31.01.2014 Views

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.5. Static Semantics for Models<br />

14 )<br />

15 )<br />

16 )<br />

Listing 7.15: gEmbeddedStateMachine constraint 1<br />

This constraint implicitly defin<strong>es</strong> that all oEmbeddedState objects have a decomposition.<br />

A state machine always needs to have exact one initial state to be able to start.<br />

1 context CProject<br />

2 inv : m_GraphSet−>s e l e c t (m_Type = ’ gEmbeddedStateMachine ’ )−>f o r A l l (<br />

3 graph |<br />

4 graph . m_ObjectSet . s e l e c t (m_Type = ’ oEmbeddedInitialState ’ )−>s i z e ( ) = 1<br />

5 )<br />

Listing 7.16: gEmbeddedStateMachine constraint 2<br />

Additionally, each oEmbeddedInitialState object must be exact in one current state role or<br />

rather an InitialTransition relationship.<br />

1 context CProject<br />

2 inv : m_GraphSet−>s e l e c t (m_Type = ’ gEmbeddedStateMachine ’ )−>f o r A l l (<br />

3 graph |<br />

4 graph . m_BindingSet−>s e l e c t ( m_pRelationship . m_Type = ’ I n i t i a l T r a n s i t i o n ’ )−>s i z e ( ) = 1<br />

5 )<br />

Listing 7.17: gEmbeddedStateMachine constraint 3<br />

It is nec<strong>es</strong>sary that all oEmbeddedState objects are in at least one CurrentState role to avoid<br />

dead locks / stat<strong>es</strong>.<br />

1 context CProject<br />

2 inv : m_GraphSet−>s e l e c t (m_Type = ’ gEmbeddedStateMachine ’ )−>f o r A l l (<br />

3 graph |<br />

4 graph . m_ObjectSet−>s e l e c t (m_Type = ’ oEmbeddedState ’ )−>f o r A l l (<br />

5 o b j e c t |<br />

6 graph . m_BindingSet−>s e l e c t ( m_pRelationship . m_Type =<br />

’ T r a n s i t i o n ’ ) . m_Connection . m_Calls−>s e l e c t (m_pRole . m_Type = ’ CurrentState ’ and<br />

m_pObject = o b j e c t )−>s i z e ( ) >= 1<br />

7 )<br />

8 )<br />

Listing 7.18: gEmbeddedStateMachine constraint 4<br />

Similar to the constraint for non-concurrent prioriti<strong>es</strong> for transition of ETCS Mod<strong>es</strong> in<br />

Subsection 7.5.1, also those situations must be avoided for the priority of transitions of<br />

embedded state machin<strong>es</strong>.<br />

1 context CProject<br />

2 inv : m_GraphSet−>s e l e c t (m_Type = ’ gEmbeddedStateMachine ’ )−>f o r A l l (<br />

3 graph |<br />

4 graph . m_ObjectSet−>s e l e c t (m_Type = ’ oEmbeddedState ’ )−>f o r A l l (<br />

5 s t a t e |<br />

6 graph . m_BindingSet−>s e l e c t ( m_Connection . m_Calls−>e x i s t s ( m_pObject =<br />

s t a t e ) ) . m_pRelationship−>s e l e c t (m_Type =<br />

’ T r a n s i t i o n ’ ) . m_Properti<strong>es</strong>−>s e l e c t (m_Type = ’ P r i o r i t y ’ )−>isUnique (m_Value)<br />

7 )<br />

8 )<br />

Listing 7.19: gEmbeddedStateMachine constraint 5<br />

103

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!