Live corpus

The playground is the proof ledger.

This isn't a sandbox with fake data. Every row below is a real definition from the committed Oath store — its content hash is the actual SHA-256 identity, and each verdict is the actual outcome the kernel recorded when it ran oath prove over the corpus. 56 definitions, 207 properties, 134 proven for all inputs by Z3.

elaborate
s-expr → canonical AST
hash
SHA-256 of the O1 encoding
typecheck
structural, no inference
test
200 seeded cases
prove
Z3, all inputs
abs
Numbers
abs-small
Honest exhibits
append
Lists
bad-reverse
Honest exhibits
clamp
Numbers
contains
Lists
count
Lists
drop
Lists
e-div
Numbers
e-mod
Numbers
full-name
Strings & records
greet
Strings & records
greet-or-guest
Strings & records
i-contains
Intervals
i-hull
Intervals
i-intersect
Intervals
i-overlaps
Intervals
initials-or
Strings & records
insert
Sorting
is-sorted
Sorting
join-with
Strings & records
kv-get
Worlds & state
kv-put
Worlds & state
length
Lists
lengths
Lists
main-echo
Programs & capabilities
main-fetch
Programs & capabilities
map
Lists
max2
Numbers
merge
Sorting
or-else
Strings & records
q-drop
Queue
q-peek
Queue
q-push
Queue
q-to-list
Queue
rename-key
Worlds & state
reverse
Lists
rle-decode
Run-length coding
rle-encode
Run-length coding
rle-expand
Run-length coding
rot
Programs & capabilities
rot-f
Programs & capabilities
rot-h2
Programs & capabilities
rot-h3
Programs & capabilities
rot-hl
Programs & capabilities
safe-get
Worlds & state
shout
Strings & records
sign
Numbers
sort
Sorting
spin
Honest exhibits
sum
Lists
t-flatten
Trees
t-insert
Trees
t-member
Trees
t-size
Trees
take
Lists

Insertion sort, fully proven correct

sort
proven · total
sha2564947f21a8edd89b5f28c4e9c8a3f4741b2008cc03e17cbdef5afbc6dd46073fd

Authored against the spec of List/length/append — never their bodies. The permutation oath (count preserved) is the strong property: sorted + same-length can both hold for wrong code; sorted + counts-preserved cannot.

sort
(defn sort [] [(xs (List Int))] (List Int)
  (match xs
    ((Nil) (Nil [Int]))
    ((Cons h t) (insert h (sort t))))
  (prop output-is-sorted [(xs (List Int))]
    (is-sorted (sort xs)))
  (prop preserves-length [(xs (List Int))]
    (== (length [Int] (sort xs)) (length [Int] xs)))
  (prop preserves-counts [(x Int) (xs (List Int))]
    (== (count x (sort xs)) (count x xs)))
  (prop idempotent [(xs (List Int))]
    (== (sort (sort xs)) (sort xs)))
  (prop sorted-is-fixpoint [(xs (List Int))]
    (if (is-sorted xs) (== (sort xs) xs) true)))
7 / 7 properties proven · Sorting
provenoutput-is-sorted
provenpreserves-length
provenpreserves-counts
provensnoc-is-insert
provensorted-is-fixpoint
provenidempotent
provenreverse-invariant
  • Proven by structural induction, discharged to Z3 over unbounded integers.
  • idempotent and reverse-invariant go through a four-lemma plan: insert commutativity, the sorted-head no-op, snoc-is-insert, and the sorted-fixpoint theorem.

Standing caveat, kept honest: Z3 reasons over unbounded integers; the evaluator uses int64. Division stays outside the proof fragment on purpose — the kernel truncates while SMT-LIB is Euclidean, so a "proof" would certify the wrong theorem. A proof is valid modulo overflow, and the corpus says so.