Module LustreDesugarIfBlocks

Code 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 =
  1. | MisplacedNodeItemError of LustreAst.node_item
  2. | MissingDefinitionInBranchError of HString.t
val error_message : error_kind -> string
type error = [
  1. | `LustreDesugarIfBlocksError of Lib.position * error_kind
]
val pos_list_map : (Lib.position * LustreAst.eq_lhs) list NodeId.Hashtbl.t
val 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