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 />

4 graph . m_Containers−>s e l e c t ( m_pContainer . m_Type =<br />

’ oPacket ’ )−>m_ContainedObjects−>s i z e ( ) =<br />

graph . m_Containers−>s e l e c t ( m_pContainer . m_Type =<br />

’ oPacket ’ ) . m_ContainedObjects−>asSet−>s i z e ( )<br />

5 )<br />

Listing 7.23: Communication graph constraint 3<br />

1 context CProject<br />

2 inv : m_GraphSet−>s e l e c t (m_Type = ’ gCommunicationRea<strong>der</strong> ’ or m_Type =<br />

’ gCommunicationSen<strong>der</strong> ’ )−>f o r A l l (<br />

3 graph |<br />

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

5 c o n t a i n e r |<br />

6 c o n t a i n e r . m_ContainedObjects−>s e l e c t (m_Type = ’ o V a r i a b l e I n s t a c e ’ )−>f o r A l l (<br />

7 v a r i a b l e |<br />

8 c o n t a i n e r . m_pContainer . m_pDecomposition . m_ObjectSet−>i n c l u d e s ( v a r i a b l e )<br />

9 )<br />

10 )<br />

11 )<br />

Listing 7.24: Communication graph constraint 4<br />

7.5.5. gTelegram Graph Type<br />

The gTelegram graph type is used to define an or<strong>der</strong>ed set of oVariableInstance and oPacket<br />

objects that build together an ETCS telegram. Therefore, it is important that this or<strong>der</strong>ed set<br />

has a defined beginning and ending, which is modelled by oRootNode and oLeafNode objects.<br />

The <strong>der</strong>ived constraint is that in each gTelegram exists exact one instance of each type.<br />

1 context CProject<br />

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

3 graph |<br />

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

5 and<br />

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

7 )<br />

Listing 7.25: gTelegram constraint 1<br />

Furthermore, no “loose” objects are allowed, which means that all objects b<strong>es</strong>id<strong>es</strong> the<br />

oLeafNode and oRootNode instanc<strong>es</strong>, must have exact one NextVariable or NextPacket role<br />

and exact one PreviousVariable or PreviousPacket role.<br />

1 context CProject<br />

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

3 graph |<br />

4 graph . m_ObjectSet−>r e j e c t (m_Type = ’ oRootNode ’ or m_Type = ’ oLeafNode ’ )−>f o r A l l (<br />

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

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

7 (m_pRole . m_Type = ’ NextVariable ’ or m_pRole . m_Type = ’ NextPacket ’ ) and m_pObject<br />

= o b j e c t<br />

8 )−>s i z e ( ) = 1<br />

9 and<br />

10 graph . m_BindingSet . m_Connection . m_Calls−>s e l e c t (<br />

11 (m_pRole . m_Type = ’ P r e v i o u s V a r i a b l e ’ or m_pRole . m_Type = ’ PreviousPacket ’ ) and<br />

m_pObject = o b j e c t<br />

105

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

Saved successfully!

Ooh no, something went wrong!