Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes
Clasp::UnitHeuristic Class Reference

Heuristic that uses the results of lookahead. More...

#include <lookahead.h>

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

List of all members.

Public Member Functions

Literal doSelect (Solver &s)
 Implements the actual selection process.
void endInit (Solver &s)
virtual bool notify (Solver &)
 UnitHeuristic (const Lookahead::Params &p)
void updateVar (const Solver &s, Var v, uint32 n)

Static Public Member Functions

static UnitHeuristicrestricted (const Lookahead::Params &p, uint32 numOps, DecisionHeuristic *other)
 Decorates the heuristic given in other with temporary lookahead of type t.

Protected Types

typedef SingleOwnerPtr< LookaheadLookPtr

Protected Attributes

LookPtr look_

Detailed Description

Heuristic that uses the results of lookahead.

The heuristic creates and installs a Lookahead post propagator. It then selects the literal with the highest score, where the score is determined by counting assignments made during failed-literal detection. hybrid_lookahead simply selects the literal that derived the most literals. uniform_lookahead behaves similar to the smodels lookahead heuristic (the literal that maximizes the minimum is selected).

See also:
Patrik Simons: "Extending and Implementing the Stable Model Semantics" for a detailed description of the lookahead Decision Heuristics.
Note:
The heuristic might itself apply some lookahead but only on variables that did not fail in a previous call to Lookahead::propagateFixpoint(). I.e. if priorities are correct for all post propagators in s, the lookahead operations can't fail.

Definition at line 226 of file lookahead.h.


Member Typedef Documentation

Definition at line 239 of file lookahead.h.


Constructor & Destructor Documentation

Parameters:
pLookahead parameters to apply during lookahead.

Definition at line 342 of file lookahead.cpp.


Member Function Documentation

Implements the actual selection process.

Precondition:
s.numFreeVars() > 0, i.e. there is at least one variable to branch on.
Returns:
  • a literal that is currently free or
  • a sentinel literal. In that case, the heuristic shall have asserted a literal!

Implements Clasp::DecisionHeuristic.

Reimplemented in Clasp::Restricted.

Definition at line 353 of file lookahead.cpp.

void Clasp::UnitHeuristic::endInit ( Solver ) [virtual]

Called once after all problem constraints are known to the solver and the problem was simplified. The default-implementation is a noop.

Parameters:
sThe solver in which this heuristic is used.

Reimplemented from Clasp::DecisionHeuristic.

Reimplemented in Clasp::Restricted.

Definition at line 346 of file lookahead.cpp.

virtual bool Clasp::UnitHeuristic::notify ( Solver ) [inline, virtual]

Reimplemented in Clasp::Restricted.

Definition at line 237 of file lookahead.h.

UnitHeuristic * Clasp::UnitHeuristic::restricted ( const Lookahead::Params p,
uint32  numOps,
DecisionHeuristic other 
) [static]

Decorates the heuristic given in other with temporary lookahead of type t.

Definition at line 434 of file lookahead.cpp.

void Clasp::UnitHeuristic::updateVar ( const Solver ,
Var  ,
uint32   
) [virtual]

Called if the state of one or more variables changed. A state change is one of:

  • A previously eliminated variable is resurrected.
  • A new aux variable was added.
  • An aux variable was removed.
Parameters:
sSolver in which the state change occurred.
vThe first variable affected by the change.
nThe range of variables affected, i.e. [v, v+n).
Note:
Use s.validVar(v) and s.auxVar(v) to determine the reason for the update.

Implements Clasp::DecisionHeuristic.

Reimplemented in Clasp::Restricted.

Definition at line 376 of file lookahead.cpp.


Member Data Documentation

Definition at line 240 of file lookahead.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:41