PropCheck.StateM.ModelDSL.defcommand

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

defcommand(name, list)

View Source (macro)

Defines a new command of the model.

Inside the command, local functions define

  • how the command is executed: impl(...) - this is required,
  • 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.