public static String[] getUselessVariables(Grammar grammar,
			VariableDependencyGraph graph) {
		ArrayList list = new ArrayList();
		UnreachableStatesDetector usd = new UnreachableStatesDetector(graph);
		State[] states = usd.getUnreachableStates();
		for (int k = 0; k < states.length; k++) {
			list.add(states[k].getName());
		}
		return (String[]) list.toArray(new String[0]);
	}