Documentation ¶
Index ¶
- func CompareAtomic[T Term](a T, t Term, cmp func(T, T) int, env *Env) int
- func CompareCompound(c Compound, t Term, env *Env) int
- func WriteCompound(w io.Writer, c Compound, opts *WriteOptions, env *Env) error
- type Atom
- type Compound
- type Cont
- type Env
- type Exception
- func DomainError(domain, culprit Term, env *Env) Exception
- func EvaluationError(error Term, env *Env) Exception
- func ExistenceError(objectType, culprit Term, env *Env) Exception
- func InstantiationError(env *Env) Exception
- func NewException(term Term, env *Env) Exception
- func PermissionError(operation, permissionType, culprit Term, env *Env) Exception
- func RepresentationError(limit Term, env *Env) Exception
- func ResourceError(resource Term, env *Env) Exception
- func SyntaxError(error Term, env *Env) Exception
- func TypeError(typ, culprit Term, env *Env) Exception
- type Float
- type Integer
- type Lexer
- type ListIterator
- type Number
- type ParsedVariable
- type Parser
- type Predicate0
- type Predicate1
- type Predicate2
- type Predicate3
- type Predicate4
- type Predicate5
- type Predicate6
- type Predicate7
- type Predicate8
- type Promise
- func Abolish(vm *VM, pi Term, k Cont, env *Env) *Promise
- func AcyclicTerm(_ *VM, t Term, k Cont, env *Env) *Promise
- func Append(vm *VM, xs, ys, zs Term, k Cont, env *Env) *Promise
- func Arg(vm *VM, nth, t, arg Term, k Cont, env *Env) *Promise
- func Asserta(vm *VM, t Term, k Cont, env *Env) *Promise
- func Assertz(vm *VM, t Term, k Cont, env *Env) *Promise
- func AtomChars(vm *VM, atom, chars Term, k Cont, env *Env) *Promise
- func AtomCodes(vm *VM, atom, codes Term, k Cont, env *Env) *Promise
- func AtomConcat(vm *VM, atom1, atom2, atom3 Term, k Cont, env *Env) *Promise
- func AtomLength(vm *VM, atom, length Term, k Cont, env *Env) *Promise
- func BagOf(vm *VM, template, goal, instances Term, k Cont, env *Env) *Promise
- func Between(vm *VM, lower, upper, value Term, k Cont, env *Env) *Promise
- func Bool(ok bool) *Promise
- func Call(vm *VM, goal Term, k Cont, env *Env) (promise *Promise)
- func Call1(vm *VM, closure, arg1 Term, k Cont, env *Env) *Promise
- func Call2(vm *VM, closure, arg1, arg2 Term, k Cont, env *Env) *Promise
- func Call3(vm *VM, closure, arg1, arg2, arg3 Term, k Cont, env *Env) *Promise
- func Call4(vm *VM, closure, arg1, arg2, arg3, arg4 Term, k Cont, env *Env) *Promise
- func Call5(vm *VM, closure, arg1, arg2, arg3, arg4, arg5 Term, k Cont, env *Env) *Promise
- func Call6(vm *VM, closure, arg1, arg2, arg3, arg4, arg5, arg6 Term, k Cont, env *Env) *Promise
- func Call7(vm *VM, closure, arg1, arg2, arg3, arg4, arg5, arg6, arg7 Term, k Cont, ...) *Promise
- func CallNth(vm *VM, goal, nth Term, k Cont, env *Env) *Promise
- func Catch(vm *VM, goal, catcher, recover Term, k Cont, env *Env) *Promise
- func CharCode(vm *VM, char, code Term, k Cont, env *Env) *Promise
- func CharConversion(vm *VM, inChar, outChar Term, k Cont, env *Env) *Promise
- func Clause(vm *VM, head, body Term, k Cont, env *Env) *Promise
- func Close(vm *VM, streamOrAlias, options Term, k Cont, env *Env) *Promise
- func Compare(vm *VM, order, term1, term2 Term, k Cont, env *Env) *Promise
- func Consult(vm *VM, files Term, k Cont, env *Env) *Promise
- func CopyTerm(vm *VM, in, out Term, k Cont, env *Env) *Promise
- func CurrentCharConversion(vm *VM, inChar, outChar Term, k Cont, env *Env) *Promise
- func CurrentInput(vm *VM, stream Term, k Cont, env *Env) *Promise
- func CurrentOp(vm *VM, priority, specifier, op Term, k Cont, env *Env) *Promise
- func CurrentOutput(vm *VM, stream Term, k Cont, env *Env) *Promise
- func CurrentPredicate(vm *VM, pi Term, k Cont, env *Env) *Promise
- func CurrentPrologFlag(vm *VM, flag, value Term, k Cont, env *Env) *Promise
- func Delay(k ...func(context.Context) *Promise) *Promise
- func Equal(_ *VM, e1, e2 Term, k Cont, env *Env) *Promise
- func Error(err error) *Promise
- func ExpandTerm(vm *VM, term1, term2 Term, k Cont, env *Env) *Promise
- func Failure(*Env) *Promise
- func FindAll(vm *VM, template, goal, instances Term, k Cont, env *Env) *Promise
- func FlushOutput(vm *VM, streamOrAlias Term, k Cont, env *Env) *Promise
- func Functor(vm *VM, t, name, arity Term, k Cont, env *Env) *Promise
- func GetByte(vm *VM, streamOrAlias, inByte Term, k Cont, env *Env) *Promise
- func GetChar(vm *VM, streamOrAlias, char Term, k Cont, env *Env) *Promise
- func GreaterThan(_ *VM, e1, e2 Term, k Cont, env *Env) *Promise
- func GreaterThanOrEqual(_ *VM, e1, e2 Term, k Cont, env *Env) *Promise
- func Halt(_ *VM, n Term, k Cont, env *Env) *Promise
- func Is(vm *VM, result, expression Term, k Cont, env *Env) *Promise
- func KeySort(vm *VM, pairs, sorted Term, k Cont, env *Env) *Promise
- func Length(vm *VM, list, length Term, k Cont, env *Env) *Promise
- func LessThan(_ *VM, e1, e2 Term, k Cont, env *Env) *Promise
- func LessThanOrEqual(_ *VM, e1, e2 Term, k Cont, env *Env) *Promise
- func Negate(vm *VM, goal Term, k Cont, env *Env) *Promise
- func NotEqual(_ *VM, e1, e2 Term, k Cont, env *Env) *Promise
- func Nth0(vm *VM, n, list, elem Term, k Cont, env *Env) *Promise
- func Nth1(vm *VM, n, list, elem Term, k Cont, env *Env) *Promise
- func NumberChars(vm *VM, num, chars Term, k Cont, env *Env) *Promise
- func NumberCodes(vm *VM, num, codes Term, k Cont, env *Env) *Promise
- func Op(vm *VM, priority, specifier, op Term, k Cont, env *Env) *Promise
- func Open(vm *VM, sourceSink, mode, stream, options Term, k Cont, env *Env) *Promise
- func PeekByte(vm *VM, streamOrAlias, inByte Term, k Cont, env *Env) *Promise
- func PeekChar(vm *VM, streamOrAlias, char Term, k Cont, env *Env) *Promise
- func Phrase(vm *VM, grBody, s0, s Term, k Cont, env *Env) *Promise
- func PutByte(vm *VM, streamOrAlias, byt Term, k Cont, env *Env) *Promise
- func PutChar(vm *VM, streamOrAlias, char Term, k Cont, env *Env) *Promise
- func ReadTerm(vm *VM, streamOrAlias, out, options Term, k Cont, env *Env) *Promise
- func Repeat(_ *VM, k Cont, env *Env) *Promise
- func Retract(vm *VM, t Term, k Cont, env *Env) *Promise
- func SetInput(vm *VM, streamOrAlias Term, k Cont, env *Env) *Promise
- func SetOf(vm *VM, template, goal, instances Term, k Cont, env *Env) *Promise
- func SetOutput(vm *VM, streamOrAlias Term, k Cont, env *Env) *Promise
- func SetPrologFlag(vm *VM, flag, value Term, k Cont, env *Env) *Promise
- func SetStreamPosition(vm *VM, streamOrAlias, position Term, k Cont, env *Env) *Promise
- func SkipMaxList(vm *VM, skip, max, list, suffix Term, k Cont, env *Env) *Promise
- func Sort(vm *VM, list, sorted Term, k Cont, env *Env) *Promise
- func StreamProperty(vm *VM, stream, property Term, k Cont, env *Env) *Promise
- func SubAtom(vm *VM, atom, before, length, after, subAtom Term, k Cont, env *Env) *Promise
- func SubsumesTerm(_ *VM, general, specific Term, k Cont, env *Env) *Promise
- func Succ(vm *VM, x, s Term, k Cont, env *Env) *Promise
- func Success(*Env) *Promise
- func TermVariables(vm *VM, term, vars Term, k Cont, env *Env) *Promise
- func Throw(_ *VM, ball Term, _ Cont, env *Env) *Promise
- func TypeAtom(_ *VM, t Term, k Cont, env *Env) *Promise
- func TypeCompound(_ *VM, t Term, k Cont, env *Env) *Promise
- func TypeFloat(_ *VM, t Term, k Cont, env *Env) *Promise
- func TypeInteger(_ *VM, t Term, k Cont, env *Env) *Promise
- func TypeVar(_ *VM, t Term, k Cont, env *Env) *Promise
- func Unify(_ *VM, x, y Term, k Cont, env *Env) *Promise
- func UnifyWithOccursCheck(_ *VM, x, y Term, k Cont, env *Env) *Promise
- func Univ(vm *VM, t, list Term, k Cont, env *Env) *Promise
- func WriteTerm(vm *VM, streamOrAlias, t, options Term, k Cont, env *Env) *Promise
- type Stream
- func (s *Stream) Close() error
- func (s *Stream) Compare(t Term, env *Env) int
- func (s *Stream) Flush() error
- func (s *Stream) Name() string
- func (s *Stream) ReadByte() (byte, error)
- func (s *Stream) ReadRune() (r rune, size int, err error)
- func (s *Stream) Seek(offset int64, whence int) (int64, error)
- func (s *Stream) UnreadByte() error
- func (s *Stream) UnreadRune() error
- func (s *Stream) WriteByte(c byte) error
- func (s *Stream) WriteRune(r rune) (size int, err error)
- func (s *Stream) WriteTerm(w io.Writer, _ *WriteOptions, _ *Env) error
- type Term
- type Token
- type VM
- func (vm *VM) Arrive(name Atom, args []Term, k Cont, env *Env) (promise *Promise)
- func (vm *VM) Compile(ctx context.Context, s string, args ...interface{}) error
- func (vm *VM) Register0(name Atom, p Predicate0)
- func (vm *VM) Register1(name Atom, p Predicate1)
- func (vm *VM) Register2(name Atom, p Predicate2)
- func (vm *VM) Register3(name Atom, p Predicate3)
- func (vm *VM) Register4(name Atom, p Predicate4)
- func (vm *VM) Register5(name Atom, p Predicate5)
- func (vm *VM) Register6(name Atom, p Predicate6)
- func (vm *VM) Register7(name Atom, p Predicate7)
- func (vm *VM) Register8(name Atom, p Predicate8)
- func (vm *VM) SetUserInput(s *Stream)
- func (vm *VM) SetUserOutput(s *Stream)
- type Variable
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAtomic ¶ added in v0.15.2
CompareAtomic compares a custom atomic term of type T with a Term and returns -1, 0, or 1. The order is Variable < Float < Integer < Atom < custom atomic terms < Compound where different types of custom atomic terms are ordered by the Go-syntax representation of the types. It compares values of the same custom atomic term type T by the provided comparison function.
func CompareCompound ¶ added in v0.15.2
CompareCompound compares the Compound with a Term.
func WriteCompound ¶ added in v0.15.2
WriteCompound outputs the Compound to an io.Writer.
Types ¶
type Atom ¶ added in v0.4.1
type Atom uint64
Atom is a prolog atom.
func (Atom) Apply ¶ added in v0.4.1
Apply returns a Compound which Functor is the Atom and args are the arguments. If the arguments are empty, then returns itself.
type Env ¶ added in v0.4.1
type Env struct {
// contains filtered or unexported fields
}
Env is a mapping from variables to terms.
type Exception ¶
type Exception struct {
// contains filtered or unexported fields
}
Exception is an error represented by a prolog term.
func DomainError ¶ added in v0.4.0
DomainError creates a new domain error exception.
func EvaluationError ¶ added in v0.10.0
EvaluationError creates a new evaluation error exception.
func ExistenceError ¶ added in v0.4.0
ExistenceError creates a new existence error exception.
func InstantiationError ¶ added in v0.4.0
InstantiationError returns an instantiation error exception.
func NewException ¶ added in v0.10.0
NewException creates an Exception from a copy of the given Term.
func PermissionError ¶ added in v0.4.0
PermissionError creates a new permission error exception.
func RepresentationError ¶ added in v0.10.0
RepresentationError creates a new representation error exception.
func ResourceError ¶ added in v0.10.0
ResourceError creates a new resource error exception.
func SyntaxError ¶ added in v0.10.0
SyntaxError creates a new syntax error exception.
type Float ¶ added in v0.4.1
type Float float64
Float is a prolog floating-point number.
type Integer ¶ added in v0.4.1
type Integer int64
Integer is a prolog integer.
type Lexer ¶ added in v0.4.1
type Lexer struct {
// contains filtered or unexported fields
}
Lexer turns runes into tokens.
type ListIterator ¶ added in v0.9.0
type ListIterator struct { List Term Env *Env AllowPartial bool AllowCycle bool // contains filtered or unexported fields }
ListIterator is an iterator for a list.
func (*ListIterator) Current ¶ added in v0.9.0
func (i *ListIterator) Current() Term
Current returns the current element.
func (*ListIterator) Next ¶ added in v0.9.0
func (i *ListIterator) Next() bool
Next proceeds to the next element of the list and returns true if there's such an element.
func (*ListIterator) Suffix ¶ added in v0.10.0
func (i *ListIterator) Suffix() Term
Suffix returns the rest of the list.
type Number ¶ added in v0.9.0
type Number interface { Term // contains filtered or unexported methods }
Number is a prolog number, either Integer or Float.
type ParsedVariable ¶ added in v0.4.1
ParsedVariable is a set of information regarding a variable in a parsed term.
type Parser ¶ added in v0.4.1
type Parser struct { Vars []ParsedVariable // contains filtered or unexported fields }
Parser turns bytes into Term.
func NewParser ¶ added in v0.4.1
func NewParser(vm *VM, r io.RuneReader) *Parser
NewParser creates a new parser from the current VM and io.RuneReader.
func (*Parser) SetPlaceholder ¶ added in v0.14.0
SetPlaceholder registers placeholder and its arguments. Every occurrence of placeholder will be replaced by arguments. Mismatch of the number of occurrences of placeholder and the number of arguments raises an error.
type Predicate0 ¶ added in v0.14.0
Predicate0 is a predicate of arity 0.
type Predicate1 ¶ added in v0.14.0
Predicate1 is a predicate of arity 1.
type Predicate2 ¶ added in v0.14.0
Predicate2 is a predicate of arity 2.
type Predicate3 ¶ added in v0.14.0
Predicate3 is a predicate of arity 3.
type Predicate4 ¶ added in v0.14.0
Predicate4 is a predicate of arity 4.
type Predicate5 ¶ added in v0.14.0
Predicate5 is a predicate of arity 5.
type Predicate6 ¶ added in v0.14.0
Predicate6 is a predicate of arity 6.
type Predicate7 ¶ added in v0.14.0
Predicate7 is a predicate of arity 7.
type Predicate8 ¶ added in v0.14.0
Predicate8 is a predicate of arity 8.
type Promise ¶ added in v0.4.1
type Promise struct {
// contains filtered or unexported fields
}
Promise is a delayed execution that results in (bool, error). The zero value for Promise is equivalent to Bool(false).
func AcyclicTerm ¶ added in v0.9.0
AcyclicTerm checks if t is acyclic.
func Arg ¶
Arg extracts nth argument of term as arg, or finds the argument position of arg in term as nth.
func AtomChars ¶
AtomChars breaks down atom into list of characters and unifies with chars, or constructs an atom from a list of characters chars and unifies it with atom.
func AtomCodes ¶
AtomCodes breaks up atom into a list of runes and unifies it with codes, or constructs an atom from the list of runes and unifies it with atom.
func AtomConcat ¶
AtomConcat concatenates atom1 and atom2 and unifies it with atom3.
func AtomLength ¶
AtomLength counts the runes in atom and unifies the result with length.
func BagOf ¶ added in v0.14.0
BagOf collects all the solutions of goal as instances, which unify with template. instances may contain duplications.
func Between ¶ added in v0.9.0
Between succeeds when lower, upper, and value are all integers, and lower <= value <= upper. If value is a variable, it is unified with successive integers from lower to upper.
func Call ¶ added in v0.14.0
Call executes goal. it succeeds if goal followed by k succeeds. A cut inside goal doesn't affect outside of Call.
func Call7 ¶ added in v0.14.0
func Call7(vm *VM, closure, arg1, arg2, arg3, arg4, arg5, arg6, arg7 Term, k Cont, env *Env) *Promise
Call7 succeeds if closure with 7 additional arguments succeeds.
func CallNth ¶ added in v0.14.0
CallNth succeeds iff goal succeeds and nth unifies with the number of re-execution. See http://www.complang.tuwien.ac.at/ulrich/iso-prolog/call_nth
func Catch ¶ added in v0.4.1
Catch calls goal. If an exception is thrown and unifies with catcher, it calls recover.
func CharConversion ¶ added in v0.14.0
CharConversion registers a character conversion from inChar to outChar, or remove the conversion if inChar = outChar.
func Clause ¶ added in v0.14.0
Clause unifies head and body with H and B respectively where H :- B is in the database.
func CurrentCharConversion ¶ added in v0.14.0
CurrentCharConversion succeeds iff a conversion from inChar to outChar is defined.
func CurrentInput ¶ added in v0.14.0
CurrentInput unifies stream with the current input stream.
func CurrentOp ¶ added in v0.14.0
CurrentOp succeeds if operator is defined with priority and specifier.
func CurrentOutput ¶ added in v0.14.0
CurrentOutput unifies stream with the current output stream.
func CurrentPredicate ¶ added in v0.14.0
CurrentPredicate matches pi with a predicate indicator of the user-defined procedures in the database.
func CurrentPrologFlag ¶ added in v0.14.0
CurrentPrologFlag succeeds iff flag is set to value.
func ExpandTerm ¶ added in v0.14.0
ExpandTerm transforms term1 according to term_expansion/2 and DCG rules then unifies with term2.
func FindAll ¶ added in v0.14.0
FindAll collects all the solutions of goal as instances, which unify with template. instances may contain duplications.
func FlushOutput ¶ added in v0.14.0
FlushOutput sends any buffered output to the stream.
func Functor ¶
Functor extracts the name and arity of term, or unifies term with an atomic/compound term of name and arity with fresh variables as arguments.
func GetByte ¶ added in v0.14.0
GetByte reads a byte from the stream represented by streamOrAlias and unifies it with inByte.
func GetChar ¶ added in v0.14.0
GetChar reads a character from the stream represented by streamOrAlias and unifies it with char.
func GreaterThan ¶ added in v0.14.0
GreaterThan succeeds iff e1 is greater than e2.
func GreaterThanOrEqual ¶ added in v0.14.0
GreaterThanOrEqual succeeds iff e1 is greater than or equal to e2.
func KeySort ¶ added in v0.9.0
KeySort succeeds if sorted is a sorted list of pairs based on their keys.
func LessThanOrEqual ¶ added in v0.14.0
LessThanOrEqual succeeds iff e1 is less than or equal to e2.
func Negate ¶ added in v0.15.1
Negate calls goal and returns false if it succeeds. Otherwise, invokes the continuation.
func NumberChars ¶
NumberChars breaks up an atom representation of a number num into a list of characters and unifies it with chars, or constructs a number from a list of characters chars and unifies it with num.
func NumberCodes ¶
NumberCodes breaks up an atom representation of a number num into a list of runes and unifies it with codes, or constructs a number from a list of runes codes and unifies it with num.
func Op ¶ added in v0.14.0
Op defines operator with priority and specifier, or removes when priority is 0.
func PeekByte ¶ added in v0.14.0
PeekByte peeks a byte from the stream represented by streamOrAlias and unifies it with inByte.
func PeekChar ¶ added in v0.14.0
PeekChar peeks a rune from the stream represented by streamOrAlias and unifies it with char.
func Phrase ¶ added in v0.14.0
Phrase succeeds if the difference list of s0-s satisfies the grammar rule of grBody.
func PutByte ¶ added in v0.14.0
PutByte outputs an integer byte to a stream represented by streamOrAlias.
func ReadTerm ¶ added in v0.14.0
ReadTerm reads from the stream represented by streamOrAlias and unifies with stream.
func SetOf ¶ added in v0.14.0
SetOf collects all the solutions of goal as instances, which unify with template. instances don't contain duplications.
func SetPrologFlag ¶ added in v0.14.0
SetPrologFlag sets flag to value.
func SetStreamPosition ¶ added in v0.14.0
SetStreamPosition sets the position property of the stream represented by streamOrAlias.
func SkipMaxList ¶ added in v0.10.0
SkipMaxList iterates over list up to max elements and unifies the number of skipped elements with skip and the rest with suffix.
func StreamProperty ¶ added in v0.14.0
StreamProperty succeeds iff the stream represented by stream has the stream property.
func SubAtom ¶
SubAtom unifies subAtom with a sub atom of length which appears with before runes preceding it and after runes following it.
func SubsumesTerm ¶ added in v0.9.0
SubsumesTerm succeeds if general and specific are unifiable without binding variables in specific.
func TermVariables ¶ added in v0.9.0
TermVariables succeeds if vars unifies with a list of variables in term.
func TypeCompound ¶
TypeCompound checks if t is a compound term.
func TypeInteger ¶
TypeInteger checks if t is an integer.
func UnifyWithOccursCheck ¶
UnifyWithOccursCheck unifies x and y with occurs check (i.e., X = f(X) is not allowed).
func Univ ¶
Univ constructs list as a list which first element is the functor of term and the rest is the arguments of term, or construct a compound from list as term.
type Stream ¶ added in v0.4.1
type Stream struct {
// contains filtered or unexported fields
}
Stream is a prolog stream.
func NewInputBinaryStream ¶ added in v0.14.0
NewInputBinaryStream creates a new input binary stream backed by the given io.Reader.
func NewInputTextStream ¶ added in v0.14.0
NewInputTextStream creates a new input text stream backed by the given io.Reader.
func NewOutputBinaryStream ¶ added in v0.14.0
NewOutputBinaryStream creates a new output binary stream backed by the given io.Writer.
func NewOutputTextStream ¶ added in v0.14.0
NewOutputTextStream creates a new output text stream backed by the given io.Writer.
func (*Stream) Name ¶ added in v0.14.0
Name returns the stream's name. If the underlying source/sink doesn't have a name, returns "".
func (*Stream) ReadByte ¶ added in v0.14.0
ReadByte reads a byte from the underlying source. It throws an error if the stream is not an input binary stream.
func (*Stream) ReadRune ¶ added in v0.14.0
ReadRune reads the next rune from the underlying source. It throws an error if the stream is not an input text stream.
func (*Stream) UnreadByte ¶ added in v0.14.0
func (*Stream) UnreadRune ¶ added in v0.14.0
func (*Stream) WriteByte ¶ added in v0.14.0
WriteByte writes the byte c to the underlying sink. It throws an error if the stream is not an output binary stream,.
type Term ¶ added in v0.4.1
type Term interface { WriteTerm(w io.Writer, opts *WriteOptions, env *Env) error Compare(t Term, env *Env) int }
Term is a prolog term.
func PartialList ¶ added in v0.14.0
PartialList returns a list of ts followed by tail.
type Token ¶ added in v0.4.1
type Token struct {
// contains filtered or unexported fields
}
Token is a smallest meaningful unit of prolog program.
type VM ¶
type VM struct { // Unknown is a callback that is triggered when the VM reaches to an unknown predicate while current_prolog_flag(unknown, warning). Unknown func(name Atom, args []Term, env *Env) // FS is a file system that is referenced when the VM loads Prolog texts e.g. ensure_loaded/1. // It has no effect on open/4 nor open/3 which always access the actual file system. FS fs.FS // contains filtered or unexported fields }
VM is the core of a Prolog interpreter. The zero value for VM is a valid VM without any builtin predicates.
func (*VM) Compile ¶ added in v0.14.0
Compile compiles the Prolog text and updates the DB accordingly.
func (*VM) Register0 ¶
func (vm *VM) Register0(name Atom, p Predicate0)
Register0 registers a predicate of arity 0.
func (*VM) Register1 ¶
func (vm *VM) Register1(name Atom, p Predicate1)
Register1 registers a predicate of arity 1.
func (*VM) Register2 ¶
func (vm *VM) Register2(name Atom, p Predicate2)
Register2 registers a predicate of arity 2.
func (*VM) Register3 ¶
func (vm *VM) Register3(name Atom, p Predicate3)
Register3 registers a predicate of arity 3.
func (*VM) Register4 ¶
func (vm *VM) Register4(name Atom, p Predicate4)
Register4 registers a predicate of arity 4.
func (*VM) Register5 ¶
func (vm *VM) Register5(name Atom, p Predicate5)
Register5 registers a predicate of arity 5.
func (*VM) Register6 ¶ added in v0.9.0
func (vm *VM) Register6(name Atom, p Predicate6)
Register6 registers a predicate of arity 6.
func (*VM) Register7 ¶ added in v0.9.0
func (vm *VM) Register7(name Atom, p Predicate7)
Register7 registers a predicate of arity 7.
func (*VM) Register8 ¶ added in v0.9.0
func (vm *VM) Register8(name Atom, p Predicate8)
Register8 registers a predicate of arity 8.
func (*VM) SetUserInput ¶
SetUserInput sets the given stream as user_input.
func (*VM) SetUserOutput ¶
SetUserOutput sets the given stream as user_output.
type Variable ¶ added in v0.4.1
type Variable int64
Variable is a prolog variable.
func NewVariable ¶ added in v0.4.1
func NewVariable() Variable
NewVariable creates a new anonymous variable.
type WriteOptions ¶ added in v0.10.0
type WriteOptions struct {
// contains filtered or unexported fields
}
WriteOptions specify how the Term writes itself.