public static Set smallerSymbols(Grammar grammar) {
		Set smaller = new HashSet();
		Production[] prods = grammar.getProductions();
		boolean added;
		do {
			added = false;
			for (int i = 0; i < prods.length; i++) {
				String left = prods[i].getLHS();
				String right = prods[i].getRHS();
				int rightLength = minimumLength(right, smaller);
				int leftLength = minimumLength(left, smaller);
				if (leftLength > rightLength) {
					for (int j = 0; j < left.length(); j++) {
						String symbol = left.substring(j, j + 1);
						char s = symbol.charAt(0);
						if (smaller.contains(symbol))
							continue;
						if (count(left, s) <= count(right, s))
							continue;
						smaller.add(symbol);
						added = true;
					}
				}
			}
		} while (added);
		return smaller;
	}