Some stuff returns false on the ScalaJS version but not on the JVM version
This is a simple prolog-like relational language. It's like a programming language where functions only return true or false, but by leaving an argument as a variable, you can make the engine solve for that variable. The evaluation is similar to MiniKanren, but not quite the same.
The engine is written in Scala, but this frontend uses a partial embedding into JavaScript.
Write all the variables you might use in the variables box, comma separated
Write all your facts in the facts box, separated by semicolons. Facts look like a function call. Declaring a fact tells the engine that that fact holds for the given values, which should not be variables.
Write all your relations in the relations box, separated by semicolons. Relation declarations have the form:
relation_name(args) :- bodyA relation is like a conditional fact. If the body holds, then the relation holds for the given arguments.
The body of a relation is actually plain JavaScript, but it has to be
of type Formula
, which is formed by the terms Var, Const, Tuple
and the operators Eq, And, Or
, or a fact call or relation call.