Ex Contract v0.1.2 ExContract.CompileState View Source
This module is not meant to be used directly by client code. This module holds compilation state
for ExContract. Stores each condition and optional message in corresponding requires or ensures
lists.
Link to this section Summary
Types
Defines fields that store ExContract compile state.
:requires- list ofExContract.ConditionMsgthat define a single method pre-conditions.:ensures- list ofExContract.ConditionMsgthat define a single method post-conditions
Functions
Adds 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 provided message
Adds requires condition of type ExContract.ConditionMsg to the requires list. The condition
is associated with nil message
Adds requires 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
t() :: %ExContract.CompileState{
ensures: [ExContract.ConditionMsg.t()],
requires: [ExContract.ConditionMsg.t()]
}
Defines fields that store ExContract compile state.
:requires- list ofExContract.ConditionMsgthat define a single method pre-conditions.:ensures- list ofExContract.ConditionMsgthat define a single method post-conditions.
Link to this section Functions
add_ensure(state :: ExContract.CompileState.t(), condition :: tuple()) :: ExContract.CompileState.t()
Adds ensures condition of type ExContract.ConditionMsg to the ensures list. The condition
is associated with nil message.
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 provided message.
add_require(state :: ExContract.CompileState.t(), condition :: tuple()) :: ExContract.CompileState.t()
Adds requires condition of type ExContract.ConditionMsg to the requires list. The condition
is associated with nil message.
add_require( state :: ExContract.CompileState.t(), condition :: tuple(), msg :: String.t() ) :: ExContract.CompileState.t()
Adds requires 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.