Allow running the action sequence from a user supplied initial state #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
runActionsFrom
allows specifying an initial annotated state, giving some control to the user of what state to start the execution from.Motivation
I have a model, in which the initial state depends on some input parameters. As
quickcheck-dynamic
does not provide a way to specify static configuration, I have to put the parameters into the model state:As the
initialState
method of theStateModel
class has no parameters, I have to create an explicitInitState
action, which will forward the parameter into the model:Finally, in the property, I need to:
InitState
action to the sequence of actions, which I do not think is possible with the current interface ofquickcheck-dynamic
,InitState
action separately, obtaining the desired initialised state as output, and then somehow inject it back, which I can only do if I have therunActionFrom
function:Discussion
Please let me know if there is a way to achieve what I want using the current interface of
quickcheck-dynamic
.I see that there is a PR #83 that solves a similar problem in a more principled way. I would be very happy to use this functionality instead of the
runActionsFrom
back-door! Are there any plans to merge #83