Rulebook Documentation

Rulebook is a statically-checked imperative language that turns interactive behaviour—reinforcement-learning environments, video-games, or in general complex interactive subsystems—into something you can query, replay, fuzz, and formally verify.

4hammer (our flagship demo) shows Rulebook in action.

Why Rulebook?

Under the hood

Rulebook’s defining idea is the notion of Action functions with SPIN properties, which make all of the above possible.

Integration

Rulebook compiles to one shared library (or WebAssembly module) with a C-compatible ABI and generated bindings for C, C++, C#, Python, and Godot Script. Use it the way SQL complements those languages—drop it in wherever interactive logic is the hard part. Rulebook puts action functions on the stack, unless you want it on the heap. Zero mallocs unless explicitly requested by the user.

Reinforcement Learning Docs:

UI, Controller and Gameplay Programming

UI, controller and gameplay programming are among the sections that benefit the most from using Rulebook. Beside automatically fuzz , prove correct and run reinforcement learning on your program, write self-configuring UIs , Rulebook automatically provides a sharp division between UI concerns and Controllers or Gameplay.