Mercurial > urweb
comparison src/rpcify.sml @ 650:fcf0bd3d1667
BatchG demo
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 10 Mar 2009 16:38:38 -0400 |
parents | 96ebc6bdb5a0 |
children | bab524996fca |
comparison
equal
deleted
inserted
replaced
649:96ebc6bdb5a0 | 650:fcf0bd3d1667 |
---|---|
69 maxName : int | 69 maxName : int |
70 } | 70 } |
71 | 71 |
72 fun frob file = | 72 fun frob file = |
73 let | 73 let |
74 fun sideish (basis, ssids) = | 74 fun sideish (basis, ssids) e = |
75 U.Exp.exists {kind = fn _ => false, | 75 case #1 e of |
76 con = fn _ => false, | 76 ERecord _ => false |
77 exp = fn ENamed n => IS.member (ssids, n) | 77 | _ => |
78 | EFfi ("Basis", x) => SS.member (basis, x) | 78 U.Exp.exists {kind = fn _ => false, |
79 | EFfiApp ("Basis", x, _) => SS.member (basis, x) | 79 con = fn _ => false, |
80 | _ => false} | 80 exp = fn ENamed n => IS.member (ssids, n) |
81 | EFfi ("Basis", x) => SS.member (basis, x) | |
82 | EFfiApp ("Basis", x, _) => SS.member (basis, x) | |
83 | _ => false} e | |
81 | 84 |
82 fun whichIds basis = | 85 fun whichIds basis = |
83 let | 86 let |
84 fun decl ((d, _), ssids) = | 87 fun decl ((d, _), ssids) = |
85 let | 88 let |
329 case IM.find (tfuncs, n) of | 332 case IM.find (tfuncs, n) of |
330 NONE => (Print.prefaces "BAD" [("e", | 333 NONE => (Print.prefaces "BAD" [("e", |
331 CorePrint.p_exp CoreEnv.empty (e, loc))]; | 334 CorePrint.p_exp CoreEnv.empty (e, loc))]; |
332 raise Fail "Rpcify: Undetected transaction function [2]") | 335 raise Fail "Rpcify: Undetected transaction function [2]") |
333 | SOME x => x | 336 | SOME x => x |
337 | |
338 val () = Print.prefaces "Double true" | |
339 [("trans1", CorePrint.p_exp CoreEnv.empty trans1), | |
340 ("e", CorePrint.p_exp CoreEnv.empty e)] | |
334 | 341 |
335 val n' = #maxName st | 342 val n' = #maxName st |
336 | 343 |
337 val st = {cpsed = IM.insert (#cpsed st, n, n'), | 344 val st = {cpsed = IM.insert (#cpsed st, n, n'), |
338 cpsed_range = IM.insert (#cpsed_range st, n', ran), | 345 cpsed_range = IM.insert (#cpsed_range st, n', ran), |