correct is_cyclic again for non-variable ref cells (#2116)

This commit is contained in:
Mark
2023-10-15 01:28:42 -06:00
parent 3fb2e451a2
commit 3a6aee72a3
2 changed files with 7 additions and 1 deletions

View File

@@ -273,8 +273,10 @@ impl<'a, UMP: UnmarkPolicy> StacklessPreOrderHeapIter<'a, UMP> {
fn is_cyclic(&self, var_current: usize, var_next: usize) -> bool {
if self.heap[var_next].is_var() {
!self.heap[var_next].get_forwarding_bit() && var_current != var_next
} else if self.heap[var_next].is_ref() {
self.heap[var_next].get_mark_bit()
} else {
self.heap[var_next].is_ref()
false
}
}

View File

@@ -173,6 +173,10 @@ test("acyclic_term#2114", (
A=B*B, acyclic_term(A)
)).
test("acyclic_term#2116", (
A=B*B,B=[]*[], acyclic_term(A)
)).
main :-
findall(test(Name, Goal), test(Name, Goal), Tests),
run_tests(Tests, Failed),