equal
deleted
inserted
replaced
126 "ALL x:A. P" == "Ball(A, %x. P)" |
126 "ALL x:A. P" == "Ball(A, %x. P)" |
127 "EX x:A. P" == "Bex(A, %x. P)" |
127 "EX x:A. P" == "Bex(A, %x. P)" |
128 |
128 |
129 "<x, y, z>" == "<x, <y, z>>" |
129 "<x, y, z>" == "<x, <y, z>>" |
130 "<x, y>" == "Pair(x, y)" |
130 "<x, y>" == "Pair(x, y)" |
131 "%<x,y,zs>.b" => "split(%x <y,zs>.b)" |
131 "%<x,y,zs>.b" == "split(%x <y,zs>.b)" |
132 "%<x,y>.b" => "split(%x y.b)" |
132 "%<x,y>.b" == "split(%x y.b)" |
133 (* The <= direction fails if split has more than one argument because |
133 (* The <= direction fails if split has more than one argument because |
134 ast-matching fails. Otherwise it would work fine *) |
134 ast-matching fails. Otherwise it would work fine *) |
135 |
135 |
136 defs |
136 defs |
137 |
137 |
232 |
232 |
233 |
233 |
234 ML |
234 ML |
235 |
235 |
236 (* Pattern-matching and 'Dependent' type operators *) |
236 (* Pattern-matching and 'Dependent' type operators *) |
237 |
237 (* |
238 local open Syntax |
238 local open Syntax |
239 |
239 |
240 fun pttrn s = const"@pttrn" $ s; |
240 fun pttrn s = const"@pttrn" $ s; |
241 fun pttrns s t = const"@pttrns" $ s $ t; |
241 fun pttrns s t = const"@pttrns" $ s $ t; |
242 |
242 |
253 fun split_tr'(t::args) = |
253 fun split_tr'(t::args) = |
254 let val (pats,ft) = split2(t) |
254 let val (pats,ft) = split2(t) |
255 in list_comb(const"_lambda" $ pttrn pats $ ft, args) end; |
255 in list_comb(const"_lambda" $ pttrn pats $ ft, args) end; |
256 |
256 |
257 in |
257 in |
258 |
258 *) |
259 val print_translation = |
259 val print_translation = |
260 [("split", split_tr'), |
260 [(*("split", split_tr'),*) |
261 ("Pi", dependent_tr' ("@PROD", "op ->")), |
261 ("Pi", dependent_tr' ("@PROD", "op ->")), |
262 ("Sigma", dependent_tr' ("@SUM", "op *"))]; |
262 ("Sigma", dependent_tr' ("@SUM", "op *"))]; |
263 |
263 (* |
264 end; |
264 end; |
|
265 *) |