From: Mark Thom Date: Sun, 12 Dec 2021 17:58:42 +0000 (-0700) Subject: module-qualify incomplete goals in expand_goal/3 X-Git-Tag: v0.9.0^2~96 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=b056d40eba4ee1458c54f4d3bb2ca726e0b3e2cb;p=scryer-prolog.git module-qualify incomplete goals in expand_goal/3 --- diff --git a/src/examples/least_time.pl b/src/examples/least_time.pl index b93f0b5e..06eccd31 100644 --- a/src/examples/least_time.pl +++ b/src/examples/least_time.pl @@ -20,12 +20,6 @@ :- use_module(library(reif)). -permutation([], []). -permutation([X|Xs], Ys) :- - permutation(Xs, Yss), - select(X, Ys, Yss). - - valid_time([H1,H2,M1,M2], T) :- memberd_t(H1, [0,1,2], TH1), memberd_t(H2, [0,1,2,3,4,5,6,7,8,9], TH2), diff --git a/src/heap_iter.rs b/src/heap_iter.rs index df211339..c88ad721 100644 --- a/src/heap_iter.rs +++ b/src/heap_iter.rs @@ -439,7 +439,7 @@ mod tests { ] )); - for _ in 0..2 { //00000 { + for _ in 0..200000 { let mut iter = stackless_preorder_iter(&mut wam.machine_st.heap, heap_loc_as_cell!(0)); assert_eq!( diff --git a/src/heap_print.rs b/src/heap_print.rs index 9e7e2206..6f320839 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -1125,9 +1125,6 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { return self.push_list(max_depth); } - // let end_h = heap_pstr_iter.focus(); - // let end_cell = self.iter.heap[end_h]; - let end_h = heap_pstr_iter.focus(); let end_cell = heap_pstr_iter.focus; @@ -1146,7 +1143,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { if self.ignore_ops { if !self.print_string_as_functor(focus, max_depth) { - if end_cell == empty_list_as_cell!() { // end_cell.get_tag() == HeapCellValueTag::CStr { + if end_cell == empty_list_as_cell!() { append_str!(self, "[]"); } else { if self.outputter.ends_with(",") { diff --git a/src/loader.pl b/src/loader.pl index 20933268..a9e8f8d7 100644 --- a/src/loader.pl +++ b/src/loader.pl @@ -643,6 +643,7 @@ expand_meta_predicate_subgoals([SG | SGs], [MS | MSs], M, [ESG | ESGs], HeadVars MS >= 0 ) -> ( var(SG), + MS =:= 0, pairs:same_key(SG, HeadVars, [_|_], _) -> expand_subgoal(SG, MS, M, ESG, HeadVars) ; expand_subgoal(SG, MS, M, ESG0, HeadVars),