Nominal/Ex/ExLeroy.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Tue, 04 May 2010 16:30:31 +0200
changeset 2051 13da60487112
parent 2042 495b6feb76a8
child 2082 0854af516f14
permissions -rw-r--r--
Fix for new isabelle
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1600
e33e37fd4c7d More reorganization.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1599
diff changeset
     1
theory ExLeroy
2042
495b6feb76a8 Move ExLeroy to New Parser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1773
diff changeset
     2
imports "../NewParser"
1599
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
(* example form Leroy 96 about modules; OTT *)
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     7
atom_decl name
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     8
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     9
nominal_datatype mexp =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    10
  Acc "path"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    11
| Stru "body"
2042
495b6feb76a8 Move ExLeroy to New Parser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1773
diff changeset
    12
| Funct x::"name" "sexp" m::"mexp"    bind_set x in m
1599
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    13
| FApp "mexp" "path"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    14
| Ascr "mexp" "sexp"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    15
and body =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
  Empty
2042
495b6feb76a8 Move ExLeroy to New Parser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1773
diff changeset
    17
| Seq c::defn d::"body"     bind_set "cbinders c" in d
1599
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    18
and defn =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    19
  Type "name" "tyty"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    20
| Dty "name"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    21
| DStru "name" "mexp"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    22
| Val "name" "trmtrm"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    23
and sexp =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    24
  Sig sbody
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    25
| SFunc "name" "sexp" "sexp"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    26
and sbody =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    27
  SEmpty
2042
495b6feb76a8 Move ExLeroy to New Parser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1773
diff changeset
    28
| SSeq C::spec D::sbody    bind_set "Cbinders C" in D
1599
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    29
and spec =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    30
  Type1 "name"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    31
| Type2 "name" "tyty"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    32
| SStru "name" "sexp"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    33
| SVal "name" "tyty"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    34
and tyty =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    35
  Tyref1 "name"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    36
| Tyref2 "path" "tyty"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    37
| Fun "tyty" "tyty"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    38
and path =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    39
  Sref1 "name"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    40
| Sref2 "path" "name"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    41
and trmtrm =
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    42
  Tref1 "name"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    43
| Tref2 "path" "name"
2042
495b6feb76a8 Move ExLeroy to New Parser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1773
diff changeset
    44
| Lam' v::"name" "tyty" M::"trmtrm"  bind_set v in M
1599
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    45
| App' "trmtrm" "trmtrm"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    46
| Let' "body" "trmtrm"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    47
binder
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    48
    cbinders :: "defn \<Rightarrow> atom set"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    49
and Cbinders :: "spec \<Rightarrow> atom set"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    50
where
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    51
  "cbinders (Type t T) = {atom t}"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    52
| "cbinders (Dty t) = {atom t}"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    53
| "cbinders (DStru x s) = {atom x}"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    54
| "cbinders (Val v M) = {atom v}"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    55
| "Cbinders (Type1 t) = {atom t}"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    56
| "Cbinders (Type2 t T) = {atom t}"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    57
| "Cbinders (SStru x S) = {atom x}"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    58
| "Cbinders (SVal v T) = {atom v}"
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    59
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    60
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.fv
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    61
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.eq_iff
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    62
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.bn
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    63
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.perm
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    64
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.induct
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    65
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.inducts
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    66
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.distinct
2042
495b6feb76a8 Move ExLeroy to New Parser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1773
diff changeset
    67
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.supp(1-3,5-7,9-10)
495b6feb76a8 Move ExLeroy to New Parser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1773
diff changeset
    68
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.fv[simplified mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm.supp(1-3,5-7,9-10)]
1599
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    69
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    70
end
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    71
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    72
8b5a1ad60487 Move Leroy out of Test, rename accordingly.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    73