|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectubc.cs.JLog.Foundation.jType
ubc.cs.JLog.Terms.jTerm
ubc.cs.JLog.Terms.jCompoundTerm
ubc.cs.JLog.Terms.jPredicateTerms
public class jPredicateTerms
This class represents a collection of predicates.
Field Summary |
---|
Fields inherited from class ubc.cs.JLog.Terms.jCompoundTerm |
---|
terms |
Fields inherited from class ubc.cs.JLog.Foundation.jType |
---|
type |
Fields inherited from interface ubc.cs.JLog.Terms.iTerm |
---|
EQUAL, GREATER_THAN, LESS_THAN |
Fields inherited from interface ubc.cs.JLog.Foundation.iType |
---|
TYPE_ARITHMETIC, TYPE_ATOM, TYPE_BUILTINPREDICATE, TYPE_COMMAND, TYPE_COMPARE, TYPE_COMPOUND, TYPE_CONS, TYPE_IF, TYPE_INTEGER, TYPE_LIST, TYPE_NULLLIST, TYPE_NUMERICCOMPARE, TYPE_OBJECT, TYPE_OPERATOR, TYPE_OR, TYPE_ORPREDICATE, TYPE_PREDICATE, TYPE_PREDICATETERMS, TYPE_REAL, TYPE_TYPE, TYPE_UNARYARITHMETIC, TYPE_UNARYOPERATOR, TYPE_UNDEFINED, TYPE_VARIABLE |
Constructor Summary | |
---|---|
|
jPredicateTerms()
|
protected |
jPredicateTerms(java.util.Vector t)
|
Method Summary | |
---|---|
void |
addGoals(jGoal g,
iGoalStack goals)
|
void |
addGoals(jGoal g,
jVariable[] vars,
iGoalStack goals)
|
void |
addPredicate(iPredicate p)
|
void |
addTerm(jTerm t)
|
jTerm |
copy(jVariableRegistry vars)
Internal member function which creates a copy of this term. |
jTerm |
duplicate(jVariable[] vars)
Creates a complete and entirely independant duplicate of this term. |
protected java.lang.String |
getEndingSymbol()
|
protected java.lang.String |
getStartingSymbol()
|
void |
make(jTerm t)
Makes this a representation of the provided jTerm , which may include
conjunction and disjunction operators. |
protected void |
makeConsPredicateTerms(jTerm term)
Add jCons separated jTerm s to this
jPredicateTerms instance. |
protected void |
makeOrPredicateTerms(jOrPredicate orpred,
jTerm term)
Add jOr separated jTerm s to the provided
jOrPredicate . |
void |
makePredicateTerms(jTerm t)
Add jCons and jOr separated jTerm s
to this jPredicateTerms . |
void |
removePredicate(iPredicate p)
|
void |
removeTerm(jTerm t)
|
jTerm |
unmake()
Creates a jCons and/or jOr separated jTerm s
to represent this jPredicateTerms . |
jTerm |
unmakePredicateTerms()
Creates a jCons and/or jOr separated jTerm s
to represent this jPredicateTerms . |
Methods inherited from class ubc.cs.JLog.Terms.jCompoundTerm |
---|
compare, consult, consultReset, copyCompoundTerm, elementAt, enumerateVariables, enumTerms, equivalence, hasTerm, internal_copy, internal_duplicate, intersectionCompoundTerm, isEmpty, isHigherPriorityOperator, makeCompoundTerm, mutateElementAt, registerUnboundVariables, registerVariables, removeAllTerms, requiresCompleteVariableState, size, subtractCompoundTerm, toString, unify, unionCompoundTerm, unmakeCompoundTerm |
Methods inherited from class ubc.cs.JLog.Terms.jTerm |
---|
compare, copy, getName, getTerm, getValue, isConsultNeeded, toString |
Methods inherited from class ubc.cs.JLog.Foundation.jType |
---|
getType, objectToString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public jPredicateTerms()
protected jPredicateTerms(java.util.Vector t)
Method Detail |
---|
public void addTerm(jTerm t)
addTerm
in class jCompoundTerm
public void removeTerm(jTerm t)
removeTerm
in class jCompoundTerm
public void addPredicate(iPredicate p)
public void removePredicate(iPredicate p)
public jTerm duplicate(jVariable[] vars)
jTerm
registerVariables
has already been
invoked.
Within duplicate
, any other calls to duplicate should pass along
the same vars
array produced by registerVariables
since the same duplication path previously taken by registerVariables
should be taken by duplicate
. This call is designed only for terms
which belong to rules and are templates for instantiation. Any variables in the
term should be unbound. As implied by the modification restrictions on
registerVariables
, terms and their children cannot change
(especially during call!)
duplicate
in interface iTerm
duplicate
in class jCompoundTerm
vars
- The user passes in a duplicate of the variable vector produced
from the previous call to registerVariables
.
vars
is produced from the
jVariableVector
by creating a single duplicate
variable for each variable. Since this is created in the same
order as the registerVariables
, it is now
efficient for jVariables
to return their
unique duplicate.
jTerm
which is an instantiated duplicate of this
term.public jTerm copy(jVariableRegistry vars)
jTerm
duplicate
function. Should only be invoked by copy()
or other copy(vars)
. Should only invoke other
copy(vars)
functions.
Bound variables should return a copy of the bound term.
copy
in interface iTerm
copy
in class jCompoundTerm
vars
- The registry of variables and their duplicates. Initially this
is empty. As variables generate copies, they add themselves
and their copy to the jVariableRegistry
, and this
is output from the function call. Any further calls with the
same vars
ensures that the same variable
(in a different term) returns the same copy.
jTerm
which is an instantiated copy of this
term.public void addGoals(jGoal g, jVariable[] vars, iGoalStack goals)
public void addGoals(jGoal g, iGoalStack goals)
protected java.lang.String getStartingSymbol()
getStartingSymbol
in class jCompoundTerm
protected java.lang.String getEndingSymbol()
getEndingSymbol
in class jCompoundTerm
public void make(jTerm t)
jTerm
, which may include
conjunction and disjunction operators. Invokes makePredicateTerms
.
make
in interface iMakeUnmake
make
in class jCompoundTerm
t
- jTerm
using jCons
to separate
terms.public void makePredicateTerms(jTerm t)
jCons
and jOr
separated jTerm
s
to this jPredicateTerms
.
t
- jTerm
using jCons
and/or
jOr
to separate terms.protected void makeOrPredicateTerms(jOrPredicate orpred, jTerm term)
jOr
separated jTerm
s to the provided
jOrPredicate
.
orpred
- The jOrPredicate
to add the jOr
separated jTerm
s to.term
- jTerm
using jOr
to separate terms.protected void makeConsPredicateTerms(jTerm term)
jCons
separated jTerm
s to this
jPredicateTerms
instance.
term
- jTerm
using jOr
to separate terms.public jTerm unmake()
jCons
and/or jOr
separated jTerm
s
to represent this jPredicateTerms
. Invokes
unmakePredicateTerms
to perform work.
unmake
in interface iMakeUnmake
unmake
in class jCompoundTerm
jTerm
using jCons
and jOr
to separate terms. Duplicates this jPredicateTerms
.public jTerm unmakePredicateTerms()
jCons
and/or jOr
separated jTerm
s
to represent this jPredicateTerms
.
jTerm
using jCons
and jOr
to separate terms. Duplicates this jPredicateTerms
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |