v0.1.0
The first release of DotProlog — a Prolog implementation for .NET 10, built as a first-class
SDK language rather than an interpreter you embed. It compiles Prolog to bytecode and runs it on a
virtual machine written in C#, emits no CLR IL, and therefore works unchanged inside a NativeAOT
binary: a published executable can consult a .pl file it has never seen and run it.
Added
- The language. Facts, rules, unification, backtracking, and the control constructs
,/2,
;/2,->/2,*->/2,\+/1,!/0, andcall/1..8, with ISO cut scoping in clause bodies and
in meta-called goals alike. Exceptions throughthrow/1andcatch/3, with every engine error
raised as a catchableerror(Formal, Context)term. - All solutions.
findall/3,bagof/3,setof/3,forall/2, andaggregate_all/3. - The database.
assertz/1,asserta/1,retract/1,retractall/1,clause/2,abolish/1,
and:- dynamic, with logical-update-view semantics. - A standard library. Text conversion, the list library, sorting, higher-order predicates,
copy_term/2,term_variables/2,succ/2,plus/3, andformat/1,2,3with column stops. - Operators.
op/3andcurrent_op/3, and a term writer that honours them — whatever
writeq/1produces reads back as the same term. - Grammars.
-->/2translated at load time, withphrase/2,3,{}/1, pushback lists, and
terminals written as lists or double-quoted strings. - Streams.
open/3,4,close/1, the current-stream predicates,read/1,2,read_term/2,3,
character I/O,with_output_to/2,term_to_atom/2, andread_term_from_atom/3. - Modules.
:- module/2hides what its export list omits, withuse_module/1,2,Module:Goal,
and:- meta_predicate/1. .dplprojprojects throughDotProlog.Sdk, an additive MSBuild SDK. A.dplicontract turns
a Prolog predicate into an idiomatic .NET method, consumable from C#, F#, and Visual Basic.dotnet newtemplates:prolog-consoleandprolog-lib.dotnet prolog run, a .NET tool.- Testing.
DotProlog.Testingruns a project'stest_*predicates under
Microsoft.Testing.Platform, each in a fresh engine. - Embedding.
PrologEngine.Query/1enumerates solutions lazily, marshalling each binding into a
PrologValue;PrologHostbinds a predicate once and calls it asProve,CallOnce, or
CallAll.
Compatibility
- Requires .NET 10. Packages are platform-neutral; NativeAOT publishing is exercised on
Linux, Windows, and macOS. - No independent conformance claim. 244 cases encoded from ISO/IEC 13211-1 pass, but they are
DotProlog's own reading of the standard rather than a third-party suite. Known differences are
listed in COMPATIBILITY.md. - There is no string type: an atom is the only text term, and the SWI-Prolog string predicates are
absent rather than aliased to atoms.
Known limitations
dotnet testcannot yet drive a.dplprojtest project; run the test host directly.- No binary streams and no stream repositioning.
- No first-argument clause indexing, so a predicate with many facts is scanned linearly.
plcand the foreign-predicate source generator are designed but not implemented.
Full Changelog: https://github.com/kidoz/dotprolog/commits/v0.1.0