Is leash(-all) broken?

Using: SWI-Prolog (threaded, 64 bits, version 8.5.0-49-g2f46def0c)
Windows build of the day: swipl-w64-2021-10-22.exe Fri Oct 22 03:12:29 2021 12,467,614

Was expecting leash(-all) to allow the capture of a trace to run to completion without requesting user input. Instead had to press space bar after each valid answer.

Minimal reproducible example (Click triangle to expand)

Source code.
Directory: C:/Users/Groot
File: family tree.pl

parent(pam,bob).
parent(tom,bob).

Show that goal runs and produces multiple valid answers.

?- working_directory(_,'C:/Users/Groot').
true.

?- ['family tree'].
true.

?- parent(Parent,bob).
Parent = pam ;
Parent = tom.

Now use leash(-all) with trace/0.

?- leash(-all).
true.

?- visible(+all).
true.

?- trace,parent(Parent,bob).
   Call: (11) family_tree:parent(_21260, bob)
   Unify: (11) family_tree:parent(pam, bob)
   Exit: (11) family_tree:parent(pam, bob)
Parent = pam ;   % < Had to press space bar here. It was unexpected. >
   Redo: (11) family_tree:parent(_21260, bob)
   Unify: (11) family_tree:parent(tom, bob)
   Exit: (11) family_tree:parent(tom, bob)
Parent = tom.  % < Had to press space bar here. It was unexpected. >

[trace]  ?- 

leash only affects the trace interaction, not toplevel interaction in general such as asking for alternatives. It has always been that way and AFAIK is that way in all Prolog systems (and least the ones I know about).

I reran the steps posted in Protocol/1 (Used to capture screen to file) which has never required a pressing of the space bar when leash(-all) is active. I even noted that in the steps.

Now it requires me to press the space bar when leash(-all) is active.


EDIT

I un-installed my current version of SWI-Prolog on Windows, checked that there were no other versions installed, e.g. 32-bit, installed 8.0.0 stable (swipl-8.0.0-1.x64.exe) and reran the steps for protocol/1. The space bar was required. :woozy_face:


Seems leash(-all) is working as it should.

If you do not want to stop at the prompt for alternatives, add , fail.. You can add a format/2 or writeln/1 to write the bindings, e.g

?- parent(X,Y), writeln(X-Y), fail.
1 Like