Public Member Functions | Protected Member Functions
Clasp::LearntConstraint Class Reference

Base class for learnt constraints. More...

#include <constraint.h>

Inheritance diagram for Clasp::LearntConstraint:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual Activity activity () const
 Returns the activity of the constraint.
virtual void decreaseActivity ()
 Asks the constraint to decrease its activity.
virtual uint32 isOpen (const Solver &s, const TypeSet &t, LitVec &freeLits)=0
 Shall return 0 if either !t.inSet(type()) or this constraint is satisfied w.r.t the current assignment.
 LearntConstraint ()
virtual bool locked (const Solver &s) const =0
virtual void resetActivity (Activity hint)
 Asks the constraint to reset its activity.
ConstraintType type () const
 Returns the type of this learnt constraint.

Protected Member Functions

 ~LearntConstraint ()

Detailed Description

Base class for learnt constraints.

Base class for constraints that can be learnt during search. A learnt constraint is a constraint with the difference that it can be created and deleted dynamically during the search-process and is subject to nogood-deletion. Typical examples are conflict clauses which are created during conflict analysis and loop formulas which are created during unfounded-set checks.

A learnt constraint must additionally define the method locked in order to tell a solver if the constraint can be safely deleted or not. Furthermore whenever a solver needs to delete some learnt constraints it will first delete those with a low activity. A learnt constraint may therefore bump its activity whenever it sees fit in order to delay its deletion.

Definition at line 202 of file constraint.h.


Constructor & Destructor Documentation

Definition at line 37 of file constraint.cpp.

Definition at line 36 of file constraint.cpp.


Member Function Documentation

Returns the activity of the constraint.

Note:
A solver uses the activity-value in order to establish an ordering of learnt constraints. Whenever a solver needs to delete some learnt constraints it selects from the unlocked ones those with a low activity-value.
The default-implementation always returns 0.

Reimplemented in Clasp::LoopFormula, and Clasp::ClauseHead.

Definition at line 38 of file constraint.cpp.

Asks the constraint to decrease its activity.

Reimplemented in Clasp::LoopFormula, and Clasp::ClauseHead.

Definition at line 39 of file constraint.cpp.

virtual uint32 Clasp::LearntConstraint::isOpen ( const Solver s,
const TypeSet t,
LitVec freeLits 
) [pure virtual]

Shall return 0 if either !t.inSet(type()) or this constraint is satisfied w.r.t the current assignment.

If this constraint is currently not satisfied and t.inSet(type()), shall return type() and freeLits shall contain all currently unassigned literals of this constraint.

Implemented in Clasp::mt::SharedLitsClause, Clasp::LoopFormula, Clasp::Clause, and Clasp::Test::TestingConstraint.

virtual bool Clasp::LearntConstraint::locked ( const Solver s) const [pure virtual]

Shall return true if this constraint can't be deleted because it currently implies one ore more literals and false otherwise.

Implemented in Clasp::LoopFormula, Clasp::ClauseHead, and Clasp::Test::TestingConstraint.

Asks the constraint to reset its activity.

Reimplemented in Clasp::LoopFormula, and Clasp::ClauseHead.

Definition at line 40 of file constraint.cpp.

Returns the type of this learnt constraint.

Note:
The default implementation returns Constraint_t::learnt_conflict.

Reimplemented from Clasp::Constraint.

Reimplemented in Clasp::LoopFormula, Clasp::ClauseHead, and Clasp::Test::TestingConstraint.

Definition at line 41 of file constraint.cpp.


The documentation for this class was generated from the following files:


clasp
Author(s): Benjamin Kaufmann
autogenerated on Thu Aug 27 2015 12:41:41