9 - Propositional Logic

ucla | CS 161 | 2024-02-26 14:22


Table of Contents

Basic Concepts

Syntax

Validity

  • a statement α is valid if ω:ωα
  • otherwise it is invalid: ω,ωα

    Models

  • a model of a logical statement is the set of worlds for which α holds: M(α)={ω:ωα}

    Satisfiability/Consistency

  • a statement is UNSAT (inconsistent) if the statement never holds: ω,ωα
  • a statement is SAT if it is not inconsistent ω,ωα

Relationships between Sentences

Entailment

  • a statement entails another statement if: αβM(α)M(β)

    Equivalence

  • two statements are equivalent if α=βM(α)=M(β)M(α)=M(β)M(α)M(β) AND M(β)M(α)

    Mutual Exclusivity

  • two statements are mutually exclusive if ω, ωα  ωβ M(α)M(β)M(β)M(α)

    Reductions

    Validity to SAT

  • given α is valid, ¬α is unsatisfiable

    Entailment to SAT

Monotonicity of logic

  • trying to “add” a statement to aa set of statements in not possible, i.e., the model cannot adapt
  • e.g., sps KBα and we propose some new knowledge base KB:=KBβKBα i.e. KBαKBβα
  • adding β to the knowledge base did not change our knowledge base, it is still at most the original KB or is smaller

    Normal Forms

    Conjunctive Normal Form (CNF)

  • conjunction of disjunction of literals
  • disjunction:
  • conjunction:
  • a clause - a disjunction of literals
  • the empty clause is unsatisfiable or False
  • e.g., 3-SAT is a CNF

    Complexity

  • CNF SAT is NP-complete
  • NF Validity is Linear
    • check if there is an invalid in each clause

      Disjunctive Normal Form (DNF)

  • disjunction of conjunction of literals
  • a term (conjunctive clause) - a conjunction of literals
  • the empty term = True

    Complexity

  • DNF SAT is Linear
    • bc we could jut check if any of the disjunctions (terms) are true
  • DNF Validity is co-NP-complete (NP-hard)
    • if we try to convert to CNF using conversion rules, worst case distributing over could exponentially blow up the statement

      Horn Clause and Definite Clause

  • conjunction of Horn clauses
  • a Horn clause - a clause with 1 positive literal
  • a definite clause - has only 1 positive literal

    Converting non CNF to CNF

    1. Eliminatee all bidirectional implication
    1. e.g. given BP1P2
    2. (BP1P2)(BP1P2)
      1. Eliminate implication: αβ¬αβ
    3. (¬BP1P2)(B¬(P1P2))
      1. Apply DeMorgan’s
    4. (¬BP1P2)(B(¬P1¬P2))
      1. Distribute over
    5. (¬BP1P2)(B¬P1)(BP2)

Logical Inference

Determine KB?α

Enumerate Models

  • truth table to infer entailment or satisfiability
  • check if the worlds are modeled: M(KB)M(α)

    Deduction

  • We can make logical inferences over some ruleset R KBRα
  • Modus Ponens - if the above are true, then the bottom is true α,αββ
  • E.g., Introduction α,βαβ
  • Add-Reduction αβα,αββ
  • Require knowing the ruleset database

    Refutation

  • if we can prove refutation then we can prove the clauseKBαKB¬αfalse

    Resolution

  • we do so using resolution: if we have ¬AA=
  • e.g., KB={ABCACD α=C
  • we want to observe KB?α
  • we can use refutation to get the clauses: KB¬α={¬A¬BC(1)A(2)¬CD(3)¬C(4)
  • Then we can make some new clause using resolution: KB¬α={¬A¬BC(1)A(2)¬CD(3)¬C(4)¬BC(1+2)(5)...
  • None of the new rule from resolution get to false thus KB¬α is SAT, thus KBα

    SAT Solver (by CSP) - DPLL

  • see if we can find an assignment that makes KB¬α is SAT, if so then KBα
  • else, KB¬α is UNSAT, thus KBα
  • we can find this by drawing a search tree, s.t.: A=f,B=t,C=tKB¬α
  • we can also check arc consistency at each step by propagating the assigned values without taking the full branch to check for SAT