OTS/CafeOBJ method
Test & Set (TAS) is a mutual-exclusion protocol where several concurrent processes make use of a shared lock to ensure that, at any moment of time, at most one process is in a critical section. In a nutshell, the protocol works as follows:
For TAS, we are interested in verifying the following strong mutual-exclusion property: at every moment of time, at most one process is in a critical section, in which case the lock is closed.
We formalize this property as a conjunction of two goals that are proved simultaneously.
ceq lock(S:Sys)= close if pc(S:Sys,I:X$Pid)= cs ;
ceq I:X$Pid = J:X$Pid if pc(S:Sys,I:X$Pid)= cs /\ pc(S:Sys,J:X$Pid)= cs ;
See me.maude for the full proof.