org.sat4j.tools
Class ConstrGroup

java.lang.Object
  extended by org.sat4j.tools.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)
           
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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


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