Clasp's default unfounded set checker. More...
#include <unfounded_check.h>
Clasp's default unfounded set checker.
Searches for unfounded atoms by checking the positive dependency graph (PDG) Basic Idea:
Definition at line 48 of file unfounded_check.h.
Definition at line 53 of file unfounded_check.h.
typedef PodVector<AtomData>::type Clasp::DefaultUnfoundedCheck::AtomVec [private] |
Definition at line 256 of file unfounded_check.h.
Definition at line 52 of file unfounded_check.h.
typedef PodVector<BodyData>::type Clasp::DefaultUnfoundedCheck::BodyVec [private] |
Definition at line 257 of file unfounded_check.h.
Definition at line 50 of file unfounded_check.h.
typedef PodVector<ExtData*>::type Clasp::DefaultUnfoundedCheck::ExtVec [private] |
Definition at line 258 of file unfounded_check.h.
typedef PodQueue<NodeId> Clasp::DefaultUnfoundedCheck::IdQueue [private] |
Definition at line 260 of file unfounded_check.h.
typedef SingleOwnerPtr<MinimalityCheck> Clasp::DefaultUnfoundedCheck::MiniPtr [private] |
Definition at line 261 of file unfounded_check.h.
Definition at line 51 of file unfounded_check.h.
typedef PodVector<ExtWatch>::type Clasp::DefaultUnfoundedCheck::WatchVec [private] |
Definition at line 259 of file unfounded_check.h.
Defines the supported reasons for explaining assignments.
Definition at line 55 of file unfounded_check.h.
enum Clasp::DefaultUnfoundedCheck::UfsType [private] |
Definition at line 81 of file unfounded_check.h.
enum Clasp::DefaultUnfoundedCheck::WatchType [private] |
Definition at line 86 of file unfounded_check.h.
Definition at line 72 of file unfounded_check.cpp.
Definition at line 80 of file unfounded_check.cpp.
Clasp::DefaultUnfoundedCheck::DefaultUnfoundedCheck | ( | const DefaultUnfoundedCheck & | ) | [private] |
void Clasp::DefaultUnfoundedCheck::addDeltaReason | ( | const BodyPtr & | body, |
uint32 | uScc | ||
) | [private] |
Definition at line 606 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::addExtWatch | ( | Literal | p, |
const BodyPtr & | n, | ||
uint32 | data | ||
) | [private] |
Definition at line 194 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::addIfReason | ( | const BodyPtr & | n, |
uint32 | uScc | ||
) | [private] |
Definition at line 639 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::addReasonLit | ( | Literal | p | ) | [private] |
Definition at line 691 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::addUnsourced | ( | const BodyPtr & | n | ) | [private] |
Definition at line 499 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::addWatch | ( | Literal | p, |
uint32 | data, | ||
WatchType | type | ||
) | [private] |
Definition at line 89 of file unfounded_check.cpp.
bool Clasp::DefaultUnfoundedCheck::assertAtom | ( | Literal | a, |
UfsType | t | ||
) | [private] |
Definition at line 531 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::computeReason | ( | UfsType | t | ) | [private] |
Definition at line 578 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::createLoopFormula | ( | ) | [private] |
Definition at line 555 of file unfounded_check.cpp.
bool Clasp::DefaultUnfoundedCheck::falsifyUfs | ( | UfsType | t | ) | [private] |
Definition at line 509 of file unfounded_check.cpp.
Definition at line 705 of file unfounded_check.cpp.
bool Clasp::DefaultUnfoundedCheck::findSource | ( | NodeId | atom | ) | [private] |
Definition at line 415 of file unfounded_check.cpp.
DefaultUnfoundedCheck::UfsType Clasp::DefaultUnfoundedCheck::findUfs | ( | Solver & | s, |
bool | checkNonHcf | ||
) | [private] |
Definition at line 395 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::forwardSource | ( | const BodyPtr & | n | ) | [private] |
Definition at line 297 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::forwardUnsource | ( | const BodyPtr & | n, |
bool | add | ||
) | [private] |
Definition at line 304 of file unfounded_check.cpp.
BodyPtr Clasp::DefaultUnfoundedCheck::getBody | ( | NodeId | bId | ) | const [inline, private] |
Definition at line 182 of file unfounded_check.h.
DependencyGraph* Clasp::DefaultUnfoundedCheck::graph | ( | ) | const [inline] |
Definition at line 68 of file unfounded_check.h.
bool Clasp::DefaultUnfoundedCheck::init | ( | Solver & | s | ) | [virtual] |
Called during initialization of s.
Reimplemented from Clasp::PostPropagator.
Definition at line 98 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::initBody | ( | const BodyPtr & | n | ) | [private] |
Definition at line 156 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::initExtBody | ( | const BodyPtr & | n | ) | [private] |
Definition at line 167 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::initSuccessors | ( | const BodyPtr & | n, |
weight_t | lower | ||
) | [private] |
Definition at line 182 of file unfounded_check.cpp.
bool Clasp::DefaultUnfoundedCheck::isModel | ( | Solver & | s | ) | [virtual] |
Is the current total assignment a model?
Reimplemented from Clasp::PostPropagator.
Definition at line 241 of file unfounded_check.cpp.
bool Clasp::DefaultUnfoundedCheck::isValidSource | ( | const BodyPtr & | n | ) | [private] |
Definition at line 465 of file unfounded_check.cpp.
uint32 Clasp::DefaultUnfoundedCheck::nodes | ( | ) | const [inline] |
Definition at line 69 of file unfounded_check.h.
DefaultUnfoundedCheck& Clasp::DefaultUnfoundedCheck::operator= | ( | const DefaultUnfoundedCheck & | ) | [private] |
uint32 Clasp::DefaultUnfoundedCheck::priority | ( | ) | const [inline, virtual] |
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.
Implements Clasp::PostPropagator.
Definition at line 72 of file unfounded_check.h.
PropResult Clasp::DefaultUnfoundedCheck::propagate | ( | Solver & | s, |
Literal | p, | ||
uint32 & | data | ||
) | [inline, private, virtual] |
Propagate is called for each constraint that watches p. It shall enqueue all consequences of p becoming true.
s | The solver in which p became true. |
p | A literal watched by this constraint that recently became true. |
data | The data-blob that this constraint passed when the watch for p was registered. |
Reimplemented from Clasp::PostPropagator.
Definition at line 171 of file unfounded_check.h.
bool Clasp::DefaultUnfoundedCheck::propagateFixpoint | ( | Solver & | s, |
PostPropagator * | ctx | ||
) | [virtual] |
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.
s | The solver in which this post propagator is used. |
ctx | The post propagator from which this post propagator is called or 0 if no other post propagator is currently active. |
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.
Definition at line 216 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::propagateSource | ( | ) | [private] |
Definition at line 248 of file unfounded_check.cpp.
bool Clasp::DefaultUnfoundedCheck::pushTodo | ( | NodeId | at | ) | [inline, private] |
Definition at line 251 of file unfounded_check.h.
bool Clasp::DefaultUnfoundedCheck::pushUfs | ( | NodeId | at | ) | [inline, private] |
Definition at line 252 of file unfounded_check.h.
void Clasp::DefaultUnfoundedCheck::reason | ( | Solver & | s, |
Literal | p, | ||
LitVec & | lits | ||
) | [private, virtual] |
Reimplemented from Clasp::PostPropagator.
Definition at line 202 of file unfounded_check.cpp.
ReasonStrategy Clasp::DefaultUnfoundedCheck::reasonStrategy | ( | ) | const [inline] |
Definition at line 66 of file unfounded_check.h.
void Clasp::DefaultUnfoundedCheck::removeSource | ( | NodeId | bodyId | ) | [private] |
Definition at line 334 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::reset | ( | ) | [virtual] |
Aborts an active propagation operation.
The function reset() is called whenever propagation on the current decision level is stopped before a fixpoint is reached. In particular, a solver calls reset() when a conflict is detected during propagation.
Reimplemented from Clasp::PostPropagator.
Definition at line 227 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::resetTodo | ( | ) | [inline, private] |
Definition at line 253 of file unfounded_check.h.
void Clasp::DefaultUnfoundedCheck::resetUfs | ( | ) | [inline, private] |
Definition at line 254 of file unfounded_check.h.
void Clasp::DefaultUnfoundedCheck::setSource | ( | NodeId | atom, |
const BodyPtr & | b | ||
) | [private] |
Definition at line 319 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::updateAssignment | ( | Solver & | s | ) | [private] |
Definition at line 351 of file unfounded_check.cpp.
void Clasp::DefaultUnfoundedCheck::updateSource | ( | AtomData & | atom, |
const BodyPtr & | n | ||
) | [private] |
Definition at line 263 of file unfounded_check.cpp.
bool Clasp::DefaultUnfoundedCheck::valid | ( | Solver & | s | ) | [virtual] |
Shall return whether the constraint is valid (i.e. not conflicting) w.r.t the current assignment in s.
Reimplemented from Clasp::Constraint.
Definition at line 236 of file unfounded_check.cpp.
Definition at line 276 of file unfounded_check.h.
AtomVec Clasp::DefaultUnfoundedCheck::atoms_ [private] |
Definition at line 266 of file unfounded_check.h.
BodyVec Clasp::DefaultUnfoundedCheck::bodies_ [private] |
Definition at line 267 of file unfounded_check.h.
Definition at line 272 of file unfounded_check.h.
Definition at line 264 of file unfounded_check.h.
Definition at line 278 of file unfounded_check.h.
Definition at line 270 of file unfounded_check.h.
Definition at line 275 of file unfounded_check.h.
MiniPtr Clasp::DefaultUnfoundedCheck::mini_ [private] |
Definition at line 265 of file unfounded_check.h.
Definition at line 274 of file unfounded_check.h.
LitVec* Clasp::DefaultUnfoundedCheck::reasons_ [private] |
Definition at line 277 of file unfounded_check.h.
Solver* Clasp::DefaultUnfoundedCheck::solver_ [private] |
Definition at line 263 of file unfounded_check.h.
VarVec Clasp::DefaultUnfoundedCheck::sourceQ_ [private] |
Definition at line 271 of file unfounded_check.h.
Definition at line 279 of file unfounded_check.h.
IdQueue Clasp::DefaultUnfoundedCheck::todo_ [private] |
Definition at line 268 of file unfounded_check.h.
IdQueue Clasp::DefaultUnfoundedCheck::ufs_ [private] |
Definition at line 269 of file unfounded_check.h.
Definition at line 273 of file unfounded_check.h.