@Override
    public Production optimize() {
        List<Production> prodList = new ArrayList<Production>();
        Production ao = a.optimize();
        if(ao instanceof MultiOr && ao.getName() == null && ao.getProdName() == null) {
            MultiOr mor = (MultiOr) ao;
            prodList.addAll(mor.disjuncts);
        } else {
            prodList.add(ao);
        }
        ao = b.optimize();
        if(ao instanceof MultiOr && ao.getName() == null && ao.getProdName() == null) {
            MultiOr mor = (MultiOr) ao;
            prodList.addAll(mor.disjuncts);
        } else {
            prodList.add(ao);
        }
        return new MultiOr(prodList, name, prodName, grammar);
    }