# -*- generated by 1.0.2 -*-
import da
PatternExpr_382 = da.pat.TuplePattern([da.pat.ConstantPattern('done')])
PatternExpr_402 = da.pat.TuplePattern([da.pat.ConstantPattern('request'), da.pat.FreePattern('p')])
PatternExpr_419 = da.pat.TuplePattern([da.pat.ConstantPattern('decision'), da.pat.FreePattern('s'), da.pat.FreePattern('p')])
PatternExpr_387 = da.pat.TuplePattern([da.pat.FreePattern(None), da.pat.TuplePattern([da.pat.FreePattern(None), da.pat.FreePattern(None), da.pat.FreePattern(None)]), da.pat.TuplePattern([da.pat.ConstantPattern('done')])])
PatternExpr_499 = da.pat.TuplePattern([da.pat.ConstantPattern('done')])
PatternExpr_519 = da.pat.FreePattern('m')
PatternExpr_537 = da.pat.TuplePattern([da.pat.ConstantPattern('p1a'), da.pat.FreePattern(None), da.pat.FreePattern('b')])
PatternExpr_561 = da.pat.TuplePattern([da.pat.ConstantPattern('p2a'), da.pat.FreePattern(None), da.pat.FreePattern('b'), da.pat.FreePattern(None), da.pat.FreePattern(None)])
PatternExpr_592 = da.pat.TuplePattern([da.pat.ConstantPattern('p1a'), da.pat.FreePattern('leader_scout'), da.pat.FreePattern('b')])
PatternExpr_615 = da.pat.TuplePattern([da.pat.ConstantPattern('p2a'), da.pat.FreePattern('leader_commander'), da.pat.FreePattern('b'), da.pat.FreePattern('s'), da.pat.FreePattern('p')])
PatternExpr_504 = da.pat.TuplePattern([da.pat.FreePattern(None), da.pat.TuplePattern([da.pat.FreePattern(None), da.pat.FreePattern(None), da.pat.FreePattern(None)]), da.pat.TuplePattern([da.pat.ConstantPattern('done')])])
PatternExpr_689 = da.pat.TuplePattern([da.pat.ConstantPattern('p2b'), da.pat.FreePattern('a'), da.pat.BoundPattern('_BoundPattern694_')])
PatternExpr_724 = da.pat.TuplePattern([da.pat.ConstantPattern('p2b'), da.pat.FreePattern(None), da.pat.FreePattern('b1')])
PatternExpr_796 = da.pat.TuplePattern([da.pat.ConstantPattern('p1b'), da.pat.FreePattern('a'), da.pat.BoundPattern('_BoundPattern801_'), da.pat.FreePattern(None)])
PatternExpr_828 = da.pat.TuplePattern([da.pat.ConstantPattern('p1b'), da.pat.FreePattern(None), da.pat.BoundPattern('_BoundPattern832_'), da.pat.FreePattern('r')])
PatternExpr_866 = da.pat.TuplePattern([da.pat.ConstantPattern('p1b'), da.pat.FreePattern('a'), da.pat.FreePattern('b1'), da.pat.FreePattern(None)])
PatternExpr_956 = da.pat.TuplePattern([da.pat.ConstantPattern('done')])
PatternExpr_976 = da.pat.TuplePattern([da.pat.ConstantPattern('propose'), da.pat.FreePattern('s'), da.pat.FreePattern('p')])
PatternExpr_1028 = da.pat.TuplePattern([da.pat.ConstantPattern('adopted'), da.pat.FreePattern('ballot_num'), da.pat.FreePattern('pvals')])
PatternExpr_1080 = da.pat.TuplePattern([da.pat.ConstantPattern('preempted'), da.pat.TuplePattern([da.pat.FreePattern('r1'), da.pat.FreePattern('leader1')])])
PatternExpr_961 = da.pat.TuplePattern([da.pat.FreePattern(None), da.pat.TuplePattern([da.pat.FreePattern(None), da.pat.FreePattern(None), da.pat.FreePattern(None)]), da.pat.TuplePattern([da.pat.ConstantPattern('done')])])
PatternExpr_1269 = da.pat.TuplePattern([da.pat.ConstantPattern('response'), da.pat.FreePattern('cid'), da.pat.FreePattern('result')])
PatternExpr_1470 = da.pat.TuplePattern([da.pat.ConstantPattern('done')])
PatternExpr_1475 = da.pat.BoundPattern('_BoundPattern1476_')
PatternExpr_1477 = da.pat.TuplePattern([da.pat.FreePattern(None), da.pat.TuplePattern([da.pat.FreePattern(None), da.pat.FreePattern(None), da.pat.BoundPattern('_BoundPattern1483_')]), da.pat.TuplePattern([da.pat.ConstantPattern('done')])])
_config_object = {}
import sys
import time
import random
NOPS = 10

def operation(i):
    return (lambda state: ((state + [i]), ['result', i, 'on', state]))
operations = {i: operation(i) for i in range(NOPS)}

class Replica(da.DistProcess):

    def __init__(self, procimpl, props):
        super().__init__(procimpl, props)
        self._ReplicaReceivedEvent_0 = []
        self._events.extend([da.pat.EventPattern(da.pat.ReceivedEvent, '_ReplicaReceivedEvent_0', PatternExpr_382, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[]), da.pat.EventPattern(da.pat.ReceivedEvent, '_ReplicaReceivedEvent_1', PatternExpr_402, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Replica_handler_401]), da.pat.EventPattern(da.pat.ReceivedEvent, '_ReplicaReceivedEvent_2', PatternExpr_419, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Replica_handler_418])])

    def setup(self, leaders, initial_state, **rest_1497):
        super().setup(leaders=leaders, initial_state=initial_state, **rest_1497)
        self._state.leaders = leaders
        self._state.initial_state = initial_state
        self._state.state = self._state.initial_state
        self._state.slot_num = 1
        self._state.proposals = set()
        self._state.decisions = set()

    def run(self):
        self.debug('### start')
        super()._label('_st_label_379', block=False)
        _st_label_379 = 0
        while (_st_label_379 == 0):
            _st_label_379 += 1
            if PatternExpr_387.match_iter(self._ReplicaReceivedEvent_0, SELF_ID=self._id):
                _st_label_379 += 1
            else:
                super()._label('_st_label_379', block=True)
                _st_label_379 -= 1
        self.output('terminating')

    def propose(self, p):

        def ExistentialOpExpr_243():
            for (_, _BoundPattern247_) in self._state.decisions:
                if (_BoundPattern247_ == p):
                    if True:
                        return True
            return False
        if (not ExistentialOpExpr_243()):
            maxs = max(({s for (s, _) in (self._state.proposals | self._state.decisions)} or {0}))

            def ExistentialOpExpr_285(s):
                for (_BoundPattern288_, _) in (self._state.proposals | self._state.decisions):
                    if (_BoundPattern288_ == s):
                        if True:
                            return True
                return False
            s1 = min({s for s in range(1, ((maxs + 1) + 1)) if (not ExistentialOpExpr_285(s=s))})
            self._state.proposals.add((s1, p))
            self.send(('propose', s1, p), self._state.leaders)

    def perform(self, p):
        self.debug('### perform', p)
        (client, cid, op) = p
        s = None

        def ExistentialOpExpr_328():
            nonlocal s
            for (s, _BoundPattern333_) in self._state.decisions:
                if (_BoundPattern333_ == p):
                    if (s < self._state.slot_num):
                        return True
            return False
        if ExistentialOpExpr_328():
            self._state.slot_num += 1
        else:
            self.debug('===', self._state.state, op)
            (next, result) = operations[op](self._state.state)
            self.debug('===', next, result)
            self._state.state = next
            self._state.slot_num += 1
            self.send(('response', cid, result), client)

    def _Replica_handler_401(self, p):
        self.debug('### request', p)
        self.propose(p)
    _Replica_handler_401._labels = None
    _Replica_handler_401._notlabels = None

    def _Replica_handler_418(self, s, p):
        self.debug('### decision', s, p)
        self._state.decisions.add((s, p))
        p1 = None

        def ExistentialOpExpr_441():
            nonlocal p1
            for (_BoundPattern444_, p1) in self._state.decisions:
                if (_BoundPattern444_ == self._state.slot_num):
                    if True:
                        return True
            return False
        while ExistentialOpExpr_441():
            p2 = None

            def ExistentialOpExpr_451():
                nonlocal p2
                for (_BoundPattern454_, p2) in self._state.proposals:
                    if (_BoundPattern454_ == self._state.slot_num):
                        if (not (p2 == p1)):
                            return True
                return False
            if ExistentialOpExpr_451():
                self.propose(p2)
            self.perform(p1)
    _Replica_handler_418._labels = None
    _Replica_handler_418._notlabels = None

class Acceptor(da.DistProcess):

    def __init__(self, procimpl, props):
        super().__init__(procimpl, props)
        self._AcceptorReceivedEvent_0 = []
        self._AcceptorReceivedEvent_2 = []
        self._AcceptorReceivedEvent_3 = []
        self._events.extend([da.pat.EventPattern(da.pat.ReceivedEvent, '_AcceptorReceivedEvent_0', PatternExpr_499, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[]), da.pat.EventPattern(da.pat.ReceivedEvent, '_AcceptorReceivedEvent_1', PatternExpr_519, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Acceptor_handler_518]), da.pat.EventPattern(da.pat.ReceivedEvent, '_AcceptorReceivedEvent_2', PatternExpr_537, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[]), da.pat.EventPattern(da.pat.ReceivedEvent, '_AcceptorReceivedEvent_3', PatternExpr_561, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[]), da.pat.EventPattern(da.pat.ReceivedEvent, '_AcceptorReceivedEvent_4', PatternExpr_592, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Acceptor_handler_591]), da.pat.EventPattern(da.pat.ReceivedEvent, '_AcceptorReceivedEvent_5', PatternExpr_615, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Acceptor_handler_614])])

    def setup(self, **rest_1497):
        super().setup(**rest_1497)
        self._state.ballot_num = None
        self._state.accepted = set()

    def run(self):
        self.debug('### start')
        super()._label('_st_label_496', block=False)
        _st_label_496 = 0
        while (_st_label_496 == 0):
            _st_label_496 += 1
            if PatternExpr_504.match_iter(self._AcceptorReceivedEvent_0, SELF_ID=self._id):
                _st_label_496 += 1
            else:
                super()._label('_st_label_496', block=True)
                _st_label_496 -= 1
        self.output('terminating')

    def _Acceptor_handler_518(self, m):
        BOTTOM = ((- 1), (- 1))
        self._state.ballot_num = max((({b for (_, _, (_ConstantPattern553_, _, b)) in self._AcceptorReceivedEvent_2 if (_ConstantPattern553_ == 'p1a')} | {b for (_, _, (_ConstantPattern579_, _, b, _, _)) in self._AcceptorReceivedEvent_3 if (_ConstantPattern579_ == 'p2a')}) or {BOTTOM}))
    _Acceptor_handler_518._labels = None
    _Acceptor_handler_518._notlabels = None

    def _Acceptor_handler_591(self, leader_scout, b):
        self.debug('### p1a', leader_scout, b)
        self.send(('p1b', self._id, self._state.ballot_num, self._state.accepted), leader_scout)
    _Acceptor_handler_591._labels = None
    _Acceptor_handler_591._notlabels = None

    def _Acceptor_handler_614(self, leader_commander, b, s, p):
        self.debug('### p2a', leader_commander, b, s, p)
        if (b == self._state.ballot_num):
            self._state.accepted.add((b, s, p))
        self.send(('p2b', self._id, self._state.ballot_num), leader_commander)
    _Acceptor_handler_614._labels = None
    _Acceptor_handler_614._notlabels = None

class Commander(da.DistProcess):

    def __init__(self, procimpl, props):
        super().__init__(procimpl, props)
        self._CommanderReceivedEvent_0 = []
        self._CommanderReceivedEvent_1 = []
        self._events.extend([da.pat.EventPattern(da.pat.ReceivedEvent, '_CommanderReceivedEvent_0', PatternExpr_689, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[]), da.pat.EventPattern(da.pat.ReceivedEvent, '_CommanderReceivedEvent_1', PatternExpr_724, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[])])

    def setup(self, leader, acceptors, replicas, b, s, p, **rest_1497):
        super().setup(leader=leader, acceptors=acceptors, replicas=replicas, b=b, s=s, p=p, **rest_1497)
        self._state.leader = leader
        self._state.acceptors = acceptors
        self._state.replicas = replicas
        self._state.b = b
        self._state.s = s
        self._state.p = p
        pass

    def run(self):
        self.debug('### start')
        self.send(('p2a', self._id, self._state.b, self._state.s, self._state.p), self._state.acceptors)
        super()._label('_st_label_684', block=False)
        b1 = None

        def ExistentialOpExpr_722():
            nonlocal b1
            for (_, _, (_ConstantPattern740_, _, b1)) in self._CommanderReceivedEvent_1:
                if (_ConstantPattern740_ == 'p2b'):
                    if (not (b1 == self._state.b)):
                        return True
            return False
        _st_label_684 = 0
        while (_st_label_684 == 0):
            _st_label_684 += 1
            if (len({a for (_, _, (_ConstantPattern705_, a, _BoundPattern708_)) in self._CommanderReceivedEvent_0 if (_ConstantPattern705_ == 'p2b') if (_BoundPattern708_ == self._state.b)}) > (len(self._state.acceptors) / 2)):
                self.send(('decision', self._state.s, self._state.p), self._state.replicas)
                _st_label_684 += 1
            elif ExistentialOpExpr_722():
                self.send(('preempted', b1), self._state.leader)
                _st_label_684 += 1
            else:
                super()._label('_st_label_684', block=True)
                _st_label_684 -= 1

class Scout(da.DistProcess):

    def __init__(self, procimpl, props):
        super().__init__(procimpl, props)
        self._ScoutReceivedEvent_0 = []
        self._ScoutReceivedEvent_1 = []
        self._ScoutReceivedEvent_2 = []
        self._events.extend([da.pat.EventPattern(da.pat.ReceivedEvent, '_ScoutReceivedEvent_0', PatternExpr_796, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[]), da.pat.EventPattern(da.pat.ReceivedEvent, '_ScoutReceivedEvent_1', PatternExpr_828, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[]), da.pat.EventPattern(da.pat.ReceivedEvent, '_ScoutReceivedEvent_2', PatternExpr_866, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[])])

    def setup(self, leader, acceptors, b, **rest_1497):
        super().setup(leader=leader, acceptors=acceptors, b=b, **rest_1497)
        self._state.leader = leader
        self._state.acceptors = acceptors
        self._state.b = b
        self._state.pvalues = set()

    def run(self):
        self.debug('### start')
        time.sleep(random.random())
        self.send(('p1a', self._id, self._state.b), self._state.acceptors)
        super()._label('_st_label_791', block=False)
        b1 = a = None

        def ExistentialOpExpr_864():
            nonlocal b1, a
            for (_, _, (_ConstantPattern884_, a, b1, _)) in self._ScoutReceivedEvent_2:
                if (_ConstantPattern884_ == 'p1b'):
                    if (not (b1 == self._state.b)):
                        return True
            return False
        _st_label_791 = 0
        while (_st_label_791 == 0):
            _st_label_791 += 1
            if (len({a for (_, _, (_ConstantPattern813_, a, _BoundPattern816_, _)) in self._ScoutReceivedEvent_0 if (_ConstantPattern813_ == 'p1b') if (_BoundPattern816_ == self._state.b)}) > (len(self._state.acceptors) / 2)):
                self._state.pvalues = {v for (_, _, (_ConstantPattern845_, _, _BoundPattern848_, r)) in self._ScoutReceivedEvent_1 if (_ConstantPattern845_ == 'p1b') if (_BoundPattern848_ == self._state.b) for v in r}
                self.send(('adopted', self._state.b, self._state.pvalues), self._state.leader)
                _st_label_791 += 1
            elif ExistentialOpExpr_864():
                self.send(('preempted', b1), self._state.leader)
                _st_label_791 += 1
            else:
                super()._label('_st_label_791', block=True)
                _st_label_791 -= 1

class Leader(da.DistProcess):

    def __init__(self, procimpl, props):
        super().__init__(procimpl, props)
        self._LeaderReceivedEvent_0 = []
        self._events.extend([da.pat.EventPattern(da.pat.ReceivedEvent, '_LeaderReceivedEvent_0', PatternExpr_956, sources=None, destinations=None, timestamps=None, record_history=True, handlers=[]), da.pat.EventPattern(da.pat.ReceivedEvent, '_LeaderReceivedEvent_1', PatternExpr_976, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Leader_handler_975]), da.pat.EventPattern(da.pat.ReceivedEvent, '_LeaderReceivedEvent_2', PatternExpr_1028, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Leader_handler_1027]), da.pat.EventPattern(da.pat.ReceivedEvent, '_LeaderReceivedEvent_3', PatternExpr_1080, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Leader_handler_1079])])

    def setup(self, acceptors, replicas, **rest_1497):
        super().setup(acceptors=acceptors, replicas=replicas, **rest_1497)
        self._state.acceptors = acceptors
        self._state.replicas = replicas
        self._state.ballot_num = (0, self._id)
        self._state.active = False
        self._state.proposals = set()

    def run(self):
        self.debug('### start')
        sub = self.new(Scout, (self._id, self._state.acceptors, self._state.ballot_num), method='thread', daemon=True)
        self._start(sub)
        super()._label('_st_label_953', block=False)
        _st_label_953 = 0
        while (_st_label_953 == 0):
            _st_label_953 += 1
            if PatternExpr_961.match_iter(self._LeaderReceivedEvent_0, SELF_ID=self._id):
                _st_label_953 += 1
            else:
                super()._label('_st_label_953', block=True)
                _st_label_953 -= 1
        self.output('terminating')

    def circle_plus(self, x, y):

        def ExistentialOpExpr_1137(s):
            for (_BoundPattern1140_, _) in y:
                if (_BoundPattern1140_ == s):
                    if True:
                        return True
            return False
        return (y | {(s, p) for (s, p) in x if (not ExistentialOpExpr_1137(s=s))})

    def pmax(self, pvals):

        def UniversalOpExpr_1163(s, b):
            for (b1, _BoundPattern1168_, _) in pvals:
                if (_BoundPattern1168_ == s):
                    if (not (b1 <= b)):
                        return False
            return True
        return {(s, p) for (b, s, p) in pvals if UniversalOpExpr_1163(s=s, b=b)}

    def _Leader_handler_975(self, s, p):
        self.debug('### propose', s, p)

        def ExistentialOpExpr_992():
            for (_BoundPattern995_, _) in self._state.proposals:
                if (_BoundPattern995_ == s):
                    if True:
                        return True
            return False
        if (not ExistentialOpExpr_992()):
            self._state.proposals.add((s, p))
            if self._state.active:
                sub = self.new(Commander, (self._id, self._state.acceptors, self._state.replicas, self._state.ballot_num, s, p), method='thread', daemon=True)
                self._start(sub)
    _Leader_handler_975._labels = None
    _Leader_handler_975._notlabels = None

    def _Leader_handler_1027(self, ballot_num, pvals):
        self.debug('### adopted', ballot_num, pvals)
        self._state.proposals = self.circle_plus(self._state.proposals, self.pmax(pvals))
        for (s, p) in self._state.proposals:
            sub = self.new(Commander, (self._id, self._state.acceptors, self._state.replicas, ballot_num, s, p), method='thread', daemon=True)
            self._start(sub)
        self._state.active = True
    _Leader_handler_1027._labels = None
    _Leader_handler_1027._notlabels = None

    def _Leader_handler_1079(self, r1, leader1):
        if ((r1, leader1) > self._state.ballot_num):
            self._state.active = False
            self._state.ballot_num = ((r1 + 1), self._id)
            sub = self.new(Scout, (self._id, self._state.acceptors, self._state.ballot_num), method='thread', daemon=True)
            self._start(sub)
    _Leader_handler_1079._labels = None
    _Leader_handler_1079._notlabels = None

class Client(da.DistProcess):

    def __init__(self, procimpl, props):
        super().__init__(procimpl, props)
        self._events.extend([da.pat.EventPattern(da.pat.ReceivedEvent, '_ClientReceivedEvent_0', PatternExpr_1269, sources=None, destinations=None, timestamps=None, record_history=None, handlers=[self._Client_handler_1268])])

    def setup(self, replicas, nops, **rest_1497):
        super().setup(replicas=replicas, nops=nops, **rest_1497)
        self._state.replicas = replicas
        self._state.nops = nops
        self._state.cid = 0
        self._state.results = dict()
        self._state.count = dict()

    def run(self):
        for i in range(self._state.nops):
            self.send(('request', (self._id, self._state.cid, random.randint(0, (NOPS - 1)))), self._state.replicas)
            super()._label('_st_label_1232', block=False)
            _st_label_1232 = 0
            while (_st_label_1232 == 0):
                _st_label_1232 += 1
                if (self._state.cid in self._state.results):
                    _st_label_1232 += 1
                else:
                    super()._label('_st_label_1232', block=True)
                    _st_label_1232 -= 1
            else:
                if (_st_label_1232 != 2):
                    continue
            if (_st_label_1232 != 2):
                break
            self.output('received result', self._state.cid, self._state.results[self._state.cid])
            self._state.cid += 1
        super()._label('_st_label_1246', block=False)
        cid = None

        def UniversalOpExpr_1247():
            nonlocal cid
            for self._state.cid in range(self._state.nops):
                if (not (self._state.count[self._state.cid] == len(self._state.replicas))):
                    return False
            return True
        _st_label_1246 = 0
        while (_st_label_1246 == 0):
            _st_label_1246 += 1
            if UniversalOpExpr_1247():
                _st_label_1246 += 1
            else:
                super()._label('_st_label_1246', block=True)
                _st_label_1246 -= 1
        self.output('terminating')
        self.send(('done',), self.parent())

    def _Client_handler_1268(self, cid, result):
        self.debug('### response', cid, result)
        if (not (cid in self._state.results)):
            self._state.results[cid] = result
        elif (not (self._state.results[cid] == result)):
            self.error('different result', cid, result, 'than', self._state.results[cid])
        self._state.count[cid] = (1 if (not (cid in self._state.count)) else (self._state.count[cid] + 1))
    _Client_handler_1268._labels = None
    _Client_handler_1268._notlabels = None

class Node_(da.NodeProcess):

    def __init__(self, procimpl, props):
        super().__init__(procimpl, props)
        self._Node_ReceivedEvent_0 = []
        self._events.extend([da.pat.EventPattern(da.pat.ReceivedEvent, '_Node_ReceivedEvent_0', PatternExpr_1470, sources=[PatternExpr_1475], destinations=None, timestamps=None, record_history=True, handlers=[])])

    def run(self):
        nacceptors = (int(sys.argv[1]) if (len(sys.argv) > 1) else 5)
        nreplicas = (int(sys.argv[2]) if (len(sys.argv) > 2) else 4)
        nleaders = (int(sys.argv[3]) if (len(sys.argv) > 3) else 2)
        nclients = (int(sys.argv[4]) if (len(sys.argv) > 4) else 3)
        nops = (int(sys.argv[5]) if (len(sys.argv) > 5) else 3)
        acceptors = self.new(Acceptor, (), num=nacceptors)
        replicas = self.new(Replica, num=nreplicas)
        leaders = self.new(Leader, (acceptors, replicas), num=nleaders)
        initial_state = []
        self._setup(replicas, (leaders, initial_state))
        clients = self.new(Client, (replicas, nops), num=nclients)
        self._start(acceptors)
        self._start((replicas | leaders))
        self._start(clients)
        super()._label('_st_label_1461', block=False)
        c = None

        def UniversalOpExpr_1462():
            nonlocal c
            for c in clients:
                if (not PatternExpr_1477.match_iter(self._Node_ReceivedEvent_0, _BoundPattern1483_=c)):
                    return False
            return True
        _st_label_1461 = 0
        while (_st_label_1461 == 0):
            _st_label_1461 += 1
            if UniversalOpExpr_1462():
                _st_label_1461 += 1
            else:
                super()._label('_st_label_1461', block=True)
                _st_label_1461 -= 1
        self.output('All clients done.')
        self.send(('done',), ((acceptors | replicas) | leaders))
