Skip to content

Latest commit

 

History

History
107 lines (67 loc) · 3.01 KB

README.md

File metadata and controls

107 lines (67 loc) · 3.01 KB

[NProlog]

C# implementation of Prolog ported from Java implementaion Projog

Clp is not included.

Mockito tests are disabled.

Most of tests are passed, you may use it safely.

[New Features]

Now we support Chinese/Unicode chars in Atoms/Variables.

Prolog uses lower case letters to compose Atoms, and upper case letters for Variables.

Languages such as Chinese have no meaning of lower/upper cases which makes no way to distinguish Atoms and Variables.

So we added a prefix "@" in front of a variable to indicate it.

So that we can code:

-: assert(like(a,b)).

-: assert(like(a,c)).

-: likes(a,@哪一个).

also,

-: assert(喜欢(小明,小红)).

-: assert(喜欢(小明,小黄)).

-: 喜欢(小明,@谁).

Please try it out.


Maven Central Build Status License

About

Projog provides an implementation of the Prolog programming language for the Java platform. Prolog is a declarative logic programming language where programs are represented as facts and rules.

Projog can be used as a stand-alone console application or embedded in your Java applications as a Maven dependency.

Resources

Quick Start Guide

The following commands will download Projog and start the console:

$ wget http://projog.org/downloads/projog-0.8.0.zip
$ jar xvf projog-0.8.0.zip
$ cd projog-0.8.0
$ chmod u+x projog-console.sh
$ ./projog-console.sh

When the console has started you can enter the following command:

W=X, X=1+1, Y is W, Z is -W.

Which should generate the following response:

W = 1 + 1
X = 1 + 1
Y = 2
Z = -2

yes

To exit the console type quit.

Maven Artifacts

To include Projog within your project, just add this dependency to your pom.xml file:

<dependency>
   <groupId>org.projog</groupId>
   <artifactId>projog-core</artifactId>
   <version>0.8.0</version>
</dependency>

Reporting Issues

We would be grateful for feedback. If you would like to report a bug, suggest an enhancement or ask a question then please create a new issue.