From: Mark Thom Date: Thu, 18 Mar 2021 18:50:12 +0000 (-0600) Subject: fix findall/4 (#873) X-Git-Tag: v0.9.0~118 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=4623e9d7fcfc1794e55e32c4bd5cc38032568c61;p=scryer-prolog.git fix findall/4 (#873) --- diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index 983612c8..18a5f38c 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -682,9 +682,8 @@ findall(Template, Goal, Solutions) :- ). -% :- meta_predicate '$iterate_find_all_diff'(?, 0, ?, ?, ?). - :- non_counted_backtracking '$iterate_find_all_diff'/5. + '$iterate_find_all_diff'(Template, Goal, _, _, LhOffset) :- call(Goal), '$copy_to_lh'(LhOffset, Template), diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index c7fcb154..e0f43472 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -467,7 +467,7 @@ impl MachineState { } else { self.p.local() + 1 }; - + Ok(self.p = CodePtr::REPL(repl_code_ptr, p)) } @@ -3267,8 +3267,7 @@ impl MachineState { let solutions = self[temp_v!(2)]; let diff = self[temp_v!(3)]; - (self.unify_fn)(self, solutions, Addr::EmptyList); - (self.unify_fn)(self, diff, Addr::EmptyList); + (self.unify_fn)(self, solutions, diff); } else { let h = self.heap.h(); let mut last_index = h;