Nominal/Ex/Let.thy
author Christian Urban <urbanc@in.tum.de>
Tue, 03 May 2011 15:39:30 +0100
changeset 2779 3c769bf10e63
parent 2722 ba34f893539a
child 2842 43bb260ef290
permissions -rw-r--r--
added two mutual recursive inductive definitions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2436
3885dc2669f9 cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents: 2120
diff changeset
     1
theory Let
2454
9ffee4eb1ae1 renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents: 2449
diff changeset
     2
imports "../Nominal2" 
1600
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
atom_decl name
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     7
nominal_datatype trm =
2436
3885dc2669f9 cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents: 2120
diff changeset
     8
  Var "name"
3885dc2669f9 cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents: 2120
diff changeset
     9
| App "trm" "trm"
3885dc2669f9 cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents: 2120
diff changeset
    10
| Lam x::"name" t::"trm"  bind  x in t
2490
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    11
| Let as::"assn" t::"trm"   bind "bn as" in t
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    12
and assn =
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    13
  ANil
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    14
| ACons "name" "trm" "assn"
1600
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    15
binder
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
  bn
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    17
where
2490
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    18
  "bn ANil = []"
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    19
| "bn (ACons x t as) = (atom x) # (bn as)"
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    20
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    21
thm trm_assn.fv_defs
2492
5ac9a74d22fd post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents: 2490
diff changeset
    22
thm trm_assn.eq_iff 
2490
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    23
thm trm_assn.bn_defs
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    24
thm trm_assn.perm_simps
2492
5ac9a74d22fd post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents: 2490
diff changeset
    25
thm trm_assn.induct
5ac9a74d22fd post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents: 2490
diff changeset
    26
thm trm_assn.inducts
2490
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    27
thm trm_assn.distinct
320775fa47ca some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2454
diff changeset
    28
thm trm_assn.supp
2493
2e174807c891 added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents: 2492
diff changeset
    29
thm trm_assn.fresh
2617
e44551d067e6 properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    30
thm trm_assn.exhaust
e44551d067e6 properly exported strong exhaust theorem; cleaned up some examples
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    31
thm trm_assn.strong_exhaust
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents: 2493
diff changeset
    32
2670
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    33
1602
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    34
lemma lets_bla:
2670
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    35
  "x \<noteq> z \<Longrightarrow> y \<noteq> z \<Longrightarrow> x \<noteq> y \<Longrightarrow>(Let (ACons x (Var y) ANil) (Var x)) \<noteq> (Let (ACons x (Var z) ANil) (Var x))"
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    36
  by (simp add: trm_assn.eq_iff)
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    37
1602
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    38
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    39
lemma lets_ok:
2670
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    40
  "(Let (ACons x (Var y) ANil) (Var x)) = (Let (ACons y (Var y) ANil) (Var y))"
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    41
  apply (simp add: trm_assn.eq_iff Abs_eq_iff )
1602
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    42
  apply (rule_tac x="(x \<leftrightarrow> y)" in exI)
2670
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    43
  apply (simp_all add: alphas atom_eqvt supp_at_base fresh_star_def trm_assn.bn_defs trm_assn.supp)
1602
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    44
  done
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    45
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    46
lemma lets_ok3:
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    47
  "x \<noteq> y \<Longrightarrow>
2670
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    48
   (Let (ACons x (App (Var y) (Var x)) (ACons y (Var y) ANil)) (App (Var x) (Var y))) \<noteq>
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    49
   (Let (ACons y (App (Var x) (Var y)) (ACons x (Var x) ANil)) (App (Var x) (Var y)))"
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    50
  apply (simp add: trm_assn.eq_iff)
1602
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    51
  done
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    52
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    53
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    54
lemma lets_not_ok1:
1685
721d92623c9d Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1658
diff changeset
    55
  "x \<noteq> y \<Longrightarrow>
2670
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    56
   (Let (ACons x (Var x) (ACons y (Var y) ANil)) (App (Var x) (Var y))) \<noteq>
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    57
   (Let (ACons y (Var x) (ACons x (Var y) ANil)) (App (Var x) (Var y)))"
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    58
  apply (simp add: alphas trm_assn.eq_iff trm_assn.supp fresh_star_def atom_eqvt Abs_eq_iff trm_assn.bn_defs)
1602
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    59
  done
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    60
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    61
lemma lets_nok:
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    62
  "x \<noteq> y \<Longrightarrow> x \<noteq> z \<Longrightarrow> z \<noteq> y \<Longrightarrow>
2670
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    63
   (Let (ACons x (App (Var z) (Var z)) (ACons y (Var z) ANil)) (App (Var x) (Var y))) \<noteq>
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    64
   (Let (ACons y (Var z) (ACons x (App (Var z) (Var z)) ANil)) (App (Var x) (Var y)))"
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    65
  apply (simp add: alphas trm_assn.eq_iff fresh_star_def trm_assn.bn_defs Abs_eq_iff trm_assn.supp trm_assn.distinct)
1602
a7e60da429e2 Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1600
diff changeset
    66
  done
2670
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    67
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    68
lemma
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    69
  fixes a b c :: name
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    70
  assumes x: "a \<noteq> c" and y: "b \<noteq> c"
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    71
  shows "\<exists>p.([atom a], Var c) \<approx>lst (op =) supp p ([atom b], Var c)"
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    72
  apply (rule_tac x="(a \<leftrightarrow> b)" in exI)
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    73
  apply (simp add: alphas trm_assn.supp supp_at_base x y fresh_star_def atom_eqvt)
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    74
  by (metis Rep_name_inverse atom_name_def flip_fresh_fresh fresh_atom fresh_perm x y)
3c493c951388 alpha_abs_let_stronger is not true in the same form
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2630
diff changeset
    75
2720
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    76
lemma alpha_bn_refl: "alpha_bn x x"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    77
apply (induct x rule: trm_assn.inducts(2))
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    78
apply (rule TrueI)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    79
apply (auto simp add: trm_assn.eq_iff)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    80
done
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    81
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    82
lemma alpha_bn_inducts_raw:
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    83
  "\<lbrakk>alpha_bn_raw a b; P3 ANil_raw ANil_raw;
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    84
 \<And>trm_raw trm_rawa assn_raw assn_rawa name namea.
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    85
    \<lbrakk>alpha_trm_raw trm_raw trm_rawa; alpha_bn_raw assn_raw assn_rawa;
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    86
     P3 assn_raw assn_rawa\<rbrakk>
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    87
    \<Longrightarrow> P3 (ACons_raw name trm_raw assn_raw)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    88
        (ACons_raw namea trm_rawa assn_rawa)\<rbrakk> \<Longrightarrow> P3 a b"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    89
  by (erule alpha_trm_raw_alpha_assn_raw_alpha_bn_raw.inducts(3)[of _ _ "\<lambda>x y. True" _ "\<lambda>x y. True", simplified]) auto
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    90
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    91
lemmas alpha_bn_inducts = alpha_bn_inducts_raw[quot_lifted]
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    92
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    93
nominal_primrec
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    94
    subst  :: "name \<Rightarrow> trm \<Rightarrow> trm \<Rightarrow> trm"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    95
and substa :: "name \<Rightarrow> trm \<Rightarrow> assn \<Rightarrow> assn"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    96
where
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    97
  "subst s t (Var x) = (if (s = x) then t else (Var x))"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    98
| "subst s t (App l r) = App (subst s t l) (subst s t r)"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
    99
| "atom v \<sharp> (s, t) \<Longrightarrow> subst s t (Lam v b) = Lam v (subst s t b)"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   100
| "set (bn as) \<sharp>* (s, t) \<Longrightarrow> subst s t (Let as b) = Let (substa s t as) (subst s t b)"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   101
| "substa s t ANil = ANil"
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   102
| "substa s t (ACons v t' as) = ACons v (subst v t t') as"
2722
ba34f893539a cleaned up the experiments so that the tests go through
Christian Urban <urbanc@in.tum.de>
parents: 2720
diff changeset
   103
oops
2720
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   104
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   105
(*apply (subgoal_tac "\<forall>l. \<exists>!r. subst_substa_graph l r")
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   106
defer
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   107
apply rule
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   108
apply (simp only: Ex1_def)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   109
apply (case_tac l)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   110
apply (case_tac a)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   111
apply (rule_tac y="c" and c="(aa,b)" in trm_assn.strong_exhaust(1))
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   112
apply simp_all[3]
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   113
apply rule
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   114
apply rule
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   115
apply (rule subst_substa_graph.intros)*)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   116
2722
ba34f893539a cleaned up the experiments so that the tests go through
Christian Urban <urbanc@in.tum.de>
parents: 2720
diff changeset
   117
(*
2720
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   118
defer
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   119
apply (case_tac x)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   120
apply (case_tac a)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   121
thm trm_assn.strong_exhaust(1)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   122
apply (rule_tac y="c" and c="(aa,b)" in trm_assn.strong_exhaust(1))
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   123
apply (simp add: trm_assn.distinct trm_assn.eq_iff)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   124
apply auto[1]
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   125
apply (simp add: trm_assn.distinct trm_assn.eq_iff)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   126
apply auto[1]
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   127
apply (simp add: trm_assn.distinct trm_assn.eq_iff fresh_star_def)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   128
apply (simp add: trm_assn.distinct trm_assn.eq_iff)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   129
apply (drule_tac x="assn" in meta_spec)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   130
apply (rotate_tac 3)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   131
apply (drule_tac x="aa" in meta_spec)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   132
apply (rotate_tac -1)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   133
apply (drule_tac x="b" in meta_spec)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   134
apply (rotate_tac -1)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   135
apply (drule_tac x="trm" in meta_spec)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   136
apply (auto simp add: alpha_bn_refl)[1]
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   137
apply (case_tac b)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   138
apply (rule_tac ya="c" in trm_assn.strong_exhaust(2))
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   139
apply (simp add: trm_assn.distinct trm_assn.eq_iff)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   140
apply auto[1]
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   141
apply blast
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   142
apply (simp add: trm_assn.distinct trm_assn.eq_iff)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   143
apply auto[1]
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   144
apply blast
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   145
apply (simp_all only: sum.simps Pair_eq trm_assn.distinct trm_assn.eq_iff)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   146
apply simp_all
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   147
apply (simp_all add: meta_eq_to_obj_eq[OF subst_def, symmetric, unfolded fun_eq_iff])
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   148
apply (simp_all add: meta_eq_to_obj_eq[OF substa_def, symmetric, unfolded fun_eq_iff])
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   149
apply clarify
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   150
prefer 2
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   151
apply clarify
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   152
apply (rule conjI)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   153
prefer 2
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   154
apply (rename_tac a pp vv zzz a2 s t zz)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   155
apply (erule alpha_bn_inducts)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   156
apply (rule alpha_bn_refl)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   157
apply clarify
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   158
apply (rename_tac t' a1 a2 n1 n2)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   159
thm subst_substa_graph.intros[no_vars]
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   160
.
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   161
alpha_bn (substa s t (ACons n1 t' a1))
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   162
         (substa s t (ACons n2 t' a2))
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   163
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   164
alpha_bn (Acons s (subst a t t') a1)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   165
         (Acons s (subst a t t') a2)
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   166
3dd6d524dfdd Experiments defining a function on Let
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2670
diff changeset
   167
ACons v (subst v t t') as"
2722
ba34f893539a cleaned up the experiments so that the tests go through
Christian Urban <urbanc@in.tum.de>
parents: 2720
diff changeset
   168
*)
1600
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   169
end
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   170
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   171
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   172