Re: Prolog doesn't give multiple solutions to my goal.




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

.



Relevant Pages