Chapter 1: The Foundations: Logic and Proofs
Q55E
How many different truth tables of compound propositions are there that involve the propositional variables p and q.
Q56E
Show that if p,q and r are compound propositions such that p and qare logically equivalent and q and rare logically equivalent, then pand r are logically equivalent.
Q56E
Given the Prolog facts in Example 28, what would Prolog
return when given these queries?
a) ?enrolled(kevin,ee222)
b) ?enrolled(kiko,math273)
c) ?instructor(grossman,X)
d) ?instructor(X,cs301)
e) ?teaches(X,kevin)
Q57E
Suppose that Prolog facts are used to define the predicates mother and father ,which represent that Mis the mother of Yand Fis the father of X, respectively. Give a Prolog rule to define the predicate sibling , which represents that Xand Yare siblings (that is, have the same mother and the same father).
Q57E
The following sentence is taken from the specification of a telephone system: “If the directory database is opened, then the monitor is put in a closed state, if the system is not in its initial state.” This specification is hard to understand because it involves two conditional statements. Find an equivalent, easier-to-understand specification that involves disjunctions and negations but not conditional statements.
Q58E
Suppose that Prolog facts are used to define the predicates motherand fatherwhich represent that Mis the mother of Yand Fis the father of X, respectively. Give a Prolog rule to define the predicate grandfather ,which represents that Xis the grandfather of Y. [Hint: You can write a disjunction in Prolog either by using a semicolon to separate predicates or by putting these predicates on separate lines.]
Q58E
How many of the disjunctions and can be made simultaneously true by an assignment of truth values to p,q and r ?
Q59E
Let andbe the statements “xis a professor,” “xis ignorant,” and “xis vain,” respectively. Express each of these statements using quantifiers; logical connectives; andandwhere the domain consists of all people.
a) No professors are ignorant.
b) All ignorant people are vain.
c) No professors are vain.
d) Does (c) follow from (a) and (b)?
Q59E
How many of the disjunctions and can be made simultaneously true by an assignment of truth values to p,q,r and s?
Q5E
Use a truth table to verify the distributive law.