Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Attributes
Clasp::EnumerationConstraint Class Reference

A solver-local (i.e. thread-local) constraint to support enumeration. More...

#include <enumerator.h>

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

List of all members.

Public Types

typedef EnumerationConstraintConPtr
typedef MinimizeConstraintMinPtr

Public Member Functions

bool commitModel (Enumerator &ctx, Solver &s)
bool commitUnsat (Enumerator &ctx, Solver &s)
bool disjointPath () const
 Returns true if search-path is disjoint from all others.
void end (Solver &s)
bool integrateBound (Solver &s) const
MinPtr minimizer () const
bool optimize () const
 Returns true if optimization is active.
void setDisjoint (bool x)
void setMinimizer (MinPtr min)
bool start (Solver &s, const LitVec &path, bool disjoint)
ValueRep state () const
bool update (Solver &s)

Protected Member Functions

MinimizeConstraintcloneMinimizer (Solver &s) const
virtual void destroy (Solver *s, bool detach)
 Default is to call delete this.
virtual void doCommitModel (Enumerator &, Solver &)
virtual bool doUpdate (Solver &s)=0
 EnumerationConstraint (Solver &s, MinimizeConstraint *min)
virtual PropResult propagate (Solver &, Literal, uint32 &)
virtual void reason (Solver &, Literal, LitVec &)
virtual bool simplify (Solver &s, bool reinit)
virtual bool valid (Solver &s)
 Shall return whether the constraint is valid (i.e. not conflicting) w.r.t the current assignment in s.
virtual ~EnumerationConstraint ()

Private Types

enum  { clear_state_mask = ~uint32(value_true|value_false) }
enum  Flag { flag_path_disjoint = 4u }

Private Attributes

uint32 flags_: 4
MinimizeConstraintmini_
LitVec next_
uint32 root_: 28

Detailed Description

A solver-local (i.e. thread-local) constraint to support enumeration.

An enumeration constraint is used to extract/store enumeration-related information from models.

Definition at line 234 of file enumerator.h.


Member Typedef Documentation

Definition at line 236 of file enumerator.h.

Definition at line 237 of file enumerator.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
clear_state_mask 

Definition at line 269 of file enumerator.h.

Enumerator:
flag_path_disjoint 

Definition at line 268 of file enumerator.h.


Constructor & Destructor Documentation

Definition at line 27 of file enumerator.cpp.

Definition at line 33 of file enumerator.cpp.


Member Function Documentation

Definition at line 30 of file enumerator.cpp.

Definition at line 80 of file enumerator.cpp.

Definition at line 88 of file enumerator.cpp.

void Clasp::EnumerationConstraint::destroy ( Solver s,
bool  detach 
) [protected, virtual]

Default is to call delete this.

Reimplemented from Clasp::Constraint.

Reimplemented in Clasp::CBConsequences::CBFinder, and Clasp::ModelEnumerator::ModelFinder.

Definition at line 34 of file enumerator.cpp.

Returns true if search-path is disjoint from all others.

Definition at line 239 of file enumerator.h.

virtual void Clasp::EnumerationConstraint::doCommitModel ( Enumerator ,
Solver  
) [inline, protected, virtual]
virtual bool Clasp::EnumerationConstraint::doUpdate ( Solver s) [protected, pure virtual]

Definition at line 43 of file enumerator.cpp.

Definition at line 37 of file enumerator.cpp.

Definition at line 243 of file enumerator.h.

Returns true if optimization is active.

Definition at line 38 of file enumerator.cpp.

virtual PropResult Clasp::EnumerationConstraint::propagate ( Solver s,
Literal  p,
uint32 &  data 
) [inline, protected, 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.

Reimplemented in Clasp::ModelEnumerator::BacktrackFinder.

Definition at line 259 of file enumerator.h.

virtual void Clasp::EnumerationConstraint::reason ( Solver s,
Literal  p,
LitVec lits 
) [inline, protected, 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.

Reimplemented in Clasp::ModelEnumerator::BacktrackFinder.

Definition at line 260 of file enumerator.h.

Definition at line 39 of file enumerator.cpp.

Definition at line 253 of file enumerator.h.

bool Clasp::EnumerationConstraint::simplify ( Solver s,
bool  reinit 
) [protected, 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.

Reimplemented in Clasp::ModelEnumerator::ModelFinder.

Definition at line 35 of file enumerator.cpp.

bool Clasp::EnumerationConstraint::start ( Solver s,
const LitVec path,
bool  disjoint 
)

Definition at line 49 of file enumerator.cpp.

Definition at line 240 of file enumerator.h.

Definition at line 59 of file enumerator.cpp.

bool Clasp::EnumerationConstraint::valid ( Solver s) [protected, virtual]

Shall return whether the constraint is valid (i.e. not conflicting) w.r.t the current assignment in s.

Precondition:
The assignment in s is not conflicting and fully propagated.
Postcondition:
A changed assignment if the assignment was not valid.
Note:
The default implementation always returns true and assumes that conflicts are detected by Constraint::propagate().

Reimplemented from Clasp::Constraint.

Definition at line 36 of file enumerator.cpp.


Member Data Documentation

Definition at line 272 of file enumerator.h.

Definition at line 270 of file enumerator.h.

Definition at line 271 of file enumerator.h.

Definition at line 273 of file enumerator.h.


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


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