private void removeUseless(Grammar g) 
	{
		UselessProductionRemover remover = new UselessProductionRemover();
		
		Grammar g2 = UselessProductionRemover
				.getUselessProductionlessGrammar(g);
		
		Production[] p1 = g.getProductions();
		Production[] p2 = g2.getProductions();
		if (p1.length > p2.length) {
			
			GrammarEnvironment env=new GrammarEnvironment(new GrammarInputPane(g));
			UselessPane up = new UselessPane(env, g);
			UselessController controller=new UselessController(up, g);
			controller.doAll();
			g=controller.getGrammar();
		}
		initializeChomskyMap(g);
	}