3 ms·
though be careful how you do this -- it's easy to end up with a divergent program, as prolog tries to: * prove X(A,B) * realizes that it can prove this if it
by jimwise 15y ago
though be careful how you do this -- it's easy to end up with a divergent program, as prolog tries to:
* prove X(A,B)
* realizes that it can prove this if it can prove transitive(X, A, B, C), and then prove X(B,A)
* realizes that it can prove this if it can prove transitive(X, B, A, C), and then prove X(A,B)
* ...
- swannodette 15y agoSuch behavior is easily avoided with tabling.
- jimwise 15y agoThere are a couple of ways around this -- all of which fall under "be careful". :-)