2-layered Cache specification in Quint #1548
Replies: 1 comment 10 replies
-
| Hi! Thanks for sharing. If at some point you want to open a PR adding this to our Perhaps the most important feedback I have is that you can't use action sendRequest = all { nondet tpe = Set("R", "W").oneOf() nondet key = Set("a", "b", "c").oneOf() nondet value = Set("john", "tom", "carl", "alice", "rick").oneOf() pure val req = if (tpe == "R") { {tpe: tpe, key: key, value: ""} } else { {tpe: tpe, key: key, value: value} } requests' = requests.append(req), responses' = responses, history' = history, }There's one small issue in your You can fix it by simply replacing action init = { pure val startingClock = 1 all { requests' = [], responses' = [], historyClock' = startingClock, history' = [], layer1' = Map("a" -> {value: "1", expire: startingClock + DefaultExpireDuration}), layer2' = Map("a" -> {value: "1", expire: startingClock + DefaultExpireDuration}), } } After these two fixes, I'm able to run your spec on the simulator: It reports that the invariant holds :D I'll leave it to you to run it yourself and see if the traces match your expectations - I haven't gotten two far in revieweing the behavior itself for now. Let me know if you want assistance with anything else! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone.
After some time getting to know Quint. I have done an exercise of designing a 2-layered Cache with the following behaviors:
Correctness:
TODO ideas:
All feedbacks are welcome!
Ok, without further ado. Below is the specification:
Beta Was this translation helpful? Give feedback.
All reactions