diff options
author | Alex Auvolat <alex.auvolat@ansys.com> | 2014-07-04 11:48:05 +0200 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ansys.com> | 2014-07-04 11:48:05 +0200 |
commit | 1445a2be1e1bd81efa552230a0f11672aa20a92c (patch) | |
tree | 9a5973181ebaf26373e8cc01b0f9eca553f66240 /frontend/typing.ml | |
parent | 2cbaba6f00d40d5c6c9659678d0156f14b7e3780 (diff) | |
download | scade-analyzer-1445a2be1e1bd81efa552230a0f11672aa20a92c.tar.gz scade-analyzer-1445a2be1e1bd81efa552230a0f11672aa20a92c.zip |
First implementation of resetting transitions.
Diffstat (limited to 'frontend/typing.ml')
-rw-r--r-- | frontend/typing.ml | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/frontend/typing.ml b/frontend/typing.ml index d814bbe..883e8e0 100644 --- a/frontend/typing.ml +++ b/frontend/typing.ml @@ -178,17 +178,12 @@ let rec extract_all_vars rp (node, prefix, eqs) n_vars = vars_of_expr c @ do_branch a @ do_branch b in do_branch b | AST_automaton (aid, states, ret) -> - (* Determine which states can be reset *) - let rst_trans = List.flatten + let rst_states = List.flatten (List.map (fun (st, _) -> - List.map (fun (_, (id, _), _) -> (st.st_name, id)) + List.map (fun (_, (id, _), _) -> id) (List.filter (fun (_, _, rst) -> rst) st.until)) states) in - List.iter (fun (st, _) -> - st.i_rst <- List.mem (st.st_name, st.st_name) rst_trans; - st.o_rst <- List.exists (fun (a, b) -> b = st.st_name && a <> b) rst_trans) - states; let do_state (st, _) = let tvars = @@ -197,7 +192,7 @@ let rec extract_all_vars rp (node, prefix, eqs) n_vars = in let st_scope = (node, aid^"."^st.st_name^".", st.body) in let svars = vars_in_node node st.st_locals in - (if st.i_rst || st.o_rst then + (if List.mem st.st_name rst_states then [false, node^"/"^aid^"."^st.st_name^".must_reset", bool_type] else []) @ svars @ tvars @ clock_vars rp st_scope @ |