Proper unify_with_occurs_check/2 in SWI-Prolog?
问题 Got this strange behaviour. I was running these test cases: s1 :- Q=[[lambda,symbol(_3026),[cons,[quote,_3434], [quote,_3514]]],[quote,_3206]], P=[_3434|_3514], freeze(_3434, (write(foo), nl)), unify_with_occurs_check(P, Q). s2 :- Q=[[lambda,symbol(_3026),[cons,[quote,_3434], [quote,_3514]]],[quote,_3206]], P=[_3434|_3514], freeze(_3434, (write(foo), nl)), freeze(_3514, (write(bar), nl)), unify_with_occurs_check(P, Q). Now I get these results, where the outcome of s2 is wrong. The outcome is