author | paulson |
Wed, 05 Nov 1997 13:32:07 +0100 | |
changeset 4159 | 4aff9b7e5597 |
parent 3940 | 1d5bee4d047f |
child 6093 | 87bf8c03b169 |
permissions | -rw-r--r-- |
1478 | 1 |
(* Title: ZF/qpair.thy |
0 | 2 |
ID: $Id$ |
1478 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
0 | 4 |
Copyright 1993 University of Cambridge |
5 |
||
6 |
Quine-inspired ordered pairs and disjoint sums, for non-well-founded data |
|
7 |
structures in ZF. Does not precisely follow Quine's construction. Thanks |
|
8 |
to Thomas Forster for suggesting this approach! |
|
9 |
||
10 |
W. V. Quine, On Ordered Pairs and Relations, in Selected Logic Papers, |
|
11 |
1966. |
|
12 |
*) |
|
13 |
||
2469 | 14 |
QPair = Sum + |
3923 | 15 |
|
16 |
global |
|
17 |
||
0 | 18 |
consts |
1478 | 19 |
QPair :: [i, i] => i ("<(_;/ _)>") |
1401 | 20 |
qfst,qsnd :: i => i |
21 |
qsplit :: [[i, i] => 'a, i] => 'a::logic (*for pattern-matching*) |
|
22 |
qconverse :: i => i |
|
23 |
QSigma :: [i, i => i] => i |
|
0 | 24 |
|
1478 | 25 |
"<+>" :: [i,i]=>i (infixr 65) |
1401 | 26 |
QInl,QInr :: i=>i |
27 |
qcase :: [i=>i, i=>i, i]=>i |
|
0 | 28 |
|
929
137035296ad6
Moved declarations of @QSUM and <*> to a syntax section.
lcp
parents:
753
diff
changeset
|
29 |
syntax |
1401 | 30 |
"@QSUM" :: [idt, i, i] => i ("(3QSUM _:_./ _)" 10) |
1478 | 31 |
"<*>" :: [i, i] => i (infixr 80) |
929
137035296ad6
Moved declarations of @QSUM and <*> to a syntax section.
lcp
parents:
753
diff
changeset
|
32 |
|
0 | 33 |
translations |
34 |
"QSUM x:A. B" => "QSigma(A, %x. B)" |
|
44 | 35 |
"A <*> B" => "QSigma(A, _K(B))" |
0 | 36 |
|
3940 | 37 |
local |
3923 | 38 |
|
753 | 39 |
defs |
0 | 40 |
QPair_def "<a;b> == a+b" |
1097
01379c46ad2d
Changed definitions so that qsplit is now defined in terms of
lcp
parents:
929
diff
changeset
|
41 |
qfst_def "qfst(p) == THE a. EX b. p=<a;b>" |
01379c46ad2d
Changed definitions so that qsplit is now defined in terms of
lcp
parents:
929
diff
changeset
|
42 |
qsnd_def "qsnd(p) == THE b. EX a. p=<a;b>" |
01379c46ad2d
Changed definitions so that qsplit is now defined in terms of
lcp
parents:
929
diff
changeset
|
43 |
qsplit_def "qsplit(c,p) == c(qfst(p), qsnd(p))" |
01379c46ad2d
Changed definitions so that qsplit is now defined in terms of
lcp
parents:
929
diff
changeset
|
44 |
|
0 | 45 |
qconverse_def "qconverse(r) == {z. w:r, EX x y. w=<x;y> & z=<y;x>}" |
46 |
QSigma_def "QSigma(A,B) == UN x:A. UN y:B(x). {<x;y>}" |
|
47 |
||
120 | 48 |
qsum_def "A <+> B == ({0} <*> A) Un ({1} <*> B)" |
0 | 49 |
QInl_def "QInl(a) == <0;a>" |
50 |
QInr_def "QInr(b) == <1;b>" |
|
51 |
qcase_def "qcase(c,d) == qsplit(%y z. cond(y, d(z), c(z)))" |
|
52 |
end |
|
53 |
||
54 |
ML |
|
55 |
||
56 |
val print_translation = |
|
929
137035296ad6
Moved declarations of @QSUM and <*> to a syntax section.
lcp
parents:
753
diff
changeset
|
57 |
[("QSigma", dependent_tr' ("@QSUM", "op <*>"))]; |