MachineArithmetic is the SMT-based theorem prover at the base of Smalltalk-25, our scientific programm towards constructing verified dynamic-language compilers via formal methods. To scale verification to industrial CPUs and languages, we translate both the complete, authoritative formal specification of the target (such as the RISC-V Sail spec) and the concrete semantics of the language to a dependently-typed "computational core" IL, the typechecking of which proves the wanted properties of the compiler. More importantly, the proof-based Debugger augments the compiler-engineer's ability to comprehend the complexity inherent in an industrial compiler by machine-assisted traversal of abstraction hierarchies on the fly.
This repo contains the core prover. The underlying algorithms are essentially similar to those in LiquidHaskell, mutatis mutandis for the dynamic nature of Smalltalk and for our overarching goal of extreme debuggability of a Dynabook-like environment: proofs can be GT-inspected and hot-code-replaced mid-execution, etc.
Just clone the repository, cd into the Smalltalk-dialect-specific
image directory of your choice
(Pharo or
Smalltalk/X jv-branch
), type make to download the base Smalltalk and build the image,
and then make run to run the dev environment:
git clone https://github.com/shingarov/MachineArithmetic
cd MachineArithmetic/pharo
make
make run
You will need Z3 installed in some place where the dynamic loader can find it.
NOTE: On Smalltalk/X only the Z3 bindings are supported at the moment.
NOTE: If you want to load any of the downstream projects (such as Tinyrossa, you don't need to worry about loading MachineArithmetic separetely unless you have specific development needs, because Tinyrossa's Makefile takes care of dependencies automatically.
-
Boris Shingarov and Jan Vraný: Towards a Dynabook for verified VM construction https://doi.org/10.1016/j.cola.2024.101275
-
Boris Shingarov and Jan Vraný: Debugging a Smalltalk VM assisted by large automated reasoning https://drops.dagstuhl.de/entities/document/10.4230/OASIcs.Programming.2025.4
-
Jan Vraný and Boris Shingarov: Tinyrossa: A Compiler Framework for Vertical, Verified Construction of Smalltalk VMs https://dl.acm.org/doi/10.1145/3660829.3660838
-
Boris Shingarov: Live Proof-by-Induction https://openreview.net/pdf?id=AaMvINlc7d