Why does Prolog fail?
From: Alex Povzner (alex_at_siberlogic.com)
Date: 04/05/04
- Next message: bart demoen: "Re: Why does Prolog fail?"
- Previous message: Paul Singleton: "Re: Playing sounds with swi"
- Next in thread: bart demoen: "Re: Why does Prolog fail?"
- Reply: bart demoen: "Re: Why does Prolog fail?"
- Reply: Bill Spight: "Re: Why does Prolog fail?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: bart demoen: "Re: Why does Prolog fail?"
- Previous message: Paul Singleton: "Re: Playing sounds with swi"
- Next in thread: bart demoen: "Re: Why does Prolog fail?"
- Reply: bart demoen: "Re: Why does Prolog fail?"
- Reply: Bill Spight: "Re: Why does Prolog fail?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|