diff --git a/src/lib/clpz.pl b/src/lib/clpz.pl index fda2f309..b7fa0ea7 100644 --- a/src/lib/clpz.pl +++ b/src/lib/clpz.pl @@ -5884,10 +5884,12 @@ difference_arcs([V|Vs], FL0) --> writeln(T) :- write(T), nl. +:- meta_predicate must_succeed(0). + must_succeed(G) :- - (G -> true - ;write(failed-G), halt - ). + ( G -> true + ; throw(failed-G) + ). enumerate([], _) --> []. enumerate([N|Ns], V) --> @@ -6047,6 +6049,8 @@ remove_attr(Var, Attr) :- functor(Term, Attr, 1), put_atts(Var, -Term). +:- meta_predicate with_local_attributes(?, 0, ?). + with_local_attributes(Vars, Goal, Result) :- catch((Goal, maplist(del_all_attrs, Vars),