modeling resets

26 views
Skip to first unread message

Brian

unread,
May 12, 2016, 11:56:55 AM5/12/16
to tla...@googlegroups.com
I've modeled a reader process and a writer process using PlusCal, and they
communicate via some global state.

I'd like to model a reset event (such as a power failure) in which, regardless
of its current state, each process is reset back to its initial state.
Some global state would be reset as well, but some global state is persistent
and survives the reset.

I was imagining something similar to the LoseMsg process in the ABProtocol
algorithm example, but I'm not sure how to reset the other processes.

Is there an example of something like this, or any ideas on how I might achieve
it?


Thanks!
Brian

RESCH Stefan

unread,
May 12, 2016, 12:18:18 PM5/12/16
to tla...@googlegroups.com
Hello Brian,

You could add one additional reset event, which sets the generated
program counter variable pc to the state it has defined by the
also generated Init formula. So in the file below the translation
of your PlusCal code you can add something like:

reset == /\ pc = [self \in ProcSet |-> "<your first label here>"]
/\ <here the reset of part of the system state>

There you can also reset part of your global state.

Then you would have to define a new Next formula including the reset
event like this:

NNext == Next \/ reset

And use it for the new Spec:

NSpec == Init /\ [][NNext]_vars


Hope it works, but I haven't tried it.


Best regards,
Stefan
--
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+u...@googlegroups.com.
To post to this group, send email to tla...@googlegroups.com.
Visit this group at https://groups.google.com/group/tlaplus.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages