runtime verification of executable modelsicetcs.ru.is/nwpt2015/slides/macias.pdf · runtime...

34
Runtime Verification of Executable Models Fernando Macías [email protected] Adrian Rutle [email protected] Volker Stolz [email protected] NWPT 2015

Upload: others

Post on 22-Jan-2020

22 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Runtime Verification of

Executable Models

Fernando Macías – [email protected]

Adrian Rutle – [email protected]

Volker Stolz – [email protected]

NWPT 2015

Page 2: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Motivation

• Modelling offers one more level of abstraction

above programming

• Close the gap between domain experts and

software engineers

› Different views of the system

› The solution can be specified in the problem space

2

Problem space

Domain experts

Solution space

Software engineers

Page 3: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Two types of models

Structural models

Behavioural models

3

• The metamodel defines

a type of structure

• The model represents a

particular structure

• Semantics given by a

set of instances

(snapshots)

• E.g: Class diagrams

• The metamodel defines

a process language

• The model represent a

process

• Semantics can be

expressed as model

transformations

• E.g: BPMN, Petri nets

Page 4: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Verification of Behavioural Models

• Testing

› Applied on small parts of the model

› Cumbersome in big models

› Not exhaustive

• Model checking

› Exhaustive and strong

› Bad scalability

• Runtime verification

4

Page 5: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Runtime Verification of Behavioural

Models

• Useful when the system is too complex to be

analysed thoroughly1

• Can be performed over simulations or the actual

deployed system

• Based on:

› Temporal properties: Invariants, implications of

present/past events in future events, global properties

(e.g: termination)

› Monitors: Check properties against running instances

1. Leucker et al. A brief account of runtime verification. 5

Page 6: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Executable Modelling

• Definition of models with enough information to be

executed

• Two alternatives

› Interpreted: The model itself is run in a custom runtime

environment. The instances are evolved through model

transformations1

› Compiled: The model is transformed into a machine-

readable representation, e.g: imperative code2

• Focus on definition of interpreted process models

1. Guermazi et al. Executable Modeling with fUML and Alf in Papyrus

2. Dévai et al. UML Model Execution via Code Generation

6

Page 7: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Runtime Verification of

Executable Models

Fernando Macías – [email protected]

Adrian Rutle – [email protected]

Volker Stolz – [email protected]

Page 8: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Hierarchy for Executable Modelling

8

• The standardized

solutions are EMF (MOF)

and UML

• Both have a bigger focus

on structure

• Limited number of levels

• In complex architectures,

the levels have to be

collapsed

› Convolution of models

› Bad maintainability

Meta-metamodel

Metamodel

Model

Page 9: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Hierarchy for Executable Modelling

8

• The standardized

solutions are EMF (MOF)

and UML

• Both have a bigger focus

on structure

• Limited number of levels

• In complex architectures,

the levels have to be

collapsed

› Convolution of models

› Bad maintainability

Meta-metamodel

Metamodel

Typed by

Model

Typed by

Page 10: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Hierarchy for Executable Modelling

9

Page 11: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Hierarchy for Executable Modelling

1. De Lara et al. When and How to Use Multilevel Modelling 9

• Our hierarchy exploits

the concept of Multilevel

Modelling

“Enabling modelling at an

arbitrary number of meta-

levels” 1

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Page 12: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Hierarchy for Executable Modelling

10

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Page 13: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Hierarchy for Executable Modelling

10

• Our hierarchy exploits

the concept of Deep

Metamodelling

“An element in a model

can be typed by another

element several models

above”

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Typed by

Typed by

Page 14: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Hierarchy for Executable Modelling

11

• This hierarchy allows to

› Define custom executable

modelling languages

› Create models according to

those languages

› Run the instances with

default semantics

› Customize semantics

› Simulation

› Deployment

› Runtime verification over

the running instances

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Typed by

Typed by

Page 15: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

12

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Typed by

Typed by

Page 16: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

1. Rossini et al. A formalisation of deep metamodelling 12

• Using the concept of

Linguistic Extension

“Instantiation within a

linguistic modelling

language used to specify

the models at all

metalevels of the

ontological stack” 1

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Typed by

Typed by P

ropert

y

Specific

ation

Language

Page 17: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

13

Page 18: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

14

Page 19: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

14

• Linguistic Extension

allows to create

properties connected to

model elements

• Temporal properties

expressed over types

and instances of the

models

Page 20: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

14

• Linguistic Extension

allows to create

properties connected to

model elements

• Temporal properties

expressed over types

and instances of the

models

• Possibility to define

cross-level properties

Page 21: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

14

• Linguistic Extension

allows to create

properties connected to

model elements

• Temporal properties

expressed over types

and instances of the

models

• Possibility to define

cross-level properties

• Possibility to link to

several instances

Page 22: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

15

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Typed by

Typed by P

ropert

y

Specific

ation

Language 1

Page 23: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

15

• The hierarchy allows to

add new languages

(e.g. TLTL, SALT)

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Typed by

Typed by P

ropert

y

Specific

ation

Language 1

Pro

pert

y

Specific

ation

Language 2

Page 24: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

15

• The hierarchy allows to

add new languages

(e.g. TLTL, SALT)

• Possibility of a

hierarchy of property

languages P

ropert

y

Language

Meta

model

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Typed by

Typed by P

ropert

y

Specific

ation

Language 1

Pro

pert

y

Specific

ation

Language 2

Page 25: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

15

• The hierarchy allows to

add new languages

(e.g. TLTL, SALT)

• Possibility of a

hierarchy of property

languages P

ropert

y

Language

Meta

model

Model

Model

Model

Model

Instance

Typed by

Typed by

Typed by

Typed by

Typed by

Typed by P

ropert

y

Specific

ation

Language 1

Pro

pert

y

Specific

ation

Language 2

Page 26: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Property Specification Language

16

Page 27: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Syntax

Abstract syntax

Concrete syntax

17

• Internal representation

of the model

• In graph-based models,

nodes and relations

among them

• Created to be human

readable

• Synchronized with the

abstract syntax

• Text, diagrams...

Model Model

F

G

Page 28: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Semantics

• LTL temporal operator unrolling

• LTL Next operator (X) processing

• LTL reduction

18

))(( UXU

XFF

XGG

)()( 1 nn ttX

GGG

Page 29: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Repeat until every property has been reduced to ⊤

or ⊥

Semantics

19

F1 (t)

F2 (t)

Mp(t)

Unrolling

(MT)

F1 (t)

F2 (t)

Mp(t)

Compare

with instance

(query)

Mr (t)

F1 (t+1)

F2 (t+1)

Mp(t+1)

Reduction

(MT)

F1 (t)

F2 (t) Mp(t+1)

Page 30: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Semantics

• ATL/EMF implementation

abstract rule processX {

from

input : mmProperties!X

to

output : mmProperties!UnaryOperator (

formula <- input.formula.formula

)

}

20

Page 31: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Semantics as model transformations

• ATL/EMF implementation

21

Page 32: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Future work

• Integrate our hierarchy of models and languages

into an existing framework (GEMOC), or…

• … create a multilevel modelling editor for EMF

models

• Add new languages for the specification of

temporal properties

• Seamless and automatic linking of property

specification languages with any model in the

hierarchy

22

Page 33: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Summary

• Introduction of flexible hierarchy for executable

modelling

• Definition of abstract syntax, concrete syntax and

semantics for temporal properties on behavioural

models

• Runtime Verification of temporal properties on

interpreted models. No need for

compilation/translation

• Usage of deep metamodelling concepts to achieve

a customizable hierarchy

23

Page 34: Runtime Verification of Executable Modelsicetcs.ru.is/nwpt2015/SLIDES/Macias.pdf · Runtime Verification of Executable Models Fernando Macías – fernando.macias@hib.no Adrian Rutle

Summary

• Introduction of flexible hierarchy for executable

modelling

• Definition of abstract syntax, concrete syntax and

semantics for temporal properties on behavioural

models

• Runtime Verification of temporal properties on

interpreted models. No need for

compilation/translation

• Usage of deep metamodelling concepts to achieve

a customizable hierarchy

23

Thank you for your attention!