Nominal/Ex/NoneExamples.thy
author Christian Urban <urbanc@in.tum.de>
Wed, 11 Aug 2010 16:23:50 +0800
changeset 2394 e2759a4dad4b
parent 2083 9568f9f31822
child 2436 3885dc2669f9
permissions -rw-r--r--
updated to Isabelle 11 Aug
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2083
9568f9f31822 tuned file names for examples
Christian Urban <urbanc@in.tum.de>
parents: 2082
diff changeset
     1
theory NoneExamples
2082
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
     2
imports "../NewParser"
1589
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
atom_decl name
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
2082
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
     7
(* this example binds bound names and
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
     8
   so is not respectful *)
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
     9
(*
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    10
nominal_datatype trm =
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    11
  Vr "name"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    12
| Lm x::"name" t::"trm"         bind x in t
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    13
| Lt left::"trm" right::"trm"   bind "bv left" in right
1589
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    14
binder
2082
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    15
  bv
1589
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
where
2082
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    17
  "bv (Vr n) = {}"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    18
| "bv (Lm n t) = {atom n} \<union> bv t"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    19
| "bv (Lt l r) = bv l \<union> bv r"
1589
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    20
*)
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    21
2082
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    22
(* this example uses "-" in the binding function; 
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    23
   at the moment this is unsupported *)
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    24
(*
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    25
nominal_datatype trm' =
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    26
  Vr' "name"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    27
| Lm' l::"name" r::"trm'"   bind l in r
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    28
| Lt' l::"trm'" r::"trm'"   bind "bv' l" in r
1589
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    29
binder
2082
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    30
  bv'
1589
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    31
where
2082
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    32
  "bv' (Vr' n) = {atom n}"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    33
| "bv' (Lm' n t) = bv' t - {atom n}"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    34
| "bv' (Lt' l r) = bv' l \<union> bv' r"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    35
*)
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    36
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    37
(* this example again binds bound names  *)
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    38
(*
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    39
nominal_datatype trm'' =
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    40
  Va'' "name"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    41
| Lm'' n::"name" l::"trm''" bind n in l
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    42
and bla'' =
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    43
  Bla'' f::"trm''" s::"trm''" bind "bv'' f" in s
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    44
binder
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    45
  bv''
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    46
where
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    47
  "bv'' (Vm'' x) = {}"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    48
| "bv'' (Lm'' x b) = {atom x}"
0854af516f14 cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents: 1773
diff changeset
    49
*)
1589
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    50
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    51
end
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    52
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    53
6542026b95cd Move Non-respectful examples to NotRsp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    54