public HashSet<ArrayList<Rule>> FindMinLeftRecursiveDerivations(){
        HashSet<ArrayList<Rule>> res = new HashSet<ArrayList<Rule>>();
        minLen=Integer.MAX_VALUE;
        cyrcles.clear();
        HashMap<String,HashSet<String>> g =  BuildGraph();
        for(String s : m_nonterminals){
            Bfs(g,s);
        }
        
        for(ArrayList<String> cyrc : cyrcles){
            ArrayList<Rule> cur = new ArrayList<Rule>();
            for(int i=1;i<cyrc.size();i++){
                String a = cyrc.get(i-1);
                String b = cyrc.get(i);
                for(Rule rule : m_rules){
                    if(rule.GetLeftPart().equals(a) && rule.GetRightPart().get(0).equals(b)){
                        cur.add(rule);
                        break;
                    }
                }
            }
            res.add(cur);
        }
        
        return res;
    }