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

Composed states unrecognized #886

Closed
ahochheiden opened this Issue Sep 24, 2016 · 2 comments

Comments

Projects
None yet
4 participants
@ahochheiden
Contributor

ahochheiden commented Sep 24, 2016

Consider the following example:

class DeepHistoryCourse
{
  Sm {
    S1 {
      toS2HStar -> S2.HStar;
      Ss1 {
        Sss1{
          toSs2Sss2 -> Ss2.Sss2;
          toS2 -> S2;
        }
        Sss2{
          toS2 -> S2;
        }
      }
      Ss2 {
        Sss1{
          toSss2 -> S1.Sss2;
          toS2 -> S2;
        }
        Sss2{
          Ssss1{
            toSsss2 -> Ssss2;
            toS2Ss2 -> S2.Ss2;
          }
          Ssss2{
            toS2 -> S2;
            toSsss1 -> Ssss1;
          }
        }
      }
    }
    S2 {
      toDeepHistory -> S1.HStar;
      toS1Ss2 -> S1.Ss2;
      Ss1{
        toS1 -> S1;
      }
      Ss2{
        -> S1.HStar;
      }
    }
  }
}

The above code generates the following warnings:

Warning on line 11 : State 'Sss2' from StateMachine 'Ss1' is non-reachable.. More information (67)
Warning on line 17 : State 'S1.Sss2' has not been declared, it is being treated as an new state. More information (50)

These warnings are incorrect, as:

  • on line 8 we have toSs2Sss2 -> Ss2.Sss2;`, which makes it reachable.
  • on line 20 S1.Sss2 is declared

In umpleOnline, when using GraphViz State to view the state diagram, you can see that the state diagram is incorrect. (Sss1 -> toSs2Sss2)

@tlaport4

This comment has been minimized.

Contributor

tlaport4 commented Dec 13, 2016

I believe this is working as intended already.

For the first warning
Warning on line 11 : State 'Sss2' from StateMachine 'Ss1' is non-reachable.. More information (67)
I believe it is referring to the state S1.Ss1.Sss2. The transition toSs2Sss2 -> Ss2.Sss2; as mentioned in the ticket, is referring to the state S1.Ss2.Sss2.

So, S1.Ss1.Sss2 actually is non-reachable.

For the second warning
Warning on line 17 : State 'S1.Sss2' has not been declared, it is being treated as an new state. More information (50)
I believe it doesn't know which S1.Sss2 to go to (S1.Ss1.Sss2 or S1.Ss2.Sss2), and since it can't decide which one to use, it treats it as a new state.

If you change

Ss2 {
    Sss1{
        toSss2 -> S1.Sss2;
            toS2 -> S2;
        }

to

Ss2 {
    Sss1{
        toSss2 -> S1.Ss1.Sss2;
            toS2 -> S2;
        }

it resolves both of the warnings. So I think these warnings are correct.

@vahdat-ab

This comment has been minimized.

Member

vahdat-ab commented Dec 13, 2016

Yes, I checked. There was an issue in the original code. Thanks @tlaport4

@vahdat-ab vahdat-ab closed this Dec 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment