The resulting JOut binding is using the default NLG method, so it generates statements like “winner holds for testgame and bob”, but it is not using the #pred statements in the loaded file, which would cause it to generate statements like “bob is the winner of testgame.” The same code in SWISH works fine, if I query ? winner(G,P)..
How can I modify the query to obtain the justification that is displayed in SWISH, using the natural language forms set out the #pred statements?
There are two potential problems. One is that if you load a s(CASP) file using Prolog consult/1, etc. you must be aware that if the file starts with #, the first line is taken as comment. This allows for #!/usr/bin/env swipl to make a Prolog file executable on POSIX systems. So, leave the first line blank.
Second, explicitly using scasp_embed probably gets the module context wrong. Doing all in the user module I get the desired results using
A simpler alternative might be to use the (demo) webserver. It is running at s(CASP) web server and its sources are in examples/dyncall/http.pl. Simply run as swipl examples/dyncall/http.pl. First pull the latest sCASP as there was a bug.