Re: Prolog doesn't give multiple solutions to my goal.
- From: Joachim Schimpf <jschimpf@xxxxxxxxx>
- Date: Fri, 24 Aug 2007 16:03:57 +0100
Benjamin Johnston wrote:
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.
Actually, Bart's point was that, if the query was ground (variable-free),
some systems do NEVER prompt for a semicolon, even if there are multiple
solutions, e.g. member(a,[a,b,a]).
-- Joachim
.
- Follow-Ups:
- Re: Prolog doesn't give multiple solutions to my goal.
- From: Benjamin Johnston
- 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
- Re: Prolog doesn't give multiple solutions to my goal.
- From: Benjamin Johnston
- 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
|
|