Advertisement
logicmoo

nb_setarg/3 to use destructive assignest

Aug 23rd, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. agg_all_1(min(X,W), Goal, min(X,W)) :-
  2. State = state(_,W),
  3. ( call(Goal),
  4. arg(1, State, M0),
  5. ( var(M0) -> true; (X<M0)),
  6. nb_setarg(1, State, X),
  7. nb_setarg(2, State, W),
  8. fail
  9. ;
  10. arg(1, State, X),
  11. arg(2, State, W)
  12. ).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement