Isabelle-LLVM is a verification framework for Isabelle/HOL that targets LLVM as backend. The main features are:
You can browse the theories or download the files. (The download link won’t work if you are browsing this from inside the downloaded archive!)
Warning: the .thy files in the download are best viewed with the Isabelle/HOL IDE.
The project is hosted on github github.com/lammich/isabelle_llvm/tree/2022
Here are some default starting points for browsing the theories
Some starting points, structured according to the parallel paper:
M Monad Includes the parallel combinator
Memory Model Including access reports
Code Generator Including the template for translating llc_par
Separation Logic and VCG A bit more general than described in paper, parameterized over memory model. The general rules are proved in Sep_Generic_Wp.thy, e.g. lemma ht_par for the parallel rule. The instantiated parallel rule is ht_llc_par in Sepref_Parallel.thy.
Sepref Tool Including the parallel setup in Sepref_Parallel.thy.
With-Split Combinator, With-Idxs Combinator and its implementation on arrays.
Sorting Algorithms Contains the code export to LLVM, and the final correctness theorem. Our parallel quicksort algorithm is in Sorting_Parsort.thy, the sampling pivot finder is in Sorting_Sample_Partition.thy, and the parallel partitioner is in Sorting_Par_Partition.thy.
Knuth Morris Pratt String Search
For the ISA-SAT verified SAT solver, see its own homepage
IICF (Isabelle-LLVM + Refinement Framework + Collection Framework)
Shallow Embedding of LLVM Semantics
To compile and run the benchmarks
cd benchmarks
./bench_bs.sh -r
./bench_kmp.sh -r
cd sorting
make run
This will run the binary search, KMP, and parallel sorting benchmarks. Warning: We have only tested this on a Linux x86_64 platform so far. We do not (yet) know how LLVM will digest our code on other platforms.
To re-check the proofs, run
cd thys
isabelle build -D.
Here, isabelle
must refer to /your/path/to/Isabelle2022/bin/isabelle
from your Isabelle installation. This will invoke Isabelle to check all proofs and re-generate the exported code.
To run a quick regression test script
cd regression
make
This will re-check the proofs, export a few example programs, link them with C wrappers, and execute them under Valgrind’s memcheck, to detect ABI problems with header file generation and interfacing exported code from C.
Short Presentation of the Isabelle Refinement Framework
The download links won’t work if you are browsing this from inside a downloaded archive!
Isabelle-LLVM 1.0 for Isabelle-2020