9 - Propositional Logic
ucla | CS 161 | 2024-02-26 14:22
Table of Contents
- Basic Concepts
- Relationships between Sentences
- Reductions
- Monotonicity of logic
- Normal Forms
- Logical Inference
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: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:
Equivalence
- two statements are equivalent if
Mutual Exclusivity
- two statements are mutually exclusive if
Reductions
Validity to SAT
- given
is valid, is unsatisfiableEntailment 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
and we propose some new knowledge base i.e. - adding
to the knowledge base did not change our knowledge base, it is still at most the original KB or is smallerNormal 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
- 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)
- conjunction of Horn clauses
- a Horn clause - a clause with
positive literal - a definite clause - has only 1 positive literal
Converting non CNF to CNF
- Eliminatee all bidirectional implication
- e.g. given
- Eliminate implication:
- Eliminate implication:
- Apply DeMorgan’s
- Distribute
over
- Distribute
Logical Inference
Determine
Enumerate Models
- truth table to infer entailment or satisfiability
- check if the worlds are modeled:
Deduction
- We can make logical inferences over some ruleset
- 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 clause
Resolution
- we do so using resolution: if we have
- e.g.,
- we want to observe
- we can use refutation to get the clauses:
- Then we can make some new clause using resolution:
- None of the new rule from resolution get to
thus is SAT, thusSAT Solver (by CSP) - DPLL
- see if we can find an assignment that makes
is SAT, if so then - else,
is UNSAT, thus - we can find this by drawing a search tree, s.t.:
- we can also check arc consistency at each step by propagating the assigned values without taking the full branch to check for SAT