-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to constrain steps #18
Conversation
ced9eaa
to
cfd6b65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to print out the current state again if a constraint is unsatisfiable:
(aldb) current
S1
----
far: { }
near: { Chicken, Farmer, Fox, Grain }
(aldb) step [Chicken=far]
Cannot perform step. Transition constraint is unsatisfiable.
S1
----
far: { }
near: { Chicken, Farmer, Fox, Grain }
(aldb)
README.md
Outdated
|
||
Specify an integer value of n >= 1. By default, n = 1. | ||
|
||
A list of constraints may also be specified, as a comma-separated list enclosed by square brackets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be more clear that the user can either specify the number of steps or a list of constraints. Something like: "Instead of a numeric number of steps, step constraints may be specified as a comma-separated list enclosed in square brackets."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Please manually test it with the musical chairs model before merging; that model is more complex than RCP and is useful for exposing potential bugs.
A list of constraints can now be specified alongside the
step
command, enabling the user to specify paths of execution. The length of the list represents the number of transitions, and the i-th element of the list is the constraint applied to the i-th transition.If an empty string is specified as a constraint at a particular index, no constraint will be applied to the corresponding transition.
This functionality is implemented by creating an auxiliary predicate for each constraint. After these predicates have been created, a master
path
predicate is generated, containing a conjunction of the auxiliary predicates. Finally, the run command callspath[first]
to apply the master predicate beginning at the first state.Usage example:
Closes #17.