-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added ch. 8 bubblesort exercise & ch. 9 exercises. #19
base: main
Are you sure you want to change the base?
Conversation
I've also added the exercises from chapter 9. About these, I have some questions/notes:
|
CTLSPEC !EF goal | ||
CTLSPEC EF goal | ||
|
||
-- how come they both are true? |
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.
24h in, nuXmv is still playing sudoku |
I finally found time to check them. Sorry for the delayed answer! I'll split my answer into several comments, one for exercise. The bubblesort is perfect: I love the encoding, in particular how you decided to manage the array assignment after each update. For the sake of practice, you can also try to do that in constraint style, since the array assignments are usually easier to encode using TRANS conditions. This was a pleasant exception, and I prefer your option :) |
Nothing to add about hanoi5, it also work fine |
Regarding the ferryman exercise: The ferryman can bring TWO passengers into the boat, meaning him + two of the creatures (it could be a bit misleading). If you only could take one single creature, then independently from the first move you would not be able to move correctly, since there would be at least one creature eating another one (e.g. if I move the caterpillar, then the fox can eat the chicken; the same if I move the cabbage). Using INVAR to encode them you create a system that can generate an initial state, but with no transitions. When this happens, verification of LTL properties could be messy: remember, the trace for LTLSPEC (and the same for CTLSPEC) is infinite, but if I have no transition, how can I generate it? Consequently, it returns TRUE since it cannot generate that infinite tracking contradicting it. |
Lastly, regarding sudoku, the encoding is a bit confusing. If you see it is running for long time, you can try to simulate it using bounded model checking and see how it behaves. In particular, I noticed that it stops at step 1 setting every variable to 1, definitely not the behavior we are expecting! |
No description provided.