Nominal/Test_compat.thy
author Christian Urban <urbanc@in.tum.de>
Tue, 09 Mar 2010 08:46:55 +0100
changeset 1369 424962b8b699
parent 1368 c0cb30581f58
child 1370 0e32379e452f
permissions -rw-r--r--
added another compat example
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1368
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory Test_compat
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports "Parser" "../Attic/Prove"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
text {* 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
  example 1 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
  
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
  single let binding
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
*}
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
nominal_datatype lam =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
  VAR "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
| APP "lam" "lam"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
| LET bp::"bp" t::"lam"   bind "bi bp" in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
and bp = 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
  BP "name" "lam" 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
  bi::"bp \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
  "bi (BP x t) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
thm alpha_lam_raw_alpha_bp_raw.intros[no_vars]
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
abbreviation "VAR \<equiv> VAR_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
abbreviation "APP \<equiv> APP_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
abbreviation "LET \<equiv> LET_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
abbreviation "BP \<equiv> BP_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
abbreviation "bi \<equiv> bi_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
(* non-recursive case *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
inductive
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  alpha_lam :: "lam_raw \<Rightarrow> lam_raw \<Rightarrow> bool" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
  alpha_bp  :: "bp_raw \<Rightarrow> bp_raw \<Rightarrow> bool" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
  compat_bp :: "bp_raw \<Rightarrow> perm \<Rightarrow> bp_raw \<Rightarrow> bool"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
  "x = y \<Longrightarrow> alpha_lam (VAR x) (VAR y)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
| "alpha_lam l1 s1 \<and> alpha_lam l2 s2 \<Longrightarrow> alpha_lam (APP l1 l2) (APP s1 s2)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
| "\<exists>pi. (bi bp, lam) \<approx>gen alpha_lam fv_lam_raw pi (bi bp', lam') \<and> compat_bp bp pi bp' 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
   \<Longrightarrow> alpha_lam (LET bp lam) (LET bp' lam')"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
| "alpha_lam lam lam' \<and> name = name' \<Longrightarrow> alpha_bp (BP name lam) (BP name' lam')"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
| "alpha_lam t t' \<and> pi \<bullet> x = x' \<Longrightarrow> compat_bp (BP x t) pi (BP x' t')" 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
lemma test1:
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
  assumes "distinct [x, y]"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  shows "alpha_lam (LET (BP x (VAR x)) (VAR x))
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
                   (LET (BP y (VAR x)) (VAR y))"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
apply(rule alpha_lam_alpha_bp_compat_bp.intros)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
apply(rule_tac x="(x \<leftrightarrow> y)" in exI)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
apply(simp add: alpha_gen fresh_star_def)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
apply(simp add: alpha_lam_alpha_bp_compat_bp.intros(1))
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
apply(rule alpha_lam_alpha_bp_compat_bp.intros)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
apply(simp add: alpha_lam_alpha_bp_compat_bp.intros(1))
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
done
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
lemma test2:
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
  assumes asm: "distinct [x, y]"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
  shows "\<not> alpha_lam (LET (BP x (VAR x)) (VAR x))
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
                     (LET (BP y (VAR y)) (VAR y))"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
using asm
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
apply(clarify)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
apply(erule alpha_lam.cases)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
apply(simp_all)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
apply(erule exE)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
apply(clarify)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
apply(simp add: alpha_gen fresh_star_def)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
apply(erule alpha_lam.cases)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
apply(simp_all)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
apply(clarify)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
apply(erule compat_bp.cases)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
apply(simp_all)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
apply(clarify)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
apply(erule alpha_lam.cases)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
apply(simp_all)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
done
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
(* recursive case where we have also bind "bi bp" in bp *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
inductive
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
  Alpha_lam :: "lam_raw \<Rightarrow> lam_raw \<Rightarrow> bool" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
  Alpha_bp  :: "bp_raw \<Rightarrow> bp_raw \<Rightarrow> bool" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
  Compat_bp :: "bp_raw \<Rightarrow> perm \<Rightarrow> bp_raw \<Rightarrow> bool"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
  "x = y \<Longrightarrow> Alpha_lam (VAR x) (VAR y)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
| "Alpha_lam l1 s1 \<and> Alpha_lam l2 s2 \<Longrightarrow> Alpha_lam (APP l1 l2) (APP s1 s2)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
| "\<exists>pi. (bi bp, lam) \<approx>gen Alpha_lam fv_lam_raw pi (bi bp', lam') \<and> Compat_bp bp pi bp' 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
   \<Longrightarrow> Alpha_lam (LET bp lam) (LET bp' lam')"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
| "Alpha_lam lam lam' \<and> name = name' \<Longrightarrow> Alpha_bp (BP name lam) (BP name' lam')"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
| "Alpha_lam (pi \<bullet> t) t' \<and> pi \<bullet> x = x' \<Longrightarrow> Compat_bp (BP x t) pi (BP x' t')"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
lemma Test1:
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
  assumes "distinct [x, y]"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  shows "Alpha_lam (LET (BP x (VAR x)) (VAR x))
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
                   (LET (BP y (VAR y)) (VAR y))"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
apply(rule Alpha_lam_Alpha_bp_Compat_bp.intros)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
apply(rule_tac x="(x \<leftrightarrow> y)" in exI)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
apply(simp add: alpha_gen fresh_star_def)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
apply(simp add: Alpha_lam_Alpha_bp_Compat_bp.intros(1))
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
apply(rule Alpha_lam_Alpha_bp_Compat_bp.intros)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
apply(simp add: Alpha_lam_Alpha_bp_Compat_bp.intros(1))
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
done
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
lemma Test2:
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
  assumes asm: "distinct [x, y]"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
  shows "\<not> Alpha_lam (LET (BP x (VAR x)) (VAR x))
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
                     (LET (BP y (VAR x)) (VAR y))"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
using asm
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
apply(clarify)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
apply(erule Alpha_lam.cases)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
apply(simp_all)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
apply(erule exE)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
apply(clarify)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
apply(simp add: alpha_gen fresh_star_def)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
apply(erule Alpha_lam.cases)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
apply(simp_all)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
apply(clarify)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
apply(erule Compat_bp.cases)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
apply(simp_all)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
apply(clarify)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
apply(erule Alpha_lam.cases)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
apply(simp_all)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
done
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
text {* example 2 *}
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
nominal_datatype trm' =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
  Var "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
| App "trm'" "trm'"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
| Lam x::"name" t::"trm'"          bind x in t 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
| Let p::"pat'" "trm'" t::"trm'"   bind "f p" in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
and pat' =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
  PN
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
| PS "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
| PD "name" "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
  f::"pat' \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
where 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
  "f PN = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
| "f (PS x) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
| "f (PD x y) = {atom x} \<union> {atom y}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
thm alpha_trm'_raw_alpha_pat'_raw.intros[no_vars]
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
1369
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   145
abbreviation "Var \<equiv> Var_raw"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   146
abbreviation "App \<equiv> App_raw"
1368
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
abbreviation "Lam \<equiv> Lam_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
abbreviation "Lett \<equiv> Let_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
abbreviation "PN \<equiv> PN_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
abbreviation "PS \<equiv> PS_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
abbreviation "PD \<equiv> PD_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
abbreviation "f \<equiv> f_raw"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
1369
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   154
(* not_yet_done *)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   155
inductive 
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   156
  alpha_trm' :: "trm'_raw \<Rightarrow> trm'_raw \<Rightarrow> bool" and
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   157
  alpha_pat'  :: "pat'_raw \<Rightarrow> pat'_raw \<Rightarrow> bool" and
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   158
  compat_pat' :: "pat'_raw \<Rightarrow> perm \<Rightarrow> pat'_raw \<Rightarrow> bool"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   159
where
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   160
  "name = name' \<Longrightarrow> alpha_trm' (Var name) (Var name')"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   161
| "alpha_trm' t2 t2' \<and> alpha_trm' t1 t1' \<Longrightarrow> alpha_trm' (App t1 t2) (App t1' t2')"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   162
| "\<exists>pi. ({atom x}, t) \<approx>gen alpha_trm' fv_trm'_raw pi ({atom x'}, t') \<Longrightarrow> alpha_trm' (Lam x t) (Lam x' t')"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   163
| "\<exists>pi. (f p, t) \<approx>gen alpha_trm' fv_trm'_raw pi (f p', t') \<and> alpha_trm' s s' \<and>
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   164
        compat_pat' p pi p' \<Longrightarrow> alpha_trm' (Lett p s t) (Lett p' s' t')"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   165
| "alpha_pat' PN PN"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   166
| "name = name' \<Longrightarrow> alpha_pat' (PS name) (PS name')"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   167
| "name2 = name2' \<and> name1 = name1' \<Longrightarrow> alpha_pat' (PD name1 name2) (PD name1' name2')"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   168
| "compat_pat' PN pi PN"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   169
| "pi \<bullet> x = x' \<Longrightarrow> compat_pat' (PS x) pi (PS x')"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   170
| "pi \<bullet> p1 = p1' \<and> pi \<bullet> p2 = p2' \<Longrightarrow> compat_pat' (PD p1 p2) pi (PD p1' p2')"
1368
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
1369
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   172
lemma
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   173
  assumes a: "distinct [x, y, z, u]"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   174
  shows "alpha_trm' (Lett (PD x u) t (App (Var x) (Var y)))
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   175
                    (Lett (PD z u) t (App (Var z) (Var y)))"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   176
using a
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   177
apply -
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   178
apply(rule alpha_trm'_alpha_pat'_compat_pat'.intros)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   179
apply(auto simp add: alpha_gen)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   180
apply(rule_tac x="(x \<leftrightarrow> z)" in exI)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   181
apply(auto simp add: fresh_star_def)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   182
defer
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   183
apply(rule alpha_trm'_alpha_pat'_compat_pat'.intros)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   184
apply(simp add: alpha_trm'_alpha_pat'_compat_pat'.intros)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   185
defer
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   186
apply(rule alpha_trm'_alpha_pat'_compat_pat'.intros)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   187
apply(simp)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   188
(* they can be proved *)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   189
oops
1368
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
1369
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   191
lemma
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   192
  assumes a: "distinct [x, y, z, u]"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   193
  shows "\<not> alpha_trm' (Lett (PD x u) t (App (Var x) (Var y)))
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   194
                      (Lett (PD z z) t (App (Var z) (Var y)))"
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   195
using a
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   196
apply(clarify)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   197
apply(erule alpha_trm'.cases)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   198
apply(simp_all)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   199
apply(auto simp add: alpha_gen)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   200
apply(erule alpha_trm'.cases)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   201
apply(simp_all)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   202
apply(clarify)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   203
apply(erule compat_pat'.cases)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   204
apply(simp_all)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   205
apply(clarify)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   206
apply(erule alpha_trm'.cases)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   207
apply(simp_all)
424962b8b699 added another compat example
Christian Urban <urbanc@in.tum.de>
parents: 1368
diff changeset
   208
done
1368
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
nominal_datatype trm0 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
  Var0 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
| App0 "trm0" "trm0"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
| Lam0 x::"name" t::"trm0"          bind x in t 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
| Let0 p::"pat0" "trm0" t::"trm0"   bind "f0 p" in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
and pat0 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   216
  PN0
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   217
| PS0 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   218
| PD0 "pat0" "pat0"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
  f0::"pat0 \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
where 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   222
  "f0 PN0 = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
| "f0 (PS0 x) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   224
| "f0 (PD0 p1 p2) = (f0 p1) \<union> (f0 p2)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   225
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   226
thm f0_raw.simps
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   227
(*thm trm0_pat0_induct
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
thm trm0_pat0_perm
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   229
thm trm0_pat0_fv
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   230
thm trm0_pat0_bn*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   231
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   232
text {* example type schemes *}
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
(* does not work yet
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
nominal_datatype t =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
  Var "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
| Fun "t" "t"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   239
nominal_datatype tyS =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
  All xs::"name list" ty::"t_raw" bind xs in ty
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   241
*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   244
nominal_datatype t = 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   245
  Var "name" 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   246
| Fun "t" "t"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   247
and  tyS = 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
  All xs::"name set" ty::"t" bind xs in ty
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   249
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
(* example 1 from Terms.thy *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
nominal_datatype trm1 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
  Vr1 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   254
| Ap1 "trm1" "trm1"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   255
| Lm1 x::"name" t::"trm1"       bind x in t 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   256
| Lt1 p::"bp1" "trm1" t::"trm1" bind "bv1 p" in t 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   257
and bp1 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   258
  BUnit1
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   259
| BV1 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   260
| BP1 "bp1" "bp1"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   262
  bv1
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   263
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   264
  "bv1 (BUnit1) = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   265
| "bv1 (BV1 x) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   266
| "bv1 (BP1 bp1 bp2) = (bv1 bp1) \<union> (bv1 bp2)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   267
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   268
thm bv1_raw.simps
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   269
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   270
(* example 2 from Terms.thy *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   271
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   272
nominal_datatype trm2 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   273
  Vr2 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   274
| Ap2 "trm2" "trm2"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   275
| Lm2 x::"name" t::"trm2"       bind x in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   276
| Lt2 r::"assign" t::"trm2"    bind "bv2 r" in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   277
and assign = 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   278
  As "name" "trm2"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   279
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   280
  bv2
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   281
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   282
  "bv2 (As x t) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   283
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   284
(* compat should be
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   285
compat (As x t) pi (As x' t') == pi o x = x' & alpha t t'
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   286
*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   287
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   288
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   289
thm fv_trm2_raw_fv_assign_raw.simps[no_vars]
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   290
thm alpha_trm2_raw_alpha_assign_raw.intros[no_vars]
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   292
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   293
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   294
text {* example 3 from Terms.thy *}
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   295
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
nominal_datatype trm3 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
  Vr3 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   298
| Ap3 "trm3" "trm3"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   299
| Lm3 x::"name" t::"trm3"        bind x in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   300
| Lt3 r::"rassigns3" t::"trm3"   bind "bv3 r" in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   301
and rassigns3 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   302
  ANil
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
| ACons "name" "trm3" "rassigns3"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
  bv3
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
  "bv3 ANil = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   308
| "bv3 (ACons x t as) = {atom x} \<union> (bv3 as)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   309
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   310
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
(* compat should be
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
compat (ANil) pi (PNil) \<equiv> TRue
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
compat (ACons x t ts) pi (ACons x' t' ts') \<equiv> pi o x = x' \<and> alpha t t' \<and> compat ts pi ts'
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   316
(* example 4 from Terms.thy *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
(* fv_eqvt does not work, we need to repaire defined permute functions
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
   defined fv and defined alpha... *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
nominal_datatype trm4 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
  Vr4 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322
| Ap4 "trm4" "trm4 list"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
| Lm4 x::"name" t::"trm4"  bind x in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   325
thm alpha_trm4_raw_alpha_trm4_raw_list.intros[no_vars]
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   326
thm fv_trm4_raw_fv_trm4_raw_list.simps[no_vars]
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   327
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   328
(* example 5 from Terms.thy *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   329
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
nominal_datatype trm5 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   331
  Vr5 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   332
| Ap5 "trm5" "trm5"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   333
| Lt5 l::"lts" t::"trm5"  bind "bv5 l" in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   334
and lts =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
  Lnil
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
| Lcons "name" "trm5" "lts"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
  bv5
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
  "bv5 Lnil = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
| "bv5 (Lcons n t ltl) = {atom n} \<union> (bv5 ltl)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
(* example 6 from Terms.thy *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
(* BV is not respectful, needs to fail*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
nominal_datatype trm6 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
  Vr6 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
| Lm6 x::"name" t::"trm6"         bind x in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
| Lt6 left::"trm6" right::"trm6"  bind "bv6 left" in right
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
  bv6
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   352
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
  "bv6 (Vr6 n) = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
| "bv6 (Lm6 n t) = {atom n} \<union> bv6 t"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
| "bv6 (Lt6 l r) = bv6 l \<union> bv6 r"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
(* example 7 from Terms.thy *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
(* BV is not respectful, needs to fail*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
nominal_datatype trm7 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
  Vr7 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   361
| Lm7 l::"name" r::"trm7"   bind l in r
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   362
| Lt7 l::"trm7" r::"trm7"   bind "bv7 l" in r
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   363
binder 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   364
  bv7 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   365
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   366
  "bv7 (Vr7 n) = {atom n}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   367
| "bv7 (Lm7 n t) = bv7 t - {atom n}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   368
| "bv7 (Lt7 l r) = bv7 l \<union> bv7 r"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   369
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370
(* example 8 from Terms.thy *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   372
nominal_datatype foo8 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   373
  Foo0 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   374
| Foo1 b::"bar8" f::"foo8" bind "bv8 b" in f --"check fo error if this is called foo"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   375
and bar8 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   376
  Bar0 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   377
| Bar1 "name" s::"name" b::"bar8" bind s in b
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   378
binder 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   379
  bv8
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   380
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   381
  "bv8 (Bar0 x) = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   382
| "bv8 (Bar1 v x b) = {atom v}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   383
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   384
(* example 9 from Terms.thy *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   385
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   386
(* BV is not respectful, needs to fail*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   387
nominal_datatype lam9 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   388
  Var9 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   389
| Lam9 n::"name" l::"lam9" bind n in l
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   390
and bla9 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   391
  Bla9 f::"lam9" s::"lam9" bind "bv9 f" in s
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   392
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   393
  bv9
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   394
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   395
  "bv9 (Var9 x) = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
| "bv9 (Lam9 x b) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   397
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
(* example from my PHD *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   400
atom_decl coname
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   401
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   402
nominal_datatype phd =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   403
   Ax "name" "coname"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   404
|  Cut n::"coname" t1::"phd" c::"coname" t2::"phd"              bind n in t1, bind c in t2
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   405
|  AndR c1::"coname" t1::"phd" c2::"coname" t2::"phd" "coname"  bind c1 in t1, bind c2 in t2
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   406
|  AndL1 n::"name" t::"phd" "name"                              bind n in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   407
|  AndL2 n::"name" t::"phd" "name"                              bind n in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   408
|  ImpL c::"coname" t1::"phd" n::"name" t2::"phd" "name"        bind c in t1, bind n in t2
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   409
|  ImpR c::"coname" n::"name" t::"phd" "coname"                 bind n in t, bind c in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   410
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   411
thm alpha_phd_raw.intros[no_vars]
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   412
thm fv_phd_raw.simps[no_vars]
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   413
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   414
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   415
(* example form Leroy 96 about modules; OTT *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   416
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   417
nominal_datatype mexp =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   418
  Acc "path"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   419
| Stru "body"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   420
| Funct x::"name" "sexp" m::"mexp"    bind x in m
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   421
| FApp "mexp" "path"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   422
| Ascr "mexp" "sexp"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   423
and body =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   424
  Empty
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   425
| Seq c::defn d::"body"     bind "cbinders c" in d
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   426
and defn =  
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   427
  Type "name" "tyty"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   428
| Dty "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   429
| DStru "name" "mexp"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   430
| Val "name" "trmtrm"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   431
and sexp =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   432
  Sig sbody
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   433
| SFunc "name" "sexp" "sexp"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   434
and sbody = 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   435
  SEmpty
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   436
| SSeq C::spec D::sbody    bind "Cbinders C" in D
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   437
and spec =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   438
  Type1 "name" 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   439
| Type2 "name" "tyty"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   440
| SStru "name" "sexp"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   441
| SVal "name" "tyty"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   442
and tyty =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   443
  Tyref1 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   444
| Tyref2 "path" "tyty"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   445
| Fun "tyty" "tyty"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   446
and path =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   447
  Sref1 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   448
| Sref2 "path" "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   449
and trmtrm =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   450
  Tref1 "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   451
| Tref2 "path" "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   452
| Lam' v::"name" "tyty" M::"trmtrm"  bind v in M
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   453
| App' "trmtrm" "trmtrm"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   454
| Let' "body" "trmtrm"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   455
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   456
    cbinders :: "defn \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   457
and Cbinders :: "spec \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   458
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   459
  "cbinders (Type t T) = {atom t}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   460
| "cbinders (Dty t) = {atom t}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   461
| "cbinders (DStru x s) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   462
| "cbinders (Val v M) = {atom v}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   463
| "Cbinders (Type1 t) = {atom t}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   464
| "Cbinders (Type2 t T) = {atom t}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   465
| "Cbinders (SStru x S) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   466
| "Cbinders (SVal v T) = {atom v}"  
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   467
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   468
(* core haskell *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   469
print_theorems
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   470
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   471
atom_decl var
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   472
atom_decl tvar
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   473
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   474
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   475
(* there are types, coercion types and regular types *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   476
nominal_datatype tkind = 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   477
  KStar
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   478
| KFun "tkind" "tkind"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   479
and ckind =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   480
  CKEq "ty" "ty" 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   481
and ty =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   482
  TVar "tvar"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   483
| TC "string"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   484
| TApp "ty" "ty"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   485
| TFun "string" "ty list"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   486
| TAll tv::"tvar" "tkind" T::"ty"  bind tv in T
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   487
| TEq "ty" "ty" "ty"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   488
and co =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   489
  CC "string"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   490
| CApp "co" "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   491
| CFun "string" "co list"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   492
| CAll tv::"tvar" "ckind" C::"co"  bind tv in C
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   493
| CEq "co" "co" "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   494
| CSym "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   495
| CCir "co" "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   496
| CLeft "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   497
| CRight "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   498
| CSim "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   499
| CRightc "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   500
| CLeftc "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   501
| CCoe "co" "co"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   502
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   503
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   504
typedecl ty --"hack since ty is not yet defined"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   505
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   506
abbreviation 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   507
  "atoms A \<equiv> atom ` A"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   508
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   509
nominal_datatype trm =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   510
  Var "var"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   511
| C "string"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   512
| LAM tv::"tvar" "kind" t::"trm"   bind tv in t 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   513
| APP "trm" "ty"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   514
| Lam v::"var" "ty" t::"trm"       bind v in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   515
| App "trm" "trm"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   516
| Let x::"var" "ty" "trm" t::"trm" bind x in t
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   517
| Case "trm" "assoc list"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   518
| Cast "trm" "ty"                   --"ty is supposed to be a coercion type only"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   519
and assoc = 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   520
  A p::"pat" t::"trm" bind "bv p" in t 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   521
and pat = 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   522
  K "string" "(tvar \<times> kind) list" "(var \<times> ty) list"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   523
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   524
 bv :: "pat \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   525
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   526
 "bv (K s ts vs) = (atoms (set (map fst ts))) \<union> (atoms (set (map fst vs)))"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   527
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   528
(*
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   529
compat (K s ts vs) pi (K s' ts' vs') ==
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   530
  s = s' & 
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   531
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   532
*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   533
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   534
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   535
(*thm bv_raw.simps*)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   536
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   537
(* example 3 from Peter Sewell's bestiary *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   538
nominal_datatype exp =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   539
  VarP "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   540
| AppP "exp" "exp"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   541
| LamP x::"name" e::"exp" bind x in e
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   542
| LetP x::"name" p::"pat" e1::"exp" e2::"exp" bind x in e2, bind "bp p" in e1
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   543
and pat =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   544
  PVar "name"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   545
| PUnit
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   546
| PPair "pat" "pat"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   547
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   548
  bp :: "pat \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   549
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   550
  "bp (PVar x) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   551
| "bp (PUnit) = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   552
| "bp (PPair p1 p2) = bp p1 \<union> bp p2"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   553
thm alpha_exp_raw_alpha_pat_raw.intros
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   554
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   555
(* example 6 from Peter Sewell's bestiary *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   556
nominal_datatype exp6 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   557
  EVar name
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   558
| EPair exp6 exp6
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   559
| ELetRec x::name p::pat6 e1::exp6 e2::exp6 bind x in e1, bind x in e2, bind "bp6 p" in e1
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   560
and pat6 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   561
  PVar' name
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   562
| PUnit'
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   563
| PPair' pat6 pat6
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   564
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   565
  bp6 :: "pat6 \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   566
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   567
  "bp6 (PVar' x) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   568
| "bp6 (PUnit') = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   569
| "bp6 (PPair' p1 p2) = bp6 p1 \<union> bp6 p2"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   570
thm alpha_exp6_raw_alpha_pat6_raw.intros
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   571
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   572
(* example 7 from Peter Sewell's bestiary *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   573
nominal_datatype exp7 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   574
  EVar name
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   575
| EUnit
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   576
| EPair exp7 exp7
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   577
| ELetRec l::lrbs e::exp7 bind "b7s l" in e, bind "b7s l" in l
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   578
and lrb =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   579
  Assign name exp7
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   580
and lrbs =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   581
  Single lrb
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   582
| More lrb lrbs
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   583
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   584
  b7 :: "lrb \<Rightarrow> atom set" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   585
  b7s :: "lrbs \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   586
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   587
  "b7 (Assign x e) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   588
| "b7s (Single a) = b7 a"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   589
| "b7s (More a as) = (b7 a) \<union> (b7s as)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   590
thm alpha_exp7_raw_alpha_lrb_raw_alpha_lrbs_raw.intros
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   591
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   592
(* example 8 from Peter Sewell's bestiary *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   593
nominal_datatype exp8 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   594
  EVar name
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   595
| EUnit
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   596
| EPair exp8 exp8
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   597
| ELetRec l::lrbs8 e::exp8 bind "b_lrbs8 l" in e, bind "b_lrbs8 l" in l
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   598
and fnclause =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   599
  K x::name p::pat8 e::exp8 bind "b_pat p" in e
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   600
and fnclauses =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   601
  S fnclause
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   602
| ORs fnclause fnclauses
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   603
and lrb8 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   604
  Clause fnclauses
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   605
and lrbs8 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   606
  Single lrb8
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   607
| More lrb8 lrbs8
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   608
and pat8 =
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   609
  PVar name
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   610
| PUnit
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   611
| PPair pat8 pat8
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   612
binder
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   613
  b_lrbs8 :: "lrbs8 \<Rightarrow> atom set" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   614
  b_pat :: "pat8 \<Rightarrow> atom set" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   615
  b_fnclauses :: "fnclauses \<Rightarrow> atom set" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   616
  b_fnclause :: "fnclause \<Rightarrow> atom set" and
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   617
  b_lrb8 :: "lrb8 \<Rightarrow> atom set"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   618
where
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   619
  "b_lrbs8 (Single l) = b_lrb8 l"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   620
| "b_lrbs8 (More l ls) = b_lrb8 l \<union> b_lrbs8 ls"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   621
| "b_pat (PVar x) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   622
| "b_pat (PUnit) = {}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   623
| "b_pat (PPair p1 p2) = b_pat p1 \<union> b_pat p2"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   624
| "b_fnclauses (S fc) = (b_fnclause fc)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   625
| "b_fnclauses (ORs fc fcs) = (b_fnclause fc) \<union> (b_fnclauses fcs)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   626
| "b_lrb8 (Clause fcs) = (b_fnclauses fcs)"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   627
| "b_fnclause (K x pat exp8) = {atom x}"
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   628
thm alpha_exp8_raw_alpha_fnclause_raw_alpha_fnclauses_raw_alpha_lrb8_raw_alpha_lrbs8_raw_alpha_pat8_raw.intros
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   629
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   630
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   631
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   632
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   633
(* example 9 from Peter Sewell's bestiary *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   634
(* run out of steam at the moment *)
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   635
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   636
end
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   637
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   638
c0cb30581f58 added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   639