Lecture 03: Object Constraint Language

Size: px
Start display at page:

Download "Lecture 03: Object Constraint Language"

Transcription

1 Software Design, Modelling and Analysis in UML Lecture 03: Object Constraint Language Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany main

2 Content The Object Constraint Language (OCL): Syntax Running Example Overview Expressions Notational Conventions (. (OCL-Dot) and -> (OCL-Arrow)) Constants & Arithmetics Iterate Context More Notational Conventions The Running Example Revisited Not Interesting Scontent 2/24

3 (Core) OCL Syntax OMG (2006) 3/ main

4 Overview expr ::= w : τ(w) expr 1 = τ expr 2 : τ τ Bool oclisundefined τ (expr 1 ) : τ Bool {expr 1,...,expr n } : τ τ Set(τ) size(expr 1 ) : Set(τ) Int allinstances C : Set(τ C ) v(expr 1 ) : τ C τ(v) r 1 (expr 1 ) : τ C τ D r 2 (expr 1 ) : τ C Set(τ D ) true, false : Bool notexpr 1 : Bool Bool expr 1 {and,or,implies}expr 2 : Bool Bool Bool... OclUndefined τ : τ expr 1 ->iterate(w 1 :T 1 ;w 2 :T 2 =expr 2 expr 3 ) : Set(τ 0 ) τ T2 context ::= contextw 1 :T 1,...,w n :T n inv :expr : Bool 4/24

5 Recall: Vending Machine Structure S = ({Bool,Int},{VM,CP,DD}, {cp : CP,dd : DD 0,1,wen : Bool,wis : Nat}, {VM {cp,dd},cp {wen,dd},dd {wis}) Claim: this is a proper OCL constraint over S : context CP inv : wen implies dd.wis > 0 5/24

6 Plan expr ::= w : τ(w) expr 1 = τ expr 2 : τ τ Bool oclisundefined τ (expr 1 ) : τ Bool {expr 1,...,expr n } : τ τ Set(τ) size(expr 1 ) : Set(τ) Int allinstances C : Set(τ C ) v(expr 1 ) : τ C τ(v) r 1 (expr 1 ) : τ C τ D r 2 (expr 1 ) : τ C Set(τ D ) true, false : Bool notexpr 1 : Bool Bool expr 1 {and,or,implies}expr 2 : Bool Bool Bool... OclUndefined τ : τ expr 1 ->iterate(w 1 :T 1 ;w 2 :T 2 =expr 2 expr 3 ) : Set(τ 0 ) τ T2 context ::= contextw 1 :T 1,...,w n :T n inv :expr : Bool 6/24

7 OCL Syntax 1/4: Expressions expr ::= w : τ(w) Where, given S = (T, C,V,atr), w W {self C : τ C C C} is a set of typed logical variables, w has typeτ(w) expr 1 = τ expr 2 : τ τ Bool oclisundefined τ (expr 1 ) : τ Bool {expr 1,...,expr n } : τ τ Set(τ) isempty(expr 1 ) : Set(τ) Bool size(expr 1 ) : Set(τ) Int allinstances C : Set(τ C ) τ is any type from T T B T C {Set(τ 0 ) τ 0 T T B T C } T B is a set of (OCL) basic types, in the following we use T B = {Bool,Int,String} T C = {τ C C C} is the set of object types, Set(τ 0 ) denotes the set-of-τ 0 type forτ 0 T B T C (sufficient because of flattening (cf. standard)). v(expr 1 ) : τ C τ where v : τ atr(c), τ T, r 1 (expr 1 ) : τ C τ D where r 1 : D 0,1 atr(c),c,d C, r 2 (expr 1 ) : τ C Set(τ D ) where r 2 : D atr(c),c,d C. 7/24

8 Expression Examples expr ::= w : τ(w) size(expr 1 ) : Set(τ) Int expr 1 = τ expr 2 : τ τ Bool oclisundefined τ (expr 1 ) : τ Bool {expr 1,...,expr n } : τ τ Set(τ) isempty(expr 1 ) : Set(τ) Bool allinstances C : Set(τ C ) v(expr 1 ) : τ C τ(v) r 1 (expr 1 ) : τ C τ D r 2 (expr 1 ) : τ C Set(τ D ) S 0 = ({Int},{C,D},{x : Int,p : C 0,1,n : C },{C {p,n},d {x}}) 8/24

9 Expression Examples expr ::= w : τ(w) size(expr 1 ) : Set(τ) Int expr 1 = τ expr 2 : τ τ Bool oclisundefined τ (expr 1 ) : τ Bool {expr 1,...,expr n } : τ τ Set(τ) isempty(expr 1 ) : Set(τ) Bool allinstances C : Set(τ C ) v(expr 1 ) : τ C τ(v) r 1 (expr 1 ) : τ C τ D r 2 (expr 1 ) : τ C Set(τ D ) S 0 = ({Int},{C,D},{x : Int,p : C 0,1,n : C },{C {p,n},d {x}}) context CP inv : wen implies dd.wis > 0 8/24

10 Notational Conventions for Expressions Each expression ω(expr 1,expr 2,...,expr n ) : τ 1 τ n τ may alternatively be written ( abbreviated as ) expr 1. ω(expr 2,...,expr n ) ifτ 1 is an object type, i.e. ifτ 1 T C. expr 1 -> ω(expr 2,...,expr n ) ifτ 1 is a collection type (here: only sets), i.e. ifτ 1 = Set(τ 0 ) for someτ 0 T B T C. Examples: ({Int},{C,D},{x : Int,p : C 0,1,n : C },{C {p,n},d {x}}) self C.p self C.p.n self C.p.n->isEmpty context CP inv : wen implies dd.wis > 0 (atr(cp) = {wen : Bool,dd : DD 0,1 }) 9/24

11 OCL Syntax 2/4: Constants & Arithmetics For example: expr ::=... true, false : Bool expr 1 {and,or,implies}expr 2 : Bool Bool Bool notexpr 1 : Bool Bool 0, 1,1, 2,2,... : Int expr 1 {+,,...}expr 2 : Int Int Int expr 1 {<,,...}expr 2 : Int Int Bool OclUndefined τ : τ Generalised notation: expr ::= ω(expr 1,...,expr n ) : τ 1 τ n τ withω {+,,...} 10/24

12 Constants & Arithmetics Examples expr ::=... true, false : Bool expr 1 {and,or,implies}expr 2 : Bool Bool Bool notexpr 1 : Bool Bool 0, 1,1, 2,2,... : Int expr 1 {+,,...}expr 2 : Int Int Int expr 1 {<,,...}expr 2 : Int Int Bool OclUndefined τ : τ S 0 = ({Int},{C,D},{x : Int,p : C 0,1,n : C },{C {p,n},d {x}}) context CP inv : wen implies dd.wis > 0 11/24

13 OCL Syntax 3/4: Iterate expr ::= expr 1 ->iterate(w 1 :T 1 ;w 2 :T 2 =expr 2 expr 3 ) or, with a little renaming, expr ::= expr 1 ->iterate(iter :T 1 ;result :T 2 =expr 2 expr 3 ) where expr 1 is of a collection type (here: a setset(τ 0 ) for someτ 0 ), iter W is called iterator, of the type denoted byt 1 (ift 1 is omitted,τ 0 is assumed as type ofiter) result W is called result variable, gets typeτ 2 denoted byt 2, expr 2 in an expression of typeτ 2 giving the initial value forresult, (OclUndefined τ2, if omitted) expr 3 is an expression of typeτ 2, in particulariter andresult may appear inexpr 3. 12/24

14 Iterate Example S = ({Bool,Int},{VM,CP,DD}, {cp : CP,dd : DD 0,1,wen : Bool,wis : Nat}, {VM {cp,dd},cp {wen,dd},dd {wis}) expr ::= expr 1 ->iterate(w 1 :T 1 ;w 2 :T 2 =expr 2 expr 3 ) 13/24

15 Abbreviations on Top of Iterate expr ::= expr 1 ->iterate(w 1 :T 1 ;w 2 :T 2 =expr 2 expr 3 ) expr 1 ->forall(w 1 : τ 1 expr 3 ) is an abbreviation for expr 1 ->iterate(w 1 :T 1 ;w 2 :Bool =true w 2 and expr 3 ). expr 1 ->Exists(w : τ 1 expr 3 ) is an abbreviation for To ensure confusion, we may again omit all kinds of things, cf. OMG (2006). 14/24

16 Recall: Overview expr ::= w : τ(w) expr 1 = τ expr 2 : τ τ Bool oclisundefined τ (expr 1 ) : τ Bool {expr 1,...,expr n } : τ τ Set(τ) size(expr 1 ) : Set(τ) Int allinstances C : Set(τ C ) v(expr 1 ) : τ C τ(v) r 1 (expr 1 ) : τ C τ D r 2 (expr 1 ) : τ C Set(τ D ) true, false : Bool notexpr 1 : Bool Bool expr 1 {and,or,implies}expr 2 : Bool Bool Bool... OclUndefined τ : τ expr 1 ->iterate(w 1 :T 1 ;w 2 :T 2 =expr 2 expr 3 ) : Set(τ 0 ) τ T2 context ::= contextw 1 :T 1,...,w n :T n inv :expr : Bool 15/24

17 More Iterate Examples S = ({Bool,Int},{VM,CP,DD}, {cp : CP,dd : DD 0,1,wen : Bool,wis : Nat}, {VM {cp,dd},cp {wen,dd},dd {wis}) expr ::= expr 1 ->iterate(w 1 :T 1 ;w 2 :T 2 =expr 2 expr 3 ) 16/24

18 OCL Syntax 4/4: Context Syntax: (Assuming signature S = (T, C,V,atr).) context ::= contextw 1 :T 1,...,w n :T n inv :expr wheret i C andw i : τ Ti W for all1 i n,n 0. Semantics: contextw 1 : C 1,...,w n : C n inv :expr is (just) an abbreviation for allinstances C1 ->forall(w 1 : τ C1... allinstances Cn ->forall(w n : τ Cn expr )... ) 17/24

19 Context: More Notational Conventions For context self : T inv :expr we may alternatively write ( abbreviate as ) context T inv :expr Within the latter abbreviation, we may omit the self in expressionexpr, i.e. for context T inv :self.v (which is an abbreviation for context T inv :v(self) ) we may alternatively write ( abbreviate as ) context T inv :v 18/24

20 The Running Example context CP inv : wen implies dd.wis > 0 19/24

21 Recall: Overview expr ::= w : τ(w) expr 1 = τ expr 2 : τ τ Bool oclisundefined τ (expr 1 ) : τ Bool {expr 1,...,expr n } : τ τ Set(τ) size(expr 1 ) : Set(τ) Int allinstances C : Set(τ C ) v(expr 1 ) : τ C τ(v) r 1 (expr 1 ) : τ C τ D r 2 (expr 1 ) : τ C Set(τ D ) true, false : Bool notexpr 1 : Bool Bool expr 1 {and,or,implies}expr 2 : Bool Bool Bool... OclUndefined τ : τ expr 1 ->iterate(w 1 :T 1 ;w 2 :T 2 =expr 2 expr 3 ) : Set(τ 0 ) τ T2 context ::= contextw 1 :T 1,...,w n :T n inv :expr : Bool 20/24

22 Not Interesting Among others: Enumeration types Type hierarchy Complete list of arithmetical operators The two other collection types Bag and Sequence Casting Runtime type information Pre/post conditions (maybe later, when we officially know what an operation is)... 22/24

23 References 23/ main

24 References OMG (2006). Object Constraint Language, version 2.0. Technical Report formal/ OMG (2011a). Unified modeling language: Infrastructure, version Technical Report formal/ OMG (2011b). Unified modeling language: Superstructure, version Technical Report formal/ Warmer, J. and Kleppe, A. (1999). The Object Constraint Language. Addison-Wesley main 24/24

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 03: Object Constraint Language (OCL) 2013-10-28 03 2013-10-28 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg,

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 03: Object Constraint Language (OCL) 2013-10-28 03 2013-10-28 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg,

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 03: Object Constraint Language (OCL) 2012-10-30 03 2012-10-30 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg,

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 03: Object Constraint Language (OCL) 2011-11-02 03 2011-11-02 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg,

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 07: A Type System for Visibility 2013-11-18 07 2013-11-18 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg,

More information

Lecture 02: Semantical Model

Lecture 02: Semantical Model Software Design, Modelling and Analysis in UML Lecture 02: Semantical Model 2014-10-23 02 2014-10-23 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Contents

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 02: Semantical Model 2013-10-23 02 2013-10-23 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Contents

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 05: Class Diagrams I 2012-11-07 05 2012-11-07 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Course

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 06: Class Diagrams I 2013-11-11 06 2013-11-11 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Course

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 07: Class Diagrams II 2009-11-12 07 2009-11-12 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Contents

More information

Lecture 07: Class Diagrams II

Lecture 07: Class Diagrams II Software Design, Modelling and Analysis in UML Lecture 07: lass Diagrams II 2014-11-13 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany ontents & Goals Last Lecture:

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 06: Class Diagrams I 2013-11-11 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Course Map UML W N E Model

More information

/50 5/50 2/50 3/50 6/50. UML-Notationsübersicht. Teil 1/4. Figure Examples of navigable ends. enda. endb main

/50 5/50 2/50 3/50 6/50. UML-Notationsübersicht. Teil 1/4. Figure Examples of navigable ends. enda. endb main a c e g i b d f h j * * Software Design, Modelling and Analysis in UML Lecture 07: Class Diagrams II 20--30 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany UML

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 08: Class Diagrams II 2013-11-20 08 2013-11-20 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Contents

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML ourse Map ontents & Goals UML W N E Last Lecture: OL Semantics Software Design, Modelling and Analysis in UML Lecture 05: lass Diagrams I 2011-11-15 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität

More information

Lecture 15: Hierarchical State Machines I

Lecture 15: Hierarchical State Machines I Software Design, Modelling and Analysis in UML Lecture 15: Hierarchical State Machines I 2015-01-08 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal 15 2015-01-08 main Albert-Ludwigs-Universität Freiburg,

More information

Lecture 10: State Machines Overview

Lecture 10: State Machines Overview Software Design, Modelling and Analysis in UML Lecture 10: State Machines Overview 2015-12-03 10 2015-12-03 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 20: Inheritance III 2012-02-14 20 2012-02-14 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Contents

More information

What is OCL? OCL/Context

What is OCL? OCL/Context What is? Software Engineering Lecture 5: Prof. Dr. Peter Thiemann Universität Freiburg SS 20 = object constraint language standard query language of UML 2 specify expressions and constraints in object-oriented

More information

Lecture 16: Hierarchical State Machines II

Lecture 16: Hierarchical State Machines II Software Design, Modelling and Analysis in UML Lecture 6: Hierarchical State Machines II 206-0-9 6 206-0-9 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany

More information

Unified Modeling Language 2

Unified Modeling Language 2 Unified Modeling Language 2 Profiles 166 Usage scenarios Metamodel customization for adapting terminology to a specific platform or domain adding (visual) notation adding and specializing semantics adding

More information

Index. business modeling syntax 181 business process modeling 57 business rule 40

Index. business modeling syntax 181 business process modeling 57 business rule 40 OCL.book Page 203 Tuesday, July 22, 2003 9:48 PM Index Symbols OclAny, of 167 = OclAny, of 167 @pre 34, 86, 155 ^ 34, 156 ^^ 157 A abstract syntax 93 accumulator 153 action in statechart 56 activity

More information

Formal Specification of Software Systems

Formal Specification of Software Systems Formal Specification of Software Systems Lecture Notes Winter Term 2001 / 2002 Heinrich Hußmann Technische Universität Dresden Formal Specification of Software Systems Summary: Construction of large software

More information

Lecture 8: Use Cases and Scenarios

Lecture 8: Use Cases and Scenarios Softwaretechnik / Software-Engineering Lecture 8: Use Cases and Scenarios 2016-06-02 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany 8 2016-06-02 main Topic

More information

Software Engineering

Software Engineering Software Engineering Lecture 15: OCL Peter Thiemann University of Freiburg, Germany 01.07.2013 Peter Thiemann (Univ. Freiburg) Software Engineering 01.07.2013 1 / 28 What is OCL? OCL = Object Constraint

More information

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis. SOFTWARE ENGINEERING UML FUNDAMENTALS Saulius Ragaišis saulius.ragaisis@mif.vu.lt Information source Slides are prepared on the basis of Bernd Oestereich, Developing Software with UML: Object- Oriented

More information

Directed Model Checking for PROMELA with Relaxation-Based Distance Functions

Directed Model Checking for PROMELA with Relaxation-Based Distance Functions Directed Model Checking for PROMELA with Relaxation-Based Distance Functions Ahmad Siyar Andisha and Martin Wehrle 2 and Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany {andishaa,westphal}@informatik.uni-freiburg.de

More information

CONSTRAINT SPECIFICATIONS USING PATTERNS IN OCL

CONSTRAINT SPECIFICATIONS USING PATTERNS IN OCL CONSTRAINT SPECIFICATIONS USING PATTERNS IN OCL Ali Hamie. University of Brighton, Brighton, UK a.a.hamie@brighton.ac.uk ABSTRACT Constraint patterns are very useful for specifying OCL constraints on UML

More information

Specification-based Testing of Embedded Systems H. Schlingloff, SEFM 2008

Specification-based Testing of Embedded Systems H. Schlingloff, SEFM 2008 SEFM School 2008 Specification-based Testing of Embedded Systems Prof. Dr. Holger Schlingloff Humboldt-Universität zu Berlin and Fraunhofer FIRST, Berlin Lecture 4: Mutations, OCL etc. Course Outline L1:

More information

Softwaretechnik Model Driven Architecture Meta Modeling

Softwaretechnik Model Driven Architecture Meta Modeling Softwaretechnik Model Driven Architecture Meta Modeling Prof. Dr. Peter Thiemann Universität Freiburg 22.06.2009 PT (Univ. Freiburg) Softwaretechnik Model Driven Architecture Meta Modeling 22.06.2009 1

More information

Formal Methods for Software Engineers

Formal Methods for Software Engineers Formal Methods for Software Engineers Professor Ray Welland Department of Computing Science University of Glasgow ray@dcs.gla.ac.uk INF3120-FM 1 Overview Motivation Why have formal specifications? Where

More information

The Object Contraint Language by Example

The Object Contraint Language by Example Formal Specification of Software The Object Contraint Language by Example Bernhard Beckert UNIVERSITÄT KOBLENZ-LANDAU B. Beckert: Formal Specification of Software p.1 The Classifier Context inv ( c :)?

More information

Variables. Substitution

Variables. Substitution Variables Elements of Programming Languages Lecture 4: Variables, binding and substitution James Cheney University of Edinburgh October 6, 2015 A variable is a symbol that can stand for another expression.

More information

Specification with OCL

Specification with OCL Specification with OCL Jurriaan Hage Slides adapted from Birgit Demuth, TU Dresden e-mail: jur@cs.uu.nl homepage: http://www.cs.uu.nl/people/jur/ Department of Information and Computing Sciences, Universiteit

More information

Specification-based Testing of Embedded Systems H. Schlingloff, SEFM 2008

Specification-based Testing of Embedded Systems H. Schlingloff, SEFM 2008 SEFM School 2008 Specification-based Testing of Embedded Systems Prof. Dr. Holger Schlingloff Humboldt-Universität zu Berlin and Fraunhofer FIRST, Berlin Lecture 5: OCL, ParTeG Course Outline L1: Introduction

More information

Formal Methods for Java

Formal Methods for Java Formal Methods for Java Lecture 6: Introduction to JML Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg May 15, 2017 Jochen Hoenicke (Software Engineering) Formal Methods for Java

More information

Outline. A little history. Outline. The Unified Modeling Language Opportunities and Challenges for Formal Methods

Outline. A little history. Outline. The Unified Modeling Language Opportunities and Challenges for Formal Methods Outline The Unified Modeling Language Opportunities and Challenges for Formal Methods An update on UML Language definition Tools A precise OO meta-modeling facility - MMF Stuart Kent University of Kent

More information

8/22/2003. Proposal for VPI model PSL assertion extensions

8/22/2003. Proposal for VPI model PSL assertion extensions 8/22/2003 Proposal for VPI model PSL assertion extensions Cadence Design Systems, Inc. 8/22/2003 This proposal has been prepared by Cadence Design Systems, Inc. for consideration by the IEEE 1364 working

More information

COSC 3351 Software Design. An Introduction to UML (I)

COSC 3351 Software Design. An Introduction to UML (I) COSC 3351 Software Design An Introduction to UML (I) This lecture contains material from: http://wps.prenhall.com/esm_pfleeger_softengtp_2 http://sunset.usc.edu/classes/cs577a_2000/lectures/05/ec-05.ppt

More information

The Calculator CS571. Abstract syntax of correct button push sequences. The Button Layout. Notes 16 Denotational Semantics of a Simple Calculator

The Calculator CS571. Abstract syntax of correct button push sequences. The Button Layout. Notes 16 Denotational Semantics of a Simple Calculator CS571 Notes 16 Denotational Semantics of a Simple Calculator The Calculator Two functions: + and * Unbounded natural numbers (no negatives Conditional: if-then-else Parentheses One memory register 1of

More information

Principles of Software Construction: Objects, Design and Concurrency. Just enough UML. toad

Principles of Software Construction: Objects, Design and Concurrency. Just enough UML. toad Principles of Software Construction: Objects, Design and Concurrency Just enough UML 15-214 toad Christian Kästner Charlie Garrod School of Computer Science With slides from Klaus Ostermann Learning Goals

More information

Semantic Analysis Type Checking

Semantic Analysis Type Checking Semantic Analysis Type Checking Maryam Siahbani CMPT 379 * Slides are modified version of Schwarz s compiler course at Stanford 4/8/2016 1 Type Checking Type errors arise when operations are performed

More information

Softwaretechnik. Lecture 19: Model Driven Engineering. Peter Thiemann. University of Freiburg, Germany

Softwaretechnik. Lecture 19: Model Driven Engineering. Peter Thiemann. University of Freiburg, Germany Softwaretechnik Lecture 19: Model Driven Engineering Peter Thiemann University of Freiburg, Germany 23.07.2012 Peter Thiemann (Univ. Freiburg) Softwaretechnik 23.07.2012 1 / 50 Introduction MDA Introduction

More information

Lecture #2 on Object-Oriented Modeling

Lecture #2 on Object-Oriented Modeling Outline Lecture #2 on Object-Oriented Modeling Thierry Géraud EPITA Research and Development Laboratory (LRDE) 2006 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 1 / 38 Outline

More information

Towards Transformation of Integrity Constraints and Database States

Towards Transformation of Integrity Constraints and Database States Towards Transformation of Integrity Constraints and Database States Fabian Büttner, Hanna Bauerdick, Martin Gogolla Database Group, Computer Science Department University of Bremen, D-28334 Bremen, Germany

More information

From OCL to Typed First-order Logic

From OCL to Typed First-order Logic 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 From OCL to Typed First-order Logic Copyright 2007-8 Reiner Hähnle and Cesare Tinelli. Notes originally developed by Reiner

More information

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Course Softwaretechnik Book Chapter 2 Modeling with UML Course "Softwaretechnik" Book Chapter 2 Modeling with UML Lutz Prechelt, Bernd Bruegge, Allen H. Dutoit Freie Universität Berlin, Institut für Informatik http://www.inf.fu-berlin.de/inst/ag-se/ Modeling,

More information

Architectural Models and Styles Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 12 The Object Constraint Language (Part A)

Architectural Models and Styles Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 12 The Object Constraint Language (Part A) Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 12 The Object Constraint Language (Part A) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo

More information

Object-Oriented Theories for Model Driven Architecture

Object-Oriented Theories for Model Driven Architecture Object-Oriented Theories for Model Driven Architecture Tony Clark 1, Andy Evans 2, Robert France 3 1 King s College London, UK, anclark@dcs.kcl.ac.uk, 2 University of York, UK, andye@cs.york.ac.uk, 3 University

More information

Hans Karlsen. MDriven The book. Doing effective Business by taking control of Information. Hans Karlsen, Stockholm, Sweden

Hans Karlsen. MDriven The book. Doing effective Business by taking control of Information. Hans Karlsen, Stockholm, Sweden Hans Karlsen MDriven The book Doing effective Business by taking control of Information Hans Karlsen, Stockholm, Sweden 2016-01-23 Part 8 Object Constraint Language 1 What is Object Constraint Language

More information

Rubby Casallas Grupo de Construcción de Software Uniandes

Rubby Casallas Grupo de Construcción de Software Uniandes UML OCL 2.0 Rubby Casallas Grupo de Construcción de Software Uniandes Why OCL? A UML diagram, such as a class diagram, is typically not refined enough to provide all the relevant aspects of a specification.

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java

Object-Oriented Software Engineering Practical Software Development using UML and Java Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes Lecture 5 5.1 What is UML? The Unified Modelling Language is a standard graphical

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Fall 2016 Lecture 7a Andrew Tolmach Portland State University 1994-2016 Values and Types We divide the universe of values according to types A type is a set of values and a

More information

Dependant Type Systems (saying what you are) Data Abstraction (hiding what you are) Review. Dependent Types. Dependent Type Notation

Dependant Type Systems (saying what you are) Data Abstraction (hiding what you are) Review. Dependent Types. Dependent Type Notation Dependant Type Systems (saying what you are) Data Abstraction (hiding what you are) #1 Recount We re now reaching the point where you have all of the tools and background to understand advanced topics.

More information

Chapter 12. UML and Patterns. Copyright 2008 Pearson Addison-Wesley. All rights reserved

Chapter 12. UML and Patterns. Copyright 2008 Pearson Addison-Wesley. All rights reserved Chapter 12 UML and Patterns Copyright 2008 Pearson Addison-Wesley. All rights reserved Introduction to UML and Patterns UML and patterns are two software design tools that can be used within the context

More information

Software Design, Modelling and Analysis in UML

Software Design, Modelling and Analysis in UML Software Design, Modelling and Analysis in UML Lecture 1: Introduction 2011-10-25 1 2011-10-25 main Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany Contents

More information

These notes are intended exclusively for the personal usage of the students of CS352 at Cal Poly Pomona. Any other usage is prohibited without

These notes are intended exclusively for the personal usage of the students of CS352 at Cal Poly Pomona. Any other usage is prohibited without These notes are intended exclusively for the personal usage of the students of CS352 at Cal Poly Pomona. Any other usage is prohibited without previous written authorization. 1 2 The simplest way to create

More information

Object Oriented Program Correctness with OOSimL

Object Oriented Program Correctness with OOSimL Kennesaw State University DigitalCommons@Kennesaw State University Faculty Publications 12-2009 Object Oriented Program Correctness with OOSimL José M. Garrido Kennesaw State University, jgarrido@kennesaw.edu

More information

Programming Languages

Programming Languages CSE 230: Winter 2008 Principles of Programming Languages Ocaml/HW #3 Q-A Session Push deadline = Mar 10 Session Mon 3pm? Lecture 15: Type Systems Ranjit Jhala UC San Diego Why Typed Languages? Development

More information

Ruby: Introduction, Basics

Ruby: Introduction, Basics Ruby: Introduction, Basics Computer Science and Engineering College of Engineering The Ohio State University Lecture 4 Ruby vs Java: Similarities Imperative and object-oriented Classes and instances (ie

More information

Syntax-Directed Translation. Lecture 14

Syntax-Directed Translation. Lecture 14 Syntax-Directed Translation Lecture 14 (adapted from slides by R. Bodik) 9/27/2006 Prof. Hilfinger, Lecture 14 1 Motivation: parser as a translator syntax-directed translation stream of tokens parser ASTs,

More information

02291: System Integration

02291: System Integration 02291: System Integration Week 8 Hubert Baumeister huba@dtu.dk DTU Compute Technical University of Denmark Spring 2018 Last Week Components: Synchronized communication Sequence Diagrams Use Case Realization

More information

Ruby: Introduction, Basics

Ruby: Introduction, Basics Ruby: Introduction, Basics Computer Science and Engineering College of Engineering The Ohio State University Lecture 3 Ruby vs Java: Similarities Imperative and object-oriented Classes and instances (ie

More information

Appendix A OCL 2.0 Grammar

Appendix A OCL 2.0 Grammar Appendix A OCL 2.0 Grammar In this appendix we summarise the concrete syntax of OCL [113] using an extended Backus-Naur format [8]. The grammar in [113] is different from the grammar presented here. It

More information

Component-Based Software Engineering

Component-Based Software Engineering Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 14 The Object Constraint Language (Part C) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo

More information

Formal Methods for Java

Formal Methods for Java Formal Methods for Java Lecture 3: Operational Semantics (Part 2) Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg May 3, 2017 Jochen Hoenicke (Software Engineering) Formal Methods

More information

The Object Constraint Language (OCL)

The Object Constraint Language (OCL) The Object Constraint Language (OCL) Robert B. France Dept. of Computer Science Colorado State University USA france@cs.colostate.edu Semantics and UML models UML models often treated as informal descriptions

More information

Softwaretechnik. Program verification. Albert-Ludwigs-Universität Freiburg. June 28, Softwaretechnik June 28, / 24

Softwaretechnik. Program verification. Albert-Ludwigs-Universität Freiburg. June 28, Softwaretechnik June 28, / 24 Softwaretechnik Program verification Albert-Ludwigs-Universität Freiburg June 28, 2012 Softwaretechnik June 28, 2012 1 / 24 Road Map Program verification Automatic program verification Programs with loops

More information

1 Lexical Considerations

1 Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

More information

Supporting Modeling in the Large in Fujaba

Supporting Modeling in the Large in Fujaba Supporting Modeling in the Large in Thomas Buchmann Angewandte Informatik 1 Universität Bayreuth D-95440 Bayreuth thomas.buchmann@unibayreuth.de Alexander Dotor Angewandte Informatik 1 Universität Bayreuth

More information

Object Constraint https://www.lri.fr/~linaye/gl.html lina.ye@centralesupelec.fr Sequence 3, 2017-2018 1/45 Plan 1 2 3 4 2/45 Motivation Why OCL Cannot represent all the relevant aspects of a specification

More information

Exercise Sheet 5. Exercise 1 (Object and Class Diagrams)

Exercise Sheet 5. Exercise 1 (Object and Class Diagrams) Prof. Dr. A. Podelski, Dr. B. Westphal Sommersemester 2015 S. Feo Arenis Softwaretechnik/Software Engineering http://swt.informatik.uni-freiburg.de/teaching/ss2015/swtvl Exercise Sheet 5 Early submission:

More information

Compositional Model Based Software Development

Compositional Model Based Software Development Compositional Model Based Software Development Prof. Dr. Bernhard Rumpe http://www.se-rwth.de/ Seite 2 Our Working Groups and Topics Automotive / Robotics Autonomous driving Functional architecture Variability

More information

JML OCL. Java. iterate

JML OCL. Java. iterate 1 OCL JML OCL (Object Constraint Language) JML (Java Modelling Language) UML/OCL JML Java OCL JML iterate iterate Java OCL JML The paper presents a translation method from OCL (Object Constraint Language)

More information

Dependent Types. Announcements. Project Presentations. Recap. Dependent Types. Dependent Type Notation

Dependent Types. Announcements. Project Presentations. Recap. Dependent Types. Dependent Type Notation Dependant Type Systems (saying what you are) a (hiding what you are) Meeting 25, CSCI 5535, Spring 2009 Announcements Project Presentations Let me know if you prefer Apr 27 or Apr 29 Small amount of extra

More information

Model Driven Architecture Action Semantics and Action Languages

Model Driven Architecture Action Semantics and Action Languages Model Driven Architecture Action Semantics and Action Languages Prof. Dr. Peter Thiemann Universität Freiburg 28.06.2006 Action Semantics What is it? OMG sanctioned approach to define the low-level behavior

More information

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools UML Modeling I Instructor: Yongjie Zheng September 3, 2015 CS 490MT/5555 Software Methods and Tools Object-Oriented Design: Topics & Skills Rational Unified Process Unified Modeling Languages (UML) Provide

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 9: Generalization/Specialization 1 Analysis Workflow: Analyze a Use Case The analysis workflow consists of the following activities: Architectural

More information

Semantics of programming languages

Semantics of programming languages Semantics of programming languages Informatics 2A: Lecture 27 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 21 November, 2011 1 / 19 1 2 3 4 2 / 19 Semantics for programming

More information

Basic Structure of Denotational Definitions

Basic Structure of Denotational Definitions asic Structure of Denotational Definitions This chapter presents the format for denotational definitions. We use the abstract syntax and semantic algebra formats to define the appearance and the meaning

More information

Calculating Correct Compilers

Calculating Correct Compilers university of copenhagen department of computer science Faculty of Science Calculating Correct Compilers Patrick Bahr1 Graham Hutton2 1 University of Copenhagen, Department of Computer Science paba@diku.dk

More information

Lecture 8: Context Free Grammars

Lecture 8: Context Free Grammars Lecture 8: Context Free s Dr Kieran T. Herley Department of Computer Science University College Cork 2017-2018 KH (12/10/17) Lecture 8: Context Free s 2017-2018 1 / 1 Specifying Non-Regular Languages Recall

More information

Programming for Engineers Iteration

Programming for Engineers Iteration Programming for Engineers Iteration ICEN 200 Spring 2018 Prof. Dola Saha 1 Data type conversions Grade average example,-./0 class average = 23450-67 893/0298 Grade and number of students can be integers

More information

Model Driven Development Unified Modeling Language (UML)

Model Driven Development Unified Modeling Language (UML) Model Driven Development Unified Modeling Language (UML) An Overview UML UML is a modeling notation standardized by OMG (proposal 1997, ver.1.1 in 1998, ver. 2.0 in 2004) now in 2.4.1 mature based on notations

More information

Chapter 8, Object Design: Object Constraint Language

Chapter 8, Object Design: Object Constraint Language Object-Oriented Software Engineering Using UML, Patterns, and Java Chapter 8, Object Design: Object Constraint Language Outline of the Lecture OCL Simple predicates Preconditions Postconditions Contracts

More information

UNIT-II Introduction to UML

UNIT-II Introduction to UML UNIT-II Introduction to UML - P. P. Mahale UML OVERVIEW OF UML :- We need a Modeling Language! We will use the Unified Modeling Language, UML), Provides a standard for artifacts produced during development

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 04 Programs with IO and Loop We will now discuss the module 2,

More information

Modelling with OCL. Context of OCL Expressions. The Object Constraint Language (OCL) Component-Based Software Engineering. ECE493-Topic 4 Winter 2006

Modelling with OCL. Context of OCL Expressions. The Object Constraint Language (OCL) Component-Based Software Engineering. ECE493-Topic 4 Winter 2006 Component-Based Software Engineering ECE493-Topic 4 Winter 2006 Lecture 10 The Object Constraint Language (Part B) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo

More information

Electronic Communications of the EASST Volume 5 (2006)

Electronic Communications of the EASST Volume 5 (2006) Electronic Communications of the EASST Volume 5 (2006) Proceedings of the Sixth OCL Workshop OCL for (Meta-)Models in Multiple Application Domains (OCLApps 2006) Improving the OCL Semantics Definition

More information

Boolean expressions. Elements of Programming Languages. Conditionals. What use is this?

Boolean expressions. Elements of Programming Languages. Conditionals. What use is this? Boolean expressions Elements of Programming Languages Lecture 3: Booleans, conditionals, and types James Cheney So far we ve considered only a trivial arithmetic language L Arith Let s extend L Arith with

More information

Product line annotations with UML-F

Product line annotations with UML-F Product line annotations with UML-F Wolfgang Pree 1), Marcus Fontoura 2), Bernhard Rumpe 3) 1) Department of Computer Sciences, University of California, Berkeley 2) IBM Almaden Research Center, San Jose,

More information

Interpreters. Prof. Clarkson Fall Today s music: Step by Step by New Kids on the Block

Interpreters. Prof. Clarkson Fall Today s music: Step by Step by New Kids on the Block Interpreters Prof. Clarkson Fall 2017 Today s music: Step by Step by New Kids on the Block Review Previously in 3110: functional programming modular programming data structures Today: new unit of course:

More information

Lecture 08: Scenarios and Use Cases

Lecture 08: Scenarios and Use Cases Introduction evelopment Process, Metrics Requirements ngineering rchitecture & esign onstructive Models Testing, Formal Verification Invited Talks Wrap-Up L 1: 20.4., Mo T 1: 23.4., o L 2: 27.4., Mo L

More information

CIS 771: Software Specifications

CIS 771: Software Specifications CIS 771: Software Specifications Lecture 11: Introduction to OCL & USE Copyright 2001-2002, Matt Dwyer, John Hatcliff, and Rod Howell. The syllabus and all lectures for this course are copyrighted materials

More information

Composite Structures

Composite Structures Composite Structures Marie-Agnès Peraldi-Frati UNSA/I3S/INRIA map@unice.fr UML 2 Composition Model Purpose: improve the black diamond composition Supports connections between parts at the same level of

More information

Parsing. Zhenjiang Hu. May 31, June 7, June 14, All Right Reserved. National Institute of Informatics

Parsing. Zhenjiang Hu. May 31, June 7, June 14, All Right Reserved. National Institute of Informatics National Institute of Informatics May 31, June 7, June 14, 2010 All Right Reserved. Outline I 1 Parser Type 2 Monad Parser Monad 3 Derived Primitives 4 5 6 Outline Parser Type 1 Parser Type 2 3 4 5 6 What

More information

Software Architecture

Software Architecture Software Architecture Benjamin Satzger Distributed Systems Group TU Wien http://www.infosys.tuwien.ac.at/staff/ bsatzger Models Terms Unified Modeling Language (UML) Architecture Description Language (ADL)

More information

Introduction to Programming Using Python Lecture 4. Dr. Zhang COSC 1437 Fall, 2018 October 11, 2018

Introduction to Programming Using Python Lecture 4. Dr. Zhang COSC 1437 Fall, 2018 October 11, 2018 Introduction to Programming Using Python Lecture 4 Dr. Zhang COSC 1437 Fall, 2018 October 11, 2018 Chapter 7 Object-Oriented Programming Object-oriented programming (OOP) involves programming using objects.

More information

course: Database Systems (NDBI025) SS2017/18

course: Database Systems (NDBI025) SS2017/18 course: Database Systems (NDBI025) SS2017/18 doc. RNDr. Tomáš Skopal, Ph.D. Mgr. Martin Nečaský, Ph.D. RNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics,

More information

The Substitution Model

The Substitution Model The Substitution Model Prof. Clarkson Fall 2017 Today s music: Substitute by The Who Review Previously in 3110: simple interpreter for expression language abstract syntax tree (AST) evaluation based on

More information