Public Member Functions | Static Public Member Functions | Public Attributes
Clasp::Test::TestingConstraint Struct Reference
Inheritance diagram for Clasp::Test::TestingConstraint:
Inheritance graph
[legend]

List of all members.

Public Member Functions

ConstraintcloneAttach (Solver &)
 Returns a clone of this and adds necessary watches to the given solver.
void destroy (Solver *s, bool b)
 Default is to call delete this.
uint32 isOpen (const Solver &, const TypeSet &, LitVec &)
 Shall return 0 if either !t.inSet(type()) or this constraint is satisfied w.r.t the current assignment.
bool locked (const Solver &) const
PropResult propagate (Solver &, Literal, uint32 &)
void reason (Solver &, Literal, LitVec &out)
bool simplify (Solver &, bool)
 TestingConstraint (bool *del=0, ConstraintType t=Constraint_t::static_constraint)
ConstraintType type () const
 Returns the type of this learnt constraint.
void undoLevel (Solver &)
 Called when the solver undid a decision level watched by this constraint.

Static Public Member Functions

static uint32 size ()

Public Attributes

LitVec ante
bool * deleted
bool keepWatch
int propagates
bool sat
bool setConflict
ConstraintType type_
int undos

Detailed Description

Definition at line 26 of file solver_test.cpp.


Constructor & Destructor Documentation

Definition at line 27 of file solver_test.cpp.


Member Function Documentation

Returns a clone of this and adds necessary watches to the given solver.

The function shall create and return a copy of this constraint to be used in the given solver. Furthermore, it shall add necessary watches to the given solver.

Note:
Return 0 to indicate that cloning is not supported.

Implements Clasp::Constraint.

Definition at line 29 of file solver_test.cpp.

void Clasp::Test::TestingConstraint::destroy ( Solver s,
bool  detach 
) [inline, virtual]

Default is to call delete this.

Reimplemented from Clasp::Constraint.

Definition at line 41 of file solver_test.cpp.

uint32 Clasp::Test::TestingConstraint::isOpen ( const Solver s,
const TypeSet t,
LitVec freeLits 
) [inline, 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.

Implements Clasp::LearntConstraint.

Definition at line 46 of file solver_test.cpp.

bool Clasp::Test::TestingConstraint::locked ( const Solver s) const [inline, virtual]

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

Implements Clasp::LearntConstraint.

Definition at line 45 of file solver_test.cpp.

PropResult Clasp::Test::TestingConstraint::propagate ( Solver s,
Literal  p,
uint32 &  data 
) [inline, virtual]

Propagate is called for each constraint that watches p. It shall enqueue all consequences of p becoming true.

Precondition:
p is true in s
Parameters:
sThe solver in which p became true.
pA literal watched by this constraint that recently became true.
dataThe data-blob that this constraint passed when the watch for p was registered.

Implements Clasp::Constraint.

Definition at line 32 of file solver_test.cpp.

void Clasp::Test::TestingConstraint::reason ( Solver s,
Literal  p,
LitVec lits 
) [inline, virtual]
Precondition:
This constraint is the reason for p being true in s.
Postcondition:
The literals implying p were added to lits.

Implements Clasp::Constraint.

Definition at line 40 of file solver_test.cpp.

bool Clasp::Test::TestingConstraint::simplify ( Solver s,
bool  reinit 
) [inline, virtual]

Simplify this constraint.

Precondition:
s.decisionLevel() == 0 and the current assignment is fully propagated.
Returns:
true if this constraint can be ignored (e.g. is satisfied), false otherwise.
Postcondition:
If simplify returned true, this constraint has previously removed all its watches from the solver.
Note:
The default implementation is a noop and returns false.

Reimplemented from Clasp::Constraint.

Definition at line 39 of file solver_test.cpp.

static uint32 Clasp::Test::TestingConstraint::size ( ) [inline, static]

Definition at line 47 of file solver_test.cpp.

Returns the type of this learnt constraint.

Note:
The default implementation returns Constraint_t::learnt_conflict.

Reimplemented from Clasp::LearntConstraint.

Definition at line 48 of file solver_test.cpp.

void Clasp::Test::TestingConstraint::undoLevel ( Solver s) [inline, virtual]

Called when the solver undid a decision level watched by this constraint.

Parameters:
sthe solver in which the decision level is undone.

Reimplemented from Clasp::Constraint.

Definition at line 36 of file solver_test.cpp.


Member Data Documentation

Definition at line 49 of file solver_test.cpp.

Definition at line 56 of file solver_test.cpp.

Definition at line 54 of file solver_test.cpp.

Definition at line 51 of file solver_test.cpp.

Definition at line 53 of file solver_test.cpp.

Definition at line 55 of file solver_test.cpp.

Definition at line 50 of file solver_test.cpp.

Definition at line 52 of file solver_test.cpp.


The documentation for this struct was generated from the following file:


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