Mini-project II

Published

24 April 2026

Question 1

The truth table for the negation of Exercise 1.2.14 from Rosen’s book, i.e. the formula \(\lnot((\lnot p \land (p \to q)) \to \lnot q)\), is shown below.

\(p\) \(q\) \(\lnot p\) \(p\to q\) \(\lnot p \land (p \to q)\) \(\lnot q\) \((\lnot p \land (p \to q)) \to \lnot q\) \(\lnot((\lnot p \land (p \to q)) \to \lnot q)\)
T T F T F F T F
T F F F F T T F
F T T T T F F T
F F T T T T T F

The table shows that \(\lnot((\lnot p \land (p \to q)) \to \lnot q)\) is satisfiable. Specifically, The two leftmost columns and the rightmost column show that the formula is satisfied when \(p\) is true and \(q\) is false.

This can be expressed as the function \(\upsilon\) with domain {\(p,q,\lnot,\land,\to\)}, codomain {\(0,1\)} and the following mapping:
\(\upsilon(\lnot x)\) = 1 if \(\upsilon(x)\) = 0, and 0 otherwise.
\(\upsilon(x \land y)\) = 1 if \(\upsilon(x)\) = 1 and \(\upsilon(y)\) = 1, and 0 otherwise.
\(\upsilon(x \to y)\) = 0 if \(\upsilon(x)\) = 1 and \(\upsilon(y)\) = 0, and 1 otherwise.

Question 2

The function \(\upsilon(x \lor y)\) can be expressed in set-theoretic notation as

\(\{ B_1, \ldots, B \cup \{ \phi\lor\psi \}, \ldots, B_i \} \leadsto \{ \{ B_1, \ldots, B \cup \{ \phi \}, \ldots, B_i \}, \{ B_1, \ldots, B \cup \{ \psi \}, \ldots, B_i \} \}\)

NoteCorrection #1

The above expression contains two errors (as pointed out in feedback):

Error #1: The syntax confused branches and formulas.

Error #2: Derived formulas should be negated.

Corrected expression:

\(\{ B_1, \ldots, B \cup \{ \phi\lor\psi \}, \ldots, B_i \} \leadsto \{ B_1, \ldots, B \cup \{ \lnot\phi \}, B \cup \{ \lnot\psi \}, \ldots, B_i \}\)

and the function \(\upsilon(x \to y)\) can be expressed as

\(\{ B_1, \ldots, B \cup \{ \phi\to\psi \}, \ldots, B_i \} \leadsto \{ \{ B_1, \ldots, B \cup \{ \lnot\phi \}, \ldots, B_i \}, \{ B_1, \ldots, B \cup \{ \psi \}, \ldots, B_i \} \}\)

NoteCorrection #2

The above expression contains one error (as pointed out in feedback):

Error #1: The syntax confused branches and formulas.

Corrected expression:

\(\{ B_1, \ldots, B \cup \{ \phi\to\psi \}, \ldots, B_i \} \leadsto \{ B_1, \ldots, B \cup \{ \lnot\phi \}, B \cup \{ \psi \}, \ldots, B_i \}\)

Question 3

NoteAddition #1

Obtaining a complete tableau by applying tableau rules can be described in pseudecode like this:

\begin{algorithm} \caption{TableauCompletion} \begin{algorithmic} \Procedure{TableauCompletion}{$\tau$} \If{$\tau \in \emptyset$} \Return $\tau$ \Comment{tableau is closed} \EndIf \Repeat \State $\rho \gets \tau$ \State $\rho \gets$ \Call{DropInconsistencies}{$\rho$} \State $\rho \gets$ \Call{ApplyUnibranchRules}{$\rho$} \Until{$\rho = \tau$}\Comment{deplete non-branching changes first} \State $\rho \gets$ \Call{ApplyBranchingRules}{$\rho$} \If{$\rho = \tau$} \Return $\rho$ \Comment{tableau is open and complete} \EndIf \State \Call{TableauCompletion}{$\rho$} \EndProcedure \Procedure{DropInconsistencies}{$\tau$} \State $\rho \gets \tau$ \ForAll{$n \in \{1, \dots, i \gets |\rho|\}$ where $\{B_1, \dots, B_i\} \in \rho$} \If{\Call{BranchIsInconsistent}{$B_n$}} \State $\rho \gets \{ B_1, \dots, B_{n-1}, B_{n+1}, \dots, B_i \}$ \EndIf \EndFor \Return $\rho$ \EndProcedure \Procedure{ApplyUnibranchRules}{$\tau$} \State $\rho \gets \tau$ \ForAll{$n \in \{1, \dots, i \gets |\rho|\}$ where $\{B_1, \dots, B_i\} \in \rho$} \ForAll{$m \in \{1, \dots, j \gets |B_n|\}$ where $\{F_1, \dots, F_j\} \in B_n$} \If{$\{\phi\} \gets$ \Call{RuledUnibranchFormula}{$F_m$}} \State $B_n \gets \{ F_1, \dots, F_{m-1}, \phi, F_{m+1}, \dots, F_i \}$ \EndIf \EndFor \EndFor \Return $\rho$ \EndProcedure \Procedure{ApplyBranchingRules}{$\tau$} \ForAll{$n \in \{1, \dots, i \gets |\tau|\}$ where $\{B_1, \dots, B_i\} \in \tau$} \ForAll{$m \in \{1, \dots, j \gets |B_n|\}$ where $\{F_1, \dots, F_j\} \in B_n$} \If{$\{\phi, \psi\} \gets$ \Call{RuledBranchingFormulas}{$F_m$}} \State $B_n' \gets \{ F_1, \dots, F_{m-1}, \phi, F_{m+1}, \dots, F_i \}$ \State $B_n'' \gets \{ F_1, \dots, F_{m-1}, \psi, F_{m+1}, \dots, F_i \}$ \Return $\{B_1, \dots, B_{n-1}, B_n', B_n'', B_{n+1}, \dots, B_i \}$ \EndIf \EndFor \EndFor \Return $\tau$ \EndProcedure \end{algorithmic} \end{algorithm}
\begin{algorithm} \begin{algorithmic} \Procedure{BranchIsInconsistent}{$B$} \ForAll{$n \in \{1, \dots, i \gets |B|\}$ where $\{F_1, \dots, F_i\} \in B$} \If{ $|F_n| > 2$ \And \Call{Symbols}{$F_n, 1$} $= \lnot$ \And \Call{Symbols}{$F_n, 2$} $\neq \lnot$ } \State $contradiction \gets$ \Call{Symbols}{$F_n, 2 \dots |F_n|$} \ForAll{$m \in \{1, \dots, j \gets |B|\}$ where $\{F_1, \dots, F_j\} \in B$} \If{$F_m = contradiction$} \Return \True \EndIf \EndFor \EndIf \EndFor \Return \False \EndProcedure \Procedure{RuledUnibranchFormula}{$F$} \If{ $|F_n| > 2$ \And \Call{Symbols}{$F_n, 1 \dots 2$} $= \lnot\lnot$ } \Comment{$\lnot\lnot$} \Return \{\Call{Symbols}{$F_n, 3 \dots |F_n|$}\} \ElsIf{$\dots$} \State $\dots$ \Else \State $\dots$ \EndIf \Return $\emptyset$ \EndProcedure \Procedure{RuledBranchingFormulas}{$B$} \If{$\dots$} \State $\dots$ \ElsIf{$\dots$} \State $\dots$ \Else \State $\dots$ \EndIf \Return $\emptyset$ \EndProcedure \end{algorithmic} \end{algorithm}

Each round of the while-loop beginning at line 2 either drops a branch, applies rules to a branch, or ends the function. Every rule reduces the length of involved formulas, which means it is certain to eventually stop with either a set of irreducible branches or the empty set of branches.

Question 4

NoteAddition #2

\[\begin{align*} && \{ \lnot p \land p \land \lnot q \} &\leadsto \{ \lnot p, p \land \lnot q \} && \\ && &\leadsto \{ \lnot p, p, \lnot q \} && \end{align*}\]

Question 5

TODO