Semantics of UML class diagrams



Similar documents
INTRODUCTORY SET THEORY

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

CSC 742 Database Management Systems

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Finite Automata. Reading: Chapter 2

The Halting Problem is Undecidable

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

Lecture 16 : Relations and Functions DRAFT

Omega Automata: Minimization and Learning 1

Relational Databases

Basic Concepts of Set Theory, Functions and Relations

Finite Automata. Reading: Chapter 2

Lecture 17 : Equivalence and Order Relations DRAFT

Regular Expressions and Automata using Haskell

Discrete Mathematics. Hans Cuypers. October 11, 2007

Chapter 8 The Enhanced Entity- Relationship (EER) Model

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

Automata and Formal Languages

Discrete Mathematics

Solutions to In-Class Problems Week 4, Mon.

Mathematical Induction. Lecture 10-11

CHAPTER 7 GENERAL PROOF SYSTEMS

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Software Engineering

Non-deterministic Semantics and the Undecidability of Boolean BI

Regular Languages and Finite Automata

COMP 378 Database Systems Notes for Chapter 7 of Database System Concepts Database Design and the Entity-Relationship Model

Admin Report Kit for Active Directory

Introduction to Automata Theory. Reading: Chapter 1

A Propositional Dynamic Logic for CCS Programs

Semantic Errors in SQL Queries: A Quite Complete List

Discrete Maths. Philippa Gardner. These lecture notes are based on previous notes by Iain Phillips.

Scalable Automated Symbolic Analysis of Administrative Role-Based Access Control Policies by SMT solving

SOLUTIONS TO ASSIGNMENT 1 MATH 576

Software Model Checking. Equivalence Hierarchy

facultad de informática universidad politécnica de madrid

How To Design Software

Propagating Functional Dependencies with Conditions

Cartesian Products and Relations

Automata on Infinite Words and Trees

Formal Engineering for Industrial Software Development

CS5236 Advanced Automata Theory

Class notes Program Analysis course given by Prof. Mooly Sagiv Computer Science Department, Tel Aviv University second lecture 8/3/2007

Lecture 03 ( ) Quality of the Software Development Process

ALTIRIS CMDB Solution 6.5 Product Guide

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

A Little Set Theory (Never Hurt Anybody)

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

IRA 423/08. Designing the SRT control software: Notes to the UML schemes. Andrea Orlati 1 Simona Righini 2

Computability Theory

Testing LTL Formula Translation into Büchi Automata

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

Two approaches to the integration of heterogeneous data warehouses

MOC 20461C: Querying Microsoft SQL Server. Course Overview

A first step towards modeling semistructured data in hybrid multimodal logic

Compiler Construction

Lecture 12: Entity Relationship Modelling

Symbol Tables. Introduction

Regular Languages and Finite State Machines

Chapter 7 Uncomputability

4. CLASSES OF RINGS 4.1. Classes of Rings class operator A-closed Example 1: product Example 2:

THE LANGUAGE OF SETS AND SET NOTATION

CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards

Graphical Systems Modeling with UML / SysML Class diagrams

Object Oriented Software Models

24 Uses of Turing Machines

Programming Languages Featherweight Java David Walker

Removing Partial Inconsistency in Valuation- Based Systems*

Lights and Darks of the Star-Free Star

A logical approach to dynamic role-based access control

IT2305 Database Systems I (Compulsory)

UPDATES OF LOGIC PROGRAMS

On strong fairness in UNITY

Notes on Richard Dedekind s Was sind und was sollen die Zahlen?

IV. The (Extended) Entity-Relationship Model

On the Structure of Turing Universe: The Non-Linear Ordering of Turing Degrees

Deterministic Finite Automata

ITU-T Z.100. Specification and description language (SDL)

The E-R èentity-relationshipè data model views the real world as a set of basic objects èentitiesè and

Information Systems SQL. Nikolaj Popov

Full and Complete Binary Trees

Computing Concepts with Java Essentials

Integrating Data from Possibly Inconsistent Databases

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

! " # The Logic of Descriptions. Logics for Data and Knowledge Representation. Terminology. Overview. Three Basic Features. Some History on DLs

Describing, manipulating and pricing financial contracts: The MLFi language

The Software Development Process

Introduction. UML = Unified Modeling Language It is a standardized visual modeling language.

Review: Participation Constraints

Course Syllabus. MATH 1350-Mathematics for Teachers I. Revision Date: 8/15/2016

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

11 November

How To Program In Scheme (Prolog)

UML: Classes -- Association

EXTREME: EXecuTable Requirements Engineering, Management and Evolution. Dr. Ella Roubtsova Open University of the Netherlands

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

Big Data with Rough Set Using Map- Reduce

Transcription:

1 Otto-von-Guericke Universität Magdeburg, Germany April 26, 2016

Sets Definition (Set) A set is a collection of objects. The basic relation is membership: x A (x is a member of A) The following operations and relations are defined on sets: empty set is the set with no members enumeration set {a 1 ;... ; a n } contains exactly a 1 ;... ; a n subset A B iff for all x: x A implies x B comprehension {x A P(x)} (the set of all x A such that P(x) holds) union A B = {x x A or x B} intersection A B = {x x A and x B} difference A \ B = {x x A and not x B} powerset P(A) = {B B A} set of words (strings) over A A = {ε} {a 1... a n a i A}

Relations Definition (Cartesian product) A B = {(a, b) a A and b B} A B C = {(a, b, c) a A, b B and c C} etc. Definition (Relation) A binary relation R on A and B is given by a set of pairs R A B (a, b) R often is written as a R b. If A = B, then we speak of a binary relation R on A.

Orders Definition (Partial Order) A partial order (A, ) is given by a set A and a binary relation on A, such that for all x A: x x (reflexivity) for all x, y, z A: x y and y z imply x z (transitivity) for all x, y A: x y and y x imply x = y (antisymmetry) Definition (Total Order) A partial order (A, ) is called a total order, if additionally for all x, y A: x y or y x or x = y (trichotomy)

Orders Example (Sample partial orders) the set of natural numbers with the usual ordering the set of natural numbers with the ordering x can be divided by y the lexicographic order on strings (used for sorting) the prefix order on strings Which of these are total?

The semantics is given by a mathematical function S, representing a snapshot of a system A snapshot S includes all objects of a system, and their relations The evolution of a system can be represented by the transition of a system from a snapshot S 1 to a new snapshot S 2 evolution of a system is only considered later (state machines)

Semantics of a class hierarchy A class hierarchy is given a by a partial order (C, ) antisymmetry means that cyclic subclasses are forbidden Each class c C is interpreted as a finite set S(c) S(c) is the set of objects that are instances of class c If c d, then S(c) S(d) must hold hence, each c is a d

Semantics of a generalisation set disjoint(c 1 d,..., c n d) expresses the condition S(c i ) S(c j ) = for i j complete(c 1 d,..., c n d) expresses the condition S(c 1 ) S(c n ) = S(d) no condition for overlapping and incomplete

Semantics of enumeration types and built-in types An enumeration type T with literals l 1,..., l n has as its semantics the set of literals: S(T ) = {l 1,..., l n } A built-in type has a predefined semantics, e.g. S(integer) = Z S(string) = A where A is a suitable set of characters

Functions Definition (Function) A function f from a set A to a set B, written f : A B, associates with some of the elements a A a unique element b B. This association is symbolically expressed as f (a) = b. The elemen a A is called the argument and b the value of the function application f (a). If there is no b, then f (a) is undefined. Note: a function f : A B can be represented as a binary relation graph(f ) A B as follows: We have right-uniqueness: graph(f ) = {(a, f (a)) a A} (x, y) graph(f ) and (x, z) graph(f ) imply y = z Definition (Total function) A function f : A B is total, if f (a) is defined for all a A. In this case, we write f : A B.

Semantics of attributes The semantics of an attribute a : T of a class c is given by a partial function S(a) : S(c) S(T ) The function is needed to be partial because the value of the attribute may not have been initialised yet. If an attribute a : T has multiplicity other than 1, the semantics is given by S(a) : S(c) P(S(T ))

Semantics of query operations The semantics of a query operation op(x 1 : T 1 ;... x n : T n ) : T of a class c is given by a partial function S(op) : S(c) S(T 1 ) S(T n ) S(T ) Non-query operations will lead to a new snapshot and are not considered here.

Semantics of associations Given two classes c and d, the semantics of an association c a d is given by a binary relation S(a) S(c) S(d) An association c a d satisfies the multiplicity c m..n a d if for all y S(d), m {x (x, y) S(a)} n Here, X is the number of elements in X (also called cardinality of X ).

Consistency A UML class diagram is consistent, if there is at least one snapshot satisfying all its conditions. Otherwise, it is inconsistent. A UML class diagram is strongly consistent, if there is at least one snapshot intepreting all classes as non-empty sets satisfying all its conditions.

Semantics of association ends The semantics of an association end c e a d is given by a function S(e) : S(d) P(S(c)): for y S(d), S(e)(y) = {x (x, y) S(a)} The semantics of an association end with multiplicity 0..1 c e 0..1 a d is given by a partial function S(e) : S(d) S(c): for y S(d), S(e)(y) = the x with (x, y) S(a) (if existing)

Semantics of association ends The semantics of an association end with multiplicity 1 c e 1 a d is given by a total function S(e) : S(d) S(c): for y S(d), S(e)(y) = the x with (x, y) S(a) (always exists) The semantics of an association end e ordered c a d is given by a function S(e) : S(d) (S(c)) with: for y S(d), x S(e)(y) iff (x, y) S(a)

Semantics of aggregations and compositions Aggregations and compositions are associations and inherit their semantics Aggregations and compositions represent part-whole relationships; hence they are irreflexive (and so are their transitive closures) For compositions, there is a condition on evolution of snapshots: if an object of the composite class is deleted, so must be all associated elements of component classes Definition (transitive closure) Given a binary relation R A A, its transitive closure is the least relation R A A with R R R is transitive

Semantics of object diagrams An object diagram specifies some objects to be part of the snapshot S If an object o is specified to have class c, then it must hold that S(o) S(c) If there is an association a between objects o and p, then it must hold that (S(o), S(p)) S(a)

Different stages of goodness of UML class diagrams 1 Syntactically ill-formed 2 Syntactically well-formed, but static-semantically ill-formed 3 Syntactically and static-semantically well-formed, but inconsistent 4 Syntactically and static-semantically well-formed and consistent, but methodologically doubtful 5 Syntactically and static-semantically well-formed, consistent and methodologically clean