choco.cp.solver.constraints.integer.bool.sat
Class WLClause

java.lang.Object
  extended by choco.cp.solver.constraints.integer.bool.sat.WLClause
Direct Known Subclasses:
BinaryWLClause, DynWLClause

public class WLClause
extends Object

A clause is a set of litterals used within the watched literals propagation based global constraint for clauses (ClauseStore)


Field Summary
protected  int idx
           
protected  boolean isreg
           
protected  int[] lits
           
protected  boolean nogood
           
protected  ClauseStore propagator
           
protected  Lits voc
           
 
Constructor Summary
WLClause(int[] ps, Lits voc)
           
 
Method Summary
 void findLiteral(int start)
           
 int getIdx()
           
 int[] getLits()
           
 int getLitZero()
           
 Lits getVocabulary()
           
 Boolean isEntailed()
           
 boolean isNogood()
           
 boolean isRegistered()
           
 boolean isSatisfied()
           
 boolean isSatisfied(int[] tuple)
           
 boolean learnt()
           
 boolean propagate(int p, int idxcl)
          propagate the clause because one of the watched literals has changed
 boolean register(ClauseStore propagator)
          register this clause in the watching lists of the propagator.
 void setIdx(int id)
           
 void simplePropagation(ClauseStore propagator)
          propagate the clause from scratch
 int size()
           
 String toString()
           
 void unregister()
           
 boolean update()
           
 void updateDomain()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lits

protected final int[] lits

voc

protected final Lits voc

isreg

protected boolean isreg

nogood

protected boolean nogood

idx

protected int idx

propagator

protected ClauseStore propagator
Constructor Detail

WLClause

public WLClause(int[] ps,
                Lits voc)
Method Detail

setIdx

public void setIdx(int id)

getIdx

public int getIdx()

getLitZero

public int getLitZero()

findLiteral

public void findLiteral(int start)

register

public boolean register(ClauseStore propagator)
                 throws ContradictionException
register this clause in the watching lists of the propagator. Basically find two literals to watch

Parameters:
propagator -
Throws:
ContradictionException

unregister

public void unregister()

propagate

public boolean propagate(int p,
                         int idxcl)
                  throws ContradictionException
propagate the clause because one of the watched literals has changed

Parameters:
p - the watched literals that has just changed
idxcl - the index of the clause within the propagator
Returns:
if the literals being watche have changed
Throws:
ContradictionException

updateDomain

public void updateDomain()
                  throws ContradictionException
Throws:
ContradictionException

simplePropagation

public void simplePropagation(ClauseStore propagator)
                       throws ContradictionException
propagate the clause from scratch

Parameters:
propagator -
Throws:
ContradictionException

update

public boolean update()
               throws ContradictionException
Returns:
true if the clause is properly watched by two free literals
Throws:
ContradictionException

learnt

public boolean learnt()

size

public int size()

getVocabulary

public Lits getVocabulary()

getLits

public int[] getLits()

isSatisfied

public boolean isSatisfied()

isEntailed

public Boolean isEntailed()

isSatisfied

public boolean isSatisfied(int[] tuple)

isRegistered

public boolean isRegistered()

isNogood

public boolean isNogood()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.