follow marked variables to end in eager_stackful_iter (#2100, #2101)

This commit is contained in:
Mark
2023-10-10 16:02:38 -06:00
committed by Mark Thom
parent 4962c3df11
commit 902b08e657
2 changed files with 54 additions and 15 deletions

View File

@@ -43,12 +43,34 @@ test("term_variables#2097", (
T = [[[A|B]|A]|A], Vs == [A,B]
)).
test("term_variables#2100", (
termt2(T), term_variables(T,Vs),
T = [[T|A]|B], Vs == [A,B]
)).
test("term_variables#2101", (
termt3(T), term_variables(T,Vs),
T = [[[[A|B]|A]|A]|A], Vs == [A, B]
)).
termt(T) :-
T = [T1|T2],
T1 = [T3|A],
T3 = [A|_],
T2 = A.
termt2(T) :-
T = [T1|_B],
T1 = [T|_A].
termt3(T) :-
T = [T1|T0],
T1 = [T2|T3],
T2 = [T4|A],
T4 = [A|_],
T3 = A,
T0 = A.
main :-
findall(test(Name, Goal), test(Name, Goal), Tests),
run_tests(Tests, Failed),