31

Does anyone know of a nice (and preferably free) way to integrate Prolog and 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).

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

Community
  • 1
  • 1
TK.
  • 46,577
  • 46
  • 119
  • 147
  • 2
    Hey Greg, I was curious what route you'd taken with this Prolog/C# integration and any luck you've had. In same boat here. Thx. -Al – mirezus Nov 12 '08 at 02:01

7 Answers7

8

You can take a look at Yield Prolog.

Yield Prolog uses yield keyword in C# (and Python, and JavaScript) and custom Variable class 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.

zuber
  • 3,449
  • 2
  • 24
  • 19
3

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

Abel
  • 56,041
  • 24
  • 146
  • 247
3

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

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

Torbjörn Josefsson
  • 1,301
  • 1
  • 7
  • 2
  • 1
    I have used Sicstus in the past and found it to be a very good product. I wasn't aware that it can connect with c#, the only problem now it the rather large licence fee! – TK. Feb 16 '09 at 08:28
2

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

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

Anniepoo
  • 2,152
  • 17
  • 17
2

Perhaps P# will be useful for you

Abel
  • 56,041
  • 24
  • 146
  • 247
OnesimusUnbound
  • 2,886
  • 3
  • 30
  • 40
0

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

mdm
  • 5,528
  • 5
  • 29
  • 28
0

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

Archie
  • 2,564
  • 8
  • 39
  • 50