From: Mark Thom Date: Fri, 11 Apr 2025 04:06:44 +0000 (-0700) Subject: restore more tabu_list use to compare_term_tests (#2633) X-Git-Tag: v0.10.0~35^2~44 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=549a26dd0359256b44cb92c4ef4d9603ee6e8db7;p=scryer-prolog.git restore more tabu_list use to compare_term_tests (#2633) --- diff --git a/src/machine/machine_state_impl.rs b/src/machine/machine_state_impl.rs index 58535f03..d2dfc18d 100644 --- a/src/machine/machine_state_impl.rs +++ b/src/machine/machine_state_impl.rs @@ -628,6 +628,12 @@ impl MachineState { (HeapCellValueTag::PStrLoc, l1) => { read_heap_cell!(v2, (HeapCellValueTag::PStrLoc, l2) => { + if tabu_list.contains(&(l1, l2)) { + continue; + } + + tabu_list.insert((l1, l2)); + match self.heap.compare_pstr_segments(l1, l2) { PStrSegmentCmpResult::Continue(v1, v2) => { self.pdl.push(v1); @@ -642,6 +648,12 @@ impl MachineState { } } (HeapCellValueTag::Lis, l2) => { + if tabu_list.contains(&(l1, l2)) { + continue; + } + + tabu_list.insert((l1, l2)); + let (c, succ_cell) = self.heap.last_str_char_and_tail(l1); self.pdl.push(succ_cell); @@ -651,10 +663,16 @@ impl MachineState { self.pdl.push(heap_loc_as_cell!(l2)); } (HeapCellValueTag::Str, s) => { + if tabu_list.contains(&(l1, s)) { + continue; + } + let (name, arity) = cell_as_atom_cell!(self.heap[s]) .get_name_and_arity(); if name == atom!(".") && arity == 2 { + tabu_list.insert((l1, s)); + let (c, succ_cell) = self.heap.last_str_char_and_tail(l1); self.pdl.push(heap_loc_as_cell!(s+2));