# HG changeset patch # User blanchet # Date 1410288696 -7200 # Node ID b13e5c3497f588c38980c23c3474742d21f63dc9 # Parent bf4188deabb20e091f7c8e19baaff2f1930d9b4e ported Bali to new datatypes diff -r bf4188deabb2 -r b13e5c3497f5 src/HOL/Bali/AxCompl.thy --- a/src/HOL/Bali/AxCompl.thy Tue Sep 09 20:51:36 2014 +0200 +++ b/src/HOL/Bali/AxCompl.thy Tue Sep 09 20:51:36 2014 +0200 @@ -1027,7 +1027,7 @@ "G,A\{=:n} \e\\<^sub>e\ {G\}" and "G,A\{=:n} \c\\<^sub>s\ {G\}" and "G,A\{=:n} \es\\<^sub>l\ {G\}" - proof (induct rule: var_expr_stmt.inducts) + proof (induct rule: compat_var.induct compat_expr.induct compat_stmt.induct compat_expr_list.induct) case (LVar v) show "G,A\{=:n} \LVar v\\<^sub>v\ {G\}" apply (rule MGFn_NormalI) @@ -1318,7 +1318,7 @@ show "G,A\{=:n} \Init C\\<^sub>s\ {G\}" by (rule MGFn_Init) next - case Nil_expr + case Nil show "G,A\{=:n} \[]\\<^sub>l\ {G\}" apply - apply (rule MGFn_NormalI) @@ -1326,7 +1326,7 @@ apply (fastforce intro: eval.Nil) done next - case (Cons_expr e es) + case (Cons e es) thus "G,A\{=:n} \e# es\\<^sub>l\ {G\}" apply - apply (rule MGFn_NormalI) diff -r bf4188deabb2 -r b13e5c3497f5 src/HOL/Bali/DefiniteAssignment.thy --- a/src/HOL/Bali/DefiniteAssignment.thy Tue Sep 09 20:51:36 2014 +0200 +++ b/src/HOL/Bali/DefiniteAssignment.thy Tue Sep 09 20:51:36 2014 +0200 @@ -236,8 +236,8 @@ \ P (b? e1 : e2)" shows "P e" proof - - have "True" and "\ v. constVal e = Some v \ P e" and "True" and "True" - proof (induct "x::var" and e and "s::stmt" and "es::expr list") + have "\ v. constVal e = Some v \ P e" + proof (induct e) case Lit show ?case by (rule hyp_Lit) next @@ -264,7 +264,7 @@ with Cond show ?thesis using v bv by (auto intro: hyp_CondR) qed - qed (simp_all) + qed (simp_all add: hyp_Lit) with const show ?thesis by blast @@ -334,8 +334,8 @@ assumes boolConst: "constVal e = Some (Bool b)" (is "?Const b e") shows "assigns_if b e = {}" (is "?Ass b e") proof - - have "True" and "\ b. ?Const b e \ ?Ass b e" and "True" and "True" - proof (induct _ and e and _ and _ rule: var_expr_stmt.inducts) + have "\ b. ?Const b e \ ?Ass b e" + proof (induct e) case Lit thus ?case by simp next @@ -382,8 +382,8 @@ assumes boolConst: "constVal e = Some (Bool b)" (is "?Const b e") shows "assigns_if (\b) e = UNIV" (is "?Ass b e") proof - - have True and "\ b. ?Const b e \ ?Ass b e" and True and True - proof (induct _ and e and _ and _ rule: var_expr_stmt.inducts) + have "\ b. ?Const b e \ ?Ass b e" + proof (induct e) case Lit thus ?case by simp next @@ -949,8 +949,10 @@ assumes boolEx: "E\e\-PrimT Boolean" (is "?Boolean e") shows "assignsE e \ assigns_if True e \ assigns_if False e" (is "?Incl e") proof - - have True and "?Boolean e \ ?Incl e" and True and True - proof (induct _ and e and _ and _ rule: var_expr_stmt.inducts) + obtain vv where ex_lit: "E\Lit vv\- PrimT Boolean" + using typeof.simps(2) wt.Lit by blast + have "?Boolean e \ ?Incl e" + proof (induct e) case (Cast T e) have "E\e\- (PrimT Boolean)" proof - @@ -1011,7 +1013,10 @@ with Some show ?thesis using hyp_e2 boolean_e2 by auto qed qed - qed simp_all + next + show "\x. E\Lit vv\-PrimT Boolean" + by (rule ex_lit) + qed (simp_all add: ex_lit) with boolEx show ?thesis by blast diff -r bf4188deabb2 -r b13e5c3497f5 src/HOL/Bali/DefiniteAssignmentCorrect.thy --- a/src/HOL/Bali/DefiniteAssignmentCorrect.thy Tue Sep 09 20:51:36 2014 +0200 +++ b/src/HOL/Bali/DefiniteAssignmentCorrect.thy Tue Sep 09 20:51:36 2014 +0200 @@ -102,8 +102,7 @@ proof - have True and True and "\ jmps' jmps. \jumpNestingOkS jmps' c; jmps' \ jmps\ \ jumpNestingOkS jmps c" - and True - proof (induct rule: var_expr_stmt.inducts) + proof (induct rule: var.induct expr.induct stmt.induct) case (Lab j c jmps' jmps) note jmpOk = `jumpNestingOkS jmps' (j\ c)` note jmps = `jmps' \ jmps` @@ -2008,8 +2007,8 @@ have True and "\ c v s0 s. \ constVal e = Some c; G\Norm s0 \e-\v\ s\ \ v = c \ normal s" - and True and True - proof (induct rule: var_expr_stmt.inducts) + and True + proof (induct rule: var.induct expr.induct stmt.induct) case NewC hence False by simp thus ?case .. next case NewA hence False by simp thus ?case .. @@ -2156,8 +2155,8 @@ have True and "\ c. \constVal e = Some c;Env\e\-PrimT Boolean\ \ typeof empty_dt c = Some (PrimT Boolean)" - and True and True - proof (induct rule: var_expr_stmt.inducts) + and True + proof (induct rule: var.induct expr.induct stmt.induct) case NewC hence False by simp thus ?case .. next case NewA hence False by simp thus ?case .. diff -r bf4188deabb2 -r b13e5c3497f5 src/HOL/Bali/Eval.thy --- a/src/HOL/Bali/Eval.thy Tue Sep 09 20:51:36 2014 +0200 +++ b/src/HOL/Bali/Eval.thy Tue Sep 09 20:51:36 2014 +0200 @@ -833,7 +833,7 @@ apply (erule eval_cases) apply auto apply (induct_tac "t") -apply (induct_tac "a") +apply (rename_tac a, induct_tac "a") apply auto done diff -r bf4188deabb2 -r b13e5c3497f5 src/HOL/Bali/Evaln.thy --- a/src/HOL/Bali/Evaln.thy Tue Sep 09 20:51:36 2014 +0200 +++ b/src/HOL/Bali/Evaln.thy Tue Sep 09 20:51:36 2014 +0200 @@ -245,7 +245,7 @@ | In2 e \ (\v. w = In2 v) | In3 e \ (\v. w = In3 v)" apply (erule evaln_cases , auto) apply (induct_tac "t") -apply (induct_tac "a") +apply (rename_tac a, induct_tac "a") apply auto done diff -r bf4188deabb2 -r b13e5c3497f5 src/HOL/Bali/Term.thy --- a/src/HOL/Bali/Term.thy Tue Sep 09 20:51:36 2014 +0200 +++ b/src/HOL/Bali/Term.thy Tue Sep 09 20:51:36 2014 +0200 @@ -217,6 +217,8 @@ --{* technical term for smallstep sem.) *} | Init qtname --{* class initialization *} +datatype_compat var expr stmt + text {* The expressions Methd and Body are artificial program constructs, in the @@ -421,7 +423,7 @@ \\ v. P \v\\<^sub>v; \ e. P \e\\<^sub>e;\ c. P \c\\<^sub>s;\ l. P \l\\<^sub>l\ \ P t" apply (cases t) - apply (case_tac a) + apply (rename_tac a, case_tac a) apply auto done