Changing prompt for s(CASP)

SWI-Prolog can change the prompt, trace/1 does this, e.g.

?- append([a],[b],L).
L = [a, b].

?- trace.
true.

[trace]  ?- append([a],[b],L).
L = [a, b].

Using ? with s(CASP) is not always remembered.

Would it be possible to enter scasp, like how trace is entered to change modes, that changes the prompt to [s(CASP)] so that one does not have to remember the ?. Also this would make it evident when such queries are posted that they are s(CASP), e.g.

?- genotype(1,[2,1,2]),genotype(2,[1,2,1]).
true.

?- scasp.
true.

[s(CASP)] ?- genotype(1,[2,1,2]),genotype(2,[1,2,1]).
#### s(CASP) model

* haplotype holds for [0, 1, 0]
...

Note: If you find this topic via a search, the above [s(CASP)] prompt was edited in by hand. SWI-Prolog does not currently work this way.

It is worth considering. I don’t know yet. Surely, ? Goal easily confuses people. A s(CASP) mode creates a (another) stateful toplevel. That doesn’t work in SWISH as there is no state between queries. These days I almost always do

?- gtrace, goal.

rather than the (IMO) old school

?- gtrace.
[trace] ?- goal.
1 Like

That is what I was thinking but sometimes you note something that I have never seen.

Since adding adding a new stateful toplevel would just add more puzzlement I will put this in the needs more thought pile.