class StopVrijgave:
    """Logisch model van een onafhankelijke, stopdominante vergrendeling."""
    def __init__(self):
        self.vergrendeld, self.vorig_reset = True, False

    def stap(self, stop, voeding, gezond, reset, verzoek_uit, contact_uit):
        flank = reset and not self.vorig_reset
        self.vorig_reset = reset
        if stop or not voeding or not gezond:
            self.vergrendeld = True
        elif flank and verzoek_uit and contact_uit:
            self.vergrendeld = False
        return voeding and gezond and not stop and not self.vergrendeld
