Graph transformation in a Nutshell

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
ARTIST2 - MOTIVES Trento - Italy, February 19-23, 2007 Model Transformation and UML Reiko Heckel University of Leicester, UK Foundations of Model Transformation.
Binary Trees CSC 220. Your Observations (so far data structures) Array –Unordered Add, delete, search –Ordered Linked List –??
Foundations of Model Transformations A “lambda calculus” for MDD ? Reiko Heckel University of Leicester, UK.
Behaviour-Preserving Model Transformation Arend Rensink, University of Twente IPA Spring Days, 18 April 2012.
1 Data Modeling : ER Model Lecture Why We Model  We build models of complex systems because we cannot comprehend any such system in its entirety.
Analyzing the Requirements with Formal Specifications Vienna Development Method Specification Language (VDM-SL) Book: Formal Software Development From.
Detailed design – class design Domain Modeling SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Introduction to Graph Grammars Fulvio D’Antonio LEKS, IASI-CNR Rome,
1 Graph-Based State Spaces Arend Rensink, University of Twente CamPaM 2012 April 2012Graph-Based State Spaces.
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
An Introduction to Graph Rewriting Thomas Huining Feng CHESS, UC Berkeley May.
Computer Science: A Structured Programming Approach Using C Graphs A graph is a collection of nodes, called vertices, and a collection of segments,
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Complete Graphs A complete graph is one where there is an edge between every two nodes A C B G.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
® IBM Software Group © 2009 IBM Corporation Essentials of Modeling with the IBM Rational Software Architect, V7.5 Module 15: Traceability and Static Analysis.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Finding Reusable UML Sequence Diagrams Automatically By: William N. Robinson and Han G. Woo From: IEEE Software (September/October 2004) Presented by:
What is this? SE-2030 Dr. Mark L. Hornick 1. Same images with different levels of detail SE-2030 Dr. Mark L. Hornick 2.
Generalizing Similar Functions
Chapter 0: Introduction
Analysis Classes Unit 5.
Object-Orientated Analysis, Design and Programming
UML Diagrams By Daniel Damaris Novarianto S..
Databases Chapter 9 Asfia Rahman.
Control Flow Testing Handouts
Lectures linked lists Chapter 6 of textbook
Data Structure Interview Question and Answers
Formal Modeling Concepts
Multi-Step Equations How to Identify Multistep Equations |Combining Terms| How to Solve Multistep Equations | Consecutive Integers.
Testing Validity With Venn Diagrams
Arab Open University 2nd Semester, M301 Unit 5
COMPSCI210 Recitation 12 Oct 2012 Vamsi Thummala
CS 5010 Program Design Paradigms “Bootcamp” Lesson 4.1
Ch. 4 – Semantic Analysis Errors can arise in syntax, static semantics, dynamic semantics Some PL features are impossible or infeasible to specify in grammar.
Lecture Trees Chapter 9 of textbook 1. Concepts of trees
Specifications Liskov Chapter 9
Outline of the Chapter Basic Idea Outline of Control Flow Testing
UML Diagrams Jung Woo.
Syntax-based Testing CS 4501 / 6501 Software Testing
Unilateral Neglect, Spatial Attention, Object-Based Attention
Chapter 2 Database Environment.
NORMA Lab. 2 Revision: Unary and Binary Fact Types Ternary Fact Types
Constrained Bipartite Vertex Cover: The Easy Kernel is Essentially Tight Bart M. P. Jansen June 4th, WORKER 2015, Nordfjordeid, Norway.
Find in a linked list? first last 7  4  3  8 NULL
Programming Languages 2nd edition Tucker and Noonan
Subject Name:Sysytem Software Subject Code: 10SCS52
CHAPTER 2 Context-Free Languages
NORMA Lab. 5 Duplicating Object Type and Predicate Shapes
vms x Year 8 Mathematics Equations
Software Construction Lecture 2
Introduction to Data Structures
Spreadsheets, Modelling & Databases
Non-fiction text features
Tutorial 10: Programming with javascript
Data Structures & Algorithms
Non-fiction text features
Introduction to Graph Transformation
What is Happening? Level 2 Copy Rights A. J. Dupree.
How to Use i2b2 URL to i2b2: Questions?
Generalizing Similar Functions
Lesson 9: Basic Monte Carlo integration
Programming Languages 2nd edition Tucker and Noonan
Lecture 23 NP-Hard Problems
Software Architecture & Design
Tree (new ADT) Terminology: A tree is a collection of elements (nodes)
Presentation transcript:

Graph transformation in a Nutshell Author: Reiko Heckel Presented by : Azadeh Assadi

Contents Modeling Generalization Type and Instance Graphs Rules and Transformations Constraints Multi-objects Application Conditions Control Conditions Use StageCast and the example of developing a PacMan game to illustrate these points

Modeling by example Modeling: Generalization Build models as representations of reality Rules and transformations

Generalization Behavioural Generalization: Looking at extracting rules as it applies to the model and its scope Rules are specifications of state transformations Conceptual generalization: Create types/concepts Each with instances Relationship between instance and the type/concept is defined

Type and Instance Graphs Graph = Vertices (V) + edges (E) where E has s(e) and t(e) So you could put these types together to create a graph

Type and Instance Graphs Graph = Vertices (V) + edges (E) where E has s(e) and t(e) Vertices: P:PacMan, G:Ghost, M:Marble, F1:field, F2:field, …

Type and Instance Graphs Graph = Vertices (V) + edges (E) where E has s(e) and t(e) Edges: represent the current location of a character/concept as well as the neighborhood relation of fields

Type and Instance Graphs Type Graph: the type(concept) level and its instance graphs the individual snapshots. i.e. at any given instance, each of the concepts are associated to one Field

Type and Instance Graphs Vertices may contain attributes to store values of pre-defined data types Attributes (a) would have a type-level (T) declaration (a:T) And an instance-level occurrence or value (v) (a-v)

Rules and Transformations Rules can be created as one graph instance is transformed into another specific graph instance In this case, this is how the Collect rule would be created One could then create rules as needed based on two different instances of a graph that would relate to eachother

Rules and Transformations Which can be generalized to this. The PacMan has two rules, collect(p) and movePM(p) rules

Rules and Transformations Rules can be created as one graph instance is transformed into another specific graph instance And this would make the Kill rule

Rules and Transformations Which can be generalized to this. The ghosts therefore can have two rules, kill(g) and moveGhost(g) rules Rules and Transformations

Rules and Transformations Rules generate transformations by replacing in a given graph an occurrence of the one state with another. 3 steps to go from Pre-state G to post-state H Find an occurrence oL of the left hand side L in the given graph G

Rules and Transformations Rules generate transformations by replacing in a given graph an occurrence of the one state with another. 3 steps to go from Pre-state G to post-state H Find an occurrence oL of the left hand side L in the given graph G Delete from G all vertices and edges matched by L/R Deletes this edge b/c it no longer exists in R while it did in L

Rules and Transformations Rules generate transformations by replacing in a given graph an occurrence of the one state with another. 3 steps to go from Pre-state G to post-state H Find an occurrence oL of the left hand side L in the given graph G Similarly with the Marble

Rules and Transformations Rules generate transformations by replacing in a given graph an occurrence of the one state with another. 3 steps to go from Pre-state G to post-state H Find an occurrence oL of the left hand side L in the given graph G Delete from G all vertices and edges matched by L/R Deletes this edge and vertex b/c it no longer exists in R while it did in L

Rules and Transformations Rules generate transformations by replacing in a given graph an occurrence of the one state with another. 3 steps to go from Pre-state G to post-state H Find an occurrence oL of the left hand side L in the given graph G Delete from G all vertices and edges matched by L/R Paste to the result a copy of R/L, to arrive at H

Rules and Transformations The total behavior of the game then is set by the set of all sequence of consecutive transformation steps G0 → Gn Based on the rules developed for the game and a valid instance graph G0 Must also make sure that there are no dangling edges as a result of a deletion – i.e. valid transformations must be performed This Photo by Unknown Author is licensed under CC BY-SA

What Do You See? I know I’ve asked this question before, but it’s a good question so I’ll ask it again! What do you see? So depending on what features you focus on you can see a few different things. You can either see an old couple facing eachother, you can see two ppl singing and playing music together, Or you see a golden vase in the centre. Obviously this is an optical illusion and they are interesting in many ways but the point I want to make here with this example that relates to this topic is that your mind transforms images so seamlessly and quickly that you could see any one of the possible illusions at any given time. This ofcourse can’t happen in code and you want to apply controls or constrains to limit variability in interpretation. e.g. fix the elements to a given feature. Beard not guitar, etc.

Constraints Dangling edge: caused by the fact that a node in a graph have an unknown number of connections Can constrain the number of connections E.g. each Ghost, Pacman, or marble vertex is linked to exactly one Field vertex

Constraints Can also represent more complex constraints as graphs – i.e. forbidden subgraph Therefore constraints restrict the set of admissible instance graphs that can be used to control the transformation process by ruling out transformations leading to non-admissible graphs

Multi-objects Similar to the simple case will go through the same three steps of find, delete and paste to go from one state to the next having applied the rules – in this case the SuperPM rule which kills al the ghosts in the vicinity of Pacman

Multi-objects Similar to the simple case will go through the same three steps of find, delete and paste to go from one state to the next having applied the rules – in this case the SuperPM rule which kills al the ghosts in the vicinity of Pacman

Application conditions Here the graph transformation rule check for empty marble fields Here the application of the rule depends on the graph G and the chosen occurrence

Application conditions At the metamodel level Generalizes the pre-defined gluing conditions of algebraic (true or false) approach

Control conditions On a global level, control structures lead to programmed graph transformations

Control conditions On a global level, control structures lead to programmed graph transformations Can also have node-label controlled (NLC) Double pushout graph rewriting (DPO graph rewriting): deletion and addition. After a match from the left hand to G is fixed, noted and edges that are not in the right hand side are deleted. Right hand side is then glued in

A Medical Application A Proof of Concept

A Medical Application Attributes 1-n Attributes 1-n Attributes 1-n

A Medical Application As long as all the attributes of each of these types are maintained and the concepts appear in this specific order in the transformation, the rhythm can be considered as sinus The details of each type is learned from the patient

A Medical Application So when this rhythm appears, because its out of keeping with what is allowed or considered sinus, the rhythm gets labeled as pathological. **In reality, the permutations of the acceptable variations in the attributes that fall within the realm of normal are nearly infinite Therefore hard to analyze using this approach alone

For Discussion Questions? Where else could this be applied to?

Some Examples FuJaba: “from UML to JAVA And Back Again” Open source CAE tool providing developers with support for model-based software engineering and re- engineering Progres: for PROgrammed graph rewriting system AGG: “Attributed Graph Grammar” system Visual programming environment based on graph transformation and Java On a global level, control structures lead to programmed graph transformations