Registry Mirror
Skip to content

Repository files navigation

A mathematical foundation for construction of formally-verified dynamic-language VMs

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.

How to create a fresh development image

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.

How to load only the Z3 interface

See README_Z3_bindings.md

Further Reading

About

A mathematical foundation for construction of formally-verified dynamic-language VMs

Resources

Stars

21 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages