]> Repositorios git - scryer-prolog.git/commitdiff
module-qualify incomplete goals in expand_goal/3
authorMark Thom <[email protected]>
Sun, 12 Dec 2021 17:58:42 +0000 (10:58 -0700)
committerMark Thom <[email protected]>
Fri, 7 Jan 2022 04:44:41 +0000 (21:44 -0700)
src/examples/least_time.pl
src/heap_iter.rs
src/heap_print.rs
src/loader.pl

index b93f0b5e4cd3c9375702c7727e4b813d760c7f6f..06eccd314ee147cfd2d60a738b0b4fdba8a4eca4 100644 (file)
 :- 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),
index df211339e20024f99659f656e4a4eea35afcac06..c88ad721aa3b6fa950824c0506fce65ca7b6fbbc 100644 (file)
@@ -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!(
index 9e7e2206647ab6f486e01be90e9a410198bad84e..6f320839a3e56b44cdfd7d06c47abea35799b10b 100644 (file)
@@ -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(",") {
index 209332682a29adbd6e1a81f624df68aada36db7b..a9e8f8d7f45197f7a2d2fa04d31113a4aa0bf00b 100644 (file)
@@ -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),