private static CompactDFA < Character > constructSUL ( ) { // input alphabet contains characters 'a'..'b' Alphabet < Character > sigma = Alphabets . characters ( ' ' , ' ' ) ; // @formatter:off // create automaton return AutomatonBuilders . newDFA ( sigma ) . withInitial ( "q0" ) . from ( "q0" ) . on ( ' ' ) . to ( "q1" ) . on ( ' ' ) . to ( "q2" ) . from ( "q1" ) . on ( ' ' ) . to ( "q0" ) . on ( ' ' ) . to ( "q3" ) . from ( "q2" ) . on ( ' ' ) . to ( "q3" ) . on ( ' ' ) . to ( "q0" ) . from ( "q3" ) . on ( ' ' ) . to ( "q2" ) . on ( ' ' ) . to ( "q1" ) . withAccepting ( "q0" ) . create ( ) ; // @formatter:on }
creates example from Angluin s seminal paper .