Package dk.brics.automaton

Examples of dk.brics.automaton.Automaton.minimize()


                        }
                    }
                }
            }
        }
        b.minimize();
        return b;
    }

    private Set<State> findPreSet(Automaton b) {
        Set<State> pre = new HashSet<State>();
View Full Code Here


        for (State state : result.getLiveStates()) {
            state.setAccept(true);
        }
        result.restoreInvariant();
        if (result.isDeterministic()) {
            result.minimize();
        }
        return result;
    }
   
    /**
 
View Full Code Here

            }
        }
        result.addEpsilons(epsilons);
        if (automaton.isDeterministic()) {
            result.determinize();
            result.minimize();
        }
        return result;
    }
   
    /**
 
View Full Code Here

            }
        }
        result.restoreInvariant(); // accept states have been modified
        result.addEpsilons(epsilons);
        result.determinize();
        result.minimize();
        return result;
    }
   
    /**
     * Returns an automaton accepting all characters considered digits by {@link Character#isDigit(char)}.
View Full Code Here

        for (State s : b.getStates()) {
            epsilons.add(new StatePair(initial, s));
        }
        b.setInitialState(initial);
        b.addEpsilons(epsilons);
        b.minimize();
        return b;
    }

    @Override
    public String toString() {
View Full Code Here

                }
            }
        }
        b.setDeterministic(false);
        b.reduce();
        b.minimize();
        return b;
    }

    @Override
    public String toString() {
View Full Code Here

        for (State s : a1s) {
            for (Transition t : map.get(s).getTransitions()) {
                s.addTransition(new Transition(Character.MIN_VALUE, Character.MAX_VALUE, t.getDest()));
            }
        }
        a1.minimize();
        return a1;
    }

    @Override
    public String toString() {
View Full Code Here

            epsilons.add(new StatePair(initial, s));
            epsilons.add(new StatePair(s, accept));
        }
        b.setInitialState(initial);
        b.addEpsilons(epsilons);
        b.minimize();
        return b;
    }

    @Override
    public String toString() {
View Full Code Here

                pp.addTransition(new Transition(t.getMin(), t.getMax(), ss));
            }
        }
        b.setDeterministic(false);
        b.addEpsilons(epsilons);
        b.minimize();
        return b;
    }

    @Override
    public String toString() {
View Full Code Here

                transitions.add(new Transition(Character.MIN_VALUE, Character.MAX_VALUE, dest));
            }
        }
        b.setDeterministic(false);
        b.reduce();
        b.minimize();
        return b;
    }

    @Override
    public String toString() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.