Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.51 KB

DPLL-Satisfiable.md

File metadata and controls

25 lines (20 loc) · 1.51 KB

DPLL-SATISFIABLE?

AIMA3e

function DPLL-SATISFIABLE?(s) returns true or false
inputs: s, a sentence in propositional logic.

clauses ← the set of clauses in the CNF representation of s
symbols ← a list of the proposition symbols in s
return DPLL(clauses, symbols, { })


function DPLL(clauses, symbols, model) returns true or false

if every clause in clauses is true in model then return true
if some clause in clauses is false in model then return false
P, value ← FIND-PURE-SYMBOL(symbols, clauses, model)
if P is non-null then return DPLL(clauses, symbols - P, model ∪ {P = value})
P, value ← FIND-UNIT-CLAUSE(clauses, model)
if P is non-null then return DPLL(clauses, symbols - P, model ∪ {P = value})
P ← FIRST(symbols); rest ← REST(symbols)
return DPLL(clauses, rest, model ∪ {P = true}) or
    DPLL(clauses, rest, model ∪ {P = false})


Figure ?? The DPLL algorithm for checking satisfiability of a sentence in propositional logic. The ideas behind FIND-PURE-SYMBOL and FIND-UNIT-CLAUSE are described in the text; each returns a symbol (or null) and the truth value to assign to that symbol. Like TT-ENTAILS?, DPLL operates over partial models.