• No results found

Dynamic Logic Semantics for UML Consistency

N/A
N/A
Protected

Academic year: 2021

Share "Dynamic Logic Semantics for UML Consistency"

Copied!
66
0
0

Loading.... (view fulltext now)

Full text

(1)

Dynamic Logic Semantics

for UML Consistency

Greg O’Keefe Computer Sciences Laboratory

(2)

The Big Picture

a model is a statement about systems

but its meaning is only approximate so we can not say if it is consistent

a dynamic logic formula is also a statement about systems

its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(3)

The Big Picture

a model is a statement about systems

but its meaning is only approximate

so we can not say if it is consistent

a dynamic logic formula is also a statement about systems

its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(4)

The Big Picture

a model is a statement about systems but its meaning is only approximate

so we can not say if it is consistent

a dynamic logic formula is also a statement about systems

its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(5)

The Big Picture

a model is an approximate statement about systems

but its meaning is only approximate so we can not say if it is consistent

a dynamic logic formula is also a statement about systems

its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(6)

The Big Picture

a model is an approximate statement about systems

but its meaning is only approximate so we can not say if it is consistent

a dynamic logic formula is also a statement about systems

its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(7)

The Big Picture

a model is an approximate statement about systems

but its meaning is only approximate so we can not say if it is consistent

a dynamic logic formula is also a statement about systems

its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(8)

The Big Picture

a model is an approximate statement about systems

but its meaning is only approximate so we can not say if it is consistent

a dynamic logic formula is also a statement about systems its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(9)

The Big Picture

a model is an approximate statement about systems

but its meaning is only approximate so we can not say if it is consistent

a dynamic logic formula is also a statement about systems its meaning is exact

and we can automatically determine its consistency (undecidable, but most of the time)

(10)

The Big Picture

a model is an approximate statement about systems

but its meaning is only approximate so we can not say if it is consistent

a dynamic logic formula is a precise statement about systems

its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(11)

The Big Picture

a model is an approximate statement about systems

but its meaning is only approximate so we can not say if it is consistent

a dynamic logic formula is a precise statement about systems

its meaning is exact

and we can automatically determine its consistency

(undecidable, but most of the time)

(12)

Consistency (Logic 101)

In a situation, each statement is true or false.

The circle is red. true

The circle is red. false

A statement is consistent if it is true in some situation. The circle is red. consistent

(13)

Consistency (Logic 101)

In a situation, each statement is true or false.

The circle is red. true

The circle is red. false

A statement is consistent if it is true in some situation. The circle is red. consistent

(14)

A model is a statement about systems

Given a system, each model is true or false.

situation/system statement/model

true? false?

To answer model consistency questions, we need definitions of:

model (syntax)

system (semantic domain)

when a model is true of a system (semantics)

Do we have this in the OMG documents?

(15)

A model is a statement about systems

Given a system, each model is true or false.

situation/system statement/model

true? false?

To answer model consistency questions, we need definitions of:

model (syntax)

system (semantic domain)

when a model is true of a system (semantics)

Do we have this in the OMG documents?

(16)

A model is a statement about systems

Given a system, each model is true or false.

situation/system statement/model

true? false?

To answer model consistency questions, we need definitions of:

model (syntax)

system (semantic domain)

when a model is true of a system (semantics)

Do we have this in the OMG documents?

(17)

A model is a statement about systems

Given a system, each model is true or false.

situation/system statement/model

true? false?

To answer model consistency questions, we need definitions of:

model (syntax)

system (semantic domain)

when a model is true of a system (semantics)

Do we have this in the OMG documents?

(18)

A model is a statement about systems

Given a system, each model is true or false.

situation/system statement/model

true? false?

To answer model consistency questions, we need definitions of:

model (syntax)

system (semantic domain)

when a model is true of a system (semantics)

Do we have this in the OMG documents?

(19)

A model is a statement about systems

Given a system, each model is true or false.

situation/system statement/model

true? false?

To answer model consistency questions, we need definitions of:

model (syntax)

system (semantic domain)

when a model is true of a system (semantics)

Do we have this in the OMG documents?

(20)

Mellor’s Challenge

We want

semantics to say this is inconsistent

tools to detect it

Sequence Diagram

Class Diagram

State Machine for Class A

Entry Action for State s0

(21)

Mellor’s Challenge

We want

semantics to say this is inconsistent

tools to detect it

Sequence Diagram

Class Diagram

State Machine for Class A

Entry Action for State s0

(22)

Mellor’s Challenge

We want

semantics to say this is inconsistent

tools to detect it

Sequence Diagram

Class Diagram

State Machine for Class A

Entry Action for State s0

(23)

Mellor’s Challenge

We want

semantics to say this is inconsistent

tools to detect it

Sequence Diagram

Class Diagram

State Machine for Class A

Entry Action for State s0

(24)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

(25)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM

valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

(26)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM

valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

(27)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u

example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

(28)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u

example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

(29)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

(30)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

(31)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

(32)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

x :=t relates u to the x -variant with x 7→tM,u

(33)

Dynamic Logic (Logic 201)

First Order Logic

syntax example:∀xf(x) =y

interpretationMgives us a function fM valuation u gives us individuals xu, yu

x needs truth of f(x) =y under all x -variants of u example formula is true iff fM is constant with value yu

Dynamic Logic

syntax example:hy :=f(x)ix =y

hprogramiϕmeansϕmight be true afterprogramruns

programmeans binary relation over valuations

x :=t relates u to the x -variant with x 7→tM,u

(34)

System States and Evolution

Statics: What is a system state?

a system state is a valuation objects are individuals, they persist

attributes, association ends are “array” variables Dynamics: How can a system evolve?

Objects do actions, if conditions allow:

guard?;action

ε ≡ ((sc(x,M,y)?; x.sendMtoy) ∪ (ac(x)?; x.accept))∗

sc(x,M,y) ≡ x.class=ExternalEntity

∨ (head(x.todo) =sendMtoy) x.sendM toyy.intray :=append(y.intray,M);

(35)

System States and Evolution

Statics: What is a system state?

a system state is a valuation

objects are individuals, they persist

attributes, association ends are “array” variables Dynamics: How can a system evolve?

Objects do actions, if conditions allow:

guard?;action

ε ≡ ((sc(x,M,y)?; x.sendMtoy) ∪ (ac(x)?; x.accept))∗

sc(x,M,y) ≡ x.class=ExternalEntity

∨ (head(x.todo) =sendMtoy) x.sendM toyy.intray :=append(y.intray,M);

(36)

System States and Evolution

Statics: What is a system state?

a system state is a valuation

objects are individuals, they persist

attributes, association ends are “array” variables Dynamics: How can a system evolve?

Objects do actions, if conditions allow:

guard?;action

ε ≡ ((sc(x,M,y)?; x.sendMtoy) ∪ (ac(x)?; x.accept))∗

sc(x,M,y) ≡ x.class=ExternalEntity

∨ (head(x.todo) =sendMtoy) x.sendM toyy.intray :=append(y.intray,M);

(37)

System States and Evolution

Statics: What is a system state?

a system state is a valuation objects are individuals, they persist

attributes, association ends are “array” variables

Dynamics: How can a system evolve? Objects do actions, if conditions allow:

guard?;action

ε ≡ ((sc(x,M,y)?; x.sendMtoy) ∪ (ac(x)?; x.accept))∗

sc(x,M,y) ≡ x.class=ExternalEntity

∨ (head(x.todo) =sendMtoy) x.sendM toyy.intray :=append(y.intray,M);

(38)

System States and Evolution

Statics: What is a system state?

a system state is a valuation objects are individuals, they persist

attributes, association ends are “array” variables Dynamics: How can a system evolve?

Objects do actions, if conditions allow:

guard?;action

ε ≡ ((sc(x,M,y)?; x.sendMtoy) ∪ (ac(x)?; x.accept))∗

sc(x,M,y) ≡ x.class=ExternalEntity

∨ (head(x.todo) =sendMtoy) x.sendM toyy.intray :=append(y.intray,M);

(39)

System States and Evolution

Statics: What is a system state?

a system state is a valuation objects are individuals, they persist

attributes, association ends are “array” variables Dynamics: How can a system evolve?

Objects do actions, if conditions allow: guard?;action

ε ≡ ((sc(x,M,y)?; x.sendMtoy) ∪ (ac(x)?; x.accept))∗

sc(x,M,y) ≡ x.class=ExternalEntity

∨ (head(x.todo) =sendMtoy) x.sendM toyy.intray :=append(y.intray,M);

(40)

System States and Evolution

Statics: What is a system state?

a system state is a valuation objects are individuals, they persist

attributes, association ends are “array” variables Dynamics: How can a system evolve?

Objects do actions, if conditions allow:

guard?;action

ε ≡ ((sc(x,M,y)?; x.sendMtoy) ∪ (ac(x)?; x.accept))∗

sc(x,M,y) ≡ x.class=ExternalEntity

∨ (head(x.todo) =sendMtoy) x.sendM toyy.intray :=append(y.intray,M);

(41)

System States and Evolution

Statics: What is a system state?

a system state is a valuation objects are individuals, they persist

attributes, association ends are “array” variables Dynamics: How can a system evolve?

Objects do actions, if conditions allow:

guard?;action

ε ≡ ((sc(x,M,y)?; x.sendMtoy) ∪ (ac(x)?; x.accept))∗

sc(x,M,y) ≡ x.class=ExternalEntity

∨ (head(x.todo) =sendMtoy) x.sendM toyy.intray :=append(y.intray,M);

(42)

Class Diagram

For each diagram, a range of interpretations is possible, even desirable. Here we give rather weak ones.

(They are shorter!)

CD≡ [ε](∀xx.class=A //

size(x.ex) =1∧

(43)

Class Diagram

For each diagram, a range of interpretations is possible, even desirable. Here we give rather weak ones. (They are shorter!)

CD≡ [ε](∀xx.class=A //

size(x.ex) =1∧

(44)

Class Diagram

For each diagram, a range of interpretations is possible, even desirable. Here we give rather weak ones. (They are shorter!)

CD≡ [ε](∀xx.class=A //

size(x.ex) =1∧

(45)

State Machine Diagram

We do not yet specify which objects the state machine diagram applies to, so the formulae have a free variable.

SMs(x) ≡ [ε](x.state=sx.state =s0)

SMt(x) ≡ [ε](x.state=shead(x.intray) =W

(46)

State Machine Diagram

We do not yet specify which objects the state machine diagram applies to, so the formulae have a free variable.

SMs(x) ≡ [ε](x.state=sx.state =s0)

SMt(x) ≡ [ε](x.state=shead(x.intray) =W

(47)

Weaving as Formation

Aspect Oriented Modelling and model “weaving” are hot research topics. In this formal setting, it is clear and simple.

action - state join

Put action on todo list when object enters state.

SMp(x) ≡ [ε][x.accept](

x.state=s0 //

x.todo=sendX tox.ex)

state machine - class join

Make objects of class A obey state machine formulae.

(48)

Weaving as Formation

Aspect Oriented Modelling and model “weaving” are hot research topics. In this formal setting, it is clear and simple. action - state join

Put action on todo list when object enters state.

SMp(x) ≡ [ε][x.accept](

x.state=s0 //

x.todo=sendX tox.ex)

state machine - class join

Make objects of class A obey state machine formulae.

(49)

Weaving as Formation

Aspect Oriented Modelling and model “weaving” are hot research topics. In this formal setting, it is clear and simple. action - state join

Put action on todo list when object enters state.

SMp(x) ≡ [ε][x.accept](

x.state=s0 //

x.todo=sendX tox.ex)

state machine - class join

Make objects of class A obey state machine formulae.

(50)

Sequence Diagram

SEQclass(ee) =ExternalEntitya.class=Ab.class=B

hεi(sc(ee,W,a) ∧ hee.sendW toai hεi(ac(a) ∧ ha.accepti

(51)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers

a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the handle and then . . .

it gives us a system where X =Y , showing that the UML model is consistent, hmmm!

(52)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers

a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the handle and then . . .

it gives us a system where X =Y , showing that the UML model is consistent, hmmm!

(53)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the handle and then . . .

it gives us a system where X =Y , showing that the UML model is consistent, hmmm!

(54)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the handle and then . . .

it gives us a system where X =Y , showing that the UML model is consistent, hmmm!

(55)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the handle and then . . .

it gives us a system where X =Y , showing that the UML model is consistent, hmmm!

(56)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the

handle and then . . .

it gives us a system where X =Y , showing that the UML model is consistent, hmmm!

(57)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the handle and then . . .

it gives us a system where X =Y , showing that the UML

model is consistent, hmmm!

(58)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the handle and then . . .

it gives us a system where X =Y , showing that the UML model is consistent, hmmm!

so next time we add X.name=“X” etc. to our theory

(59)

Consistency: the search for a satisfying system

Semantic tableaux theorem provers a formulaϕis valid iff¬ϕis inconsistent

if a complete search for an interpretation to satisfy¬ϕfinds none, then it is a proof ofϕ

we can use these interpretation finders to demonstrate model consistency

Our search

we drop CDSMSEQ into a tableau prover, turn the handle and then . . .

it gives us a system where X =Y , showing that the UML model is consistent, hmmm!

so next time we add X.name=“X” etc. to our theory

(60)

Summary

By translating models into dynamic logic we

give precise meaning enable consistency check

Why DL? Why not TLA+, Z, ASM’s, OCL (?!), ...? With DL we have made action outline statements.

(61)

Summary

By translating models into dynamic logic we give precise meaning

enable consistency check

Why DL? Why not TLA+, Z, ASM’s, OCL (?!), ...? With DL we have made action outline statements.

(62)

Summary

By translating models into dynamic logic we give precise meaning

enable consistency check

Why DL? Why not TLA+, Z, ASM’s, OCL (?!), ...? With DL we have made action outline statements.

(63)

Summary

By translating models into dynamic logic we give precise meaning

enable consistency check

Why DL? Why not TLA+, Z, ASM’s, OCL (?!), ...?

With DL we have made action outline statements.

(64)

Summary

By translating models into dynamic logic we give precise meaning

enable consistency check

Why DL? Why not TLA+, Z, ASM’s, OCL (?!), ...?

With DL we have made action outline statements.

(65)

Summary

By translating models into dynamic logic we give precise meaning

enable consistency check

Why DL? Why not TLA+, Z, ASM’s, OCL (?!), ...? With DL we have made action outline statements.

ignore irrelevant detail

(66)

Summary

By translating models into dynamic logic we give precise meaning

enable consistency check

Why DL? Why not TLA+, Z, ASM’s, OCL (?!), ...? With DL we have made action outline statements.

References

Related documents

Regarding learning outcomes, majority reported that they developed critical thinking abilities, better understanding of clinical experience, assessment skills,

The study is helpful for many players in Home Appliances to make following strategies related to advertising for any particular company: -..  Advertising

The present review article mainly focused on different approaches, mainly on formulation, carrier system and/or coating system, bioactive stability, patient

Yazbeck, Natacha, MA; AUB; Instructor (Part time); Social and Behavioral Sciences Yazbek-Karam, Vanda, MD; Université Saint Joseph; Clinical Associate; Anesthesiology Yeretzian,

If a dominion does not meet an action’s Ability minimum, a Virtue can be rolled with an Attribute when a dominion takes an action, but doing so can increase the dominion’s Limit..

This article explores the recent initiative to invigorate architectural records collections at Ball State University’s Drawings + Documents Archive using rapid prototyping

The third research question asked whether participants held perceptions related to negative meta-stereotypes which could serve as a psychological barrier to the

3 Filling this gap in the empirical data and asymmetry in the public discourse serves two purposes: for scholars, to "improve the accuracy and pertinence of