34 namespace Gecode {
namespace Search {
56 while ((l != NULL) && l->
leaf()) {
58 notice = notice || l->
notice();
64 while (!notice && (l != NULL)) {
65 notice = notice || l->
notice();
75 assert(p.
root != NULL);
78 for (
NGL* pc = p.
root; pc != NULL; pc = pc->
next()) {
79 NGL*
n = pc->copy(home);
92 int n =
std::min(p.ds.entries(),
static_cast<int>(p.ngdl()));
94 unsigned long int n_nogood = 0;
97 while ((n > s) && (p.ds[n-1].truealt() == 0U))
106 while ((s < n) && (p.ds[s].truealt() > 0U))
108 if (p.ds[s].rightmost()) {
110 home.
trycommit(*p.ds[s].choice(),p.ds[s].truealt());
114 for (
unsigned int a=0U;
a<p.ds[s].truealt();
a++) {
115 NGL*
l = home.
ngl(*p.ds[s].choice(),
a);
122 if (
NGL*
l = home.
ngl(*p.ds[s].choice(),p.ds[s].truealt())) {
136 ((n-s == 1) && (c != &nn)));
142 for (
int i=s;
i<
n;
i++) {
144 for (
unsigned int a=0U;
a<p.ds[
i].truealt();
a++) {
153 c = c->
add(l,
true); ll =
c;
157 if (
NGL*
l = home.
ngl(*p.ds[
i].choice(),p.ds[
i].truealt())) {
159 }
else if (!p.ds[
i].rightmost()) {
168 const_cast<Path&
>(
p).ng(n_nogood);
virtual void subscribe(Space &home, Propagator &p)=0
Subscribe propagator p to all views of the no-good literal.
static ExecStatus post(Space &home, const Path &p)
Post propagator for path p.
virtual ExecStatus prune(Space &home)=0
Propagate the negation of the no-good literal.
Actor must always be disposed.
NoNGL(void)
Constructor for creation.
long long int ll(int x)
Cast x into a long long int.
Base-class for propagators.
NoGoodsProp(Space &home, NGL *root)
Constructor for creation.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
NGL * root
Root of no-good literal tree.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
bool leaf(void) const
Test whether literal is a leaf.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Execution has resulted in failure.
bool failed(void) const
Check whether space is failed.
NGL * next(void) const
Return pointer to next literal.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
unsigned int n
Number of no-good literals with subscriptions.
virtual bool notice(void) const
Whether dispose must always be called (returns false)
void trycommit(const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
If possible, commit choice c for alternative a.
NGL * add(NGL *n, bool l)
Add node n and mark it as leaf l and return n.
Gecode toplevel namespace
Home class for posting propagators
Class for a sentinel no-good literal.
NGL * ngl(const Choice &c, unsigned int a)
Create no-good literal for choice c and alternative a.
No-good literal recorded during search.