Nominal/ExCoreHaskell.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Wed, 24 Mar 2010 10:55:59 +0100
changeset 1624 91ab98dd9999
parent 1621 a40dbea68d0b
child 1626 0d7d0b8adca5
permissions -rw-r--r--
Experiments with Core Haskell support.
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
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     2
imports "Parser"
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 *}
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
     8
ML {* val _ = cheat_bn_eqvt := true *}
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
     9
ML {* val _ = cheat_bn_rsp := true *}
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
    10
ML {* val _ = cheat_const_rsp := true *}
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
    11
ML {* val _ = cheat_alpha_bn_rsp := true *}
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    12
atom_decl var
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    13
atom_decl tvar
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    14
1606
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    15
(* 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
    16
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    17
nominal_datatype tkind =
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    18
  KStar
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    19
| KFun "tkind" "tkind"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    20
and ckind =
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    21
  CKEq "ty" "ty"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    22
and ty =
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    23
  TVar "tvar"
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
    24
| TC "char"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    25
| TApp "ty" "ty"
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
    26
| TFun "char" "ty_lst"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    27
| TAll tv::"tvar" "tkind" T::"ty"  bind tv in T
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    28
| TEq "ty" "ty" "ty"
1606
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    29
and ty_lst =
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    30
  TsNil
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    31
| TsCons "ty" "ty_lst"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    32
and co =
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
    33
  CC "char"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    34
| CApp "co" "co"
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
    35
| CFun "char" "co_lst"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    36
| CAll tv::"tvar" "ckind" C::"co"  bind tv in C
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    37
| CEq "co" "co" "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    38
| CSym "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    39
| CCir "co" "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    40
| CLeft "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    41
| CRight "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    42
| CSim "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    43
| CRightc "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    44
| CLeftc "co"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    45
| CCoe "co" "co"
1606
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    46
and co_lst =
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    47
  CsNil
75403378068b Initial list unfoldings in Core Haskell.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1601
diff changeset
    48
| 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
    49
and trm =
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    50
  Var "var"
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
    51
| C "char"
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    52
| LAMT tv::"tvar" "tkind" t::"trm" bind tv in t
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    53
| LAMC tv::"tvar" "ckind" t::"trm" bind tv in t
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    54
| APP "trm" "ty"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    55
| Lam v::"var" "ty" t::"trm"       bind v in t
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    56
| App "trm" "trm"
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    57
| 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
    58
| 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
    59
| 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
    60
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
    61
  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
    62
| 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
    63
and pat =
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
    64
  K "char" "tvtk_lst" "tvck_lst" "vt_lst"
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    65
and vt_lst =
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    66
  VTNil
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    67
| VTCons "var" "ty" "vt_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
    68
and tvtk_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
  TVTKNil
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
| TVTKCons "tvar" "tkind" "tvtk_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
    71
and tvck_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
    72
  TVCKNil
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    73
| TVCKCons "tvar" "ckind" "tvck_lst"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    74
binder
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
    75
    bv :: "pat \<Rightarrow> atom set"
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    76
and bv_vt :: "vt_lst \<Rightarrow> atom set"
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
    77
and bv_tvtk :: "tvtk_lst \<Rightarrow> atom set"
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    78
and bv_tvck :: "tvck_lst \<Rightarrow> atom set"
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    79
where
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    80
  "bv (K s tvts tvcs vs) = (bv_tvtk tvts) \<union> (bv_tvck tvcs) \<union> (bv_vt vs)"
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    81
| "bv_vt VTNil = {}"
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
    82
| "bv_vt (VTCons v k t) = {atom v} \<union> bv_vt t"
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    83
| "bv_tvtk TVTKNil = {}"
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    84
| "bv_tvtk (TVTKCons v k t) = {atom v} \<union> bv_tvtk t"
c9bc3b61046c Modification to Core Haskell to make it accepted with an empty binding function.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1606
diff changeset
    85
| "bv_tvck TVCKNil = {}"
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    86
| "bv_tvck (TVCKCons v k t) = {atom v} \<union> bv_tvck t"
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    87
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    88
ML {* Sign.of_sort @{theory} (@{typ tkind}, @{sort fs}) *}
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    89
1624
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
    90
lemma helper: 
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
    91
  "((\<exists>p. P p) \<and> Q) = (\<exists>p. (P p \<and> Q))"
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
    92
  "(Q \<and> (\<exists>p. P p)) = (\<exists>p. (Q \<and> P p))"
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    93
by auto
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    94
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    95
lemma supp:
1624
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
    96
  "fv_tkind tkind = supp tkind \<and>
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    97
  fv_ckind ckind = supp ckind \<and>
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    98
  fv_ty ty = supp ty \<and>
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
    99
  fv_ty_lst ty_lst = supp ty_lst \<and>
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   100
  fv_co co = supp co \<and>
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   101
  fv_co_lst co_lst = supp co_lst \<and>
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   102
  fv_trm trm = supp trm \<and>
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   103
  fv_assoc_lst assoc_lst = supp assoc_lst \<and>
1624
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   104
  (fv_pat pat = supp pat \<and> fv_bv pat = {a. infinite {b. \<not> alpha_bv ((a \<rightleftharpoons> b) \<bullet> pat) pat}}) \<and>
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   105
  (fv_vt_lst vt_lst = supp vt_lst \<and>
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   106
   fv_bv_vt vt_lst = {a. infinite {b. \<not> alpha_bv_vt ((a \<rightleftharpoons> b) \<bullet> vt_lst) vt_lst}}) \<and>
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   107
  (fv_tvtk_lst tvtk_lst = supp tvtk_lst \<and>
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   108
   fv_bv_tvtk tvtk_lst = {a. infinite {b. \<not> alpha_bv_tvtk ((a \<rightleftharpoons> b) \<bullet> tvtk_lst) tvtk_lst}}) \<and>
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   109
  fv_tvck_lst tvck_lst = supp tvck_lst \<and>
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   110
  fv_bv_tvck tvck_lst = {a. infinite {b. \<not> alpha_bv_tvck ((a \<rightleftharpoons> b) \<bullet> tvck_lst) tvck_lst}}"
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   111
apply(rule tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.induct)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   112
ML_prf {*
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   113
fun supp_eq_tac fv perm eqiff ctxt =
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   114
  asm_full_simp_tac (HOL_basic_ss addsimps fv) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   115
  asm_full_simp_tac (HOL_basic_ss addsimps @{thms supp_Abs[symmetric]}) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   116
  simp_tac (HOL_basic_ss addsimps @{thms supp_abs_sum}) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   117
  simp_tac (HOL_basic_ss addsimps @{thms supp_def}) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   118
  simp_tac (HOL_basic_ss addsimps (@{thm permute_ABS} :: perm)) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   119
  simp_tac (HOL_basic_ss addsimps (@{thm Abs_eq_iff} :: eqiff)) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   120
  simp_tac (HOL_basic_ss addsimps @{thms alpha_gen2}) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   121
  simp_tac (HOL_basic_ss addsimps @{thms alpha_gen}) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   122
  asm_full_simp_tac (HOL_basic_ss addsimps (@{thm supp_Pair} :: sym_eqvts ctxt)) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   123
  asm_full_simp_tac (HOL_basic_ss addsimps (@{thm Pair_eq} :: all_eqvts ctxt)) THEN_ALL_NEW
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   124
  simp_tac (HOL_basic_ss addsimps @{thms supp_at_base[symmetric,simplified supp_def]}) THEN_ALL_NEW
1624
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   125
  simp_tac (HOL_basic_ss addsimps @{thms Collect_disj_eq[symmetric]}) THEN_ALL_NEW
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   126
  simp_tac (HOL_basic_ss addsimps @{thms infinite_Un[symmetric]}) THEN_ALL_NEW
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   127
  simp_tac (HOL_basic_ss addsimps @{thms Collect_disj_eq[symmetric]}) THEN_ALL_NEW
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   128
  simp_tac (HOL_basic_ss addsimps @{thms de_Morgan_conj[symmetric]}) THEN_ALL_NEW
1624
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   129
  simp_tac (HOL_basic_ss addsimps @{thms helper}) THEN_ALL_NEW
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   130
  simp_tac (HOL_ss addsimps @{thms Collect_const finite.emptyI})
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   131
*}
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   132
apply (tactic {* ALLGOALS (TRY o SOLVED' (supp_eq_tac 
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   133
  @{thms tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.fv}
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   134
  @{thms tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.perm}
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   135
  @{thms tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.eq_iff}
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   136
  @{context})) *})
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   137
apply (simp only: tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.fv)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   138
apply (simp only: supp_Abs[symmetric])
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   139
apply (simp (no_asm) only: supp_def)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   140
apply (simp only: permute_ABS)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   141
apply (simp only: tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.perm)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   142
apply (simp only: Abs_eq_iff)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   143
apply (simp only: tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.eq_iff)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   144
apply (simp only: alpha_gen)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   145
apply (simp only: eqvts[symmetric])
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   146
apply (simp only: eqvts)
1624
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   147
apply (simp only: Collect_disj_eq[symmetric])
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   148
apply (simp only: infinite_Un[symmetric])
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   149
apply (simp only: Collect_disj_eq[symmetric])
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   150
apply (simp only: de_Morgan_conj[symmetric])
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   151
apply (simp only: helper)
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   152
1624
91ab98dd9999 Experiments with Core Haskell support.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1621
diff changeset
   153
thm supp
1621
a40dbea68d0b Core Haskell experiments.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1615
diff changeset
   154
thm tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.fv[simplified supp]
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
   155
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
   156
1601
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   157
end
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   158
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   159
5f0bb35114c3 Added missing file
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   160