author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Tue, 16 Mar 2010 12:08:37 +0100 | |
changeset 1453 | 49bdb8d475df |
parent 1451 | 104bdc0757e9 |
child 1454 | 7c8cd6eae8e2 |
permissions | -rw-r--r-- |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
theory Test |
1335
c3dfd4193b42
Experiments with proving weird transp
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1331
diff
changeset
|
2 |
imports "Parser" "../Attic/Prove" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
4 |
|
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
5 |
text {* example 1, equivalent to example 2 from Terms *} |
1316
0577afdb1732
Porting from Lift to Parser; until defining the Quotient type.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1309
diff
changeset
|
6 |
|
1428
4029105011ca
Show that the new types are in finite support typeclass.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1418
diff
changeset
|
7 |
atom_decl name |
4029105011ca
Show that the new types are in finite support typeclass.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1418
diff
changeset
|
8 |
|
1445
3246c5e1a9d7
cheat_alpha_eqvt no longer needed; the proofs work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1441
diff
changeset
|
9 |
ML {* val cheat_alpha_eqvt = ref false *} |
1448
f2c50884dfb9
fv_eqvt_cheat no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1447
diff
changeset
|
10 |
ML {* val cheat_fv_eqvt = ref false *} |
1445
3246c5e1a9d7
cheat_alpha_eqvt no longer needed; the proofs work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1441
diff
changeset
|
11 |
|
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
12 |
(* |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
nominal_datatype lam = |
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
14 |
VAR "name" |
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
15 |
| APP "lam" "lam" |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
16 |
| LAM x::"name" t::"lam" bind x in t |
1287
8557af71724e
slight simplification of the raw-decl generation
Christian Urban <urbanc@in.tum.de>
parents:
1285
diff
changeset
|
17 |
| LET bp::"bp" t::"lam" bind "bi bp" in t |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
18 |
and bp = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
19 |
BP "name" "lam" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
20 |
binder |
1295
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1290
diff
changeset
|
21 |
bi::"bp \<Rightarrow> atom set" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
22 |
where |
1295
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1290
diff
changeset
|
23 |
"bi (BP x t) = {atom x}" |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
24 |
*) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
25 |
|
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
26 |
nominal_datatype lam = |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
27 |
VAR "name" |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
28 |
| APP "lam" "lam" |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
29 |
| LAM x::"name" t::"lam" bind x in t |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
30 |
| LET bp::"bp" t::"lam" bind "bi bp" in t |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
31 |
and bp = |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
32 |
BP "name" |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
33 |
binder |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
34 |
bi::"bp \<Rightarrow> atom set" |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
35 |
where |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
36 |
"bi (BP x) = {atom x}" |
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
parents:
1223
diff
changeset
|
37 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
38 |
thm lam_bp_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
39 |
thm lam_bp_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
40 |
thm lam_bp_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
41 |
thm lam_bp_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
42 |
thm lam_bp_induct |
1447
378b8c791de8
derive "inducts" from "induct" instead of lifting again is much faster.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1445
diff
changeset
|
43 |
thm lam_bp_inducts |
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
44 |
thm lam_bp_distinct |
1428
4029105011ca
Show that the new types are in finite support typeclass.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1418
diff
changeset
|
45 |
ML {* Sign.of_sort @{theory} (@{typ lam}, @{sort fs}) *} |
4029105011ca
Show that the new types are in finite support typeclass.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1418
diff
changeset
|
46 |
|
4029105011ca
Show that the new types are in finite support typeclass.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1418
diff
changeset
|
47 |
term "supp (x :: lam)" |
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
48 |
|
1439
bdd73f8bb63b
added an eqvt-proof for bi
Christian Urban <urbanc@in.tum.de>
parents:
1436
diff
changeset
|
49 |
(* maybe should be added to Infinite.thy *) |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
50 |
lemma infinite_Un: |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
51 |
shows "infinite (S \<union> T) \<longleftrightarrow> infinite S \<or> infinite T" |
1439
bdd73f8bb63b
added an eqvt-proof for bi
Christian Urban <urbanc@in.tum.de>
parents:
1436
diff
changeset
|
52 |
by simp |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
53 |
|
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
54 |
lemma bi_eqvt: |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
55 |
shows "(p \<bullet> (bi b)) = bi (p \<bullet> b)" |
1441 | 56 |
by (rule eqvts) |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
57 |
|
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
58 |
term alpha_bi |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
59 |
|
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
60 |
lemma alpha_bi: |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
61 |
shows "alpha_bi pi b b' = True" |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
62 |
apply(induct b rule: lam_bp_inducts(2)) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
63 |
sorry |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
64 |
|
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
65 |
lemma fv_bi: |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
66 |
shows "fv_bi b = {}" |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
67 |
apply(induct b rule: lam_bp_inducts(2)) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
68 |
apply(auto)[1] |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
69 |
apply(simp_all) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
70 |
apply(simp add: lam_bp_fv) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
71 |
done |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
72 |
|
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
73 |
lemma supp_fv: |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
74 |
"supp t = fv_lam t" and |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
75 |
"supp b = fv_bp b" |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
76 |
apply(induct t and b rule: lam_bp_inducts) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
77 |
apply(simp_all add: lam_bp_fv) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
78 |
(* VAR case *) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
79 |
apply(simp only: supp_def) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
80 |
apply(simp only: lam_bp_perm) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
81 |
apply(simp only: lam_bp_inject) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
82 |
apply(simp only: supp_def[symmetric]) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
83 |
apply(simp only: supp_at_base) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
84 |
(* APP case *) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
85 |
apply(simp only: supp_def) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
86 |
apply(simp only: lam_bp_perm) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
87 |
apply(simp only: lam_bp_inject) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
88 |
apply(simp only: de_Morgan_conj) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
89 |
apply(simp only: Collect_disj_eq) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
90 |
apply(simp only: infinite_Un) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
91 |
apply(simp only: Collect_disj_eq) |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
92 |
(* LAM case *) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
93 |
apply(rule_tac t="supp (LAM name lam_raw)" and s="supp (Abs {atom name} lam_raw)" in subst) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
94 |
apply(simp (no_asm) only: supp_def) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
95 |
apply(simp only: lam_bp_perm) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
96 |
apply(simp only: permute_ABS) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
97 |
apply(simp only: lam_bp_inject) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
98 |
apply(simp only: Abs_eq_iff) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
99 |
apply(simp only: insert_eqvt atom_eqvt empty_eqvt) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
100 |
apply(simp only: alpha_gen) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
101 |
apply(simp only: supp_eqvt[symmetric]) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
102 |
apply(simp only: eqvts) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
103 |
apply(simp only: supp_Abs) |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
104 |
(* LET case *) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
105 |
defer |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
106 |
(* BP case *) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
107 |
apply(simp only: supp_def) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
108 |
apply(simp only: lam_bp_perm) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
109 |
apply(simp only: lam_bp_inject) |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
110 |
(* |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
111 |
apply(simp only: de_Morgan_conj) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
112 |
apply(simp only: Collect_disj_eq) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
113 |
apply(simp only: infinite_Un) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
114 |
apply(simp only: Collect_disj_eq) |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
115 |
*) |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
116 |
apply(simp only: supp_def[symmetric]) |
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
117 |
apply(simp only: supp_at_base) |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
118 |
(*apply(simp)*) |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
119 |
(* LET case *) |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
120 |
apply(rule_tac t="supp (LET bp_raw lam_raw)" and s="supp (Abs_tst bi bp_raw lam_raw)" in subst) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
121 |
apply(simp (no_asm) only: supp_def) |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
122 |
apply(simp only: lam_bp_perm) |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
123 |
apply(simp only: permute_ABS_tst) |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
124 |
apply(simp only: lam_bp_inject) |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
125 |
apply(simp only: eqvts_raw) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
126 |
apply(simp only: Abs_tst_eq_iff) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
127 |
apply(simp only: alpha_bi) |
1436
04dad9b0136d
started supp-fv proofs (is going to work)
Christian Urban <urbanc@in.tum.de>
parents:
1428
diff
changeset
|
128 |
apply(simp only: alpha_gen) |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
129 |
apply(simp only: alpha_tst) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
130 |
apply(simp only: supp_eqvt[symmetric]) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
131 |
apply(simp only: eqvts) |
1453
49bdb8d475df
The proof in 'Test' gets simpler.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1451
diff
changeset
|
132 |
apply simp |
1449
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
133 |
apply(simp add: supp_Abs_tst) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
134 |
apply(simp add: fv_bi) |
b66d754bf1c2
proof for support when bn-function is present, but fb_function is empty
Christian Urban <urbanc@in.tum.de>
parents:
1439
diff
changeset
|
135 |
done |
1367
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
136 |
|
1261
853abc14c5c6
added IsaMakefile...but so far included only a test for the parser
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
137 |
text {* example 2 *} |
853abc14c5c6
added IsaMakefile...but so far included only a test for the parser
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
138 |
|
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
139 |
nominal_datatype trm' = |
961
0f88e04eb486
Variable takes a 'name'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
954
diff
changeset
|
140 |
Var "name" |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
141 |
| App "trm'" "trm'" |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
142 |
| Lam x::"name" t::"trm'" bind x in t |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
143 |
| Let p::"pat'" "trm'" t::"trm'" bind "f p" in t |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
144 |
and pat' = |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
145 |
PN |
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
146 |
| PS "name" |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
147 |
| PD "name" "name" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
148 |
binder |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
149 |
f::"pat' \<Rightarrow> atom set" |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
150 |
where |
978
b44592adf235
Improper interface for datatype and function packages and proper interface lateron.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
973
diff
changeset
|
151 |
"f PN = {}" |
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
parents:
1378
diff
changeset
|
152 |
| "f (PD x y) = {atom x, atom y}" |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
153 |
| "f (PS x) = {atom x}" |
1380
dab8d99b37c1
added bn-information, but it is not yet ordered according to the dts
Christian Urban <urbanc@in.tum.de>
parents:
1378
diff
changeset
|
154 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
155 |
thm trm'_pat'_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
156 |
thm trm'_pat'_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
157 |
thm trm'_pat'_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
158 |
thm trm'_pat'_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
159 |
thm trm'_pat'_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
160 |
thm trm'_pat'_distinct |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
161 |
|
1367
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
162 |
(* compat should be |
1368
c0cb30581f58
added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
1367
diff
changeset
|
163 |
compat (PN) pi (PN) == True |
c0cb30581f58
added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
1367
diff
changeset
|
164 |
compat (PS x) pi (PS x') == pi o x = x' |
c0cb30581f58
added a test-file for compatibility
Christian Urban <urbanc@in.tum.de>
parents:
1367
diff
changeset
|
165 |
compat (PD p1 p2) pi (PD p1' p2') == compat p1 pi p1' & compat p2 pi p2' |
1367
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
166 |
*) |
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
167 |
|
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
168 |
nominal_datatype trm0 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
169 |
Var0 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
170 |
| App0 "trm0" "trm0" |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
171 |
| Lam0 x::"name" t::"trm0" bind x in t |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
172 |
| Let0 p::"pat0" "trm0" t::"trm0" bind "f0 p" in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
173 |
and pat0 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
174 |
PN0 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
175 |
| PS0 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
176 |
| PD0 "pat0" "pat0" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
177 |
binder |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
178 |
f0::"pat0 \<Rightarrow> atom set" |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
179 |
where |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
180 |
"f0 PN0 = {}" |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
181 |
| "f0 (PS0 x) = {atom x}" |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
182 |
| "f0 (PD0 p1 p2) = (f0 p1) \<union> (f0 p2)" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
183 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
184 |
thm trm0_pat0_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
185 |
thm trm0_pat0_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
186 |
thm trm0_pat0_bn |
1340
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
187 |
thm trm0_pat0_perm |
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
188 |
thm trm0_pat0_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
189 |
thm trm0_pat0_distinct |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
190 |
|
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
191 |
text {* example type schemes *} |
1285
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
192 |
|
1302
d3101a5b9c4d
Length fix for nested recursions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1299
diff
changeset
|
193 |
nominal_datatype t = |
1416 | 194 |
VarTS "name" |
195 |
| FunTS "t" "t" |
|
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
196 |
and tyS = |
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1340
diff
changeset
|
197 |
All xs::"name set" ty::"t" bind xs in ty |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
198 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
199 |
thm t_tyS_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
200 |
thm t_tyS_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
201 |
thm t_tyS_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
202 |
thm t_tyS_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
203 |
thm t_tyS_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
204 |
thm t_tyS_distinct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
205 |
|
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
206 |
(* example 1 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
207 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
208 |
nominal_datatype trm1 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
209 |
Vr1 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
210 |
| Ap1 "trm1" "trm1" |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
211 |
| Lm1 x::"name" t::"trm1" bind x in t |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
212 |
| Lt1 p::"bp1" "trm1" t::"trm1" bind "bv1 p" in t |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
213 |
and bp1 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
214 |
BUnit1 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
215 |
| BV1 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
216 |
| BP1 "bp1" "bp1" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
217 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
218 |
bv1 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
219 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
220 |
"bv1 (BUnit1) = {}" |
1392
baa67b07f436
parser produces ordered bn-fun information
Christian Urban <urbanc@in.tum.de>
parents:
1380
diff
changeset
|
221 |
| "bv1 (BP1 bp1 bp2) = (bv1 bp1) \<union> (bv1 bp2)" |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
222 |
| "bv1 (BV1 x) = {atom x}" |
1392
baa67b07f436
parser produces ordered bn-fun information
Christian Urban <urbanc@in.tum.de>
parents:
1380
diff
changeset
|
223 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
224 |
thm trm1_bp1_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
225 |
thm trm1_bp1_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
226 |
thm trm1_bp1_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
227 |
thm trm1_bp1_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
228 |
thm trm1_bp1_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
229 |
thm trm1_bp1_distinct |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
230 |
|
1367
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
231 |
text {* example 3 from Terms.thy *} |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
232 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
233 |
nominal_datatype trm3 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
234 |
Vr3 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
235 |
| Ap3 "trm3" "trm3" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
236 |
| Lm3 x::"name" t::"trm3" bind x in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
237 |
| Lt3 r::"rassigns3" t::"trm3" bind "bv3 r" in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
238 |
and rassigns3 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
239 |
ANil |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
240 |
| ACons "name" "trm3" "rassigns3" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
241 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
242 |
bv3 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
243 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
244 |
"bv3 ANil = {}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
245 |
| "bv3 (ACons x t as) = {atom x} \<union> (bv3 as)" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
246 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
247 |
thm trm3_rassigns3_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
248 |
thm trm3_rassigns3_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
249 |
thm trm3_rassigns3_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
250 |
thm trm3_rassigns3_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
251 |
thm trm3_rassigns3_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
252 |
thm trm3_rassigns3_distinct |
1367
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
253 |
|
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
254 |
(* compat should be |
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
255 |
compat (ANil) pi (PNil) \<equiv> TRue |
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
256 |
compat (ACons x t ts) pi (ACons x' t' ts') \<equiv> pi o x = x' \<and> alpha t t' \<and> compat ts pi ts' |
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
257 |
*) |
9bbf56cdeb88
added compat definitions to some examples
Christian Urban <urbanc@in.tum.de>
parents:
1365
diff
changeset
|
258 |
|
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
259 |
(* example 5 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
260 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
261 |
nominal_datatype trm5 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
262 |
Vr5 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
263 |
| Ap5 "trm5" "trm5" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
264 |
| Lt5 l::"lts" t::"trm5" bind "bv5 l" in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
265 |
and lts = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
266 |
Lnil |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
267 |
| Lcons "name" "trm5" "lts" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
268 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
269 |
bv5 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
270 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
271 |
"bv5 Lnil = {}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
272 |
| "bv5 (Lcons n t ltl) = {atom n} \<union> (bv5 ltl)" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
273 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
274 |
thm trm5_lts_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
275 |
thm trm5_lts_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
276 |
thm trm5_lts_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
277 |
thm trm5_lts_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
278 |
thm trm5_lts_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
279 |
thm trm5_lts_distinct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
280 |
|
1285
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
281 |
(* example from my PHD *) |
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
282 |
|
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
283 |
atom_decl coname |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
284 |
|
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1340
diff
changeset
|
285 |
nominal_datatype phd = |
1290
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
286 |
Ax "name" "coname" |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
287 |
| Cut n::"coname" t1::"phd" c::"coname" t2::"phd" bind n in t1, bind c in t2 |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
288 |
| AndR c1::"coname" t1::"phd" c2::"coname" t2::"phd" "coname" bind c1 in t1, bind c2 in t2 |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
289 |
| AndL1 n::"name" t::"phd" "name" bind n in t |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
290 |
| AndL2 n::"name" t::"phd" "name" bind n in t |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
291 |
| ImpL c::"coname" t1::"phd" n::"name" t2::"phd" "name" bind c in t1, bind n in t2 |
1319
d793ce9cd06f
potential problem with the phd-example, where two permutations are generated, but only one is used
Christian Urban <urbanc@in.tum.de>
parents:
1313
diff
changeset
|
292 |
| ImpR c::"coname" n::"name" t::"phd" "coname" bind n in t, bind c in t |
d793ce9cd06f
potential problem with the phd-example, where two permutations are generated, but only one is used
Christian Urban <urbanc@in.tum.de>
parents:
1313
diff
changeset
|
293 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
294 |
thm phd_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
295 |
thm phd_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
296 |
thm phd_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
297 |
thm phd_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
298 |
thm phd_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
299 |
thm phd_distinct |
1285
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
300 |
|
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
301 |
(* example form Leroy 96 about modules; OTT *) |
1284 | 302 |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
303 |
nominal_datatype mexp = |
1296 | 304 |
Acc "path" |
305 |
| Stru "body" |
|
306 |
| Funct x::"name" "sexp" m::"mexp" bind x in m |
|
307 |
| FApp "mexp" "path" |
|
308 |
| Ascr "mexp" "sexp" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
309 |
and body = |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
310 |
Empty |
1296 | 311 |
| Seq c::defn d::"body" bind "cbinders c" in d |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
312 |
and defn = |
1296 | 313 |
Type "name" "tyty" |
314 |
| Dty "name" |
|
315 |
| DStru "name" "mexp" |
|
316 |
| Val "name" "trmtrm" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
317 |
and sexp = |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
318 |
Sig sbody |
1296 | 319 |
| SFunc "name" "sexp" "sexp" |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
320 |
and sbody = |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
321 |
SEmpty |
1296 | 322 |
| SSeq C::spec D::sbody bind "Cbinders C" in D |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
323 |
and spec = |
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
324 |
Type1 "name" |
1296 | 325 |
| Type2 "name" "tyty" |
326 |
| SStru "name" "sexp" |
|
327 |
| SVal "name" "tyty" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
328 |
and tyty = |
1296 | 329 |
Tyref1 "name" |
330 |
| Tyref2 "path" "tyty" |
|
331 |
| Fun "tyty" "tyty" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
332 |
and path = |
1296 | 333 |
Sref1 "name" |
334 |
| Sref2 "path" "name" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
335 |
and trmtrm = |
1296 | 336 |
Tref1 "name" |
337 |
| Tref2 "path" "name" |
|
1340
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
338 |
| Lam' v::"name" "tyty" M::"trmtrm" bind v in M |
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
339 |
| App' "trmtrm" "trmtrm" |
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
340 |
| Let' "body" "trmtrm" |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
341 |
binder |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
342 |
cbinders :: "defn \<Rightarrow> atom set" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
343 |
and Cbinders :: "spec \<Rightarrow> atom set" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
344 |
where |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
345 |
"cbinders (Type t T) = {atom t}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
346 |
| "cbinders (Dty t) = {atom t}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
347 |
| "cbinders (DStru x s) = {atom x}" |
1396
08294f4d6c08
Linked parser to fv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1392
diff
changeset
|
348 |
| "cbinders (Val v M) = {atom v}" |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
349 |
| "Cbinders (Type1 t) = {atom t}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
350 |
| "Cbinders (Type2 t T) = {atom t}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
351 |
| "Cbinders (SStru x S) = {atom x}" |
1396
08294f4d6c08
Linked parser to fv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1392
diff
changeset
|
352 |
| "Cbinders (SVal v T) = {atom v}" |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
353 |
|
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
354 |
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
355 |
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
356 |
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
357 |
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
358 |
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm_induct |
1447
378b8c791de8
derive "inducts" from "induct" instead of lifting again is much faster.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1445
diff
changeset
|
359 |
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm_inducts |
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
360 |
thm mexp_body_defn_sexp_sbody_spec_tyty_path_trmtrm_distinct |
1392
baa67b07f436
parser produces ordered bn-fun information
Christian Urban <urbanc@in.tum.de>
parents:
1380
diff
changeset
|
361 |
|
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
362 |
(* example 3 from Peter Sewell's bestiary *) |
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
363 |
|
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
364 |
nominal_datatype exp = |
1340
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
365 |
VarP "name" |
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
366 |
| AppP "exp" "exp" |
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
367 |
| LamP x::"name" e::"exp" bind x in e |
1396
08294f4d6c08
Linked parser to fv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1392
diff
changeset
|
368 |
| LetP x::"name" p::"pat3" e1::"exp" e2::"exp" bind x in e2, bind "bp' p" in e1 |
1378
5c6c950812b1
All examples should work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1368
diff
changeset
|
369 |
and pat3 = |
1319
d793ce9cd06f
potential problem with the phd-example, where two permutations are generated, but only one is used
Christian Urban <urbanc@in.tum.de>
parents:
1313
diff
changeset
|
370 |
PVar "name" |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
371 |
| PUnit |
1378
5c6c950812b1
All examples should work.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1368
diff
changeset
|
372 |
| PPair "pat3" "pat3" |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
373 |
binder |
1396
08294f4d6c08
Linked parser to fv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1392
diff
changeset
|
374 |
bp' :: "pat3 \<Rightarrow> atom set" |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
375 |
where |
1396
08294f4d6c08
Linked parser to fv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1392
diff
changeset
|
376 |
"bp' (PVar x) = {atom x}" |
08294f4d6c08
Linked parser to fv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1392
diff
changeset
|
377 |
| "bp' (PUnit) = {}" |
08294f4d6c08
Linked parser to fv and alpha.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1392
diff
changeset
|
378 |
| "bp' (PPair p1 p2) = bp' p1 \<union> bp' p2" |
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
379 |
|
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
380 |
thm exp_pat3_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
381 |
thm exp_pat3_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
382 |
thm exp_pat3_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
383 |
thm exp_pat3_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
384 |
thm exp_pat3_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
385 |
thm exp_pat3_distinct |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
386 |
|
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
387 |
(* example 6 from Peter Sewell's bestiary *) |
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1340
diff
changeset
|
388 |
nominal_datatype exp6 = |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
389 |
EVar name |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
390 |
| EPair exp6 exp6 |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
391 |
| ELetRec x::name p::pat6 e1::exp6 e2::exp6 bind x in e1, bind x in e2, bind "bp6 p" in e1 |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
392 |
and pat6 = |
1340
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
393 |
PVar' name |
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
394 |
| PUnit' |
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
395 |
| PPair' pat6 pat6 |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
396 |
binder |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
397 |
bp6 :: "pat6 \<Rightarrow> atom set" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
398 |
where |
1340
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
399 |
"bp6 (PVar' x) = {atom x}" |
f201eb6acafc
Lift BV,FV,Permutations and injection :).
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1338
diff
changeset
|
400 |
| "bp6 (PUnit') = {}" |
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1340
diff
changeset
|
401 |
| "bp6 (PPair' p1 p2) = bp6 p1 \<union> bp6 p2" |
1418
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
402 |
|
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
403 |
thm exp6_pat6_fv |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
404 |
thm exp6_pat6_inject |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
405 |
thm exp6_pat6_bn |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
406 |
thm exp6_pat6_perm |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
407 |
thm exp6_pat6_induct |
632b08744613
With the 4 cheats, all examples fully lift.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1416
diff
changeset
|
408 |
thm exp6_pat6_distinct |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
409 |
|
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
410 |
(* THE REST ARE NOT SUPPOSED TO WORK YET *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
411 |
|
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
412 |
(* example 7 from Peter Sewell's bestiary *) |
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1340
diff
changeset
|
413 |
nominal_datatype exp7 = |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
414 |
EVar name |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
415 |
| EUnit |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
416 |
| EPair exp7 exp7 |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
417 |
| ELetRec l::lrbs e::exp7 bind "b7s l" in e, bind "b7s l" in l |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
418 |
and lrb = |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
419 |
Assign name exp7 |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
420 |
and lrbs = |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
421 |
Single lrb |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
422 |
| More lrb lrbs |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
423 |
binder |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
424 |
b7 :: "lrb \<Rightarrow> atom set" and |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
425 |
b7s :: "lrbs \<Rightarrow> atom set" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
426 |
where |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
427 |
"b7 (Assign x e) = {atom x}" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
428 |
| "b7s (Single a) = b7 a" |
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1340
diff
changeset
|
429 |
| "b7s (More a as) = (b7 a) \<union> (b7s as)" |
1361
1e811e3424f3
With restricted_nominal=1, exp7 and exp8 work. Not sure about proving bn_rsp there.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1355
diff
changeset
|
430 |
thm alpha_exp7_raw_alpha_lrb_raw_alpha_lrbs_raw.intros |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
431 |
|
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
432 |
(* example 8 from Peter Sewell's bestiary *) |
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1340
diff
changeset
|
433 |
nominal_datatype exp8 = |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
434 |
EVar name |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
435 |
| EUnit |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
436 |
| EPair exp8 exp8 |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
437 |
| ELetRec l::lrbs8 e::exp8 bind "b_lrbs8 l" in e, bind "b_lrbs8 l" in l |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
438 |
and fnclause = |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
439 |
K x::name p::pat8 e::exp8 bind "b_pat p" in e |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
440 |
and fnclauses = |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
441 |
S fnclause |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
442 |
| ORs fnclause fnclauses |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
443 |
and lrb8 = |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
444 |
Clause fnclauses |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
445 |
and lrbs8 = |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
446 |
Single lrb8 |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
447 |
| More lrb8 lrbs8 |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
448 |
and pat8 = |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
449 |
PVar name |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
450 |
| PUnit |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
451 |
| PPair pat8 pat8 |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
452 |
binder |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
453 |
b_lrbs8 :: "lrbs8 \<Rightarrow> atom set" and |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
454 |
b_pat :: "pat8 \<Rightarrow> atom set" and |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
455 |
b_fnclauses :: "fnclauses \<Rightarrow> atom set" and |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
456 |
b_fnclause :: "fnclause \<Rightarrow> atom set" and |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
457 |
b_lrb8 :: "lrb8 \<Rightarrow> atom set" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
458 |
where |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
459 |
"b_lrbs8 (Single l) = b_lrb8 l" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
460 |
| "b_lrbs8 (More l ls) = b_lrb8 l \<union> b_lrbs8 ls" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
461 |
| "b_pat (PVar x) = {atom x}" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
462 |
| "b_pat (PUnit) = {}" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
463 |
| "b_pat (PPair p1 p2) = b_pat p1 \<union> b_pat p2" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
464 |
| "b_fnclauses (S fc) = (b_fnclause fc)" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
465 |
| "b_fnclauses (ORs fc fcs) = (b_fnclause fc) \<union> (b_fnclauses fcs)" |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
466 |
| "b_lrb8 (Clause fcs) = (b_fnclauses fcs)" |
1341
c25f797c7e6e
Added lifting of pseudo-injectivity, commented out the code again and enabled the weird examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1340
diff
changeset
|
467 |
| "b_fnclause (K x pat exp8) = {atom x}" |
1361
1e811e3424f3
With restricted_nominal=1, exp7 and exp8 work. Not sure about proving bn_rsp there.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1355
diff
changeset
|
468 |
thm alpha_exp8_raw_alpha_fnclause_raw_alpha_fnclauses_raw_alpha_lrb8_raw_alpha_lrbs8_raw_alpha_pat8_raw.intros |
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
469 |
|
1398
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
470 |
(* example 4 from Terms.thy *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
471 |
(* fv_eqvt does not work, we need to repaire defined permute functions |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
472 |
defined fv and defined alpha... *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
473 |
nominal_datatype trm4 = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
474 |
Vr4 "name" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
475 |
| Ap4 "trm4" "trm4 list" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
476 |
| Lm4 x::"name" t::"trm4" bind x in t |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
477 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
478 |
thm alpha_trm4_raw_alpha_trm4_raw_list.intros[no_vars] |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
479 |
thm fv_trm4_raw_fv_trm4_raw_list.simps[no_vars] |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
480 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
481 |
(* core haskell *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
482 |
atom_decl var |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
483 |
atom_decl tvar |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
484 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
485 |
(* there are types, coercion types and regular types *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
486 |
nominal_datatype tkind = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
487 |
KStar |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
488 |
| KFun "tkind" "tkind" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
489 |
and ckind = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
490 |
CKEq "ty" "ty" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
491 |
and ty = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
492 |
TVar "tvar" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
493 |
| TC "string" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
494 |
| TApp "ty" "ty" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
495 |
| TFun "string" "ty list" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
496 |
| TAll tv::"tvar" "tkind" T::"ty" bind tv in T |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
497 |
| TEq "ty" "ty" "ty" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
498 |
and co = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
499 |
CC "string" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
500 |
| CApp "co" "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
501 |
| CFun "string" "co list" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
502 |
| CAll tv::"tvar" "ckind" C::"co" bind tv in C |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
503 |
| CEq "co" "co" "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
504 |
| CSym "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
505 |
| CCir "co" "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
506 |
| CLeft "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
507 |
| CRight "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
508 |
| CSim "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
509 |
| CRightc "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
510 |
| CLeftc "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
511 |
| CCoe "co" "co" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
512 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
513 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
514 |
typedecl ty --"hack since ty is not yet defined" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
515 |
typedecl kind |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
516 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
517 |
instance ty and kind:: pt |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
518 |
sorry |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
519 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
520 |
abbreviation |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
521 |
"atoms A \<equiv> atom ` A" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
522 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
523 |
nominal_datatype trm = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
524 |
Var "var" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
525 |
| C "string" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
526 |
| LAM tv::"tvar" "kind" t::"trm" bind tv in t |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
527 |
| APP "trm" "ty" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
528 |
| Lam v::"var" "ty" t::"trm" bind v in t |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
529 |
| App "trm" "trm" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
530 |
| Let x::"var" "ty" "trm" t::"trm" bind x in t |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
531 |
| Case "trm" "assoc list" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
532 |
| Cast "trm" "ty" --"ty is supposed to be a coercion type only" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
533 |
and assoc = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
534 |
A p::"pat" t::"trm" bind "bv p" in t |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
535 |
and pat = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
536 |
K "string" "(tvar \<times> kind) list" "(var \<times> ty) list" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
537 |
binder |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
538 |
bv :: "pat \<Rightarrow> atom set" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
539 |
where |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
540 |
"bv (K s ts vs) = (atoms (set (map fst ts))) \<union> (atoms (set (map fst vs)))" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
541 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
542 |
(* |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
543 |
compat (K s ts vs) pi (K s' ts' vs') == |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
544 |
s = s' & |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
545 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
546 |
*) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
547 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
548 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
549 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
550 |
text {* weirdo example from Peter Sewell's bestiary *} |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
551 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
552 |
nominal_datatype weird = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
553 |
WBind x::"name" y::"name" p1::"weird" p2::"weird" p3::"weird" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
554 |
bind x in p1, bind x in p2, bind y in p2, bind y in p3 |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
555 |
| WV "name" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
556 |
| WP "weird" "weird" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
557 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
558 |
thm permute_weird_raw.simps[no_vars] |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
559 |
thm alpha_weird_raw.intros[no_vars] |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
560 |
thm fv_weird_raw.simps[no_vars] |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
561 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
562 |
(* example 6 from Terms.thy *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
563 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
564 |
(* BV is not respectful, needs to fail*) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
565 |
nominal_datatype trm6 = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
566 |
Vr6 "name" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
567 |
| Lm6 x::"name" t::"trm6" bind x in t |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
568 |
| Lt6 left::"trm6" right::"trm6" bind "bv6 left" in right |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
569 |
binder |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
570 |
bv6 |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
571 |
where |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
572 |
"bv6 (Vr6 n) = {}" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
573 |
| "bv6 (Lm6 n t) = {atom n} \<union> bv6 t" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
574 |
| "bv6 (Lt6 l r) = bv6 l \<union> bv6 r" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
575 |
(* example 7 from Terms.thy *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
576 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
577 |
(* BV is not respectful, needs to fail*) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
578 |
nominal_datatype trm7 = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
579 |
Vr7 "name" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
580 |
| Lm7 l::"name" r::"trm7" bind l in r |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
581 |
| Lt7 l::"trm7" r::"trm7" bind "bv7 l" in r |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
582 |
binder |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
583 |
bv7 |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
584 |
where |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
585 |
"bv7 (Vr7 n) = {atom n}" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
586 |
| "bv7 (Lm7 n t) = bv7 t - {atom n}" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
587 |
| "bv7 (Lt7 l r) = bv7 l \<union> bv7 r" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
588 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
589 |
(* example 8 from Terms.thy *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
590 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
591 |
(* Binding in a term under a bn, needs to fail *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
592 |
nominal_datatype foo8 = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
593 |
Foo0 "name" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
594 |
| Foo1 b::"bar8" f::"foo8" bind "bv8 b" in f --"check fo error if this is called foo" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
595 |
and bar8 = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
596 |
Bar0 "name" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
597 |
| Bar1 "name" s::"name" b::"bar8" bind s in b |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
598 |
binder |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
599 |
bv8 |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
600 |
where |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
601 |
"bv8 (Bar0 x) = {}" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
602 |
| "bv8 (Bar1 v x b) = {atom v}" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
603 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
604 |
(* example 9 from Terms.thy *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
605 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
606 |
(* BV is not respectful, needs to fail*) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
607 |
nominal_datatype lam9 = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
608 |
Var9 "name" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
609 |
| Lam9 n::"name" l::"lam9" bind n in l |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
610 |
and bla9 = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
611 |
Bla9 f::"lam9" s::"lam9" bind "bv9 f" in s |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
612 |
binder |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
613 |
bv9 |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
614 |
where |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
615 |
"bv9 (Var9 x) = {}" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
616 |
| "bv9 (Lam9 x b) = {atom x}" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
617 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
618 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
619 |
(* Type schemes with separate datatypes *) |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
620 |
nominal_datatype t = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
621 |
Var "name" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
622 |
| Fun "t" "t" |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
623 |
|
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
624 |
nominal_datatype tyS = |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
625 |
All xs::"name list" ty::"t_raw" bind xs in ty |
1f3c01345c9e
Reordered examples in Test.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1396
diff
changeset
|
626 |
|
1312
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
627 |
|
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
628 |
|
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
629 |
|
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
630 |
(* example 9 from Peter Sewell's bestiary *) |
b0eae8c93314
added some more examples from Peter Sewell's bestiary
Christian Urban <urbanc@in.tum.de>
parents:
1304
diff
changeset
|
631 |
(* run out of steam at the moment *) |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
632 |
|
961
0f88e04eb486
Variable takes a 'name'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
954
diff
changeset
|
633 |
end |
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
parents:
1194
diff
changeset
|
634 |
|
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
parents:
1194
diff
changeset
|
635 |
|
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
parents:
1223
diff
changeset
|
636 |