clingo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Public Member Functions | List of all members
Clasp::MessageHandler Class Referenceabstract

#include <constraint.h>

Inheritance diagram for Clasp::MessageHandler:
Inheritance graph
Collaboration diagram for Clasp::MessageHandler:
Collaboration graph

Public Member Functions

 MessageHandler ()
 
virtual bool handleMessages ()=0
 
virtual uint32 priority () const
 Shall return a value representing the priority of this propagator. More...
 
virtual bool propagateFixpoint (Solver &, PostPropagator *)
 Shall enqueue and propagate new assignments implied by this propagator. More...
 
- Public Member Functions inherited from Clasp::PostPropagator
 PostPropagator ()
 
virtual ~PostPropagator ()
 
virtual bool init (Solver &s)
 Called during initialization of s. More...
 
virtual void reset ()
 Aborts an active propagation operation. More...
 
virtual bool isModel (Solver &s)
 Is the current total assignment a model? More...
 
- Public Member Functions inherited from Clasp::Constraint
 Constraint ()
 
virtual void destroy (Solver *s=0, bool detach=false)
 Default is to call delete this. More...
 
virtual ConstraintType type () const
 Returns the type of this constraint. More...
 
virtual bool minimize (Solver &s, Literal p, CCMinRecursive *rec)
 
virtual void undoLevel (Solver &s)
 Called when the solver undid a decision level watched by this constraint. More...
 
virtual bool simplify (Solver &s, bool reinit=false)
 
virtual uint32 estimateComplexity (const Solver &s) const
 Returns an estimate of the constraint's complexity relative to a clause (complexity = 1). More...
 
virtual ClauseHeadclause ()
 Shall return this if constraint is a clause, otherwise 0. More...
 
virtual bool valid (Solver &s)
 Shall return whether the constraint is valid (i.e. not conflicting) w.r.t the current assignment in s. More...
 

Additional Inherited Members

- Public Types inherited from Clasp::PostPropagator
enum  Priority {
  priority_class_simple = 0, priority_reserved_msg = 0, priority_reserved_ufs = 10, priority_reserved_look = 1023,
  priority_class_general = 1024
}
 Default priorities for post propagators. More...
 
- Public Attributes inherited from Clasp::PostPropagator
PostPropagatornext
 
- Protected Member Functions inherited from Clasp::PostPropagator
ConstraintcloneAttach (Solver &)
 PostPropagators are not clonable by default. More...
 
PropResult propagate (Solver &, Literal, uint32 &)
 
void reason (Solver &, Literal, LitVec &)
 
- Protected Member Functions inherited from Clasp::Constraint
virtual ~Constraint ()
 

Constructor & Destructor Documentation

Clasp::MessageHandler::MessageHandler ( )

Member Function Documentation

virtual bool Clasp::MessageHandler::handleMessages ( )
pure virtual
virtual uint32 Clasp::MessageHandler::priority ( ) const
inlinevirtual

Shall return a value representing the priority of this propagator.

The priority is used to order sequences of post propagators and to classify post propagators w.r.t the classes: class_simple and class_general.

Note
See class description for an overview of the two priority classes.

Implements Clasp::PostPropagator.

virtual bool Clasp::MessageHandler::propagateFixpoint ( Solver s,
PostPropagator ctx 
)
inlinevirtual

Shall enqueue and propagate new assignments implied by this propagator.

This function shall enqueue and propagate all assignments currently implied by this propagator until a fixpoint is reached w.r.t this post propagator or a conflict is detected.

Precondition
The assignment is fully propagated w.r.t any previous post propagator.
Parameters
sThe solver in which this post propagator is used.
ctxThe post propagator from which this post propagator is called or 0 if no other post propagator is currently active.
Postcondition
s.queueSize() == 0 || s.hasConflict()
Returns
false if propagation led to conflict, true otherwise
Note
The function shall not call Solver::propagate() or any other function that would result in a recursive chain of propagate() calls. On the other hand, it shall call Solver::propagateUntil(this) after enqueuing new assignments to initiate propagation up to this propagator.

Typically, propagateFixpoint() should implemet a loop like this:

for (;;) {
if (!assign_newly_implied_literals(s)){ return false; }
if (s.queueSize() == 0) { return true; }
if (!s.propagateUntil(this)) { return false; }
}

Implements Clasp::PostPropagator.

Reimplemented in Clasp::SequentialSolve::InterruptHandler.

Here is the call graph for this function:


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