src/creator/Rabinizer.java
private static HashMap<String, ArrayList<String>> secondSubformulas(String filename) {
		HashMap<String, ArrayList<String>> result = new HashMap<String, ArrayList<String>>();
		String token;
		
		try (Scanner sc = new Scanner(new File("benchmarks/rabinizer/"+filename+".hoa"))) {
			do {
				token = sc.nextLine();
				if (token.startsWith("State: ")) {
					
					int start = 2;
					while (token.charAt(start-2) != ':' || token.charAt(start-1) != ':') start++;
					assert(token.charAt(start) == '{');
					int end = start-1;
					int brackets = 0;
					
					do {
						end++;
						
						if (token.charAt(end) == '{') brackets++;
						if (token.charAt(end) == '}') brackets--;
						
					} while (token.charAt(end) != '}' || brackets > 0);
					end++;
					
					token = token.substring(start, end);
					
					// have my token
					
					start = 0;
					brackets = 0;
					while (start < token.length()) {
						if (token.charAt(start) == 'G') {
							int gcandstart = start;
							while (token.charAt(start) != '=') start++;
							int gcandend = start;
							String gcand = token.substring(gcandstart, gcandend);
							
							if (!result.containsKey(gcand))
								result.put(gcand, new ArrayList<String>());
							
							// get gtoken
							assert(token.charAt(start+1) == '{');
							end = start; start++;
							brackets = 0;
							do {
								end++;
								if (token.charAt(end) == '{') brackets++;
								if (token.charAt(end) == '}') brackets--;
							} while (brackets > 0 || token.charAt(end) != '}');
							end++;
							
							String gtoken = token.substring(start, end);
							int gtokenend = end;
							
							
							// find formulae in gtoken, add into vector associated with gcand
							boolean stop;
							assert(gtoken.charAt(0) == '{' && gtoken.charAt(gtoken.length()-1) == '}');
							start = 1;
							do {
								end = start;
								while (gtoken.charAt(end) != '=') end++;
								
								String cand = gtoken.substring(start, end);
								boolean there = false;
								for (int i=0; i<result.get(gcand).size(); i++)
									if (result.get(gcand).get(i).equals(cand)) {
										there = true;
										break;
									}
								if (!there)
									result.get(gcand).add(cand);
								
								stop = true;
								for (int i=end; i<gtoken.length(); i++)
									if (gtoken.charAt(i) == ',') {
										stop = false;
										assert(gtoken.charAt(i+1) == ' ');
										start = i+2;
										break;
									}
							} while (!stop);
							
							start = gtokenend;
						} else start++;
					}
				}
				
			} while (!token.startsWith("--END--"));
		} catch (Exception e) {
    		//e.printStackTrace();
    		return null;
		}
		
		return result;
	}
/**
	 * State-information encoding: subformulas in second part
	 * @param filename	Name of the parity automaton file (filename.hoa)
	 * @return			State-information
	 */
State-information encoding: subformulas in second part
@param filename      Name of the parity automaton file (filename.hoa)
@return                      State-information
State - information encoding : subformulas in second part @param filename Name of the parity automaton file ( filename . hoa ) @return State - information
private static HashMap<String, ArrayList<String>> secondSubformulas(String filename) {
		HashMap<String, ArrayList<String>> result = new HashMap<String, ArrayList<String>>();
		String token;
		try (Scanner sc = new Scanner(new File("benchmarks/rabinizer/"+filename+".hoa"))) {
			do {
				token = sc.nextLine();
				if (token.startsWith("State: ")) {
					int start = 2;
					while (token.charAt(start-2) != ':' || token.charAt(start-1) != ':') start++;
					assert(token.charAt(start) == '{');
					int end = start-1;
					int brackets = 0;
					do {
						end++;
						if (token.charAt(end) == '{') brackets++;
						if (token.charAt(end) == '}') brackets--;
					} while (token.charAt(end) != '}' || brackets > 0);
					end++;
					token = token.substring(start, end);
					start = 0;
					brackets = 0;
					while (start < token.length()) {
						if (token.charAt(start) == 'G') {
							int gcandstart = start;
							while (token.charAt(start) != '=') start++;
							int gcandend = start;
							String gcand = token.substring(gcandstart, gcandend);
							if (!result.containsKey(gcand))
								result.put(gcand, new ArrayList<String>());
							assert(token.charAt(start+1) == '{');
							end = start; start++;
							brackets = 0;
							do {
								end++;
								if (token.charAt(end) == '{') brackets++;
								if (token.charAt(end) == '}') brackets--;
							} while (brackets > 0 || token.charAt(end) != '}');
							end++;
							String gtoken = token.substring(start, end);
							int gtokenend = end;
							boolean stop;
							assert(gtoken.charAt(0) == '{' && gtoken.charAt(gtoken.length()-1) == '}');
							start = 1;
							do {
								end = start;
								while (gtoken.charAt(end) != '=') end++;
								String cand = gtoken.substring(start, end);
								boolean there = false;
								for (int i=0; i<result.get(gcand).size(); i++)
									if (result.get(gcand).get(i).equals(cand)) {
										there = true;
										break;
									}
								if (!there)
									result.get(gcand).add(cand);
								stop = true;
								for (int i=end; i<gtoken.length(); i++)
									if (gtoken.charAt(i) == ',') {
										stop = false;
										assert(gtoken.charAt(i+1) == ' ');
										start = i+2;
										break;
									}
							} while (!stop);
							start = gtokenend;
						} else start++;
					}
				}
			} while (!token.startsWith("--END--"));
		} catch (Exception e) {
    		return null;
		}
		return result;
	}
private static HashMap < String , ArrayList < String > > secondSubformulas ( String filename ) { HashMap < String , ArrayList < String > > result = new HashMap < String , ArrayList < String > > ( ) ; String token ; try ( Scanner sc = new Scanner ( new File ( "benchmarks/rabinizer/" + filename + ".hoa" ) ) ) { do { token = sc . nextLine ( ) ; if ( token . startsWith ( "State: " ) ) { int start = 2 ; while ( token . charAt ( start - 2 ) != ':' || token . charAt ( start - 1 ) != ':' ) start ++ ; assert ( token . charAt ( start ) == '{' ) ; int end = start - 1 ; int brackets = 0 ; do { end ++ ; if ( token . charAt ( end ) == '{' ) brackets ++ ; if ( token . charAt ( end ) == '}' ) brackets -- ; } while ( token . charAt ( end ) != '}' || brackets > 0 ) ; end ++ ; token = token . substring ( start , end ) ; start = 0 ; brackets = 0 ; while ( start < token . length ( ) ) { if ( token . charAt ( start ) == 'G' ) { int gcandstart = start ; while ( token . charAt ( start ) != '=' ) start ++ ; int gcandend = start ; String gcand = token . substring ( gcandstart , gcandend ) ; if ( ! result . containsKey ( gcand ) ) result . put ( gcand , new ArrayList < String > ( ) ) ; assert ( token . charAt ( start + 1 ) == '{' ) ; end = start ; start ++ ; brackets = 0 ; do { end ++ ; if ( token . charAt ( end ) == '{' ) brackets ++ ; if ( token . charAt ( end ) == '}' ) brackets -- ; } while ( brackets > 0 || token . charAt ( end ) != '}' ) ; end ++ ; String gtoken = token . substring ( start , end ) ; int gtokenend = end ; boolean stop ; assert ( gtoken . charAt ( 0 ) == '{' && gtoken . charAt ( gtoken . length ( ) - 1 ) == '}' ) ; start = 1 ; do { end = start ; while ( gtoken . charAt ( end ) != '=' ) end ++ ; String cand = gtoken . substring ( start , end ) ; boolean there = false ; for ( int i = 0 ; i < result . get ( gcand ) . size ( ) ; i ++ ) if ( result . get ( gcand ) . get ( i ) . equals ( cand ) ) { there = true ; break ; } if ( ! there ) result . get ( gcand ) . add ( cand ) ; stop = true ; for ( int i = end ; i < gtoken . length ( ) ; i ++ ) if ( gtoken . charAt ( i ) == ',' ) { stop = false ; assert ( gtoken . charAt ( i + 1 ) == ' ' ) ; start = i + 2 ; break ; } } while ( ! stop ) ; start = gtokenend ; } else start ++ ; } } } while ( ! token . startsWith ( "--END--" ) ) ; } catch ( Exception e ) { return null ; } return result ; }
State-information encoding: subformulas in second part
 @param filename      Name of the parity automaton file (filename.hoa)
 @return                      State-information
State - information encoding : subformulas in second part @param filename Name of the parity automaton file ( filename . hoa ) @return State - information
// have my token // get gtoken // find formulae in gtoken, add into vector associated with gcand //e.printStackTrace();