Commit 3cda476c authored by Martin Wierich's avatar Martin Wierich
Browse files

optimizing performance of explicitimports

parent 6b57219a
......@@ -2,8 +2,8 @@ definition module explicitimports
import syntax, checksupport
possiblyFilterExplImportedDecls :: ![ImportDeclaration] u:[w:(.Index,y:Declarations)] Position u0:{#DclModule} !*CheckState
-> (!v:[x:(Index,z:Declarations)],!u0:{#DclModule},!.CheckState), [y <= z, w <= x, u <= v]
possiblyFilterExplImportedDecls :: ![ImportDeclaration] u:[w:(.Index,y:Declarations)] Position *{#DclModule} !*CheckState
-> (!v:[x:(Index,z:Declarations)],!.{#DclModule},!.CheckState), [y <= z, w <= x, u <= v]
checkExplicitImportCompleteness :: !Int ![ExplicitImport] !*{#DclModule} !*{#FunDef} !*ExpressionHeap !*CheckState
-> (!.{#DclModule},!.{#FunDef},!.ExpressionHeap,!.CheckState)
......
This diff is collapsed.
......@@ -124,11 +124,12 @@ mapFilterYesSt f l st
:== map_filter_yes_st l st
where
map_filter_yes_st [] st
#! st = st
= ([], st)
map_filter_yes_st [h:t] st
#! (opt_f_h , st) = f h st
(t2, st) = map_filter_yes_st t st
f_h_t2 = optCons opt_f_h t2
(f_h_t2, _) = optCons opt_f_h t2
st = st
= (f_h_t2, st)
......@@ -136,15 +137,16 @@ iMapFilterYesSt f fr to st
:== i_map_filter_yes_st fr to st
where
i_map_filter_yes_st fr to st
#! st = st
| fr >= to
= ([], st)
#! (opt_f_fr, st) = f fr st
(t, st) = i_map_filter_yes_st (inc fr) to st
f_fr_t2 = optCons opt_f_fr t
(f_fr_t2, _) = optCons opt_f_fr t
st = st
= (f_fr_t2, st)
optCons :: !(Optional .a) !u:[.a] -> v:[.a] ,[u <= v]
optCons :: !(Optional .a) !u:[.a] -> (!v:[.a], !Int) ,[u <= v]
revAppend :: ![a] ![a] -> [a] // Reverse the list using the second argument as accumulator.
revMap :: !(.a -> .b) ![.a] !u:[.b] -> u:[.b]
......
......@@ -209,11 +209,12 @@ mapFilterYesSt f l st
:== map_filter_yes_st l st
where
map_filter_yes_st [] st
#! st = st
= ([], st)
map_filter_yes_st [h:t] st
#! (opt_f_h , st) = f h st
(t2, st) = map_filter_yes_st t st
f_h_t2 = optCons opt_f_h t2
(f_h_t2, _) = optCons opt_f_h t2
st = st
= (f_h_t2, st)
......@@ -222,19 +223,20 @@ iMapFilterYesSt f fr to st
:== i_map_filter_yes_st fr to st
where
i_map_filter_yes_st fr to st
#! st = st
| fr >= to
= ([], st)
#! (opt_f_fr, st) = f fr st
(t, st) = i_map_filter_yes_st (inc fr) to st
f_fr_t2 = optCons opt_f_fr t
(f_fr_t2, _) = optCons opt_f_fr t
st = st
= (f_fr_t2, st)
optCons :: !(Optional .a) !u:[.a] -> v:[.a] ,[u <= v]
optCons :: !(Optional .a) !u:[.a] -> (!v:[.a], !Int) ,[u <= v]
optCons No l
= l
= (l, 0)
optCons (Yes x) l
= [x:l]
= ([x:l], 0)
eqMerge :: ![a] ![a] -> [a] | Eq a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment