def get_minimized_dfa(self, finals):
	def markall(finals, tcv, table):
	    def psrmark(l):
		for pq in l:
		    if pq in PS:
			l1 = PS[pq]
			del PS[pq]
			if l1:
			    psrmark(l1)
	    PS = {}
	    for Q in tcv:
		for ip, p in enumerate(Q):
		    for q in Q[ip+1:]:
			if (p in finals) == (q in finals):
			    PS[(p, q)] = ()

	    for pq in PS.keys():
		p, q = pq
		dp = table[p]
		dq = table[q]
		# Now we know they contain the same symbols
		dps = []
		for a in dp:
		    dpa = dp[a]
		    dqa = dq[a]
		    if dpa is not dqa:
			dpadqa = (dpa, dqa)
			if dpadqa in PS:
			    dps.append(dpadqa)
			else:
			    dqadpa = (dqa, dpa)
			    if dqadpa in PS:
				dps.append(dqadpa)
			    else:
				l = PS[pq]
				del PS[pq]
				if l is not ():
				    psrmark(l)
				break
		else:
		    for dpadqa in dps:
			l = PS[dpadqa]
			if l is ():
			    l = [pq]
			    PS[dpadqa] = l
			else:
			    l.append(pq)
	    return PS

	def combine(QS, PQS):
	    eqs = {}
	    for Q in QS:
		for p in Q:
		    eqs[p] = [p]

	    for p, q in PQS:
		#
		# Combine to equivalence classes
		#
		# Now we know that p, q are combinable
		#
		ep = eqs[p]
		eq = eqs[q]
		if eq is not ep:
		    if len(eq) > len(ep):
			eq, ep = ep, eq
		    ep.extend(eq)
		    for q in eq:
			eqs[q] = ep

	    return eqs

	def finalize(eqs):
	    csbyid = {}		# Composite state by identity of atomic state list
	    csbyas = {}		# Composite state by atomic state

	    i = 0
	    for eq in eqs.values():
		ideq = id(eq)
		if ideq not in csbyid:
		    c = 'MS%d'%i
		    i += 1
		    csbyid[ideq] = eq[0], c
		    for s in eq:
			csbyas[s] = c

	    fsa = self.__class__(csbyas[self.start_state])
	    fsa.final_states = {}

	    for cs0, cst in csbyid.values():
		fsa.table[cst] = trans = {}
		for a, s in self.table[cs0].items():
		    trans[a] = csbyas[s]
		if finals in cs0:
		    fsa.final_states[cst] = 1
		    
	    return fsa

	if self.is_updated:
	    self.make_deterministic()
	    tctck = self._tctck = self.get_transition_classes()
	    self.is_updated = 0
	else:
	    tctck = self._tctck
	    
	tc, tck = tctck
	tcv = tc.values()
	PS = markall(finals, tcv, self.table)
	eqs = combine(tcv, PS)
	fsa = finalize(eqs)
	return fsa
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/etc/FSA.py/FiniteAutomaton.get_minimized_dfa/swapped operands of `in`