Created
October 30, 2015 13:13
-
-
Save tautologico/59fe0d68c4616e9ecb55 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datatype nat = Z | S nat | |
fun plus :: "nat ⇒ nat ⇒ nat" where | |
"plus Z m = m" | | |
"plus (S n) m = S (plus n m)" | |
fun mult :: "nat ⇒ nat ⇒ nat" where | |
"mult Z m = Z" | | |
"mult (S n) m = plus (mult n m) m" | |
fun factorial :: "nat ⇒ nat" where | |
"factorial Z = (S Z)" | | |
"factorial (S n) = mult (S n) (factorial n)" | |
definition ten :: nat where "ten = (S (S (S (S (S (S (S (S (S Z)))))))))" | |
definition twelve :: nat where "twelve = (S (S (S (S (S (S (S (S (S Z)))))))))" | |
theorem test_factorial1 : "factorial (S (S (S Z))) = S (S (S (S (S (S Z)))))" by simp | |
(* simplification only simplifies the left side, not the right side | |
theorem test_factorial2 : "factorial (S (S (S (S (S Z))))) = mult ten twelve" by simp | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment