4
我想在服務器上託管XSB Prolog。有人可以告訴我程序是什麼嗎? 以下的git的鏈接解釋如何舉辦SWIPL的服務器上,但同樣沒有爲XSB 工作https://github.com/SWI-Prolog/swish在服務器上託管XSB Prolog
你的幫助是極大的讚賞。
我想在服務器上託管XSB Prolog。有人可以告訴我程序是什麼嗎? 以下的git的鏈接解釋如何舉辦SWIPL的服務器上,但同樣沒有爲XSB 工作https://github.com/SWI-Prolog/swish在服務器上託管XSB Prolog
你的幫助是極大的讚賞。
如果你想舉辦XSB在服務器上,只需要用子進程將催生對XSB。
spawn_process(+CmdSpec,-StreamToProc,-StreamFromProc,-ProcStderrStream,ProcId)
菌種由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..."