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

defining the semantics of object oriented languages using
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

slide-2
SLIDE 2

Introduction Semantics of a Object-Oriented Language Summary

Outline

1

Introduction Model Driven Architecture Approach

2

Semantics of a Object-Oriented Language Graph Transformations TAAL Conclusion

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-3
SLIDE 3

Introduction Semantics of a Object-Oriented Language Summary

Outline

1

Introduction Model Driven Architecture Approach

2

Semantics of a Object-Oriented Language Graph Transformations TAAL Conclusion

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-4
SLIDE 4

Introduction Semantics of a Object-Oriented Language Summary Model Driven Architecture Approach

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

slide-5
SLIDE 5

Introduction Semantics of a Object-Oriented Language Summary Model Driven Architecture Approach

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

slide-6
SLIDE 6

Introduction Semantics of a Object-Oriented Language Summary Model Driven Architecture Approach

Example: from UML to JAVA

Figure: A UML model fragment and a corresponding Java code fragment

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-7
SLIDE 7

Introduction Semantics of a Object-Oriented Language Summary Model Driven Architecture Approach

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

slide-8
SLIDE 8

Introduction Semantics of a Object-Oriented Language Summary Model Driven Architecture Approach

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

slide-9
SLIDE 9

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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

slide-10
SLIDE 10

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Transformation from Program to Simulation

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-11
SLIDE 11

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Transformation from Program to Simulation

Figure: First two steps

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-12
SLIDE 12

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Transformation from Program to Simulation

Figure: Transformation in XML

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-13
SLIDE 13

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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

slide-14
SLIDE 14

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Flat ASG

Figure: Flat ASG

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-15
SLIDE 15

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Definitions

Definition A Control Flow Graph is a graph representing the intended flow

  • f control of a TAAL program.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-16
SLIDE 16

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Flow Graph Construction

Figure: Flow Graph Construction

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-17
SLIDE 17

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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

slide-18
SLIDE 18

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Program Graph

Figure: Program Graph

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-19
SLIDE 19

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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

slide-20
SLIDE 20

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Execution Graphs

Figure: Execution Graphs

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-21
SLIDE 21

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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

slide-22
SLIDE 22

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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

slide-23
SLIDE 23

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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

slide-24
SLIDE 24

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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.

1

Find an occurrence of L in G and replace it with R.

2

The resulting graph is H.

3

The rule is not applied in presence of a NAC in G that extends L.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-25
SLIDE 25

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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.

1

Find an occurrence of L in G and replace it with R.

2

The resulting graph is H.

3

The rule is not applied in presence of a NAC in G that extends L.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-26
SLIDE 26

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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.

1

Find an occurrence of L in G and replace it with R.

2

The resulting graph is H.

3

The rule is not applied in presence of a NAC in G that extends L.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-27
SLIDE 27

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL 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.

1

Find an occurrence of L in G and replace it with R.

2

The resulting graph is H.

3

The rule is not applied in presence of a NAC in G that extends L.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-28
SLIDE 28

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Graph Production System

GT rules are collected into graph production systems (GPSs). GPSs model transformations or computation processes. Application of successive individual rules until a graph cannot be transformed any further.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-29
SLIDE 29

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Non-Determinism

There might be more than one occurrence of L in G: non-determinism. A GPS is confluent if the order of the applications of the rules does not change the final result.

The flow graph construction step is confluent. The simulation step is deterministic.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-30
SLIDE 30

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example of a Graph Transformation Rule

Figure: L and R separated

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-31
SLIDE 31

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example of a Graph Transformation Rule

Figure: L and R in one graph

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-32
SLIDE 32

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Graph Elements

Readers: required to be in the source graph and still present in the target graph. Erasers: required to be in the source graph and deleted by rule application. Creators: not required to be in the source graph and created by rule application. Negative application conditions: forbidden to occur in a graph to apply the rule.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-33
SLIDE 33

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: Modeling a Circular Buffer

Figure: Empty buffer

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-34
SLIDE 34

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: Modeling a Circular Buffer

Figure: Put element in the buffer

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-35
SLIDE 35

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: Modeling a Circular Buffer

Figure: Get element from the buffer

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-36
SLIDE 36

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

The Mini Language TAAL

TAAL Java-like language. Includes the notions of class, attribute, operation, inheritance . . . The result of the parsing and static analysis of a TAAL program is a Flat Abstract Syntax Graph.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-37
SLIDE 37

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

A Simple TAAL Program

program amoebaworld {new Amoeba.clone()} class Amoeba child: Amoeba; clone() : Amoeba { child := new Amoeba(); return child; } endclass endprogram

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-38
SLIDE 38

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

In Java..

public class Amoeba { Amoeba child = null; public Amoeba(){}; public Amoeba clone() { return (this.child = new Amoeba()); } public static void main(String args[]) { new Amoeba().clone(); } }

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-39
SLIDE 39

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Flat Abstract Syntax Graph

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-40
SLIDE 40

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Flat Abstract Syntax Graph

Figure: Flat ASG of the example program (simplified)

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-41
SLIDE 41

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Flow Graph Construction

Analysis of the control flow and construction of the flow graph elements. The final result is the program graph: flat ASG + flow graphs Flow Graphs: directed graphs with 5 types of nodes. Connected with successor-edges.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-42
SLIDE 42

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Flow Graph Nodes and Edges

Procedure nodes: statements or expression after which the next statement is deterministic. Predicate nodes: executable statements and expressions related to a Boolean condition. Context nodes: start and end node of each flow graph. Edges: sequential relations between statements.

1

flowNext;

2

flowTrue;

3

flowFalse.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-43
SLIDE 43

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Flow Elements

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-44
SLIDE 44

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Flow Graph

Figure: Flow Graph meta-model

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-45
SLIDE 45

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Program Graph

The Program Graph is built by applying graph production rules that add control flow information to the given Flat ASG.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-46
SLIDE 46

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Program Graph = Flat ASG + Flow Graphs

Figure: Program graph of the example (flow graphs are highlighted)

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-47
SLIDE 47

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Program Graph

A program graph is the starting point for correctly simulating the execution of the system. It contains: the flat abstract syntax graph, containing nodes and edges representing abstract syntax elements; flow graphs, modeling the sequential execution relation between executable statements.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-48
SLIDE 48

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

The Last Step: Simulation

The graphs being transformed according to GT rules are called the execution graphs. Snapshots of the program state. Define the operational semantics of TAAL using GT.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-49
SLIDE 49

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

The Last Step: Simulation

Applying the GPS to the flow graph gives rise to a transition system:

Graphs are states, rules applications are transitions.

Simulation of the program execution. Deterministic: at any time, at most one rule of the GPS is applicable.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-50
SLIDE 50

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Execution Graphs

Each execution graph combines three kinds of information:

1

a program graph: static context information;

2

a value graph: models the data part of the current state (heap);

3

a frame graph: models the process part of the current state (stack);

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-51
SLIDE 51

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Value Graph

It contains elements representing the object created and referred during the program’s execution (heap). Two new concepts:

value: any data value; slot: a container for such value.

Slots can represent:

program variables: VarSlot (associated with a VarDecl); holder of tmp values: AuxSlot (bound to Expression).

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-52
SLIDE 52

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Value Graph

Figure: Value Graph meta-model

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-53
SLIDE 53

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Frame Graph

It models the process part of the current state (stack). It introduces a new type of node:

frame: it stands for the execution of the program fragment at a ContextNode and a program counter.

The frame has a pointer (pc for program counter) to the FlowElement in the corresponding graph, where control currently resides.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-54
SLIDE 54

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Frame Graph

Figure: Frame Graph meta-model

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-55
SLIDE 55

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: a Simple TAAL Program

program amoebaworld {new Amoeba.clone()} class Amoeba child: Amoeba; clone() : Amoeba { child := new Amoeba(); return child; } endclass endprogram

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-56
SLIDE 56

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: Fragment of an Execution Graph

Figure: State of the example program before the return statement

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-57
SLIDE 57

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Operational Semantics

The graph transformation rules define the dynamic semantics of TAAL. The rules define the effect of the statements and expressions on the value graph and frame graph. Starting from the program graph, each rule application corresponds to the execution of a step in the program.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-58
SLIDE 58

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: Transition System

Figure: Transition System of the simulation of the example program (edges = rule names)

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-59
SLIDE 59

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Simulation Rules

Three categories of simulation rules:

1

flow execution;

2

  • bject creation;

3

method lookup.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-60
SLIDE 60

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Simulation Rules: Flow Element Execution

One or two rules per kind of FlowElement, describing the function of the element. Triggered when a pc-edge from a Frame (Frame Graph) node arrives in instance of a flow element type (Program Graph). VarCallExp: an expression that retrieves the value of a variable.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-61
SLIDE 61

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: VarCallExp-attribute

Figure: Expression that retrieves the value of an instance variable

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-62
SLIDE 62

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Simulation Rules: Object Creation

Allocating and initializing nodes for a new object and its instance variables.

1

Allocation: object creation occurs when control reaches a CreateExp-instance. A ConstrFrame and an ObjectVal are created.

2

Initialization: all attributes have an initializing expressions.

3

Termination: a ConstrFrame terminates when a pc-edge has arrived back at the ObjectType.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-63
SLIDE 63

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: CreateExp

Figure: Create expression

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-64
SLIDE 64

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: ObjectType-ascend

Figure: Type of created object has supertype

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-65
SLIDE 65

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: ObjectType-init

Figure: Type of created object does not have supertype

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-66
SLIDE 66

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: ObjectType-descent

Figure: Supertype attribute slots have been created

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-67
SLIDE 67

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: ObjectType-return

Figure: All attribute slots have been created

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-68
SLIDE 68

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Simulation Rules: Method Lookup

This is the phase occurring each time after a method is called through an OperCallExp. The call creates a new OperFrame. The OperFrame is started by creating a pc-edge for it.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-69
SLIDE 69

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Method Lookup

1

Frame creation.

2

Method lookup.

3

Parameter passing.

4

Return.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-70
SLIDE 70

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example: OperVirtualCallExp

Figure: Lookup of method implementation starting at the dynamic type of the target object

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-71
SLIDE 71

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Tools

TAAL Eclipse plug-in: parsing and static analysis. Groove: editing and displaying graphs and graph production rules and applying rules to concrete graphs.

editor: to specify graphs and GT; simulator: GTs can be performed and tracked; imager: generates figures from graphs (PNG, JPEG).

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-72
SLIDE 72

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Java

A paper by Corradini et al.: Encoding of Java programs to GT Systems. Basic rules: common to all programs. Specify the

  • perational meaning of the operators.

Program specific rules: one rule for each method or constructor declared in the program, which are replaced with their corresponding body.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-73
SLIDE 73

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Order of Execution

To guarantee the same order of execution of statements as in JVM:

Every control edge has two additional tentacles: IN & OUT. To enforce sequential execution: unique GO hyperedge.

Every rule consumes the GO token connected to the IN and generates the token to the OUT.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-74
SLIDE 74

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Basic Rule Example: GET

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-75
SLIDE 75

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Example of Java Declaration

public class Person{ private int identifier; public int getIdentifier(){ return identifier;} public void setIdentifier(int n){ identifier = n;} public Person(int identifier){ this.identifier = identifier;} }

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-76
SLIDE 76

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Program Specific Rule Example: getIdentifier

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-77
SLIDE 77

Introduction Semantics of a Object-Oriented Language Summary Graph Transformations TAAL Conclusion

Java and TAAL

Java is widely used. The program graph changes dynamically (in TAAL is static). No frame graph, but program-dependent rules.

One rule per method/constructor.

No tools support.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-78
SLIDE 78

Introduction Semantics of a Object-Oriented Language Summary

Summary Programming languages can be defined using graphs and GT rules. Visual representation of the GT rules provides an intuitive understanding of the semantics. Future development Model checking techniques for verifying object-oriented programs.

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs

slide-79
SLIDE 79

Introduction Semantics of a Object-Oriented Language Summary

References:

◮ [TAAL] Anneke Kleppe, Harmen Kastenberg and Arend Rensink Engineering Object-Oriented Semantics Using Graph Transformations. University of Twente, 2006 ◮ [Paper] Anneke Kleppe, Harmen Kastenberg and Arend Rensink Defining Object-Oriented Execution Semantics Using Graph Transformations. FMOODS, 2006. ◮ [MDE] L. Grunske, L. Geiger, A. Zuendorf, N. Van Eetvelde, P. Van Gorp and D. Varro Using Graph Transformation for Practical Model Driven Software Engineering. Model-driven Software Development, 2005 ◮ [Java] Andrea Corradini, Fernando Luís Dotti, Luciana Foss and Leila Ribeiro Translating Java Code to Graph Transformation Systems. International Conference on Graph Transformation, 2004 ◮ [GT1] Andrea Corradini A Tutorial on Graph Transformation. Brazilian Symposium on Formal Methods, 2005 ◮ [GT2] Reiko Heckel Graph Transformation in a Nutshell. University of Leicester, United Kingdom

Daniele Sgandurra Defining Object-Oriented Semantics Using GTs