model driven engineering (mde) and diagrammatic predicate ...old.mii.lt/files/yngve.pdf · model...

43

Upload: trinhphuc

Post on 16-Apr-2018

225 views

Category:

Documents


3 download

TRANSCRIPT

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Model Driven Engineering (MDE) andDiagrammatic Predicate Logic (DPL)

Yngve Lamo

Department of Computer Engineering

Faculty of Engineering

Bergen University College

NORWAY

06.06.2008Institute of Mathematics and Informatics, Vilnius, LITHUANIA

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Project goal

To apply and adapt formal methods to software engineering

Actual research on MDE and MDE-related standards andapproachesDevelop a formal framework to express software models andmodel transformationsDevelop tools that justi�es the framework

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

History of our project:

Ph.d in Theoretical Computer Science 2003, algebraicspeci�cations, logic and category theory

Discussions with professor Uwe Wolter since 2000 about howto use theory in practice

In 2000 Wolter introduced me to the Generalized Sketchesframework, created in Latvia in the 90's, by Diskin ++

2003, we decided to try to use the GS approach for practicalsoftware engineering

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

...

2004 master student Ørjan Hatland started to implement atool for GS, based on the .NET framework, (graduated 2006)

Early 2006 Ph.d student Adrian Rutle started to investigatethe subject and we get interested in MDE and the Eclipseframework

2006 Master student Stian Skjerveggen started to implement agraphical editor in Eclipse framework, (will graduate June2008)

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

MDE

Engineering techniques where models are �rst-class entities

Evolved from the popularity of diagrammatic languages suchas UML and ER and their popularity for speci�cation anddocumentation of software systems

Aims to raise the abstraction level of software developmentfrom text to models

The development process is based on software models, not onplain text

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Industry "standard" for MDE

Model Driven Architecture (MDA) approach from ObjectManagement Group (OMG) where:

First step is building platform independent domain models,PIM'sPIM's are re�ned to platform speci�c models PSM'sRe�nement process more or less automatized as modeltransformationsCode generation and model re�nement can be seen as modeltransformationsReuse of software models by using model transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

MDD vs Traditional Development Processes

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Key point for success for MDE

Models are no longer only for documentation

Models should be both:

intuitive for software engineers to intercept and work withformal such that machines could have precise understandingand reason about the models

⇒ Diagrammatic approach enhance human understanding⇒ Challenge to combine intuition with formalization

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Key point for success for MDE

Models are no longer only for documentation

Models should be both:

intuitive for software engineers to intercept and work withformal such that machines could have precise understandingand reason about the models

⇒ Diagrammatic approach enhance human understanding⇒ Challenge to combine intuition with formalization

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Key point for success for MDE

Models are no longer only for documentation

Models should be both:

intuitive for software engineers to intercept and work withformal such that machines could have precise understandingand reason about the models

⇒ Diagrammatic approach enhance human understanding⇒ Challenge to combine intuition with formalization

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Some facts about UML

UML is defacto industry standard for modeling

UML can only express constraints on binary relations

UML has serious issues regarding:

Semantics; UML models may be ambiguous and havesemi-formal semanticsComplexity; UML uses 13 di�erent types of diagramsExpressibility; To express constraints over higher order relationsone need to use string based logic, (Object Constraint Logic,OCL)

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Formal modeling languages

Nice semantics, proven abilities and several fundamentalSoftware Engineering problems solved by use of formalmethods

Set based semantics (logic, algebras etc...)

Hard for software engineers to apply in practice

Lack of good software development tools based on formalapproaches

Only used by well trained experts

High cost low productivity

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

DPL

Aims to combine the intuition from graphical modelinglanguages with the semantic rigor of formal methods

Based on Generalized Sketches

Sketches is a graphical representation of category theory,constraints expressed by universal constructions (limits andco-limits) of diagrams

Generalized Sketches is sketches extended with constraints onarbitrary diagrams, not only universal constructions

In DPL, sketches are generalized and adapted to model drivensoftware engineering

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

More on DPL

DPL will be used as a framework for de�ning modelinglanguages and transformations between them in a formalgraphical way

We work continuously on Investigating, Analyzing, Adapting,Verifying and Evaluating DPL

Potential to use the machinery from category to implementMDE tools

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Diagrammatic speci�cations

Signature

Set of constraint (predicate) names Π withAn arity function α : Π → graph

Diagrammatic Speci�cations consist of

the underlying graph G(S) together with aset of constraints CS i.e. diagrams δ : α(cS) → G, wherecS ∈ Π

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Signature � Example

Π α visualization intended semantics

[total] 1x // 2 A •

f // B ∀a ∈ A : |f (a)| ≥ 1

[key] 1x // 2 A

f [key ]// B ∀a, a′ ∈ A : a 6= a′ implies f (a) 6= f (a′)

[inv] 1

x

$$2

y

cc A

f

%%[inv ] B

g

dd ∀a ∈ A , ∀b ∈ B : b ∈ f (a) i� a ∈ g(b)

[jointly-key]or [1-1]

1x //

y

��

2

3

Af //

g

��

[1−1]

B

C

∀a, a′ ∈ A : a 6= a′ implies f (a) 6= f (a′) org(a) 6= g(a′)

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Diagrammatic Speci�cation � Example

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Diagrammatic Speci�cation � Example

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Instance of Diagrammatic Speci�cation � Example

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Speci�cationExampleInstance

Instance of speci�cation

The semantic interpretation of Σ := (Π, α) assigns to eachp ∈ Π a set [[p]] of graph homomorphisms τ : O → α(p),where O may vary over all graphs.

An instance of a speci�cation S is a graph I together with agraph homomorphism ι : I → G (S), such that ι∗ ∈ [[p]], i.e. ι∗

is a valid instance of p for each constraint (p, δ) whereδ : α(p) → G (S).ι∗ is given by the pullback diagram:

α(p)δ // G (S)

O∗δ∗

//

ι∗

OO[PB]

I

ι

OO

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

OMG Metamodel Levels

OMG levels OMG Standards/examples

M3: Meta-metamodel MOF

M2: Metamodel UML language

M1: Model A UML model: Class "Person" withattributes "name" and "address"

M0: Instance An instance of "Person": "OlaNordmann" living in "Sotraveien 1,Bergen"

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

DPL Methodology and Modeling Formalisms

Modeling Formalism F2 = (Σ1,M2,Σ2)

Meta-formalism F3 = (Σ2,M3,Σ3)

F3 is re�exive i� (Σ3 v Σ2)

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

DPL Methodology and Modeling Formalisms

Modeling Formalism F2 = (Σ1,M2,Σ2)

Meta-formalism F3 = (Σ2,M3,Σ3)

F3 is re�exive i� (Σ3 v Σ2)

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

Outline1 Introduction and Motivation

Personal MotivationModel-driven Engineering (MDE)Modeling languages state of the artDiagrammatic Predicate Logic (DPL)

2 Concepts in DPLSpeci�cationExampleInstance

3 OMG standards and Metamodeling LevelsMetamodelingDPL meta modelEcore meta model in DPL

4 Tools5 Model Transformations

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

Ecore model expressed in DPL

Ecore is the metamodel of the Eclipse Modeling Framework, EMF

Meta-formalism E3 (EClassi�er, EReference),essentially Graph

Modeling Formalism,E2 (EPackage), typedover E3:t(EPackage) = t(EClassifier) =t(EClass) = t(EDataType) = EClassifier,

t(eClassifiers) = t(eType) =t(eAttribues) = t(eReferences) =eStructuralFeatures

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

Ecore model expressed in DPL

Ecore is the metamodel of the Eclipse Modeling Framework, EMF

Meta-formalism E3 (EClassi�er, EReference),essentially Graph

Modeling Formalism,E2 (EPackage), typedover E3:t(EPackage) = t(EClassifier) =t(EClass) = t(EDataType) = EClassifier,

t(eClassifiers) = t(eType) =t(eAttribues) = t(eReferences) =eStructuralFeatures

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

MetamodelingDPL meta modelEcore meta model in DPL

Ecore model expressed in DPL

Ecore is the metamodel of the Eclipse Modeling Framework, EMF

Meta-formalism E3 (EClassi�er, EReference),essentially Graph

Modeling Formalism,E2 (EPackage), typedover E3:t(EPackage) = t(EClassifier) =t(EClass) = t(EDataType) = EClassifier,

t(eClassifiers) = t(eType) =t(eAttribues) = t(eReferences) =eStructuralFeatures

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Tools

Tools implemented as plug-ins to the Eclipse platform

Need tools for:

Drawing of models, partly �nished June 2008Serialization of models, work startedValidation of models, future research projectModel transformation tools, reasearch started

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Drawing tool

Built over Eclipse Graphical Modeling Framework, GMF

Will build separate tool for building signatures, conforms to amodeling language

Tool for creating models over signatures, i.e. modeling tool inthe chosen language

Today drawing tool still some issues with diagrams with morethan 3 nodes

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Summary

The industry have a lot of hidden knowledge, they have noneed for formalization

Modeling community work with �brations, not index as we aretrained to in mathematics

Practical problems seems easy in theory but you really get dirton your �ngers

We have obtained good understanding on modeling, metamodeling and model transformation

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Further work

Work on classi�cation of model transformations, whatproperties has di�erent class of transformations?

Implement di�erent formalisms in DPL (UML, XML, ...)

Implement model transformation tool with code generationand cross platform translation

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Model Transformation Concepts

Model Transformation = set of Transformation Rules +Coordinations (⇒ operational)

Model Transaction = declarative de�nition of thetransformation

Transformation Engine = executes the rules

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Transformation Rules

PιP

||yyyyyyyyy

m

��

P′

ιP′

""FFFFFFFFF

[[t]](m)

��

� //

G (M1) Iιoo

[=]

trace

//I′

ι′

//[=]

G (M2)

Input and output patterns P and P ′

Input and out put instances I and I ′

The models M1 and M2

The matches m and [[t]](m)

Yngve Lamo MDE and DPL

Introduction and MotivationConcepts in DPL

OMG standards and Metamodeling LevelsTools

Key �ndingsModel Transformations

Transformation Rules

PιP

||yyyyyyyyy

m

��

P′

ιP′

""FFFFFFFFF

[[t]](m)

��

� //

G (M1) Iιoo

[=]

trace

//I′

ι′

//[=]

G (M2)

Input and output patterns P and P ′

Input and out put instances I and I ′

The models M1 and M2

The matches m and [[t]](m)

Yngve Lamo MDE and DPL