37
UNIVERSIDAD AUTONOMA Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling A Graph Transformation-Based Semantics for Deep Metamodelling Alessandro Rossini 1 , Juan de Lara 2 , Esther Guerra 2 , Adrian Rutle 3 , Yngve Lamo 3 1 Department of Informatics, University of Bergen, Norway 2 Department of Computer Engineering, Universidad Autónoma de Madrid, Spain 3 Department of Computer Engineering, Bergen University College, Norway 05 October 2011 AGTIVE 2011, Budapest, Hungary

A Graph Transformation-Based Semantics for Deep …dpf.hib.no/wp-content/uploads/agtive11_deep_mm_pres.pdf · A Graph Transformation-Based Semantics for Deep Metamodelling Alessandro

  • Upload
    vungoc

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

A Graph Transformation-Based Semantics for

Deep Metamodelling

Alessandro Rossini1, Juan de Lara2, Esther Guerra2,Adrian Rutle3, Yngve Lamo3

1Department of Informatics, University of Bergen, Norway

2Department of Computer Engineering, Universidad Autónoma de Madrid, Spain

3Department of Computer Engineering, Bergen University College, Norway

05 October 2011AGTIVE 2011, Budapest, Hungary

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Traditional metamodelling

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Traditional metamodelling stack

1

...

i

i+1

...

l

Metalevel

Model

conforms to

...conforms to

Model

conforms to

Model

conforms to

...

conforms to

Model

Linear stack

Modellinglanguage

Modellinglanguage

Modellinglanguage

metamodel of

metamodel of

metamodel of

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

OMG’s 4-layer hierarchy

O

M1

M2

M3

Metalevel

Original

represented by

Model

conforms to

Metamodel

conforms to

Meta-metamodel

conforms to

4-layer hiearachy

metamodel of

metamodel of

UML/DSL

MOF

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

DSL using traditional metamodelling

Model

Metamodel

name="UAMCampus"visualise=true

UAMCampcamptype

id="GoogleMaps"

Map

trg

offices

src

trg

geopos

src name="UAMProfs"visualise=false

UAMProfsprofstype

id="FusionTable"

Table

name: Stringvisualise: Boolean

CInstance src*

dlinstance

*trg

*type1id: String

Component

trg*

datalink

src*

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Deep metamodelling

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Deep metamodelling

• Originally proposed by Atkinson and Kühne

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Deep metamodelling

• Originally proposed by Atkinson and Kühne

• Deep characterisation

• Double linguistic/ontological typing

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Deep characterisation

Describe structure and express constraints for metalevels below theadjacent one

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

DSL using deep characterisation

Model M3

Model M2

Model M1

name="UAMProfs"visualise=false

UAMProfs

srctrgofficesname="UAMCampus"

visualise=true

UAMCamp

id="FusionTable"

Table

srctrg0..1geopos*

id="GoogleMaps"

Map

@2@2

@1id: Stringname: Stringvisualise: Boolean

@2Componentsrc*

@2datalink

*trgcontext Component

inv:

self.trg->

excludes(self)

@2

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Double linguistic/ontological typing

Orthogonal linguistic and ontological typing for each modelelement

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Metamodelling stack with double typing

l

...

i+1

i

...

1

Metalevel

Model

conforms to (onto.)

...

conforms to (onto.)

Model

conforms to (onto.)

Model

conforms to (onto.)

...

conforms to (onto.)

Model

Ontological stack

(ling.)conforms to

(ling.)conforms to

(ling.)conforms to

(ling.)conforms to

Association

*1

*1Clabject*Attribute

potency: Intname: String

DeepElement

Linguistic metamodel

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Diagram PredicateFramework

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Diagram Predicate Framework (DPF)

• Formal diagrammatic specification framework founded oncategory theory and graph transformation

• diagrammatic modelling• metamodelling• model transformation• model versioning• deep metamodelling

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Diagrammatic models in DPF

Specification T = (T, CT:Σ)

StringComponent

[irr]

datalinkid [1..1]

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Diagrammatic models in DPF

Specification T = (T, CT:Σ)

StringComponent

[irr]

datalinkid [1..1]

Graph T

StringComponentdatalinkid

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Diagrammatic models in DPF

Specification T = (T, CT:Σ)

StringComponent

[irr]

datalinkid [1..1]

Graph T

StringComponentdatalinkid

Signature Σ = (ΠΣ, α

Σ)π ∈ ΠΣ

αΣ(π) Proposed vis. Semantic interpretation

[irreflexive] 1

a

X

f[irr]

∀x ∈ X : x /∈ f (x)

[mult(m, n)] 1a

2 Xf

[m..n]Y ∀x ∈ X : m ≤ |f (x)| ≤ n,

with 0 ≤ m ≤ n and n ≥ 1

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Diagrammatic models in DPF

Specification T = (T, CT:Σ)

StringComponent

[irr]

datalinkid [1..1]

Atomic constraints CT:Σ

([irreflexive], δ1) 1

a

Component

datalink

([mult(1, 1)], δ2) 1a

2 Componentid

String

Graph T

StringComponentdatalinkid

Signature Σ = (ΠΣ, α

Σ)π ∈ ΠΣ

αΣ(π) Proposed vis. Semantic interpretation

[irreflexive] 1

a

X

f[irr]

∀x ∈ X : x /∈ f (x)

[mult(m, n)] 1a

2 Xf

[m..n]Y ∀x ∈ X : m ≤ |f (x)| ≤ n,

with 0 ≤ m ≤ n and n ≥ 1

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Typing and conformance in DPF

S'S

Σ

T

Plotsource“Google

Maps”

idMapMap

String[1..1]id

Componentdatalink

[irr]

π ∈ ΠΣα

Σ(π) Proposed vis. Semantic interpretation

[irreflexive] 1

a

X

f[irr]

∀x ∈ X : x /∈ f(x)

[mult(m, n)] 1a

2 Xf

[m..n]Y ∀x ∈ X : m ≤ |f(x)| ≤ n,

with 0 ≤ m ≤ n and n ≥ 1

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Formalisation of deepmetamodelling

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Our contribution

• Distinction of two semantics for potency

• Syntax of potency

• Structural semantics of double linguistic/ontological typing

• Operational semantics of potency

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Multi-potency

Metalevel Clabject Reference

i ANp AaNp

N

i + 1 BNp-1 BbNp-1

O

......

......

...

i + p − 1 LN1 LlN1

Y

i + p MN0 MmN0

Z

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Single-potency

Metalevel Clabject Reference Attribute

i Ap Aap

N Aap

DT

......

......

......

......

i + p B0 Mb0

Z Mb0

DV

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Tag signature Ψ for specifying potencies

θ ∈ ΘΨα

Ψ(θ) Proposed visual.

<multi(p)>1 1 XNp

<multi(p)>2 1a

2 XfNp

Y

<multi(p)>π 1a

2 Xf

πNp

Y

<single(p)>1 1 Xp

<single(p)>2 1a

2 Xfp

Y

<single(p)>π 1a

2 Xf

πp

Y

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Deep metamodelling stack

Σ

Ci

Si ΨPi

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Deep metamodelling stack

Si−1 ΣCi−1

Ci

Si

ωi

ΨPi

Pi−1

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Deep metamodelling stack

LM Si−1

λi−1

ΣCi−1

Ci

Si

ωi

λi

=

ΨPi

Pi−1

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Deep metamodelling stack

LM S1

λ1Ω

Cl

Ci

Ci−1

C1

...

ω2

Si−1

ωi−1

λi−1

Si

=

ωi

λi

...

ωi+1

Sl

ωl

λl

ΨPl

Pi

Pi−1

P1

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

DSL using the deep metamodelling stack

S3(d)

S2(c)

S1(b)

LM(a)

“UAM

Profs”

nameTableUAM0

UAMProfs0

offices0

“UAM

Campus”

nameMapUAM0

UAMCamp0

“Fusion

Table”

idTable0Table

1

geopos1

“Google

Maps”

idMap0Map

1

String

[1..1]2name2

[1..1]1id1

Component2

[irr]2

datalink2

[0..1]2

DataType

Attribute

Clabject

Reference

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

DSL after the transformation

S3(d)

S2(c)

S1(b)

LM(a)

“UAM

Profs”

nameTableUAM0

UAMProfs0

offices0

“UAM

Campus”

nameMapUAM0

UAMCamp0

“Fusion

Table”

idTable0Table

1

geopos1

“Google

Maps”

idMap0Map

1

nameTable1

1

[0..1]1

nameMap1[1..1]1String

String

[1..1]2name2

[1..1]1id1

Component2

[irr]2

datalink2

[0..1]2

DataType

Att

ribute

Clabject

Refe

rence

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Rules for flattening the semantics of single-potencies

CL = CK CR

ta1 A:Clabjecta:Attributep

DT:DataType

B:Clabject

ωLi

DT:DataType

ωLi

A:Clabjecta:Attributep

DT:DataType

B:Clabject

ωRi

aB:Attributep-1

DT:DataType

ωRi

ωR

i

tr1 A:Clabjecta:Referencep

N:Clabject

B:Clabject

ωL

i

O:Clabject

ωL

i

A:Clabjecta:Referencep

N:Clabject

B:Clabject

ωR

i

aB:Referencep-1

O:Clabject

ωR

i

ωRi

tacr2 A:Clabjecta:Reference

πp

N:Clabject

B:Clabject

ωL

i

aB:ReferenceO:Clabject

ωL

iωL

i

A:Clabjecta:Reference

πp

N:Clabject

B:Clabject

ωR

i

aB:Reference

πp-1

O:Clabject

ωR

R

i

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Rules for flattening the semantics of single-potencies

CL CK = CR

tacr3 A:Clabjecta:Reference

πp

N:Clabject

B:Clabject

ωL

i

aB:Reference

πp-1

O:Clabject

ωL

L

i

A:Clabjecta:Reference

N:Clabject

B:Clabject

ωR

i

aB:Reference

πp-1

O:Clabject

ωR

R

i

tr4 A:Clabjecta:Referencep

N:Clabject

B:Clabject

ωL

i

aB:Referencep-1

O:Clabject

ωL

i

ωLi

A:Clabject N:Clabject

B:Clabject

ωR

i

aB:Referencep-1

O:Clabject

ωR

i

ta4 A:Clabjecta:Attributep

DT:DataType

B:Clabject

ωLi

aB:Attributep-1

DT:DataType

ωLi

ωL

i

A:Clabject DT:DataType

B:Clabject

ωRi

aB:Attributep-1

DT:DataType

ωRi

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Conclusion

• Distinction of multi- and single-potency

• Syntax of multi- and single-potency

• Structural semantics of double linguistic/ontological typing

• Operational semantics of single-potency

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Related work

Multi-level metamodelling

• [Gitzel et al., 2007] Extension of MOF with multiplemetalevels to enable XML-based code generation

• [Asikainen et al., 2009] Nivel: double metamodellingframework based on the weighted constraint rule language

• [Clark et al., 2010] XMF: language-driven developmentframework allowing arbitrary number of metalevels

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Related work

Deep characterisation

• [Kühne et al., 2007] DeepJava: superset of Java whichfeatures an unbounded number of metalevels

• [Atkinson et al., 2009] Prototype modelling infrastructure withmultiple ontological and linguistic metalevels

• [de Lara et al., 2010] metaDepth: deep metamodellingframework which supports potency, doublelinguistic/ontological typing and linguistic extension

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Future work

• Structural semantics of multi- and single-potency (in progress)

• Structural semantics of linguistic extension (in progress)

• Investigation of the effects of overriding the potency of aclabject using inheritance

UNIVERSIDAD AUTONOMA

Introduction and Motivation Diagram Predicate Framework Formalisation of deep metamodelling

Thank you!

Questions?

http://dpf.hib.no

http://astreo.ii.uam.es/~jlara/metaDepth/Collab.html

http://www.alessandrorossini.org