• Keine Ergebnisse gefunden

Musterlösung FormaleTechnikenderSoftware-EntwicklungÜbungsblatt5Besprechungam05.06.2015

N/A
N/A
Protected

Academic year: 2021

Aktie "Musterlösung FormaleTechnikenderSoftware-EntwicklungÜbungsblatt5Besprechungam05.06.2015"

Copied!
3
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Ludwig-Maximilians-Universität München Institut für Informatik

Dr. M. Hölzl, C. Kroiÿ

SoSe 2015

Formale Techniken der Software-Entwicklung Übungsblatt 5

Besprechung am 05.06.2015

Musterlösung

Aufgabe 1 wurde aus [1] übernommen und sind daher auf Englisch.

Aufgabe 1:

LetF(x, y)mean thatxis the father ofy;M(x, y)denotesxis the mother ofy. Similarly,H(x, y),S(x, y), andB(x, y)say that xis the husband/sister/brother of y, respectively. You may also use constants to denote individuals, like `Ed' and `Patsy.' However, you are not allowed to use any predicate symbols other than the above to translate the following sentences into predicate logic:

(a) Everybody has a mother.

Lösung:

∀x.∃y.M(y, x)

(b) Everybody has a father and a mother.

Lösung:

∀x.∃y.∃z.M(y, x)∧F(z, x)

(c) Whoever has a mother has a father.

Lösung:

∀x.(∃y.M(y, x))→(∃z.F(z, x))

(d) Ed is a grandfather.

Lösung:

∃x.∃y.F(Ed, x)∧(F(x, y)∨M(x, y)) (e) All fathers are parents.

(2)

FTSE SoSe 2015 - Übungsblatt 5 Seite 2/3 Musterlösung

Lösung:

∀x.(∃y.F(x, y))→(∃z.F(x, z)∨M(x, z))

(f) All husbands are spouses.

Lösung:

Da es kein Prädikat für wife gibt, ist irgendwie nicht klar, wie man spouse anders als durch die husband-Beziehung ausdrücken soll. Man könnte hier noch Monogamie fordern:

∀x.∀y.H(x, y)→(∀z.H(z, y)→z=x)

(g) No uncle is an aunt.

Lösung:

∀x.(∃y.∃z.B(x, y)∧(M(y, z)∨F(y, z)))→ ¬(∃y.∃z.S(x, y)∧(M(y, z)∨F(y, z)))

(h) All brothers are siblings.

Lösung:

∀x.∀y.B(x, y)→(B(y, x)∨S(y, x))

(i) Nobody's grandmother is anybody's father.

Lösung:

∀x.(∃y.∃z.M(x, y)∧(M(y, z)∨F(y, z))) =⇒ ¬(∃y.F(x, y))

(j) Ed and Patsy are husband and wife.

Lösung:

Wie oben kann man hier Monogamie fordern:

H(Ed, P atsy)∧(∀x.H(Ed, x)→x=P atsy)∧(∀y.H(y, P atsy)→y=Ed)

(k) Carl is Monique's brother-in-law.

Lösung:

(∃x.B(Carl, x)∧H(x, M onique))∨(∃y.H(Carl, y)∧S(M onique, y))

Aufgabe 2:

Gegeben sei die FormelΦ def= ∀x∀y.Q(g(x, y), g(y, y), z). Finden Sie zwei Modelle M und M0 so dass M |= ΦaberM0 6|= Φgilt.

Lösung:

Hier gibt es natürlich unendlich viele verschiedene Möglichkeiten. Eine ganz triviale folgt:

Gegeben eine StrukturAmit TrägermengeNund

(3)

FTSE SoSe 2015 - Übungsblatt 5 Seite 3/3 Musterlösung

gA(x, y) = 1 ∀x, y∈N QA={(1,1,1)}

.

Dann wähle fürM= (A, w):

w(z) = 1 und fürM0= (A, w0):

w(z) = 0 Es ist leicht zu sehen, dassM |= ΦaberM06|= Φgilt.

Aufgabe 3:

Gegeben sei der folgende Satz:

Φdef= ∀x∃y∃z(P(x, y)∧P(z, y)∧(P(x, z)→P(z, x))) Welche der folgenden Modelle erfüllenΦ?

(a) Das ModellMbesteht aus den natürlichen Zahlen mitPMdef= {(m, n)|m < n}. Lösung:

Gilt.

Wähley > xundz=x. Dann gilt¬P(x, z)und somit ist Φwahr.

(b) Das ModellM0 besteht aus den natürlichen Zahlen mitPM0 def= {(m,2∗m)|m∈N}. Lösung:

Gilt.

Wähle y = 2∗x und z = x. Wenn man 0 zu den natürlichen Zahlen rechnet, dann gilt im Fall x = 0 auch P(x, z) = P(0,0) = (0,2∗0) ∈ PM und genauso auch P(z, x). Somit gilt die Implikation in der Klammer. Für alle anderen Fällex > 0 ist bei z=xdie Prämisse der Implikation falsch und somit die Implikation in der Klammer wahr.

(c) Das Modell M00besteht aus den natürlichen Zahlen mitPM00def= {(m, n)|m < n+ 1}. Lösung:

Gilt.

Wählez=xundy≥x. Dann giltP(x, y)∧P(z, y)∧P(x, z)∧P(z, x)und somit ist Φwahr.

Literatur

[1] Michael Huth and Mark Ryan. Logic in Computer Science: Modelling and reasoning about systems.

Cambridge University Press, 2004.

Referenzen

ÄHNLICHE DOKUMENTE

G¨ odel’s completeness theorem for first-order logic: semantics can be captured by formal proofs.. — even by

As an example, simple lattice approximation argument shows that wireless networks are certainly not small world networks, and are typically expected not to be scale-free, either

– But by observing that the other did not raise his hand (i.e. does not know whether he’s muddy), each child concludes the true world state.. – So, at the second announcement,

Was sicherlich innovativ ist (und was in eine 'linguistische' Einführung in die Konversationsanalyse gehört!), sind die da- rauffolgenden Abschnitte zu sprachlichen Ressourcen, die

Asif Agha entwickelt in Language and Social Relations eine Perspektivierung von gleichermaßen Sprache in ihrer sozialen Einbettung und Gesellschaft in ihrer sprachlichen

This Computer Note describes the offline digital incremental plotter in use at the Computer Science Center of the University of Maryland.. A functional

How to use Chan’s randomized technique and the decision algorithm for the geometric dilation of a polygonal chain to develop an optimization algorithm?. Abstract

U m s o wichtiger ist Rossis Klarstellung, dass auch die klassisch antike Mathematik keine Einheit war, dass Archimedes beispielsweise Jt noch nicht als Zahl, sondern als