Prolog parser, compiler and interpreter in Javascript
- No server-code required
- Fact
- Rule
- Cut operator
! - Conjunction
,and disjunction; trueandfalseboolean- Operators (for more details, please see
lexer.jsis+,-,*and/arithmetic operators=unification=:=,=\=,>,<,=<and>=arithmetic operators+,-andnotunary operators
builtinandusernamespaces- But no builtin facts or rules are provided out-of-the-box
- List with
|tail operator ?-unary operatorfail
The query operator is not standard in prolog source code. It is provided as convenience and used in the online demo.
The demo can be accessed through here.
The compiler can be fed directly with Javascript objects. The classes Functor and Token can be used for this purpose.
To understand how to construct "sentences" using these objects, I would encourage looking at the /tests and experimenting with
Prolog.parse_per_sentence.
For more information, please contact Jean-Lou Dupont on G+.