Nominal/Ex/ExCoreHaskell.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Mon, 03 May 2010 14:30:37 +0200
changeset 2025 070ba8972e97
parent 1958 e2e19188576e
child 2044 695c1ed61879
permissions -rw-r--r--
Register only non-looping rules in eq_iff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     1
theory ExCoreHaskell
1773
c0eac04ae3b4 added README and moved examples into separate directory
Christian Urban <urbanc@in.tum.de>
parents: 1701
diff changeset
     2
imports "../Parser"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
(* core haskell *)
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
1624
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
     7
ML {* val _ = recursive := false *}
1867
f4477d3fe520 preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents: 1846
diff changeset
     8
(* this should not be an equivariance rule *)
f4477d3fe520 preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents: 1846
diff changeset
     9
(* for the moment, we force it to be       *)
1846
756982b4fe20 temporary fix for CoreHaskell
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    10
setup {* Context.theory_map (Nominal_ThmDecls.add_thm @{thm "permute_pure"}) *}
756982b4fe20 temporary fix for CoreHaskell
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    11
thm eqvts
756982b4fe20 temporary fix for CoreHaskell
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    12
(*declare permute_pure[eqvt]*)
1656
c9d3dda79fe3 Removed remaining cheats + some cleaning.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1653
diff changeset
    13
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    14
atom_decl var
1698
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    15
atom_decl cvar
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
atom_decl tvar
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    17
1606
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    18
(* there are types, coercion types and regular types list-data-structure *)
1609
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    19
1695
e42ee5947b5c Changed to Lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1688
diff changeset
    20
ML {* val _ = alpha_type := AlphaLst *}
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    21
nominal_datatype tkind =
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    22
  KStar
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    23
| KFun "tkind" "tkind"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    24
and ckind =
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    25
  CKEq "ty" "ty"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    26
and ty =
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    27
  TVar "tvar"
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
    28
| TC "string"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    29
| TApp "ty" "ty"
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
    30
| TFun "string" "ty_lst"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    31
| TAll tv::"tvar" "tkind" T::"ty"  bind tv in T
1698
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    32
| TEq "ckind" "ty"
1606
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    33
and ty_lst =
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    34
  TsNil
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    35
| TsCons "ty" "ty_lst"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    36
and co =
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1698
diff changeset
    37
  CVar "cvar"
1698
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    38
| CConst "string"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    39
| CApp "co" "co"
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
    40
| CFun "string" "co_lst"
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1698
diff changeset
    41
| CAll cv::"cvar" "ckind" C::"co"  bind cv in C
1698
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    42
| CEq "ckind" "co"
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    43
| CRefl "ty"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    44
| CSym "co"
1698
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    45
| CCir "co" "co"
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    46
| CAt "co" "ty"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    47
| CLeft "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    48
| CRight "co"
1698
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    49
| CSim "co" "co"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    50
| CRightc "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    51
| CLeftc "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    52
| CCoe "co" "co"
1606
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    53
and co_lst =
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    54
  CsNil
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    55
| CsCons "co" "co_lst"
1609
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    56
and trm =
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    57
  Var "var"
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1698
diff changeset
    58
| K "string"
1609
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    59
| LAMT tv::"tvar" "tkind" t::"trm" bind tv in t
1698
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    60
| LAMC cv::"cvar" "ckind" t::"trm" bind cv in t
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    61
| AppT "trm" "ty"
69472e74bd3b Update according to paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1695
diff changeset
    62
| AppC "trm" "co"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    63
| Lam v::"var" "ty" t::"trm"       bind v in t
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    64
| App "trm" "trm"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    65
| Let x::"var" "ty" "trm" t::"trm" bind x in t
1609
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    66
| Case "trm" "assoc_lst"
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    67
| Cast "trm" "ty"                  --"ty is supposed to be a coercion type only"
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    68
and assoc_lst =
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    69
  ANil
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    70
| ACons p::"pat" t::"trm" "assoc_lst" bind "bv p" in t
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    71
and pat =
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    72
  Kpat "string" "tvars" "cvars" "vars"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    73
and vars =
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    74
  VsNil
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    75
| VsCons "var" "ty" "vars"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    76
and tvars =
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    77
  TvsNil
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    78
| TvsCons "tvar" "tkind" "tvars"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    79
and cvars =
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    80
  CvsNil
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    81
| CvsCons "cvar" "ckind" "cvars"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    82
binder
1695
e42ee5947b5c Changed to Lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1688
diff changeset
    83
    bv :: "pat \<Rightarrow> atom list"
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    84
and bv_vs :: "vars \<Rightarrow> atom list"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    85
and bv_tvs :: "tvars \<Rightarrow> atom list"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    86
and bv_cvs :: "cvars \<Rightarrow> atom list"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    87
where
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    88
  "bv (Kpat s tvts tvcs vs) = append (bv_tvs tvts) (append (bv_cvs tvcs) (bv_vs vs))"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    89
| "bv_vs VsNil = []"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    90
| "bv_vs (VsCons v k t) = (atom v) # bv_vs t"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    91
| "bv_tvs TvsNil = []"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    92
| "bv_tvs (TvsCons v k t) = (atom v) # bv_tvs t"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    93
| "bv_cvs CvsNil = []"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
    94
| "bv_cvs (CvsCons v k t) = (atom v) # bv_cvs t"
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    95
1958
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
    96
(*
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
    97
function
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
    98
rfv_tkind_raw and rfv_ckind_raw and rfv_ty_raw and rfv_ty_lst_raw and rfv_co_raw and rfv_co_lst_raw and rfv_trm_raw and rfv_assoc_lst_raw and rfv_bv_raw and rfv_bv_vs_raw and rfv_bv_tvs_raw and rfv_bv_cvs_raw and rfv_pat_raw and rfv_vars_raw and rfv_tvars_raw and rfv_cvars_raw
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
    99
where
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   100
  "rfv_tkind_raw KStar_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   101
| "rfv_tkind_raw (KFun_raw tkind_raw1 tkind_raw2) = rfv_tkind_raw tkind_raw1 \<union> rfv_tkind_raw tkind_raw2"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   102
| "rfv_ckind_raw (CKEq_raw ty_raw1 ty_raw2) = rfv_ty_raw ty_raw1 \<union> rfv_ty_raw ty_raw2"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   103
| "rfv_ty_raw (TVar_raw tvar) = {atom tvar}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   104
| "rfv_ty_raw (TC_raw list) = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   105
| "rfv_ty_raw (TApp_raw ty_raw1 ty_raw2) = rfv_ty_raw ty_raw1 \<union> rfv_ty_raw ty_raw2"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   106
| "rfv_ty_raw (TFun_raw list ty_lst_raw) = rfv_ty_lst_raw ty_lst_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   107
| "rfv_ty_raw (TAll_raw tvar tkind_raw ty_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   108
 rfv_tkind_raw tkind_raw \<union> (rfv_ty_raw ty_raw - {atom tvar})"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   109
| "rfv_ty_raw (TEq_raw ckind_raw ty_raw) = rfv_ckind_raw ckind_raw \<union> rfv_ty_raw ty_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   110
| "rfv_ty_lst_raw TsNil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   111
| "rfv_ty_lst_raw (TsCons_raw ty_raw ty_lst_raw) = rfv_ty_raw ty_raw \<union> rfv_ty_lst_raw ty_lst_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   112
| "rfv_co_raw (CVar_raw cvar) = {atom cvar}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   113
| "rfv_co_raw (CConst_raw list) = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   114
| "rfv_co_raw (CApp_raw co_raw1 co_raw2) = rfv_co_raw co_raw1 \<union> rfv_co_raw co_raw2"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   115
| "rfv_co_raw (CFun_raw list co_lst_raw) = rfv_co_lst_raw co_lst_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   116
| "rfv_co_raw (CAll_raw cvar ckind_raw co_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   117
 rfv_ckind_raw ckind_raw \<union> (rfv_co_raw co_raw - {atom cvar})"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   118
| "rfv_co_raw (CEq_raw ckind_raw co_raw) = rfv_ckind_raw ckind_raw \<union> rfv_co_raw co_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   119
| "rfv_co_raw (CRefl_raw ty_raw) = rfv_ty_raw ty_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   120
| "rfv_co_raw (CSym_raw co_raw) = rfv_co_raw co_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   121
| "rfv_co_raw (CCir_raw co_raw1 co_raw2) = rfv_co_raw co_raw1 \<union> rfv_co_raw co_raw2"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   122
| "rfv_co_raw (CAt_raw co_raw ty_raw) = rfv_co_raw co_raw \<union> rfv_ty_raw ty_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   123
| "rfv_co_raw (CLeft_raw co_raw) = rfv_co_raw co_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   124
| "rfv_co_raw (CRight_raw co_raw) = rfv_co_raw co_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   125
| "rfv_co_raw (CSim_raw co_raw1 co_raw2) = rfv_co_raw co_raw1 \<union> rfv_co_raw co_raw2"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   126
| "rfv_co_raw (CRightc_raw co_raw) = rfv_co_raw co_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   127
| "rfv_co_raw (CLeftc_raw co_raw) = rfv_co_raw co_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   128
| "rfv_co_raw (CCoe_raw co_raw1 co_raw2) = rfv_co_raw co_raw1 \<union> rfv_co_raw co_raw2"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   129
| "rfv_co_lst_raw CsNil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   130
| "rfv_co_lst_raw (CsCons_raw co_raw co_lst_raw) = rfv_co_raw co_raw \<union> rfv_co_lst_raw co_lst_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   131
| "rfv_trm_raw (Var_raw var) = {atom var}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   132
| "rfv_trm_raw (K_raw list) = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   133
| "rfv_trm_raw (LAMT_raw tvar tkind_raw trm_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   134
 rfv_tkind_raw tkind_raw \<union> (rfv_trm_raw trm_raw - {atom tvar})"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   135
| "rfv_trm_raw (LAMC_raw cvar ckind_raw trm_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   136
 rfv_ckind_raw ckind_raw \<union> (rfv_trm_raw trm_raw - {atom cvar})"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   137
| "rfv_trm_raw (AppT_raw trm_raw ty_raw) = rfv_trm_raw trm_raw \<union> rfv_ty_raw ty_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   138
| "rfv_trm_raw (AppC_raw trm_raw co_raw) = rfv_trm_raw trm_raw \<union> rfv_co_raw co_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   139
| "rfv_trm_raw (Lam_raw var ty_raw trm_raw) = rfv_ty_raw ty_raw \<union> (rfv_trm_raw trm_raw - {atom var})"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   140
| "rfv_trm_raw (App_raw trm_raw1 trm_raw2) = rfv_trm_raw trm_raw1 \<union> rfv_trm_raw trm_raw2"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   141
| "rfv_trm_raw (Let_raw var ty_raw trm_raw1 trm_raw2) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   142
 rfv_ty_raw ty_raw \<union> (rfv_trm_raw trm_raw1 \<union> (rfv_trm_raw trm_raw2 - {atom var}))"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   143
| "rfv_trm_raw (Case_raw trm_raw assoc_lst_raw) = rfv_trm_raw trm_raw \<union> rfv_assoc_lst_raw assoc_lst_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   144
| "rfv_trm_raw (Cast_raw trm_raw ty_raw) = rfv_trm_raw trm_raw \<union> rfv_ty_raw ty_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   145
| "rfv_assoc_lst_raw ANil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   146
| "rfv_assoc_lst_raw (ACons_raw pat_raw trm_raw assoc_lst_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   147
 rfv_bv_raw pat_raw \<union> (rfv_trm_raw trm_raw - set (bv_raw pat_raw) \<union> rfv_assoc_lst_raw assoc_lst_raw)"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   148
| "rfv_bv_raw (Kpat_raw list tvars_raw cvars_raw vars_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   149
 rfv_bv_tvs_raw tvars_raw \<union> (rfv_bv_cvs_raw cvars_raw \<union> rfv_bv_vs_raw vars_raw)"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   150
| "rfv_bv_vs_raw VsNil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   151
| "rfv_bv_vs_raw (VsCons_raw var ty_raw vars_raw) = rfv_ty_raw ty_raw \<union> rfv_bv_vs_raw vars_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   152
| "rfv_bv_tvs_raw TvsNil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   153
| "rfv_bv_tvs_raw (TvsCons_raw tvar tkind_raw tvars_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   154
 rfv_tkind_raw tkind_raw \<union> rfv_bv_tvs_raw tvars_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   155
| "rfv_bv_cvs_raw CvsNil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   156
| "rfv_bv_cvs_raw (CvsCons_raw cvar ckind_raw cvars_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   157
 rfv_ckind_raw ckind_raw \<union> rfv_bv_cvs_raw cvars_raw"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   158
| "rfv_pat_raw (Kpat_raw list tvars_raw cvars_raw vars_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   159
 rfv_tvars_raw tvars_raw \<union> (rfv_cvars_raw cvars_raw \<union> rfv_vars_raw vars_raw)"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   160
| "rfv_vars_raw VsNil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   161
| "rfv_vars_raw (VsCons_raw var ty_raw vars_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   162
 {atom var} \<union> (rfv_ty_raw ty_raw \<union> rfv_vars_raw vars_raw)"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   163
| "rfv_tvars_raw TvsNil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   164
| "rfv_tvars_raw (TvsCons_raw tvar tkind_raw tvars_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   165
 {atom tvar} \<union> (rfv_tkind_raw tkind_raw \<union> rfv_tvars_raw tvars_raw)"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   166
| "rfv_cvars_raw CvsNil_raw = {}"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   167
| "rfv_cvars_raw (CvsCons_raw cvar ckind_raw cvars_raw) =
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   168
 {atom cvar} \<union> (rfv_ckind_raw ckind_raw \<union> rfv_cvars_raw cvars_raw)"
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   169
apply pat_completeness
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   170
apply auto
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   171
done
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   172
termination
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   173
by lexicographic_order
e2e19188576e Function in Core Haskell
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1868
diff changeset
   174
*)
1800
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
   175
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   176
lemmas fv_supp=tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vars_tvars_cvars.supp(1-9,11,13,15)
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   177
lemmas supp=tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vars_tvars_cvars.fv[simplified fv_supp]
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   178
lemmas perm=tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vars_tvars_cvars.perm
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   179
lemmas eq_iff=tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vars_tvars_cvars.eq_iff
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   180
lemmas inducts=tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vars_tvars_cvars.inducts
1634
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   181
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   182
lemmas alpha_inducts=alpha_tkind_raw_alpha_ckind_raw_alpha_ty_raw_alpha_ty_lst_raw_alpha_co_raw_alpha_co_lst_raw_alpha_trm_raw_alpha_assoc_lst_raw_alpha_pat_raw_alpha_vars_raw_alpha_tvars_raw_alpha_cvars_raw_alpha_bv_raw_alpha_bv_vs_raw_alpha_bv_tvs_raw_alpha_bv_cvs_raw.inducts
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   183
lemmas alpha_intros=alpha_tkind_raw_alpha_ckind_raw_alpha_ty_raw_alpha_ty_lst_raw_alpha_co_raw_alpha_co_lst_raw_alpha_trm_raw_alpha_assoc_lst_raw_alpha_pat_raw_alpha_vars_raw_alpha_tvars_raw_alpha_cvars_raw_alpha_bv_raw_alpha_bv_vs_raw_alpha_bv_tvs_raw_alpha_bv_cvs_raw.intros
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   184
1634
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   185
lemma fresh_star_minus_perm: "as \<sharp>* - p = as \<sharp>* (p :: perm)"
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   186
  unfolding fresh_star_def Ball_def
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   187
  by auto (simp_all add: fresh_minus_perm)
1615
0ea578c6dae3 Parsing bn functions that call other bn functions and transmitting this information to fv/alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1609
diff changeset
   188
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   189
primrec permute_bv_vs_raw
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   190
where "permute_bv_vs_raw p VsNil_raw = VsNil_raw"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   191
|     "permute_bv_vs_raw p (VsCons_raw v t l) = VsCons_raw (p \<bullet> v) t (permute_bv_vs_raw p l)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   192
primrec permute_bv_cvs_raw
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   193
where "permute_bv_cvs_raw p CvsNil_raw = CvsNil_raw"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   194
|     "permute_bv_cvs_raw p (CvsCons_raw v t l) = CvsCons_raw (p \<bullet> v) t (permute_bv_cvs_raw p l)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   195
primrec permute_bv_tvs_raw
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   196
where "permute_bv_tvs_raw p TvsNil_raw = TvsNil_raw"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   197
|     "permute_bv_tvs_raw p (TvsCons_raw v t l) = TvsCons_raw (p \<bullet> v) t (permute_bv_tvs_raw p l)"
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   198
primrec permute_bv_raw
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   199
where "permute_bv_raw p (Kpat_raw c l1 l2 l3) =
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   200
     Kpat_raw c (permute_bv_tvs_raw p l1) (permute_bv_cvs_raw p l2) (permute_bv_vs_raw p l3)"
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   201
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   202
quotient_definition "permute_bv_vs :: perm \<Rightarrow> vars \<Rightarrow> vars"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   203
is "permute_bv_vs_raw"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   204
quotient_definition "permute_bv_cvs :: perm \<Rightarrow> cvars \<Rightarrow> cvars"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   205
is "permute_bv_cvs_raw"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   206
quotient_definition "permute_bv_tvs :: perm \<Rightarrow> tvars \<Rightarrow> tvars"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   207
is "permute_bv_tvs_raw"
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   208
quotient_definition "permute_bv :: perm \<Rightarrow> pat \<Rightarrow> pat"
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   209
is "permute_bv_raw"
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   210
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   211
lemma rsp_pre:
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   212
 "alpha_tvars_raw d a \<Longrightarrow> alpha_tvars_raw (permute_bv_tvs_raw x d) (permute_bv_tvs_raw x a)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   213
 "alpha_cvars_raw e b \<Longrightarrow> alpha_cvars_raw (permute_bv_cvs_raw x e) (permute_bv_cvs_raw x b)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   214
 "alpha_vars_raw f c \<Longrightarrow> alpha_vars_raw (permute_bv_vs_raw x f) (permute_bv_vs_raw x c)"
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   215
 apply (erule_tac [!] alpha_inducts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   216
 apply simp_all
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   217
 apply (rule_tac [!] alpha_intros)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   218
 apply simp_all
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   219
 done
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   220
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   221
lemma [quot_respect]:
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   222
 "(op = ===> alpha_pat_raw ===> alpha_pat_raw) permute_bv_raw permute_bv_raw"
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   223
 "(op = ===> alpha_tvars_raw ===> alpha_tvars_raw) permute_bv_tvs_raw permute_bv_tvs_raw"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   224
 "(op = ===> alpha_cvars_raw ===> alpha_cvars_raw) permute_bv_cvs_raw permute_bv_cvs_raw"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   225
 "(op = ===> alpha_vars_raw ===> alpha_vars_raw) permute_bv_vs_raw permute_bv_vs_raw"
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   226
 apply (simp_all add: rsp_pre)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   227
 apply clarify
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   228
 apply (erule_tac alpha_inducts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   229
 apply (simp_all)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   230
 apply (rule alpha_intros)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   231
 apply (simp_all add: rsp_pre)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   232
 done
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   233
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   234
thm permute_bv_raw.simps[no_vars]
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   235
 permute_bv_vs_raw.simps[quot_lifted]
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   236
 permute_bv_cvs_raw.simps[quot_lifted]
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   237
 permute_bv_tvs_raw.simps[quot_lifted]
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   238
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   239
lemma permute_bv_pre:
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   240
  "permute_bv p (Kpat c l1 l2 l3) =
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   241
   Kpat c (permute_bv_tvs p l1) (permute_bv_cvs p l2) (permute_bv_vs p l3)"
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   242
  by (lifting permute_bv_raw.simps)
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   243
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   244
lemmas permute_bv[simp] =
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   245
 permute_bv_pre
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   246
 permute_bv_vs_raw.simps[quot_lifted]
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   247
 permute_bv_cvs_raw.simps[quot_lifted]
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   248
 permute_bv_tvs_raw.simps[quot_lifted]
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   249
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   250
lemma perm_bv1:
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   251
  "p \<bullet> bv_cvs b = bv_cvs (permute_bv_cvs p b)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   252
  "p \<bullet> bv_tvs c = bv_tvs (permute_bv_tvs p c)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   253
  "p \<bullet> bv_vs d = bv_vs (permute_bv_vs p d)"
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   254
  apply(induct b rule: inducts(12))
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   255
  apply(rule TrueI)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   256
  apply(simp_all add:permute_bv eqvts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   257
  apply(induct c rule: inducts(11))
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   258
  apply(rule TrueI)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   259
  apply(simp_all add:permute_bv eqvts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   260
  apply(induct d rule: inducts(10))
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   261
  apply(rule TrueI)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   262
  apply(simp_all add:permute_bv eqvts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   263
  done
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   264
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   265
lemma perm_bv2:
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   266
  "p \<bullet> bv l = bv (permute_bv p l)"
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   267
  apply(induct l rule: inducts(9))
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   268
  apply(rule TrueI)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   269
  apply(simp_all add:permute_bv)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   270
  apply(simp add: perm_bv1[symmetric])
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   271
  apply(simp add: eqvts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   272
  done
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   273
1648
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   274
lemma alpha_perm_bn1:
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   275
 " alpha_bv_tvs tvars (permute_bv_tvs q tvars)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   276
 "alpha_bv_cvs cvars (permute_bv_cvs q cvars)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   277
 "alpha_bv_vs vars (permute_bv_vs q vars)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   278
  apply(induct tvars rule: inducts(11))
1648
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   279
  apply(simp_all add:permute_bv eqvts eq_iff)
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   280
  apply(induct cvars rule: inducts(12))
1648
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   281
  apply(simp_all add:permute_bv eqvts eq_iff)
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   282
  apply(induct vars rule: inducts(10))
1648
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   283
  apply(simp_all add:permute_bv eqvts eq_iff)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   284
  done
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   285
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   286
lemma alpha_perm_bn:
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   287
  "alpha_bv pat (permute_bv q pat)"
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   288
  apply(induct pat rule: inducts(9))
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   289
  apply(simp_all add:permute_bv eqvts eq_iff alpha_perm_bn1)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   290
  done
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   291
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   292
lemma ACons_subst:
1695
e42ee5947b5c Changed to Lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1688
diff changeset
   293
  "supp (Abs_lst (bv pat) trm) \<sharp>* q \<Longrightarrow> (ACons pat trm al) = ACons (permute_bv q pat) (q \<bullet> trm) al"
1648
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   294
  apply (simp only: eq_iff)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   295
  apply (rule_tac x="q" in exI)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   296
  apply (simp add: alphas)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   297
  apply (simp add: perm_bv2[symmetric])
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   298
  apply (simp add: eqvts[symmetric])
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   299
  apply (simp add: supp_abs)
1648
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   300
  apply (simp add: fv_supp)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   301
  apply (simp add: alpha_perm_bn)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   302
  apply (rule supp_perm_eq[symmetric])
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   303
  apply (subst supp_finite_atom_set)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   304
  apply (rule finite_Diff)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   305
  apply (simp add: finite_supp)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   306
  apply (assumption)
1ca332adc247 Showed ACons_subst.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1647
diff changeset
   307
  done
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   308
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   309
lemma permute_bv_zero1:
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   310
  "permute_bv_cvs 0 b = b"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   311
  "permute_bv_tvs 0 c = c"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   312
  "permute_bv_vs 0 d = d"
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   313
  apply(induct b rule: inducts(12))
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   314
  apply(rule TrueI)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   315
  apply(simp_all add:permute_bv eqvts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   316
  apply(induct c rule: inducts(11))
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   317
  apply(rule TrueI)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   318
  apply(simp_all add:permute_bv eqvts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   319
  apply(induct d rule: inducts(10))
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   320
  apply(rule TrueI)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   321
  apply(simp_all add:permute_bv eqvts)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   322
  done
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   323
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   324
lemma permute_bv_zero2:
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   325
  "permute_bv 0 a = a"
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   326
  apply(induct a rule: inducts(9))
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   327
  apply(rule TrueI)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   328
  apply(simp_all add:permute_bv eqvts permute_bv_zero1)
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   329
  done
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   330
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   331
lemma fv_alpha1: "fv_bv_tvs x \<sharp>* pa \<Longrightarrow> alpha_bv_tvs (pa \<bullet> x) x"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   332
apply (induct x rule: inducts(11))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   333
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   334
apply (simp_all add: eq_iff fresh_star_union)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   335
apply (subst supp_perm_eq)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   336
apply (simp_all add: fv_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   337
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   338
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   339
lemma fv_alpha2: "fv_bv_cvs x \<sharp>* pa \<Longrightarrow> alpha_bv_cvs (pa \<bullet> x) x"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   340
apply (induct x rule: inducts(12))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   341
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   342
apply (simp_all add: eq_iff fresh_star_union)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   343
apply (subst supp_perm_eq)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   344
apply (simp_all add: fv_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   345
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   346
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   347
lemma fv_alpha3: "fv_bv_vs x \<sharp>* pa \<Longrightarrow> alpha_bv_vs (pa \<bullet> x) x"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   348
apply (induct x rule: inducts(10))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   349
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   350
apply (simp_all add: eq_iff fresh_star_union)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   351
apply (subst supp_perm_eq)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   352
apply (simp_all add: fv_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   353
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   354
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   355
lemma fv_alpha: "fv_bv x \<sharp>* pa \<Longrightarrow> alpha_bv (pa \<bullet> x) x"
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   356
apply (induct x rule: inducts(9))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   357
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   358
apply (simp_all add: eq_iff fresh_star_union)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   359
apply (simp add: fv_alpha1 fv_alpha2 fv_alpha3)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   360
apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   361
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   362
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   363
lemma fin1: "finite (fv_bv_tvs x)"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   364
apply (induct x rule: inducts(11))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   365
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   366
apply (simp_all add: fv_supp finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   367
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   368
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   369
lemma fin2: "finite (fv_bv_cvs x)"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   370
apply (induct x rule: inducts(12))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   371
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   372
apply (simp_all add: fv_supp finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   373
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   374
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   375
lemma fin3: "finite (fv_bv_vs x)"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   376
apply (induct x rule: inducts(10))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   377
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   378
apply (simp_all add: fv_supp finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   379
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   380
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   381
lemma fin_fv_bv: "finite (fv_bv x)"
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   382
apply (induct x rule: inducts(9))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   383
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   384
apply (simp add: fin1 fin2 fin3)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   385
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   386
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   387
lemma finb1: "finite (set (bv_tvs x))"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   388
apply (induct x rule: inducts(11))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   389
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   390
apply (simp_all add: fv_supp finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   391
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   392
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   393
lemma finb2: "finite (set (bv_cvs x))"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   394
apply (induct x rule: inducts(12))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   395
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   396
apply (simp_all add: fv_supp finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   397
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   398
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   399
lemma finb3: "finite (set (bv_vs x))"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   400
apply (induct x rule: inducts(10))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   401
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   402
apply (simp_all add: fv_supp finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   403
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   404
1695
e42ee5947b5c Changed to Lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1688
diff changeset
   405
lemma fin_bv: "finite (set (bv x))"
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   406
apply (induct x rule: inducts(9))
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   407
apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *})
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   408
apply (simp add: finb1 finb2 finb3)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   409
done
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   410
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   411
thm tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vars_tvars_cvars.induct
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   412
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   413
lemma strong_induction_principle:
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   414
  assumes a01: "\<And>b. P1 b KStar"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   415
  and a02: "\<And>tkind1 tkind2 b. \<lbrakk>\<And>c. P1 c tkind1; \<And>c. P1 c tkind2\<rbrakk> \<Longrightarrow> P1 b (KFun tkind1 tkind2)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   416
  and a03: "\<And>ty1 ty2 b. \<lbrakk>\<And>c. P3 c ty1; \<And>c. P3 c ty2\<rbrakk> \<Longrightarrow> P2 b (CKEq ty1 ty2)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   417
  and a04: "\<And>tvar b. P3 b (TVar tvar)"
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   418
  and a05: "\<And>string b. P3 b (TC string)"
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   419
  and a06: "\<And>ty1 ty2 b. \<lbrakk>\<And>c. P3 c ty1; \<And>c. P3 c ty2\<rbrakk> \<Longrightarrow> P3 b (TApp ty1 ty2)"
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   420
  and a07: "\<And>string ty_lst b. \<lbrakk>\<And>c. P4 c ty_lst\<rbrakk> \<Longrightarrow> P3 b (TFun string ty_lst)"
1632
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   421
  and a08: "\<And>tvar tkind ty b. \<lbrakk>\<And>c. P1 c tkind; \<And>c. P3 c ty; atom tvar \<sharp> b\<rbrakk>
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   422
    \<Longrightarrow> P3 b (TAll tvar tkind ty)"
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   423
  and a09: "\<And>ck ty b. \<lbrakk>\<And>c. P2 c ck; \<And>c. P3 c ty\<rbrakk> \<Longrightarrow> P3 b (TEq ck ty)"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   424
  and a10: "\<And>b. P4 b TsNil"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   425
  and a11: "\<And>ty ty_lst b. \<lbrakk>\<And>c. P3 c ty; \<And>c. P4 c ty_lst\<rbrakk> \<Longrightarrow> P4 b (TsCons ty ty_lst)"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   426
  and a12: "\<And>string b. P5 b (CVar string)"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   427
  and a12a:"\<And>str b. P5 b (CConst str)"
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   428
  and a13: "\<And>co1 co2 b. \<lbrakk>\<And>c. P5 c co1; \<And>c. P5 c co2\<rbrakk> \<Longrightarrow> P5 b (CApp co1 co2)"
1684
b9e4c812d2c6 Core Haskell can now use proper strings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1667
diff changeset
   429
  and a14: "\<And>string co_lst b. \<lbrakk>\<And>c. P6 c co_lst\<rbrakk> \<Longrightarrow> P5 b (CFun string co_lst)"
1632
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   430
  and a15: "\<And>tvar ckind co b. \<lbrakk>\<And>c. P2 c ckind; \<And>c. P5 c co; atom tvar \<sharp> b\<rbrakk>
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   431
    \<Longrightarrow> P5 b (CAll tvar ckind co)"
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   432
  and a16: "\<And>ck co b. \<lbrakk>\<And>c. P2 c ck; \<And>c. P5 c co\<rbrakk> \<Longrightarrow> P5 b (CEq ck co)"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   433
  and a17: "\<And>ty b. \<lbrakk>\<And>c. P3 c ty\<rbrakk> \<Longrightarrow> P5 b (CRefl ty)"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   434
  and a17a: "\<And>co b. \<lbrakk>\<And>c. P5 c co\<rbrakk> \<Longrightarrow> P5 b (CSym co)"
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   435
  and a18: "\<And>co1 co2 b. \<lbrakk>\<And>c. P5 c co1; \<And>c. P5 c co2\<rbrakk> \<Longrightarrow> P5 b (CCir co1 co2)"
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   436
  and a18a:"\<And>co ty b. \<lbrakk>\<And>c. P5 c co; \<And>c. P3 c ty\<rbrakk> \<Longrightarrow> P5 b (CAt co ty)"
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   437
  and a19: "\<And>co b. \<lbrakk>\<And>c. P5 c co\<rbrakk> \<Longrightarrow> P5 b (CLeft co)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   438
  and a20: "\<And>co b. \<lbrakk>\<And>c. P5 c co\<rbrakk> \<Longrightarrow> P5 b (CRight co)"
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   439
  and a21: "\<And>co1 co2 b. \<lbrakk>\<And>c. P5 c co1; \<And>c. P5 c co2\<rbrakk> \<Longrightarrow> P5 b (CSim co1 co2)"
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   440
  and a22: "\<And>co b. \<lbrakk>\<And>c. P5 c co\<rbrakk> \<Longrightarrow> P5 b (CRightc co)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   441
  and a23: "\<And>co b. \<lbrakk>\<And>c. P5 c co\<rbrakk> \<Longrightarrow> P5 b (CLeftc co)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   442
  and a24: "\<And>co1 co2 b. \<lbrakk>\<And>c. P5 c co1; \<And>c. P5 c co2\<rbrakk> \<Longrightarrow> P5 b (CCoe co1 co2)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   443
  and a25: "\<And>b. P6 b CsNil"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   444
  and a26: "\<And>co co_lst b. \<lbrakk>\<And>c. P5 c co; \<And>c. P6 c co_lst\<rbrakk> \<Longrightarrow> P6 b (CsCons co co_lst)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   445
  and a27: "\<And>var b. P7 b (Var var)"
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   446
  and a28: "\<And>string b. P7 b (K string)"
1632
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   447
  and a29: "\<And>tvar tkind trm b. \<lbrakk>\<And>c. P1 c tkind; \<And>c. P7 c trm; atom tvar \<sharp> b\<rbrakk>
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   448
    \<Longrightarrow> P7 b (LAMT tvar tkind trm)"
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   449
  and a30: "\<And>tvar ckind trm b. \<lbrakk>\<And>c. P2 c ckind; \<And>c. P7 c trm; atom tvar \<sharp> b\<rbrakk>
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   450
    \<Longrightarrow> P7 b (LAMC tvar ckind trm)"
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   451
  and a31: "\<And>trm ty b. \<lbrakk>\<And>c. P7 c trm; \<And>c. P3 c ty\<rbrakk> \<Longrightarrow> P7 b (AppT trm ty)"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   452
  and a31a:"\<And>trm co b. \<lbrakk>\<And>c. P7 c trm; \<And>c. P5 c co\<rbrakk> \<Longrightarrow> P7 b (AppC trm co)"
1632
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   453
  and a32: "\<And>var ty trm b. \<lbrakk>\<And>c. P3 c ty; \<And>c. P7 c trm; atom var \<sharp> b\<rbrakk> \<Longrightarrow> P7 b (Lam var ty trm)"
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   454
  and a33: "\<And>trm1 trm2 b. \<lbrakk>\<And>c. P7 c trm1; \<And>c. P7 c trm2\<rbrakk> \<Longrightarrow> P7 b (App trm1 trm2)"
1632
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   455
  and a34: "\<And>var ty trm1 trm2 b. \<lbrakk>\<And>c. P3 c ty; \<And>c. P7 c trm1; \<And>c. P7 c trm2; atom var \<sharp> b\<rbrakk>
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   456
    \<Longrightarrow> P7 b (Let var ty trm1 trm2)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   457
  and a35: "\<And>trm assoc_lst b. \<lbrakk>\<And>c. P7 c trm; \<And>c. P8 c assoc_lst\<rbrakk> \<Longrightarrow> P7 b (Case trm assoc_lst)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   458
  and a36: "\<And>trm ty b. \<lbrakk>\<And>c. P7 c trm; \<And>c. P3 c ty\<rbrakk> \<Longrightarrow> P7 b (Cast trm ty)"
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   459
  and a37: "\<And>b. P8 b ANil"
1695
e42ee5947b5c Changed to Lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1688
diff changeset
   460
  and a38: "\<And>pat trm assoc_lst b. \<lbrakk>\<And>c. P9 c pat; \<And>c. P7 c trm; \<And>c. P8 c assoc_lst; set (bv (pat)) \<sharp>* b\<rbrakk>
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   461
    \<Longrightarrow> P8 b (ACons pat trm assoc_lst)"
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   462
  and a39: "\<And>string tvars cvars vars b. \<lbrakk>\<And>c. P11 c tvars; \<And>c. P12 c cvars; \<And>c. P10 c vars\<rbrakk>
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   463
    \<Longrightarrow> P9 b (Kpat string tvars cvars vars)"
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   464
  and a40: "\<And>b. P10 b VsNil"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   465
  and a41: "\<And>var ty vars b. \<lbrakk>\<And>c. P3 c ty; \<And>c. P10 c vars\<rbrakk> \<Longrightarrow> P10 b (VsCons var ty vars)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   466
  and a42: "\<And>b. P11 b TvsNil"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   467
  and a43: "\<And>tvar tkind tvars b. \<lbrakk>\<And>c. P1 c tkind; \<And>c. P11 c tvars\<rbrakk>
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   468
    \<Longrightarrow> P11 b (TvsCons tvar tkind tvars)"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   469
  and a44: "\<And>b. P12 b CvsNil"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   470
  and a45: "\<And>tvar ckind cvars b. \<lbrakk>\<And>c. P2 c ckind; \<And>c. P12 c cvars\<rbrakk>
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   471
    \<Longrightarrow> P12 b (CvsCons tvar ckind cvars)"
1632
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   472
  shows "P1 (a :: 'a :: pt) tkind \<and>
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   473
         P2 (b :: 'b :: pt) ckind \<and>
1634
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   474
         P3 (c :: 'c :: {pt,fs}) ty \<and>
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   475
         P4 (d :: 'd :: pt) ty_lst \<and>
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   476
         P5 (e :: 'e :: {pt,fs}) co \<and>
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   477
         P6 (f :: 'f :: pt) co_lst \<and>
1645
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   478
         P7 (g :: 'g :: {pt,fs}) trm \<and>
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   479
         P8 (h :: 'h :: {pt,fs}) assoc_lst \<and>
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   480
         P9 (i :: 'i :: pt) pat \<and>
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   481
         P10 (j :: 'j :: pt) vars \<and>
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   482
         P11 (k :: 'k :: pt) tvars \<and>
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   483
         P12 (l :: 'l :: pt) cvars"
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   484
proof -
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   485
  have a1: "(\<forall>p a. P1 a (p \<bullet> tkind))" and "(\<forall>p b. P2 b (p \<bullet> ckind))" and "(\<forall>p c. P3 c (p \<bullet> ty))" and "(\<forall>p d. P4 d (p \<bullet> ty_lst))" and "(\<forall>p e. P5 e (p \<bullet> co))" and " (\<forall>p f. P6 f (p \<bullet> co_lst))" and "(\<forall>p g. P7 g (p \<bullet> trm))" and "(\<forall>p h. P8 h (p \<bullet> assoc_lst))" and a1:"(\<forall>p q i. P9 i (permute_bv p (q \<bullet> pat)))" and a2:"(\<forall>p q j. P10 j (permute_bv_vs q (p \<bullet> vars)))" and a3:"(\<forall>p q k. P11 k ( permute_bv_tvs q (p \<bullet> tvars)))" and a4:"(\<forall>p q l. P12 l (permute_bv_cvs q (p \<bullet> cvars)))"
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   486
    apply (induct rule: tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vars_tvars_cvars.inducts)
1632
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   487
    apply (tactic {* ALLGOALS (REPEAT o rtac allI) *})
68c8666453f7 Started proving strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1631
diff changeset
   488
    apply (tactic {* ALLGOALS (TRY o SOLVED' (simp_tac @{simpset} THEN_ALL_NEW resolve_tac @{thms assms} THEN_ALL_NEW asm_full_simp_tac @{simpset})) *})
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   489
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   490
(* GOAL1 *)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   491
    apply(subgoal_tac "\<exists>pa. ((pa \<bullet> (atom (p \<bullet> tvar))) \<sharp> c \<and>
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   492
                       supp (Abs (p \<bullet> {atom tvar}) (p \<bullet> ty)) \<sharp>* pa)")
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   493
    apply clarify
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   494
    apply (simp only: perm)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   495
    apply(rule_tac t="TAll (p \<bullet> tvar) (p \<bullet> tkind) (p \<bullet> ty)"
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   496
               and s="TAll (pa \<bullet> p \<bullet> tvar) (p \<bullet> tkind) (pa \<bullet> p \<bullet> ty)" in subst)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   497
    apply (simp only: eq_iff)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   498
    apply (rule_tac x="-pa" in exI)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   499
    apply (simp add: alphas eqvts eqvts_raw supp_abs fv_supp)
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   500
    apply (rule_tac t="supp (pa \<bullet> p \<bullet> ty) - {atom (pa \<bullet> p \<bullet> tvar)}"
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   501
                and s="pa \<bullet> (p \<bullet> supp ty - {p \<bullet> atom tvar})" in subst)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   502
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   503
    apply (simp add: eqvts[symmetric])
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   504
    apply (rule conjI)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   505
    apply (rule supp_perm_eq)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   506
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   507
    apply (subst supp_finite_atom_set)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   508
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   509
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   510
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   511
    apply (subst supp_perm_eq)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   512
    apply (subst supp_finite_atom_set)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   513
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   514
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   515
    apply assumption
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   516
    apply (simp add: fresh_star_minus_perm)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   517
    apply (rule a08)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   518
    apply simp
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   519
    apply(rotate_tac 1)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   520
    apply(erule_tac x="(pa + p)" in allE)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   521
    apply simp
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   522
    apply (simp add: eqvts eqvts_raw)
1634
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   523
    apply (rule at_set_avoiding2_atom)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   524
    apply (simp add: finite_supp)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   525
    apply (simp add: finite_supp)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   526
    apply (simp add: fresh_def)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   527
    apply (simp only: supp_abs eqvts)
1634
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   528
    apply blast
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   529
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   530
(* GOAL2 *)
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   531
    apply(subgoal_tac "\<exists>pa. ((pa \<bullet> (atom (p \<bullet> cvar))) \<sharp> e \<and>
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   532
                       supp (Abs (p \<bullet> {atom cvar}) (p \<bullet> co)) \<sharp>* pa)")
1634
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   533
    apply clarify
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   534
    apply (simp only: perm)
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   535
    apply(rule_tac t="CAll (p \<bullet> cvar) (p \<bullet> ckind) (p \<bullet> co)"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   536
               and s="CAll (pa \<bullet> p \<bullet> cvar) (p \<bullet> ckind) (pa \<bullet> p \<bullet> co)" in subst)
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   537
    apply (simp only: eq_iff)
1634
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   538
    apply (rule_tac x="-pa" in exI)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   539
    apply (simp add: alphas eqvts eqvts_raw supp_abs fv_supp)
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   540
    apply (rule_tac t="supp (pa \<bullet> p \<bullet> co) - {atom (pa \<bullet> p \<bullet> cvar)}"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   541
                and s="pa \<bullet> (p \<bullet> supp co - {p \<bullet> atom cvar})" in subst)
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   542
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   543
    apply (simp add: eqvts[symmetric])
1634
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   544
    apply (rule conjI)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   545
    apply (rule supp_perm_eq)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   546
    apply (simp add: eqvts)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   547
    apply (subst supp_finite_atom_set)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   548
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   549
    apply (simp add: eqvts)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   550
    apply (simp add: eqvts)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   551
    apply (subst supp_perm_eq)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   552
    apply (subst supp_finite_atom_set)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   553
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   554
    apply (simp add: eqvts)
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   555
    apply assumption
b6656b707a8d Solved one of the strong-induction goals.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1632
diff changeset
   556
    apply (simp add: fresh_star_minus_perm)
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   557
    apply (rule a15)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   558
    apply simp
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   559
    apply(rotate_tac 1)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   560
    apply(erule_tac x="(pa + p)" in allE)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   561
    apply simp
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   562
    apply (simp add: eqvts eqvts_raw)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   563
    apply (rule at_set_avoiding2_atom)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   564
    apply (simp add: finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   565
    apply (simp add: finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   566
    apply (simp add: fresh_def)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   567
    apply (simp only: supp_abs eqvts)
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   568
    apply blast
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   569
1645
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   570
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   571
(* GOAL3 a copy-and-paste of Goal2 with consts and variable names changed *)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   572
    apply(subgoal_tac "\<exists>pa. ((pa \<bullet> (atom (p \<bullet> tvar))) \<sharp> g \<and>
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   573
                       supp (Abs (p \<bullet> {atom tvar}) (p \<bullet> trm)) \<sharp>* pa)")
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   574
    apply clarify
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   575
    apply (simp only: perm)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   576
    apply(rule_tac t="LAMT (p \<bullet> tvar) (p \<bullet> tkind) (p \<bullet> trm)"
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   577
               and s="LAMT (pa \<bullet> p \<bullet> tvar) (p \<bullet> tkind) (pa \<bullet> p \<bullet> trm)" in subst)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   578
    apply (simp only: eq_iff)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   579
    apply (rule_tac x="-pa" in exI)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   580
    apply (simp add: alphas eqvts eqvts_raw supp_abs fv_supp)
1645
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   581
    apply (rule_tac t="supp (pa \<bullet> p \<bullet> trm) - {atom (pa \<bullet> p \<bullet> tvar)}"
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   582
                and s="pa \<bullet> (p \<bullet> supp trm - {p \<bullet> atom tvar})" in subst)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   583
    apply (simp add: eqvts)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   584
    apply (simp add: eqvts[symmetric])
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   585
    apply (rule conjI)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   586
    apply (rule supp_perm_eq)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   587
    apply (simp add: eqvts)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   588
    apply (subst supp_finite_atom_set)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   589
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   590
    apply (simp add: eqvts)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   591
    apply (simp add: eqvts)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   592
    apply (subst supp_perm_eq)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   593
    apply (subst supp_finite_atom_set)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   594
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   595
    apply (simp add: eqvts)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   596
    apply assumption
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   597
    apply (simp add: fresh_star_minus_perm)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   598
    apply (rule a29)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   599
    apply simp
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   600
    apply(rotate_tac 1)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   601
    apply(erule_tac x="(pa + p)" in allE)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   602
    apply simp
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   603
    apply (simp add: eqvts eqvts_raw)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   604
    apply (rule at_set_avoiding2_atom)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   605
    apply (simp add: finite_supp)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   606
    apply (simp add: finite_supp)
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   607
    apply (simp add: fresh_def)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   608
    apply (simp only: supp_abs eqvts)
1645
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   609
    apply blast
bde8da26093e One more copy-and-paste in core-haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1635
diff changeset
   610
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   611
(* GOAL4 a copy-and-paste *)
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   612
    apply(subgoal_tac "\<exists>pa. ((pa \<bullet> (atom (p \<bullet> cvar))) \<sharp> g \<and>
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   613
                       supp (Abs (p \<bullet> {atom cvar}) (p \<bullet> trm)) \<sharp>* pa)")
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   614
    apply clarify
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   615
    apply (simp only: perm)
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   616
    apply(rule_tac t="LAMC (p \<bullet> cvar) (p \<bullet> ckind) (p \<bullet> trm)"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   617
               and s="LAMC (pa \<bullet> p \<bullet> cvar) (p \<bullet> ckind) (pa \<bullet> p \<bullet> trm)" in subst)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   618
    apply (simp only: eq_iff)
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   619
    apply (rule_tac x="-pa" in exI)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   620
    apply (simp add: alphas eqvts eqvts_raw supp_abs fv_supp)
1701
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   621
    apply (rule_tac t="supp (pa \<bullet> p \<bullet> trm) - {atom (pa \<bullet> p \<bullet> cvar)}"
58abc09d6f9c Updated strong induction to modified definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1700
diff changeset
   622
                and s="pa \<bullet> (p \<bullet> supp trm - {p \<bullet> atom cvar})" in subst)
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   623
    apply (simp add: eqvts)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   624
    apply (simp add: eqvts[symmetric])
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   625
    apply (rule conjI)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   626
    apply (rule supp_perm_eq)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   627
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   628
    apply (subst supp_finite_atom_set)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   629
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   630
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   631
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   632
    apply (subst supp_perm_eq)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   633
    apply (subst supp_finite_atom_set)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   634
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   635
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   636
    apply assumption
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   637
    apply (simp add: fresh_star_minus_perm)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   638
    apply (rule a30)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   639
    apply simp
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   640
    apply(rotate_tac 1)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   641
    apply(erule_tac x="(pa + p)" in allE)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   642
    apply simp
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   643
    apply (simp add: eqvts eqvts_raw)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   644
    apply (rule at_set_avoiding2_atom)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   645
    apply (simp add: finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   646
    apply (simp add: finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   647
    apply (simp add: fresh_def)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   648
    apply (simp only: supp_abs eqvts)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   649
    apply blast
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   650
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   651
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   652
(* GOAL5 a copy-and-paste *)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   653
    apply(subgoal_tac "\<exists>pa. ((pa \<bullet> (atom (p \<bullet> var))) \<sharp> g \<and>
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   654
                       supp (Abs (p \<bullet> {atom var}) (p \<bullet> trm)) \<sharp>* pa)")
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   655
    apply clarify
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   656
    apply (simp only: perm)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   657
    apply(rule_tac t="Lam (p \<bullet> var) (p \<bullet> ty) (p \<bullet> trm)"
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   658
               and s="Lam (pa \<bullet> p \<bullet> var) (p \<bullet> ty) (pa \<bullet> p \<bullet> trm)" in subst)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   659
    apply (simp only: eq_iff)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   660
    apply (rule_tac x="-pa" in exI)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   661
    apply (simp add: alphas eqvts eqvts_raw supp_abs fv_supp)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   662
    apply (rule_tac t="supp (pa \<bullet> p \<bullet> trm) - {atom (pa \<bullet> p \<bullet> var)}"
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   663
                and s="pa \<bullet> (p \<bullet> supp trm - {p \<bullet> atom var})" in subst)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   664
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   665
    apply (simp add: eqvts[symmetric])
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   666
    apply (rule conjI)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   667
    apply (rule supp_perm_eq)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   668
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   669
    apply (subst supp_finite_atom_set)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   670
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   671
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   672
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   673
    apply (subst supp_perm_eq)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   674
    apply (subst supp_finite_atom_set)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   675
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   676
    apply (simp add: eqvts)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   677
    apply assumption
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   678
    apply (simp add: fresh_star_minus_perm)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   679
    apply (rule a32)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   680
    apply simp
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   681
    apply(rotate_tac 1)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   682
    apply(erule_tac x="(pa + p)" in allE)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   683
    apply simp
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   684
    apply (simp add: eqvts eqvts_raw)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   685
    apply (rule at_set_avoiding2_atom)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   686
    apply (simp add: finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   687
    apply (simp add: finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   688
    apply (simp add: fresh_def)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   689
    apply (simp only: supp_abs eqvts)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   690
    apply blast
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   691
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   692
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   693
(* GOAL6 a copy-and-paste *)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   694
    apply(subgoal_tac "\<exists>pa. ((pa \<bullet> (atom (p \<bullet> var))) \<sharp> g \<and>
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   695
                       supp (Abs (p \<bullet> {atom var}) (p \<bullet> trm2)) \<sharp>* pa)")
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   696
    apply clarify
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   697
    apply (simp only: perm)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   698
    apply(rule_tac t="Let (p \<bullet> var) (p \<bullet> ty) (p \<bullet> trm1) (p \<bullet> trm2)"
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   699
               and s="Let (pa \<bullet> p \<bullet> var) (p \<bullet> ty) (p \<bullet> trm1) (pa \<bullet> p \<bullet> trm2)" in subst)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   700
    apply (simp only: eq_iff)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   701
    apply (rule_tac x="-pa" in exI)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   702
    apply (simp add: alphas eqvts eqvts_raw supp_abs fv_supp)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   703
    apply (rule_tac t="supp (pa \<bullet> p \<bullet> trm2) - {atom (pa \<bullet> p \<bullet> var)}"
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   704
                and s="pa \<bullet> (p \<bullet> supp trm2 - {p \<bullet> atom var})" in subst)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   705
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   706
    apply (simp add: eqvts[symmetric])
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   707
    apply (rule conjI)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   708
    apply (rule supp_perm_eq)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   709
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   710
    apply (subst supp_finite_atom_set)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   711
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   712
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   713
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   714
    apply (subst supp_perm_eq)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   715
    apply (subst supp_finite_atom_set)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   716
    apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   717
    apply (simp add: eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   718
    apply assumption
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   719
    apply (simp add: fresh_star_minus_perm)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   720
    apply (rule a34)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   721
    apply simp
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   722
    apply simp
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   723
    apply(rotate_tac 2)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   724
    apply(erule_tac x="(pa + p)" in allE)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   725
    apply simp
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   726
    apply (simp add: eqvts eqvts_raw)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   727
    apply (rule at_set_avoiding2_atom)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   728
    apply (simp add: finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   729
    apply (simp add: finite_supp)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   730
    apply (simp add: fresh_def)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   731
    apply (simp only: supp_abs eqvts)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   732
    apply blast
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   733
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   734
(* MAIN ACons Goal *)
1695
e42ee5947b5c Changed to Lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1688
diff changeset
   735
    apply(subgoal_tac "\<exists>pa. ((pa \<bullet> (set (bv (p \<bullet> pat)))) \<sharp>* h \<and>
e42ee5947b5c Changed to Lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1688
diff changeset
   736
                       supp (Abs_lst (p \<bullet> (bv pat)) (p \<bullet> trm)) \<sharp>* pa)")
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   737
    apply clarify
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   738
    apply (simp only: perm eqvts)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   739
    apply (subst ACons_subst)
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   740
    apply assumption
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   741
    apply (rule a38)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   742
    apply simp
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   743
    apply(rotate_tac 1)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   744
    apply(erule_tac x="(pa + p)" in allE)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   745
    apply simp
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   746
    apply simp
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   747
    apply (simp add: perm_bv2[symmetric])
1635
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   748
    apply (simp add: eqvts eqvts_raw)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   749
    apply (rule at_set_avoiding2)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   750
    apply (simp add: fin_bv)
8b4595cb5524 Further in the strong induction proof.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1634
diff changeset
   751
    apply (simp add: finite_supp)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   752
    apply (simp add: supp_abs)
1646
733bac87d5bf Solved all boring subgoals, and looking at properly defning permute_bv
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1645
diff changeset
   753
    apply (simp add: finite_supp)
1658
aacab5f67333 Fixed renamings.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1656
diff changeset
   754
    apply (simp add: fresh_star_def fresh_def supp_abs eqvts)
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   755
    done
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   756
  then have b: "P1 a (0 \<bullet> tkind)" and "P2 b (0 \<bullet> ckind)" "P3 c (0 \<bullet> ty)" and "P4 d (0 \<bullet> ty_lst)" and "P5 e (0 \<bullet> co)" and "P6 f (0 \<bullet> co_lst)" and "P7 g (0 \<bullet> trm)" and "P8 h (0 \<bullet> assoc_lst)" by (blast+)
1700
b5141d1ab24f Initial renaming
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1699
diff changeset
   757
  moreover have "P9  i (permute_bv 0 (0 \<bullet> pat))" and "P10 j (permute_bv_vs 0 (0 \<bullet> vars))" and "P11 k (permute_bv_tvs 0 (0 \<bullet> tvars))" and "P12 l (permute_bv_cvs 0 (0 \<bullet> cvars))" using a1 a2 a3 a4 by (blast+)
1647
032649a694d2 Only ACons_subst left to show.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1646
diff changeset
   758
  ultimately show ?thesis by (simp_all add: permute_bv_zero1 permute_bv_zero2)
1631
e94bfef17bb8 stating the strong induction; further.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1630
diff changeset
   759
qed
1615
0ea578c6dae3 Parsing bn functions that call other bn functions and transmitting this information to fv/alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1609
diff changeset
   760
1868
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   761
section {* test about equivariance for alpha *}
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   762
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   763
thm eqvts
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   764
thm eqvts_raw
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   765
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   766
declare permute_tkind_raw_permute_ckind_raw_permute_ty_raw_permute_ty_lst_raw_permute_co_raw_permute_co_lst_raw_permute_trm_raw_permute_assoc_lst_raw_permute_pat_raw_permute_vars_raw_permute_tvars_raw_permute_cvars_raw.simps[eqvt]
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   767
declare alpha_gen_eqvt[eqvt]
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   768
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   769
equivariance alpha_tkind_raw
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   770
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   771
thm eqvts
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   772
thm eqvts_raw
26c0c35641cb equivariance for alpha_raw in CoreHaskell is automatically derived
Christian Urban <urbanc@in.tum.de>
parents: 1867
diff changeset
   773
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   774
end
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   775