将 Prolog 与 C# 集成

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/181855/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 16:54:57  来源:igfitidea点击:

Integrating Prolog with C#

c#prologintegrate

提问by TK.

Does anyone know of a nice (and preferably free) way to integrate Prolog and C#?

有谁知道集成 Prolog 和 C# 的好方法(最好是免费的)?

Im looking to create a Prolog dll or similar to call from my managed code, and retrieve an answer once all the processing has been complete. Im looking for it to be predominantly one sided (c# calls Prolog).

我希望创建一个 Prolog dll 或类似的东西来从我的托管代码中调用,并在所有处理完成后检索答案。我希望它主要是一面(c# 调用 Prolog)。

I have seen this questionwhich talks about Prologs real world usage but I was wondering if anyone had either any experience with c# & Prolog? or a nice tutorial/article?

我看过这个问题,它讨论了 Prologs 现实世界的用法,但我想知道是否有人对 c# 和 Prolog 有任何经验?或一个不错的教程/文章?

回答by OnesimusUnbound

Perhaps P#will be useful for you

也许P#对你有用

回答by zuber

You can take a look at Yield Prolog.

你可以看看Yield Prolog

Yield Prolog uses yieldkeyword in C# (and Python, and JavaScript) and custom Variableclass to simulate Prolog machine. This way, you get a Prolog API in your favourite language. You don't need to connect your main language with P# or similiar projects.

Yield Prolog 使用yieldC#(以及 Python 和 JavaScript)中的关键字和自定义Variable类来模拟 Prolog 机器。这样,您就可以使用您喜欢的语言获得 Prolog API。您不需要将您的主要语言与 P# 或类似项目连接起来。

回答by Torbj?rn Josefsson

It's not free, but Sicstus Prologallows connection to C# and Java

它不是免费的,但Sicstus Prolog允许连接到 C# 和 Java

This is the Prolog implementation we use at our company, and it is very fast and useful.

这是我们公司使用的 Prolog 实现,它非常快速和有用。

回答by Archie

You can use ECLiPSe Prolog. i have integrated it with VC8. it would be better to use VC8 instead of C#.

您可以使用 ECLiPSe Prolog。我已将其与 VC8 集成。使用 VC8 而不是 C# 会更好。

回答by James Reynolds

C#Prolog, available from SourceForge(Prolog interpreter written in C#)

C#Prolog,可从 SourceForge 获得(用 C# 编写的 Prolog 解释器)

回答by mdm

If deployment with a full prolog implementation is not a problem you can use SWI-Prolog and talk to it via XPCE and sockets.

如果使用完整的 prolog 实现部署不是问题,您可以使用 SWI-Prolog 并通过 XPCE 和套接字与它交谈。

回答by Anniepoo

If your prolog is swi-prolog, you have two choices. The older, and essentially deprecated, version is http://www.swi-prolog.org/contrib/CSharp.html

如果您的 prolog 是 swi-prolog,您有两种选择。较旧且基本上已弃用的版本是http://www.swi-prolog.org/contrib/CSharp.html

The newer, much better one is swicli. http://www.swi-prolog.org/contrib/NetMono.html

更新、更好的一个是 swicli。 http://www.swi-prolog.org/contrib/NetMono.html