ARTIST2 - MOTIVES Trento - Italy, February 19-23, 2007 Model Transformation and UML Reiko Heckel University of Leicester, UK Foundations of Model Transformation.

Slides:



Advertisements
Similar presentations
System and Software Engineering Research 1 Motorola 2003 Integrated Application of MSC Clive Jervis Rapporteur Q15 Motorola UK Research Labs.
Advertisements

StateChart Diagrams State Machines Overview Change summary –core constructs –notation Examples Backward compatibility User benefits Issues.
Semantics Static semantics Dynamic semantics attribute grammars
ES Seminar1 Communicating Transaction Processes P.S. Thiagarajan National University of Singapore Joint Work with: Abhik Roychoudhury; ……
Budapest University of Technology and EconomicsDagstuhl 2004 Department of Measurement and Information Systems 1 Towards Automated Formal Verification.
Architecture Representation
1.6 Behavioral Equivalence. 2 Two very important concepts in the study and analysis of programs –Equivalence between programs –Congruence between statements.
Goal and Scenario Validation: a Fluent Combination Chin-Yi Tsai.
1 Towards formal manipulations of scenarios represented by High-level Message Sequence Charts Loïc Hélouet Claude Jard Benoît Caillaud IRISA/PAMPA (INRIA/CNRS/Univ.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
1 Ivan Lanese Computer Science Department University of Bologna Italy Exploiting user-definable synchronizations in graph transformation.
1 The SOCK SAGA Ivan Lanese Computer Science Department University of Bologna Italy Joint work with Gianluigi Zavattaro.
Model checking dynamic states in GROOVE Arend Rensink Formal Methods and Tools University of Twente.
6/12/2015Prof. Hilfinger CS164 Lecture 111 Bottom-Up Parsing Lecture (From slides by G. Necula & R. Bodik)
1 Synchronization strategies for global computing models Ivan Lanese Computer Science Department University of Bologna.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
1 Control Flow Analysis Mooly Sagiv Tel Aviv University Textbook Chapter 3
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
Foundations of Model Transformations A “lambda calculus” for MDD ? Reiko Heckel University of Leicester, UK.
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
Winter 2003/4Pls – syntax – Catriel Beeri1 SYNTAX Syntax: form, structure The syntax of a pl: The set of its well-formed programs The rules that define.
CSE 413 Programming Languages & Implementation Hal Perkins Autumn 2012 Context-Free Grammars and Parsing 1.
McGill University Proposal Exam School of Computer Science Ph.D. Candidate in the Modelling, Simulation and Design Lab Eugene Syriani.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
8/19/2015© Hal Perkins & UW CSEC-1 CSE P 501 – Compilers Parsing & Context-Free Grammars Hal Perkins Winter 2008.
Behaviour-Preserving Model Transformation Arend Rensink, University of Twente IPA Spring Days, 18 April 2012.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Chapter 2 Syntax A language that is simple to parse for the compiler is also simple to parse for the human programmer. N. Wirth.
Workshop on Integrated Application of Formal Languages, Geneva J.Fischer Mappings, Use of MOF for Language Families Joachim Fischer Workshop on.
Yu SunUniversity of Alabama at Birmingham PAR Works Jeff Gray University of Alabama Montpellier, France July 3rd, 2013 This research is supported.
Formalizing the Asynchronous Evolution of Architecture Patterns Workshop on Self-Organizing Software Architectures (SOAR’09) September 14 th 2009 – Cambrige.
Validated Model Transformation Tihamér Levendovszky Budapest University of Technology and Economics Department of Automation and Applied Informatics Applied.
Context-Free Grammars and Parsing
Grammars CPSC 5135.
Introduction to Graph Grammars Fulvio D’Antonio LEKS, IASI-CNR Rome,
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
1 Graph-Based State Spaces Arend Rensink, University of Twente CamPaM 2012 April 2012Graph-Based State Spaces.
An Introduction to Graph Rewriting Thomas Huining Feng CHESS, UC Berkeley May.
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
Multi-Path Development of User Interfaces 1 Quentin Limbourg Louvain-la-Neuve, 4th November 2004.
Automata Based Method for Domain Specific Languages Definition Ulyana Tikhonova PhD student at St. Petersburg State Politechnical University, supervised.
CPS 506 Comparative Programming Languages Syntax Specification.
Semantics Preserving Transformation: An Impossible Dream? Arend Rensink, University of Twente BX Position Statement.
Visual Specification of a DSL Processor Debugger Tamás Mészáros and Tihamér Levendovszky Budapest University of Technology and Economics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
2G1516 Formal Methods2005 Mads Dam IMIT, KTH 1 CCS: Processes and Equivalences Mads Dam Reading: Peled 8.5.
The Interpreter Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Duminda WijesekeraSWSE 623: Introduction1 Introduction to Formal and Semi- formal Methods Based on A Specifier's Introduction to Formal Methods (J. Wing)
1 Introduction to Parsing. 2 Outline l Regular languages revisited l Parser overview Context-free grammars (CFG ’ s) l Derivations.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Bottom Up Parsing CS 671 January 31, CS 671 – Spring Where Are We? Finished Top-Down Parsing Starting Bottom-Up Parsing Lexical Analysis.
1 Compiler Construction Vana Doufexi office CS dept.
Requirement Elicitation Review – Class 8 Functional Requirements Nonfunctional Requirements Software Requirements document Requirements Validation and.
Syntax Analysis Or Parsing. A.K.A. Syntax Analysis –Recognize sentences in a language. –Discover the structure of a document/program. –Construct (implicitly.
1 “UML compilation” A more formal approach for SysML 2.0 OMG SE DSIG – SysML roadmap meeting Cambridge MA - Sep 24, 2015 Yves BERNARD.
Defects of UML Yang Yichuan. For the Presentation Something you know Instead of lots of new stuff. Cases Instead of Concepts. Methodology instead of the.
LECTURE 10 Semantic Analysis. REVIEW So far, we’ve covered the following: Compilation methods: compilation vs. interpretation. The overall compilation.
Chapter 3 – Describing Syntax
CS510 Compiler Lecture 4.
Chapter 3 Context-Free Grammar and Parsing
Introduction to Parsing (adapted from CS 164 at Berkeley)
Graph-Based Operational Semantics
(Slides copied liberally from Ruth Anderson, Hal Perkins and others)
Princess Nourah bint Abdulrahman University
Graph transformation in a Nutshell
Chapter 6 Intermediate-Code Generation
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
COMPILER CONSTRUCTION
Visual Programming Languages ICS 539 Icon System Visual Languages & Visual Programming, Chapter 1, Editor Chang, 1990 ICS Department KFUPM Sept. 1,
Presentation transcript:

ARTIST2 - MOTIVES Trento - Italy, February 19-23, 2007 Model Transformation and UML Reiko Heckel University of Leicester, UK Foundations of Model Transformation

Motivation: Model-driven Engineering ● Focus and primary artifacts are models instead of programs ● Core activities include – maintaining consistency – evolution – translation – execution of models ● These are examples of model transformations ● A math. foundation is needed for studying – expressiveness and complexity – execution and optimisation – well-definedness – preservation of semantics of transformations ● Graph transformations can be one such foundation

Outline ● Graph Transformation – why it is fun – how it works ● Semantics-preserving Model Transformation

Why it is fun: Programming By Example StageCast ( a visual programming environment for kids (from 8 years on), based onwww.stagecast.com – behavioral rules associated to graphical objects – visual pattern matching – simple control structures (priorities, sequence, choice,...) – external keyboard control  intuitive rule-based behavior modelling Next: abstract from concrete visual presentation

States of the PacMan Game: Graph-Based Presentation :Ghost :Field :PacMan marbles=3 instance graph (represents a single state; abstracts from spatial layout) type graph (specifies legal instance graphs) :Marble typing Field PacMan marbles:int Ghost Marble 1 11 * * *

Rules of the PacMan Game: Graph-Based Presentation, PacMan f1:Fieldf2:Field pm:PacMan f1:Fieldf2:Field pm:PacMan movePM pm:PacMan marbles=m f1:Fieldf2:Field :Marble f1:Fieldf2:Field pm:PacMan marbles=m+1 collect

Rules of the PacMan Game: Graph-Based Presentation, Ghost f1:Fieldf2:Field g:Ghost f1:Fieldf2:Field g:Ghost moveGhost g:Ghost f1:Fieldf2:Field :PacMan f1:Fieldf2:Field g:Ghost kill

Graph Transformation :Ghost :Field :Marble :PacMan marbles=3 :PacMan marbles=4 typing collect ; kill Field PacMan marbles:int Ghost Marble 1 11 * * *

Outline ● Graph Transformation why it is fun – how it works ● Semantics-preserving Model Transformation

A Basic Formalism: Typed Graphs Directed graphs – multiple parallel edges – undirected edges as pairs of directed ones Graph homomorphism as mappings preserving source and target Typed graphs given by – fixed type graph TG – instance graphs G typed over TG by homomorphism g g:Ghost :Field f:Field g Field PacMan marbles:int Ghost Marble G TG

Rules p: L  R with L  R well-defined, in different presentations – like above (cf. PacMan example) – with L  R explicit [DPO]: L  K  R f1:Fieldf2:Field pm:PacMan movePM: f1:Fieldf2:Field pm:PacMan

Rules p: L  R with L  R well-defined, in different presentations – like above (cf. PacMan example) – with L  R explicit [DPO]: L  K  R – with L, R integrated [UML, Fujaba]: L  R and marking ● L - R as destroyed ● R - L as new f1:Fieldf2:Field pm:PacMan movePM: {destroyed} {new}

Transformation Step  select rule p: L  R ; occurrence o L : L  G  remove from G the occurrence of L\ R  add to result a copy of R \ L f1:Field f2:Field pm:PacMan marbles=3 m2:Marble oLoL G LR p pm:PacMan marbles=m f2:Fieldf1:Field m1:Marble f2:Fieldf1:Field pm:PacMan marbles=m+1 f3:Field m1:Marble oRoR pm:PacMan marbles=4 H f1:Field f2:Field m2:Marble f3:Field

Semantic Questions: Dangling Edges ● conservative solution: application is forbidden – invertible transformations, no side-effects ● radical solution: delete dangling edges – more complex behavior, requires explicit control a:A :B ?

A bit of History … Chomsky Grammars Term Rewriting Petri Nets Graph Transformation and Graph Grammars Diagram Languages Behaviour Modelling and Visual Programming Models of Computation

Outline Graph Transformation why it is fun how it works ● Semantics-preserving Model Transformation – operational – denotational Abstract Syntax Semantic Domain denotational semantics operational semantics transformation

Example: Executable Business Process ● refactoring of business processes, replacing centralised by distributed execution ● How to demonstrate preservation of behaviour?  specify operational semantics of processes  define transformations  show that transformations preserve semantics Receive order Undo order Shipment Warehouse Office

Operational Semantics: Idea ● diagram syntax plus runtime state ● GT rules to model state transitions Abstract Syntax operational semantics

Operational Semantics: Formally GTS = (TG, P) with start graph G 0 defines transition system LTS(GTS, G 0 ) = (S, L,  ) taking – as states S all graphs reachable from G 0 – observations on rules as labels – transformations as transitions

EdgeNode Basic op: String Structured Orch name: String Msg op: String id: String SwitchInvoke src tar current tofrom partner request Reply response Elem corresponds responsible Type Graph: Metamodel …… with runtime state Abstract Syntax

Rules: Invoke another Service e:Edge tar i:Invoke o1:Orcho2:Orch current partner e:Edge tar i:Invoke o1:Orcho2:Orch current partner m:Msg id=new() op=i.op from to req(i.id, m.id) request Abstract Syntax operational semantics

Rules: Answer the Invocation e:Edge tar r:Reply o1:Orcho2:Orch current m1:Msg op=r.op fromto e:Edge tar r:Reply o1:Orcho2:Orch current m1:Msg op=r.op fromto m2:Msg id=new() op=r.op from to reply(r.id, m1.id, m2.id) response src e:Edge src e:Edge Abstract Syntax operational semantics

Rules: Receive the Response i:Invoke o1:Orcho2:Orch current src m1:Msg to from m2:Msg to from e:Edge partner i:Invoke o1:Orcho2:Orch current src e:Edge partner resp(i.id, m2.id) request response Abstract Syntax operational semantics

Simulation :Edge tar i:Invokeo1:Orcho2:Orch current partner :Edge src :Edge tar r:Reply :Edge src current m1:Msg op=i.op from to request m2:Msg op=r.op from to response Observations:req(i.id, m1.id);reply(r.id, m1.id, m2.id);resp(i.id, m2.id)

Refactoring Executable Processes ● replace local control flow by message passing … Orch 1 Orch 2 … … Orch1 Orch 2 > Orch2.op > op > op … … … … … delegate

Semantic Compatibility Processes P 1 and P 2 are semantically compatible if they are weakly bisimilar after hiding labels not in alph(P 1 ) ⋂ alph(P 2 ) Show for trafo P 1  P 2 that P 2 simulates P 1, i.e. – P 1  obs Q 1 implies P 2  obs Q 2 – Q 2 simulates Q 1 and vice versa. Approach: – mixed (local) confluence – critical pair analysis P1P1 Q1Q1 P2P2 Q2Q2 obs obs

Critical Pairs and Local Confluence ● a pair of rules (p 1, p 2 ) in a minimal conflict situation ● constructed by overlapping their left-hand sides so that they intersect in items to be deleted ● system is locally confluent if all critical pairs are G H * G2G2 G1G1 * p1p1 p2p2

Critical Pair Analysis in AGG delegate vs operational rules

Critical Pair LHS of invoke vs delegate delete-use-conflict

Outline Graph Transformation why it is fun how it works ● Semantics-preserving Model Transformation operational – denotational Abstract Syntax Semantic Domain denotational semantics operational semantics transformation

Process Improvement Motivation: – transform process to increase flexibility, performance,... – preserve behaviour! Aim: rule-level verification

Rule-level Verification r LR L R r/o s(L) s(R) G H s(G) s(H) Approach: – check for each rule r if s(L) R s(R) – make sure that s(L) R s(R) implies s(G) R s(H) semantic domain

Works if … ● we select semantic domain SD where relation R is compositional – trace or failures equivalence or refinement in CSP is closed under context ● we can show that semantic mapping s: AS  SD is compositional – maps union of graphs to composition of CSP processes  use GT to define mapping s

Context-Free Graph Grammar do something out in Act Start graph: Act in out Act in out ::= Productions in EBNF-like notation: Act in out Act [c] [not c] Concrete syntax of well-structured activity diagrams Abstract Syntax

Analysis check availability receive order notify client calculate prize send receipt [product not available] [product available]

Pair Grammar A:Act in out A1:Act in out A2:Act do something out in ::= A:Act A1:Act in out A2:Act [c] [not c] Proc(A) ::= Proc(A1) ; Proc(A2) if [c] then Proc(A1) else Proc(A2) do something Source: well-structured activity diagrams Proc(A) Target: CSP Abstract Syntax Semantic Domain denotational semantics

Synthesis Proc(A0) Proc(A1) ; Proc(A2) … Proc(A3) ; Proc (A4) ; if [product available] then Proc(A5) else Proc(A8) … receive order ; check availability ; if [product available] then calculate prize ; send receipt else notify client check availability receive order notify client calculate prize send receipt [product not available] [product available]

Good Enough … ?  Visual  abstract syntax or concrete syntax templates  Bi-directional  swap source and target grammars  Declarative  Expressive ?  context-free graph languages only  Traceable ?  through naming conventions  Efficient ?  NP complete parsing problem  …  Triple Graph Grammars (see Andy’s lecture) Challenge: verify compositionality for more complex mappings

Relevant Theory Chomsky Grammars Term Rewriting Petri Nets Graph Transformation and Graph Grammars   Formal language theory of graphs;   Diagram compiler generators   Concurrency theory   Causality and conflict   Processes, unfoldings   Event-structures   Stochastic concepts   Verification, …   Well-definedness   Termination   Confluence   Semantics of process calculi