1 #+title: Predicate Logic
2 #+subtitle: (SE 212 Tutorial 5)
4 #+email: bandali@uwaterloo.ca
5 #+date: Wed Oct 9, 2019
7 #+options: email:t num:t toc:nil \n:nil ::t |:t ^:t -:t f:t *:t <:t
8 #+options: tex:t d:nil todo:t pri:nil tags:not-in-toc
10 #+exclude_tags: noexport
13 # #+latex_class_options: [bigger]
14 #+latex_header: \setbeamercovered{transparent}
15 #+latex: \setbeamertemplate{itemize items}[circle]
16 #+beamer_color_theme: beaver
23 - do some semantics questions from homework 4
24 - do some ND questions from homework 5
28 Provide a counterexample to show that the following argument is not
29 valid and demonstrate that your answer is correct.
32 forall y : M . exists x : N . p(g(x), y)
34 exists z : M . p(z, z)
37 * =h04q05= \small{(cont’d)}
46 --------------------------
49 --------------------------
50 p(., .) | P(m1, m1) := F
56 * =h04q05= \small{(cont’d)}
60 [forall y : M . exists x : N . p(g(x), y)]
61 = [exists x: N. p(g(x), ^m1)] AND
62 [exists x: N . p(g(x), ^m2)]
63 = (P(G(n1), m1) OR P(G(n2), m1)) AND
64 (P(G(n1), m2) OR P(G(n2), m2))
65 = (P(m1, m1) OR P(m2, m1)) AND
66 (P(m1, m2) OR P(m2, m2))
67 = (F OR T) AND (T OR F)
71 * =h04q05= \small{(cont’d)}
75 [exists z: M . p(z, z)]
76 = P(m1, m1) OR P(m2, m2)
83 Express the following sentences in predicate logic. Use types in your
84 formalization. Is the set of formulas consistent? Demonstrate that
85 your answer is correct using the semantics of predicate logic.
88 All programmer like some computers.
89 Some programmers use MAC.
90 Therefore, some people who like some computers use MAC.
93 * =h04q06= \small{(cont’d)}
95 All programmer like some computers.\\
96 Some programmers use MAC.\\
97 Therefore, some people who like some computers use MAC.
101 programmer(x) means x is a programmer
102 usesmac(x) means x uses MAC
103 likes(x, y) means x likes y
105 forall x: Person . programmer(x) =>
106 exists y: Computer . likes(x, y),
107 exists x: Person . programmer(x) & usesmac(x)
110 (exists y: Computer . likes(x, y) & usesmac(x))
113 * =h04q06= \small{(cont’d)}
115 These sentences are /consistent/. Here is an interpretation in which
116 all the formulas are T:
125 -------------------------------------------
126 programmer(.) | programmer(John) = T
127 likes(.,.) | likes(John, MacPro) = T
128 usesmac(.) | usesmac(John) = T
131 * =h04q06= \small{(cont’d)}
135 [forall x: Person . programmer(x) =>
136 exists y: Computer . likes(x, y)]
137 = [programmer(^John) =>
138 exists y: Computer . likes(^John, y)]]
139 = programmer(John) IMP likes(John, MacPro)
144 [exists x: Person . programmer(x) & usesmac(x)]
145 = programmer(John) AND usesmac(John)
150 * =h04q06= \small{(cont’d)}
154 [exists x: Person . (exists y: Computer .
155 likes(x, y) & usesmac(x))]
156 = [exists y: Computer .
157 likes(^John, y) & usesmac(^John)]
158 = likes(John, MacPro) AND usesmac(John)
165 If the following arguments are valid, use natural deduction AND
166 semantic tableaux to prove them; otherwise, provide a counterexample.
169 forall x . s(x) | t(x),
170 forall x . s(x) => t(x) & k(c, x),
171 forall x . t(x) => m(x)
174 where c is a constant
177 * =h05q01a= \small{(cont’d)}
181 forall x . s(x) | t(x),
182 forall x . s(x) => t(x) & k(c, x),
183 forall x . t(x) => m(x)
188 * =h05q01a= \small{(cont’d)}
191 1) forall x . s(x) | t(x) premise
192 2) forall x . s(x) => t(x) & k(c, x) premise
193 3) forall x . t(x) => m(x) premise
194 4) s(c) | t(c) by forall_e on 1
195 5) s(c) => t(c) & k(c, c) by forall_e on 2
196 6) t(c) => m(c) by forall_e on 3
198 8) t(c) & k(c, c) by imp_e on 5, 7
199 9) t(c) by and_e on 8
200 10) m(c) by imp_e on 6, 9
203 12) m(c) by imp_e on 6, 11
205 13) m(c) by cases on 4, 7-10, 11-12
210 Is this formula a tautology?
213 |- (exists x . p(x)) => forall y . p(y)
216 * =h05q01b= \small{(cont’d)}
218 No, this formula is not a tautology. Interpretation:
225 ----------------------
230 [(exists x. p(x)) => forall y. p(y)]
231 = (P(a) OR P(b)) IMP (P(a) AND P(b))
232 = (T OR F) IMP (T AND F)
239 Is this argument valid?
242 forall x . p(x) | q(x),
248 * =h05q01d= \small{(cont’d)}
253 forall x . p(x) | q(x), forall x . !p(x) |- forall x . q(x)
255 1) forall x . p(x) | q(x) premise
256 2) forall x . !p(x) premise
258 4) p(xg) | q(xg) by forall_e on 1
260 6) !p(xg) by forall_e on 2
261 7) q(xg) by not_e on 5, 6
264 9) q(xg) by cases on 4, 5-7, 8-8
266 10) forall x. q(x) by forall_i on 3-9
271 - no tutorial next week (Oct 16) (reading week)
272 - no tutorial the week after (Oct 23) (midterm marking)