Download presentation
Presentation is loading. Please wait.
Published byGerald Davis Modified over 8 years ago
1
1 April 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal Methods Relations
2
1 April 2009Instructor: Tasneem Darwish2 Outlines Binary relations.
3
1 April 2009Instructor: Tasneem Darwish3 Introduction In a formal specification, it is often necessary to describe relationships between Objects. Example: 1.This object is greater than that. 2.This action takes priority over that one. These relationships can be described using simple mathematical objects called relations.
4
1 April 2009Instructor: Tasneem Darwish4 Binary Relations We can define relations between a finite number of objects, but its enough to define binary relations. Binary relations are relations that express links between pairs of objects. In our mathematical language a relation is a set of ordered pairs, a subset of a Cartesian product. If X and Y are sets, then X ↔Y denotes the set of all relations between X and Y. The relation symbol can be defined using generic abbreviation:
5
1 April 2009Instructor: Tasneem Darwish5 Binary Relations Example 7.1 The set of relations {a, b} ↔ {0, 1} is the set of sets of pairs The relation that associates a with 0, a with 1, and b with 0 is the set The expression is another way of writing (x,y)
6
1 April 2009Instructor: Tasneem Darwish6 Binary Relations Example 7.2 The relation drives is used to record which makes of car are driven by the members of a small group of people. If the group of people is defined by: and the choice of cars is defined by Then drives is an element of, and the statement `Kate drives a cortina' could be formalised as:
7
1 April 2009Instructor: Tasneem Darwish7 Binary Relations We may also choose to introduce a relation as an infix symbol: a symbol that sits between its arguments. Many familiar relations are written in this way: the less-than-or-equal-to relation on numbers; the subset relation on sets. If the pair (x, y) is an element of the infix relation R, then we may write x R y. When we define an infix relation, we include underscores to indicate where the arguments should go.
8
1 April 2009Instructor: Tasneem Darwish8 Binary Relations Example 7.3 The relation drives could be defined by Simple relations can be illustrated using diagrams with arrows, or graphs.
9
1 April 2009Instructor: Tasneem Darwish9 Binary Relations Example 7.3 The relation drives could be defined by Simple relations can be illustrated using diagrams with arrows, or graphs.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.