Specification and Modeling Flashcards
Definition: Model
When is a model minimal?
- A model is a simplification of another entity, which can be a physical thing or another model.
- The model contains exactly those characteristics and properties of the modeled entity that are relevant for the task
- a model is called minimal with respect to a task if it does not contain any characteristics which are irrelevant for the task
Requ. for Models: Hierachy
- Hierachy is a form of abstraction
- Behavioral hierachy: States, processes, procedures
- Structural hierachy: processors, printed circuit boards, racks
Requ. for Models: Component-Based Design
- System must be designed from components
- behavior must be easy to derive from behavior of subsystems
- concurreny
- synchronization and communication
Req. for Models: Timing (examples)
- speed of underlying HW platform must be known
- timing behavior (periods, dependences, scenarios)
- Types of timing: elapsed time, delays, timouts, deadlines
Req. for Models: Support for reactive Systems
- State-oriented behavior (classic automata insufficient)
- event handling (external or internal events)
- exception-oriented behavior (it is not acceptable to describe exception for every state)
Name 5-10 Requirements for Models
- Presence of programming elements
- Executability (no algebraic specification)
- Support for the design of large systems (object orientated)
- Domain-specific support
- readability
- Portability and flexibility
- Termination
- Support for non-standard I/O devices
- non-functional properties
- Support for the design of dependable systems
..
Define “Models of Computation”
Components + computation + communication
- Components and an execution model for computation for each component (dependence graph)
- Communication model for exchange of information between components
What can/should be contained in a dependance graph?
- Nodes (Programms/operations) represented as circles
- Sequence arrows (constraints, conditions)
- timing information (arrival time, deadline i.e. (1,7] )
- I/O information (Kreis mit Punkt in der Mitte als Input)
- shared ressources (i.e. memory)
- periodic schedules (periodic dependance graphs are infinite)
- hierachical Task Graphs (Box around Tasks)
Communication Models (examples (pro, cons?))
- shared memory
pro: accessable to several components/task
con: model mostly restricted to local systems - Non-blocking/asynchronous message passing
pro: sender does not have to wait until mssge passed
con: buffer overflow may occur - Blocking/Synchronous message passing
- > Sender will wait until receiver has received mssge
pro: no buffer overflow
con: reduced performance
Organization of Computation (examples)
- finite states machines
- discrete event model
- von Neumann model (sequential execution, program memory etc.)
- differential equations
- data flow (models the flow of data in distribut. system)
- petri nets (models synchronization in distribut. system
Name and explain three early design phase modeling approaches.
- Plain text:
describing the system under design (SUD)in natural language (english/japanese) - Use cases:
description of possible applications of the SUD; includes in UML (unified modeling language).
This can be created from different points of few (User/Caller/Admin) - Sequence Charts:
explicitly indicates exchange of information (arrows left/right); usually the vertical dimension reflects time, other dim. reflects distribution in space; describes just one case (without timing tolerance)
Moore/Mealy automata: Output and Stateequation? For the same programm, does a Moore or a Mealy Machine need more states?
Input X, Output Y, internal State Z, next State Z*
Moore: Y=f(Z) and Z=f(X, Z)
Mealy: Y=f(X, Z) and Z=f(X, Z)
Moore and Mealy automata are finite state machines (FSMs). Both are capable of achieving the same programms, whereas Moore (“more”) needs generally more states than a Mealy machine.
What is stateCharts and why use it instead of Moore/Mealy
StateCharts is a better way of describing communication in finite state machines using hierachy. Moore/Mealy are not useful for complex systems.
StateChart Definitions:
- active states
- basic states
- super-states
- OR-super-states
- Current states of the FSMs are called active states.
- States which are not composed of other states are
called basic states. - States containing other states are calles super-states
- Super-states S are call OR-super-states if exactly one
of the substates of S is active when ever S is active
StateCharts:
- default State
- history mechanism
- The default state is no state by itself, only indicating
which substate is entered when entering superstate (filled dot) - History mechanism allows to enter the superstate at the substate it was when left last
- if entered first time the default state mechansim applies
How is concurrency realised in StateCharts?
- AND-super-states (FSM is in all immediate sub-states of a super state)
- dashed line in super-state box
- when leaving superstate all concurrent states are left
StateCharts: Timer
timers can be realised by a box with some “zigzag” on top. In this box the amount of waitingtime is specified.
From the timer state more than on arrow can continue depending on the things happening during timer (i.e. timout, lift off phone, closed door etc.)
StateCharts: Edge Labels
from one state to another the edges are labeled:
event [condition] / reaction
Events: exist only until next evaluation of model (internal or external)
Conditions: refer to values of variables
Reactions: assignment of variable or creation of event
Example: service-off [not in Lproc] / service :=0
Describe the three steps of StateCharts Simulation Phases. Is this determinate behavior?
- Effect of external changes on events and conditions evaluated
- The set of transitions to be made in current step and right hand sides of assignments are computed
- Transitions become effective, variables obtain new values
The seperation into phase 2 and 3 enables determinate (unique) behavior
StateCharts: What is meant by “Broadcast Mechanism”?
Values of variables are visible to all parts of the StateChart model!
.. new variables become effective after phase 3 of current step and are obtained by all parts of the model in the next step
StateCharts models consist of a sequence of status and step pairs. What is happening in each of them?
Status: Values of all variable + set of events + current time
Step: Execution of three phases
Name an application where StateCharts is appropriate and not appropriate to use
Appropriate: local control systems
Not appropriate: applications for which updating variables take some time
Definition: “Determinate System”
(Kahn 1974) calls a system determinate if we will always obtain the same result for a fixed set (and timing) of inputs
StateCharts: Pros and cons
Pros:
- Hierachy allows arbitrary nesting of AND- and OR-super-states
- (StateMate-) Semantics defined in a follow-up paper to original paper
- larger number of commercial simulation tools available
- available “back-ends” translate StateCharts into software or hardwar language, thus enabling their implementation
Cons:
- not useful for distributed applications
- no program constructs
- no description of non-functional behavior
- no object-orientation
- no description of structural hierachy
- generated programs may be inefficient
Specification and Description Language (SDL):
Definition and Representation
- model of computation based on asynchronous message passing communication ( -> appropriate for distributed systems)
- based on Finite State Machines, each FSM is called a process
- provides textual and graphical formats to please all users
SDL Communication
- based on message passing of signals (potentially indefinitely large FIFO queue
- each process fetches next signal from FIFO
- checks if signal enables transition (if yes transition otherwise signal ignorred)
Is SDL determinate?
No, if signals arrive in FIFO at same time the store order is unknown -> different behavior for mutliple runs possible
SDL: Pros and cons
Pros:
- excellent for distributed systems
- commercial tools available
Cons:
- implementation requires bound for maximum length of FIFO -> difficult to compute
- not necessarily determinate
- timer concept adequate just for soft deadlines
- limited way of using hierachies
- limited programming language support
- no description of non-functional properties