100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
Summary Modelling Computing Systems Hoofdstuk 7 Faron Moller & Georg Struth €2,99   In winkelwagen

Samenvatting

Summary Modelling Computing Systems Hoofdstuk 7 Faron Moller & Georg Struth

 24 keer bekeken  0 keer verkocht

Logic for Computer Science / Logica voor computertechnolgie hoofdstuk 7. Samenvatting van het boek Modelling Computing Systems geschreven door Faron Moller en Georg Struth. Samenvatting geschreven in het Engels. Aan de hand van voorbeelden en plaatjes wordt de stof en theorie verduidelijkt. Gegeven...

[Meer zien]

Voorbeeld 2 van de 5  pagina's

  • Nee
  • Hoofdstuk 7
  • 15 december 2020
  • 5
  • 2020/2021
  • Samenvatting
  • logica voor c
book image

Titel boek:

Auteur(s):

  • Uitgave:
  • ISBN:
  • Druk:
Alle documenten voor dit vak (6)
avatar-seller
luukvaa
Hoofdstuk 7:

The truth set associated with a predicate P is the set: {x : P(x) holds}. We can also consider the truth
set associated with predicates that take more than one argument: {(x, y, z) : R(x, y, z) holds}. For
example:

R(x, y, z) might hold if and only if the customer with ID x ordered product y on the date z. The
corresponding truth set then defines a subset of the set CustomerID × ProductID × Date.

A relation R on A and B is a subset of a cartesian product A × B. We write R(a,b) or aRb if (a,b) ∈ R;
that is, a and b are related by R. Examples of relations:

- The less-than-or equals relation on numbers, x ⩽ 4
- The equality relation, x = y
- The ‘is-an-ancestor-of’ or the parenthood relation between humans.
- The ‘equivalent’ relation between programs, describing when two programs behave the
same.
- The propositionally equivalent relation between propositions.

Functions and relations are similar, but there are some important differences:

- Given a function f : A → B, we can construct the relation {(x, f(x) : x ∈ A}, sometimes referred
to as the graph of the function f.
- But not all relations are functions. For example, the ‘is-an-ancestor-of’ relation between me
and my ancestors is not a function. Each person has many different ancestors.
- A function f : A → B associates a value in B with each a ∈ A; in a relation each a ∈ A may be
associated with zero, one or many elements of B.
- Given a relation on A × B such that each a ∈ A is related to exactly one b ∈ B - this
determines a function f : A → B

A relation between two sets A and B is called a binary relation. Many familiar binary relations use an
infix operator: ⊆, =, ⇔, ⩽, … Given a relation R ⊆ A × B we sometimes refer to A as the source and B
as the target of R. When a relation R is a subset of A × A we sometimes call R a homogeneous
relation; When a relation R is a subset of A × B (for two different sets A and B) we call R a
heterogeneous relation.

On the right is a example of a relation. U can see this is not a function
because B doesn’t have a single number associated with it, and D has
multiple number associated with it. That’s why this is a relation and
not a function.

A × B is also a relation – every pair of elements (a,b) where a ∈ A and b
∈ B, is related. The empty set ∅ is also a subset of A × B – no two
elements are related. The equality relation on a set A is defined by {
(a,a) : a ∈ A}. For any relation R on A × B, we can define the inverse relation on B × A as follows: R −1
= {(b, a) : (a, b) ∈ R} For example, given the relation < ⊆ N × N, we can define the inverse relation on
B × A as follows: R −1 = {(b, a) : (a, b) ∈ R}.

, We can use familiar operations for manipulating sets to manipulate relations:

- a ⩽ b = (a < b) ∪ (a = b)
- Parent = Father ∪ Mother
- Son = Child ∩ Male

Given a relation R ⊆ A × B, we sometimes refer to the:

- the source of R is given by {a ∈ A : ∃b ∈ B (a, b) ∈ R}
- the target of R is given by {b ∈ B : ∃a ∈ A (a, b) ∈ R}

Properties of relations:

A relation is reflexive if R(x,x) for all x. Examples: 1. equality & 2. propositionally equivalent
formulas;
Non-examples: 1. x < y (where x and y are numbers); 2. The strict-subset relation on sets. 3. Is-a-
parent-of relation between people(no one is a parent of hisself).
If a relation R is ‘never reflexive’, that is, ∀x ¬(xRx) we call R irreflexive.

A relation is symmetric if R(x,y) implies R(y,x). Examples: 1. Equality, 2: propositionally equivalent
formulas, 3. The “is a sibling of relation(X is a brother of y, than y is a brother of x)”; Non-
examples: 1. x ⩽ y (where x and y are numbers); 2. The subset relation on sets. 3. The graph of the
sort function.

A relation is asymmetric if R(x,y) implies ¬R(y,x). Examples: 1. The < relation on numbers; 2. The
‘is-a-strict-prefix-of’ relation on strings. Example: when 4 < 5 then 5 ¬< 4.

A relation is antisymmetric if R(x,y) and R(y,x) implies x = y. Examples: 1. Equality; 2. ⩽ on natural
numbers; 3. ⊆ on sets. Non-examples: 1. Equivalence of propositional formulas. 2. The < relation
on numbers;

A relation is transitive if R(x,y) and R(y,z) implies R(x,z). Examples: 1. Subsets, equality,
comparison of numbers, prefixes of strings. If hell is a prefix of hello, and he is a prefix of hell.


We can compose relations. Given a relation R on A × B and a relation S on B × C, we can form the
composed relation R ◦ S on A × C as follows: R ◦ S = {(a, c) : there is some b ∈ B such that aRb ∧ bSc}.

If R is a relation on A × A:

- R is reflexive when it contains the equality relation, = ⊆ R
- R is symmetric when R −1 ⊆ R (or equivalently, when R ⊆ R −1 )
- R is transitive when R ◦ R ⊆ R

An equivalence relation is a relation that is:

- reflexive – R(x,x) for all x.
- symmetric – R(x,y) implies R (y,x)
- transitive – R(x,y) and R(y,z) implies R(x,z)

The canonical example of such a relation is equality.

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

Verzekerd van kwaliteit door reviews

Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper luukvaa. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €2,99. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 67474 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€2,99
  • (0)
  Kopen