Extending this question, what key presses are necessary to produce multiple solutions for SWI-Prolog?
Test code:
test(10).
test(1).
Attempted interaction:
?-test(X). // <- entered query
*pressing enter
produces the following:
?-test(X).
X = 10.
?- // <- typing prompt here, pressing ";" here enters semi-colon character in new line.
According to the manual:
The user can type the semi-colon (;) or spacebar, if (s)he wants another solution. Use the return key if you do not want to see the more answers. Prolog completes the output with a full stop (.) if the user uses the return key or Prolog knows there are no more answers. If Prolog cannot find (more) answers, it writes false.
When should these keys (semicolon/space) be pressed, so that the programs gives multiple solutions instead of starting a new query?
X = 10
and waited for you to either type the period or the semicolon. Because it didn't, it didn't think there were further solutions. Trymember(X, [1,2,3]).
to see what I'm talking about. – Daniel Lyons