All Packages Class Hierarchy This Package Previous Next Index
Class prolog.Compound
java.lang.Object
|
+----prolog.Term
|
+----prolog.Compound
- public class Compound
- extends Term
- implements Cloneable
Represents Compound terms (of the form functor(arg1, arg2,
... )).
-
args
-
-
arity
-
-
copied
- Indicates that this Compound doesn't need to be copied
(true, e.g.
-
fa
- A unique value that represents this functor/arity
combination.
-
functor
-
-
functor_arity
-
-
Compound(FunctorArity)
- Creates a Compound with given functor and zero arity.
-
Compound(FunctorArity, Term[])
- Creates a Compound with given functor and arguments.
-
Compound(String)
- Creates a Compound with given functor and zero arity.
-
Compound(String, Term[])
- Creates a Compound with given functor and arguments.
-
displayString()
- Returns a displayable version of this object, for use by
write/1.
-
identical(Term)
- Asserts that this Term is identical to that.
-
instantiate(Term[])
- Copies this term, instantiating variables from the
insts
array.
-
instantiateHead(Term[])
- Don't bother checking the functor.
-
isIs()
- Is this goal an is/2 invocation?
-
isUnify()
- Is this Compound term (thought of as a predicate) a
unification?
-
map_functor_arity(String, int)
-
-
normalise_copy(Variable[], int, Vector)
- Copy a Term, instantiating variables from the array.
-
squash(Hashtable)
- Squash all bound variables (to their bindings) and substitute
Variables for Bindings.
-
toString()
- Returns a representation of this object that may be used for
debugging or database listings, etc.
-
typify(TypeDictionary, boolean)
- Generate the type tree that describes this Term.
-
unify(Term, Term[], Prolog)
- Unifies this term with the argument.
-
unify_args(Term[], Term[], Prolog)
- Unifies this Compound term against a list of arguments,
assuming that the functor and arity match.
fa
public FunctorArity fa
- A unique value that represents this functor/arity
combination.
functor_arity
public int functor_arity
functor
public String functor
arity
public int arity
args
public Term args[]
copied
boolean copied
- Indicates that this Compound doesn't need to be copied
(true, e.g. if this is a ground term, or all
Variables have been replaced with Bindings, or
arity == 0), or that it might need to be (false).
Compound
public Compound(String functor,
Term arglist[])
- Creates a Compound with given functor and arguments.
- Parameters:
- f - the functor of the Term
- arglist - an array of arguments
Compound
public Compound(String functor)
- Creates a Compound with given functor and zero arity. Used
by facts and strings.
- Parameters:
- f - the functor of the Term
Compound
public Compound(FunctorArity fa,
Term args[])
- Creates a Compound with given functor and arguments.
- Parameters:
- f - the functor of the Term
- arglist - an array of arguments
- See Also:
- compound_create
Compound
public Compound(FunctorArity fa)
- Creates a Compound with given functor and zero arity. Used
by facts and strings.
- Parameters:
- f - the functor of the Term
instantiateHead
public Term[] instantiateHead(Term insts[])
- Don't bother checking the functor.
instantiate
public Term instantiate(Term insts[])
- Copies this term, instantiating variables from the
insts
array.
- Overrides:
- instantiate in class Term
unify_args
public boolean unify_args(Term bs[],
Term insts[],
Prolog p)
- Unifies this Compound term against a list of arguments,
assuming that the functor and arity match.
- See Also:
- unify
unify
public boolean unify(Term t,
Term insts[],
Prolog p)
- Unifies this term with the argument.
- Overrides:
- unify in class Term
identical
public boolean identical(Term t)
- Asserts that this Term is identical to that.
- Overrides:
- identical in class Term
squash
protected Compound squash(Hashtable vars)
- Squash all bound variables (to their bindings) and substitute
Variables for Bindings. Used by the
assert/1s so that the database only contains ground terms
and unbound variables. This isn't pretty.
- See Also:
- asserta_1, assertz_1
normalise_copy
public Term normalise_copy(Variable vars[],
int next_new_var,
Vector new_vars)
- Copy a Term, instantiating variables from the array.
- Overrides:
- normalise_copy in class Term
typify
public void typify(TypeDictionary types,
boolean map)
- Generate the type tree that describes this Term.
- Overrides:
- typify in class Term
isUnify
boolean isUnify()
- Is this Compound term (thought of as a predicate) a
unification?
isIs
boolean isIs()
- Is this goal an is/2 invocation?
displayString
public String displayString()
- Returns a displayable version of this object, for use by
write/1.
- Overrides:
- displayString in class Term
toString
public String toString()
- Returns a representation of this object that may be used for
debugging or database listings, etc.
- Overrides:
- toString in class Term
map_functor_arity
public static synchronized FunctorArity map_functor_arity(String functor,
int arity)
All Packages Class Hierarchy This Package Previous Next Index