0

我有想要在网页中运行并返回结果的答案集编程求解器/接地器。如果我在本地机器上执行此操作,我将在命令提示符下运行类似的内容:

gringo queens.lp --const n=4 | clasp 2

或者

clingo muppets.lp

其中 lp 文件是输入,其余是参数。如何使用 exe 程序 cligo/gringo/clasp 在输入文件或网页文本区域的输入上运行它们,并显示结果,例如使用 alert()?我通过阅读另一篇文章尝试了这一点:

<body>
<script type="text/javascript">
   var oShell = new ActiveXObject("Shell.Application");
   var commandtoRun = "C:\\Users\\mdinar\\Documents\\NLU\\clingo.exe muppets.lp"; 
   oShell.ShellExecute(commandtoRun,"","","open","1");
   //document.alert(); //what do I pass on from the exe output to the alert box?
</script>
</body>
4

0 回答 0