1 Budapest University of Technology and Economics Department of Measurement and Information Systems Budapest University of Technology and Economics Fault.

Slides:



Advertisements
Similar presentations
Budapest University of Technology and EconomicsDagstuhl 2004 Department of Measurement and Information Systems 1 Towards Automated Formal Verification.
Advertisements

SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
Programming Logic and Design Fourth Edition, Introductory
MP IP Strategy Stateye-GUI Provided by Edotronik Munich, May 05, 2006.
Automated creation of verification models for C-programs Yury Yusupov Saint-Petersburg State Polytechnic University The Second Spring Young Researchers.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
COSC 120 Computer Programming
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Visual Web Information Extraction With Lixto Robert Baumgartner Sergio Flesca Georg Gottlob.
Analysis Modeling Over view of today’s lesson T he analysis model is the first technical representation of a system. Analysis modeling uses a combination.
Application architectures
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Guide To UNIX Using Linux Third Edition
Systems Analysis and Design in a Changing World, 6th Edition
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
CS102 Introduction to Computer Programming
02/06/05 “Investigating a Finite–State Machine Notation for Discrete–Event Systems” Nikolay Stoimenov.
Systems Analysis and Design in a Changing World, Fifth Edition
Introduction 01_intro.ppt
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
Chapter 6 The Traditional Approach to Requirements
Systems Analysis and Design in a Changing World, Fifth Edition
Systems Analysis – Analyzing Requirements.  Analyzing requirement stage identifies user information needs and new systems requirements  IS dev team.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
CS 355 – Programming Languages
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Xactium xDSLs Run Models Not Code Tony Clark
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
CIS Computer Programming Logic
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
DEVSView: A DEVS Visualization Tool Wilson Venhola.
Java Class Syntax CSIS 3701: Advanced Object Oriented Programming.
Software Engineering 2003 Jyrki Nummenmaa 1 CASE Tools CASE = Computer-Aided Software Engineering A set of tools to (optimally) assist in each.
Building Tools by Model Transformations in Eclipse Oskars Vilitis, Audris Kalnins, Edgars Celms, Elina Kalnina, Agris Sostaks, Janis Barzdins Institute.
Object-Oriented Programming (OOP). Implementing an OOD in Java Each class is stored in a separate file. All files must be stored in the same package.
Chapter Two ( Data Model) Objectives Introduction to Data Models What are the Data Models Why they are important Learn how to design a DBMS.
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
Selected Topics in Software Engineering - Distributed Software Development.
Summarizing the Content of Large Traces to Facilitate the Understanding of the Behaviour of a Software System Abdelwahab Hamou-Lhadj Timothy Lethbridge.
COMPUTER PROGRAMMING. A Typical C++ Environment Phases of C++ Programs: 1- Edit 2- Preprocess 3- Compile 4- Link 5- Load 6- Execute Loader Primary Memory.
1 Introduction to Software Engineering Lecture 1.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Object-Oriented Software Engineering using Java, Patterns &UML. Presented by: E.S. Mbokane Department of System Development Faculty of ICT Tshwane University.
Automata Based Method for Domain Specific Languages Definition Ulyana Tikhonova PhD student at St. Petersburg State Politechnical University, supervised.
Visual Specification of a DSL Processor Debugger Tamás Mészáros and Tihamér Levendovszky Budapest University of Technology and Economics.
Chapter 1 Introduction Study Goals: Master: the phases of a compiler Understand: what is a compiler Know: interpreter,compiler structure.
Metadata By N.Gopinath AP/CSE Metadata and it’s role in the lifecycle. The collection, maintenance, and deployment of metadata Metadata and tool integration.
LanguageLab A Meta-modelling Environment Terje Gjøsæter and Andreas Prinz, University of Agder, Norway SDL Forum 2015, Berlin, Germany.
 Programming - the process of creating computer programs.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Chapter – 8 Software Tools.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Advanced Computer Systems
Learning to Program D is for Digital.
Physical Data Model – step-by-step instructions and template
Input Space Partition Testing CS 4501 / 6501 Software Testing
TDL: The ETSI Test Description Language
TDL: The ETSI Test Description Language
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
TDL: The ETSI Test Description Language
Programming Logic and Design Eighth Edition
Presentation transcript:

1 Budapest University of Technology and Economics Department of Measurement and Information Systems Budapest University of Technology and Economics Fault Tolerant Systems Research Group Execution of the Models, Code Generation

2 Functions of Modelling Environments Code Generation Eclipse Based Modelling Environments Content

3 FUNCTIONS OF MODELLING ENVIRONMENTS Functions Code Generation Eclipse Based Environments

4 Functions of Modelling Environments Model Edit Display Trace back Nézet Views Demo internal: event A event B TextualGraphicalOther environments

5 Functions of Modelling Environments Model Source code Configuration Documentation Transformation Edit Display Trace back Nézet Views Functional Description System description Corresponding program + Information: How to generate? (file names, strategies, …) Settings, lay outs, …

6 Functions of Modelling Environments Model Edit Display Trace back Simulation Nézet Views Interactions Display Experiences Tuning of system parameters Potential course of actions System description + Information: parameter and context of the system

7 Concrete syntax (for the User) Graphical: Textual: Concrete syntax (for the User) Graphical: Textual: Modelling Functions of Yakindu Demo internal: event A event B Model (Abstract syntax) Modelling functions Model verification Code generation (Source code, documentation, configuration) Modelling functions Model verification Code generation (Source code, documentation, configuration) Syntax  Semantics

8 Abstract Syntax  Definition: Structural model of the system under editing  Will be maintained by the modelling environment  Memory aid: structural model = Graph o Graph of nodes, edges, properties

9 Example – Abstract Syntax: Yakindu Example: Yakindu Model Question: How would you implement a modelling environment tool? Abstract Syntax

10 Example – Abstract Syntax: Yakindu Example: Yakindu Model Abstract Syntax Names are stored as strings name = "X" Relations as references Model elements as objects Answer: It is a simple object-oriented program with some extra functions Question: How would you implement a modelling environment tool?

11 Concrete Syntax: Textual Syntax  Goal: representation  the model behind  Textual syntax (e.g. programs) o Task: Text  Model o Rule based (otherwise it would be hard!) Demo internal: event A event B With appropriate technologies (e.g. Xtext) anyone can implement his own modelling/programming environment! Grammar ::= * ::= (" internal "| ) " : " * ::= " event " ::= … Abstract Syntax Statechart A internal Demo event B

12 Counterexample for „appropriate technologies” (?:(?:\r\n)?[ \000-\031]+(?:(?:(?:\r\n)?[ \t] \t]))*"(?:(?: \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \000-\031]+(?:(?:( ?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \000-\0 31]+(?:(?:(?:\r\n)?[ ](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \000-\031]+ (?:(?:(?:\r\n)?[ (?:\r\n)?[ \000- \031]+(?:(?:(?:\r\n)?[ \t])+|\Z \t]))*"(?:(?:\r\n) ?[ \000- \031]+(?:(?:(?:\ r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \000-\031]+(?:(?:(?:\r\n) ?[ \t] \000-\031]+(?:(?:(?:\r\n)?[ \t])* )(?:\.(?:(?:\r\n)?[ \000-\031]+(?:(?:(?:\r\n)?[ \t] \t])*))*) *:(?:(?:\r\n)?[ \000-\031]+(?:(?:(?:\r\n)?[ \t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[ \t])+|\Z|(?=[\[ \t]))*"(?:(?:\r\n)?[ \t]) \000-\031]+(?:(?:(?:\r\n)?[ \t]) \t])*)(?:\.(?:(?:\r\n)?[ \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z \t])*))*\>(?:( ?:\r\n)?[ \t])*))*)?;\s*) Forrás:  Task: to decide whether a text consists of addresses A single address or a list Route specific information may appear Optionally names may also appear Hierarchical structure with '.' separator

13  Goal: representation  the Model behind  Graphical Syntax (e.g. diagram) o Task: Diagram  Model o More clear to read, harder to write, rule based Condition satisfied  Diagram element will be created Diagram will be changed  Model will also be changed Condition over the Model Creation of diagram elements Concrete Syntax: Graphical Syntax

14 Concrete Syntax: Graphical Syntax Result: With appropriate technologies (e.g. Sirius) anyone can implement his own modelling/programming environment!

15 Model Validation: Syntax Analysis  Syntax analysis: modelling tools connect logically cascading model elements  Syntax-driven editor o Fault during editing  Couldn’t resolve reference o Advanced editor (offering possibilities for instance)  Code and diagram together  Programming:incorrect during editing Modelling:correct during editing Declaration in interface: var clock: integer = 60 Usage in model: after 1 s [clock>0]/ clock -= 1

16 Model Validation: Structural Correctness  Structural analysis: examining model graph  Looking for error-patterns during editing  Unreachable state, for instance:  Further analysis: missing initial state, deadlock, variable assignment, etc. Node is not reachable.

17 CODE GENERATION Functions Code Generation Eclipse Based Environments

18 Tasks of the Code Generation  Task: automatic generation of models with corresponding behaviour  Several options  Design decisions o Interpretation: Model will be loaded and executed o or Program code: Source code will be generated programming languages: Java, C, C++, … o Optimising:memory vs. processor observability vs. performance o How can the generated code be extended with manually coded parts?  Code generator: customizable + extendable

19 Code Generators – Example  Task: Generate C-code for a Yakindu state machine  Write a function, which:  takes a model object  returns a text  The text will be written is a file „Demo.c”  It will be compiled (by a C-compiler) Demo internal: event A event B

20 Template Based Code Generator (Xtend)  Goal: States  Enum  Solution: a C program sprintf(result, "enum states {\n\tState%s,\n\tState%s\n};", state1->name, state2->name);  Template (Xtend): ''' enum_states { _ _ State«state1.name», __ _State«state2.name» }''' Works immediately!  Unreadable Easier to write More clear to read Easier to modify  +1 technology A template will be written The variable parts will be indicated enum states { StateX, StateY }; The output will be collected in a char*, instead %s will the names X,Y be written

21 Code Generator Example – States  Expected C-code: //States of the statemachine enum states { StateX, StateY };  Template: //States of the statemachine enum_states { «FOR state : states» State«state.name», «ENDFOR» }; Demo internal: event A event B 1.We iterate through all states 2.Their names will be written (separated by commas): State«Name» e.g.: StateX Possible states: listed as an Enum

22 Code Generator Example – Initial State  Expected C-code: // The current state // First = entry state. enum states actualState = StateX  Template: // The current state // First = entry state. enum states actualState = State«findEntry(states).name» Demo internal: event A event B 1. We search for the initial element 2. Its name will be written current state = initial state

23 Code Generator Example – State Transitions  Expected C-code: // Execute "A" event void doA{ switch(actualState) { case StateX: actualState = StateY; break; case StateY: break; } } Demo internal: event A event B A / X  Y A / - For a (simple) state machine the code generator is nothing more than this!  Template (sketch): 1.For each event a function do«NameOfEvent» 2.Its content corresponds to the transitions (with guard, action)

24 Code Generator – Summary  Code generation = translation  Same steps:  Working in the domain of the problem: Produktivity ++  Many boring, complex coding automatizedPerformance ++  Checking in the domain of the problem: Reliability ++  Projects at our research group: up to 95% generated code State machine CAssembly Machine code

25 ECLIPSE BASED ENVIRONMENTS Functions Code Generation Eclipse Based Environments

26 EclipseLink: Java Objects  Databases  Task: Storage of the objects in a database  Solution: Modelling the relations with annotations public class Car long identifier; String numberPlate; Person owner; } IdentifierNumberPlateOvner_ID 1EGG KSS KAF98456 Car_Table

27 XMind: Mindmap Editor

28 Bonita: Modelling of Business Processes

29 Kalypso: Hydrological Design + Simulation