question: public static Automaton determinizeSimple ( Automaton a , Set < Integer > initialset ) { if ( a . getNumStates ( ) == 0 ) { return a ; } int [ ] points = a . getStartPoints ( ) ; Map < Set < Integer > , Set < Integer > > sets = new HashMap < > ( ) ; LinkedList < Set < Integer > > worklist = new LinkedList < > ( ) ; Map < Set < Integer > , Integer > newstate = new HashMap < > ( ) ; sets . put ( initialset , initialset ) ; worklist . add ( initialset ) ; Automaton . Builder result = new Automaton . Builder ( ) ; result . createState ( ) ; newstate . put ( initialset , 0 ) ; Transition t = new Transition ( ) ; while ( worklist . size ( ) > 0 ) { Set < Integer > s = worklist . removeFirst ( ) ; int r = newstate . get ( s ) ; for ( int q : s ) { if ( a . isAccept ( q ) ) { result . setAccept ( r , true ) ; break ; } } for ( int n = 0 ; n < points . length ; n ++ ) { Set < Integer > p = new HashSet < > ( ) ; for ( int q : s ) { int count = a . initTransition ( q , t ) ; for ( int i = 0 ; i < count ; i ++ ) { a . getNextTransition ( t ) ; if ( t . min <= points [ n ] && points [ n ] <= t . max ) { p . add ( t . dest ) ; } } } if ( ! sets . containsKey ( p ) ) { sets . put ( p , p ) ; worklist . add ( p ) ; newstate . put ( p , result . createState ( ) ) ; } int q = newstate . get ( p ) ; int min = points [ n ] ; int max ; if ( n + 1 < points . length ) { max = points [ n + 1 ] - 1 ; } else { max = Character . MAX_CODE_POINT ; } result . addTransition ( r , q , min , max ) ; } } return Operations . removeDeadStates ( result . finish ( ) ) ; }
target:  Simple, original brics implementation of determinize() Determinizes the given automaton using the given set of initial states. 