summaryrefslogtreecommitdiff
path: root/frontend/typing.ml
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ansys.com>2014-06-24 17:12:04 +0200
committerAlex Auvolat <alex.auvolat@ansys.com>2014-06-24 17:12:04 +0200
commit99cf7409d4eaacd7f8b86ff4de8b92c86a10dd5f (patch)
tree4fddba970a4a5db064d48859c9525baff4d4ae6f /frontend/typing.ml
parent6dec5b2fae34f4be8e57745e3b1a7063a62e1fc4 (diff)
downloadscade-analyzer-99cf7409d4eaacd7f8b86ff4de8b92c86a10dd5f.tar.gz
scade-analyzer-99cf7409d4eaacd7f8b86ff4de8b92c86a10dd5f.zip
Implementation of disjunction domain seems to work.
Diffstat (limited to 'frontend/typing.ml')
-rw-r--r--frontend/typing.ml12
1 files changed, 7 insertions, 5 deletions
diff --git a/frontend/typing.ml b/frontend/typing.ml
index 0417d27..aca8d15 100644
--- a/frontend/typing.ml
+++ b/frontend/typing.ml
@@ -32,8 +32,8 @@ type scope = id * id * eqn ext list
type rooted_prog = {
p : prog;
- no_time_scope : id list; (* scopes in which not to introduce time variable *)
- init_scope : id list; (* scopes in which to introduce init variable *)
+ no_time_scope : id -> bool; (* scopes in which not to introduce time variable *)
+ init_scope : id -> bool; (* scopes in which to introduce init variable *)
root_node : node_decl;
root_scope : scope;
@@ -179,13 +179,13 @@ let rec extract_all_vars rp (node, prefix, eqs) n_vars =
in
let v = List.flatten (List.map vars_of_eq eqs) in
let v =
- if not (List.mem (node^"/") rp.no_time_scope)
+ if not (rp.no_time_scope (node^"/"))
then
(false, node^"/"^prefix^"time", TInt)::
(false, "N"^node^"/"^prefix^"time", TInt)::v
else v in
let v =
- if List.mem (node^"/") rp.init_scope
+ if rp.init_scope (node^"/")
then
(false, node^"/"^prefix^"init", bool_type)::
(false, "N"^node^"/"^prefix^"init", bool_type)::v
@@ -197,7 +197,9 @@ let rec extract_all_vars rp (node, prefix, eqs) n_vars =
root_prog : prog -> id -> string list -> string list -> rooted_prog
*)
let root_prog p root no_time_scope init_scope =
- let (root_node, _) = find_node_decl p root in
+ let (root_node, _) =
+ try find_node_decl p root
+ with Not_found -> error ("No such root node: " ^ root) in
let root_scope = ("", "", root_node.body) in
let const_vars = List.map