private static Relation<Production, Production> getProductionDependencies(Set<Production> prods) {
		Relation<Production, Production> dep = new Relation<Production, Production>();
		
		for (Production p : prods) {
			for (int i = 0; i < p.getLength(); i++) {
				Symbol s = p.getSymbolAt(i);
				if (s instanceof NonTerminal) {
					for (Production p2 : ((NonTerminal) s).productions) {
						if (prods.contains(p2) && !p2.reject && p.isDerivationAllowed(p2, i)) {
							dep.add(p, p2);
						}
					}
				}
			}
		}
		
		return dep;
	}