package
2.0.1
Repository: https://github.com/axone-protocol/prolog.git
Documentation: pkg.go.dev

# Functions

Abolish removes the procedure indicated by pi from the database.
AcyclicTerm checks if t is acyclic.
Append succeeds iff zs is the concatenation of lists xs and ys.
Arg extracts nth argument of term as arg, or finds the argument position of arg in term as nth.
Asserta prepends t to the database.
Assertz appends t to the database.
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.
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.
AtomConcat concatenates atom1 and atom2 and unifies it with atom3.
AtomLength counts the runes in atom and unifies the result with length.
BagOf collects all the solutions of goal as instances, which unify with template.
Between succeeds when lower, upper, and value are all integers, and lower <= value <= upper.
Bool returns a promise that simply returns (ok, nil).
Call executes goal.
Call1 succeeds if closure with an additional argument succeeds.
Call2 succeeds if closure with 2 additional arguments succeeds.
Call3 succeeds if closure with 3 additional arguments succeeds.
Call4 succeeds if closure with 4 additional arguments succeeds.
Call5 succeeds if closure with 5 additional arguments succeeds.
Call6 succeeds if closure with 6 additional arguments succeeds.
Call7 succeeds if closure with 7 additional arguments succeeds.
CallNth succeeds iff goal succeeds and nth unifies with the number of re-execution.
Catch calls goal.
CharCode converts a single-rune Atom char to an Integer code, or vice versa.
CharConversion registers a character conversion from inChar to outChar, or remove the conversion if inChar = outChar.
CharList returns a character list.
Clause unifies head and body with H and B respectively where H :- B is in the database.
Close closes a stream specified by streamOrAlias.
CodeList returns a character code list.
Compare compares term1 and term2 and unifies order with <, =, or >.
CompareAtomic compares a custom atomic term of type T with a Term and returns -1, 0, or 1.
CompareCompound compares the Compound with a Term.
CompositeHook returns a hook function that chains multiple hooks together.
Cons returns a list consists of a first element car and the rest cdr.
Consult executes Prolog texts in files.
CopyTerm clones in as out.
CurrentCharConversion succeeds iff a conversion from inChar to outChar is defined.
CurrentInput unifies stream with the current input stream.
CurrentOp succeeds if operator is defined with priority and specifier.
CurrentOutput unifies stream with the current output stream.
CurrentPredicate matches pi with a predicate indicator of the user-defined procedures in the database.
CurrentPrologFlag succeeds iff flag is set to value.
DebugHookFn is a function that returns a hook function that prints the executed instruction.
Delay delays an execution of k.
DelaySeq delays an execution of a sequence of promises.
DomainError creates a new domain error exception.
Equal succeeds iff e1 equals to e2.
Error returns a promise that simply returns (false, err).
EvaluationError creates a new evaluation error exception.
ExistenceError creates a new existence error exception.
ExpandTerm transforms term1 according to term_expansion/2 and DCG rules then unifies with term2.
Failure is a continuation that leads to false.
FindAll collects all the solutions of goal as instances, which unify with template.
FlushOutput sends any buffered output to the stream.
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.
GetByte reads a byte from the stream represented by streamOrAlias and unifies it with inByte.
GetChar reads a character from the stream represented by streamOrAlias and unifies it with char.
GetDict3 return the value associated with keyPath.
GreaterThan succeeds iff e1 is greater than e2.
GreaterThanOrEqual succeeds iff e1 is greater than or equal to e2.
Halt exits the process with exit code of n.
InstantiationError returns an instantiation error exception.
Is evaluates expression and unifies the result with result.
KeySort succeeds if sorted is a sorted list of pairs based on their keys.
Length succeeds iff list is a list of length.
LessThan succeeds iff e1 is less than e2.
LessThanOrEqual succeeds iff e1 is less than or equal to e2.
List returns a list of ts.
Negate calls goal and returns false if it succeeds.
NewAtom interns the given string and returns an Atom.
No description provided by the author
NewDict creates a new dictionary (Dict) from the provided arguments (args).
NewEnv creates an empty environment.
NewException creates an Exception from a copy of the given Term.
No description provided by the author
No description provided by the author
NewInputBinaryStream creates a new input binary stream backed by the given io.Reader.
NewInputTextStream creates a new input text stream backed by the given io.Reader.
NewOutputBinaryStream creates a new output binary stream backed by the given io.Writer.
NewOutputTextStream creates a new output text stream backed by the given io.Writer.
NewParser creates a new parser from the current VM and io.RuneReader.
NewVariable creates a new anonymous variable.
NotEqual succeeds iff e1 doesn't equal to e2.
Nth0 succeeds if elem is the n-th element of list, counting from 0.
Nth1 succeeds if elem is the n-th element of list, counting from 1.
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.
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.
Op defines operator with priority and specifier, or removes when priority is 0.
Op3 primarily evaluates "./2" terms within Dict expressions.
Open opens SourceSink in mode and unifies with stream.
PartialList returns a list of ts followed by tail.
PeekByte peeks a byte from the stream represented by streamOrAlias and unifies it with inByte.
PeekChar peeks a rune from the stream represented by streamOrAlias and unifies it with char.
PermissionError creates a new permission error exception.
Phrase succeeds if the difference list of s0-s satisfies the grammar rule of grBody.
PutByte outputs an integer byte to a stream represented by streamOrAlias.
PutChar outputs char to the stream represented by streamOrAlias.
PutDict3 evaluates to a new dict where the key-values in dictIn replace or extend the key-values in the original dict.
ReadTerm reads from the stream represented by streamOrAlias and unifies with stream.
Repeat repeats the continuation until it succeeds.
RepresentationError creates a new representation error exception.
ResourceError creates a new resource error exception.
Retract removes the first clause that matches with t.
SetInput sets streamOrAlias as the current input stream.
SetOf collects all the solutions of goal as instances, which unify with template.
SetOutput sets streamOrAlias as the current output stream.
SetPrologFlag sets flag to value.
SetStreamPosition sets the position property of the stream represented by streamOrAlias.
SkipMaxList iterates over list up to max elements and unifies the number of skipped elements with skip and the rest with suffix.
Sort succeeds if sorted list of elements of list unifies with sorted.
StreamProperty succeeds iff the stream represented by stream has the stream property.
SubAtom unifies subAtom with a sub atom of length which appears with before runes preceding it and after runes following it.
SubsumesTerm succeeds if general and specific are unifiable without binding variables in specific.
Succ succeeds if s is the successor of non-negative integer x.
Success is a continuation that leads to true.
SyntaxError creates a new syntax error exception.
TermVariables succeeds if vars unifies with a list of variables in term.
Throw throws ball as an exception.
TypeAtom checks if t is an atom.
TypeCompound checks if t is a compound term.
TypeError creates a new type error exception.
TypeFloat checks if t is a floating-point number.
TypeInteger checks if t is an integer.
TypeVar checks if t is a variable.
Unify unifies x and y without occurs check (i.e., X = f(X) is allowed).
UnifyWithOccursCheck unifies x and y with occurs check (i.e., X = f(X) is not allowed).
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.
WriteCompound outputs the Compound to an io.Writer.
WriteTerm outputs term to stream with options.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

Env is a mapping from variables to terms.
Exception is an error represented by a prolog term.
Float is a prolog "falsy" floating-point number.
Lexer turns runes into tokens.
ListIterator is an iterator for a list.
ParsedVariable is a set of information regarding a variable in a parsed term.
Parser turns bytes into Term.
Promise is a delayed execution that results in (bool, error).
Stream is a prolog stream.
Token is a smallest meaningful unit of prolog program.
VM is the core of a Prolog interpreter.
WriteOptions specify how the Term writes itself.

# Interfaces

Compound is a Prolog compound.
Dict is a term that represents a dictionary.
Number is a prolog number, either Integer or Float.
Term is a prolog term.

# Type aliases

Atom is a prolog atom.
Cont is a continuation.
HookFunc is a type for a hook function that is triggered before the VM executes a specific instruction.
Integer is a prolog integer.
NextFunc defines the type of a function that returns the next PromiseFunc in a sequence, along with a boolean indicating whether the returned value is valid.
No description provided by the author
Predicate0 is a predicate of arity 0.
Predicate1 is a predicate of arity 1.
Predicate2 is a predicate of arity 2.
Predicate3 is a predicate of arity 3.
Predicate4 is a predicate of arity 4.
Predicate5 is a predicate of arity 5.
Predicate6 is a predicate of arity 6.
Predicate7 is a predicate of arity 7.
Predicate8 is a predicate of arity 8.
PromiseFunc defines the type of a function that returns a promise.
Variable is a prolog variable.