Skip to content
Snippets Groups Projects
Commit 3d4db11f authored by Viktor Kuncak's avatar Viktor Kuncak
Browse files

Example of solution for Church numeral example

parent 8f5e5f76
No related branches found
No related tags found
No related merge requests found
......@@ -18,4 +18,9 @@ object ChurchNumerals {
value(r) == value(x) + value(y)
}
}
def workingAdd(x : Num, y : Num) : Num = (x match {
case Zero() => y
case Succ(p) => workingAdd(p, Succ(y))
}) ensuring (value(_) == value(x) + value(y))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment