1 (* Title: HOLCF/Cprod3.thy
3 Author: Franz Regensburger
4 Copyright 1993 Technische Universitaet Muenchen
6 Class instance of * for class pcpo and cpo.
11 instance "*" :: (cpo,cpo)cpo (cpo_cprod)
12 instance "*" :: (pcpo,pcpo)pcpo (least_cprod)
15 cpair :: "'a -> 'b -> ('a*'b)" (* continuous pairing *)
18 csplit :: "('a->'b->'c)->('a*'b)->'c"
21 "@ctuple" :: "['a, args] => 'a * 'b" ("(1<_,/ _>)")
24 "<x, y, z>" == "<x, <y, z>>"
25 "<x, y>" == "cpair`x`y"
28 cpair_def "cpair == (LAM x y.(x,y))"
29 cfst_def "cfst == (LAM p. fst(p))"
30 csnd_def "csnd == (LAM p. snd(p))"
31 csplit_def "csplit == (LAM f p. f`(cfst`p)`(csnd`p))"
35 (* introduce syntax for
37 Let <x,y> = e1; z = E2 in E3
45 CLet :: "'a -> ('a -> 'b) -> 'b"
46 "CLet == LAM s f. f`s"
55 "_Cbind" :: "[pttrn, 'a] => Cletbind" ("(2_ =/ _)" 10)
56 "" :: "Cletbind => Cletbinds" ("_")
57 "_Cbinds" :: "[Cletbind, Cletbinds] => Cletbinds" ("_;/ _")
58 "_CLet" :: "[Cletbinds, 'a] => 'a" ("(Let (_)/ in (_))" 10)
61 "_CLet (_Cbinds b bs) e" == "_CLet b (_CLet bs e)"
62 "Let x = a in e" == "CLet`a`(LAM x. e)"
65 (* syntax for LAM <x,y,z>.e *)
68 "_LAM" :: "[patterns, 'a => 'b] => ('a -> 'b)" ("(3LAM <_>./ _)" [0, 10] 10)
71 "LAM <x,y,zs>.b" == "csplit`(LAM x. LAM <y,zs>.b)"
72 "LAM <x,y>. LAM zs. b" <= "csplit`(LAM x y zs. b)"
73 "LAM <x,y>.b" == "csplit`(LAM x y. b)"
76 "_LAM" :: "[patterns, 'a => 'b] => ('a -> 'b)" ("(3\\<Lambda>()<_>./ _)" [0, 10] 10)