Visualising Logic Production Systems programs

Let’s consider an implementation of the Game of Life in LPS, whose initial state leads to the appearance of a well-known pattern, the “blinker“. If you type go(T) in the query box you’ll get a timeline depicting fluents and actions:

Alive cells are represented by ‘-‘(X,Y) terms, births by live(Cell) and deaths by fire(Cell), over the 8 time cycles of the simulation.

This is precise, but a bit overwhelming. There’s an alternative visualisation, abstracting the above into a Deterministic Finite Automata – like, state transitions diagram. By using godfa(G) instead:

Arguably simpler to understand. Now, the Game of Life’s visual appeal did not emerge from geeky diagrams alike the above… but instead from the rendering of automata cells in their natural two-dimensional space. In order to get that, we need to add some information to the pure logic theory of the program, by telling LPS how to represent fluents and actions in space:

This d(Thing,Properties) meta predicate provides visualisation properties for their matching fluents and actions; so alive cells will be green circles with radius 5 pixels, birth and death will be explosion-like stars, etc.

By using go(T) again, the additional information is used to drive a PaperJS-based animation:

Actions are displayed transiently in the scene; the above single frame shows the black action of death killing two cells, while two reddish births occur, all over the live cell fluents in green. You can try all this by uncommenting lines 47-56 in http://demo.logicalcontracts.com/example/life.pl

Logical Contracts at RuleML+RR 2018

We’re sponsoring the 2018 Rule ML+RR conference,   September 18-21th in Luxembourg, hope to see you there!

This will be the second International Joint Conferences on Rules and Reasoning…  or, as the irreverent among us refer to, the “Real AI” conference – as opposed to Machine Learning, the Artificial Intelligence field which has gained a lot of attention recently and that many tend to confuse with “AI”.  Explainable, auditable, rule-based AI is critical to supervise and complement statistical approaches, as AI systems are deployed into critical roles.

One of RuleML+RR 2017’s tutorials introduced Logic Production Systems , our underlying logic language.

This year’s tutorials will include “Logic and Smart Contracts”, which will feature some examples running on the open source version of Logical Contract Server.

Slides available here.