Package pl.edu.amu.wmi.daut.base

Examples of pl.edu.amu.wmi.daut.base.State


    */
    public final void testTwoStatesOneTransitionLabel() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.addTransition(q0, q1, new CharTransitionLabel('a'));

        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);

View Full Code Here


    */
    public final void testExemplaryAutomaton() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        State q2 = automaton.addState();
        State q3 = automaton.addState();
        State q4 = automaton.addState();
        automaton.addTransition(q0, q1, new CharTransitionLabel('a'));
        automaton.addTransition(q1, q2, new CharTransitionLabel('a'));
        automaton.addTransition(q0, q3, new CharTransitionLabel('a'));
        automaton.addTransition(q3, q2, new CharTransitionLabel('c'));
        automaton.addTransition(q2, q4, new CharTransitionLabel('b'));
View Full Code Here

    */
    public final void testThreeStatesTwoFinalStates() {

        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        State q2 = automaton.addState();
        automaton.addTransition(q0, q1, new CharTransitionLabel('a'));
        automaton.addTransition(q0, q2, new CharTransitionLabel('b'));

        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);
View Full Code Here

    */
    public final void testMultiplierEqualsZero() {
        AutomatonSpecification automaton = new NaiveAutomatonSpecification();

        State q0 = automaton.addState();
        State q1 = automaton.addState();
        automaton.addTransition(q0, q1, new CharTransitionLabel('x'));

        automaton.markAsInitial(q0);
        automaton.markAsFinal(q1);

View Full Code Here

     */
    public final void testCreateAutomatonFromTwoAutomata() {

        AutomatonSpecification a1 = new NaiveAutomatonSpecification();

        State q0 = a1.addState();
        State q1 = a1.addState();
        a1.addTransition(q0, q1, new CharTransitionLabel('b'));
        a1.addLoop(q0, new CharTransitionLabel('a'));
        a1.addLoop(q1, new CharTransitionLabel('b'));
        a1.addLoop(q1, new CharTransitionLabel('a'));

        a1.markAsInitial(q0);
        a1.markAsFinal(q1);

        AutomatonSpecification a2 = new NaiveAutomatonSpecification();

        State q0c = a2.addState();
        State q1c = a2.addState();
        State q2c = a2.addState();
        a2.addTransition(q0c, q1c, new CharTransitionLabel('c'));
        a2.addTransition(q1c, q2c, new CharTransitionLabel('c'));
        a2.addLoop(q0c, new CharTransitionLabel('a'));
        a2.addLoop(q1c, new CharTransitionLabel('a'));
        a2.addLoop(q2c, new CharTransitionLabel('a'));
View Full Code Here

     * z automatem z jednym stanem.
     */
    public final void testCreateAutomatonFromOneAutomaton1() {

        AutomatonSpecification subautomaton = new NaiveAutomatonSpecification();
        State q0 = subautomaton.addState();
        subautomaton.markAsInitial(q0);
        subautomaton.markAsFinal(q0);

        DoNothingOperator operator = new DoNothingOperator();
        NondeterministicAutomatonByThompsonApproach automaton =
View Full Code Here

     * z automatem z kilkoma stanami i przejściami.
     */
    public final void testCreateAutomatonFromOneAutomaton2() {

        AutomatonSpecification subautomaton = new NaiveAutomatonSpecification();
        State q0 = subautomaton.addState();
        State q1 = subautomaton.addState();
        State q2 = subautomaton.addState();
        subautomaton.addTransition(q0, q1, new CharTransitionLabel('a'));
        subautomaton.addLoop(q1, new CharTransitionLabel('b'));
        subautomaton.addTransition(q1, q2, new CharTransitionLabel('a'));
        subautomaton.markAsInitial(q0);
        subautomaton.markAsFinal(q2);
View Full Code Here

     * Test metody createAutomatonFromTwoAutomaton.
     */
    public final void testCreateAutomatonFromTwoAutomata() {

        AutomatonSpecification automaton1 = new NaiveAutomatonSpecification();
        State q0 = automaton1.addState();
        State q1 = automaton1.addState();
        automaton1.addTransition(q0, q1, new CharTransitionLabel('a'));
        automaton1.markAsInitial(q0);
        automaton1.markAsFinal(q1);

        AutomatonSpecification automaton2 = new NaiveAutomatonSpecification();
        State q2 = automaton2.addState();
        State q3 = automaton2.addState();
        automaton2.addTransition(q2, q3, new CharTransitionLabel('k'));
        automaton2.markAsInitial(q2);
        automaton2.markAsFinal(q3);

        AnyOrderOperator operator = new AnyOrderOperator();
        NondeterministicAutomatonByThompsonApproach result =
                new NondeterministicAutomatonByThompsonApproach(
                operator.createAutomatonFromTwoAutomata(automaton1, automaton2));

        assertTrue(result.accepts("ak"));
        assertTrue(result.accepts("ka"));
        assertFalse(result.accepts("a"));
        assertFalse(result.accepts("k"));
        assertFalse(result.accepts(""));

        AutomatonSpecification automaton3 = new NaiveAutomatonSpecification();
        State q4 = automaton3.addState();
        State q5 = automaton3.addState();
        automaton3.addTransition(q4, q5, new EpsilonTransitionLabel());
        automaton3.markAsInitial(q4);
        automaton3.markAsFinal(q5);

        AutomatonSpecification automaton4 = new NaiveAutomatonSpecification();
        State q6 = automaton2.addState();
        State q7 = automaton2.addState();
        automaton2.addTransition(q6, q7, new EpsilonTransitionLabel());
        automaton2.markAsInitial(q6);
        automaton2.markAsFinal(q7);

        AnyOrderOperator operator1 = new AnyOrderOperator();
View Full Code Here

     */
    public final void testCreateAutomatonFromTwoAutomata1() {

        AutomatonSpecification automaton1 = new NaiveAutomatonSpecification();

        State q0 = automaton1.addState();
        State q1 = automaton1.addState();
        automaton1.addTransition(q0, q1, new CharTransitionLabel('a'));
        automaton1.addLoop(q0, new CharTransitionLabel('b'));
        automaton1.addLoop(q1, new CharTransitionLabel('a'));
        automaton1.addLoop(q1, new CharTransitionLabel('b'));

        automaton1.markAsInitial(q0);
        automaton1.markAsFinal(q1);

        AutomatonSpecification automaton2 = new NaiveAutomatonSpecification();

        State q2 = automaton2.addState();
        State q3 = automaton2.addState();
        automaton2.addTransition(q2, q3, new CharTransitionLabel('b'));
        automaton2.addTransition(q3, q2, new CharTransitionLabel('b'));
        automaton2.addLoop(q2, new CharTransitionLabel('a'));
        automaton2.addLoop(q3, new CharTransitionLabel('a'));

View Full Code Here

     */
    public final void testCreateAutomatonFromTwoAutomata2() {

        AutomatonSpecification automaton1 = new NaiveAutomatonSpecification();

        State q0 = automaton1.addState();
        State q1 = automaton1.addState();
        State q2 = automaton1.addState();
        automaton1.addTransition(q0, q1, new CharTransitionLabel('a'));
        automaton1.addTransition(q1, q2, new CharTransitionLabel('b'));
        automaton1.addTransition(q2, q1, new CharTransitionLabel('a'));

        automaton1.markAsInitial(q0);
View Full Code Here

TOP

Related Classes of pl.edu.amu.wmi.daut.base.State

Copyright © 2018 www.massapicom. 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.