DPLL, First-Order Logic




CS156

Chris Pollett

Mar 30, 2015

Outline

Introduction

Look at last slide before Midterm

Horn Clauses and Definite Clauses

Prolog

A Prolog Example Logic Program

Consider the Horn program:

a. /* lines end with a period, a rule without a tail is called a fact */
b:- a.
c:-b.
d:- a, b.

How Prolog computes its answers

Quiz

Which of the following is true?

  1. Model checking can be done in polynomial time in the number of variables for a boolean-valued knowledge base.
  2. One proof system we considered but didn't give a name to (Natural Deduction) consists of knowledge base statement, equivalences, Modus Ponens and rules of inference based on the logical equivalences we went over.
  3. If a statement in propositional logic is valid then it has a resolution refutation.

DPLL Algorithm: A general resolution finding algorithm

DPLL Algorithm

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 propositional 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); //symbols is a list, this get the first element in the list into P
   rest = REST(symbols); //all the elements in the list excluding the first element
   return DPLL(clauses, rest, model ∪ {P=true}) or
       DPLL(clauses, rest, model ∪ {P=false})

First-Order Logic

Examples