From 99cf7409d4eaacd7f8b86ff4de8b92c86a10dd5f Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 24 Jun 2014 17:12:04 +0200 Subject: Implementation of disjunction domain seems to work. --- frontend/typing.ml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'frontend') 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 -- cgit v1.2.3