To use P#, you require a C# compiler and the ability to run C# programs.
To install P#, download and unzip the following file: Psharp-1.1.3.zip. This file contains:
The source code (both Prolog and C#) is contained in the demo zip file which can be downloaded below.
You can either ensure that there is a copy of the Psharp DLL in the
same directory as each of your executable programs or you can add the DLL
to the Global Assembly Cache (GAC). To do this in Windows XP drag the
DLL file into the folder C:\windows\assembly
.
To translate a Prolog source file, called myfile.pl, say, run P# and enter the command
compile('myfile').
then press CTRL-Z to exit P#.
If the compilation was successful there will now be a number of C# files in the directory. Copy the file Loader.cs into the directory as well.
Assuming that your csc
(C# compile) command is reachable from the path, and that you
have put your Psharp.dll file in the folder C:\psharp, say, you
should then be able to compile these into a P# application with the following command:
csc /r:"C:\psharp\Psharp.dll" /out:MyProgram.exe *.cs
This generates an executable file which when run will load the P# DLL and start executing
the predicate main/0
in the Prolog file you compiled. To run another predicate
of arity zero, say my_pred
you can use the command
MyProgram.exe MyPred
Notice how Prolog predicate names are renamed (if in doubt just look at the class name in the generated C# file).
Using P# is very similar to using Prolog Cafe (P# 1.1 is based on Prolog Cafe version 0.44). See the manual for details of the differences between P# and Prolog Cafe.
A screenshot of the Graphical User Interface for P#, this can be downloaded above.
A screenshot of a Web Application which allows the user to play a game of noughts and crosses (not included in the demo distribution).
A screenshot of an object oriented assistant, which allows the user to query the C# namespaces or Java packages.
A screenshot of a class hierarchy viewer.
A screen shot of the agents example discussed in the concurrency paper.