Re: Prolog doesn't give multiple solutions to my goal.
- From: Benjamin Johnston <superhero@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Aug 2007 02:36:43 -0700
Try ?- compute([put_a,put_x_or_y,put_x_or_y,put_b]), fail.
Most Prolog systems quite stupidly give only one answer to a ground query.
You are not the first one to fall in that unnecessary trap.
Some Prolog systems allow you to change that behaviour.
Just to expand slightly on Bart's reply...
If you press ; (semicolon) or ;<enter> or just <enter> (depending on
your prolog) you may get those other answers that you were expecting.
Because this "feature" isn't explained clearly on the screen in most
Prolog systems, it can be easy for a beginner to miss.
-Benjamin Johnston
.
- Follow-Ups:
- Re: Prolog doesn't give multiple solutions to my goal.
- From: Joachim Schimpf
- Re: Prolog doesn't give multiple solutions to my goal.
- From: Cesar Rabak
- Re: Prolog doesn't give multiple solutions to my goal.
- References:
- Prolog doesn't give multiple solutions to my goal.
- From: Giovanni Gherdovich
- Re: Prolog doesn't give multiple solutions to my goal.
- From: Bart Demoen
- Prolog doesn't give multiple solutions to my goal.
- Prev by Date: Re: Prolog doesn't give multiple solutions to my goal.
- Next by Date: Re: Prolog doesn't give multiple solutions to my goal.
- Previous by thread: Re: Prolog doesn't give multiple solutions to my goal.
- Next by thread: Re: Prolog doesn't give multiple solutions to my goal.
- Index(es):
Relevant Pages
|
|