Nominal/Ex/Ex3.thy
author Christian Urban <urbanc@in.tum.de>
Sat, 03 Apr 2010 22:31:11 +0200
changeset 1773 c0eac04ae3b4
parent 1598 Nominal/Ex3.thy@2406350c358f
child 2028 15c5a2926622
permissions -rw-r--r--
added README and moved examples into separate directory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1597
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     1
theory Ex3
1773
c0eac04ae3b4 added README and moved examples into separate directory
Christian Urban <urbanc@in.tum.de>
parents: 1598
diff changeset
     2
imports "../Parser"
1597
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
1598
2406350c358f Term1 is identical to Example 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1597
diff changeset
     5
(* Example 3, identical to example 1 from Terms.thy *)
2406350c358f Term1 is identical to Example 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1597
diff changeset
     6
1597
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     7
atom_decl name
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     8
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     9
ML {* val _ = recursive := false  *}
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    10
nominal_datatype trm0 =
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    11
  Var0 "name"
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    12
| App0 "trm0" "trm0"
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    13
| Lam0 x::"name" t::"trm0"          bind x in t
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    14
| Let0 p::"pat0" "trm0" t::"trm0"   bind "f0 p" in t
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    15
and pat0 =
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
  PN0
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    17
| PS0 "name"
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    18
| PD0 "pat0" "pat0"
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    19
binder
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    20
  f0::"pat0 \<Rightarrow> atom set"
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    21
where
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    22
  "f0 PN0 = {}"
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    23
| "f0 (PS0 x) = {atom x}"
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    24
| "f0 (PD0 p1 p2) = (f0 p1) \<union> (f0 p2)"
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    25
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    26
thm trm0_pat0.fv
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    27
thm trm0_pat0.eq_iff
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    28
thm trm0_pat0.bn
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    29
thm trm0_pat0.perm
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    30
thm trm0_pat0.induct
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    31
thm trm0_pat0.distinct
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    32
thm trm0_pat0.fv[simplified trm0_pat0.supp,no_vars]
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    33
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    34
end
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    35
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    36
af34dd3418fe Move example3 out.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    37