A C# implementation of Prolog
// PM> Install-Package CSProlog -pre
using System;
using Prolog;
class Program
{
static void Main(string[] args)
{
var prolog = new PrologEngine(persistentCommandHistory: false);
// 'socrates' is human.
prolog.ConsultFromString("human(socrates).");
// human is bound to die.
prolog.ConsultFromString("mortal(X) :- human(X).");
// Question: Shall 'socrates' die?
var solution = prolog.GetFirstSolution(query: "mortal(socrates).");
Console.WriteLine(solution.Solved); // = "True" (Yes!)
}
}
Prolog Engine
Unit Tests
Dotnet Core Console Interactive Interpreter (tested in linux and windows)
Earlier release documents can be found in README (2007-2014).pdf.
- Remove all pragma directives and target modern Net frameworks.
- BREAKING CHANGE: Remove "SAMPLES, TESTING & EXPERIMENTAL" predefined predicates. (including CHAT-80 support)
- Fix: "help" predefined predicate dose not work.
- Enhance: GetAllSolutions can work with null file name.
- Support: .NET Standard 1.4 (.NET Core) and UWP
- BREAKING CHANGE: Remove dependency of "System.Windows.Forms".
- NuGet package release
Earlier release notes can be found in README (2007-2014).pdf.