Академический Документы
Профессиональный Документы
Культура Документы
Introduction to UML
Contents
Overview of KeY
UML and its semantics
Introduction to OCL
Specifying requirements with OCL
Modelling of Systems with Formal Semantics
Propositional & First-order logic, sequent calculus
OCL to Logic, horizontal proof obligations, using KeY
Dynamic logic, proving program correctness
Java Card DL
Vertical proof obligations, using KeY
Wrap-up, trends
Building Models
UML
UML
UML
UML Diagrams
Structural Diagrams
Behavioural Diagrams
UML Diagrams
Structural Diagrams
Behavioural Diagrams
Class Diagrams
Component Diagrams
Composite Structure
Diagrams
Object Diagrams
Deployment Diagrams
Package Diagrams
UML Diagrams
Structural Diagrams
Behavioural Diagrams
Class Diagrams
Component Diagrams
Composite Structure
Diagrams
Object Diagrams
Deployment Diagrams
Package Diagrams
UML Diagrams
Structural Diagrams
Behavioural Diagrams
Class Diagrams
Component Diagrams
Composite Structure
Diagrams
Object Diagrams
Deployment Diagrams
Package Diagrams
UML Diagrams
Structural Diagrams
Behavioural Diagrams
Class Diagrams
Activity Diagrams
Component Diagrams
Interaction Diagrams
Composite Structure
Diagrams
Sequence Diagrams
Collaboration
Diagrams
..
.
Object Diagrams
Deployment Diagrams
Package Diagrams
UML Diagrams
Structural Diagrams
Behavioural Diagrams
Class Diagrams
Activity Diagrams
Component Diagrams
Interaction Diagrams
Composite Structure
Diagrams
Sequence Diagrams
Collaboration
Diagrams
..
.
Object Diagrams
Deployment Diagrams
Package Diagrams
UML Diagrams
Structural Diagrams
Behavioural Diagrams
Class Diagrams
Activity Diagrams
Component Diagrams
Interaction Diagrams
Composite Structure
Diagrams
Sequence Diagrams
Collaboration
Diagrams
..
.
Object Diagrams
Deployment Diagrams
Package Diagrams
Class Diagrams
Model static design view, define vocabulary (signature)
Class
Collection of similar objects in a system
Attributes
Operations/Methods
Person
name:String
e-mail:String
startWork(t:Time)
Class Diagrams
Model static design view, define vocabulary (signature)
Class
Collection of similar objects in a system
Attributes
Operations/Methods
Person
name:String
e-mail:String
startWork(t:Time)
Association
Relation between classes
Relates pairs of class instances
Person
repairs
mechanic
0..*
Car
Class Diagrams
Model static design view, define vocabulary (signature)
Class
Collection of similar objects in a system
Attributes
Operations/Methods
Person
name:String
e-mail:String
startWork(t:Time)
Association
Relation between classes
Relates pairs of class instances
Person
repairs
mechanic
0..*
Car
Car
Generalisation/Inheritance
Specialisation-/Generalisation
relationship between classes
SportsCar
Van
Classes
class name
name compartment
Person
name:String
e-mail:String
attribute names
attribute compartment
attribute types
Classes
class name
name compartment
Person
name:String
e-mail:String
attribute names
attribute compartment
attribute types
Null
Null
Semantics of Null
Each class diagram contains implicitly the Null class
No attributes, no operations
I(Null) = {null}
null I(C) for any class C
null is typeable with any type C
Subclasses
Paper
superclass
authors[*]:Person
number:Integer
constraint
ShortPaper
{disjoint}
subclasses
generalization
LongPaper
Subclasses
Paper
superclass
authors[*]:Person
number:Integer
constraint
ShortPaper
{disjoint}
subclasses
generalization
LongPaper
Semantics of Subclasses
subclass relation: I(ShortPaper) I(Paper)
constraint: I(ShortPaper) I(LongPaper) = {null}
Attributes
class name
name compartment
Person
name:String
e-mail:String
attribute names
attribute compartment
attribute types
Attributes
name compartment
Person
class name
name:String
e-mail:String
attribute names
attribute compartment
attribute types
Semantics of Attributes
Multiplicities
Semantics
I(M )
0..1
{0, 1}
0..
1..3
{1, 2, 3}
{7}
15..19
1..3, 7, 15..19
Associations
multiplicities
Person
name:String
e-mail:String
3
referee
role name
*
review
Paper
authors[*]:Person
number:int
association name
Associations
multiplicities
Person
name:String
e-mail:String
3
referee
role name
*
review
Paper
authors[*]:Person
number:int
association name
Semantics
Person
name:String
e-mail:String
3
referee
role name
Paper
*
review {ordered} authors[*]:Person
number:Integer
association name
property is ordered
Person
name:String
e-mail:String
3
referee
role name
Paper
*
review {ordered} authors[*]:Person
number:Integer
association name
property is ordered
Semantics
Client
Supplier
z }| {
z }| {
I(referee) : I(Paper) Set(I(Person))
(supplier multiplicity 6= 1)
Person
name:String
e-mail:String
3
referee
role name
Paper
*
review {ordered} authors[*]:Person
number:Integer
association name
property is ordered
Snapshots
A snapshot of a given class diagram D is a particular semantics I of D
UML object diagram (for D) including
for each class C: objects I(C) typeable with C
maps I(a) : I(C) I(C ) for all attributes a of type C in class C
association instances (pairs) in I(C)\{null} I(C )\{null}
an interpretation for operations/methods (Java: independent of
snapshot)
(standard) interpretation of predefined primitive data types and their
operations (Integer, String, . . . )
Snapshots
A snapshot of a given class diagram D is a particular semantics I of D
UML object diagram (for D) including
for each class C: objects I(C) typeable with C
maps I(a) : I(C) I(C ) for all attributes a of type C in class C
association instances (pairs) in I(C)\{null} I(C )\{null}
an interpretation for operations/methods (Java: independent of
snapshot)
(standard) interpretation of predefined primitive data types and their
operations (Integer, String, . . . )
3
referee
*
review
id0815:Person
name = Jane
e-mail = jane
Paper
authors[*]:Person
number:Integer
id333:Paper
authors = {id0815}
number = 17
review
id0825:Person
name = Paul
e-mail = paul
review
id301:Paper
authors = {id0815,id0825}
number = 33
3
referee
*
review
id0815:Person
name = Jane
e-mail = jane
Paper
authors[*]:Person
number:Integer
id333:Paper
authors = {id0815}
number = 17
review
id0825:Person
name = Paul
e-mail = paul
review
id301:Paper
authors = {id0815,id0825}
number = 33
Operations: Queries
Paper
authors[*]:Person
number:Integer
evaluate()
getNumber():Integer{query}
class name
attributes
operation
name & signature
Operations: Queries
Paper
class name
authors[*]:Person
number:Integer
evaluate()
getNumber():Integer{query}
attributes
operation
name & signature
z }| {
I(getNumber()) : I(Paper) I(Integer)
Operations: Queries
Paper
class name
authors[*]:Person
number:Integer
evaluate()
getNumber():Integer{query}
attributes
operation
name & signature
z }| {
I(getNumber()) : I(Paper) I(Integer)
Semantics of static queries omits owner class argument.
Paper
authors[*]:Person
number:Integer
evaluate()
getNumber():Integer{query}
class name
attributes
operation
name & signature
Paper
authors[*]:Person
number:Integer
evaluate()
getNumber():Integer{query}
class name
attributes
operation
name & signature
Paper
authors[*]:Person
number:Integer
evaluate()
getNumber():Integer{query}
class name
attributes
operation
name & signature
Abstract Classes
Paper
authors[*]:Person
number:Integer
ShortPaper
LongPaper
Abstract Classes
Paper
authors[*]:Person
number:Integer
ShortPaper
LongPaper
Association Class
Person
name:String
e-mail:String
3
referee
review
Paper
authors[*]:Person
number:Int
Report
recommend:Marks
Association Class
Person
name:String
e-mail:String
3
referee
review
Paper
authors[*]:Person
number:Int
Report
recommend:Marks
Semantics
Data Types
data type
Integer
=(i2:Integer):Boolean
+(i2:Integer):Integer
+(i2:Real):Real
-(i2:Integer):Integer
-(i2:Real):Real
(i2:Integer):Integer
(i2:Real):Real
\(i2:Integer):Real
\(i2:Real):Real
abs:Integer
div(i2:Integer):Integer
mod(i2:Integer):Integer
max(i2:Integer):Integer
min(i2:Integer):Integer
data type
String
=(i2:String):Boolean
size:Integer
concat(string2:String):String
toUpper(string2:String):String
toLower(string2:String):String
substring(lower:Integer, upper:Integer):String
Data Types
Syntax
UML stereotype data type
No attributes
Semantics
Semantics I(C) of a data type class C fixed for all snapshots I
Enumerations
Person
name:String
e-mail:String
3
referee
review
Paper
authors[*]:Person
number:Integer
enumeration
Marks
Report
recommend:Marks
accept
reject
weakly accept
weakly reject
Enumerations
Person
name:String
e-mail:String
3
referee
review
Paper
authors[*]:Person
number:Integer
enumeration
Marks
Report
recommend:Marks
Semantics
accept
reject
weakly accept
weakly reject
Aggregations
aggregation icon
String
*
contains
Letter
*
role name
a
Semantics
Same (formal) semantics as an association
Pragmatics
Part-of relationship, though may be shared with other objects
Compositions
composition icon
Paper
Session
authors[*]:Person
title:String
title:String
Semantics
Same (formal) semantics as an association
Pragmatics
Owned-by, object lifetime controlled by client (= owner)
Client multiplicity 0..1 or 1
Component
children
*
operation()
Composite
Leaf
operation()
operation()
add(c:Component)
remove(c:Component)
getChild(n:Integer)
Car Mechanic
Car Mechanic
RepairService
Car Mechanic
RepairService
Subject
Workshop
System
participation
User
Create
File
Open
File
des
e
c
e
pr
Open by
name
Privileged
User
extend
Try to open
non-existing file
generalization
Open by
hyperlink
include
Browse
file
.
actor
use case
Relations
Participation: communication of instances of actor/use case
Can be directed (even towards actor) if communication one-way
Generalization (actors): communicates with at most as many use cases
Generalization (use cases): more general case
Relations
Participation: communication of instances of actor/use case
Can be directed (even towards actor) if communication one-way
Generalization (actors): communicates with at most as many use cases
Generalization (use cases): more general case
Stereotypes
Include: behaviour always contains that of included use case
Extend: behaviour can be augmented with that of extending use case
Much confusion about precise semantics discouraged
Precedes: user-defined stereotype, not UML standard
Sequence Diagrams
Interaction
Scenario realised by system run
mechanic: Person
aCar: Car
aBulb: Bulb
checkBulbs
turnOn
repairBulbs
Sequence Diagrams
Interaction
Scenario realised by system run
Lifeline
Individual participant in interaction; instance of class or actor
mechanic: Person
aCar: Car
aBulb: Bulb
checkBulbs
turnOn
repairBulbs
Sequence Diagrams
Interaction
Message
Lifeline
Individual participant in interaction; instance of class or actor
mechanic: Person
aCar: Car
aBulb: Bulb
checkBulbs
turnOn
repairBulbs
Sequence Diagrams
Interaction
Message
Lifeline
Execution Occurrence
aCar: Car
aBulb: Bulb
checkBulbs
turnOn
repairBulbs