Rule class final

A Prolog Horn clause consisting of a head term and a body goal.

Unconditional facts are represented with a body of True.

For example:

final rule = Rule(
  Term('mortal', [Variable('X')]),
  Term('human', [Variable('X')]),
);
Annotations
  • @immutable

Constructors

Rule(Term head, Term body)
Creates a rule with the specified head and body.
const

Properties

body → Term
The body term or conjunction to satisfy.
final
hashCode → int
The hash code for this object.
no setterinherited
The head term of the clause.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(Database database, Term goal) → Iterable<Node>
Evaluates this rule against database to satisfy goal.
toString() → String
A string representation of this object.
override

Operators

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