| 355 | } |
| 356 | |
| 357 | void |
| 358 | NNF::post(Home home, NodeType t, |
| 359 | BoolVarArgs& bp, BoolVarArgs& bn, |
| 360 | int& ip, int& in, |
| 361 | const IntPropLevels& ipls) const { |
| 362 | if (this->t != t) { |
| 363 | switch (this->t) { |
| 364 | case BoolExpr::NT_VAR: |
| 365 | if (u.a.neg) { |
| 366 | bn[in++]=u.a.x->x; |
| 367 | } else { |
| 368 | bp[ip++]=u.a.x->x; |
| 369 | } |
| 370 | break; |
| 371 | case BoolExpr::NT_RLIN: |
| 372 | { |
| 373 | BoolVar b(home,0,1); |
| 374 | u.a.x->rl.post(home, b, !u.a.neg, ipls); |
| 375 | bp[ip++]=b; |
| 376 | } |
| 377 | break; |
| 378 | #ifdef GECODE_HAS_FLOAT_VARS |
| 379 | case BoolExpr::NT_RLINFLOAT: |
| 380 | { |
| 381 | BoolVar b(home,0,1); |
| 382 | u.a.x->rfl.post(home, b, !u.a.neg); |
| 383 | bp[ip++]=b; |
| 384 | } |
| 385 | break; |
| 386 | #endif |
| 387 | #ifdef GECODE_HAS_SET_VARS |
| 388 | case BoolExpr::NT_RSET: |
| 389 | { |
| 390 | BoolVar b(home,0,1); |
| 391 | u.a.x->rs.post(home, b, !u.a.neg); |
| 392 | bp[ip++]=b; |
| 393 | } |
| 394 | break; |
| 395 | #endif |
| 396 | case BoolExpr::NT_MISC: |
| 397 | { |
| 398 | BoolVar b(home,0,1); |
| 399 | u.a.x->m->post(home, b, u.a.neg, ipls); |
| 400 | bp[ip++]=b; |
| 401 | } |
| 402 | break; |
| 403 | default: |
| 404 | bp[ip++] = expr(home, ipls); |
| 405 | break; |
| 406 | } |
| 407 | } else { |
| 408 | u.b.l->post(home, t, bp, bn, ip, in, ipls); |
| 409 | u.b.r->post(home, t, bp, bn, ip, in, ipls); |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | void |
| 414 | NNF::rel(Home home, const IntPropLevels& ipls) const { |