author | Thomas Sewell <tsewell@nicta.com.au> |
Thu, 10 Sep 2009 15:18:43 +1000 | |
changeset 32744 | 50406c4951d9 |
parent 32155 | e2bf2f73b0c8 |
child 35426 | c9b9d4fc270d |
permissions | -rw-r--r-- |
4129
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
1 |
(* Title: HOLCF/holcf_logic.ML |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
2 |
Author: David von Oheimb |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
3 |
|
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
4 |
Abstract syntax operations for HOLCF. |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
5 |
*) |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
6 |
|
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
7 |
infixr 6 ->>; |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
8 |
|
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
9 |
signature HOLCF_LOGIC = |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
10 |
sig |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
11 |
val mk_btyp: string -> typ * typ -> typ |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
12 |
val pcpoS: sort |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
13 |
val mk_TFree: string -> typ |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
14 |
val cfun_arrow: string |
16843 | 15 |
val ->> : typ * typ -> typ |
16 |
val mk_ssumT: typ * typ -> typ |
|
4129
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
17 |
val mk_sprodT: typ * typ -> typ |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
18 |
val mk_uT: typ -> typ |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
19 |
val trT: typ |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
20 |
val oneT: typ |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
21 |
end; |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
22 |
|
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
23 |
structure HOLCFLogic: HOLCF_LOGIC = |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
24 |
struct |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
25 |
|
16843 | 26 |
(* sort pcpo *) |
27 |
||
32010 | 28 |
val pcpoS = @{sort pcpo}; |
16843 | 29 |
fun mk_TFree s = TFree ("'" ^ s, pcpoS); |
30 |
||
31 |
||
32 |
(* basic types *) |
|
4129
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
33 |
|
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
34 |
fun mk_btyp t (S,T) = Type (t,[S,T]); |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
35 |
|
16843 | 36 |
local |
32155 | 37 |
val intern_type = Sign.intern_type @{theory}; |
16843 | 38 |
val u = intern_type "u"; |
39 |
in |
|
4129
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
40 |
|
16843 | 41 |
val cfun_arrow = intern_type "->"; |
42 |
val op ->> = mk_btyp cfun_arrow; |
|
43 |
val mk_ssumT = mk_btyp (intern_type "++"); |
|
44 |
val mk_sprodT = mk_btyp (intern_type "**"); |
|
45 |
fun mk_uT T = Type (u, [T]); |
|
46 |
val trT = Type (intern_type "tr" , []); |
|
47 |
val oneT = Type (intern_type "one", []); |
|
4129
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
48 |
|
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
49 |
end; |
2fd816aa6206
HOLCFLogic.ML, contconsts.ML renamed to holcf_logic.ML, cont_consts.ML;
wenzelm
parents:
diff
changeset
|
50 |
|
12030 | 51 |
end; |