public static String[] getUnresolvedVariables(Grammar grammar) {
		String[] variables = grammar.getVariables();
		HashSet variableSet = new HashSet();
		for (int i = 0; i < variables.length; i++)
			variableSet.add(variables[i]);
		Production[] productions = grammar.getProductions();
		for (int i = 0; i < productions.length; i++) {
			String[] lhsVariables = productions[i].getVariablesOnLHS();
			for (int j = 0; j < lhsVariables.length; j++)
				variableSet.remove(lhsVariables[j]);
		}
		return (String[]) variableSet.toArray(new String[0]);
	}