Module LustreDesugarLast

Desugars the last operator (only allowed within frame blocks).

type error_kind =
  1. | MisplacedLastError of HString.t
  2. | LastOnInputError of HString.t
  3. | UnknownIdentifier of HString.t
val error_message : error_kind -> string
type error = [
  1. | `LustreDesugarLastError of Lib.position * error_kind
]
val desugar_last : LustreAst.t -> (LustreAst.t, [> error ]) Stdlib.result

Replaces each last x occurring in a frame block with a fresh local variable initialized by the frame and equal to pre x afterwards. Returns an error if last is used outside of a frame block, or if it is applied to an input of the node.