defining the semantics of object oriented languages using
play

Defining the Semantics of Object-Oriented Languages Using Graph - PowerPoint PPT Presentation

Introduction Semantics of a Object-Oriented Language Summary Defining the Semantics of Object-Oriented Languages Using Graph Transformations Daniele Sgandurra Department of Computer Science University of Pisa A Seminar for the Ph.D. Course


  1. Introduction Semantics of a Object-Oriented Language Summary Defining the Semantics of Object-Oriented Languages Using Graph Transformations Daniele Sgandurra Department of Computer Science University of Pisa A Seminar for the Ph.D. Course on Rewriting 11/04/2007 Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  2. Introduction Semantics of a Object-Oriented Language Summary Outline Introduction 1 Model Driven Architecture Approach Semantics of a Object-Oriented Language 2 Graph Transformations TAAL Conclusion Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  3. Introduction Semantics of a Object-Oriented Language Summary Outline Introduction 1 Model Driven Architecture Approach Semantics of a Object-Oriented Language 2 Graph Transformations TAAL Conclusion Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  4. Introduction Model Driven Architecture Semantics of a Object-Oriented Language Approach Summary Design and Architecture Models are specified in diverse software languages. Platform Independent Models (PIM). Platform Specific Models (PSM). Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  5. Introduction Model Driven Architecture Semantics of a Object-Oriented Language Approach Summary Model Transformations Model transformations define relations between the languages. Horizontal transformations: PIM-to-PIM (model evolution). Vertical transformations: PIM-to-PSM (refinement). Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  6. Introduction Model Driven Architecture Semantics of a Object-Oriented Language Approach Summary Example: from UML to JAVA Figure: A UML model fragment and a corresponding Java code fragment Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  7. Introduction Model Driven Architecture Semantics of a Object-Oriented Language Approach Summary Requirement Model transformations should be correctness preserving. The transformations should not introduce errors or substantial changes. Usually, well-defined syntax but informal semantics ! Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  8. Introduction Model Driven Architecture Semantics of a Object-Oriented Language Approach Summary Formal Semantics Define in a consistent and rigorous way all the aspects of a language. Use graphs and graph transformations as the formal foundations of the language. Provide semantic definitions for the source and target language. To formulate and check the requirements of correctness preserving. Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  9. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Object-Oriented Languages A state of a program can be represented as a graph: Objects = nodes, relations between the objects = edges. State changes are represented using graph transformations. TAAL: a simple object-oriented language. Series of transformations from any TAAL program to a simulation of its execution. Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  10. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Transformation from Program to Simulation Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  11. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Transformation from Program to Simulation Figure: First two steps Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  12. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Transformation from Program to Simulation Figure: Transformation in XML Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  13. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Definitions Definition A Flat Abstract Syntax Graph is a graph representing a TAAL program in an XML format, that can be understood by the Groove tool set, in which each node represents a concept in the TAAL language. Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  14. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Flat ASG Figure: Flat ASG Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  15. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Definitions Definition A Control Flow Graph is a graph representing the intended flow of control of a TAAL program. Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  16. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Flow Graph Construction Figure: Flow Graph Construction Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  17. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Definitions Definition A Program Graph is a an extension of the Flat ASG that also contains the Control Flow Graph for the represented program. Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  18. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Program Graph Figure: Program Graph Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  19. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Definitions Definition An Execution Graph is a graph representing an executing TAAL program, which consists of three interconnected sub-graphs: the Program Graph, the Value Graph (heap) and the Frame Graph (stack). Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  20. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Execution Graphs Figure: Execution Graphs Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  21. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Objectives Use graphs and graph transformations (GTs) to define language semantics. Mapping the language constructs to graphs. Objects are nodes. Mapping the operational semantics to GT rules. State changes are GTs. Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  22. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Definitions Definition A graph G = < V , E > consists of: a set V of vertices ( nodes ); a set E ⊆ V × Lab × V of edges . Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  23. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Definitions Definition A graph transformation rule p = < L , R , N > consists of: a graph L being the left hand side of the rule; a graph R being the right hand side of the rule; a set of graphs N being the negative application conditions (NAC). Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  24. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Application of a GT Rule L = left hand side of the rule. R = right hand side of the rule. Applying a GT rules transforms a graph G , the source graph, into a graph H , the target graph. Find an occurrence of L in G and replace it with R . 1 The resulting graph is H . 2 The rule is not applied in presence of a NAC in G that 3 extends L . Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  25. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Application of a GT Rule L = left hand side of the rule. R = right hand side of the rule. Applying a GT rules transforms a graph G , the source graph, into a graph H , the target graph. Find an occurrence of L in G and replace it with R . 1 The resulting graph is H . 2 The rule is not applied in presence of a NAC in G that 3 extends L . Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  26. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Application of a GT Rule L = left hand side of the rule. R = right hand side of the rule. Applying a GT rules transforms a graph G , the source graph, into a graph H , the target graph. Find an occurrence of L in G and replace it with R . 1 The resulting graph is H . 2 The rule is not applied in presence of a NAC in G that 3 extends L . Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

  27. Introduction Graph Transformations Semantics of a Object-Oriented Language TAAL Summary Conclusion Application of a GT Rule L = left hand side of the rule. R = right hand side of the rule. Applying a GT rules transforms a graph G , the source graph, into a graph H , the target graph. Find an occurrence of L in G and replace it with R . 1 The resulting graph is H . 2 The rule is not applied in presence of a NAC in G that 3 extends L . Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend