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, ... )).


Variable Index

 o args
 o arity
 o copied
Indicates that this Compound doesn't need to be copied (true, e.g.
 o fa
A unique value that represents this functor/arity combination.
 o functor
 o functor_arity

Constructor Index

 o Compound(FunctorArity)
Creates a Compound with given functor and zero arity.
 o Compound(FunctorArity, Term[])
Creates a Compound with given functor and arguments.
 o Compound(String)
Creates a Compound with given functor and zero arity.
 o Compound(String, Term[])
Creates a Compound with given functor and arguments.

Method Index

 o displayString()
Returns a displayable version of this object, for use by write/1.
 o identical(Term)
Asserts that this Term is identical to that.
 o instantiate(Term[])
Copies this term, instantiating variables from the insts array.
 o instantiateHead(Term[])
Don't bother checking the functor.
 o isIs()
Is this goal an is/2 invocation?
 o isUnify()
Is this Compound term (thought of as a predicate) a unification?
 o map_functor_arity(String, int)
 o normalise_copy(Variable[], int, Vector)
Copy a Term, instantiating variables from the array.
 o squash(Hashtable)
Squash all bound variables (to their bindings) and substitute Variables for Bindings.
 o toString()
Returns a representation of this object that may be used for debugging or database listings, etc.
 o typify(TypeDictionary, boolean)
Generate the type tree that describes this Term.
 o unify(Term, Term[], Prolog)
Unifies this term with the argument.
 o unify_args(Term[], Term[], Prolog)
Unifies this Compound term against a list of arguments, assuming that the functor and arity match.

Variables

 o fa
 public FunctorArity fa
A unique value that represents this functor/arity combination.

 o functor_arity
 public int functor_arity
 o functor
 public String functor
 o arity
 public int arity
 o args
 public Term args[]
 o 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).

Constructors

 o 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
 o 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
 o 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
 o 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

Methods

 o instantiateHead
 public Term[] instantiateHead(Term insts[])
Don't bother checking the functor.

 o instantiate
 public Term instantiate(Term insts[])
Copies this term, instantiating variables from the insts array.

Overrides:
instantiate in class Term
 o 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
 o unify
 public boolean unify(Term t,
                      Term insts[],
                      Prolog p)
Unifies this term with the argument.

Overrides:
unify in class Term
 o identical
 public boolean identical(Term t)
Asserts that this Term is identical to that.

Overrides:
identical in class Term
 o 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
 o 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
 o typify
 public void typify(TypeDictionary types,
                    boolean map)
Generate the type tree that describes this Term.

Overrides:
typify in class Term
 o isUnify
 boolean isUnify()
Is this Compound term (thought of as a predicate) a unification?

 o isIs
 boolean isIs()
Is this goal an is/2 invocation?

 o displayString
 public String displayString()
Returns a displayable version of this object, for use by write/1.

Overrides:
displayString in class Term
 o 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
 o map_functor_arity
 public static synchronized FunctorArity map_functor_arity(String functor,
                                                           int arity)

All Packages  Class Hierarchy  This Package  Previous  Next  Index