engine

package
v0.0.0-...-4b5a100 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	NotExists  bool        //negation of existential quantification
	ObjectId   interface{} //string or Variable
	Attribute  string
	Comparator Operator
	Value      interface{}
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func (*Engine) Assert

func (engine *Engine) Assert(fct Fact) (err error)

func (*Engine) Define

func (engine *Engine) Define(r Rule) (err error)

func (Engine) GetInferences

func (engine Engine) GetInferences(objectId string, attribute string) ([]Fact, error)

func (*Engine) Retract

func (engine *Engine) Retract(fct Fact) (err error)

type Fact

type Fact struct {
	ObjectId  string
	Attribute string
	Value     interface{} //scalars only (in this version)
}

func (Fact) String

func (fact Fact) String() string

type Inference

type Inference struct {
	ObjectId  interface{} //string or Variable
	Attribute string
	Value     interface{}
}

type Operator

type Operator int
const (
	EQ Operator = iota
	GE
	GT
	LE
	LT
	NE //not equal to
)

func (Operator) String

func (op Operator) String() string

type Rule

type Rule struct {
	Id  string
	LHS []Condition
	RHS []Inference
}

type Variable

type Variable string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL