def myDiv (numerator : Nat) {denominator : Nat} (denominatorNotZero : denominator ≠ 0) : Nat
:=
if denominator > numerator then
0
else
1 + myDiv (numerator - denominator) denominatorNotZero
-- Example usage.
example : myDiv 1 (denominator := 1) (by simp) = 1 := rfl
example : myDiv 120 (denominator := 10) (by simp) = 12 := rfl
You have to submit a proof that the denominator is non-zero in order to use `myDiv`. No monad required ;).
Imagine it -- security policies, infrastructure, etc. all codified in a formal model.
- Push-button generation of ISO-27001 documentation.
- Push-button generation of Terraform.
- Push-button generation of SpiceDB policies.
- ...
There is _a lot_ of missing technology, but this is critically important because it will help us ensure regulatory compliance at far greater speeds in fields like nuclear and automotive. And it enables automated reasoning over the models, to make sure you're actually doing what you set out to do.