org.sat4j.core
Class ConstrGroup

java.lang.Object
  extended by org.sat4j.core.ConstrGroup
All Implemented Interfaces:
IConstr

public class ConstrGroup
extends Object
implements IConstr

A utility class used to manage easily group of clauses to be deleted at some point in the solver.

Since:
2.0
Author:
dlb

Constructor Summary
ConstrGroup()
          Create a ConstrGroup that cannot contain null constrs.
ConstrGroup(boolean disallowNullConstraints)
          Create a new constrGroup.
 
Method Summary
 void add(IConstr constr)
           
 boolean canBePropagatedMultipleTimes()
          Partition constraints into the ones that can only be found once on the trail (e.g. clauses) and the ones that can be found several times (e.g.
 void clear()
           
 int get(int i)
          returns the ith literal in the constraint
 double getActivity()
          To obtain the activity of the constraint.
 IConstr getConstr(int i)
           
 boolean learnt()
           
 void removeFrom(ISolver solver)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstrGroup

public ConstrGroup()
Create a ConstrGroup that cannot contain null constrs.


ConstrGroup

public ConstrGroup(boolean disallowNullConstraints)
Create a new constrGroup.

Parameters:
disallowNullConstraints - should be set to false to allow adding null constraints to the group.
Method Detail

add

public void add(IConstr constr)

clear

public void clear()

removeFrom

public void removeFrom(ISolver solver)

getConstr

public IConstr getConstr(int i)

size

public int size()
Specified by:
size in interface IConstr
Returns:
the number of literals in the constraint.

learnt

public boolean learnt()
Specified by:
learnt in interface IConstr
Returns:
true iff the clause was learnt during the search

getActivity

public double getActivity()
Description copied from interface: IConstr
To obtain the activity of the constraint.

Specified by:
getActivity in interface IConstr
Returns:
the activity of the clause.

get

public int get(int i)
Description copied from interface: IConstr
returns the ith literal in the constraint

Specified by:
get in interface IConstr
Parameters:
i - the index of the literal
Returns:
a literal

canBePropagatedMultipleTimes

public boolean canBePropagatedMultipleTimes()
Description copied from interface: IConstr
Partition constraints into the ones that can only be found once on the trail (e.g. clauses) and the ones that can be found several times (e.g. cardinality constraints and pseudo-boolean constraints).

Specified by:
canBePropagatedMultipleTimes in interface IConstr
Returns:
true if the constraint can be used several times as a reason to propagate a literal.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.