All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class prolog.Clause

java.lang.Object
   |
   +----prolog.Clause

public class Clause
extends Object
implements Cloneable, Serializable
Represents a clause, which consist of a head (a Compound Term) and, optionally, a body (a GoalList).


Variable Index

 o body
 o head
 o numVars
Number of vars in this clause.
 o parsed
The parsed version of this clause.

Constructor Index

 o Clause(Compound, Goal, Compound, int)
Creates a new Clause.
 o Clause(Compound, Prolog)
Creates a new Clause, converting a parsed clause of either of the forms: Head. or ':-'(Head, Body) into the internal representation.

Method Index

 o normalise(TypeDictionary)
Normalises this clause into the format specified in andrewt's doctoral thesis (more or less).
 o toString()

Variables

 o head
 public Compound head
 o body
 public Goal body
 o parsed
 public Compound parsed
The parsed version of this clause.

 o numVars
 public int numVars
Number of vars in this clause.

Constructors

 o Clause
 public Clause(Compound parsed,
               Prolog p)
Creates a new Clause, converting a parsed clause of either of the forms: Head. or ':-'(Head, Body) into the internal representation.

Parameters:
parsed - the parsed form of this clause.
 o Clause
 public Clause(Compound head,
               Goal body,
               Compound parsed,
               int numVars)
Creates a new Clause.

Parameters:
head - the head of this clause.
body - the body of this clause.
parsed - the parsed form of this clause: ':-'(Head, Body).
numVars - the number of variables in this clause.

Methods

 o normalise
 Clause normalise(TypeDictionary types)
Normalises this clause into the format specified in andrewt's doctoral thesis (more or less). This makes it easier to compile as unifications are tightly restricted in form.

Note we don't typeify() the top-level arguments - so if head_args[i].ti == null, arg i isn't used.

See Also:
compileClauses, normalise
 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index