Nominal/Ex/LetRecB.thy
author Christian Urban <urbanc@in.tum.de>
Tue, 05 Jul 2011 04:23:33 +0200
changeset 2945 70bbd18ad194
parent 2922 a27215ab674e
child 2950 0911cb7bf696
permissions -rw-r--r--
merged
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory LetRecB
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports "../Nominal2"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
atom_decl name
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
nominal_datatype let_rec:
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
 trm =
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
  Var "name"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
| App "trm" "trm"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
| Lam x::"name" t::"trm"     bind x in t
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
| Let_Rec bp::"bp" t::"trm"  bind "bn bp" in bp t
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
and bp =
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  Bp "name" "trm"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
binder
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
  bn::"bp \<Rightarrow> atom list"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
where
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
  "bn (Bp x t) = [atom x]"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
thm let_rec.distinct
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
thm let_rec.induct
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
thm let_rec.exhaust
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
thm let_rec.fv_defs
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
thm let_rec.bn_defs
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
thm let_rec.perm_simps
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
thm let_rec.eq_iff
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
thm let_rec.fv_bn_eqvt
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
thm let_rec.size_eqvt
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
lemma Abs_lst_fcb2:
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    32
  fixes as bs :: "'a :: fs"
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
    and x y :: "'b :: fs"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
    and c::"'c::fs"
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    35
  assumes eq: "[ba as]lst. x = [ba bs]lst. y"
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    36
  and fcb1: "(set (ba as)) \<sharp>* f as x c"
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    37
  and fresh1: "set (ba as) \<sharp>* c"
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    38
  and fresh2: "set (ba bs) \<sharp>* c"
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
  and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f as x c) = f (p \<bullet> as) (p \<bullet> x) c"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
  and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f bs y c) = f (p \<bullet> bs) (p \<bullet> y) c"
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    41
  and props: "eqvt ba" "inj ba"
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
  shows "f as x c = f bs y c"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
proof -
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
  have "supp (as, x, c) supports (f as x c)"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
    unfolding  supports_def fresh_def[symmetric]
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
    by (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
  then have fin1: "finite (supp (f as x c))"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
    by (auto intro: supports_finite simp add: finite_supp)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
  have "supp (bs, y, c) supports (f bs y c)"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
    unfolding  supports_def fresh_def[symmetric]
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
    by (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
  then have fin2: "finite (supp (f bs y c))"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
    by (auto intro: supports_finite simp add: finite_supp)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
  obtain q::"perm" where 
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    55
    fr1: "(q \<bullet> (set (ba as))) \<sharp>* (x, c, f as x c, f bs y c)" and 
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    56
    fr2: "supp q \<sharp>* ([ba as]lst. x)" and 
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    57
    inc: "supp q \<subseteq> (set (ba as)) \<union> q \<bullet> (set (ba as))"
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    58
    using at_set_avoiding3[where xs="set (ba as)" and c="(x, c, f as x c, f bs y c)" and x="[ba as]lst. x"]  
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
      fin1 fin2
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
    by (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv)
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    61
  have "[q \<bullet> (ba as)]lst. (q \<bullet> x) = q \<bullet> ([ba as]lst. x)" by simp
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    62
  also have "\<dots> = [ba as]lst. x"
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
    by (simp only: fr2 perm_supp_eq)
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    64
  finally have "[q \<bullet> (ba as)]lst. (q \<bullet> x) = [ba bs]lst. y" using eq by simp
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
  then obtain r::perm where 
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
    qq1: "q \<bullet> x = r \<bullet> y" and 
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    67
    qq2: "q \<bullet> (ba as) = r \<bullet> (ba bs)" and 
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    68
    qq3: "supp r \<subseteq> (q \<bullet> (set (ba as))) \<union> set (ba bs)"
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
    apply(drule_tac sym)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
    apply(simp only: Abs_eq_iff2 alphas)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
    apply(erule exE)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
    apply(erule conjE)+
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
    apply(drule_tac x="p" in meta_spec)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
    apply(simp add: set_eqvt)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
    apply(blast)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
    done
2916
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
    77
  have qq4: "q \<bullet> as = r \<bullet> bs" using qq2 props unfolding eqvt_def inj_on_def
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
    78
    apply(perm_simp)
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
    79
    apply(simp)
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
    80
    done
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    81
  have "(set (ba as)) \<sharp>* f as x c" by (rule fcb1)
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    82
  then have "q \<bullet> ((set (ba as)) \<sharp>* f as x c)"
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
    by (simp add: permute_bool_def)
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    84
  then have "set (q \<bullet> (ba as)) \<sharp>* f (q \<bullet> as) (q \<bullet> x) c"
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
    apply(simp add: fresh_star_eqvt set_eqvt)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
    apply(subst (asm) perm1)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
    using inc fresh1 fr1
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
    apply(auto simp add: fresh_star_def fresh_Pair)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
    done
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    90
  then have "set (r \<bullet> (ba bs)) \<sharp>* f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 qq4
2916
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
    91
    by simp
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    92
  then have "r \<bullet> ((set (ba bs)) \<sharp>* f bs y c)"
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
    apply(simp add: fresh_star_eqvt set_eqvt)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
    apply(subst (asm) perm2[symmetric])
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
    using qq3 fresh2 fr1
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
    apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
    done
2917
6ad2f1c296a7 relaxed type in fcb
Christian Urban <urbanc@in.tum.de>
parents: 2916
diff changeset
    98
  then have fcb2: "(set (ba bs)) \<sharp>* f bs y c" by (simp add: permute_bool_def)
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  have "f as x c = q \<bullet> (f as x c)"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
    apply(rule perm_supp_eq[symmetric])
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
    using inc fcb1 fr1 by (auto simp add: fresh_star_def)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
  also have "\<dots> = f (q \<bullet> as) (q \<bullet> x) c" 
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
    apply(rule perm1)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
    using inc fresh1 fr1 by (auto simp add: fresh_star_def)
2916
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
   105
  also have "\<dots> = f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq4 by simp
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
  also have "\<dots> = r \<bullet> (f bs y c)"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
    apply(rule perm2[symmetric])
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
    using qq3 fresh2 fr1 by (auto simp add: fresh_star_def)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
  also have "... = f bs y c"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
    apply(rule perm_supp_eq)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
    using qq3 fr1 fcb2 by (auto simp add: fresh_star_def)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
  finally show ?thesis by simp
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
qed
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
lemma max_eqvt[eqvt]: "p \<bullet> (max (a :: _ :: pure) b) = max (p \<bullet> a) (p \<bullet> b)"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
  by (simp add: permute_pure)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
nominal_primrec
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
    height_trm :: "trm \<Rightarrow> nat"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
and height_bp :: "bp \<Rightarrow> nat"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
where
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
  "height_trm (Var x) = 1"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
| "height_trm (App l r) = max (height_trm l) (height_trm r)"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
| "height_trm (Lam v b) = 1 + (height_trm b)"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
| "height_trm (Let_Rec bp b) = max (height_bp bp) (height_trm b)"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
| "height_bp (Bp v t) = height_trm t"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
  --"eqvt"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
  apply (simp only: eqvt_def height_trm_height_bp_graph_def)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
  apply (rule, perm_simp, rule, rule TrueI)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
  --"completeness"
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
  apply (case_tac x)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
  apply (case_tac a rule: let_rec.exhaust(1))
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
  apply (auto)[4]
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
  apply (case_tac b rule: let_rec.exhaust(2))
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
  apply blast
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
  apply(simp_all)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
  apply (erule_tac c="()" in Abs_lst_fcb2)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
  apply (simp_all add: fresh_star_def pure_fresh)[3]
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
  apply (simp add: eqvt_at_def)
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
  apply (simp add: eqvt_at_def)
2916
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
   142
  apply(simp add: eqvt_def)
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
   143
  apply(perm_simp)
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
   144
  apply(simp)
b55098314f83 fcb with explicit bn function
Christian Urban <urbanc@in.tum.de>
parents: 2915
diff changeset
   145
  apply(simp add: inj_on_def)
2918
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   146
  --"The following could be done by nominal"
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   147
  apply (simp add: meta_eq_to_obj_eq[OF height_trm_def, symmetric, unfolded fun_eq_iff])
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   148
  apply (simp add: meta_eq_to_obj_eq[OF height_bp_def, symmetric, unfolded fun_eq_iff])
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   149
  apply (subgoal_tac "eqvt_at height_bp bp")
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   150
  apply (subgoal_tac "eqvt_at height_bp bpa")
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   151
  apply (subgoal_tac "eqvt_at height_trm b")
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   152
  apply (subgoal_tac "eqvt_at height_trm ba")
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   153
  apply (thin_tac "eqvt_at height_trm_height_bp_sumC (Inr bp)")
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   154
  apply (thin_tac "eqvt_at height_trm_height_bp_sumC (Inr bpa)")
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   155
  apply (thin_tac "eqvt_at height_trm_height_bp_sumC (Inl b)")
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   156
  apply (thin_tac "eqvt_at height_trm_height_bp_sumC (Inl ba)")
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   157
  defer
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   158
  apply (simp add: eqvt_at_def height_trm_def)
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   159
  apply (simp add: eqvt_at_def height_trm_def)
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   160
  apply (simp add: eqvt_at_def height_bp_def)
aaaed6367b8f Removed Inl and Inr
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2917
diff changeset
   161
  apply (simp add: eqvt_at_def height_bp_def)
2919
13ae668bdb15 eapply fcb ok
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2918
diff changeset
   162
  apply (subgoal_tac "height_bp bp = height_bp bpa")
13ae668bdb15 eapply fcb ok
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2918
diff changeset
   163
  apply (subgoal_tac "height_trm b = height_trm ba")
13ae668bdb15 eapply fcb ok
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2918
diff changeset
   164
  apply simp
13ae668bdb15 eapply fcb ok
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2918
diff changeset
   165
  apply (subgoal_tac "(\<lambda>as x c. height_trm (snd (bp, b))) as x c = (\<lambda>as x c. height_trm (snd (bpa, ba))) as x c")
13ae668bdb15 eapply fcb ok
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2918
diff changeset
   166
  apply simp
2920
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   167
  apply (erule_tac c="()" in Abs_lst_fcb2)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   168
  apply (simp add: fresh_star_def pure_fresh)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   169
  apply (simp add: fresh_star_def pure_fresh)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   170
  apply (simp add: fresh_star_def pure_fresh)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   171
  apply (simp add: eqvt_at_def)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   172
  apply (simp add: eqvt_at_def)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   173
  defer defer
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   174
  apply (subgoal_tac "(\<lambda>as x c. height_bp (fst (bp, b))) as x c = (\<lambda>as x c. height_bp (fst (bpa, ba))) as x c")
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   175
  apply simp
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   176
  apply (erule_tac c="()" in Abs_lst_fcb2)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   177
  apply (simp add: fresh_star_def pure_fresh)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   178
  apply (simp add: fresh_star_def pure_fresh)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   179
  apply (simp add: fresh_star_def pure_fresh)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   180
  apply (simp add: fresh_star_def pure_fresh)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   181
  apply (simp add: eqvt_at_def)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   182
  apply (simp add: eqvt_at_def)
99069744ad74 Leftover only inj and eqvt
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2919
diff changeset
   183
--""
2922
a27215ab674e some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2920
diff changeset
   184
  apply(simp_all add: eqvt_def inj_on_def)
a27215ab674e some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2920
diff changeset
   185
  apply(perm_simp)
a27215ab674e some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2920
diff changeset
   186
  apply(simp)
a27215ab674e some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2920
diff changeset
   187
  apply(perm_simp)
a27215ab674e some experiments
Christian Urban <urbanc@in.tum.de>
parents: 2920
diff changeset
   188
  apply(simp)
2915
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
  done
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
termination by lexicographic_order
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
end
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
b4bf3ff4bc91 added let-rec example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196