

The simplest example of inference use is connecting 2 points with a path. In other words, inference connects 2 given states (or partially observed states) with a chain of rewrite rules. Probabilistic inference in MarkovJunior allows to impose constraints on the future state, and generate only those runs that lead to the constrained future. Like in REFAL, Markov nodes can be nested: once we go into a child node, we ignore outer nodes until the child branch completes. Dungeons without cycles are pretty boring, since the player has to return through already explored zones.

For example, MazeBacktracker (animation on the left below) is a list of 2 rewrite rules: In its basic form, a MarkovJunior program is an ordered list of rewrite rules.

MarkovJunior is named after mathematician Andrey Andreyevich Markov, who defined and studied what is now called Markov algorithms. MarkovJunior is a probabilistic programming language where programs are combinations of rewrite rules and inference is performed via constraint propagation.
