PropCheck.StateM.DSL.defcommand

You're seeing just the macro defcommand, go back to PropCheck.StateM.DSL module for more information.
Link to this macro

defcommand(name, list)

View Source (macro)
This macro is deprecated. This module is deprecated, use `PropCheck.StateM.ModelDSL` instead!.

DEPRECATED : This module is deprecated, please use PropCheck.Statem.ModelDSL instead.

Defines a new command of the model.

Inside the command, local functions define

  • how the command is executed (impl(...)). This is required.
  • how the arguments in the current model state are generated (args(state). The default is the empty list of arguments.
  • if the command is allowed in the current model state (pre(state, arg_list) :: boolean) This is true per default.
  • what the next state of the model is after the call (next(old_state, arg_list, result) :: new_state). The default implementation does not change the model state, sufficient for queries.
  • if the system under test is in the correct state after the call (post(old_state, arg_list, result) :: boolean). This is true in the default implementation.

These local functions inside the macro are effectively callbacks to guide and evolve the model state.