Understanding and Comparing Model-Based Specification Notations Jianwei Niu, Joanne Atlee, and Nancy Day University of Waterloo.

Slides:



Advertisements
Similar presentations
Formal Methods in Software Engineering
Advertisements

UML Statechart semantics Speaker: Fei Mo Tutor: Priv.-Doz. Dr. Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen SS 07.
Statecharts Semantics
Models of Concurrency Manna, Pnueli.
Vered Gafni – Formal Development of Real Time Systems 1 Statecharts Semantics.
Week 6Fall 2001 CS5991 The STATEMATE Semantics of Statecharts D. Harel and A. Naamand Ahmad Alsawi 1-4 Bob Chen 5-8 Dapeng Xie 9-11.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
CS 290C: Formal Models for Web Software Lecture 4: Implementing and Verifying Statecharts Specifications Using the Spin Model Checker Instructor: Tevfik.
Temporal Specification Chris Patel Vinay Viswanathan.
Models of Computation for Embedded System Design Alvise Bonivento.
©Ian Sommerville 2000Software Engineering, 6/e, Chapter 91 Formal Specification l Techniques for the unambiguous specification of software.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 10 Slide 1 Formal Specification.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 10 Slide 1 Formal Specification.
Lecture 6 Template Semantics CS6133 Fall 2011 Software Specification and Verification.
Ch.2 Part A: Requirements, State Charts EECE **** Embedded System Design.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Requirements Expression and Modelling
Mapping Specification Notations to Analysis Tools
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 9 Slide 1 Formal Specification l Techniques for the unambiguous specification of software.
An Introduction to Software Architecture
Chapter 10 Implementing Subprograms. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 10 Topics The General Semantics of Calls and Returns.
WXGE6103 Software Engineering Process and Practice Formal Specification.
CS6133 Software Specification and Verification
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Environment Change Information Request Change Definition has subtype of Business Case based upon ConceptPopulation Gives context for Statistical Program.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
By: David Harel & Eran Grey Presenter: Elizabeth Antony CISC 836.
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor.
Systems Analysis and Design in a Changing World, Fourth Edition
UML: State Chart Diagrams
CS3773 Software Engineering Lecture 06 UML State Machines.
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Requirement Analysis SOFTWARE ENGINEERING. What are Requirements? Expression of desired behavior Deals with objects or entities, the states they can be.
Chapter 10 Implementing Subprograms. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 10 Topics The General Semantics of Calls and Returns.
Fundamentals of Algorithms MCS - 2 Lecture # 3. Representation of Algorithms.
I&C Lab Seminar Procedure for the Software Requirements Specification for Safety Critical Systems Seo Ryong Koo Korea Advanced Institute Science.
Implementing Subprograms
Requirements Specification
Operational Semantics of Scheme
A Framework for Nuclear Software (NuFA)
Formal Specification.
Chapter 10 : Implementing Subprograms
Basic Language Concepts
Implementing Subprograms
Marlon Dumas Institute of Computer Science
Main issues: • What do we want to build • How do we write this down
Formal Techniques (CS340 © John C. Knight 2004)
System Design.
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
B (The language of B-Method )
Implementing Subprograms
Chapter 10: Implementing Subprograms Sangho Ha
Implementing Subprograms
UML Activity Diagrams & State Charts
Autonomous Cyber-Physical Systems: Synchronous Components: II
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CS/CPE 426 Senior Projects
An Introduction to Software Architecture
CS/CPE 426 Senior Projects
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Dynamic Modeling Lecture # 37.
Compositional Refinement for Hierarchical Hybrid Systems
CS 791Z State Machines & Advanced State Machines
Implementing Subprograms
Modeling Tangible User Interfaces
Implementing Subprograms
Abstract Types Defined as Classes of Variables
Presentation transcript:

Understanding and Comparing Model-Based Specification Notations Jianwei Niu, Joanne Atlee, and Nancy Day University of Waterloo

Expressing a Notation’s Semantics Pseudo code: (a) For each static reaction X in EN, execute the action associated with X (b) For each transition X in EN, let S n and S x be the set of states exited and entered, respectively; Formal semantics: Let EN be the set of enabled transitions and static reactions - update the history of all the parents of states in S x - delete the states in S x from the list of states in which the system resides - execute actions associated with exiting states in S x - execute the actions of X - execute the actions associated with entering the states in S n - add to the list of states in which the system resides all of the states in S n Definition: Let X = (X 0,…,X n ) be a sequence of state configurations. Let SC be a system configuration whose state configuration is X n. Let  SC 1 be a micro system configuration with respect to SC, and let  be a micro- step from  SC 1. Then  SC = (  X, , , ,  Y) is the micro system configuration reached by  from  SC 1 if 1.  X =  X 1 -  X 1  {  *(LCA(t)) | t   } 2.  1 =   {e |  generates e } 3.  =  1  { cr(c) |  does not assign F to c }  { cr(c) |  assigns T to c } 4.  (v) = x iff  1 (v) = x and  does not assign any value to v or  assigns x to v 5.  Y =  Y 1  {  C (LCA(t), target(t), X) | t   } Harel et al. “ On the Formal Semantics of Statecharts ”, LICS 1987 Harel et al. “ The STATEMATE Semantics of Statecharts ”, TOSEM, July 1996 Designers of specification notations document the semantics of their notations, to help specifiers use the notations correctly.

Template-Based Approach 1. Separates a notation’s step semantics from its semantics of composition. We propose a template-based approach [FSE’02] to structuring the operational semantics of model-based notations that CP1 CP2CP3 CP4 HTS1HTS2 HTS3 HTS4 HTS5

Template-Based Approach 1. Separates a notation’s step semantics from its semantics of composition. 2. Extracts common semantics into templates. User instantiates the templates with parameters, to specify a notation’s distinct semantics. We propose a template-based approach [FSE’02] to structuring the operational semantics of model-based notations that Templates parameters CP1 CP2CP3 CP4 HTS1HTS2 HTS3 HTS4 HTS5

Template Parameters RESETNEXT States current auxiliary enabling Events current input auxiliary enabling outputs Variables current auxiliary enabling Macro semantics Priority

current auxiliary enabling current input auxiliary enabling outputs current auxiliary enabling Macro semantics Priority Variables Events States Agreement among All 3 notations Agreement among 2 notations RESETNEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Comparing Notation Variants No AgreementUnused

Outline of Today's Talk Template semantics u Step semantics of basic components u Template parameters u Comparing notation variants Composition operators Expressing other notations’ semantics u SCR u SDL u Petri Nets CP1 CP2CP3 CP4 HTS1HTS2 HTS3 HTS4 HTS5

Control states, state hierarchy Internal events External events Variables Transitions: Basic Components Hierarchical Transition Systems (HTSs) Nonconcurrent machines – concurrency is introduced when composing multiple HTSs S0S0 S1S1 S3S3 S7S7 S8S8 S9S9 S4S4 S2S2 S5S5 S6S6 event [condition] / action sourcedest

Step Semantics Snapshot: observable point in execution (current control states, occurring events, variable values, etc.) Operational Semantics: admissible steps between consecutive snapshots u micro-steps: execute a single transition u macro-steps: execute a sequence of micro-steps until a stable state is reached macro-step micro-step inputs

Step Semantics Snapshot: observable point in execution (current control states, occurring events, variable values, etc.) Operational Semantics: admissible steps between consecutive snapshots u micro-steps: execute a single transition u macro-steps: execute a sequence of micro-steps until a stable state is reached macro-step micro-step inputs

Step Semantics Snapshot: observable point in execution (current control states, occurring events, variable values, etc.) Operational Semantics: admissible steps between consecutive snapshots u micro-steps: execute a single transition u macro-steps: execute a sequence of micro-steps until a stable state is reached macro-step micro-step inputs

Step Semantics Snapshot: observable point in execution (current control states, occurring events, variable values, etc.) Operational Semantics: admissible steps between consecutive snapshots u micro-steps: execute a single transition u macro-steps: execute a sequence of micro-steps until a stable state is reached macro-step micro-step inputs

Step Semantics Snapshot: observable point in execution (current control states, occurring events, variable values, etc.) Operational Semantics: admissible steps between consecutive snapshots u micro-steps: execute a single transition u macro-steps: execute a sequence of micro-steps until a stable state is reached macro-step micro-step inputs

Step Semantics Snapshot: observable point in execution (current control states, occurring events, variable values, etc.) Operational Semantics: admissible steps between consecutive snapshots u micro-steps: execute a single transition u macro-steps: execute a sequence of micro-steps until a stable state is reached macro-step micro-step Stable snapshot: no transitions enabled in the snapshot inputs

Common Definitions of Template enabled transitions: identifies which transitions are enabled by the snapshot’s states, events, and variable values apply: applies a transition’s actions (new events, variable assignments) to the snapshot micro-step: selects an enabled transition and applies its actions to the snapshot macro-step: executes a sequence of micro-steps reset: resets the snapshot at start of macro-step

Common Definitions of Template enabled transitions: identifies which transitions are enabled by the snapshot’s states, events, and variable values apply: applies a transition’s actions (new events, variable assignments) to the snapshot micro-step: selects an enabled transition and applies its actions to the snapshot macro-step: executes a sequence of micro-steps reset: resets the snapshot at start of macro-step

Common Definitions of Template enabled transitions: identifies which transitions are enabled by the snapshot’s states, events, and variable values apply: applies a transition’s actions (new events, variable assignments) to the snapshot micro-step: selects an enabled transition and applies its actions to the snapshot macro-step: executes a sequence of micro-steps, reset: resets the snapshot at start of macro-step

Common Definitions of Template enabled transitions: identifies which transitions are enabled by the snapshot’s states, events, and variable values apply: applies a transition’s actions (new events, variable assignments) to the snapshot micro-step: selects an enabled transition and applies its actions to the snapshot macro-step: executes a sequence of micro-steps reset: resets the snapshot at start of macro-step

Common Definitions of Template enabled transitions: identifies which transitions are enabled by the snapshot’s states, events, and variable values apply: applies a transition’s actions (new events, variable assignments) to the snapshot micro-step: selects an enabled transition and applies its actions to the snapshot macro-step: executes a sequence of micro-steps reset: resets the snapshot at start of macro-step

Common Definitions of Template enabled transitions: identifies which transitions are enabled by the snapshot’s states, events, and variable values apply: applies a transition’s actions (new events, variable assignments) to the snapshot micro-step: selects an enabled transition and applies its actions to the snapshot macro-step: executes a sequence of micro-steps reset: resets the snapshot at start of macro-step

Example Function enabled_trans (ss, T ) returns the subset of transitions in T that are enabled in snapshot ss enabled_trans(ss, T)  {   T | enabling_states(ss,  )  enabling_events(ss,  )  enabling_cond(ss,  ) } where enabling_states, enabling_events, enabling_cond are template parameters

Template Parameters RESETNEXT how snapshot is reset at start of macro-step how snapshot changes when transition executes how transitions are enabled States current auxiliary enabling Events current input auxiliary enabling outputs Variables current auxiliary enabling Macro semantics Priority

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes where IE - current internal events I a - current external events O - output events Events IE’=  IE  gen(  ) I a ’= I IaIa IE a ’= enabling trig(  )  I a  IE O’= O  gen(  ) gen(  ) - events generated by  trig(  ) -  ’s triggering events

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes where IE - current internal events I a - current external events O - output events Events IE’=  IE  gen(  ) I a ’= I IaIa IE a ’= enabling trig(  )  I a  IE O’= O  gen(  ) gen(  ) - events generated by  trig(  ) -  ’s triggering events

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes where IE - current internal events I a - current external events O - output events Events IE’=  IE  gen(  ) I a ’= I IaIa IE a ’= enabling trig(  )  I a  IE O’= O  gen(  ) gen(  ) - events generated by  trig(  ) -  ’s triggering events

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes where IE - current internal events I a - current external events O - output events Events IE’=  IE  gen(  ) I a ’= I IaIa IE a ’= enabling trig(  )  I a  IE O’= O  gen(  ) gen(  ) - events generated by  trig(  ) -  ’s triggering events

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes where IE - current internal events I a - current external events O - output events Events IE’=  IE  gen(  ) I a ’= I IaIa IE a ’= enabling trig(  )  I a  IE O’= gen(  ) - events generated by  trig(  ) -  ’s triggering events

current auxiliary enabling current input auxiliary enabling outputs current auxiliary enabling Macro semantics Priority Variables Events States Agreement among All 3 notations Agreement among 2 notations RESETNEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Comparing Notation Variants No AgreementUnused

current auxiliary enabling current input auxiliary enabling outputs current auxiliary enabling Macro semantics Priority Variables Events States Agreement among All 3 notations Agreement among 2 notations RESETNEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Comparing Notation Variants No AgreementUnused

current auxiliary enabling current input auxiliary enabling outputs current auxiliary enabling Macro semantics Priority Variables Events States Agreement among All 3 notations Agreement among 2 notations RESETNEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Comparing Notation Variants No AgreementUnused

current auxiliary enabling current input auxiliary enabling outputs current auxiliary enabling Macro semantics Priority Variables Events States Agreement among All 3 notations Agreement among 2 notations RESETNEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Comparing Notation Variants No AgreementUnused

current auxiliary enabling current input auxiliary enabling outputs current auxiliary enabling Macro semantics Priority Variables Events States Agreement among All 3 notations Agreement among 2 notations RESETNEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Comparing Notation Variants No AgreementUnused

Variant Variable Semantics statecharts STATEMATERSML AV’= AV  eval(asn(  ), AV) AV  eval(asn(  ), AV) AV  eval(last(asn(  )), AV) AV a ’= AV a enabling AV a cond(  )AV cond(  ) Variables NEXT where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments last(asn(  )) - last of multiple assignments to same variable eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions

Variant Variable Semantics statecharts STATEMATERSML AV’= AV  eval(asn(  ), AV a ) AV  eval(asn(  ), AV) AV  eval(last(asn(  )), AV) AV a ’= AV a enabling AV a cond(  )AV cond(  ) Variables NEXT where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments last(asn(  )) - last of multiple assignments to same variable eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions

Variant Variable Semantics statecharts STATEMATERSML AV’= AV  eval(asn(  ), AV a ) AV  eval(asn(  ), AV) AV  eval(last(asn(  )), AV) AV a ’= AV a enabling AV a cond(  )AV cond(  ) Variables NEXT where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions last(asn(  )) - last of multiple assignments to same variable

Variant Variable Semantics statecharts STATEMATERSML AV’= AV  eval(asn(  ), AV a ) AV  eval(asn(  ), AV) AV  eval(last(asn(  )), AV) AV a ’= AV a enabling AV a cond(  )AV cond(  ) Variables NEXT where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions last(asn(  )) - last of multiple assignments to same variable

Variant Variable Semantics statecharts STATEMATERSML AV’= AV  eval(asn(  ), AV a ) AV  eval(asn(  ), AV) AV  eval(last(asn(  )), AV) AV a ’= AV a enabling AV a cond(  )AV cond(  ) Variables NEXT where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions last(asn(  )) - last of multiple assignments to same variable

Outline of Today's Talk Template semantics u Step semantics of basic components u Template parameters u Comparing notation variants Composition operators Expressing other notations’ semantics u SCR u SDL u Petri Nets

Composition Operators Constrain which/when components can take a step Share snapshot information: u communicate events u consistent values among shared variables CP1 CP2CP3 CP4 HTS1HTS2 HTS3 HTS4 HTS5

AND-state Composition IF: Both components are enabled Both components execute simultaneously 1 Generated events are shared 2 Assignments to shared variables are resolved 2 ELSE: One component is enabled Enabled component executes in isolation 1 Generated events are shared 2 Assignments to variables are shared 2 1 Components execute via their micro-step template definition. 2 Components use their template parameters to receive shared events and variable values

Outline of Today's Talk Template semantics u Step semantics of basic components u Template parameters u Comparing notation variants Composition operators Expressing other notations’ semantics u SCR u SDL u Petri Nets

Software Cost Reduction (SCR) An SCR specification specifies a system in terms of its variables and a history of how variables change value. Monitored variables:input variables, from the environment Controlled variables:output variables, set by the specification Terms, modes:internal variables

SCR ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ = offon An SCR specification specifies a system in terms of its variables and a history of how variables change value. Variable updates are specified as mathematical functions: Warning = Represented as a table: off if Mode=Off off if Mode  Off  Temp < 175 on if Mode  Off  Temp  175 where each table entry represents one case in the function’s definition.

SCR Template Parameters RESETNEXT States current auxiliary enabling Events current input auxiliary enabling outputs Variables current auxiliary enabling Macro semantics Priority

SCR Condition Tables ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon We define a transition  for every table entry: cond(  ): table-entry conditions, evaluated wrt current variable values: Mode  {Heat, Maintain}  Temp<175 asn(  ): bottom-level assignment Warning := off

SCR Condition Tables ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon We define a transition  for every table entry: cond(  ): table-entry conditions, evaluated wrt current variable values: Mode  {Heat, Maintain}  Temp<175 asn(  ): bottom-level assignment Warning := off

SCR Condition Tables ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon We define a transition  for every table entry: cond(  ): table-entry conditions, evaluated wrt current variable values: Mode  {Heat, Maintain}  Temp<175 asn(  ): bottom-level assignment Warning := off

SCR Condition Tables Variables AV’= AV  I AV  asn(  ) AV a ’= enabling AV cond(  ) outputs  controlled(V)  asn(  ) Macro semantics simple microstep RESETNEXT where AV – current variable values I – monitored (input) variable values O – controlled (output) variable values cond(  ) –  ’s enabling conditions controlled(V) – controlled (output) variables in V

SCR Condition Tables Variables AV’= AV  I AV  asn(  ) AV a ’= enabling AV cond(  ) outputs  controlled(V)  asn(  ) Macro semantics simple microstep RESETNEXT where AV – current variable values I – monitored (input) variable values O – controlled (output) variable values cond(  ) –  ’s enabling conditions controlled(V) – controlled (output) variables in V

SCR Condition Tables Variables AV’= AV  I AV  asn(  ) AV a ’= enabling AV cond(  ) outputs  controlled(V)  asn(  ) Macro semantics simple microstep RESETNEXT where AV – current variable values I – monitored (input) variable values O – controlled (output) variable values cond(  ) –  ’s enabling conditions controlled(V) – controlled (output) variables in V

SCR Condition Tables Variables AV’= AV  I AV  asn(  ) AV a ’= enabling AV cond(  ) outputs  controlled(V)  asn(  ) Macro semantics simple microstep RESETNEXT where AV – current variable values I – monitored (input) variable values O – controlled (output) variable values cond(  ) –  ’s enabling conditions controlled(V) – controlled (output) variables in V

SCR Condition Tables Variables AV’= AV  I AV  asn(  ) AV a ’= enabling AV cond(  ) outputs  controlled(V)  asn(  ) Macro semantics simple microstep RESETNEXT where AV – current variable values I – monitored (input) variable values O – controlled (output) variable values cond(  ) –  ’s enabling conditions controlled(V) – controlled (output) variables in V

SCR Event Tables ModeEvent Off WHEN[Temp  SetT]  SetT) Maintain X Mode’ = OffHeatMaintain We define a transition  for every table entry: trig(  ): conditions becoming variables cond(  ): table-entry conditions, evaluated wrt values at start of step: (Mode old = Off)  (Temp old < SetT old ) asn(  ): bottom-level assignment Mode := Heat

SCR Event Tables ModeEvent Off WHEN[Temp  SetT]  SetT) Maintain X Mode’ = OffHeatMaintain We define a transition  for every table entry: trig(  ): conditions becoming variables cond(  ): table-entry conditions, evaluated wrt values at start of step: (Mode old = Off)  (Temp old < SetT old ) asn(  ): bottom-level assignment Mode := Heat

SCR Event Tables ModeEvent WHEN[Temp  SetT]  SetT) Maintain X Mode’ = OffHeatMaintain We define a transition  for every table entry: trig(  ): conditions becoming variables cond(  ): table-entry conditions, evaluated wrt values at start of step: (Mode old = Off)  (Temp old < SetT old ) asn(  ): bottom-level assignment Mode := Heat

SCR Event Tables ModeEvent Off WHEN[Temp  SetT]  SetT) Maintain X Mode’ = OffHeatMaintain We define a transition  for every table entry: trig(  ): conditions becoming variables cond(  ): table-entry conditions, evaluated wrt values at start of step: (Mode old = Off)  (Temp old < SetT old ) asn(  ): bottom-level assignment Mode := Heat

SCR Event Tables Eventsenabling  e  trig(  ). [  (AV a  c)  (AV c ) ]  [  (Av a (c)  AV(c) ] Variables AV’= AV  I AV  asn(  ) AV a ’= AVAV a enabling AV a cond(  ) Outputs  controlled(V)  asn(  ) Macro semantics simple microstep RESETNEXT where AV – current variable values AV a – variable values from start of step I – new input-variable values cond(  ) –  ’s enabling conditions controlled(V) – controlled (output) variables in V

SCR Event Tables Eventsenabling  e  trig(  ). [  (AV a  c)  (AV c ) ]  [  (Av a (c)  AV(c) ] Variables AV’= AV  I AV  asn(  ) AV a ’= AVAV a enabling AV a cond(  ) Outputs  controlled(V)  asn(  ) Macro semantics simple microstep RESETNEXT where AV – current variable values AV a – variable values from start of step I – new input-variable values cond(  ) –  ’s enabling conditions controlled(V) – controlled (output) variables in V

An SCR specification is a network of these tabular functions, with variable dependences whose topological sort imposes a total ordering on tables: SCR Composition ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ABCD FE ABECDF

An SCR specification is a network of these tabular functions, with variable dependences whose topological sort imposes a total ordering on tables: SCR composition is functional composition of the tables’ functions that maps one snapshot (SCR state) to its next snapshot using new variable values in downstream calculations SCR Composition ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ModeCondition OffTrueX Heat, Maintain Temp < 175 Temp  175 Warning’ =offon ABCD FE ABECDF

A template for expressing the operational semantics of many model-based notations that reduces users’ effort in documenting a notation’s semantics results in succinct descriptions of notation semantics makes it easier to understand and to compare notations Summary

Questions?

current auxiliary enabling current input auxiliary enabling outputs current auxiliary enabling Macro semantics Priority Variables Events States RESETNEXT RESETNEXT Petri-NetsSDL Petri-Net, SDL Template Parameters

Automated generation of notation-specific analysis tools by treating an instantiated template as a model compiler that compiles a specification into its next-state relation which is a format that is suitable for computer-aided verification. Future Work

Goal: To generate model compilers from notations’ semantics. A model compiler compiles a specification into a more primitive representation, according to the notation’s computation model. An instantiated template is a model compiler. It defines a notation’s semantics in terms of allowable execution steps. Further Work

A succinct method for describing the semantics of a specification notation that Makes it easier to understand and to compare notations Makes it easier (possible) to compile specifications in a representation that is more suitable for automated analysis Summary

Current Status We have defined the generic template definitions enabled-transition, apply, init, micro-step, macro-step We have defined template parameters and composition operators for several popular notations various statecharts variants, RSML, SCR, SDL88, Petri-Nets, process algebras We have implemented a vertical slice of the Metro model- compiler generator to handle Basic State Transitions enabled-transition, apply, macro-step, interleaving composition,

Conclusions and Future Work

Example (original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes where CS - current events CS a - auxiliary state information (set of enabling states) entered(s) - states entered when s is entered ancestor(s) - ancestor states of s descend(s) - descendent states of s scope(  ) - lowest common ancestor of  ’s source and destination States CS’= CS entered(  )  ancestor(entered(  ) CS a ’= CS CS a – descend(scope(  )) enabling source(  )  CS a

Outputs Macro semantics Priority Comparing Notation Variants current auxiliary enabling current input auxiliary enabling current auxiliary enabling RESET NEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Variables Events States Agreement among All 3 notations Agreement among 2 notations

current auxiliary enabling current input auxiliary enabling current auxiliary enabling Outputs Macro semantics Priority Variables Events States Agreement among All 3 notations Agreement among 2 notations RESETNEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Comparing Notation Variants

Variant Event Semantics RESETNEXT where gen(  ) - events generated by transition  trig(  ) -  ’s triggering events intern_ev(E) - internal events in E RESETNEXT statecharts STATEMATE RESETNEXT RSML Events IE’=  IE  gen(  )  gen(  )  intern_ev( E )  gen(  ) I a ’= IIaIa I  I  IE a ’ enabling trig(  )  I a  IE

Variant State Semantics RESETNEXT where CS - current events CS a - auxiliary state information (set of enabling states) entered(s) - states entered when s is entered ancestor(s) - ancestor states of s descend(s) - descendent states of s scope(  ) - lowest common ancestor of  ’s source and destination RESETNEXT statechartsRSML, STATEMATE States CS’=CS entered(  )  ancestor(entered(  ) CS entered(  )  ancestor(entered(  ) CS a ’= CS CS a – descend(scope(  )) enabling source(  )  CS a source(  )  CS

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes Variables AV’=AV AV  eval(asn(  ), AV a ) AV a ’= AV AV a enabling AV a cond(  ) where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes Variables AV’=AV AV  eval(asn(  ), AV a ) AV a ’= AV AV a enabling AV a cond(  ) where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes Variables AV’=AV AV  eval(asn(  ), AV a ) AV a ’= AV AV a enabling AV a cond(  ) where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions

Example (Harel’s original statecharts) RESET NEXT how snapshot is reset at start of macro-step how snapshot changes when transition  executes Variables AV’=AV AV  eval(asn(  ), AV a ) AV a ’= AV AV a enabling AV a cond(  ) where AV - current variable values AV a - old variable values (from start of macro-step) asn(  ) -  ’s variable assignments eval(X, Y) - evaluates expressions in X wrt values in Y cond(  ) -  ’s enabling conditions

Template Parameters RESETNEXT States current auxiliary enabling Events current input auxiliary enabling outputs Variables current auxiliary enabling Macro semantics Priority

AND-state Composition (original statecharts) Both components are enabled AND do not assign values to the same variables Both components execute simultaneously 1 Generated events are shared 2 Assignments to shared variables are resolved 2 OR An enabled component executes in isolation 1 Generated events are shared 2 Assignments to variables are shared 2 1 Components execute via their micro-step template definition. 2 Components use their template parameters to receive shared events and variable values

SCR Composition (functional composition) N (ss, , ss’) TO  ss’ = N ( … ( N ( N ( ss,  1 ),  2 ), … ),  n )   = {  1,  2, …,  n }   i  n. [  i = enabled_trans ( N ( … ( N ( ss,  1 ), … ),  i-1 ), T TO[i] ) ] fun_comp micro TO[n]TO[2]TO[1] micro TO[i-1] micro TO[1]

SCR Composition (functional composition) N (ss, , ss’) TO  ss’ = N ( … ( N ( N ( ss,  1 ),  2 ), … ),  n )   = {  1,  2, …,  n }   i  n. [  i = enabled_trans ( N ( … ( N ( ss,  1 ), … ),  i-1 ), T TO[i] ) ] fun_comp micro TO[n]TO[2]TO[1] micro TO[i-1] micro TO[1] There is a micro-step from ss to ss’, via transitions 

SCR Composition (functional composition) N (ss, , ss’) TO  ss’ = N ( … ( N ( N ( ss,  1 ),  2 ), … ),  n )   = {  1,  2, …,  n }   i  n. [  i = enabled_trans ( N ( … ( N ( ss,  1 ), … ),  i-1 ), T TO[i] ) ] fun_comp micro TO[n]TO[2]TO[1] micro TO[i-1] micro TO[1] Given a total ordering, TO, over the specification’s n functions (tables) There is a micro-step from ss to ss’, via transitions 

SCR Composition (functional composition) N (ss, , ss’) TO  ss’ = N ( … ( N ( N ( ss,  1 ),  2 ), … ),  n )   = {  1,  2, …,  n }   i  n. [  i = enabled_trans ( N ( … ( N ( ss,  1 ), … ),  i-1 ), T TO[i] ) ] fun_comp micro TO[n]TO[2]TO[1] micro TO[i-1] micro TO[1] Given a total ordering, TO, over the specification’s n functions (tables) There is a micro-step from ss to ss’, via transitions  ss’ = the functional composition of the tables’ functions, applied in the total order TO, starting from ss.

SCR Composition (functional composition) N (ss, , ss’) TO  ss’ = N ( … ( N ( N ( ss,  1 ),  2 ), … ),  n )   = {  1,  2, …,  n }   i  n. [  i = enabled_trans ( N ( … ( N ( ss,  1 ), … ),  i-1 ), T TO[i] ) ] fun_comp micro TO[n]TO[2]TO[1] micro TO[i-1] micro TO[1] Given a total ordering, TO, over the specification’s n functions (tables) There is a micro-step from ss to ss’, via transitions  ss’ = the functional composition of the tables’ functions, applied in the total order TO, starting from ss. one transition (i.e., variable assignment) from each table.

SCR Composition (functional composition) N (ss, , ss’) TO  ss’ = N ( … ( N ( N ( ss,  1 ),  2 ), … ),  n )   = {  1,  2, …,  n }   i  n. [  i = enabled_trans ( N ( … ( N ( ss,  1 ), … ),  i-1 ), T TO[i] ) ] fun_comp micro TO[n]TO[2]TO[1] micro TO[i-1] micro TO[1] Given a total ordering, TO, over the specification’s n functions (tables) There is a micro-step from ss to ss’, via transitions  ss’ = the functional composition of the tables’ functions, applied in the total order TO, starting from ss. one transition (i.e., variable assignment) from each table. each transition  i is enabled after the functional composition of transitions  1 …  i-1

SCR Composition (functional composition) N (ss, , ss’) TO  ss’ = N ( … ( N ( N ( ss,  1 ),  2 ), … ),  n )   = {  1,  2, …,  n }   i  n. [  i = enabled_trans ( N ( … ( N ( ss,  1 ), … ),  i-1 ), T TO[i] ) ] fun_comp micro TO[n]TO[2]TO[1] micro TO[i-1] micro TO[1] Given a total ordering, TO, over the specification’s n functions (tables) There is a micro-step from ss to ss’, via transitions  ss’ = the functional composition of the tables’ functions, applied in the total order TO, starting from ss. one transition (i.e., variable assignment) from each table. each transition  i is enabled after the functional composition of transitions  1 …  i-1

current auxiliary enabling current input auxiliary enabling outputs current auxiliary enabling Macro semantics Priority Variables Events States Agreement among All 3 notations Agreement among 2 notations RESETNEXT RESET NEXT RESETNEXT statecharts RSML STATEMATE Comparing Notation Variants No AgreementUnused