11 12 13 14 15 16 17 18 Definition Clock_merge (n1 n2 : option nat) := match n1, n2 with | None, None => None | Some n, None => Some n | None, Some n => Some n | Some n1', Some n2' => Some (max n1' n2') end. Definition Clock_compare (n1 n2 : option nat) := match n1, n2 with | None, None => None | Some n, None => Some false | None, Some n => Some true | Some n1', Some n2' => Some (leb n1' n2') end. Tuesday, May 14, 13
11 12 13 14 15 16 17 18 Definition G_Counter_incr actor clocks := match ClockMap.find actor clocks with | None => ClockMap.add actor 1 clocks | Some count => (ClockMap.add actor (S count) clocks) end. Tuesday, May 14, 13