+ All Categories
Home > Science > Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Date post: 25-Jun-2015
Category:
Upload: tanja-mayerhofer
View: 195 times
Download: 0 times
Share this document with a friend
Description:
At the MODELS 2014 conference, we presented a generic framework for performing semantic model differencing based on behavioral semantics specifications. Model differencing is concerned with the identification of differences among independently developed or consecutive versions of models. Therewith, it constitutes the basis for performing change management tasks, such as model merging, model versioning, and conflict detection. The majority of existing model differencing approaches focus on revealing syntactic differences among models. While syntactic differences provide important information for performing change management tasks, they can only approximate semantic differences among models with respect to the meaning of models. Thus, they cannot account for the fact that models with many syntactic differences may have the same semantics and few syntactic differences may induce very different semantics. Therefore, semantic model differencing is required that takes the semantics of models into account. We developed a generic semantic model differencing framework, which can be instantiated to realize semantic model differencing operators for specific modeling languages. The framework utilizes the behavioral semantics specification of the used modeling language to execute the models to be compared and capture execution traces representing the models’ semantic interpretations. Based on these semantic interpretations, semantic differences are revealed in the form of diff witnesses that are semantic interpretations valid only for one of the compared models.
Popular Tags:
47
Semantic Model Differencing Utilizing Behavioral Semantics Specifications www.modelexecution.org Philip Langer, Tanja Mayerhofer, Gerti Kappel Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 911/1883, 1040 Vienna, Austria phone: 43 (1) 5880118804 (secretary), fax: 43 (1) 5880118896 [email protected], www.big.tuwien.ac.at
Transcript
Page 1: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Semantic Model Differencing Utilizing Behavioral Semantics Specifications

www.modelexecution.orgg

Philip Langer, Tanja Mayerhofer, Gerti Kappel

Business Informatics GroupInstitute of Software Technology  and Interactive Systems Vienna University of Technology

p g , j y , pp

Favoritenstraße 9‐11/1883, 1040 Vienna, Austriaphone: 43 (1) 5880118804 (secretary), fax: 43 (1) [email protected], www.big.tuwien.ac.at

Page 2: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

MotivationMotivation

Models are subject to change  Change management for models is required

Model differencing Goal: Identify differences among models Applications: Merging, versioning, conflict detection, incremental testing, etc.

Syntactic model differencing Procedure: Matching Differencing Procedure: Matching ‐ Differencing Output: Syntactic differences (add, delete, update operations)

Semantic model differencing Takes semantics of models into account Enables additional analyses of changes (e.g., semantic preservation) Provides basis for comprehending the evolution of models

2

Page 3: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Syntactic Model DifferencingMotivating Example Syntactic Model Differencing

M1

p3

t1p1 p2 p4t2

M2

t1p1 p2 p3t2 t3 p4

+

t1p1 p2 p3t2 t3 p

3

Page 4: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Syntactic Model DifferencingMotivating Example Syntactic Model Differencing

1. MatchingM1

Identify corresponding elements based on Identifiers

p3

Identifiers Signatures Similarity

t1p1 p2 p4t2

Custom matchingM2

t1p1 p2 p3t2 t3 p4

+

t1p1 p2 p3t2 t3 p

4

Page 5: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Syntactic Model DifferencingMotivating Example Syntactic Model Differencing

1. MatchingM1

Identify corresponding elements based on Identifiers

p3

Identifiers Signatures Similarity

t1p1 p2 p4t2

Custom matching (names)M2

t1p1 p2 p3t2 t3 p4

+

t1p1 p2 p3t2 t3 p

5

Page 6: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Syntactic Model DifferencingMotivating Example Syntactic Model Differencing

1. MatchingM1

Identify corresponding elements based on Identifiers

p3

Identifiers Signatures Similarity

t1p1 p2 p4t2

Custom matching (names)

2. DifferencingM2

Compare corresponding elements

t1p1 p2 p3t2 t3 p4

+

Identify non‐corresponding elements

t1p1 p2 p3t2 t3 p

6

Page 7: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Syntactic Model DifferencingMotivating Example Syntactic Model Differencing

1. MatchingM1

Identify corresponding elements based on Identifiers

p3

Identifiers Signatures Similarity

t1p1 p2 p4t2

p3 removed as outputp3 removed as inputp3 added as output

Custom matching (names)

2. DifferencingM2

!

p3 removed as output p3 added as output p4 removed as output

! Compare corresponding 

elementst1p1 p2 p3t2 t3 p4

++! !

Identify non‐corresponding elements

t1p1 p2 p3t2 t3 p

t3 added

7

Page 8: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Syntactic Model DifferencingMotivating Example Syntactic Model Differencing

Which impact do the changes have on the model(‘s semantics)?

1. MatchingM1

Which impact do the changes have on the model( s semantics)?

Identify corresponding elements based on Identifiers

p3

Identifiers Signatures Similarity

t1p1 p2 p4t2

p3 removed as outputp3 removed as inputp3 added as output

Custom matching (names)

2. DifferencingM2

!

p3 removed as output p3 added as output p4 removed as output

! Compare corresponding 

elementst1p1 p2 p3t2 t3 p4

++! !

Identify non‐corresponding elements

t1p1 p2 p3t2 t3 p

t3 added

8

Page 9: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Introduction to Semantic Model DifferencingIntroduction to Semantic Model Differencing

Semantics of a modeling language1

Mapping : Language → Semantic domain Assigns meaning to each conformant model Provides (semantic) interpretations of models

i d l diff iSemantic model differencing Procedure:

Obtain semantic interpretations of models Obtain semantic interpretations of models Analyze semantic interpretations

Output: Semantic differencesp Semantic interpretations valid for one model but not for the other one Witness semantic differences among models (diff witnesses2)

9

1 D. Harel, B. Rumpe. Meaningful Modeling: What’s the Semantics of “Semantics”? IEEE Computer, 37(10):64–72, 2004.2 S. Maoz et al. A Manifesto for Semantic Model Differencing. MODELS’10, volume 6627 of LNCS, pages 194–203. Springer, 2011.

Page 10: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Semantic Model DifferencingMotivating Example Semantic Model Differencing

Petri netsSemantics Firing of transitions leading to markings 

(token distributions)M1

(token distributions)

Semantic interpretation

p3

Semantic interpretation Traces (order of transition firings) Reachable markings

t1p1 p2 p4t2

Semantic differencel l d d l

M2

Traces only valid in one model Markings only reachable in one model Final markings only reached by one modelt1p1 p2 p3t2 t3 p4

+

Final markings only reached by one modelt1p1 p2 p3t2 t3 p

10

Page 11: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Semantic Model DifferencingMotivating Example Semantic Model Differencing

Petri netsSemantics Firing of transitions leading to markings 

(token distributions)M1

(token distributions)

Semantic interpretation

p3

Semantic interpretation Traces (order of transition firings) Reachable markings

t1p1 p2 p4t2

Semantic differencel l d d l

M2

Traces only valid in one model Markings only reachable in one model Final markings only reached by one modelt1p1 p2 p3t2 t3 p4

+

Final markings only reached by one modelt1p1 p2 p3t2 t3 p

11

Page 12: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Semantic Model DifferencingMotivating Example Semantic Model Differencing

Petri netsSemantic interpretation

M1

M : p1=1 p2=0 p3=0 p4=0p3

M0,M1: p1=1, p2=0, p3=0, p4=0

M0

t1p1 p2 p4t2

M2

t1p1 p2 p3t2 t3 p4

+

t1p1 p2 p3t2 t3 p

12

Page 13: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Semantic Model DifferencingMotivating Example Semantic Model Differencing

Petri netsSemantic interpretation

M1

M : p1=1 p2=0 p3=0 p4=0p3

M0,M1: p1=1, p2=0, p3=0, p4=0M1,M1: p1=0, p2=1, p3=1, p4=0

M0

t1p1 p2 p4t2

M2

t1p1 p2 p3t2 t3 p4

+

t1p1 p2 p3t2 t3 p

13

Page 14: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Semantic Model DifferencingMotivating Example Semantic Model Differencing

Petri netsSemantic interpretation

M1

M : p1=1 p2=0 p3=0 p4=0p3

M0,M1: p1=1, p2=0, p3=0, p4=0M1,M1: p1=0, p2=1, p3=1, p4=0M2,M1: p1=0, p2=0, p3=0, p4=1M0

t1p1 p2 p4t2

M2

t1p1 p2 p3t2 t3 p4

+

t1p1 p2 p3t2 t3 p

14

Page 15: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Semantic Model DifferencingMotivating Example Semantic Model Differencing

Petri netsSemantic interpretation

M1

M : p1=1 p2=0 p3=0 p4=0p3

M0,M1: p1=1, p2=0, p3=0, p4=0M1,M1: p1=0, p2=1, p3=1, p4=0M2,M1: p1=0, p2=0, p3=0, p4=1M0

t1p1 p2 p4t2

M2 M0,M2: p1=1, p2=0, p3=0, p4=0M : p1=0 p2=1 p3=0 p4=0

t1p1 p2 p3t2 t3 p4

+M1,M2: p1=0, p2=1, p3=0, p4=0M2,M2: p1=0, p2=0, p3=1, p4=0M3,M2: p1=0, p2=0, p3=0, p4=1

M0

t1p1 p2 p3t2 t3 p

15

Page 16: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Semantic Model DifferencingMotivating Example Semantic Model Differencing

Petri netsSemantic difference (final marking)

M1

M : p1=1 p2=0 p3=0 p4=0p3

M0,M1: p1=1, p2=0, p3=0, p4=0M1,M1: p1=0, p2=1, p3=1, p4=0M2,M1: p1=0, p2=0, p3=0, p4=1M0

t1p1 p2 p4t2semanticallyequivalent

M2 M0,M2: p1=1, p2=0, p3=0, p4=0M : p1=0 p2=1 p3=0 p4=0

q

t1p1 p2 p3t2 t3 p4

+M1,M2: p1=0, p2=1, p3=0, p4=0M2,M2: p1=0, p2=0, p3=1, p4=0M3,M2: p1=0, p2=0, p3=0, p4=1

M0

t1p1 p2 p3t2 t3 p

16

Page 17: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Motivating Example Semantic Model DifferencingMotivating Example Semantic Model Differencing

Petri netsSemantic difference (final marking)

M1

M : p1=0 p2=1 p3=0 p4=0p3

M0,M1: p1=0, p2=1, p3=0, p4=0

M0

t1p1 p2 p4t2 diff witness

M2 M0,M2: p1=0, p2=1, p3=0, p4=0M : p1=0 p2=0 p3=1 p4=0

t1p1 p2 p3t2 t3 p4

+M1,M2: p1=0, p2=0, p3=1, p4=0M2,M2: p1=0, p2=0, p3=0, p4=1M0

t1p1 p2 p3t2 t3 p

17

Page 18: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Generic Semantic Model Differencing: MotivationGeneric Semantic Model Differencing: Motivation

Language‐specific approach (Maoz et al.1 and Fahrenberg et al.2) Procedure:

Translate models into semantic domainP f ti diff i i ti d i Perform semantic differencing in semantic domain

Translate result into modeling language Challenge: Complex translations and differencing algorithmsChallenge: Complex translations and differencing algorithms

Generic approachId U ili b h i l i ifi i f i diff i Idea: Utilize behavioral semantics specifications for semantic differencing

Goal: Perform semantic differencing directly in modeling language Perform semantic differencing directly in modeling language Use existing behavioral semantics specifications for semantic differencing Enable to apply custom semantic equivalence criteria

181 S. Maoz et al. A Manifesto for Semantic Model Differencing. MODELS’10, volume 6627 of LNCS, pages 194–203. Springer, 2011.2 U. Fahrenberg et al. Vision Paper: Make a Difference! (Semantically). MODELS’11, volume 6981 of LNCS, pages 490–500. Springer, 2011.

Page 19: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Generic Semantic Model Differencing: IntroductionGeneric Semantic Model Differencing: Introduction

Generic framework for semantic model differencing Idea: Utilize behavioral semantics specifications for semantic differencing Procedure:

Execute models to obtain execution traces (semantic interpretations) Identify execution traces valid for only one model by comparison (diff witness) Customize execution trace comparison to modeling language and suitableCustomize execution trace comparison to modeling language and suitable 

semantic equivalence criterion Benefits: 

Implementation of translations and algorithms specifically for semantic model differencing is avoided

Only comparison of execution traces is specific to modeling language andOnly comparison of execution traces is specific to modeling language and semantic equivalence criterion

19

Page 20: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Generic Semantic Model Differencing: OverviewGeneric Semantic Model Differencing: Overview

CM1,M2syn

M1

Syntactic Matching CM1,M2

syn Model

Execution

M1 TM1

Semantic Matching CM1,M2

sem

TM1

M2

g

Match Rules

M2

IM1 IM2

TM2

Match Rules

g

TM2 C … Correspon-dence

I … InputM … Model

SynM1 M2

Sem T … Trace

20

Page 21: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Generic Semantic Model Differencing: OverviewGeneric Semantic Model Differencing: Overview

CM1,M2syn Epsilon Platform1

M1

Syntactic Matching CM1,M2

syn Model

Execution

M1 TM1

Semantic Matching CM1,M2

sem

TM1

M2

g

Match Rules

M2

IM1 IM2

TM2

Match Rules

g

TM2 C … Correspon-dence

I … InputM … Model

1 Syntactic matching: Identify syntactic correspondences

SynM1 M2

SemEpsilon Comparison Language (ECL)

T … Trace

1. Syntactic matching: Identify syntactic correspondences Syntactic match rules define custom language‐specific matching algorithm

211 D. Kolovos, L. Rose, A. García‐Domínguez, R. Paige. The Epsilon Book. March 2014. http://www.eclipse.org/epsilon/doc/book.

Page 22: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Generic Semantic Model Differencing: OverviewGeneric Semantic Model Differencing: Overview

CM1,M2syn

Behavioral semantics

M1

Syntactic Matching CM1,M2

syn Model

Execution

M1 TM1

Semantic Matching CM1,M2

sem

TM1

M2

g

Match Rules

M2

IM1 IM2

TM2

Match Rules

g

TM2 C … Correspon-dence

I … InputM … Model

2 Model execution: Obtain execution traces

SynM1 M2

SemGeneric execution trace format

T … Trace

2. Model execution: Obtain execution traces Execute models based on behavioral semantics specification Obtain execution traces adhering to generic execution trace format

22

Page 23: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Generic Execution Trace FormatGeneric Execution Trace Format

Runtime states of

Runtime states of model during execution

State Objectstates *

1t t 1

objects *

Runtime states of model elements

Trace

E t

source1

outgoing0..1

target 1

incoming 0..1 Events causingstate transitions

TransitionEvent

qualifiedName : EStringtransitions *

event 1

Transitions between

state transitions

Execution trace: Sequence of runtime states

Transitions between runtime states

Execution trace: Sequence of runtime states Format serves as interface to our semantic model differencing framework

Execution traces adhering to this format are the input for indentifying semantic g p y gdifferences among models

Framework is genericwith respect to semantics specification approach and model execution environmentmodel execution environment

23

Page 24: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Generic Semantic Model Differencing: OverviewGeneric Semantic Model Differencing: Overview

CM1,M2syn Epsilon Platform

M1

Syntactic Matching CM1,M2

syn Model

Execution

M1 TM1

Semantic Matching CM1,M2

sem

TM1

M2

g

Match Rules

M2

IM1 IM2

TM2

Match Rules

g

TM2 C … Correspon-dence

I … InputM … Model

3 Semantic matching: Identify semantic correspondences

SynM1 M2

Sem T … Trace

Epsilon Comparison Language (ECL)

3. Semantic matching: Identify semantic correspondences Semantic match rules define whether two models are semantically equivalent Non‐matching traces constitute diff witnesses

24

Page 25: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Generic Semantic Model Differencing: OverviewGeneric Semantic Model Differencing: Overview

CM1,M2syn Behavioral

Semantics

M1

Syntactic Matching CM1,M2

syn Model

Execution

M1 TM1

Semantic Matching CM1,M2

sem

TM1

M2

g

Match Rules

M2

IM1 IM2

TM2

Match Rules

g

TM2 C … Correspon-dence

I … InputM … Model

1 Syntactic matching: Identify syntactic correspondences

SynM1 M2

Sem T … Trace

1. Syntactic matching: Identify syntactic correspondences2. Model execution: Obtain execution traces3. Semantic matching: Identify semantic correspondences3. Semantic matching: Identify semantic correspondences

25

Page 26: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Syntactic Match Rules (ECL)Example Syntactic Match Rules (ECL)

1 rule MatchPlace2 match left : Place with right : Place {2 match left : Place with right : Place {3 compare : left.name = right.name4 }

5 rule MatchTransition6 match left : Transition with right : Transition {7 compare : left.name = right.name8 }

MetamodelNet

Models

M

inputtransitions* places*

M1

p3

Place

name : EString

Transition

name : EString

p

*output

* +

t1p1 p2 p4t2M2

+

t1p1 p2 p3t2 t3 p4

MatchPlace MatchTransition

26

MatchPlace MatchTransition

Page 27: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Behavioral Semantics (xMOF)Example Behavioral Semantics (xMOF)

Behavioral semantics specification with xMOF1

Integrates fUML action language with metamodeling languages (Ecore) Behavioral semantics is defined with UML activities (operational semantics) Model execution is performed by fUML virtual machine

271 T. Mayerhofer, P. Langer, M. Wimmer, and G. Kappel. xMOF: Executable DSMLs Based on fUML. In Proc. of SLE’13, volume 8225 of LNCS, pages 56–75. Springer, 2013.

Page 28: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Behavioral Semantics (xMOF)Example Behavioral Semantics (xMOF)

Behavioral semantics specification with xMOF1

Integrates fUML action language with metamodeling languages (Ecore) Behavioral semantics is defined with UML activities (operational semantics) Model execution is performed by fUML virtual machine

Transition PlaceNet

TransitionConfiguration PlaceConfigurationNetConfiguration

heldTokens*

Token

Runtime concept

281 T. Mayerhofer, P. Langer, M. Wimmer, and G. Kappel. xMOF: Executable DSMLs Based on fUML. In Proc. of SLE’13, volume 8225 of LNCS, pages 56–75. Springer, 2013.

Page 29: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Behavioral Semantics (xMOF)Example Behavioral Semantics (xMOF)

Behavioral semantics specification with xMOF1

Integrates fUML action language with metamodeling languages (Ecore) Behavioral semantics is defined with UML activities (operational semantics) Model execution is performed by fUML virtual machine

Transition PlaceNet

TransitionConfiguration

fire()i E bl d() EB l

PlaceConfiguration

addToken()T k ()

NetConfiguration

main(Token[*])()

heldTokens*

isEnabled() : EBoolean removeToken()run()

Computational stepsToken

Runtime concept

p pfor executing model

291 T. Mayerhofer, P. Langer, M. Wimmer, and G. Kappel. xMOF: Executable DSMLs Based on fUML. In Proc. of SLE’13, volume 8225 of LNCS, pages 56–75. Springer, 2013.

Page 30: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Behavioral Semantics (xMOF)Example Behavioral Semantics (xMOF)

Behavioral semantics specification with xMOF1

Integrates fUML action language with metamodeling languages (Ecore) Behavioral semantics is defined with UML activities (operational semantics) Model execution is performed by fUML virtual machine

Transition PlaceNet

TransitionConfiguration

fire()i E bl d() EB l

PlaceConfiguration

addToken()T k ()

NetConfiguration

main(Token[*])()

heldTokens*

isEnabled() : EBoolean removeToken()run()

ActivityPlaceConfiguration::addToken()

Token

Runtime concept

g ()

read selfReadSelf

result add heldTokens

AddStructuralFeatureValue

objectCreateObject

1 T. Mayerhofer, P. Langer, M. Wimmer, and G. Kappel. xMOF: Executable DSMLs Based on fUML. In Proc. of SLE’13, volume 8225 of LNCS, pages 56–75. Springer, 2013.

30value

create Tokenj

result

Page 31: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Execution TracesExample Execution Traces

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2

M0

name p1

p p p

M2

+

t1p1 p2 p3t2 t3 p4

31

Page 32: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Execution TracesExample Execution Traces

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

M2

+

t1p1 p2 p3t2 t3 p4

32

Page 33: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Execution TracesExample Execution Traces

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

objects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

M2

+

t1p1 p2 p3t2 t3 p4

33

Page 34: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Execution TracesExample Execution Traces

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

objects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

states objects heldTokenst2 : Trace s1 : State : Token: PlaceConfiguration

name = “p1"

M2

+

T M2,1

M0objects heldTokens: PlaceConfiguration

name = “p2"s2 : State

objects heldTokens

: Tokent1p1 p2 p3t2 t3 p4

M0

objects heldTokens: PlaceConfiguration4 St t

objects heldTokens: PlaceConfiguration

name = “p3"s3 : State

T k

: Token

g

name = “p4"s4 : State : Token

34

Page 35: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules (ECL)Example Semantic Match Rules (ECL)

Final marking equivalence: For the same initial markings (input), the same final markings are reached

1 rule MatchTrace2 mat h l ft T ith i ht T {

Returns final state capturing final marking

2 match left : Trace with right : Trace {3 compare {4 var finalStateLeft : State = left.getFinalState(); // final state of left net5 var finalStateRight : State = right.getFinalState(); // final state of right net6 return finalStateLeft matches(finalStateRight) and // final states match6 return finalStateLeft.matches(finalStateRight) and // final states match7 finalStateRight.matches(finalStateLeft);8 }9 }

Returns instances of10 rule MatchState11 match left : State with right : State {12 compare {13 var placeConfsLeft : Set = left getPlaceConfigurations(); // final states of left places

Returns instances of PlaceConfiguration

13 var placeConfsLeft : Set = left.getPlaceConfigurations(); // final states of left places14 var placeConfsRight : Set = right.getPlaceConfigurations(); // final states of right places15 return placeConfsLeft.matches(placeConfsRight); // final states of places match16 }17 }}

18 rule MatchPlaceConfiguration19 match left : PlaceConfiguration with right : PlaceConfiguration extends MatchPlace {20 compare : left.heldTokens.size() = right.heldTokens.size() // places hold same amount of tokens

35

20 compare : left.heldTokens.size()   right.heldTokens.size() // places hold same amount of tokens21 }

Page 36: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules ApplicationExample Semantic Match Rules Application

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

objects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

M2

+

T M2,1 states objects heldTokenst2 : Trace s1 : State : Token: PlaceConfiguration

name = “p1"M0

t1p1 p2 p3t2 t3 p4objects heldTokens: PlaceConfiguration

name = “p2"s2 : State

objects heldTokens

: Token

M0

objects heldTokens: PlaceConfiguration

objects heldTokens: PlaceConfiguration

name = “p3"s3 : State : Token

j : PlaceConfiguration

name = “p4"s4 : State : Token

36

Page 37: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules ApplicationExample Semantic Match Rules Application

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

objects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

M2

+

T M2,1 states objects heldTokenst2 : Trace s1 : State : Token: PlaceConfiguration

name = “p1"M0

t1p1 p2 p3t2 t3 p4objects heldTokens: PlaceConfiguration

name = “p2"s2 : State

objects heldTokens

: Token

M0

objects heldTokens: PlaceConfiguration

objects heldTokens: PlaceConfiguration

name = “p3"s3 : State : Token

MatchTracej : PlaceConfiguration

name = “p4"s4 : State : Token

37

Page 38: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules ApplicationExample Semantic Match Rules Application

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

objects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

final state

M2

+

T M2,1 states objects heldTokenst2 : Trace s1 : State : Token: PlaceConfiguration

name = “p1"M0

t1p1 p2 p3t2 t3 p4objects heldTokens: PlaceConfiguration

name = “p2"s2 : State

objects heldTokens

: Token

M0

MatchTraceobjects heldTokens: PlaceConfiguration

objects heldTokens: PlaceConfiguration

name = “p3"s3 : State : Token

j : PlaceConfiguration

name = “p4"s4 : State : Token

final state

Page 39: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules ApplicationExample Semantic Match Rules Application

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

objects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

final state

M2

+

T M2,1 states objects heldTokenst2 : Trace s1 : State : Token: PlaceConfiguration

name = “p1"M0

t1p1 p2 p3t2 t3 p4objects heldTokens: PlaceConfiguration

name = “p2"s2 : State

objects heldTokens

: Token

M0

h

MatchTraceobjects heldTokens: PlaceConfiguration

objects heldTokens: PlaceConfiguration

name = “p3"s3 : State : Token

MatchStatej : PlaceConfiguration

name = “p4"s4 : State : Token

final state

Page 40: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules ApplicationExample Semantic Match Rules Application

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

objects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

final state

M2

+

T M2,1 states objects heldTokenst2 : Trace s1 : State : Token: PlaceConfiguration

name = “p1"M0

t1p1 p2 p3t2 t3 p4objects heldTokens: PlaceConfiguration

name = “p2"s2 : State

objects heldTokens

: Token

M0

h

MatchTraceobjects heldTokens: PlaceConfiguration

objects heldTokens: PlaceConfiguration

name = “p3"s3 : State : Token

MatchPlaceConfiguration

MatchStatej : PlaceConfiguration

name = “p4"s4 : State : Token

final state

Page 41: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules ApplicationExample Semantic Match Rules Application

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Token

objects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

final state

M2

+

T M2,1 states objects heldTokenst2 : Trace s1 : State : Token: PlaceConfiguration

name = “p1"M0

t1p1 p2 p3t2 t3 p4objects heldTokens: PlaceConfiguration

name = “p2"s2 : State

objects heldTokens

: Token

M0

h

MatchTraceobjects heldTokens: PlaceConfiguration

objects heldTokens: PlaceConfiguration

name = “p3"s3 : State : Token

MatchPlaceConfiguration

MatchStatej : PlaceConfiguration

name = “p4"s4 : State : Token

final state

Page 42: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules ApplicationExample Semantic Match Rules Application

M1 T M1,1 objects heldTokenst1 : Trace : PlaceConfiguration

name = “p1"s1 : State

states: Token

t1p1 p2

p3

p4t2objects

objects heldTokens

name p1

s2 : State

: PlaceConfiguration

name = “p2": Token

M0

p p pobjects

heldTokenss2 : State

: PlaceConfiguration

name = "p3": Tokensemantically

equivalentobjects heldTokens: PlaceConfiguration

name = “p4"s3 : State : Token

final state

M2

+

T M2,1 states objects heldTokenst2 : Trace s1 : State : Token: PlaceConfiguration

name = “p1"M0

t1p1 p2 p3t2 t3 p4objects heldTokens: PlaceConfiguration

name = “p2"s2 : State

objects heldTokens

: Token

M0

h

MatchTraceobjects heldTokens: PlaceConfiguration

objects heldTokens: PlaceConfiguration

name = “p3"s3 : State : Token

MatchPlaceConfiguration

MatchStatej : PlaceConfiguration

name = “p4"s4 : State : Token

final state

Page 43: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Example Semantic Match Rules ApplicationExample Semantic Match Rules Application

M1 T :M1,1 I = {} MF = {}M1,1T : I = {p1=1} MF = {p4=1}

t1p1 p2

p3

p4t2

T :M1,2 I {p1 1} MF {p4 1}M1,2T :M1,3 I = {p2=1} MF = {p2=1} diff witnessM1,3T :M1,4 I = {p3=1} MF = {p3=1} diff witnessM1,4p p pT :M1,5 I = {p1=1,p2=1} MF = {p2=1,p4=1} diff witnessM1,5T :M1,6 I = {p1=1,p3=1} MF = {p3=1,p4=1} diff witnessM1,6T :M 7 I = {p2=1,p3=1} MF = {p4=1} diff witnessM 7M1,7 {p ,p } F {p }M1,7T :M1,8 I = {p1=1,p2=1,p3=1} MF = {p4=2} diff witnessM1,8

M2

+

T :M2,1 I = {} MF = {}M2,1T :M2,2 I = {p1=1} MF = {p4=1}M2,2T I { 2 1} M { 4 1} diff it

t1p1 p2 p3t2 t3 p4T :M2,3 I = {p2=1} MF = {p4=1} diff witnessM2,3T :M2,4 I = {p3=1} MF = {p4=1} diff witnessM2,4T :M2 5 I = {p1=1,p2=1} MF = {p4=2} diff witnessM2 5M2,5 M2,5T :M2,6 I = {p1=1,p3=1} MF = {p4=2} diff witnessM2,6T :M2,7 I = {p2=1,p3=1} MF = {p4=2} diff witnessM2,7T : I = {p1=1 p2=1 p3=1} M = {p4=3} diff witnessT :M2,8 I = {p1=1,p2=1,p3=1} MF = {p4=3} diff witnessM2,8

43

Page 44: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

EvaluationEvaluation

Case studies comparing our approach with CDDiff1 and ADDiff2 by Maoz et al. Behavioral semantics of both languages Semantic match rules for both languages

C t ti f diff it f l d l id d b M t l 3 Computation of diff witnesses for example models provided by Maoz et al.3

Expressive powerffi i f d fi i i i l i d l diff i Sufficient for defining non‐trivial semantic model differencing operators

Developing operators is a language engineering task Runtime states build basis for semantic model differencingRuntime states build basis for semantic model differencing

Performance Model execution is most expensive taking 95 % of overall execution time Model execution is most expensive taking 95 % of overall execution time High performance of execution environment and reasonable number of model 

executions (inputs) are important

441 S. Maoz et al. CDDiff: Semantic Differencing for Class Diagrams. ECOOP’11, volume 6813 of LNCS, pages 230–254. Springer, 2011.2 S. Maoz et al. ADDiff: Semantic Differencing for Activity Diagrams. ESEC/FSE’11, pages 179–189. ACM, 2011.3 http://www.se‐rwth.de/materials/semdiff

Page 45: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

SummarySummary

CM1,M2syn

M1

Syntactic Matching CM1,M2

syn Model

Execution

M1 TM1

Semantic Matching CM1,M2

sem

TM1

M2

g

Match Rules

M2

IM1 IM2

TM2

Match Rules

g

TM2 C … Correspon-dence

I … InputM … Model

Characteristics

SynM1 M2

Sem T … Trace

Characteristics Generic w.r.t. modeling language (behavioral semantics) Generic w.r.t. semantics specification approach (generic trace format)Generic w.r.t. semantics specification approach (generic trace format) Configurable w.r.t. semantic equivalence criterion (semantic match rules)

45

Page 46: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

OutlookOutlook

Generation of inputs relevant to semantic differencing Relevant inputs are inputs that cause distinct execution traces Problem: Inputs have to be defined manually now

Symbolic execution1

Calculation of semantic differences avoiding model execution Calculation of semantic differences avoiding model execution Problem: Model execution for obtaining concrete execution traces is expensive Path conditions obtained from symbolic execution already capture differences y y p

among execution traces Only syntactic differences can lead to semantic differences

Directed and differential symbolic execution2,3

461 L. Clarke. A Program Testing System. In Proc. of ACM ‘76, pages 488–491. ACM, 1976.2 K.‐K. Ma et al. Directed Symbolic Execution. In Proc of SAS’11, volume 6887 of LNCS, pages 95–111. Springer, 2011.3 S. Person et al. Differential Symbolic Execution. In Proc. of FSE’08, pages 226–237. ACM, 2008.

Page 47: Semantic Model Differencing Utilizing Behavioral Semantics Specifications (Talk at MODELS 2014)

Thank you!Thank you!

Model Execution Based on fUML

www.modelexecution.org


Recommended