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

Size: px
Start display at page:

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

Transcription

1 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 Architectural Models and Styles Architectural models are achieved in UML2 by: Component-and-connector diagrams, to define component relationships Interface descriptions, consisting of: method signatures (method names, input and output types) a semantics that tells us how methods work Architectural styles are defined in UML2 through: Explaining the kinds of components that are used in a style A semantics explaining how components and connections should behave Constraints telling us how the components are to be assembled 2 Informal Semantics and Constraints The semantics of architectures and architectural styles has been given informally (in English) Similarly, the constraints on component assembly for styles has also been given in English UML2 includes a range of languages for specifying aspects of semantics precisely: State-Charts Activity Graphs Swimlane Notation Object Constraint Language (OCL) Formal Semantics Advantages Informal English specifications can be ambiguous formal specifications leave less to interpretation The use of a standards such as UML means that formal specifications should eventually become commonly understood by any decent software development team Disadvantages English descriptions are easy to write and can be understood by any member of a development team who understands English English descriptions less cost for the software development process (it takes more time to define and comprehend formal semantics, and requires suitably qualified (more expensive) team members 3 4

2 The Object Constraint Language (OCL) OCL is used for adding important information to UML models A business modelling language used within the Syntropy (Booch method) in IBM until it was added to UML in 1997 OCL is used To add constraints, restrictions on values that formed part of an object-oriented model To state conditions on execution of a system To define business rules To define queries on the model so questions about a model can be answered automatically by executing an OCL query OCL2.0 is a new improved version. Building Better Models OCL is based on maths and first-order logic but is written like a programming language OCL expresses information that cannot be expressed well using other diagrams of UML Example1: Consider the UML class diagram below The association between class Flight and class Person indicates that a certain group of persons are passengers on a flight -- the association is (0..*) on the side of the Person class The diagram says that the number of passengers is unlimited In reality, the number of passengers will be restricted to the number of seats on the airplane that is associated with the flight OCL can be use to specify such a constraint OCL CONSTRAINT: Inequalities for defining constraints OO dot notation for navigating around a model Context Flight Inv: passengers->size() <= plane.numberofseats 5 6 Example 2 Any human reader of the model will undoubtedly assume that a number of rules must apply to this model. A person may have a mortgage on a house only if that house is owned by himor herself; one cannot obtain a mortgage on the house of one's neighbor or friend. The start date for any mortgage must be before the end date. The social security number of all persons must be unique. A new mortgage will be allowed only when the person's income is sufficient. Expression Syntax OCL Types Custom Defined by UML diagrams Predefined Integer, Real, String and Boolean Collection Sets, ordered sets, and sequences Similar operations on sets as those on collections in Java (that is, we can define iterator expressions like foreach) OCL expressions are logical expressions about elements of OCL types Boolean propositions (true or false values) 7 8

3 Boolean s Boolean Inequalities Implies or Notation (where a and b are Booleans) a implies b a or b Equals Not equals Notation (where a and b are strings, integers or reals) a = b a <> b and a and b Less than, less than or equal to a < b, a <= b exclusive or negation a xor b not a Greater than, greater than or equal to a > b, a >= b Example: Specifying part of a bank machine incorrect-password implies no-access and correct-password implies db-access 9 equals not equals a = b a <> b 10 Integers and Reals Strings Standard operations (-,+,-,*,/) Modulus a->mod(b) Absolute value a->abs() Maximum of a and b: a->max(b) Minimum of a and b: a->min(b) Examples: 12.max(33) = 33 is a true OCL expression 13.mod(2) = 1 is a true OCL expression Concatenation of a and b: a->concat(b) Size of a: a->size() a in lower case: a->tolower() b in upper case: b->toupper() Substring of a between i and j: a.substring(i,j) Examples: KCL.size() = 6 is a false OCL expression Computer.concat( Science ) = Computer Science is a true OCL expression 11 12

4 Set Collection Type s on Sets Needed to talk about groups of things in a model Syntax for declaring a set: Set { elt1, elt2, elt3, } Syntax for declaring a type set: Set(Type) Examples: Set { apple, orange, strawberry } is an element of type Set(String) Set {1, 2, 5, 88} is of type Set(Integer) Set {HotelRes, LoyaltyProgram, CreditCardBilling} is of type Set(Component) 13 s->size() s->intersection(t) s->union(t) s->count(o) s->includes(o) s->excludes(o) s->includesall(u) s->excludesall(u) s->isempty() s->notempty() Description Returns the number of elements in set s Returns the intersection of sets s and t Computers the union of s and t Number of times element o occurs in s True if o is an element of s True if o is not an element of s True if all elements of set u are in s True if all elements of set u are not in s True if s doesn t contain any elements True if s contains at least one element Examples - The followings are true OCL expressions about sets: Set{3,8,2,1}->size() = 4 Set{HotelRes,LoyaltyProgram}->excludes(CreditCardBill) Set{HotelRes,LoyaltyProgram}->union(Set{CreditCardBill}) = Set{HotelRes,LoyaltyProgram,CreditCardBill} 14 Iterators Some Important Iterators Over Sets Iterators are a powerful kind of OCL operation over collections used to perform operations repeatedly over each element of a collection of the form set->iterator(body) or set->iterator(variable body) each operation has an OCL expression as its parameter, called the body of the operation each operation also has an optional parameter, called an iterator variable used within the body s->any(expr) s->collect(expr) s->exists(expr) s->forall(expr) s->select(expr) s->reject(expr) Description expr is of the form variable body Returns a random element of set s for which expr is true Returns the set of objects that result from evaluating expr for each element in the source collection Returns true if there is at least one element in the source collection for which expr is true Returns true if expr is true for all elements in the source collection Returns a subset of s containing all elements for which expr is true Returns a subset of s containing all elements for which expr is false Iterators are not new an important programming concept that is borrowed by OCL Example - The followings are true OCL expressions: Set{4,24,2000,2005}->select(x:Integer x=>2000) = Set{2000,2005} Set{4,24,2000,2002}->forAll(x:Integer x.mod(2) = 0) Set{4,24,2000,2005}->exists(x.Integer x.mod(2) = 1) 15 16

5 Select Iterator Used when we are interested only in a special subset of a set The select operation allows us to specify a selection from the original set Example: Assume App.components consists of all components in an application architecture, and that s->isconnected(client) returns true if the component s is connected to the component client, then App.components->select (Client:Component IsConnected(C,Client)) Returns the subset of all components connected to Client forall operator The forall operation is used to specify that a certain condition must hold for all elements of a collection Example: if CarInsurance.customers is a list of customers of a car insurance company and c.age is the age of a customer c, then CarInsurance.customers-> forall(c:customer c.age <= 70) Specifies that all customers should be aged 70 or less Modelling with OCL Used for queries and constraints over UML2 models OCL syntax covers the following aspects of models: Initial values Contracts Constraints If you read the reference (the Warmer and Kleppe book from ), these aspects are detailed for class diagrams, not component diagrams; however the approach is similar To understand how OCL can be used to provide a formal semantics of components Context of OCL Expressions An OCL expression annotates a particular model entity (class, interface, datatype, component or entire application) this is called the context of the expression Annotation takes the following form: Context ModelEntity [init:/pre:/post: inv:] OCL expression about ModelEntity The context acts as a namespace for the OCL expressions The OCL expression can refer to aspects of the context: the attributes and methods of the class the provided interfaces of the component the required interfaces of the component 19 20

6 Types of Constraints An invariant is a constraint that states a condition that must always be met by all instances of the component, type, or interface. An invariant is described using an expression that evaluates to true if the invariant is met. Invariants must be true all the time. A precondition to an operation is a restriction that must be true at the moment that the operation is going to be executed. The obligations are specified by postconditions. A postcondition to an operation is a restriction that must be true at the moment that the operation has just ended its execution. Example 2 Any human reader of the model will undoubtedly assume that a number of rules must apply to this model. A person may have a mortgage on a house only if that house is owned by himor herself; one cannot obtain a mortgage on the house of one's neighbor or friend. The start date for any mortgage must be before the end date. The social security number of all persons must be unique. A new mortgage will be allowed only when the person's income is sufficient Example 2 Augmenting Model with OCL Expressions context Mortgage inv: security.owner = borrower context Mortgage inv: startdate < enddate context Person inv: Person::allInstances()- >isunique(socsecnr) context Person::getMortgage(sum : Money, security : House) pre: self.mortgages.monthlypayment- >sum() <= self.salary * 0.30 context Person::getMortgage(sum : Money, security : House) pre: security.value >= security.mortgages.principal->sum() 23

ECE750-Topic11: Component-Based Software Systems

ECE750-Topic11: Component-Based Software Systems ECE750-Topic11: Component-Based Software Systems Architectural Styles in CBSE Ladan Tahvildari, PEng Associate Professor Software Technologies Applied Research (STAR) Group Dept. of Elect. & Comp. Eng.

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

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

Formal Methods in Software Engineering 1

Formal Methods in Software Engineering 1 Today s Agenda Quiz 1 on next Tue. Quick Review Finish Program Proof Introduction to OCL Formal Methods in Software Engineering 1 Quick Review What is the difference between first-order logic and propositional

More information

Formal Methods in Software Engineering 1

Formal Methods in Software Engineering 1 Building Models with OCL Introduction Completing UML Diagrams Modeling Tips and Hints Summary Formal Methods in Software Engineering 1 What Is a Model? Simply put, a model is a high level system description.

More information

Chapter 1. MDA and the Use of OCL 1.1 INTRODUCING OCL

Chapter 1. MDA and the Use of OCL 1.1 INTRODUCING OCL OCL.book Page 3 Tuesday, July 22, 2003 9:48 PM Chapter 1 MDA and the Use of OCL This chapter explains why it is important to create models that contain as much information about the system as possible,

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

OCL Object Constraint Language

OCL Object Constraint Language PA103 - Object-oriented Methods for Design of Information Systems OCL Object Constraint Language Radek Ošlejšek Fakulta informatiky MU oslejsek@fi.muni.cz Literature The Object Constraint Language (Second

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

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

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

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

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 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

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

Component-Based Software Engineering

Component-Based Software Engineering Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 4 Specification of Components (Part A) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo A

More information

Specification of an Interface. Component Specification. Component-Based Software Engineering. A Component Comprised of?

Specification of an Interface. Component Specification. Component-Based Software Engineering. A Component Comprised of? Component-Based Software Engineering ECE493-Topic 4 Winter 2006 Lecture 3 Specification of Components Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo A Component

More information

SLIDES: Introductory Modeling Example Employing UML and OCL [UML: Unified Modeling Language, OCL:Object Constarint Language]

SLIDES: Introductory Modeling Example Employing UML and OCL [UML: Unified Modeling Language, OCL:Object Constarint Language] Lecture day 2016-04-07 SLIDES: Introductory Modeling Example Employing UML and OCL [UML: Unified Modeling Language, OCL:Object Constarint Language] - System design in an object-oriented way employing USE

More information

Architectural Styles: Definitions

Architectural Styles: Definitions Component-Based Software Engineering ECE493-Topic 4 Winter 2006 Lecture 7 Architectural Styles in CBSE (Part A) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo

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

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

Research Paper on Implementation of OCL Constraints in JAVA

Research Paper on Implementation of OCL Constraints in JAVA ISSN No. 0976-5697 Volume 8, No. 5, May June 2017 International Journal of Advanced Research in Computer Science RESEARCH PAPER Available Online at www.ijarcs.info Research Paper on Implementation of OCL

More information

Basic Properties of Styles

Basic Properties of Styles Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 18 Enterprise Styles/Patterns (Part A) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo Basic

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

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University Metamodeling Janos ISIS, Vanderbilt University janos.sztipanovits@vanderbilt.edusztipanovits@vanderbilt edu Content Overview of Metamodeling Abstract Syntax Metamodeling Concepts Metamodeling languages

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

What is CBSE and Why? Component-Based Software Engineering. But why not in Software engineering? Component Everywhere

What is CBSE and Why? Component-Based Software Engineering. But why not in Software engineering? Component Everywhere Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 1 Basic Concepts (Part A) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo What is CBSE and

More information

Component-Based Software Engineering

Component-Based Software Engineering Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 1 Basic Concepts (Part A) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo What is CBSE and

More information

OCL and Concept Model

OCL and Concept Model OCL and Concept Model Jörg Kienzle & Alfred Strohmeier COMP-533 OCL and Concept Model OCL History and Goal Constraints OCL Types Base Types & Operations Collection Types & Operations Navigating UML Diagrams

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

Agenda. More on the Unified Modeling Language. UML diagram types. Packages

Agenda. More on the Unified Modeling Language. UML diagram types. Packages Agenda More on the Unified Modeling Language Perdita Stevens, University of Edinburgh July 2010 And the rest... deployment diagrams, component diagrams, object diagrams, timing diagrams, etc. OCL and alternatives

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML Ingegneria del Software Corso di Laurea in Informatica per il Management Introduction to UML Davide Rossi Dipartimento di Informatica Università di Bologna Modeling A model is an (abstract) representation

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: A Practitioner s s Approach, 6/e Roger Pressman. Chapter 28 Formal Methods

Software Engineering: A Practitioner s s Approach, 6/e Roger Pressman. Chapter 28 Formal Methods Software Engineering: A Practitioner s s Approach, 6/e Roger Pressman Chapter 28 Formal Methods 1 Problems with Conventional Specification contradictions ambiguities vagueness incompleteness mixed levels

More information

TIME-BASED CONSTRAINTS IN THE OBJECT CONSTRAINT LANGUAGE OCL

TIME-BASED CONSTRAINTS IN THE OBJECT CONSTRAINT LANGUAGE OCL TIME-BASED CONSTRAINTS IN THE OBJECT CONSTRAINT LANGUAGE OCL Ali Hamie, John Howse School of Computing, Mathematical and Information Sciences, University of Brighton, Brighton, UK. {a.a.hamie@brighton.ac.uk,

More information

Object Constraint Language 2

Object Constraint Language 2 Object Constraint Language 2 Martin Nečaský Dept. of Software Engineering Faculty of Mathematics and Physics Charles University in Prague Type System predefined types in OCL standard library generic types

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

An Evolution of Mathematical Tools

An Evolution of Mathematical Tools An Evolution of Mathematical Tools From Conceptualization to Formalization Here's what we do when we build a formal model (or do a computation): 0. Identify a collection of objects/events in the real world.

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

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models CS 494 Object-Oriented Analysis & Design UML Class Models Overview How class models are used? Perspectives Classes: attributes and operations Associations Multiplicity Generalization and Inheritance Aggregation

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

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

Higher Computing Science Software Design and Development - Programming Summary Notes

Higher Computing Science Software Design and Development - Programming Summary Notes Higher Computing Science Software Design and Development - Programming Summary Notes Design notations A design notation is the method we use to write down our program design. Pseudocode is written using

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

From OCL to Propositional and First-order Logic: Part I

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

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

UNIT II. Syllabus. a. An Overview of the UML: Visualizing, Specifying, Constructing, Documenting

UNIT II. Syllabus. a. An Overview of the UML: Visualizing, Specifying, Constructing, Documenting UNIT II Syllabus Introduction to UML (08 Hrs, 16 Marks) a. An Overview of the UML: Visualizing, Specifying, Constructing, Documenting b. Background, UML Basics c. Introducing UML 2.0 A Conceptual Model

More information

An Annotated Language

An Annotated Language Hoare Logic An Annotated Language State and Semantics Expressions are interpreted as functions from states to the corresponding domain of interpretation Operators have the obvious interpretation Free of

More information

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F 1 Logical Operations 1.1 And The and operator is a binary operator, denoted as, &,, or sometimes by just concatenating symbols, is true only if both parameters are true. A B A B F T F F F F The expression

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples Outline Introduction to Programming (in C++) Introduction Programming examples Algorithms, programming languages and computer programs Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer

More information

Chapter 9, Object Design: Specifying Interfaces

Chapter 9, Object Design: Specifying Interfaces Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 9, Object Design: Specifying Interfaces Lecture Plan Specifying Interfaces (Chapter 9) Object Design Activities Visibilities and

More information

Component-Based Software Engineering. ECE493-Topic 5 Winter Lecture 26 Java Enterprise (Part D)

Component-Based Software Engineering. ECE493-Topic 5 Winter Lecture 26 Java Enterprise (Part D) Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 26 Java Enterprise (Part D) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo J2EE Application

More information

The Unified Modelling Language. Example Diagrams. Notation vs. Methodology. UML and Meta Modelling

The Unified Modelling Language. Example Diagrams. Notation vs. Methodology. UML and Meta Modelling UML and Meta ling Topics: UML as an example visual notation The UML meta model and the concept of meta modelling Driven Architecture and model engineering The AndroMDA open source project Applying cognitive

More information

Verbalizing Business Rules: Part 9

Verbalizing Business Rules: Part 9 Verbalizing Business Rules: Part 9 Terry Halpin Northface University Business rules should be validated by business domain experts, and hence specified using concepts and languages easily understood by

More information

Formal Methods. CITS5501 Software Testing and Quality Assurance

Formal Methods. CITS5501 Software Testing and Quality Assurance Formal Methods CITS5501 Software Testing and Quality Assurance Pressman, R. Software Engineering: A Practitioner s Approach. Chapter 28. McGraw-Hill, 2005 The Science of Programming, David Gries, 1981

More information

Generating Alternative Representations for OCL Integrity Constraints

Generating Alternative Representations for OCL Integrity Constraints Generating Alternative Representations for OCL Integrity Constraints Jordi Cabot 1,2 and Ernest Teniente 2 1 Estudis d'informàtica i Multimèdia, Universitat Oberta de Catalunya jcabot@uoc.edu 2 Dept. Llenguatges

More information

Shared Variables and Interference

Shared Variables and Interference Illinois Institute of Technology Lecture 24 Shared Variables and Interference CS 536: Science of Programming, Spring 2018 A. Why Parallel programs can coordinate their work using shared variables, but

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

Axiomatic Specification. Al-Said, Apcar, Jerejian

Axiomatic Specification. Al-Said, Apcar, Jerejian Axiomatic Specification Al-Said, Apcar, Jerejian 1 Axioms: Wffs that can be written down without any reference to any other Wffs. Wffs that are stipulated as unproved premises for the proof of other wffs

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

III. Check if the divisors add up to the number. Now we may consider each of these tasks separately, assuming the others will be taken care of

III. Check if the divisors add up to the number. Now we may consider each of these tasks separately, assuming the others will be taken care of Top-Down Design 1 Top-Down Design: A solution method where the problem is broken down into smaller sub-problems, which in turn are broken down into smaller subproblems, continuing until each sub-problem

More information

UNIT-4 Behavioral Diagrams

UNIT-4 Behavioral Diagrams UNIT-4 Behavioral Diagrams P. P. Mahale Behavioral Diagrams Use Case Diagram high-level behaviors of the system, user goals, external entities: actors Sequence Diagram focus on time ordering of messages

More information

OCL parsing / type checking in the context of GF and KeY. Kristofer Johannisson

OCL parsing / type checking in the context of GF and KeY. Kristofer Johannisson OCL parsing / type checking in the context of GF and KeY Kristofer Johannisson 1 I. Introduction 2 Typechecking? context OwnerPIN inv: maxpinsize > 0 and maxtries > 0 and triesremaining >= 0 and triesremaining

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

IFAD. VDMTools Validated. Design through Modelling. Overview of VDM -SL/++ IFAD. IFAD A/S Forskerparken 10 DK-5230 Odense M Denmark.

IFAD. VDMTools Validated. Design through Modelling. Overview of VDM -SL/++ IFAD. IFAD A/S Forskerparken 10 DK-5230 Odense M Denmark. VDMTools Validated Design through Modelling Overview of VDM -SL/++ www.ifad.dk A/S Forskerparken 10 DK-5230 Odense M Denmark 1 VDM-SL ISO Standard 1996 for flat language Different module proposals A de-facto

More information

Part II Black-Box Composition Systems 10. Business Components in a Component-Based Development Process

Part II Black-Box Composition Systems 10. Business Components in a Component-Based Development Process Part II Black-Box Composition Systems 10. Business Components in a Component-Based Development Process 1. Business component model of the Cheesman/ Daniels process 2. Identifying business components Prof.

More information

Introduction to Software Engineering. 5. Modeling Objects and Classes

Introduction to Software Engineering. 5. Modeling Objects and Classes Introduction to Software Engineering 5. Modeling Objects and Classes Roadmap > UML Overview > Classes, attributes and operations > UML Lines and Arrows > Parameterized Classes, Interfaces and Utilities

More information

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1 Chapter 2 Input, Processing, and Output Fall 2016, CSUS Designing a Program Chapter 2.1 1 Algorithms They are the logic on how to do something how to compute the value of Pi how to delete a file how to

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

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING KEY CONCEPTS COMP 10 EXPLORING COMPUTER SCIENCE Lecture 2 Variables, Types, and Programs Problem Definition of task to be performed (by a computer) Algorithm A particular sequence of steps that will solve

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 Notes: Hoare Logic

Lecture Notes: Hoare Logic Lecture Notes: Hoare Logic 17-654/17-754: Analysis of Software Artifacts Jonathan Aldrich (jonathan.aldrich@cs.cmu.edu) Lecture 3 1 Hoare Logic The goal of Hoare logic is to provide a formal system for

More information

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Lecture 19 Tuesday, April 3, 2018 1 Introduction to axiomatic semantics The idea in axiomatic semantics is to give specifications

More information

Shared Variables and Interference

Shared Variables and Interference Solved Shared Variables and Interference CS 536: Science of Programming, Fall 2018 A. Why Parallel programs can coordinate their work using shared variables, but it s important for threads to not interfere

More information

Business-Driven Software Engineering Lecture 5 Business Process Model and Notation

Business-Driven Software Engineering Lecture 5 Business Process Model and Notation Business-Driven Software Engineering Lecture 5 Business Process Model and Notation Jochen Küster jku@zurich.ibm.com Agenda BPMN Introduction BPMN Overview BPMN Advanced Concepts Introduction to Syntax

More information

J2EE Application Server. EJB Overview. Java versus.net for the Enterprise. Component-Based Software Engineering. ECE493-Topic 5 Winter 2007

J2EE Application Server. EJB Overview. Java versus.net for the Enterprise. Component-Based Software Engineering. ECE493-Topic 5 Winter 2007 Component-Based Software Engineering ECE493-Topic 5 Winter 2007 Lecture 24 Java Enterprise (Part B) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo J2EE Application

More information

N-Tiered Enterprise Styles. Example 1. Key Concepts. Component-Based Software Engineering. ECE493-Topic 4 Winter 2006

N-Tiered Enterprise Styles. Example 1. Key Concepts. Component-Based Software Engineering. ECE493-Topic 4 Winter 2006 Component-Based Software Engineering ECE493-Topic 4 Winter 2006 Lecture 14 Enterprise Styles/Patterns (Part B) Ladan Tahvildari Assistant Professor Dept. of Elect. & Comp. Eng. University of Waterloo N-Tiered

More information

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. 9 Self-Test Exercises p. 11 History Note p. 12 Programming and

More information

CSEN 102 Introduction to Computer Science

CSEN 102 Introduction to Computer Science CSEN 102 Introduction to Computer Science Lecture 2: Python and Sequential Algorithms Prof. Dr. Slim Abdennadher Dr. Aysha Alsafty, slim.abdennadher@guc.edu.eg, aysha.alsafty@guc.edu.eg German University

More information

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs?

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs? Part II. Hoare Logic and Program Verification Part II. Hoare Logic and Program Verification Dilian Gurov Props: Models: Specs: Method: Tool: safety of data manipulation source code logic assertions Hoare

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

SNS COLLEGE OF ENGINEERING,

SNS COLLEGE OF ENGINEERING, SNS COLLEGE OF ENGINEERING, COIMBATORE Department of Computer Science and Engineering QUESTION BANK(PART A) GE8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING TWO MARKS UNIT-I 1. What is computer? Computers

More information

OCL for the Specification of Model Transformation Contracts

OCL for the Specification of Model Transformation Contracts OCL for the Specification of Model Transformation Contracts Eric Cariou, Raphaël Marvie, Lionel Seinturier, and Laurence Duchien LIFL - Université des Sciences et Technologies de Lille UMR CNRS 8022 -

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

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

More information

Assertions, pre/postconditions

Assertions, pre/postconditions Programming as a contract Assertions, pre/postconditions Assertions: Section 4.2 in Savitch (p. 239) Specifying what each method does q Specify it in a comment before method's header Precondition q What

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

Object-Oriented Systems Development: Using the Unified Modeling Language

Object-Oriented Systems Development: Using the Unified Modeling Language Object-Oriented Systems Development: Using the Unified Modeling Language Chapter 5: Unified Modeling Language Goals Modeling. Unified modeling language. Class diagram. Use case diagram. Interaction diagrams.

More information

Lecture 9. UML language architecture

Lecture 9. UML language architecture Lecture 9 UML Model architecture Object Constraint Language 12/10/98 AOO / UML / OCL/Strategies 1 UML language architecture UML metamodel defines meaning of UML models Defined in a metacircular manner,

More information

Validation of UML Design Model

Validation of UML Design Model Validation of UML Design Model Ashish Kumar Mishra, Dharmendra K. Yadav* The Department of Computer Science and Engineering, MNNIT Allahabad, Allahabad. * Corresponding author. Tel.: 08004486303; email:

More information

Constraint-enabled Process Modeling. Conrad Bock U.S. National Institute of Standards and Technology November 20, 2007

Constraint-enabled Process Modeling. Conrad Bock U.S. National Institute of Standards and Technology November 20, 2007 Constraint-enabled Process Modeling Conrad Bock U.S. National Institute of Standards and Technology November 20, 2007 1 Overview Models and constraints: Example of structure models Extend to process models:

More information

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects,

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects, Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects, Classes, Class Diagrams Values and Attributes Operations

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

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java Chapter 3 Syntax, Errors, and Debugging Objectives Construct and use numeric and string literals. Name and use variables and constants. Create arithmetic expressions. Understand the precedence of different

More information

K Reference Card. Complete example

K Reference Card. Complete example K Reference Card Complete example package examples.example1 annotation doc : String class Date class Person { name : String age : Int ssnr : Int @doc("employee inherits from Person") class Employee extends

More information

Chapter 3 (part 3) Describing Syntax and Semantics

Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings

More information

Object Constraint Language OCL. Tomáš Černý : Object contraint language

Object Constraint Language OCL. Tomáš Černý : Object contraint language Object Constraint Language OCL Tomáš Černý : Object contraint language OCL Intro Flight type : enum of cargo, passenger flights Airplane type : enum of cargo, passenger {context Flight inv: type = #cargo

More information

9/2/2016. Expressions are Used to Perform Calculations. ECE 120: Introduction to Computing. Five Arithmetic Operators on Numeric Types

9/2/2016. Expressions are Used to Perform Calculations. ECE 120: Introduction to Computing. Five Arithmetic Operators on Numeric Types University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Expressions are Used to Perform Calculations Let s talk in more detail starting

More information

1/31/2017. Expressions are Used to Perform Calculations. ECE 120: Introduction to Computing. Five Arithmetic Operators on Numeric Types

1/31/2017. Expressions are Used to Perform Calculations. ECE 120: Introduction to Computing. Five Arithmetic Operators on Numeric Types University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing Expressions are Used to Perform Calculations Let s talk in more detail starting

More information

Objectives for this class meeting. 1. Conduct review of core concepts concerning contracts and pre/post conditions

Objectives for this class meeting. 1. Conduct review of core concepts concerning contracts and pre/post conditions CSE1720 Click to edit Master Week text 01, styles Lecture 02 Second level Third level Fourth level Fifth level Winter 2015! Thursday, Jan 8, 2015 1 Objectives for this class meeting 1. Conduct review of

More information