multidepend.ncd 694 B

123456789101112131415161718192021222324252627282930
  1. process main {
  2. var("0") x;
  3. process_manager() mgr;
  4. var("false") backtrack_check;
  5. backtrack_point() point;
  6. If (backtrack_check) {
  7. val_equal(x, "2") a; # must not have rebound temporarily to A during backtracking
  8. assert(a);
  9. exit("0");
  10. };
  11. multiprovide("A");
  12. mgr->start("t1", "t1", {});
  13. val_equal(x, "1") a; # must have bound to A immediately
  14. assert(a);
  15. multiprovide("B") mgr;
  16. val_equal(x, "2") a; # must have rebound to B immediately
  17. assert(a);
  18. backtrack_check->set("true");
  19. point->go();
  20. }
  21. template t1 {
  22. multidepend({"B", "A"}) dep;
  23. num_add(dep.x, "1") new_x;
  24. dep.x->set(new_x);
  25. }