13 |
structure F = FLINT |
structure F = FLINT |
14 |
structure O = Option |
structure O = Option |
15 |
structure M = IntBinaryMap |
structure M = IntBinaryMap |
16 |
structure S = IntSetF |
structure S = IntBinarySet |
17 |
structure OU = OptUtils |
structure OU = OptUtils |
18 |
structure LK = LtyKernel |
structure LK = LtyKernel |
19 |
structure CTRL = FLINT_Control |
structure CTRL = FLINT_Control |
58 |
let val I{tcp,calls,icalls,...} = new(f, known, p) |
let val I{tcp,calls,icalls,...} = new(f, known, p) |
59 |
val _ = loop le |
val _ = loop le |
60 |
val necalls = length(!calls) |
val necalls = length(!calls) |
61 |
in collect f (if !tcp then S.add(f,tfs) else S.singleton f) body; |
in collect f (if !tcp then S.add(tfs, f) else S.singleton f) body; |
62 |
icalls := List.take(!calls, length(!calls) - necalls) |
icalls := List.take(!calls, length(!calls) - necalls) |
63 |
end |
end |
64 |
| F.FIX(fdecs,le) => |
| F.FIX(fdecs,le) => |
76 |
end |
end |
77 |
| F.APP(F.VAR f,vs) => |
| F.APP(F.VAR f,vs) => |
78 |
(let val I{tails,calls,tcp,parent,...} = get f |
(let val I{tails,calls,tcp,parent,...} = get f |
79 |
in if S.member tfs f then tails := vs::(!tails) |
in if S.member(tfs, f) then tails := vs::(!tails) |
80 |
else (calls := vs::(!calls); |
else (calls := vs::(!calls); |
81 |
if S.member tfs parent then () else tcp := false) |
if S.member(tfs, parent) then () else tcp := false) |
82 |
end handle NotFound => ()) |
end handle NotFound => ()) |
83 |
| F.TFN((_,_,_,body),le) => (collect p S.empty body; loop le) |
| F.TFN((_,_,_,body),le) => (collect p S.empty body; loop le) |
84 |
| F.TAPP _ => () |
| F.TAPP _ => () |
222 |
of SOME(fl, filt) => |
of SOME(fl, filt) => |
223 |
F.APP(F.VAR fl, OU.filter filt vs) |
F.APP(F.VAR fl, OU.filter filt vs) |
224 |
| NONE => le |
| NONE => le |
225 |
(*esac*)) |
(*esac*))) |
226 |
| F.TFN((tfk,f,args,body),le) => F.TFN((tfk, f, args, loop body), loop le) |
| F.TFN((tfk,f,args,body),le) => F.TFN((tfk, f, args, loop body), loop le) |
227 |
| F.TAPP(f,tycs) => le |
| F.TAPP(f,tycs) => le |
228 |
| F.SWITCH(v,ac,arms,def) => |
| F.SWITCH(v,ac,arms,def) => |