XSB Prolog Hosting on the Server

I wanted to host XSB Prolog on a server. Can someone please tell me what this procedure is? The following git link explains how to host SWIPL on the server, but the same does not work for XSB https://github.com/SWI-Prolog/swish

Your help is greatly appreciated.

+4
source share
1 answer

If you want to host XSB on the server, just use the subprocesses that will be created in XSB .

see XSB manual

spawn_process(+CmdSpec,-StreamToProc,-StreamFromProc,-ProcStderrStream,ProcId)

Create a new process specified by CmdSpec

XSB XSB, . XSB. XSB, , :

`| ?-` spawn_process([xsb], To, From,Err,_),
     file_write(To,’assert(p(1)).’),
     file_nl(To),
     file_flush(To,_),
     file_write(To,’p(X), writeln(X).’),
     file_nl(To),
     file_flush(To,_),
     file_read_line_atom(From,XX).

`XX = 126`
`yes`
`| ?-`
"Here the parent **XSB** process sends "
`assert(p(1)).`
" and then "
`p(X), writeln(X).`
" to the spawned XSB subprocess."
"The latter evaluates the goal and prints (via " `writeln(X)` ") 
to its standard output..."
+1

Source: https://habr.com/ru/post/1661068/


All Articles