Propositional Logic: Core Concepts and Natural Deduction
Logics: Core Concepts
Artificial Intelligence (AI) Challenge: Formalize intelligence as symbolic reasoning with explicit knowledge representations.
Example: Imagine teaching a computer to play chess. Instead of just showing it games, we give it clear rules like "A knight moves in an L-shape." This is symbolic reasoning.
Knowledge Representation (KR) Challenge: Represent knowledge in computers and use it algorithmically.
Example: How do we tell the computer that "the sky is blue"? We need a way to store that information so it can use it later.
Logic: A theoretical framework for symbolic knowledge expression and reasoning characterization.
Example: Like grammar rules for language, logic provides rules for how we can build true statements and draw conclusions.
Knowledge Base: A set of logical sentences expressing knowledge.
Example: All the rules about chess, plus the current board position, would be a knowledge base for a chess AI.
Common Ingredients of Logics:
Syntax: Rules for constructing well-formed statements.
Example: "It is raining" is a well-formed statement. "Raining it is" is not.
Semantics: Meanings of statements, truth conditions, and what they describe (models).
Example: The meaning of "It is raining" is that water is falling from the sky. It's true if water is falling, and false otherwise.
Inference: Determining when one statement follows from others.
Example: If "It is raining" is true, and "If it is raining, then I need an umbrella" is true, then we can infer "I need an umbrella."
Propositional Logic (PL): Syntax and Semantics
Propositional Logic (PL): Studies basic inference.
Syntax Definition:
Propositional Variables (p.v.s): Basic atomic statements, e.g., , assigned truth-values T (True) or F (False).
Example: Let be "It is raining." Let be "The ground is wet."
Connectives: Used to build complex sentences:
(conjunction, "and")
Example: means "It is raining AND the ground is wet."
(disjunction, "or")
Example: means "It is raining OR the ground is wet (or both)."
(negation, "not")
Example: means "It is NOT raining."
(implication, "if… then…")
Example: means "IF it is raining, THEN the ground is wet."
(equivalence, "if and only if")
Example: means "It is raining IF AND ONLY IF the ground is wet." (This might not always be true in the real world, but it shows the meaning of the connective).
Special p.v.s: (always true), (always false).
Example: could represent "". could represent "".
Semantics Definition:
Truth-Tables: Define the truth-values of complex sentences based on their components (e.g., is true iff both and are true).
Example: For :
If is True and is True, then is True.
If is True and is False, then is False.
If is False and is True, then is False.
If is False and is False, then is False.
Implication (): True if is true, or if is false. Only false when is true and is false.
Example: "IF it rains (), THEN the ground gets wet ()."
If it rains (T) AND the ground gets wet (T), the statement is True.
If it rains (T) BUT the ground is NOT wet (F), the statement is False (this is the only way for an implication to be false).
If it does NOT rain (F) AND the ground gets wet (T), the statement is True (maybe someone watered it).
If it does NOT rain (F) AND the ground is NOT wet (F), the statement is True.
Equivalence (): True iff and have the same truth-value.
Example: "The light is on () IFF the switch is up ()." This statement is true if both and are true, or if both and are false.
Valuations and Logical Equivalence
Valuation (): An assignment of truth-values to propositional variables (; extends to all sentences ().
Example: Let be "It is sunny" and be "I am happy." A valuation could be , . Another valuation could be , .
satisfies (or is a model of ) if .
Example: If our sentence is , then valuation (T,T) satisfies because is True. Valuation (F,T) also satisfies because is True.
Logical Equivalence (): Two sentences have the same meaning if they are true under the same valuations (i.e., ).
Example: The sentence "IF it rains, THEN the ground is wet" () is logically equivalent to "EITHER it does NOT rain OR the ground is wet" (). You can check with a truth table that they are true in exactly the same situations.
Models of a Sentence/Set ( / ): The set of all valuations that satisfy the sentence/all sentences in the set.
Tautology: A sentence true for every possible valuation (e.g., ).
Example: "It is raining OR it is NOT raining." This statement is always true, no matter the weather.
Contradiction: A sentence false for every possible valuation (e.g., ).
Example: "It is raining AND it is NOT raining." This statement is always false, it can't be both.
Satisfiable: A sentence true for at least one valuation ().
Example: "It is raining." This is satisfiable because there are times when it is raining. It's not always true, but it's not always false either.
A sentence is satisfiable iff it is not a contradiction.
A sentence is not satisfiable iff its negation is a tautology.
Logical Inference and Complexity
Logical Consequence (): A conclusion is a logical consequence of a set of premises if every valuation that makes all sentences in true also makes true (i.e., ).
Example: If our premises are {"It's Monday", "If it's Monday, then the store is open"}, then "The store is open" () is a logical consequence. If the premises are true, the conclusion must be true.
Cn(): The set of all logical consequences of .
Inference and Satisfiability: Checking if an inference is valid is equivalent to checking if the sentence is unsatisfiable.
Example: To check if "If it's raining (), then the ground is wet ()" implies "If the ground is not wet (), then it's not raining ()", we would check if is unsatisfiable.
Satisfiability Problem (SAT): Given a PL sentence, is it satisfiable?
Decidable: Yes, an algorithm exists (e.g., truth-table method).
Complexity: In NP (can be verified in polynomial time).
NP-Complete: SAT is NP-complete (Cook's Theorem); finding a polynomial-time algorithm would prove P=NP.
Practical Outlook: Computationally infeasible in the worst case; requires practical SAT-solvers or restricted language fragments.
Natural Deduction and Completeness
Proof-Theoretic Inference (): can be derived from using a system of proof rules (Natural Deduction).
Natural Deduction Rules: Include introduction and elimination rules for connectives (e.g., , (modus ponens), ).
Example: From "It is raining" and "If it is raining, then the ground is wet," we can use the (Modus Ponens) rule to derive "The ground is wet."
Derived rules include Modus Tollens (MT) and the Law of Excluded Middle (LEM).
Theorem: A sentence is a theorem if it can be derived without premises ().
Example: (It is raining or it is not raining) is a theorem because it can be proven universally true without needing any starting assumptions.
Inconsistent: A sentence is inconsistent if a contradiction () can be derived from it ().
Example: The sentence "I am alive and I am not alive" is inconsistent because it leads to a contradiction.
Completeness Theorem for PL (): The proof-theoretic () and model-theoretic () inference relations are equivalent.
Soundness Theorem (): Proof rules never lead from true premises to false conclusions.
Example: If we follow all the rules of logic correctly, we'll never prove something false from true statements.
Completeness Theorem (): Proof rules are sufficient to capture all valid logical consequences.
Example: If something is a logical consequence (true in all models), then there is a way to prove it using our rules.
Consequences: Consistent = Satisfiable; Theorems = Tautologies.
Horn Logic: A Tractable Fragment
Horn Clause: A sentence of the form , where and are propositional variables ().
Example: "IF (the alarm rings AND it's a weekday), THEN I wake up." ()
Fact: A Horn clause with (e.g., ).
Example: "The light is on." (). This is a fact because it doesn't depend on any other conditions.
Integrity Constraint: A Horn clause with (e.g., ).
Example: "IF (I am sleeping AND the alarm is ringing loudly), THEN there is a problem." (). This means it's an undesirable situation because it leads to a contradiction.
Horn Sentence: A conjunction of Horn clauses.
Limited Expressiveness: Cannot express implications whose conclusion is a disjunction of p.v.s.
Example: Cannot express "IF it rains, THEN the ground is wet OR I stay inside." (Cannot have ). Conclusions in Horn clauses must be a single propositional variable or .
Tractability: Reasoning in Horn Logic is tractable, unlike full PL.
Example: Finding solutions or checking consequences in Horn Logic is much faster for computers than in general Propositional Logic.
Consensus Valuation (): A valuation where a variable is true iff it's true in both and .
Example: If says "P is True, Q is False" and says "P is True, Q is True", then their consensus valuation would say "P is True, Q is False." (Only what they both agree is true remains true).
Theorem: A set of valuations is the set of models for some Horn sentence iff is closed under consensus.
Trade-off: Horn Logic offers tractability at the cost of limited expressiveness.