def NewSetState(self, kind, InSet): # return existing state if one is present that matches the set LastState= self.maxState # skip state 0 (successful final state)??? for State in range(1,LastState+1): MarkSet = self.States[State][1] if kjSet.Same(InSet,MarkSet): return State # nonlocal #endfor # if not exited then allocate a new state LastState = LastState + 1 self.States[LastState] = [ kind , InSet ] self.maxState = LastState return LastState
def NewSetState(self, kind, InSet): ''' add an set-marked state to self if not present uses self.States[s][1] as the set marking the state s only used by Eclosure above ''' # return existing state if one is present that matches the set LastState= self.maxState # skip state 0 (successful final state)??? for State in range(1,LastState+1): MarkSet = self.States[State][1] if kjSet.Same(InSet,MarkSet): return State # nonlocal #endfor # if not exited then allocate a new state LastState = LastState + 1 self.States[LastState] = [ kind , InSet ] self.maxState = LastState return LastState