private void learnAutomata() {
		
		String counterexample = "";
		Automata<String> guessedAutomata = null;
		
		// While the guessed automata we have does not equal the
		// 'secret' (to be learned) automata held by the teacher
		while (!counterexample.equals("Confirm")) {
			
			printTable();
			
			String closed = checkForTableClosedness();
			
			while (closed != "true") {
				
				System.out.println("Table is not closed.");
				
				// If the table is not closed, find the thing that is causing it not to be,
				// and move it to the top of the table
				topTable.add(getRowByLeftState(closed, "bottom"));
				bottomTable.remove(bottomOfTableRow.indexOf(closed));
				topOfTableRow.add(bottomOfTableRow.remove(bottomOfTableRow.indexOf(closed)));
				
				// Add successors as necessary
				updateSuccessors();
				
				closed = checkForTableClosedness();
				
				printTable();
			
			}
			
			System.out.println("Table is closed.");
			
			String consistent = checkForTableConsistency();
			
			while (consistent != "true") {
				
				System.out.println("Table is not consistent.");
				
				columns.add(consistent);
				
				updateTableMembership();
				
				consistent = checkForTableConsistency();
				
				printTable();
				
			}
			
			System.out.println("Table is consistent.\n");

			System.out.println("Converting table to FSA.");
			
			guessedAutomata = createAutomataFromTable();
			
			counterexample = teacher.checkConjecture(guessedAutomata);
			
			if (counterexample.equals("Confirm")) break;
			
			System.out.println("Incorporating " + counterexample + " and prefixes in top of table. \n");
			
			for (int i = 1; i <= counterexample.length(); i++) {
				
				String prefix = counterexample.substring(0, i);
				
				if (!topOfTableRow.contains(prefix)) {
					
					topOfTableRow.add(prefix);
					
				}
				
			}
			
			System.out.println("Adding counterexamples successors. \n");
			
			updateSuccessors();
			
			System.out.println("Updating membership queries. \n");
			
			updateTableMembership();
			
		}
		
		System.out.println("Automata Learnt.\n");
		
		System.out.println(guessedAutomata);
		
		printTable();
		
	}