Grammars. Prof. Andreas Prinz. Introduction, Compilers. Examples Meta-models vs. Grammars Summary

Similar documents
Static analysis and testing of executable DSL specification

Metamodeling with Metamodels. Using. UML/MOF including OCL

with openarchitectureware

Proceedings of the 6th Educators Symposium: Software Modeling in Education at MODELS 2010 (EduSymp 2010)

The Eclipse Modeling Framework and MDA Status and Opportunities

Language engineering and Domain Specific Languages

Introduction to OpenArchitectureWare

Plan. Language engineering and Domain Specific Languages. Language designer defines syntax. How to define language

Model driven Engineering & Model driven Architecture

Model-Driven Language Engineering

Metamodeling. 16. April 2012 Real-Time Systems Lab Prof. Dr. Andy Schürr Dr. Gergely Varró 1

MDD with OMG Standards MOF, OCL, QVT & Graph Transformations

A Model-based Standard for SDL

A Metamodel for SDL-2000 in the Context of Metamodelling ULF

Introduction to MDE and Model Transformation

Model Driven Engineering (MDE)

Implementing the eodl graphical representation

Outline. A little history. Outline. The Unified Modeling Language Opportunities and Challenges for Formal Methods

ECLIPSE MODELING PROJECT

Developing Web-Based Applications Using Model Driven Architecture and Domain Specific Languages

Model transformations. Model transformations. Model transformations. Model transformations

It s all Done with Mirrors Patterns and OCL. KMF Kent Modelling Framework D.H.Akehurst and O.Patrascoiu

Model-Driven Engineering (MDE) Lecture 1: Metamodels and Xtext Regina Hebig, Thorsten Berger

Coral: A Metamodel Kernel for Transformation Engines

Multi-level Language Descriptions

Deriving a textual notation from a metamodel: an experience on bridging Modelware and Grammarware

Introduction to Dependable Systems: Meta-modeling and modeldriven

All you need are models Anneke Kleppe, Klasse Objecten

Model-based Software Engineering (02341, spring 2017) Ekkart Kindler

Model transformations. Overview of DSLE. Model transformations. Model transformations. The 4-layer architecture

Eclipse technology in IFMS Interface Management System

Preserving Non-essential Information Related to the Presentation of a Language Instance. Terje Gjøsæter and Andreas Prinz

Migration of Pogo7 Templates

Reconciling TGGs with QVT

Modellierung operationaler Aspekte von Systemarchitekturen. Master Thesis presentation. October 2005 March Mirko Bleyh - Medieninformatik

CISC836: Models in Software Development: Methods, Techniques and Tools

On Implementing MOF 2.0 New Features for Modelling Language Abstractions

Computation Independent Model (CIM): Platform Independent Model (PIM): Platform Specific Model (PSM): Implementation Specific Model (ISM):

A Comparison of Ecore and GOPPRR through an Information System Meta Modeling Approach

LEMP: a Language Engineering Model-driven Process

Towards the Harmonisation of UML and SDL

OCL Support in MOF Repositories

Construction of Complex UML Profiles

This paper is more intended to set up a basis for a constructive discussion than to offer definitive answers and closed solutions.

A Proposed Engine Implementation Mechanism to Execute the Code of Relations Query/View/Transformation Language

Science of Computer Programming. Aspect-oriented model-driven skeleton code generation: A graph-based transformation approach

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

The Unified Modelling Language. Example Diagrams. Notation vs. Methodology. UML and Meta Modelling

Softwaretechnik. Lecture 19: Model Driven Engineering. Peter Thiemann. University of Freiburg, Germany

Software Industrialization

Model-based Software Engineering (02341, spring 2016) Ekkart Kindler

Dresden OCL2 in MOFLON

Metamodeling and Metaprogramming Seminar

Comparing Relational Model Transformation Technologies Implementing QVT with Triple Graph Grammars

Syntax and Grammars 1 / 21

Enabling High Quality Executable Domain Specific Language Specification

Computer Science at Kent

Modelling in Enterprise Architecture. MSc Business Information Systems

A little History Domain Specific Languages Examples Tools Benefits A more theoretical View Programming and Modeling The LWES Project Bonus: Best

The etrice Eclipse Project Proposal

Navigating the MetaMuddle

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

Christian Doppler Laboratory

Softwaretechnik Model Driven Architecture Meta Modeling

openarchitectureware 4.1 An introduction

Model-Driven Iterative Development of 3D Web-Applications Using SSIML, X3D and JavaScript

GMF Tooling 3.0 Vision, Architecture, Roadmap

Modelling Constraints

Kermeta tutorial. How to create a metamodel. François Tanguy, Didier Vojtisek. Abstract

Modelling SDL, Modelling Languages

ETL: Epsilon Transformation Language. MISO - Uniandes

What Every Xtext User Wished to Know Industry Experience of Implementing 80+ DSLs

An Introduction to MDE

Describing Computer Languages

BIG MODELS AN ALTERNATIVE APPROACH

OCL Tooling for OMG specifications

New and Noteworthy. Peter Friese Bernd Kolb

DRAFT. Consolidation of the Generator Infrastructure MDGEN Model Driven Generation

A Metamodel-based Simulator for ASMs

Overview of the KeY System

MDA & Semantic Web Services Integrating SWSF & OWL with ODM

Defining Domain-Specific Modeling Languages

Automation of Semantic Web based Digital Library using Unified Modeling Language Minal Bhise 1 1

Eclipse Development Tools for Epsilon

Model Driven Ontology: A New Methodology for Ontology Development

Enhancing Xtext for General Purpose Languages

Enabling Component-Based Model Transformations with QVT. Li Dan

Design and Prototypical Implementation of a Pivot Model as Exchange Format for Models and Metamodels in a QVT/OCL Development Environment

Model Transformation Testing Challenges

Model Querying with Graphical Notation of QVT Relations

Orccad, a Model Driven Architecture and Environment for Real-Time Control. Soraya Arias Florine Boudin Roger Pissard-Gibollet Daniel Simon

A Metamodel independent approach for Conflict Detection to support distributed development in MDE. Mostafa Pordel A THESIS

A Formal Approach to Modeling and Model Transformations in Software Engineering

Model Transformation Techniques

ATHABASCA UNIVERSITY RULE ENHANCED BUSINESS PROCESS MODELING OF SERVICE ORIENTED ARCHITECTURES LUIS ROCHA. A project submitted in partial fulfillment

Model Driven Architecture

developer.* The Independent Magazine for Software Professionals

Model Abstraction versus Model to Text Transformation

Model Driven Development Unified Modeling Language (UML)

Model Driven Engineering (MDE) and Diagrammatic Predicate Logic (DPL)

Transcription:

Meta-models and Grammars Prof. Andreas Prinz Introduction, Compilers Modelling & Meta-modelling Examples Meta-models vs. Grammars Summary

Compilers Graphical Editor Parser Text editor Static checks (OCL) Abstract Syntax Meta-model dl MOF-structure Exchange Format (XMI, ASN.1) Test case derivation Code generation Proofs Solved: many input/output p formats Graphical / Domain specific languages, many transformations Internal representation: Meta-model vs. Abstract syntax Prepared by Andreas Prinz 2

Importance of internal structure (html web pg) page) Representation (xml check descr.) generated code (python code) (web page model) Model (checking model) generated Model (code model) (access. checker) checking Tools transformation tool generated tool (type,consistency) t (checks compiler) (access. checker) Prepared by Andreas Prinz 3

Aspects of Compilers/Languages Language structure: What are the concepts? How are they related? Static semantics: additional conditions, what is allowed? Representation: How are programs written? -> graphical vs. textual Dynamic semantics: What do the programs mean? How to generate code for them? Prepared by Andreas Prinz 4

Aspects of a language & tools Graphical editor graphical run Representation Behaviour textual Structure transform Simulator Transformator Textual editor Exchange format Parser Access interface Repository Constraints Checker XMF Mosaic from Xactium as example tool set. Idea: The metamodel IS the tool. Prepared by Andreas Prinz 5

Aspects for SDL and UML Representation graphical Behaviour run informal EBNF formal ASM Structure textual formal EBNF transform Representation graphical Behaviour run informal informal Structure textual formal meta-model transform Constraints formal PC1 Constraints formal OCL SDL UML Prepared by Andreas Prinz 6

What is a Model? A model is an abstraction of a (part of a) system. one model describes several systems, one system can have several models simplified view of a system with respect to criteria can answer questions about the system if related to the view needs a representation, e.g. using a modelling language Models on different abstraction levels Models of the real Bits: Assembler Models of the Control Flow: Prog. Lang. Models of data storage: Database descriptions Models of access: Interface languages What is the best model of a cat? It is a cat. But it has to be the same cat! A model has aspects like a language. Prepared by Andreas Prinz 7

What are Meta-Models? A description of a class of models Models / high-level descriptions of the modelling language narrow view: structure of the modelling language g wider view: all important aspects of the language, i.e. structure, presentation, static ti and dynamic semantics Meta-models (languages) can have several aspects. Prepared by Andreas Prinz 8

Language support MDA and Eclipse HUGN Action Representation Behaviour Structure HUTN MOF QVT GEF/GMF --- Representation Behaviour Structure Xtext Xtend EMF Xpand Constraints OCL Constraints OCL MDA Eclipse (oaw) Prepared by Andreas Prinz 9

A meta-modelling architecture «component» MOF OMG Level Examples Grammar example OCL example M3 «component» UML Metamodel «component» UML Model «component» User Data M2 M1 3 = meta MOF EBNF MOF meta model 2 = meta UML MM Java OCL model grammar language 1 = model UML Model a program a formula 0 = real objects A run a truth instances value M0 Prepared by Andreas Prinz 10

Instances on several levels Class name : String isabstract:boolean M3 Property name:string * owned- Attribute Class:Class name = Class isabstract =false name : String isabstract:boolean M2 Class name : String isabstract:boolean Class:Class name = Class isabstract =false M1 Person :Property name = isabstract :Property name= name M0 :Person Prepared by Andreas Prinz 11

Simple sample structure (EMF) Puzzle dimension Field 1..* Column Row column row field cells Cell cellvalue l cellsb cellsr cellsc Box box Prepared by Andreas Prinz 12

Simple sample constraints (OCL) context Field inv uniqueicellvalues: self.cells->forall(c1,c2 : Cell c1<>c2 implies c1.icellvalue <> c2.icellvalue) context Cell inv rowfromcell: self.row -> size()=1 context Puzzle inv numberofboxes: self.elements->select(f : Field f.oclistypeof(box)) -> size()=9 Prepared by Andreas Prinz 13

Simple sample text syntax (TEF) syntax toplevel PuzzleTpl, ecorepath " { element CellTpl for Cell{ single for icellvalue, with INTEGER; } element RowTpl for Row{ "Row"; "("; sequence for cellsinrow, with @CellTpl, seperator ",", last false; ")"; } element PuzzleTpl for Puzzle{ "Puzzle"; "("; single for idimension, with INTEGER; ")"; "="; sequence for Elements, with @FieldTpl, seperator ",",, last false; } choice FieldTpl for Field{ @RowTpl } } Prepared by Andreas Prinz 14

Simple sample graphics Sudoku Diagram rows subsets diacontents Row Container cells subsets contents Cell Rectangle Prepared by Andreas Prinz 15

Simple sample transformation (QVT) transformation theone (source : sudoku, target: sudoku){ top relation change1to16 { checkonly domain source sudoku:cell { icellvalue = 1 }; enforce domain target sudoku:cell { icellvalue = 16 }; } top relation change6to11 { checkonly domain source newstructure:cell { icellvalue = 6 }; enforce domain target newstructure:cell { icellvalue = 11 }; } top relation nochange { value: Integer; checkonly domain source newstructure:cell { icellvalue = value }; enforce domain target newstructure:cell { icellvalue = value }; when{ icellvalue <> 1 or icellvalue <> 6; } } } Prepared by Andreas Prinz 16

Simple sample execution Run(s:Sudoku) = def forall f in self.field do RunF(f) Runf(f:Field) = def choose c in self.cell with c.value=null and c.possible.size = 1 choose v in c.possible do c.value:= v choose c in self.cell with c.value<>null forall cc in self.cell do delete c.value from cc.possible Prepared by Andreas Prinz 17

Problem area execution Syntax Runtime Meta-model Cell RTCell Model X:Cell A: RTCell B: RTCell e.g. history Prepared by Andreas Prinz 18

Problem area representation There are usually several representations for the same meta-model instances. Tools and theory exist only for the case 1:1. A representation is a separate model that is related to the meta-model. Sig1: SignalDefinition signal Sig1, Sig2; signal Sig1; signal Sig2; signal Sig1; Sig2: SignalDefinition signal Sig2; Prepared by Andreas Prinz 19

Meta-models versus grammars Advantages of grammars Strong mathematical basis Tree-based Trees can be extended into general graphs Several advanced tools available Easily understandable Advantages of meta-models Direct representation of graphs (graphics!) Namespaces and relations between language elements (in particular for language transformations and combinations) Object-oriented definition of oo languages More problem-oriented Reuse and inheritance Tools allow direct handling of models (repositories) Structuring possible (e.g. packages) Prepared by Andreas Prinz 20

Grammars meta-models 1. Every symbol is represented with a class. 2. A rule with a single symbol on the rhs is represented with an association between the class representing the lhs and the rhs. 3. A rule with a composition on the rhs is represented with an association for every sub-expression. 4. A rule with an alternative on the rhs is represented with a generalization for every sub-expression. 5. A sub-expression consisting of just one symbol is represented with the symbol s class. 6. A sub-expression being a composition or an alternative is represented with a new class with new name. The composition is then handled like a rule. Prepared by Andreas Prinz 21

Using the transformation for SDL Joachim Fischer, Michael Piefel, Markus Scheidgen: A Metamodel for SDL-2000 in the Context of Metamodelling ULF in Proceedings of SAM2006 Introduction of abstract concepts General: namespace, namedelement, typedelement Specific: parametrizedelement, bodiedelement Introduction of relations Procedure name versus procedure definition Deletion of grammar artefacts Referencing: identifier, qualifier Names in general Superfluous structuring Prepared by Andreas Prinz 22

Conclusions / Summary Future languages g will be defined using meta-models. definition of good meta-models is difficult need also agreement (standard) patterns for good models needed, maybe joint concepts Meta-models / Languages have several aspects: structure, syntax, static and dynamic semantics Meta-model language definitions allow tool generation Direct access to the models Easy exchange of representation or several of them Combination of tools handling the language Description of relations between languages Meta-models are the models to be used in model- driven compiler technology. Prepared by Andreas Prinz 23