Documentation ¶
Index ¶
- Variables
- func Compare(a, b Interface) int64
- func Contains(t, s Interface, env *Env) bool
- type Atom
- type Binding
- type Compound
- type Env
- type EofAction
- type Float
- type Integer
- type Interface
- type Operator
- type Operators
- type Parser
- type Stream
- type StreamMode
- type StreamType
- type Variable
- type VariableWithCount
- type WriteTermOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultWriteTermOptions = WriteTermOptions{ Quoted: true, Ops: Operators{ {Priority: 400, Specifier: "yfx", Name: "/"}, }, NumberVars: false, }
View Source
var ErrNotANumber = errors.New("not a number")
Functions ¶
Types ¶
type Atom ¶
type Atom string
Atom is a prolog atom.
type Compound ¶
Compound is a prolog compound.
type Env ¶
type Env []Binding
Env is an environment stack.
func (Env) FreeVariables ¶
FreeVariables extracts variables in the given terms.
type Float ¶
type Float float64
Float is a prolog floating-point number.
type Integer ¶
type Integer int64
Integer is a prolog integer.
type Interface ¶
type Interface interface { fmt.Stringer WriteTerm(io.Writer, WriteTermOptions, Env) error Unify(Interface, bool, *Env) bool }
Interface is a prolog term.
type Operator ¶
type Operator struct { Priority Integer // 1 ~ 1200 Specifier Atom // xf, yf, xfx, xfy, yfx, fx, or fy Name Atom }
Operator is an operator definition.
type Operators ¶
type Operators []Operator
Operators are a list of operators sorted in a descending order of precedence.
type Parser ¶
type Parser struct { Vars []VariableWithCount // contains filtered or unexported fields }
Parser turns bytes into Interface.
type Stream ¶
type Stream struct { Source io.Reader Sink io.Writer Closer io.Closer Mode StreamMode Alias Atom EofAction EofAction Reposition bool StreamType StreamType }
Stream is a prolog stream.
type StreamMode ¶
type StreamMode int
const ( StreamModeRead StreamMode = iota StreamModeWrite StreamModeAppend )
type Variable ¶
type Variable string
Variable is a prolog variable.
func NewVariable ¶
func NewVariable() Variable
type VariableWithCount ¶
Click to show internal directories.
Click to hide internal directories.