Language, Models and Megamodels Tutorial on Megamodelling Anya - - PowerPoint PPT Presentation

language models and megamodels tutorial on megamodelling
SMART_READER_LITE
LIVE PREVIEW

Language, Models and Megamodels Tutorial on Megamodelling Anya - - PowerPoint PPT Presentation

Language, Models and Megamodels Tutorial on Megamodelling Anya Helene Bagge Bergen Language Design Laboratory University of Bergen SATToSE14 2014-07-10 Bagge (UiB / BLDL) Megamodelling 2014-07-10 1 / 18 Learning Outcomes What is a


slide-1
SLIDE 1

Language, Models and Megamodels Tutorial on Megamodelling

Anya Helene Bagge

Bergen Language Design Laboratory University of Bergen

SATToSE’14 2014-07-10

Bagge (UiB / BLDL) Megamodelling 2014-07-10 1 / 18

slide-2
SLIDE 2

Learning Outcomes

What is a model? ...a metamodel? ...a megamodel? Why would would you need one? Relations between models Kinds of megamodels Mega patterns Practical megamodelling I’m a language engineer, so we’ll start from a language perspective.

Bagge (UiB / BLDL) Megamodelling 2014-07-10 2 / 18

slide-3
SLIDE 3

So... What’s a Language?

A language is a form of communication has structure carries meaning is/creates abstraction → → → → → →

Bagge (UiB / BLDL) Megamodelling 2014-07-10 3 / 18

slide-4
SLIDE 4

Languages

Kinds: Natural Artificial

Formal

Software language: Artificial language used in software development Programming, Modelling, Data representation, Ontologies, APIs, ... Forms: Written Spoken Diagrams Purpose: General-Purpose

Can define arbitrary abstractions

Domain-specific

Bagge (UiB / BLDL) Megamodelling 2014-07-10 4 / 18

slide-5
SLIDE 5

What’s a model?

A model is a simplification of a system build with an intended goal in mind. The model should be able to answer questions in place of the actual system∗ Typically, a model represents a system System may be abstract or real May also be used in the sense of a type/class, example, instance, mold Descriptive or prescriptive

* [Bézivin, Gerbé, Towards a Precise Definition of the OMG/MDA Framework]

Bagge (UiB / BLDL) Megamodelling 2014-07-10 5 / 18

slide-6
SLIDE 6

...aaand a metamodel?

A metamodel is model of a modelling language

Modelling Language Metamodel Model ←writtenIn ←conformsTo ←models

Bagge (UiB / BLDL) Megamodelling 2014-07-10 6 / 18

slide-7
SLIDE 7

’Sup With Megamodels?

A megamodel is model of a system of models

Bagge (UiB / BLDL) Megamodelling 2014-07-10 7 / 18

slide-8
SLIDE 8

A Totally Unrelated Example: Climate Modelling

. . Bagge (UiB / BLDL) Megamodelling 2014-07-10 8 / 18

slide-9
SLIDE 9

A Totally Unrelated Example: Climate Modelling

. . ← reprOf Bagge (UiB / BLDL) Megamodelling 2014-07-10 8 / 18

slide-10
SLIDE 10

A Totally Unrelated Example: Climate Modelling

. . ← reprOf Bagge (UiB / BLDL) Megamodelling 2014-07-10 8 / 18

slide-11
SLIDE 11

A Totally Unrelated Example: Climate Modelling

. . ← reprOf ← impacts → Bagge (UiB / BLDL) Megamodelling 2014-07-10 8 / 18

slide-12
SLIDE 12

A Totally Unrelated Example: Climate Modelling

. . ← reprOf ← reprOf ← impacts → Bagge (UiB / BLDL) Megamodelling 2014-07-10 8 / 18

slide-13
SLIDE 13

A Totally Unrelated Example: Climate Modelling

. .

?

← reprOf ← reprOf ← impacts → impacts? → impacts? → Bagge (UiB / BLDL) Megamodelling 2014-07-10 8 / 18

slide-14
SLIDE 14

Why Would You Need a Megamodel?

To understand your system: Models have implicit relations and assumptions:

What technologies are in the environment? How does this model relate to other models? (e.g. models may show different views of same system)

Systems of models may very complex

Need a model to understand them!

Supporting MDE with model management Define software architecture Things to model: Languages Technologies Programs Transformations Relations ... Relationships: Conformance Transformation Composition Representation ...

Bagge (UiB / BLDL) Megamodelling 2014-07-10 9 / 18

slide-15
SLIDE 15

Megamodel Relations

Ad hoc megamodelling: Draw a diagram with models Add relations between them Relations are in natural language Focus is on understanding and communicating. Jean-Marie’s relations: µ: representationOf ǫ: elementOf δ: decomposedIn χ: conformsTo

E.g.: Program is ElementOf Language, Grammar is RepresentationOf Language, Program ConformsTo Grammar, System is DecomposedIn Component

Bagge (UiB / BLDL) Megamodelling 2014-07-10 10 / 18

slide-16
SLIDE 16

Megamodel Relations

Relations in MegaL:

[Favre, Lämmel, and Varanovich, Modeling the Linguistic Architecture of Software Products]

Bagge (UiB / BLDL) Megamodelling 2014-07-10 11 / 18

slide-17
SLIDE 17

Megamodel Relations

Relations in MegaL:

:Language subsetOf :Language :Artifact elementOf :Language :Language domainOf :Function :Function hasRange :Language :FunctionApplication elementOf :Function :Artifact inputOf :FunctionApplication :FunctionApplication hasOutput :Artifact :Artifact conformsTo :Artifact :Artifact partOf :Artifact :Artifact correspondsTo :Artifact :Artifact dependsOn :Artifact :Artifact dependsOn :Language :Artifact realizationOf :Function :Artifact definitionOf :Language :Program partOf :Technology :Library partOf :Technology [Favre, Lämmel, and Varanovich, Modeling the Linguistic Architecture of Software Products]

Bagge (UiB / BLDL) Megamodelling 2014-07-10 11 / 18

slide-18
SLIDE 18

Megamodel Patterns

Example: Specification/Language/Program or Metamodel/Language/Model

MM L M ... reprOf → elementOf → reprOf →

MM L M ... ← conformsTo reprOf → [Favre, Megamodelling and etymology. A story of words: from MED to MDE via MODEL in five millenniums]

Bagge (UiB / BLDL) Megamodelling 2014-07-10 12 / 18

slide-19
SLIDE 19

Practical Megamodelling: Modelling Language Artifacts

Str Tkl Tok Ptr Cst Ast

text editing structural editing refactoring c

  • d

e t r a n s f

  • r

m a t i

  • n

Text Layout Layoutless Abstract Flat Structured tokenize concat strip format parse unparse parse unparse strip format implode explode

[Zaytsev & Bagge: Parsing in a Broad Sense]

Bagge (UiB / BLDL) Megamodelling 2014-07-10 13 / 18

slide-20
SLIDE 20

Practical Megamodelling: Modelling Language Artifacts

Str Tkl Tok Ptr Cst Ast

Text Layout Layoutless Abstract Flat Structured ← reprOf ← reprOf ← structOf ← structOf ← reprOf ← reprOf [Zaytsev & Bagge: Parsing in a Broad Sense]

Bagge (UiB / BLDL) Megamodelling 2014-07-10 14 / 18

slide-21
SLIDE 21

MegaL

[Favre, Lämmel, and Varanovich, Modeling the Linguistic Architecture of Software Products]

Bagge (UiB / BLDL) Megamodelling 2014-07-10 15 / 18

slide-22
SLIDE 22

Another Example: Astronomical Simulation Software

[Favre, Megamodelling and etymology. A story of words: from MED to MDE via MODEL in five millenniums]

Bagge (UiB / BLDL) Megamodelling 2014-07-10 16 / 18

slide-23
SLIDE 23

Summary

Language is structured and meaningful communication Models abstract over and represent systems Metamodels are models of (modelling) languages Megamodels are models of systems of models

Aimed at understanding (for humans) Makes relationships explicit Identifies roles – and missing models

Bagge (UiB / BLDL) Megamodelling 2014-07-10 17 / 18

slide-24
SLIDE 24

Image credits: 3/Vase: Guillaume Blanchard (CC-BY-SA-1.0) 3/Sun: Alan Murray Walsh / www.geograph.org.uk (CC-BY-SA-2.0) 3/Duck: J.M.Garg / Wikimedia (GNU-FDL) 3/Father and son: Onkelbo / Wikimedia (GNU-FDL) 3/Hatshepsut: Keith Schengili-Roberts / Wikimedia / Ägyptisches Museum Berlin (CC-BY-SA-3.0) 5/System model: Phil’s Astronomy Blog 6/Solar system model: Mrs. Studivan 8/Earth: NASA (public domain) 8/Climate model: NOAA (public domain) 8/People: James Cridland (CC-BY) 8/The Sims cover: EA 10/Jean-Marie Favre: Eelco Visser Bagge (UiB / BLDL) Megamodelling 2014-07-10 18 / 18