我正在编写 OCaml 代码。其中一部分,我想检查两个算术表达式是否相等(比如 x+2+y == x+2*y-y+2)。在 Mathematica 中实现这个很简单,所以我只需要一些帮助来执行 Mathematica 并将结果返回到 OCaml 中。我的操作系统平台是 Linux。
干杯, Z.
最佳答案
您可以按照以下方式使用一些东西:
let channel_to_mathematica, channel_from_mathematica = open_process "mathematica"
in
Printf.fprintf channel_to_mathematica "Tell me if this is equal ...\n";
let answer_from_mathematica = Scanf.fscanf channel_from_mathematica ...
in
...
关于ocaml - 从 OCaml 程序调用 Mathematica,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3650674/