Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettyPrint() of automaton #25

Open
sunyixu opened this issue Aug 17, 2018 · 0 comments
Open

prettyPrint() of automaton #25

sunyixu opened this issue Aug 17, 2018 · 0 comments
Labels

Comments

@sunyixu
Copy link
Collaborator

sunyixu commented Aug 17, 2018

the method prettyPrint() prints strings that are not actually recognized by the automaton because the transitions of it do not reach a final state.
Example:

HashSet<State> statesR = new HashSet<>();
        HashSet<Transition> deltaR = new HashSet<>();
        State q00 = new State("q0", true, false);
        State q1 = new State("q1", false, false);
        State q2 = new State("q2", false, false);
        State q3 = new State("q3", false, false);
        statesR.add(q00);
        statesR.add(q1);
        statesR.add(q2);
        statesR.add(q3);
        deltaR.add(new Transition(q00, q1, "b"));
        deltaR.add(new Transition(q1, q2, "u"));
        deltaR.add(new Transition(q2, q3, "g"));
        FA result = new FA(new Automaton(deltaR, statesR));
        System.out.println("result --> " + result); //--> bug
        result.minimize();
        System.out.println("result after minimization --> " + result); //--> ε

In the example above, the automaton has no final state.
The first println will print "bug" while it should print "ε" as the second call.

@sunyixu sunyixu added the bug label Aug 17, 2018
@sunyixu sunyixu changed the title toString of automaton prettyPrint() of automaton Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant