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

factors() factorizes not recognized strings #26

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

factors() factorizes not recognized strings #26

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

Comments

@sunyixu
Copy link
Collaborator

sunyixu commented Aug 17, 2018

The method produces the factorization of strings that are not recognized by the automaton.
Not sure if it was purposely intended to work this way.
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("factorization --> " + Automaton.factors(result.getAutomaton()));

The above println prints "(((((bug + bu) + b) + g) + (ug + u)) + ε)" even though "bug" is not actually a string of the language of the automaton.

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