code: func removeDeadStates(a *Automaton) *Automaton {
  	numStates := a.numStates()
  	liveSet := liveStates(a)
  
  	m := make([]int, numStates)
  
  	ans := newEmptyAutomaton()
  	// fmt.Printf("liveSet: %v numStates=%v\n", liveSet, numStates)
  	for i := 0; i < numStates; i++ {
  		if liveSet.Get(int64(i)) {
  			m[i] = ans.createState()
  			ans.setAccept(m[i], a.IsAccept(i))
  		}
  	}
  
  	t := newTransition()
  
  	for i := 0; i < numStates; i++ {
  		if liveSet.Get(int64(i)) {
  			numTransitions := a.initTransition(i, t)
  			// filter out transitions to dead states:
  			for j := 0; j < numTransitions; j++ {
  				a.nextTransition(t)
  				if liveSet.Get(int64(t.dest)) {
  					ans.addTransitionRange(m[i], m[t.dest], t.min, t.max)
  				}
  			}
  		}
  	}
  
  	ans.finishState()
  	assert(!hasDeadStates(ans))
  	return ans
  }
docs: /*
  Removes transitions to dead states (a state is "dead" if it is not
  reachable from the initial state or no accept state is reachable from
  it.)
  */