Class Predicate

java.lang.Object
  |
  +--Predicate
Direct Known Subclasses:
BELIEVE, EPS, PER, PERSUADED, PlannablePredicate, RECOMMEND, SymbolPred

public class Predicate
extends java.lang.Object

Predicate.java Created: Wed Apr 7 16:03:15 1999


Inner Class Summary
(package private) static interface Predicate.PossibleKeys
          Says which parts of a Predicate, besides the name, are going to be searchable.
 
Field Summary
(package private)  java.lang.Object arg1
           
(package private)  java.lang.Object arg2
           
(package private) static boolean DEBUG
           
(package private) static java.lang.String em
           
(package private)  boolean isDummy
           
(package private)  boolean isPlannable
           
(package private)  int keys
           
(package private) static java.lang.String loc
           
(package private)  java.lang.Object name
           
(package private) static java.util.Vector newPredicateNames
           
(package private)  ObjectiveCell objectiveCell
           
(package private)  boolean plannedFor
           
(package private) static java.lang.String wm
           
 
Constructor Summary
Predicate()
           
Predicate(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
           
 
Method Summary
 boolean equals(Predicate obj)
           
 java.lang.Object getCorrespondingObject(Variable v1, Predicate otherP)
          When passed a Variable, and also a second predicate, returns the object from the second predicate that corresponds to the position of the Variable in this predicate.
 java.lang.Object getFirstArg()
           
 Predicate getMoreSpecificOrNull(java.util.Hashtable h)
          Determine if this partially specified predicate has a more specific match in this hashtable.
 java.lang.Object getName()
           
 java.lang.Object getSecondArg()
           
 java.util.Vector getVariables()
           
 boolean isDummyPredicate()
           
 boolean isFullyInstantiated()
           
 boolean isPlannable()
           
static boolean isSameOrMoreGeneralThan(Predicate p1, Predicate p2)
          Returns true if p2 is the same kind of Predicate and there exist pairwise matches that could be unified (but doesn't really unify).
static boolean isSameOrMoreGeneralThan(Predicate p1, Predicate p2, java.util.Hashtable h)
           
 boolean isSimple()
           
static void main(java.lang.String[] args)
           
 Predicate makeDummy()
           
static java.util.Vector removeDuplicates(java.util.Vector v1)
           
 void store(java.util.Hashtable h)
          If predicate contains no variables, hash it three ways: 12, 23, 13.
private  Predicate subMakeDummy(java.util.Hashtable varHash)
           
private static boolean subSameOrMoreGeneralThan(java.lang.Object o1, java.lang.Object o2, java.util.Hashtable h)
           
 java.lang.String toString()
           
 boolean verify(java.util.Hashtable h)
          Return true if this fully specified predicate is true in this hashtable.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

name

java.lang.Object name

arg1

java.lang.Object arg1

arg2

java.lang.Object arg2

newPredicateNames

static java.util.Vector newPredicateNames

DEBUG

static boolean DEBUG

objectiveCell

ObjectiveCell objectiveCell

plannedFor

boolean plannedFor

isPlannable

boolean isPlannable

isDummy

boolean isDummy

em

static java.lang.String em

wm

static java.lang.String wm

loc

static java.lang.String loc

keys

int keys
Constructor Detail

Predicate

public Predicate()

Predicate

public Predicate(java.lang.Object o1,
                 java.lang.Object o2,
                 java.lang.Object o3)
Method Detail

getName

public java.lang.Object getName()

getFirstArg

public java.lang.Object getFirstArg()

getSecondArg

public java.lang.Object getSecondArg()

isDummyPredicate

public boolean isDummyPredicate()

makeDummy

public Predicate makeDummy()

subMakeDummy

private Predicate subMakeDummy(java.util.Hashtable varHash)

getVariables

public java.util.Vector getVariables()

isSimple

public boolean isSimple()

isPlannable

public boolean isPlannable()

isFullyInstantiated

public boolean isFullyInstantiated()

removeDuplicates

public static java.util.Vector removeDuplicates(java.util.Vector v1)

isSameOrMoreGeneralThan

public static boolean isSameOrMoreGeneralThan(Predicate p1,
                                              Predicate p2)
Returns true if p2 is the same kind of Predicate and there exist pairwise matches that could be unified (but doesn't really unify). If two constants, must match; if 2 vars, must be paired in same direction; (a ?x ?z) (a ?x ?y) true (a ?x ?y) (a ?x ?x) true (a ?x ?x) (a ?x ?y) false Cannot have a predicate sub for a variable.

isSameOrMoreGeneralThan

public static boolean isSameOrMoreGeneralThan(Predicate p1,
                                              Predicate p2,
                                              java.util.Hashtable h)

subSameOrMoreGeneralThan

private static boolean subSameOrMoreGeneralThan(java.lang.Object o1,
                                                java.lang.Object o2,
                                                java.util.Hashtable h)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(Predicate obj)

store

public void store(java.util.Hashtable h)
If predicate contains no variables, hash it three ways: 12, 23, 13.

getCorrespondingObject

public java.lang.Object getCorrespondingObject(Variable v1,
                                               Predicate otherP)
When passed a Variable, and also a second predicate, returns the object from the second predicate that corresponds to the position of the Variable in this predicate.

verify

public boolean verify(java.util.Hashtable h)
Return true if this fully specified predicate is true in this hashtable.

getMoreSpecificOrNull

public Predicate getMoreSpecificOrNull(java.util.Hashtable h)
Determine if this partially specified predicate has a more specific match in this hashtable. Return the new predicate or NULL. Question: will there ever be a Pred in ht that isn't fully specified? no?

main

public static void main(java.lang.String[] args)