View difference between Paste ID: NWy4Zxsr and 5UeSERqu
SHOW: | | - or go back to the newest paste.
1-
agg_all_(min(X,W), Goal, min(X,W)) :-
1+
agg_all_1(min(X,W), Goal, min(X,W)) :-
2-
  State = state(X,W,LastMin),
2+
  State = state(_,W),
3
  (  call(Goal),
4-
     arg(1, State, M0),
4+
      arg(1, State, M0),
5-
      M is min(M0,X),
5+
      (   var(M0) -> true; (X<M0)),
6-
      M \== LastMin,
6+
     nb_setarg(1, State, X),
7-
     nb_setarg(1, State, M),
7+
8
     fail
9-
     nb_setarg(3, State, M),
9+
10
     arg(1, State, X),
11
     arg(2, State, W)
12
  ).