MLIR dialect for the Timbda-0 Verse calculus, with continuation passing SSA construction proved in Rocq + extracted to OCaml https://www.cs.uoregon.edu/research/summerschool/summer26/_lectures/SPJ_Verse-figures.pdf#page=15
  • Rocq Prover 68.1%
  • OCaml 15.7%
  • Shell 7.5%
  • C++ 6%
  • Makefile 2.7%
Find a file
2026-11-21 23:27:05 +00:00
examples feat(validate): check optimised modules against the source with a proved validator 2026-11-21 23:26:10 +00:00
media feat(project): introduce the verified timbda-0 dialect 2026-11-17 10:00:00 +00:00
mlir feat(mlir): run canonicalize and cse with folds for fail and duplicate choice 2026-11-21 23:26:10 +00:00
proof feat(validate): check optimised modules against the source with a proved validator 2026-11-21 23:26:10 +00:00
src feat(validate): check optimised modules against the source with a proved validator 2026-11-21 23:26:10 +00:00
tests feat(validate): check optimised modules against the source with a proved validator 2026-11-21 23:26:10 +00:00
.gitignore feat(project): introduce the verified timbda-0 dialect 2026-11-17 10:00:00 +00:00
Makefile feat(validate): check optimised modules against the source with a proved validator 2026-11-21 23:26:10 +00:00
README.md Merge pull request #2 from rasidency/develop 2026-11-21 23:27:05 +00:00

litany

An MLIR dialect for Timbda-0, the calculus in Figure 19 of the OPLSS 2026 Verse notes, with continuation passing SSA construction proved in Rocq and extracted to OCaml

Build with Rocq 9.2, OCaml 5.5 and LLVM/MLIR 19:

make MLIR=/usr/lib/llvm-19
make check MLIR=/usr/lib/llvm-19

Example

Each lambda becomes an MLIR region with its parameter as a block argument, as this example shows:

cat examples/Showcase.tim
_build/litany examples/Showcase.tim | _build/litany-opt
make -B _build/Target.vo
Syntax Meaning
int Identity graph on ℤ
:e Range of a graph
f x Application
e | e Choice
fail Empty set
lambda (x := domain). body Lambda, also written λ or \

Range binds tightest, then left associative application, then choice

Translation validation

litany --validate checks canonicalised and CSE'd modules against their source, after Necula's Translation Validation for an Optimizing Compiler (PLDI 2000), so the C++ folds need no trust

Here 17 operations become 6:

_build/litany examples/Redundant.tim | _build/litany-opt --canonicalize --cse --canonicalize > /tmp/redundant.mlir
_build/litany --validate examples/Redundant.tim /tmp/redundant.mlir

Swapping the operands still passes the MLIR verifier, but validation rejects it:

sed 's/"timbda.apply"(%0, %arg0)/"timbda.apply"(%arg0, %0)/' /tmp/redundant.mlir > /tmp/swapped.mlir
_build/litany --validate examples/Redundant.tim /tmp/swapped.mlir