Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
theory Scratch
|
||||
imports Main
|
||||
begin
|
||||
|
||||
text‹if-then-else›
|
||||
lemma "(if True then 42 else 0) = 42" by simp
|
||||
|
||||
text‹case statement with pattern matching, which evaluates to the True-case›
|
||||
lemma "case [42] of
|
||||
Nil ⇒ False
|
||||
| [x] ⇒ True
|
||||
| x#xs ⇒ False" by simp
|
||||
|
||||
text‹Loops are implemented via recursive functions›
|
||||
fun recurse :: "nat ⇒ nat" where
|
||||
"recurse 0 = 0"
|
||||
| "recurse (Suc n) = recurse n"
|
||||
|
||||
text‹The function always returns zero.›
|
||||
lemma "recurse n = 0" by(induction n) simp+
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue