generating model with uncertainty by means of jtl

28
Dipartimento di Ingegneria e Scienze Università degli Studi dell’Aquila dell’Informazione e Matematica Generating model with uncertainty by means of JTL Gianni Rosa

Upload: gianni-rosa

Post on 10-Apr-2017

108 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Generating Model with Uncertainty by means of JTL

Dipartimento di Ingegneria e Scienze

Università degli Studi dell’Aquiladell’Informazione e Matematica

Generating model with uncertainty by means of JTL

Gianni Rosa

Page 2: Generating Model with Uncertainty by means of JTL

In Model-Driven Engineering (MDE) bidirectionality in

transformations has been always regarded as a key

mechanism, but has rarely produced anticipated benefits.

Why?

Page 3: Generating Model with Uncertainty by means of JTL

…probably the main reason is the ambivalence concerning non-

bijectivity.

Propagating changes from one side to the other is typically non univocal as more than one correct solution is admitted.

Page 4: Generating Model with Uncertainty by means of JTL

We discuss how dealing with multiple solutions is important and requires

specialized tools and support

Page 5: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

5Non-bijectivityMost examples of bidirectional transformations are non-bijective, therefore there may be multiple ways to transform two models into a consistent state, introducing uncertainty and non-determinism.

T-1

Δ Manual Changes

TMs Mt

Mt’

Ms1’

…?Msn’

Ms1’

Page 6: Generating Model with Uncertainty by means of JTL

Source model Target model

Hierarchical State Machine

Non-hierarchical state machine obtained by flattening the source model

T

Page 7: Generating Model with Uncertainty by means of JTL

Source model Target model

Δ Manual ChangesThe designer performs

some manual changes on the generated model

T

Page 8: Generating Model with Uncertainty by means of JTL

Source model Target model

Δ Manual ChangesThe designer performs

some manual changes on the generated model

TProblem

How to back propagate the manual changes on the target model towards the source

models according to the knowledge encoded in T?

What about non-bijectivity?

Page 9: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

9Specifying transformation with JTLFragment of the HSM2NHSM transformation specified in JTL

9

transformation hsm2nhsm(source : HSM, target : NHSM) { top relation StateMachine2StateMachine { enforce domain source sSM : HSM::StateMachine; enforce domain target tSM : NHSM::StateMachine; }

top relation State2State { enforce domain source sourceState : HSM::State; enforce domain target targetState : NHSM::State; when { sourceState.owningCompositeState.oclIsUndefined(); } }

top relation CompositeState2State { enforce domain source sourceState : HSM::CompositeState; enforce domain target targetState : NHSM::State; }}

Page 10: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

10

transformation hsm2nhsm(source : HSM, target : NHSM) { top relation StateMachine2StateMachine { enforce domain source sSM : HSM::StateMachine; enforce domain target tSM : NHSM::StateMachine; }

top relation State2State { enforce domain source sourceState : HSM::State; enforce domain target targetState : NHSM::State; when { sourceState.owningCompositeState.oclIsUndefined(); } }

top relation CompositeState2State { enforce domain source sourceState : HSM::CompositeState; enforce domain target targetState : NHSM::State; }}

Specifying transformation with JTLFragment of the HSM2NHSM transformation specified in JTL

10

c

It transforms hierarchical state machines into flat state machines

and the other way round.

Page 11: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

11

transformation hsm2nhsm(source : HSM, target : NHSM) { top relation StateMachine2StateMachine { enforce domain source sSM : HSM::StateMachine; enforce domain target tSM : NHSM::StateMachine; }

top relation State2State { enforce domain source sourceState : HSM::State; enforce domain target targetState : NHSM::State; when { sourceState.owningCompositeState.oclIsUndefined(); } }

top relation CompositeState2State { enforce domain source sourceState : HSM::CompositeState; enforce domain target targetState : NHSM::State; }}

Specifying transformation with JTLFragment of the HSM2NHSM transformation specified in JTL

11

c

The forward transformation is clearly non-injective:

both «State» and «CompositeState» are mapped

to the same target «State»

Page 12: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

12

transformation hsm2nhsm(source : HSM, target : NHSM) { top relation StateMachine2StateMachine { enforce domain source sSM : HSM::StateMachine; enforce domain target tSM : NHSM::StateMachine; }

top relation State2State { enforce domain source sourceState : HSM::State; enforce domain target targetState : NHSM::State; when { sourceState.owningCompositeState.oclIsUndefined(); } }

top relation CompositeState2State { enforce domain source sourceState : HSM::CompositeState; enforce domain target targetState : NHSM::State; }}

Specifying transformation with JTLFragment of the HSM2NHSM transformation specified in JTL

12

c

The forward transformation is clearly non-injective:

both «State» and «CompositeState» are mapped

to the same target «State»

Page 13: Generating Model with Uncertainty by means of JTL

Source model Target model

Δ Manual Changes

T

T

Modifications on the target are back propagated to the source which is consistently updated making use of tracing information

Page 14: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

14Combinatorial explosionNot surprisingly, there is not a unique way of updating the source model.Despite the changes on the target model are relatively simple, their impact on the source model istypically exponential.

Page 15: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

15Combinatorial explosion|print| × |completed| × |critical error| = 4 * 4 * 3 = 48where |name| is the number of alternative model elements called name.

Page 16: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

16Combinatorial explosion|print| × |completed| × |critical error| = 4 * 4 * 3 = 48where |name| is the number of alternative model elements called name.Solution? Representing multiple solutions with Model Uncertainty

Page 17: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

17UncertaintyUncertainty is a consequence of non-determinism.

Dealing with a multitude of models obtained by a non-deterministic transformation requires us to consider uncertainty as a first-class concern.

For any metamodel M an uncertainty metamodel U(M) can obtained by means of an automated transformation:

U: Ecore Ecore

Page 18: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

18Uncertainty metamodel

.HSM

M

etam

odel

U(H

SM)

Met

amod

el

Page 19: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

19Uncertainty metamodel

.HSM

M

etam

odel

U(H

SM)

Met

amod

el

the abstract metaclass TracedClass with attributes trace and ref is added

Page 20: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

20Uncertainty metamodel

.HSM

M

etam

odel

U(H

SM)

Met

amod

el

the abstract metaclass TracedClass with attributes trace and ref is added

StateMachine is generalized by TracedClass

Page 21: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

21Uncertainty metamodel

.HSM

M

etam

odel

U(H

SM)

Met

amod

el

the abstract metaclass TracedClass with attributes trace and ref is added

a direct sub-metaclass of StateMachine is added

StateMachine is generalized by TracedClass

Page 22: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

22Uncertainty metamodel

.HSM

M

etam

odel

U(H

SM)

Met

amod

el

the abstract metaclass TracedClass with attributes trace and ref is added

a direct sub-metaclass of StateMachine is added

StateMachine is generalized by TracedClass

The composition enable the representation of a point of uncertainty and its alternatives

the cardinality of attributes and references are relaxed

Page 23: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

23Extension of JTL SemanticThe JTL semantics has been extended in order to factorize the solution space and generate a model with uncertainty instead of a set of models.

Page 24: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

24Extension of JTL SemanticThe JTL semantics has been extended in order to factorize the solution space and generate a model with uncertainty instead of a set of models.

Page 25: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

25Extension of JTL SemanticThe JTL semantics has been extended in order to factorize the solution space and generate a model with uncertainty instead of a set of models.

Page 26: Generating Model with Uncertainty by means of JTL

Example

Page 27: Generating Model with Uncertainty by means of JTL

Gianni Rosa – University of L’Aquila - ITALY

27ConclusionThe JTL semantics has been refined in order to be able to generate directly the model with uncertainty semantically corresponding to the complete solution space.

We distinguish among two different behaviors: - extensional, generate all the models satisfying the relation defined in the bidirectional transformation; - intensional (or with uncertainty), generate a model with uncertainty wich is semantically equivalent to the models of the extensive case

The approach is implemented on Eclipse/EMF.

Page 28: Generating Model with Uncertainty by means of JTL

Thank you!