module-qualify incomplete goals in expand_goal/3

This commit is contained in:
Mark Thom
2021-12-12 10:58:42 -07:00
parent 708c3bc3ce
commit b056d40eba
4 changed files with 3 additions and 11 deletions

View File

@@ -20,12 +20,6 @@
:- use_module(library(reif)). :- use_module(library(reif)).
permutation([], []).
permutation([X|Xs], Ys) :-
permutation(Xs, Yss),
select(X, Ys, Yss).
valid_time([H1,H2,M1,M2], T) :- valid_time([H1,H2,M1,M2], T) :-
memberd_t(H1, [0,1,2], TH1), memberd_t(H1, [0,1,2], TH1),
memberd_t(H2, [0,1,2,3,4,5,6,7,8,9], TH2), memberd_t(H2, [0,1,2,3,4,5,6,7,8,9], TH2),

View 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)); let mut iter = stackless_preorder_iter(&mut wam.machine_st.heap, heap_loc_as_cell!(0));
assert_eq!( assert_eq!(

View File

@@ -1125,9 +1125,6 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
return self.push_list(max_depth); 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_h = heap_pstr_iter.focus();
let end_cell = 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.ignore_ops {
if !self.print_string_as_functor(focus, max_depth) { 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, "[]"); append_str!(self, "[]");
} else { } else {
if self.outputter.ends_with(",") { if self.outputter.ends_with(",") {

View File

@@ -643,6 +643,7 @@ expand_meta_predicate_subgoals([SG | SGs], [MS | MSs], M, [ESG | ESGs], HeadVars
MS >= 0 MS >= 0
) -> ) ->
( var(SG), ( var(SG),
MS =:= 0,
pairs:same_key(SG, HeadVars, [_|_], _) -> pairs:same_key(SG, HeadVars, [_|_], _) ->
expand_subgoal(SG, MS, M, ESG, HeadVars) expand_subgoal(SG, MS, M, ESG, HeadVars)
; expand_subgoal(SG, MS, M, ESG0, HeadVars), ; expand_subgoal(SG, MS, M, ESG0, HeadVars),