Why does Prolog fail?

From: Alex Povzner (alex_at_siberlogic.com)
Date: 04/05/04


Date: Mon, 5 Apr 2004 12:24:40 -0400

Experts,

I am using the following simple code with SWI Prolog:

fact(car,have,wheel).
fact(car,contain,engine).
fact(car,contain,cylinder).
fact(contain,specialize,have).

fact(X,G,Y):-fact(S,specialize,G),fact(X,S,Y).

Then I use the following query:

fact(car,have,X)

SWI prolog (and some other prolog interpreters) fails with Out of Stack
Error. I fail to see any infinite recursion in the code,

Alex



Relevant Pages