Version without JavaScript, read-only: workshops, quizzes and running code are not available here. Full version · Catalogue · Sign in
Exercise sheet 1
Reading and writing formulas
Parentheses, precedence, syntax trees, and the boundary between formulas and statements about formulas. Chapter 1.
The conventions are those of chapter 1: $\lnot > \land > \lor > \to > \leftrightarrow$, and $\to$ associates to the right.
Solution
- $\lnot\lnot p \to q \lor r$
- $\lnot(\lnot p \to q \lor r)$. The negation applies to the whole implication: its parentheses stay.
- $p \land q \lor r \to p \to q$. All the parentheses go: since $\to$ associates to the right, $\ldots \to p \to q$ does read as $\ldots \to (p \to q)$. The trap is to believe they are needed; the tree settles it.
- $(p \to q) \to r$. Here the parentheses are compulsory: $p \to q \to r$ would read $p \to (q \to r)$.
- $\lnot(p \land q) \leftrightarrow \lnot p \lor \lnot q$
Solution
- $(((p \to (q \lor r)) \land (q \to r)) \to (p \to r))$. Main connective: the middle $\to$.
- $((((\lnot p) \land q) \to r) \leftrightarrow ((\lnot r) \to ((\lnot q) \lor p)))$. Main connective: $\leftrightarrow$, the one with the lowest precedence.
- $(p \to (q \to (r \to s)))$. Main connective: the first $\to$.
Solution
- Root $\to$; on the left $\lnot$ above $\land(p, q)$; on the right $\lor$ above $\lnot p$ and $\lnot q$.
- $A$, $\lnot(p \land q)$, $p \land q$, $\lnot p \lor \lnot q$, $\lnot p$, $\lnot q$, $p$, $q$ (the occurrences of $p$ and of $q$ give the same subformulas).
- Connectives: $\to, \lnot, \land, \lor, \lnot, \lnot$, that is 6, of which 3 are binary. Occurrences of variables: 4. In a tree where each binary connective has two children, there is always one more leaf than there are binary connectives: $4 = 3 + 1$. The $\lnot$ do not change this count.
Solution
- Formula.
- Statement, true: every model of $p$ makes $p \lor q$ true.
- Statement, false: the right-hand side is equivalent to $q$, and $p \not\equiv q$. The formula that was probably meant is $p \leftrightarrow (p \land q) \lor (\lnot p \land q)$; one can ask whether it is valid.
- Statement, true: the right-hand side is equivalent to $p \lor q$.
- Neither: no rule produces $p \land \lor q$.
- Statement, true: $p \to p$ is valid.
Solution
- $p \to q$
- $r \to p$ (“only if”: the necessary condition is on the right).
- $\lnot\lnot p \to q$, that is $p \to q$: the same thing as sentence 1.
- $\lnot p \land r$
- $\lnot r \land \lnot q$