[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlaplus] Model checking double buffering
- From: Jeenu Viswambharan <jeenuv@xxxxxxxxx>
- Date: Sun, 5 Dec 2021 03:48:48 -0800 (PST)
- Ironport-data: A9a23:MyHcIqOW3fznkPjvrR2FlsFynXyQoLVcMsFnjC/WdVS9gTxw0TBUxmsWXm/XO/yCN2X2Ko1wat/ioxgPvpHSv4NqS1BcGVNFHysb85KdbTi6Bh6tZH3KdpWroHqKXqzyU/GYRCwPZiKa9kjF3oTJ9yEmjPjSHuekUYYoBwgoLeNaYHd54f5cs7Vh6mJYqYDR7zKl4bsekeWHULOW82Ic3lYv1k62gEgHUMIeF98vlgdWifhj5DcynpSOZX4VDfnZw3DQGuG4EgMmLtsvwo1V/kuBl/ssItask7K+dUxTB7CLbVTIhX1RVKyvxBNFo0Te0I5hbKtaORoR0mvW2YkhlL2htrToIestFrHIkfwZTgIbGSd1F4F5wOLsB1OD7eq55WzhVETP7MxLI3gbAqoz07lIKElB8vsXLD0CdBeen/nwy7W+IgVprpR+dJC0YNN3VnZIlGmFV57KW6vrT6TR7sJDxx8sgskIGO3EIssfcztmKhXGeRxGfFkNYK/SNs+83iy6K3sHvAvA/exv9zKGlEovi+S9JIGAIprXUZoAt1i8jWfi02TdIxg/CMa79zug5iv007eLxTeTtJk6EbS58rttgQTWyDVDVFsZUly0pfT/gUm7M++z4nc8okIGxZXePmTyJjU8Y/G5nJJAlhsVWt4VFOxjrQ/UmvaS7AGeCWwJCDVGbbTKcedeqSMCjje0cxHBXFSDc4F5jVqS8bCbqT69Iy8INXREbigBJefAy8e2u5k913ojUf46eJNYTbTJ9fXYzDeNoywziK8UkNYQka68+DgrRhrESofhFmYI2+kcYo5pAs6VqmJoi0xEJGU3Ncp9Ebs=
- Ironport-hdrordr: A9a23:8coc/q1fMDtsDhJDjQFDSwqjBIMkLtp133Aq2lEZdPUzSL39qynOpoV/6faQsl0ssR4b6Ki90da7MBThHPJOgbX5F43SOjUOwVHYVb2KjrGSoQEIeReRygc1784JGZSWY+eQMbEVt7eY3OGIeOxM/DF1m5rFuQ6n9RhQcT0=
I'm modelling two audio channels playing back with double buffering. Each channel goes through a sequence of transitions on their own, but for the purpose of double buffering, each nudges the other's playback. In the beginning, one of the channels is given a head start, which then nudges the other, and the other does the same back, and so on. Together, they are you play back all the audio blobs.
I was able to get TLC to verify some of the properties
. For others
, I get temporal property violation, reporting stuttering. I wondered if I can use this example to clear some doubts:
Right now, I've to use -deadlock to get the checks successfully run (those that TLC can). From discussions here and elsewhere, having to use -deadlock stems from the fact that my model terminates. For example, a counter example given (without -deadlock) was this:
State 5: <Complete line 43, col 3 to line 45, col 28 of module AudioChannel>
/\ nextBlob = 2
/\ channels = << [blob |-> 1, state |-> "complete", id |-> 1],
[blob |-> 0, state |-> "idle", id |-> 2] >>
This situation arose because the first channel didn't nudge
the second one, so no bootstrapping happened, and this is indeed a terminal state. But I did specify weak fairness
on all steps. Given that, shouldn't TLC have definitely taken the nudge step?
(I had noticed a mention somewhere that liveness/fairness apply only to infinite behaviors. I could potentially run the model unconstrained
, but then that never terminates!).
That brings me to my main question: I'm aware of the semantics of fairness formulae, but what exactly does fairness/liveness imply when model checking with TLC? In the presence of liveness/fairness, viz.:
- Does TLC seek out transitions eagerly that would satisfy the property?
- Or does TLC goes about its business as usual, and then check if the property is satisfied?
I ask because I had to specify weak fairness explicitly for one check
to pass. Couple of others
don't even pass--they report stuttering, as mentioned earlier. (I'll hazard that the way I've written them may be incorrect).
In general, though: why should fairness matter? Shouldn't fairness be the default as opposed to something explicitly picked out? I mean, one writes down steps with the intent that they're taken, so what additional meaning does fairness convey to the spec consumer? Like, "seriously, these steps are important, so do make sure you take them often enough"? Or, "this spec works only if you do these steps more as opposed to the rest"?
My interpretation (perhaps wrongly) has been that steps are to be taken automatically as soon as favorable conditions arise--more like an electronic circuit as opposed to an imperative program selectively checking conditional statements.
Apologies - this ended up being longer and chaotic than I originally thought. Any pointers are appreciated.
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/f1f9071d-c331-478c-a5a4-d7541d5d7e71n%40googlegroups.com.