grub-fork/csp/sync.csp

12 lines
418 B
Text
Raw Normal View History

2015-08-13 22:25:18 +03:00
N = 3
channel input, up, save:{0..N-1}
2015-08-13 21:58:03 +03:00
2015-08-13 22:25:18 +03:00
apply(state, patch) = (state + patch) % N
diff(state1, state2) = (state2 - state1) % N
CLIENT(state, shadow) = input?new_state -> up!diff(shadow, new_state) -> CLIENT(new_state, shadow)
SERVER(state, shadow) =
up?patch -> save!apply(state, patch) -> SERVER(apply(state, patch), apply(shadow, patch))
SYSTEM = CLIENT(0, 0) ||| SERVER(0, 0)
2015-08-13 21:58:03 +03:00
assert SYSTEM :[deadlock free [F]]