projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
57a2771
)
Fix propagateState removing all non-FApp SigDefs.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Wed, 4 Mar 2009 10:35:42 +0000
(11:35 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Wed, 4 Mar 2009 10:35:42 +0000
(11:35 +0100)
Translator.hs
patch
|
blob
|
history
diff --git
a/Translator.hs
b/Translator.hs
index 2373c342dd40a0f861d014901d19ff71c50b3785..841f63b892c2f330adfa88bca5c837cf5a7ada23 100644
(file)
--- a/
Translator.hs
+++ b/
Translator.hs
@@
-190,7
+190,6
@@
propagateState ::
propagateState hsfunc flatfunc =
flatfunc {flat_defs = apps', flat_sigs = sigs'}
where
propagateState hsfunc flatfunc =
flatfunc {flat_defs = apps', flat_sigs = sigs'}
where
- apps = filter is_FApp (flat_defs flatfunc)
(olds, news) = unzip $ getStateSignals hsfunc flatfunc
states' = zip olds news
-- Find all signals used by all sigdefs
(olds, news) = unzip $ getStateSignals hsfunc flatfunc
states' = zip olds news
-- Find all signals used by all sigdefs
@@
-201,7
+200,7
@@
propagateState hsfunc flatfunc =
-- Find the states whose "old state" signal is used only once
single_use_states = filter ((`notElem` multiple_uses) . fst) states'
-- See if these single use states can be propagated
-- Find the states whose "old state" signal is used only once
single_use_states = filter ((`notElem` multiple_uses) . fst) states'
-- See if these single use states can be propagated
- (substate_sigss, apps') = unzip $ map (propagateState' single_use_states)
apps
+ (substate_sigss, apps') = unzip $ map (propagateState' single_use_states)
(flat_defs flatfunc)
substate_sigs = concat substate_sigss
-- Mark any propagated state signals as SigSubState
sigs' = map
substate_sigs = concat substate_sigss
-- Mark any propagated state signals as SigSubState
sigs' = map
@@
-212,18
+211,20
@@
propagateState hsfunc flatfunc =
propagateState' ::
[(SignalId, SignalId)]
-- ^ TODO
propagateState' ::
[(SignalId, SignalId)]
-- ^ TODO
- -> SigDef -- ^ The function application to process. Must be
- -- a FApp constructor.
+ -> SigDef -- ^ The SigDef to process.
-> ([SignalId], SigDef)
-- ^ Any signal ids that should become substates,
-- and the resulting application.
-> ([SignalId], SigDef)
-- ^ Any signal ids that should become substates,
-- and the resulting application.
-propagateState' states app =
- (our_old ++ our_new, app {appFunc = hsfunc'})
+propagateState' states def =
+ if (is_FApp def) then
+ (our_old ++ our_new, def {appFunc = hsfunc'})
+ else
+ ([], def)
where
where
- hsfunc = appFunc
app
- args = appArgs
app
- res = appRes
app
+ hsfunc = appFunc
def
+ args = appArgs
def
+ res = appRes
def
our_states = filter our_state states
-- A state signal belongs in this function if the old state is
-- passed in, and the new state returned
our_states = filter our_state states
-- A state signal belongs in this function if the old state is
-- passed in, and the new state returned