From 8833cdf99d3128466d85eb88aeb8e340e07e937c Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Sat, 18 Aug 2018 23:27:25 +0200 Subject: Reorganize methods --- ex/Methods.thy | 12 ++++++------ ex/Synthesis.thy | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'ex') diff --git a/ex/Methods.thy b/ex/Methods.thy index 415fbc3..c78af14 100644 --- a/ex/Methods.thy +++ b/ex/Methods.thy @@ -14,7 +14,7 @@ text "Wellformedness results, metatheorems written into the object theory using lemma assumes "A : U(i)" "B: A \ U(i)" "\x. x : A \ C x: B x \ U(i)" shows "\x:A. \y:B x. \z:C x y. \w:A. x =\<^sub>A w : U(i)" -by (simple lems: assms) +by (routine lems: assms) lemma @@ -38,7 +38,7 @@ text "Typechecking and constructing inhabitants:" \ \Correctly determines the type of the pair\ schematic_goal "\A: U(i); B: U(i); a : A; b : B\ \ : ?A" -by simple +by routine \ \Finds pair (too easy).\ schematic_goal "\A: U(i); B: U(i); a : A; b : B\ \ ?x : A \ B" @@ -56,19 +56,19 @@ lemma assumes "A: U(i)" "a: A" shows "(\<^bold>\x. )`a \ " proof compute - show "\x. x: A \ : A \ \" by simple -qed (simple lems: assms) + show "\x. x: A \ : A \ \" by routine +qed (routine lems: assms) lemma assumes "A: U(i)" "B: A \ U(i)" "a: A" "b: B(a)" shows "(\<^bold>\x y. )`a`b \ " proof compute - show "\x. x: A \ \<^bold>\y. : \y:B(x). \x:A. B(x)" by (simple lems: assms) + show "\x. x: A \ \<^bold>\y. : \y:B(x). \x:A. B(x)" by (routine lems: assms) show "(\<^bold>\b. )`b \ " proof compute - show "\b. b: B(a) \ : \x:A. B(x)" by (simple lems: assms) + show "\b. b: B(a) \ : \x:A. B(x)" by (routine lems: assms) qed fact qed fact diff --git a/ex/Synthesis.thy b/ex/Synthesis.thy index cff9374..a5e77ec 100644 --- a/ex/Synthesis.thy +++ b/ex/Synthesis.thy @@ -21,7 +21,7 @@ text " text "First we show that the property we want is well-defined." lemma pred_welltyped: "\pred:\\\ . ((pred`0) =\<^sub>\ 0) \ (\n:\. (pred`(succ n)) =\<^sub>\ n): U(O)" -by simple +by routine text " Now we look for an inhabitant of this type. @@ -33,7 +33,7 @@ schematic_goal "?p`0 \ 0" and "\n. n: \ \ (?p`( apply compute prefer 4 apply compute prefer 3 apply compute -apply (rule Nat_routine Nat_elim | assumption)+ +apply (rule Nat_routine Nat_elim | compute | assumption)+ done text " @@ -43,36 +43,36 @@ text " definition pred :: Term where "pred \ \<^bold>\n. ind\<^sub>\ (\a b. a) 0 n" -lemma pred_type: "pred: \ \ \" unfolding pred_def by simple +lemma pred_type: "pred: \ \ \" unfolding pred_def by routine lemma pred_props: "\n. refl(n)>: ((pred`0) =\<^sub>\ 0) \ (\n:\. (pred`(succ n)) =\<^sub>\ n)" -proof (simple lems: pred_type) +proof (routine lems: pred_type) have *: "pred`0 \ 0" unfolding pred_def proof compute - show "\n. n: \ \ ind\<^sub>\ (\a b. a) 0 n: \" by simple + show "\n. n: \ \ ind\<^sub>\ (\a b. a) 0 n: \" by routine show "ind\<^sub>\ (\a b. a) 0 0 \ 0" proof compute show "\: U(O)" .. - qed simple + qed routine qed rule - then show "refl(0): (pred`0) =\<^sub>\ 0" by (subst *) simple + then show "refl(0): (pred`0) =\<^sub>\ 0" by (subst *) routine show "\<^bold>\n. refl(n): \n:\. (pred`(succ(n))) =\<^sub>\ n" unfolding pred_def proof show "\n. n: \ \ refl(n): ((\<^bold>\n. ind\<^sub>\ (\a b. a) 0 n)`succ(n)) =\<^sub>\ n" proof compute - show "\n. n: \ \ ind\<^sub>\ (\a b. a) 0 n: \" by simple + show "\n. n: \ \ ind\<^sub>\ (\a b. a) 0 n: \" by routine show "\n. n: \ \ refl(n): ind\<^sub>\ (\a b. a) 0 (succ n) =\<^sub>\ n" proof compute show "\: U(O)" .. - qed simple + qed routine qed rule qed rule qed theorem "\n. refl(n)>>: \pred:\\\ . ((pred`0) =\<^sub>\ 0) \ (\n:\. (pred`(succ n)) =\<^sub>\ n)" -by (simple lems: pred_welltyped pred_type pred_props) +by (routine lems: pred_welltyped pred_type pred_props) end -- cgit v1.2.3