LustreDesugarIfBlocksCode for desugaring imperative-style if blocks to functional ITEs.
Precondition: Multiple assignment has been removed from if and frame blocks.
The code has a few steps. 1. Parse the if block and create a map of trees, one for each variable. 2. Fill in oracles in the trees for missing values. 3. Remove redundancy from the trees. 4. Convert the trees to ITE expressions.
type error_kind = | MisplacedNodeItemError of LustreAst.node_item| MissingDefinitionInBranchError of HString.tval error_message : error_kind -> stringval pos_list_map : (Lib.position * LustreAst.eq_lhs) list NodeId.Hashtbl.tval desugar_if_blocks :
TypeCheckerContext.tc_context ->
LustreAst.declaration list ->
GeneratedIdentifiers.t NodeId.Map.t ->
(LustreAst.declaration list * GeneratedIdentifiers.t NodeId.Map.t,
[> error ])
Stdlib.result