Model Transformations Require Formal Semantics Yu Sun 1, Zekai Demirezen 1, Tomaz Lukman 2, Marjan Mernik 3, Jeff Gray 1 1 Department of Computer and Information.

Slides:



Advertisements
Similar presentations
Verification of DSMLs Using Graph Transformation: A Case Study with Alloy Zekai Demirezen 1, Marjan Mernik 1,2, Jeff Gray 1, Barrett Bryant 1 1 Department.
Advertisements

Introduction to Programming Languages Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.
LIFE CYCLE MODELS FORMAL TRANSFORMATION
AUTOMATIC GENERATION OF CODE OPTIMIZERS FROM FORMAL SPECIFICATIONS Vineeth Kumar Paleri Regional Engineering College, calicut Kerala, India. (Currently,
UNIT-III By Mr. M. V. Nikum (B.E.I.T). Programming Language Lexical and Syntactic features of a programming Language are specified by its grammar Language:-
Presented by: Thabet Kacem Spring Outline Contributions Introduction Proposed Approach Related Work Reconception of ADLs XTEAM Tool Chain Discussion.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
CS 355 – Programming Languages
This research is supported by NSF CAREER award CCF A Demonstration-based Approach to Support Live Transformations in a Model Editor Yu SunUniversity.
Automatic Verification of Component-Based Real-Time CORBA Applications Gabor Madl Sherif Abdelwahed
Train Control Language Teaching Computers Interlocking By: J. Endresen, E. Carlson, T. Moen1, K. J. Alme, Haugen, G. K. Olsen & A. Svendsen Synthesizing.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 12: Semantic Analysis COMP 144 Programming Language Concepts Spring 2002 Felix.
Institute For Software Integrated Systems Vanderbilt University Applications of Model Integrated Computing to The Synchronous Language Signal Ethan Jackson.
PSUCS322 HM 1 Languages and Compiler Design II Formal Semantics Material provided by Prof. Jingke Li Stolen with pride and modified by Herb Mayer PSU Spring.
Verifying Distributed Real-time Properties of Embedded Systems via Graph Transformations and Model Checking Gabor Madl
On the Correctness of Model Transformations Gabor Karsai ISIS/Vanderbilt University.
Describing Syntax and Semantics
Mining Metamodels From Instance Models: The MARS System Faizan Javed Department of Computer & Information Sciences, University of Alabama at Birmingham.
An Information Theory based Modeling of DSMLs Zekai Demirezen 1, Barrett Bryant 1, Murat M. Tanik 2 1 Department of Computer and Information Sciences,
1 Legacy System Evolution through Model-Driven Program Transformation Funded by the DARPA Information Exploitation Office (DARPA/IXO), under the Program.
Bridging the chasm between MDE and the world of compilation Nondini Das 1.
Robert Tairas, Marjan Mernik, Jeff Gray Using Ontologies in the Domain Analysis of Domain-Specific Languages Workshop on Transformation and Weaving Ontologies.
Yu SunUniversity of Alabama at Birmingham PAR Works Jeff Gray University of Alabama Montpellier, France July 3rd, 2013 This research is supported.
Yu Sun 1, Zekai Demirezen 1, Marjan Mernik 2, Jeff Gray 1, Barret Bryant 1 1 Department of Computer and Information Sciences, University of Alabama at.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,
POSAML: A Visual Language for Middleware Provisioning Dimple Kaul, Arundhati Kogekar, Aniruddha Gokhale ISIS, Dept.
Key Challenges for Modeling Language Creation by Demonstration Hyun Cho, Jeff Gray Department of Computer Science University of Alabama Jules White Bradley.
A Semantic Framework for DSLs Zekai Demirezen Advisor: Dr. Jeff Gray Doctoral Symposium OOPSLA 2009 Software Composition and Modeling Lab This work funded.
Building Tools by Model Transformations in Eclipse Oskars Vilitis, Audris Kalnins, Edgars Celms, Elina Kalnina, Agris Sostaks, Janis Barzdins Institute.
Institute for Software Integrated Systems Vanderbilt University Copyright © Vanderbilt University/ISIS 2008 Model Interpreters Janos Mathe based on Peter.
Model-Driven Analysis Frameworks for Embedded Systems George Edwards USC Center for Systems and Software Engineering
Replicators: Transformations to Address Model Scalability Jeff Gray, Yuehua Lin, Jing Zhang, Steve Nordstrom, Aniruddha Gokhale, Sandeep Neema, and Swapna.
Verification and Validation in the Context of Domain-Specific Modelling Janne Merilinna.
Vanderbilt University 23 July 2003 Metamodel Based Model Migration Jonathan Sprinkle Dissertation Defense Given toward satisfaction of the requirements.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Semantic Foundations for Model-Integrated Computing A panel at the First OMG MIC Workshop Arlington, VA October 14, 2004 Jeff Gray, University of Alabama.
This research is supported by NSF CAREER award CCF A WYSISYG Approach forConfiguring Model Layout using Model Transformations Yu SunUniversity.
Verification of behavioural elements of UML models using B Truong, Ninh-Thuan and Souquieres, Jeanine In Proceedings of the 2005 ACM Symposium on.
Contact Profile (1/2) Yu Sun, University of Alabama at Birmingham Hyun Cho, University of Alabama Jeff Gray, University of Alabama Jules White, Virginia.
Toward a Semantic Anchoring Infrastructure for Domain-Specific Modeling Languages Kai Chen Janos Sztipanovits Sandeep Neema Matthew Emerson Sherif Abdelwahed.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
ISBN Chapter 3 Describing Semantics.
Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu.
Chapter 3 Part II Describing Syntax and Semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics In Text: Chapter 3.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
A Generative Approach to Model Interpreter Evolution Jing Zhang, Jeff Gray, and Yuehua Lin {zhangj, gray, cis.uab.edu Dept. of Computer & Information.
Weaving a Debugging Aspect into Domain-Specific Language Grammars SAC ’05 PSC Track Santa Fe, New Mexico USA March 17, 2005 Hui Wu, Jeff Gray, Marjan Mernik,
1 Model-based Aspect Weaver Construction Suman Roychoudhury Frédéric Jouault Jeff Gray {roychous, jouault, cis.uab.edu This project is supported.
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
Programming Language Descriptions. What drives PL Development? Computers are “in charge” of extremely important issues Execute a program literally. Exercise.
Model Transformation for End-Users
Ontology Support for Abstraction Layer Modularization Hyun Cho, Jeff Gray Department of Computer Science University of Alabama
Model-Driven Synthesis of Embedded Robotic Navigation Systems Rachael Dennison Bina Shah
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
C HAPTER 3 Describing Syntax and Semantics. D YNAMIC S EMANTICS Describing syntax is relatively simple There is no single widely acceptable notation or.
Carnegie Mellon Vadim Zaliva, Franz Franchetti Carnegie Mellon University Department of Electrical and Computer Engineering Funded by the DARPA I2O HACMS.
Model Transformation By Demonstration Yu Sun, Jules White, Jeff Gray This work funded in part by NSF CAREER award CCF CIS Dept. – University of.
AUTOMATIC GENERATION OF MODEL TRAVERSALS FROM METAMODEL DEFINITIONS Authors: Tomaž Lukman, Marjan Mernik, Zekai Demirezen, Barrett Bryant, Jeff Gray ACM.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Prologue Sung-Dong Kim, Dept. of Computer Engineering, Hansung University.
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
Software Design Methodology
Model-Driven Analysis Frameworks for Embedded Systems
Design of Transmission Pipeline Modelling Language
Semantics In Text: Chapter 3.
A Generative Approach to Model Interpreter Evolution
Presentation transcript:

Model Transformations Require Formal Semantics Yu Sun 1, Zekai Demirezen 1, Tomaz Lukman 2, Marjan Mernik 3, Jeff Gray 1 1 Department of Computer and Information Sciences, University of Alabama at Birmingham {yusun, zekzek, 2 Jožef Stefan Institute Dept. of Systems and Control 3 University of Maribor, Slovenia This work funded in part by NSF CAREER award CCF

Overview Motivation Background Methods for Representing Semantics in Grammarware Case Study Model Transformation has to preserve behavior Goals Define Optimization for the DSML Define a Semantics for the DSML Metamodeling Environments C [[ left ]] (x,y) = (x+Δx,y+Δy) where Δx=-1 and Δy=0 C [[ right ]] (x,y) = (x+Δx,y+Δy) where Δx=+1 and Δy=0 C [[ down ]] (x,y) = (x+Δx,y+Δy) where Δx=0 and Δy=-1 C [[ up ]] (x,y) = (x+Δx,y+Δy) where Δx=0 and Δy=+1 C [[ C1 C2 ]] (x,y) = let (x+Δx1, y+Δy1) = C [[ C1]] (x,y) in let (x+Δx1+Δx2, y+Δy1+Δy2) = C [[ C2]] (x+Δx1, y+Δy1) in (x+Δx1+Δx2, y+Δy1+Δy2) Prove the Optimization Correctness Robot DSL/DSML

Motivation  A primary shortcoming that can be found in many model transformation approaches and tools is the lack of formal semantics to define the meaning of a modeling abstraction  An example of transformation is the modification of a particular source code (or model) to support some desired optimization  One essential requirement of optimization is to ensure that the semantics of the program (or model) is preserved in the whole process of optimization  The more mature foundation of programming language theory could be used to define the semantics of a DSL such that a formal optimization proof is realizable

Approaches to Define Language Semantics Attribute grammar is a context-free grammar augmented with attributes and semantic rules. Denotational semantics formalizes the meanings of a programming language by constructing mathematical objects. Operational semantics specifies a programming language in terms of program execution on abstract machines.

Robot DSL GRAMMAR P  Program C  Command P ::= begin C end C ::= left | right | up | down | C1C2 PROGRAM begin left up down up end DENOTATIONAL SEMANTICS P : Program → Int*Int P [[ begin C end ]]= C [[ C ]] (0,0) C :: Command → Int*Int → Int*Int C [[ left ]] (x,y) = (x+Δx,y+Δy)where Δx=-1 and Δy=0 C [[ right ]] (x,y) = (x+Δx,y+Δy)where Δx=+1 and Δy=0 C [[ down ]] (x,y) = (x+Δx,y+Δy) where Δx=0 and Δy=-1 C [[ up ]] (x,y) = (x+Δx,y+Δy)where Δx=0 and Δy=+1 C [[ C1 C2 ]] (x,y) = let (x+Δx1, y+Δy1) = C [[ C1]] (x,y) in let (x+Δx1+Δx2, y+Δy1+Δy2) = C [[ C2]] (x+Δx1, y+Δy1) in (x+Δx1+Δx2, y+Δy1+Δy2)

Program Optimization in DSL  In Optimization 1, the sequence of moves can be rearranged so that the same type of moves are adjacent  The rationale behind Optimization 1 is that the robot can move faster if there is no need to change the direction  In Optimization 2, some combinations of moves have no effect and can be eliminated

Optimization Correctness in DSL Since: C [[ C1 C2 ]] (0,0) = let (Δx1, Δy1) = C [[ C1]] (0,0) in let (Δx1+Δx2, Δy1+Δy2) = C [[ C2]] (Δx1, Δy1) in (Δx1+Δx2, Δy1+Δy2) C [[ C2 C1 ]] (0,0) = let (Δx2, Δy2) = C [[ C2]] (0,0) in let (Δx2+Δx1, Δy2+Δy1) = C [[ C1]] (Δx2, Δy2) in (Δx2+Δx1, Δy2+Δy1) Also: (Δx1+Δx2, Δy1+Δy2) = (Δx2+Δx1, Δy2+Δy1) (due to associativity of +) We can get: C [[ C1 C2 ]] (0,0) = C [[ C2 C1 ]] (0,0) Therefore: P [[ begin C1 C2 end ]] = P [[ begin C2 C1 end ]] To prove "begin C1 C2 end" = "begin C2 C1 end" We have to show that: P [[ begin C1 C2 end ]] = P [[ begin C2 C1 end ]] In other words, we have to prove: C [[ C1 C2 ]] (0,0) = C [[ C2 C1 ]] (0,0)

DSML Semantics  Can we utilize a DSL semantics formalism to define optimizations in DSML?  Current state of the art tools  GME  Atom 3  GEMS  Kermeta

Model Interpretation Model Interpreters Models Modeling Environment Application Domain App 1 App 2 App 3 Application Evolution Environment Evolution Metamodeling Interface Metamodel Definition Meta-Level Translation Model Builder DSML Platforms and Semantics GME MetamodelMetamodel ModelModel InterpreterInterpreter void CComponent::InvokeEx(CBuilder &buil der,CBuilderObject *focus, CBui lderObjectList &selected, long param) { CString DMSRoot = ""; DMSRoot = SelectFolder("Please Select DMS Root Folder:"); if (DMSRoot != "") { DMSRulePath = DMSRoot + RULESPATH + "Rules\\"; MSRuleApplierPath = DMSRoot + RULESPATH + "RuleApplier\\"; AfxMessageBox("DMSRulePath = " + DMSRulePath, MB_OK); CString OEPRoot = ""; OEPRoot = SelectFolder("Please Selec DEFINE INTERPRET The semantics of the a DSML is hard-coded into the model interpreter

DSML Platforms and Semantics Atom 3 Graph Rewriting Pos_x Pos_y Pos_x-- Pos_y = LHSRHS Left Action Semantics Robot Metamodel

DSML Platforms and Semantics GEMS Interpreter Robot Metamodel Robot Semantics public class RobotInterpreter extends AbstractInterpreter{ public void visitLeft(Left tovisit) { } public void visitRight(Right tovisit) { … } public void visitUp(Up tovisit) { … } public void visitDown(Down tovisit) { … } int temp_x = Integer.parseInt((String)(tovisit. getParent().getAttribute("Pos_x"))); int temp_y = Integer.parseInt((String)(tovisit. getParent().getAttribute("Pos_y"))); MakeAction((Robot)(tovisit.getParent()), tovisit, temp_x, temp_y); displayRobotPosition(tovisit); visitContainer(tovisit); int temp_x=Integer.parseInt((String)(tovisit. getParent().getAttribute("Pos_x"))); int temp_y=Integer.parseInt((String)(tovisit. getParent().getAttribute("Pos_y"))); MakeAction((Robot)(tovisit.getParent()), tovisit, temp_x,temp_y); displayRobotPosition(tovisit); visitContainer(tovisit);

DSML Platforms and Semantics Kermeta Robot Metamodel Robot Semantics class Robot { attribute pos_x:int; attribute pos_y:int; reference actionList:Action[0..1]; operation run():int is do actionList.move(this); end } class Action{ operation move(r:Robot ):int is do end } class Left{ operation move(r:Robot):int{ r.pos_x:=r.pos_x-1; } Run() Move(Robot r)

Problems Related with DSML Semantics  Lack of semantic reasoning, which is needed for proofs  Lack of formal proof of the optimization  Hard to comprehend semantics  Hard to generate model interpreters automatically  Difficulties in compiler verification  Limitations in proving properties of domain concepts  Lack of connection between Transformation and Semantic Layers

Defining DSML Optimization  Model Transformation by Example Optimization #1 Optimization #2

Model Optimization in DSML Optimization #1 Optimization #2

Conclusion  Due to the lack of formal semantics for DSMLs, the real meaning of a modeling language is available only in associated model interpreters  As a consequence, model transformations cannot be verified for preserving the semantics  Traditional programming language theory could be used to define the semantics of a DSML such that a formal optimization proof is realizable  Future Work: Proof for DSML optimization

 Question ?  Comments ? This work funded in part by NSF CAREER award CCF

Robot DSML Syntax Metamodel Semantics Metamodel