Nominal/Ex/Foo1.thy
author Christian Urban <urbanc@in.tum.de>
Mon, 06 Dec 2010 16:35:42 +0000
changeset 2594 515e5496171c
parent 2593 25dcb2b1329e
child 2598 b136721eedb2
permissions -rw-r--r--
automated alpha_perm_bn theorems
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory Foo1
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports "../Nominal2" 
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
     5
text {* 
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
  Contrived example that has more than one
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
     7
  binding function
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
     8
*}
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
2571
f0252365936c proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents: 2564
diff changeset
    10
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
atom_decl name
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
nominal_datatype foo: trm =
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  Var "name"
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
| App "trm" "trm"
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
| Lam x::"name" t::"trm"  bind x in t
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
| Let1 a::"assg" t::"trm"  bind "bn1 a" in t
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
| Let2 a::"assg" t::"trm"  bind "bn2 a" in t
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
| Let3 a::"assg" t::"trm"  bind "bn3 a" in t
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    20
| Let4 a::"assg'" t::"trm"  bind (set) "bn4 a" in t
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
and assg =
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
  As "name" "name" "trm"
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    23
and assg' =
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    24
  BNil
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    25
| BAs "name" "assg'"
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
binder
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
  bn1::"assg \<Rightarrow> atom list" and
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
  bn2::"assg \<Rightarrow> atom list" and
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    29
  bn3::"assg \<Rightarrow> atom list" and
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    30
  bn4::"assg' \<Rightarrow> atom set"
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
where
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  "bn1 (As x y t) = [atom x]"
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
| "bn2 (As x y t) = [atom y]"
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
| "bn3 (As x y t) = [atom x, atom y]"
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    35
| "bn4 (BNil) = {}"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    36
| "bn4 (BAs a as) = {atom a} \<union> bn4 as"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    37
2593
25dcb2b1329e ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents: 2588
diff changeset
    38
thm foo.perm_bn_alpha
25dcb2b1329e ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents: 2588
diff changeset
    39
thm foo.perm_bn_simps
25dcb2b1329e ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents: 2588
diff changeset
    40
thm foo.bn_finite
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
thm foo.distinct
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
thm foo.induct
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
thm foo.inducts
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
thm foo.exhaust
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
thm foo.fv_defs
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
thm foo.bn_defs
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
thm foo.perm_simps
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
thm foo.eq_iff
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
thm foo.fv_bn_eqvt
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
thm foo.size_eqvt
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
thm foo.supports
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
thm foo.fsupp
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
thm foo.supp
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
thm foo.fresh
2571
f0252365936c proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents: 2564
diff changeset
    56
thm foo.bn_finite
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    58
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    59
lemma tt1:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    60
  shows "(p \<bullet> bn1 as) = bn1 (permute_bn1 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    61
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    62
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    63
apply(simp add: foo.perm_bn_simps foo.bn_defs)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    64
apply(simp add: atom_eqvt)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    65
apply(auto)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    66
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    67
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    68
lemma tt2:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    69
  shows "(p \<bullet> bn2 as) = bn2 (permute_bn2 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    70
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    71
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    72
apply(simp add: foo.perm_bn_simps foo.bn_defs)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    73
apply(simp add: atom_eqvt)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    74
apply(auto)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    75
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    76
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    77
lemma tt3:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    78
  shows "(p \<bullet> bn3 as) = bn3 (permute_bn3 p as)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    79
apply(induct as rule: foo.inducts(2))
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    80
apply(auto)[7]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    81
apply(simp add: foo.perm_bn_simps foo.bn_defs)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
    82
apply(simp add: atom_eqvt)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    83
apply(auto)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    84
done
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    85
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    86
lemma tt4:
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    87
  shows "(p \<bullet> bn4 as) = bn4 (permute_bn4 p as)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    88
apply(induct as rule: foo.inducts(3))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    89
apply(auto)[8]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    90
apply(simp add: foo.perm_bn_simps foo.bn_defs permute_set_eq)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    91
apply(simp add: foo.perm_bn_simps foo.bn_defs)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    92
apply(simp add: atom_eqvt insert_eqvt)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    93
done
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
    94
2586
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
    95
lemma strong_exhaust1:
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
    96
  fixes c::"'a::fs"
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
    97
  assumes "\<exists>name. y = Var name \<Longrightarrow> P" 
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
    98
  and     "\<exists>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
2588
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
    99
  and     "\<exists>name trm.  {atom name} \<sharp>* c \<and> y = Lam name trm \<Longrightarrow> P" 
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   100
  and     "\<exists>(c::'a::fs) assn trm. set (bn1 assn) \<sharp>* c \<and> y = Let1 assn trm \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   101
  and     "\<exists>(c::'a::fs) assn trm. set (bn2 assn) \<sharp>* c \<and> y = Let2 assn trm \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   102
  and     "\<exists>(c::'a::fs) assn trm. set (bn3 assn) \<sharp>* c \<and> y = Let3 assn trm \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   103
  and     "\<exists>(c::'a::fs) assn' trm. (bn4 assn') \<sharp>* c \<and> y = Let4 assn' trm \<Longrightarrow> P"
2586
3ebc7ecfb0dd disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents: 2573
diff changeset
   104
  shows "P"
2594
515e5496171c automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents: 2593
diff changeset
   105
oops
2588
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   106
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   107
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   108
lemma strong_exhaust2:
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   109
  fixes c::"'a::fs"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   110
  assumes "\<And>name. y = Var name \<Longrightarrow> P" 
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   111
  and     "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   112
  and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   113
  and     "\<And>assn trm. \<lbrakk>set (bn1 assn) \<sharp>* c; y = Let1 assn trm\<rbrakk> \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   114
  and     "\<And>assn trm. \<lbrakk>set (bn2 assn) \<sharp>* c; y = Let2 assn trm\<rbrakk> \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   115
  and     "\<And>assn trm. \<lbrakk>set (bn3 assn) \<sharp>* c; y = Let3 assn trm\<rbrakk> \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   116
  and     "\<And>assn' trm. \<lbrakk>(bn4 assn') \<sharp>* c; y = Let4 assn' trm\<rbrakk> \<Longrightarrow> P"
8f5420681039 completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents: 2586
diff changeset
   117
  shows "P"
2594
515e5496171c automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents: 2593
diff changeset
   118
oops
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   119
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   120
lemma strong_exhaust1:
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   121
  fixes c::"'a::fs"
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   122
  assumes "\<And>name. y = Var name \<Longrightarrow> P" 
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   123
  and     "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   124
  and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   125
  and     "\<And>assn trm. \<lbrakk>set (bn1 assn) \<sharp>* c; y = Let1 assn trm\<rbrakk> \<Longrightarrow> P"
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   126
  and     "\<And>assn trm. \<lbrakk>set (bn2 assn) \<sharp>* c; y = Let2 assn trm\<rbrakk> \<Longrightarrow> P"
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   127
  and     "\<And>assn trm. \<lbrakk>set (bn3 assn) \<sharp>* c; y = Let3 assn trm\<rbrakk> \<Longrightarrow> P"
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   128
  and     "\<And>assn' trm. \<lbrakk>(bn4 assn') \<sharp>* c; y = Let4 assn' trm\<rbrakk> \<Longrightarrow> P"
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   129
  shows "P"
2594
515e5496171c automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents: 2593
diff changeset
   130
oops 
2571
f0252365936c proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents: 2564
diff changeset
   131
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   132
lemma strong_exhaust2:
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   133
  assumes "\<And>x y t. as = As x y t \<Longrightarrow> P" 
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   134
  shows "P"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   135
apply(rule_tac y="as" in foo.exhaust(2))
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   136
apply(rule assms(1))
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   137
apply(assumption)
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   138
done
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   139
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   140
lemma strong_exhaust3:
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   141
  assumes "as' = BNil \<Longrightarrow> P"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   142
  and "\<And>a as. as' = BAs a as \<Longrightarrow> P" 
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   143
  shows "P"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   144
apply(rule_tac y="as'" in foo.exhaust(3))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   145
apply(rule assms(1))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   146
apply(assumption)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   147
apply(rule assms(2))
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   148
apply(assumption)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   149
done
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   150
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   151
lemma 
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   152
  fixes t::trm
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   153
  and   as::assg
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   154
  and   as'::assg'
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   155
  and   c::"'a::fs"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   156
  assumes a1: "\<And>x c. P1 c (Var x)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   157
  and     a2: "\<And>t1 t2 c. \<lbrakk>\<And>d. P1 d t1; \<And>d. P1 d t2\<rbrakk> \<Longrightarrow> P1 c (App t1 t2)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   158
  and     a3: "\<And>x t c. \<lbrakk>{atom x} \<sharp>* c; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Lam x t)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   159
  and     a4: "\<And>as t c. \<lbrakk>set (bn1 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let1 as t)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   160
  and     a5: "\<And>as t c. \<lbrakk>set (bn2 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let2 as t)"
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   161
  and     a6: "\<And>as t c. \<lbrakk>set (bn3 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let3 as t)"
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   162
  and     a7: "\<And>as' t c. \<lbrakk>(bn4 as') \<sharp>* c; \<And>d. P3 d as'; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let4 as' t)" 
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   163
  and     a8: "\<And>x y t c. \<And>d. P1 d t \<Longrightarrow> P2 c (As x y t)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   164
  and     a9: "\<And>c. P3 c (BNil)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   165
  and     a10: "\<And>c a as. \<And>d. P3 d as \<Longrightarrow> P3 c (BAs a as)"
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   166
  shows "P1 c t" "P2 c as" "P3 c as'"
2594
515e5496171c automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents: 2593
diff changeset
   167
oops
515e5496171c automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents: 2593
diff changeset
   168
(*
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   169
using assms
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   170
apply(induction_schema)
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   171
apply(rule_tac y="t" and c="c" in strong_exhaust1)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   172
apply(simp_all)[7]
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   173
apply(rule_tac as="as" in strong_exhaust2)
2503
cc5d23547341 simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents: 2500
diff changeset
   174
apply(simp)
2564
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   175
apply(rule_tac as'="as'" in strong_exhaust3)
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   176
apply(simp_all)[2]
5be8e34c2c0e tuned example
Christian Urban <urbanc@in.tum.de>
parents: 2562
diff changeset
   177
apply(relation "measure (sum_case (size o snd) (sum_case (\<lambda>y. size (snd y)) (\<lambda>z. size (snd z))))")
2500
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   178
apply(simp_all add: foo.size)
3b6a70e73006 worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents: 2494
diff changeset
   179
done
2594
515e5496171c automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents: 2593
diff changeset
   180
*)
2494
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
end
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
11133eb76f61 added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185