|
||||||||||
| 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(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 String |
getEndingSymbol()
|
protected 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 jTerms to this
jPredicateTerms instance. |
protected void |
makeOrPredicateTerms(jOrPredicate orpred,
jTerm term)
Add jOr separated jTerms to the provided
jOrPredicate. |
void |
makePredicateTerms(jTerm t)
Add jCons and jOr separated jTerms
to this jPredicateTerms. |
void |
removePredicate(iPredicate p)
|
void |
removeTerm(jTerm t)
|
jTerm |
unmake()
Creates a jCons and/or jOr separated jTerms
to represent this jPredicateTerms. |
jTerm |
unmakePredicateTerms()
Creates a jCons and/or jOr separated jTerms
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(Vector t)
| Method Detail |
|---|
public void addTerm(jTerm t)
addTerm in class jCompoundTermpublic void removeTerm(jTerm t)
removeTerm in class jCompoundTermpublic void addPredicate(iPredicate p)
public void removePredicate(iPredicate p)
public jTerm duplicate(jVariable[] vars)
jTermregisterVariables 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 iTermduplicate in class jCompoundTermvars - 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)
jTermduplicate 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 iTermcopy in class jCompoundTermvars - 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 String getStartingSymbol()
getStartingSymbol in class jCompoundTermprotected String getEndingSymbol()
getEndingSymbol in class jCompoundTermpublic void make(jTerm t)
jTerm, which may include
conjunction and disjunction operators. Invokes makePredicateTerms.
make in interface iMakeUnmakemake in class jCompoundTermt - jTerm using jCons to separate
terms.public void makePredicateTerms(jTerm t)
jCons and jOr separated jTerms
to this jPredicateTerms.
t - jTerm using jCons and/or
jOr to separate terms.
protected void makeOrPredicateTerms(jOrPredicate orpred,
jTerm term)
jOr separated jTerms to the provided
jOrPredicate.
orpred - The jOrPredicate to add the jOr
separated jTerms to.term - jTerm using jOr to separate terms.protected void makeConsPredicateTerms(jTerm term)
jCons separated jTerms to this
jPredicateTerms instance.
term - jTerm using jOr to separate terms.public jTerm unmake()
jCons and/or jOr separated jTerms
to represent this jPredicateTerms. Invokes
unmakePredicateTerms to perform work.
unmake in interface iMakeUnmakeunmake in class jCompoundTermjTerm using jCons and jOr
to separate terms. Duplicates this jPredicateTerms.public jTerm unmakePredicateTerms()
jCons and/or jOr separated jTerms
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 | |||||||||