Skip to content

Commit fade87a

Browse files
Define UF symbols for all function outputs (kind2-mc#1324)
Even if a function defines its output in its body, compositional analysis replaces the body with its contract, so the output becomes undefined at the transition-system level. Therefore, the associated UF symbols must always be generated when creating the LustreNode. This issue was introduced by kind2-mc#1286.
1 parent 883dea4 commit fade87a

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/lustre/lustreNodeGen.ml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -629,11 +629,11 @@ let compile_contract_item map count scope kind pos name expr =
629629
N.add_state_var_def state_var (N.ContractItem (pos, contract_sv, kind));
630630
contract_sv
631631

632-
let create_uf_symbols node_id inputs undefined_outputs =
632+
let create_uf_symbols node_id inputs outputs =
633633
let type_of = StateVar.type_of_state_var in
634634
let input_types = List.map type_of (X.values inputs) in
635635

636-
undefined_outputs
636+
X.values outputs
637637
|> List.fold_left (
638638
fun uf_symbols output ->
639639
let uf_name =
@@ -2771,16 +2771,7 @@ and compile_node_decl gids_map is_function opac cstate ctx node_id ext params in
27712771
(* ****************************************************************** *)
27722772
let comp_type =
27732773
if is_function then
2774-
let undefined_outputs =
2775-
let defined_svars = List.fold_left
2776-
(fun set ((sv,_),_) -> SVS.add sv set) SVS.empty equations
2777-
in
2778-
let is_undefined svar = SVS.mem svar defined_svars |> not in
2779-
List.filter is_undefined (X.values outputs)
2780-
in
2781-
N.Function { uf_symbols =
2782-
create_uf_symbols node_id inputs undefined_outputs
2783-
}
2774+
N.Function { uf_symbols = create_uf_symbols node_id inputs outputs}
27842775
else
27852776
N.Node
27862777
in

0 commit comments

Comments
 (0)