|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tuffy.ground.KBMC.AtomCutSet
private static class KBMC.AtomCutSet
AtomCutSet is set of atoms with the same predicate.
These atoms are organized in strata, with each stratum
responds to a different degree-of-freedom. Atoms in a AtomCutSet
satisfy that $\forall$ atom $a$ in this set, there does not exist atom $b$
in this set that $a$ subsumes $b$. For the definition of ``subsume'', see
Tuple.subsumes(Tuple)
.
Nested Class Summary | |
---|---|
(package private) class |
KBMC.AtomCutSet.Stratum
A stratum is a set of tuples with the same degree-of-freedom. |
Field Summary | |
---|---|
(package private) int |
arity
Arity of pred . |
(package private) boolean |
complete
Whether this AtomCutSet is complete. |
(package private) java.util.HashSet<Tuple> |
heap
Set of all tuples in each stratum. |
(package private) Predicate |
pred
Predicate of this AtomCutSet. |
(package private) java.util.ArrayList<KBMC.AtomCutSet.Stratum> |
strata
List of stratum in this AtomCutSet. |
Constructor Summary | |
---|---|
KBMC.AtomCutSet(Predicate p)
Constructor of AtomCutSet. |
Method Summary | |
---|---|
void |
addTuple(Tuple t)
Add a tuple to corresponding stratum. |
boolean |
collectAll()
Copy all tuples in each stratum to heap . |
boolean |
contains(Tuple t)
Return true if the input tuple is in the corresponding stratum. |
void |
removeTuple(Tuple t)
Remove the input tuple from corresponding stratum. |
boolean |
subsumes(Tuple t)
Returns true if there exists a tuple in this AtomCutSet that subsumes the input tuple. |
Tuple |
top()
Returns the first tuple in the first stratum. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
Predicate pred
int arity
pred
.
boolean complete
Tuple.subsumes(Tuple)
.
java.util.ArrayList<KBMC.AtomCutSet.Stratum> strata
java.util.HashSet<Tuple> heap
Constructor Detail |
---|
public KBMC.AtomCutSet(Predicate p)
p
- Method Detail |
---|
public boolean collectAll()
heap
.
public Tuple top()
public void removeTuple(Tuple t)
t
- input tuple.public boolean contains(Tuple t)
t
- input tuple.public boolean subsumes(Tuple t)
Tuple.subsumes(Tuple)
.
t
- input tuple.public void addTuple(Tuple t)
KBMC.run()
ensure this.
t
- input tuple
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |