Previous Next Methods Allocation  
Annex 1  
4.17 Interface PCODE-STM  

Contents  
  • 1 Characterization of the Interface
  • 2 Example
  • 3 Tool Support
  • 4 Literature
  • 1 Characterization of the Interface

    The interface corresponds to the type "information transmission from one basic method to another in sequential order". The STM - State Transition Modeling results are further utilized by PCODE - Pseudocode.

    The state automata specified by STM define certain sequences of communicating processes. In the detailed design, the individual processes are formulated in pseudocode. In this connection it is important to note that the specified behavior preset by STM is exactly represented in the PCODE.

    2 Example

    The following example illustrates the interface relationship on the basis of the reader/writer example in /Buhr, 1984/, p.157-163.

    Figure 4.25
    Figure 4.25: State Automaton for Scheduler Process of the Reader/Writer

         Process SCHEDULER
         ...
         when STATE = IDLE or STATE = WRITE_READY
              accept write request
                 set STATE = WRITING
              end
         when STATE = IDLE or STATE = READING
              accept read request
                 do case
                    STATE = IDLE: set STATE = READING
                                  increment READERS
                    STATE = READING : ...
                 end case
              end
         when ...
    

    Figure 4.26: PCODE-Section for the Scheduler Process

    Explanation:

    The pseudocode for Process Scheduler (see Figure 4.26) copies the state model (see Figure 4.25) in such a way that it sets a "guard" in front of the corresponding actions (expressed by "when..." ) which allows the corresponding actions only in certain states or which realizes the actions in these states itself. The PCODE example is adopted from /Buhr, 1984/, chap. 5.3.3.

    3 Tool Support

    The tool support for the mapping of state automata into pseudocode usually exists in a form that allows the transformation of state diagrams in program bodies (if necessary for different target languages).

    4 Literature

    /Buhr, 1984/ Contains examples about state diagrams and corresponding program examples in chap. 5.3.

    Previous Next GDPA Online Last Updated 01.Jan.2002 Updated by Webmaster Last Revised 01.Jan.2002 Revised by Webmaster