public class CanonicalEnumerator extends java.lang.Object implements java.util.Iterator<PlBeliefSet>
| Modifier and Type | Field and Description | 
|---|---|
private java.math.BigInteger | 
next
The next value used for compiling a knowledge base. 
 | 
private java.math.BigInteger | 
upperBoundIndex
The upper bound used for enumerating knowledge bases. 
 | 
| Constructor and Description | 
|---|
CanonicalEnumerator()
Default constructor. 
 | 
CanonicalEnumerator(java.math.BigInteger startIndex)
Creates a new enumerator that enumerates 
 knowledge bases starting from the given index 
 | 
CanonicalEnumerator(java.math.BigInteger startIndex,
                   java.math.BigInteger endIndex)
Creates a new enumerator that enumerates 
 knowledge bases starting from the given start
 index up to the given end index (including) 
 | 
CanonicalEnumerator(java.lang.Integer startIndex)
Creates a new enumerator that enumerates 
 knowledge bases starting from the given index 
 | 
CanonicalEnumerator(java.lang.Integer startIndex,
                   java.lang.Integer endIndex)
Creates a new enumerator that enumerates 
 knowledge bases starting from the given start
 index up to the given end index (including) 
 | 
CanonicalEnumerator(java.lang.Long startIndex)
Creates a new enumerator that enumerates 
 knowledge bases starting from the given index 
 | 
CanonicalEnumerator(java.lang.Long startIndex,
                   java.lang.Long endIndex)
Creates a new enumerator that enumerates 
 knowledge bases starting from the given start
 index up to the given end index (including) 
 | 
| Modifier and Type | Method and Description | 
|---|---|
static java.util.BitSet | 
beliefSet2BitSet(PlBeliefSet bs)
Creates a bitset representation of the given belief set. 
 | 
private PlBeliefSet | 
bitset2BeliefSet(java.util.BitSet s)
Parses a knowledge base (PlBeliefSet) from the the given bitset. 
 | 
private static java.lang.String | 
formula2String(PropositionalFormula f,
              java.util.Map<Proposition,java.lang.Integer> prop)
Encodes the given formula as a bitstring. 
 | 
private void | 
gotoNextValidIndex()
Sets this.next to the next value actually encoding a belief base (or to this.upperBoundIndex if set). 
 | 
boolean | 
hasNext()  | 
private boolean | 
isLessThan(java.util.BitSet s,
          boolean equal,
          int i,
          int j,
          int k,
          int l)
Checks whether the bitvector at positions [i,...,j] is less
 than the bitvector at positions [k,...,l]. 
 | 
PlBeliefSet | 
next()  | 
java.math.BigInteger | 
nextIndex()
Returns the index of the next element. 
 | 
private Pair<java.util.Collection<PropositionalFormula>,java.lang.Integer> | 
parseAssociativeFormula(java.util.BitSet s,
                       int idx,
                       int numOfTerms,
                       PropositionalSignature sig)
Parses an associate formula from the given bitset starting at index idx, with the given number
 of terms and the given signature 
 | 
private Pair<PropositionalFormula,java.lang.Integer> | 
parseFormula(java.util.BitSet s,
            int idx,
            PropositionalSignature sig)
Reads the next formula of the given bitset, starting at the given index. 
 | 
private Pair<PropositionalFormula,java.lang.Integer> | 
parseProposition(java.util.BitSet s,
                int idx,
                PropositionalSignature sig)
Parses a proposition in bitset s starting from idx. 
 | 
private java.math.BigInteger upperBoundIndex
private java.math.BigInteger next
public CanonicalEnumerator()
public CanonicalEnumerator(java.lang.Long startIndex)
startIndex - some integer valuepublic CanonicalEnumerator(java.lang.Integer startIndex)
startIndex - some integer valuepublic CanonicalEnumerator(java.math.BigInteger startIndex)
startIndex - some integer valuepublic CanonicalEnumerator(java.lang.Long startIndex,
                           java.lang.Long endIndex)
startIndex - some integer valueendIndex - some integer valuepublic CanonicalEnumerator(java.lang.Integer startIndex,
                           java.lang.Integer endIndex)
startIndex - some integer valueendIndex - some integer valuepublic CanonicalEnumerator(java.math.BigInteger startIndex,
                           java.math.BigInteger endIndex)
startIndex - some integer valueendIndex - some integer valueprivate void gotoNextValidIndex()
private boolean isLessThan(java.util.BitSet s,
                           boolean equal,
                           int i,
                           int j,
                           int k,
                           int l)
s - some bitsetequal - whether equality is allowedi - start index of first bitvector (including)j - end index of first bitvector (including)k - start index of second bitvector (including)l - end index of second bitvector (including)private Pair<java.util.Collection<PropositionalFormula>,java.lang.Integer> parseAssociativeFormula(java.util.BitSet s, int idx, int numOfTerms, PropositionalSignature sig)
s - some bitsetidx - the starting index of the formula to be parsednumOfTerms - the number of terms to be parsedsig - the current signatureprivate Pair<PropositionalFormula,java.lang.Integer> parseProposition(java.util.BitSet s, int idx, PropositionalSignature sig)
s - some bitsetidx - the starting index of the propositionsig - the current signatureprivate Pair<PropositionalFormula,java.lang.Integer> parseFormula(java.util.BitSet s, int idx, PropositionalSignature sig)
b - a bitsetidx - the start index of a formulasig - the current signatureprivate PlBeliefSet bitset2BeliefSet(java.util.BitSet s)
s - some bitsetpublic boolean hasNext()
hasNext in interface java.util.Iterator<PlBeliefSet>public PlBeliefSet next()
next in interface java.util.Iterator<PlBeliefSet>public java.math.BigInteger nextIndex()
private static java.lang.String formula2String(PropositionalFormula f, java.util.Map<Proposition,java.lang.Integer> prop)
f - some formulaprop - map of propositions to their indicespublic static java.util.BitSet beliefSet2BitSet(PlBeliefSet bs)
bs - some belief set