24.6.2008 Formal Methods of Systems Specification Logical Specification of Hard- and Software Dr. Armin Wolf Fraunhofer Institut für Rechnerarchitektur.

Slides:



Advertisements
Similar presentations
1 Mireille Blay-Fornarino – 2007/2008 EPU département SI, Master STIC Survol de Object Constraint Language & IDM À partir du cours Contracts, Patterns.
Advertisements

Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
Modelling Features as Statecharts Pourya Shaker and Joanne M. Atlee.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 5.
Lecture 7 Constraints and Invariants Formal Modeling and Analyzing a Flash File System.
The role of OCL in the Model Driven Architecture Jos Warmer Klasse Objecten
LECTURE 11: Specifying Systems – State Diag’s & OCL
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
By Karen Richart. The Object Constraint Language (OCL)  Formal specification language that could be used for constraining the model elements that occur.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
1 The Object Constraint Language: Expressing Constraints in the UML (Most slides created by Robert B. France, Professor Department of Computer Science,
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
OCL2 April A presentation of OCL 2 Object Constraint Language Christian Hein, Fraunhofer FOKUS April 2006.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 9, Object Design: Object Constraint Language.
Object Design: Specifying Interfaces Chapter 9. 2 Object Design  Object design is the process of adding details to the requirements analysis and making.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Specifying Agent Interaction Protocols with AUML and OCL COSC 6341 Project Presentation Alexei Lapouchnian November 29, 2000.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
1 Specifying Object Interfaces. 2 Major tasks in this stage: --are there any missing attributes or operations? --how can we reduce coupling, make interface.
Detail Design Extending UML and Object Design. Object Design.
Axiomatic Semantics Dr. M Al-Mulhem ICS
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
Describing Syntax and Semantics
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
SEG4110 – Advanced Software Engineering and Reengineering TOPIC E Object Constraint Language (OCL)
1 The Object Constraint Language Jos Warmer and Anneke Kleppe. OCL: The Constraint Language of the UML, Journal of Object-Oriented Programming, 2(2):10-13,
A presentation of OCL 2 Object Constraint Language Fraunhofer FOKUS.
1 COSC 4406 Software Engineering COSC 4406 Software Engineering Haibin Zhu, Ph.D. Dept. of Computer Science and mathematics, Nipissing University, 100.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
111 Writing Protocols in OCL CS 4311 Jos B. Warmer and Anneke G. Kleppe, OCL: The Constraint Language of the UML, JOOP, May Jos B. Warmer and Anneke.
An introduction to specification in VDM-SL At the end of this lecture you should be able to: write a formal specification of a system in VDM-SL; correlate.
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
UML Model architecture Object Constraint Language Lectures P9-P11 T120B pavasario sem.
CS551 - Lecture 8 1 CS551 Modelling with Objects (Chap. 3 of UML) Yugi Lee STB #555 (816)
1 OCL The Role of OCL in UML. 2 רשימת הנושאים  מבוא  מרכיבי השפה  דוגמאות  מקורות.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
IM NTU Software Development Methods, Fall2006 Software Development Methods, Fall 2006 OCL 2006/12/ Object Constraint Language (OCL) Yih-Kuen Tsay.
Institute for Software Integrated Systems Vanderbilt University Object Constraint Language Himanshu Neema Krishnakumar Balasubramanian Jeff Parsons November.
Object Constraint Language
1 Kyung Hee University Constraints Spring Kyung Hee University Graphical Notations  Graphical notations are well suited for displaying structural.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
© 2004 Benet Devereux Lecture #4 OCL and SCR/Parnas Tables.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Interpreting the Object Constraint Presented by: Ed Kausmeyer.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
An association between class Flight and class Person, indicating that a certain group of persons are the passengers on a flight, will have multiplicity.
Jan Pettersen Nytun, UIA, page 1. Jan Pettersen Nytun, UIA, page 2 HISTORY COLLECTION TYPES AND QUERING IN OCL FORMAL LANGUAGE - STATEMENT EXAMPLES CONSTRAINTS.
Presentation of a paper on “Model-based Software Testing”
The Object Constraint Language
Extending UML.
Modeling the OCL Standard Library
The Object Constraint Language
Chapter 9, Object Design: Object Constraint Language
Chapter 5 Structures.
UML Class Diagrams: Basic Concepts
Software Verification 2 Automated Verification
LECTURE 11: Specifying Systems – State Diag’s & OCL
A Specification Language
LabVIEW.
The Object Constraint Language
Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract, Computer,
Object Constraint Language (OCL)
Formal Methods in Software Engineering 1
Presentation transcript:

Formal Methods of Systems Specification Logical Specification of Hard- and Software Dr. Armin Wolf Fraunhofer Institut für Rechnerarchitektur und Softwaretechnik Prof. Dr. Holger Schlingloff

Slide 2 H. Schlingloff, Logical Specification OCL Object constraint language (important) Part of UML Specifies constraints on model elements A constraint is a restriction on one or more values of (part of) an object-oriented model or system Different kinds of constraints invariant - a constraint that must always be met by all instances of a class precondition of an operation - a constraint that must always be true before the execution of the operation postcondition of an operation - a constraint that must always be true after the execution of the operation guard of a transition – a constraint that must be met before a state transition fires

Slide 3 H. Schlingloff, Logical Specification Semantics of UML 2 13 diagram types Common meta-model Instances (objects) can occur in several diagrams, different views onto the same thing A structure diagram, e.g. a class, defines a collection of objects with similar properties, attributes and methods signature and structure A behavioural diagram, e.g. a statechart, defines a collection of behaviours of objects change of model in time

Slide 4 H. Schlingloff, Logical Specification Connection UML-OCL Each OCL formula can mention objects defined in UML diagrams OCL semantics relative to a certain UML model Expressions in OCL add information to UML diagrams not a stand-alone specification language OCL for constraints which cannot be expressed by diagrams - e.g. number of passengers in a flight is less or equal to the number of seats in the plane - fixed interpretation (includes arithmetics)

Slide 5 H. Schlingloff, Logical Specification Standardisation early 1990s: Steve Cook and John Daniels, Syntropy design method adaptation of Z to OOA 1996: OMG request for proposal; IBM and ObjectTime Ltd. submit joint proposal 1997: OCL : OCL 2.0

Slide 6 H. Schlingloff, Logical Specification A Simple Example (from Wikipedia) Informelle Beschreibung 1. Das Alter einer Person ist nicht negativ. 2. Eine Person ist jünger als ihre Eltern. 3. Nach einem Geburtstag ist eine Person um genau 1 Jahr älter. 4. Eine Person hat genau 2 Eltern. 5. Wenn jemand ein Kind bekommen hat, ist die Menge seiner Kinder nicht leer und die Anzahl seiner Kinder ist größer als vorher. 6. Nur eine erwachsene Person darf ein Auto besitzen. 7. Die Erstzulassung eines Autos liegt nicht vor dem Baujahr. OCL-Constraint Context Person inv: self.alter >=0 Context Person inv: self.Eltern- >forall(e|e.Alter>self.Alter) Context Person::hatGeburtstag() post: Context Person inv: self.Eltern->size()=2 Context Person::bekommtKind() post: self.Kinder->notEmpty() and self.Kinder- >size() > Context Person inv: Alter size()=0 Context Auto inv: Erstzulassung>=Baujahr

Slide 7 H. Schlingloff, Logical Specification OCL Types Basic type void: void::oclIsUndefined Boolean, Integer, Real, String, … Enumerations: enum{val1, val2, val3} Set, Bag, Sequence union(Bag{2,2,3}, Bag{3,3}) Class types: each class name can be used as a type most general class/type: OclAny Strong typing rules, subtyping according to OO Integer is subtype of Real Each type conforms to each of ist supertypes

Slide 8 H. Schlingloff, Logical Specification OCL Contexts The context attaches a constraint to a particular modelling element context :: ( ) pre: Dot-notation allows access to other (visible) modelling elements or objects Meeting.start, Passagier.name self always refers to the object identifier from which the constraint is evaluated context Meeting inv: self.end > self.start Access to collections via -> Passagier.buchung->size()

Slide 9 H. Schlingloff, Logical Specification OCL Operators Boolean operators: =, and, or, xor, not, implies, if- then-else, forall sequential evaluation, i.e. (true or undefined) = true x implies y = (not x) or (x and refers to the previous value of an object in a postcondition select-operator collection->select(condition) is any element of the collection satisfying the condition e.g. Passagier.buchung->select(datum=TODAY)

Slide 10 H. Schlingloff, Logical Specification Pre- and Postconditions Used to constrain methods context Meeting :: confirm() pre: Calendar.freeTimeSlot (self.start, self.duration()) post: self.isConfirmed = true context Meeting :: duration(): Integer post: result = self.end – self.start context Meeting :: shift(d: Integer) post: start = + d and end = + d

Slide 11 H. Schlingloff, Logical Specification Iterations c->iterate(x:T1; a:T2 = exp0 | exp ) c is of type Collection(T) x is a name for a variable (sometimes called the cursor) x is of a type T1 which is conformant to T a is the name for a variable (sometimes called the accumulator) a is of type T2 exp0 is an OCL expression giving a value of type T2 exp is an OCL expression using the variables x and a and giving a value of type T2 The type of the whole iterate expression is of type T2

Slide 12 H. Schlingloff, Logical Specification Predefined iterations c:Collection(T)->size: Integer post: result = c->iterate(e:OclAny; a:Integer = 0 | a+1) c:Collection(T)->isEmpty: Boolean post: result = c->size = 0 c:Collection(T)->forAll(expr: OclExpression): Boolean post: result = c->iterate(e:OclAny; a: Boolean = true | a and expr) c:Collection(T)->exists(expr: OclExpression): Boolean post: result = c->iterate(e:OclAny; a: Boolean = false | a or expr)