Ex Contract v0.1.0 ExContract.CompileState View Source

Holds compilation state for JdContracts storing each condition and optional message in corresponding requires or ensures lists.

Link to this section Summary

Types

t()

Defines fields that store JdContracts compile state.

Functions

Adds a ensures condition of type ExContract.ConditionMsg to the ensures list. The condition is associated with nil message

Adds a ensures condition of type ExContract.ConditionMsg to the ensures list. The condition is associated with nil message

Adds a require condition of type ExContract.ConditionMsg to the requires list. The condition is associated with nil message

Adds a require condition of type ExContract.ConditionMsg to the requires list. The condition is associated with provided message

Returns an empty state where both :requires and :ensures list are empty

Link to this section Types

Link to this type t() View Source
t() :: %ExContract.CompileState{ensures: [ExContract.ConditionMsg.t], requires: [ExContract.ConditionMsg.t]}

Defines fields that store JdContracts compile state.

Link to this section Functions

Link to this function add_ensure(state, condition) View Source
add_ensure(state :: ExContract.CompileState.t, condition :: tuple) :: ExContract.CompileState.t

Adds a ensures condition of type ExContract.ConditionMsg to the ensures list. The condition is associated with nil message.

Link to this function add_ensure(state, condition, msg) View Source
add_ensure(state :: ExContract.CompileState.t, condition :: tuple, msg :: String.t) :: ExContract.CompileState.t

Adds a ensures condition of type ExContract.ConditionMsg to the ensures list. The condition is associated with nil message.

Link to this function add_require(state, condition) View Source
add_require(state :: ExContract.CompileState.t, condition :: tuple) :: ExContract.CompileState.t

Adds a require condition of type ExContract.ConditionMsg to the requires list. The condition is associated with nil message.

Link to this function add_require(state, condition, msg) View Source
add_require(state :: ExContract.CompileState.t, condition :: tuple, msg :: String.t) :: ExContract.CompileState.t

Adds a require condition of type ExContract.ConditionMsg to the requires list. The condition is associated with provided message.

Returns an empty state where both :requires and :ensures list are empty.