Modifier and Type | Field and Description |
---|---|
int |
assertedLiteral
the literal that will be asserted due to unit propagation of the conflict clause.
|
int |
backjumpLevel
the level at which backjumping should go due to the explanation clause.
|
Map<Integer,Boolean> |
literals
the literals of the clause
|
Constructor and Description |
---|
MapClause()
creates an empty clause
|
MapClause(int[] clause)
initializes the SetClause with given int[] clause
|
MapClause(Iterable<Integer> clause) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(int[] clause)
same as previous
|
boolean |
addAll(Iterable<Integer> clause)
adds all elements of clause to the SetClause, performing resolution.
|
boolean |
addLiteral(int literal)
Add a literal to the clause, with resolution.
|
void |
clear()
clear the clause, ie.
|
boolean |
containsLiteral(int literal)
Predicate which is true iff the literal is present.
|
boolean |
containsVariable(int var)
Predicate which is true iff the variable or its opposite is present
|
boolean |
isEmpty() |
boolean |
isTrivial()
Deprecated.
|
boolean |
isUnitIn(int literal,
Trail trail) |
boolean |
isUnitIn(Trail trail) |
boolean |
isUnsatisfiableIn(Trail trail) |
Iterator<Integer> |
iterator()
(slow) iterate over literals of the clause
|
void |
partialResolveWith(int literal)
If variable specified by the literal does not exists in this clause then
literal is added.
|
boolean |
removeLiteral(int literal)
It removes the literal, if it is in the clause.
|
int |
size()
returns the number of literals in the clause
|
int[] |
toIntArray()
allocates an int[] and dumps the clause in
|
int[] |
toIntArray(MemoryPool pool)
converts the clause to an int[] suitable for the efficient clauses pool
implementations.
|
String |
toString()
returns a nice representation of the clause
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public int assertedLiteral
public int backjumpLevel
public MapClause()
public MapClause(int[] clause)
clause
- the clausepublic boolean addLiteral(int literal)
literal
- the literal to be added from another clausepublic boolean removeLiteral(int literal)
literal
- the literal to remove (sign sensitive)public void partialResolveWith(int literal)
literal
- the literal to be addedpublic boolean containsLiteral(int literal)
literal
- a literalpublic boolean containsVariable(int var)
var
- a variable (> 0)public boolean isUnsatisfiableIn(Trail trail)
trail
- the trail to checkpublic boolean isUnitIn(int literal, Trail trail)
literal
- the only satisfiable literal in the clausetrail
- the trail for the literalpublic boolean isUnitIn(Trail trail)
public boolean isEmpty()
public int size()
public int[] toIntArray(MemoryPool pool)
pool
- the pool for clause implementationpublic int[] toIntArray()
@Deprecated public boolean isTrivial()
public String toString()
public void clear()
public final boolean addAll(Iterable<Integer> clause)
clause
- the literals to addpublic final boolean addAll(int[] clause)
clause
- clause the literals to addCopyright © 2022. All rights reserved.