definition:
|
wlIteration :: (Eq a, Eq b) => (a -> [(QName,b)] -> b) -> (a -> QName)
-> [(a,[QName])] -> [(a,[QName])] -> SetRBT QName
-> ProgInfo b -> Map QName b -> Map QName b
--wlIteration analysis nameOf declsToDo declsDone changedEntities
-- importInfos currvals
wlIteration analysis nameOf [] alldecls changedEntities importInfos currvals =
if Set.null changedEntities
then currvals -- no todos, no changed values, so we are done:
else -- all declarations processed, compute todos for next round:
let (declsToDo,declsDone) =
partition (\ (_,calls) -> any (`Set.member` changedEntities) calls)
alldecls
in wlIteration analysis nameOf declsToDo declsDone (Set.empty (<))
importInfos currvals
-- process a single declaration:
wlIteration analysis nameOf (decldeps@(decl,calls):decls) declsDone
changedEntities importInfos currvals =
let decname = nameOf decl
lookupVal qn = maybe (maybe (lookupError "wlIteration" qn) id
(Map.lookup qn currvals)) id
(lookupProgInfo qn importInfos)
oldval = lookupVal decname
newval = analysis decl (map (\qn -> (qn, lookupVal qn)) calls)
in if oldval==newval
then wlIteration analysis nameOf decls (decldeps:declsDone)
changedEntities importInfos currvals
else wlIteration analysis nameOf decls (decldeps:declsDone)
(Set.insert decname changedEntities) importInfos
(Map.adjust (const newval) decname currvals)
|
demand:
|
arguments 5 9
|
deterministic:
|
deterministic operation
|
failfree:
|
<FAILING>
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_,_,_,{[]},_,_,_,_) |-> _ || (_,_,_,_,{:},_,_,_,_) |-> _}
|
name:
|
wlIteration
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
(Prelude.Eq a, Prelude.Eq b) => (a -> [((String, String), b)] -> b) -> (a
-> (String, String)) -> [(a, [(String, String)])] -> [(a, [(String, String)])]
-> Data.RedBlackTree.RedBlackTree (String, String)
-> Analysis.ProgInfo.ProgInfo b -> Data.Map.Map (String, String) b
-> Data.Map.Map (String, String) b
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|