remove setof/3, bagof/3 non-determinism (#270)
This commit is contained in:
@@ -456,7 +456,10 @@ group_by_variants([V-S|Pairs], [V-Solution|Solutions]) :-
|
|||||||
group_by_variants(Pairs0, Solutions).
|
group_by_variants(Pairs0, Solutions).
|
||||||
group_by_variants([], []).
|
group_by_variants([], []).
|
||||||
|
|
||||||
iterate_variants([V-Solution|GroupSolutions], V, Solution).
|
iterate_variants([V-Solution|GroupSolutions], V, Solution) :-
|
||||||
|
( GroupSolutions == [] -> !
|
||||||
|
; true
|
||||||
|
).
|
||||||
iterate_variants([_|GroupSolutions], Ws, Solution) :-
|
iterate_variants([_|GroupSolutions], Ws, Solution) :-
|
||||||
iterate_variants(GroupSolutions, Ws, Solution).
|
iterate_variants(GroupSolutions, Ws, Solution).
|
||||||
|
|
||||||
@@ -491,7 +494,10 @@ bagof(Template, Goal, Solution) :-
|
|||||||
iterate_variants(GroupedSolutions, Witnesses, Solution).
|
iterate_variants(GroupedSolutions, Witnesses, Solution).
|
||||||
|
|
||||||
iterate_variants_and_sort([V-Solution0|GroupSolutions], V, Solution) :-
|
iterate_variants_and_sort([V-Solution0|GroupSolutions], V, Solution) :-
|
||||||
sort(Solution0, Solution).
|
sort(Solution0, Solution),
|
||||||
|
( GroupSolutions == [] -> !
|
||||||
|
; true
|
||||||
|
).
|
||||||
iterate_variants_and_sort([_|GroupSolutions], Ws, Solution) :-
|
iterate_variants_and_sort([_|GroupSolutions], Ws, Solution) :-
|
||||||
iterate_variants_and_sort(GroupSolutions, Ws, Solution).
|
iterate_variants_and_sort(GroupSolutions, Ws, Solution).
|
||||||
|
|
||||||
|
|||||||
@@ -3169,7 +3169,8 @@ impl MachineState {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn setup_built_in_call(&mut self, ct: BuiltInClauseType) {
|
pub(super)
|
||||||
|
fn setup_built_in_call(&mut self, ct: BuiltInClauseType) {
|
||||||
self.num_of_args = ct.arity();
|
self.num_of_args = ct.arity();
|
||||||
self.b0 = self.b;
|
self.b0 = self.b;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user