Term class

A compound Prolog term consisting of a functor name and argument arguments.

When arguments is empty, represents an atomic term.

For example:

final term = Term.parse('father(john, mary)');
print(term.name); // 'father'
print(term.arguments); // [john, mary]
Inheritance
Implementers
Annotations
  • @immutable

Constructors

Term(String name, Iterable<Node> list)
Creates a compound term with name and list of arguments.
factory
Term.parse(String rules)
Parses a string into a Term.
factory

Properties

arguments → List<Node>
The argument nodes of the compound term.
final
hashCode → int
The hash code for this object.
no setteroverride
name → String
The functor name of the term.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

match(Node other) → Map<Variable, Node>?
Attempts to unify this node with other, returning variable bindings or null.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(Database database) → Iterable<Node>
Evaluates this term as a goal against database.
substitute(Map<Variable, Node>? bindings) → Term
Substitutes variables in this node with their bound values in bindings.
override
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override