Propositional Logic: Syntax, Semantics, and Complexity
Introduction
This document delves into the foundational aspects of propositional logic, encompassing its syntax, semantics, and the complexity of associated computational problems. We will investigate the construction of propositional formulas, the evaluation of their truth values, and the computational intricacies involved in determining their satisfiability and validity. The primary goals are to grasp the structure of propositional logic, master the evaluation of formulas, and analyze the complexity of model checking and satisfiability problems. Key concepts that will be explored include propositional letters, logical connectives, syntax trees, truth assignments, model checking, satisfiability (SAT), and normal forms. This exploration will provide a solid understanding of propositional logic and its computational properties.
Vocabulary and Syntax
The vocabulary of propositional logic consists of:
Propositional letters (or Boolean variables): \(P, Q, R, \dots\) These letters represent statements that can be either true or false.
Boolean connectives: \(\land\) (conjunction), \(\lor\) (disjunction), \(\neg\) (negation), \(\to\) (implication), \(\leftrightarrow\) (double implication). These symbols are used to combine or modify propositional letters to form more complex formulas.
The signature \(\Sigma\) is the subset of the vocabulary that is not pre-interpreted. In propositional logic, it typically consists of the set of propositional letters used in a formula. For example, if a formula uses the letters \(P\), \(Q\), and \(R\), the signature is \(\Sigma = \{P, Q, R\}\).
The syntax of propositional logic defines the rules for constructing well-formed formulas (wffs). It can be represented by the following grammar: \[\begin{aligned} \phi ::= & P \mid Q \mid R \mid \dots \quad \text{(propositional letters)} \\ & | \neg \phi \quad \text{(negation)} \\ & | \phi \land \phi \quad \text{(conjunction)} \\ & | \phi \lor \phi \quad \text{(disjunction)} \\ & | \phi \to \phi \quad \text{(implication)} \\ & | \phi \leftrightarrow \phi \quad \text{(double implication)} \end{aligned}\] This grammar specifies how complex formulas can be built from simpler ones using Boolean connectives.
An example of a propositional formula is: \[\phi = (P \land \neg Q) \lor (\neg Q \land \neg R)\]
Formulas can be represented as strings with parentheses to avoid ambiguity. Alternatively, they can be represented as trees, where internal nodes are operators and leaves are propositional letters. Both representations are equivalent, but the tree representation can be more intuitive for understanding the structure of a formula.
The formula \(\phi = (P \land \neg Q) \lor (\neg Q \land \neg R)\) can be represented as a tree:
This tree visually represents the structure of the formula, making it easier to see the relationships between the different parts.
Semantics
The semantics of propositional logic is defined by a function (also called an interpretation or structure) that maps each propositional letter to a truth value. This function is represented as: \[S: \Sigma \to \{0, 1\}\] where \(\Sigma\) is the signature (the set of propositional letters) and 0 represents false and 1 represents true.
Given the structure \(S\) where \(S(P) = 1\), \(S(Q) = 0\), and \(S(R) = 1\), we can evaluate the formula \(\phi = (P \land \neg Q) \lor (\neg Q \land \neg R)\) as follows:
\(S(P) = 1\)
\(S(Q) = 0\)
\(S(R) = 1\)
\(S(\neg Q) = \neg S(Q) = \neg 0 = 1\)
\(S(\neg R) = \neg S(R) = \neg 1 = 0\)
\(S(P \land \neg Q) = S(P) \land S(\neg Q) = 1 \land 1 = 1\)
\(S(\neg Q \land \neg R) = S(\neg Q) \land S(\neg R) = 1 \land 0 = 0\)
\(S((P \land \neg Q) \lor (\neg Q \land \neg R)) = S(P \land \neg Q) \lor S(\neg Q \land \neg R) = 1 \lor 0 = 1\)
Thus, the formula \(\phi\) is true under the structure \(S\). This evaluation is done by structural induction on the formula, starting from the leaves of the syntax tree and working upwards.
A structure \(S\) is a model of a formula \(\phi\) (denoted as \(S \models \phi\)) if the formula \(\phi\) evaluates to true under the interpretation \(S\). If \(\phi\) evaluates to false under the structure \(S\), we write \(S \not\models \phi\). In other words, a model is an interpretation that satisfies the formula.
Computational Problems
Model Checking
Given a formula \(\phi\) and a structure \(S\), the model checking problem is to determine whether \(S \models \phi\), i.e., whether the structure \(S\) satisfies the formula \(\phi\).
Input: Formula \(\phi\), Structure \(S\) Output: True if \(S \models \phi\), False otherwise
\(S(P)\) \(\neg\) \(\land\) \(\lor\) \(\neg\) \(\lor\) ( \(\land\) ) \(\lor\) (\(\neg\) \(\land\) \(\neg\))
The model checking problem for propositional logic can be solved in polynomial time, specifically in linear time with respect to the size of the formula.
Proof. Proof. The algorithm evaluates the formula by recursively evaluating its subformulas (lines [line:negation]-[line:double_implication]). Each connective is processed in constant time, and each subformula is processed exactly once. Therefore, the time complexity is linear in the number of nodes in the formula tree, which corresponds to the size of the formula. ◻
The model checking problem for propositional logic is P-complete, meaning it is one of the hardest problems solvable in polynomial time. Every problem solvable in polynomial time can be reduced to the model checking problem in polynomial time. This problem is also known as the "evaluation problem" (EVAL).
Satisfiability (SAT)
Given a formula \(\phi\), the satisfiability problem (SAT) is to determine whether there exists a structure \(S\) such that \(S \models \phi\). In other words, is there a truth assignment to the propositional letters that makes the formula true?
Input: Formula \(\phi\) Output: True if \(\phi\) is satisfiable, False otherwise
\(\Sigma \gets \{P_1, P_2, \dots, P_n\}\) (propositional letters in \(\phi\)) True False
The satisfiability problem (SAT) for propositional logic is NP-complete.
Proof. Proof. The problem is in NP because a non-deterministic algorithm can guess a truth assignment (a structure \(S\)) and then verify in polynomial time whether it satisfies the formula using the model checking algorithm (Algorithm [alg:model_checking]). It is NP-hard because any problem in NP can be reduced to SAT in polynomial time. ◻
Algorithm [alg:satisfiability] has a time complexity of \(O(2^n \cdot |\phi|)\), where \(n\) is the number of propositional letters in \(\phi\) and \(|\phi|\) is the size of the formula. This is because there are \(2^n\) possible truth assignments (line [line:for_loop_assignments]), and for each assignment, we perform a model check (line [line:model_check_call]), which takes linear time in the size of the formula.
Input: Formula \(\phi\) Output: True if \(\phi\) is satisfiable, False otherwise \(\Sigma \gets \{P_1, P_2, \dots, P_n\}\) (propositional letters in \(\phi\)) Non-deterministically guess a truth assignment \(S: \Sigma \to \{0, 1\}\) True False
While SAT is NP-complete, meaning that it is unlikely to have a deterministic polynomial-time solution, there are efficient SAT solvers that can handle formulas with millions of variables in practice. These solvers use sophisticated algorithms and heuristics to prune the search space.
Economy of the Syntax and Normal Forms
Removing Implication and Double Implication
Any propositional formula \(\phi\) can be transformed into an equivalent formula \(\phi'\) without implication (\(\to\)) and double implication (\(\leftrightarrow\)) operators.
Proof. Proof. We can replace each occurrence of \(\phi_1 \to \phi_2\) with \(\neg \phi_1 \lor \phi_2\), and each occurrence of \(\phi_1 \leftrightarrow \phi_2\) with \((\neg \phi_1 \lor \phi_2) \land (\neg \phi_2 \lor \phi_1)\). This is done by structural induction on the formula. ◻
Removing these operators, especially the double implication, may result in an exponential increase in the size of the formula. This is because each replacement of \(\leftrightarrow\) can approximately double the size of the subformula it operates on.
Consider the formula \(\phi = P_1 \leftrightarrow (P_2 \leftrightarrow (P_3 \leftrightarrow P_4))\). If we repeatedly apply the transformation to remove \(\leftrightarrow\), the formula will grow exponentially.
Negation Normal Form (NNF)
A formula is in Negation Normal Form (NNF) if negations (\(\neg\)) appear only immediately in front of propositional letters, and the only connectives used are \(\land\) and \(\lor\).
Any propositional formula \(\phi\) without implication and double implication can be transformed into an equivalent formula \(\phi'\) in Negation Normal Form (NNF) in linear time.
Proof. Proof. We can use De Morgan’s laws and the double negation law to push negations inward:
\(\neg (\phi_1 \land \phi_2) \equiv \neg \phi_1 \lor \neg \phi_2\)
\(\neg (\phi_1 \lor \phi_2) \equiv \neg \phi_1 \land \neg \phi_2\)
\(\neg \neg \phi \equiv \phi\)
Each application of these rules moves negations inward by one level in the formula tree, and each rule only increases the formula size by a constant amount. Thus, the total increase in size is linear in the size of the original formula. ◻
Input: Formula \(\phi\) (without \(\to\) and \(\leftrightarrow\)) Output: Equivalent formula \(\phi'\) in NNF
\(P\) \(\neg P\) \(\land\) \(\lor\) \(\lor\) \(\land\)
Conjunctive Normal Form (CNF)
A formula is in Conjunctive Normal Form (CNF) if it is a conjunction of clauses, where each clause is a disjunction of literals (a literal is a propositional letter or its negation). In other words, a CNF formula has the form: \[\bigwedge_i \left( \bigvee_j l_{ij} \right)\] where each \(l_{ij}\) is a literal.
\((P \lor \neg Q \lor R) \land (\neg P \lor \neg R) \land (P \lor Q)\) is in CNF.
Any propositional formula \(\phi\) without double implication can be transformed into an equisatisfiable formula \(\phi'\) in Conjunctive Normal Form (CNF) in polynomial time.
The transformation to CNF may result in an exponential increase in the size of the formula if logical equivalence is required. However, preserving equisatisfiability can be done more efficiently.
Two formulas \(\phi\) and \(\psi\) are equisatisfiable if \(\phi\) is satisfiable if and only if \(\psi\) is satisfiable. Formally, \(\phi\) and \(\psi\) are equisatisfiable if: \[\exists S \text{ such that } S \models \phi \iff \exists S' \text{ such that } S' \models \psi\]
Equisatisfiability does not imply logical equivalence. For example, \(\phi\) might be true in structure \(S_1\) and false in \(S_2\), while \(\psi\) is true in both \(S_1\) and \(S_2\). However, if \(\phi\) is satisfiable, then \(\psi\) is also satisfiable, and vice versa.
The transformation from a SAT problem in full propositional logic (without double implication) to a SAT problem in CNF can be viewed as a polynomial-time reduction.
Detail missing: The teacher’s explanation of the reduction from SAT to CNF-SAT is incomplete. Further details are needed to fully understand the process and implications of this reduction. The reduction is not explained in the transcript.
Conclusion
In this lecture, we covered the fundamentals of propositional logic, including its syntax and semantics. We discussed how to evaluate propositional formulas using truth assignments and explored the computational complexity of model checking and satisfiability problems. Model checking for propositional logic is solvable in polynomial time and is P-complete, while the satisfiability problem (SAT) is NP-complete. We also examined various normal forms, such as Negation Normal Form (NNF) and Conjunctive Normal Form (CNF), and discussed their transformations and implications for formula size and complexity.
Model checking is computationally easier than satisfiability. The former is in P and is P-complete, while the latter is NP-complete.
SAT is a fundamentally important problem in computer science with wide-ranging applications, including hardware and software verification, artificial intelligence, and operations research.
Normal forms like NNF and CNF are crucial for simplifying formulas and developing efficient algorithms. Many SAT solvers operate on formulas in CNF.
Removing implication and double implication can lead to an exponential blow up in formula size
Transforming a formula to NNF can be done in linear time
Transforming a formula to CNF while preserving equivalence may lead to an exponential blow up in formula size. However, it is possible to transform any formula into an equisatisfiable formula in CNF in polynomial time.
How can we prove that any problem in NP can be reduced to SAT in polynomial time (Cook’s Theorem)?
What are some practical algorithms used in modern SAT solvers (e.g., DPLL, CDCL)?
How do we handle the exponential blow-up when converting formulas to CNF while preserving equivalence?
Can we explore the concept of equisatisfiability further and its implications for problem reductions and transformations?
What is the significance of the P vs. NP problem, and how does it relate to SAT and other NP-complete problems?
What is the complete explanation of the reduction from SAT to CNF-SAT