mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.
BSD 3-Clause "New" or "Revised" License
1.93k stars 116 forks source link

(=..)/2 and rational trees #2414

Open UWN opened 4 weeks ago

UWN commented 4 weeks ago

?- T = +T, \+acyclic_term(T).
   T = +T. % so we are using rational tree unification
?- T = [.,_,_], T =.. T.
   false, unexpected.
   T = ['.','.',_I],_I=['.',_I]. % expected, but not found
?- T = [.,_,_], T =.. T, \+acyclic_term(T).
   idem.
?- T = [.,_,_], T =.. T, throw(found). % to be sure that it is not the top level
   false, unexpected.
   throw(found). % expected, but not found
?- T = [_|_], T =.. T.
   T = ['.','.',[]|'.'], unexpected.
   T = ['.','.',_I],_I=['.',_I]. % expected, but not found