Abstract DPLL and Abstract DPLL Modulo Theories Robert Nieuwenhuis 1 - - PowerPoint PPT Presentation

abstract dpll and abstract dpll modulo theories
SMART_READER_LITE
LIVE PREVIEW

Abstract DPLL and Abstract DPLL Modulo Theories Robert Nieuwenhuis 1 - - PowerPoint PPT Presentation

Abstract DPLL and Abstract DPLL Modulo Theories Robert Nieuwenhuis 1 , Albert Oliveras 1 , and Cesare Tinelli 2 1 Technical University of Catalonia 2 The University of Iowa Abstract DPLL and Abstract DPLL Modulo Theories p.1/24 Overview of


slide-1
SLIDE 1

Abstract DPLL and Abstract DPLL Modulo Theories

Robert Nieuwenhuis1, Albert Oliveras1, and Cesare Tinelli2

1 Technical University of Catalonia 2 The University of Iowa

Abstract DPLL and Abstract DPLL Modulo Theories – p.1/24

slide-2
SLIDE 2

Overview of the talk

Motivation: SAT and SMT Proposititonal case The Basic DPLL System The DPLL System SMT case Very Lazy Theory Learning Lazy Theory Learning Theory propagation

Abstract DPLL and Abstract DPLL Modulo Theories – p.2/24

slide-3
SLIDE 3

Propositional satisfiability: SAT

Deciding the satisfiability of a propositional

formula is a very important problem

Theoretical interest: first established

NP-Complete problem, phase transition, ...

Practical interest: applications to scheduling,

planning, logic synthesis, verification,...

Successful procedure: DPLL + backumping

+ learning

Abstract DPLL and Abstract DPLL Modulo Theories – p.3/24

slide-4
SLIDE 4

Satisfiablity Modulo Theories

Some problems are more naturally expressed

in other logics

Pipelined microprocessors: logic EUF,

atoms are f (g(a, b), c) = g(c, a)

Timed automata: separation logic, atoms

are a < b + 2

Software verification: combination of

theories, e.g. 5 + car(a + 2) = cdr(a + 1)

Deciding the satisfiability of a (ground)

formula with respect to a background theory has lots of applications (SMT problem)

Abstract DPLL and Abstract DPLL Modulo Theories – p.4/24

slide-5
SLIDE 5

Lifting SAT to SMT

Eager approach: obtain an equisatisfiable

propositional formula and use a SAT solver (UCLID)

Lazy approach: abstract the formula into a

propositional one and use a theory decision procedure to refine it (CVC, ICS, MathSAT, TSAT++, ...)

DPLL(T): smarter way to use the theory

information

Abstract DPLL and Abstract DPLL Modulo Theories – p.5/24

slide-6
SLIDE 6

Overview of the talk

Motivation: SAT and SMT Proposititonal case The Basic DPLL System The DPLL System SMT case Very Lazy Theory Learning Lazy Theory Learning Theory propagation

Abstract DPLL and Abstract DPLL Modulo Theories – p.6/24

slide-7
SLIDE 7

The Basic DPLL Procedure

Tries to incrementally build a model M for the

CNF formula F.

M is augmented by deciding a literal or

deducing one from M and F.

When a wrong decision is detected, the

procedure backtracks. We will model it with a transition system between states: M || F = ⇒ M′ || F′

Abstract DPLL and Abstract DPLL Modulo Theories – p.7/24

slide-8
SLIDE 8

The Basic DPLL System

Extending the model:

UnitProp M || F, C ∨ l = ⇒ M l || F, C ∨ l if    M | = ¬C l is undefined in M Decide M || F = ⇒ M ld || F if    l or ¬l occurs in F l is undefined in M

Abstract DPLL and Abstract DPLL Modulo Theories – p.8/24

slide-9
SLIDE 9

The Basic DPLL System

Repairing the model:

Fail M || F, C = ⇒ fail if    M | = ¬C M contains no decision literals Backjump M ld N || F = ⇒ M l′ || F if              for some clause C ∨ l′ : F | = C ∨ l′ and M | = ¬C l′ is undefined in M l′ or ¬l′ occurs in F

Abstract DPLL and Abstract DPLL Modulo Theories – p.9/24

slide-10
SLIDE 10

Basic DPLL System - Example

∅ || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ (Decide) 1 || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ (UnitProp) 1 2 || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ (Decide) 1 2 3 || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ (UnitProp) 1 2 3 4 || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ (Decide) 1 2 3 4 5 || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ (UnitProp) 1 2 3 4 5 6 || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ (Backjump) 1 2 5 || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ . . .

Abstract DPLL and Abstract DPLL Modulo Theories – p.10/24

slide-11
SLIDE 11

Basic DPLL System - Example

. . . 1 2 3 4 5 6 || 1∨2, 3∨4, 5∨6, 6∨5∨2 = ⇒ (Backjump) 1 2 5 || 1∨2, 3∨4, 5∨6, 6∨5∨2

In this case F | = 1∨5 we have by resolution

1∨2 6∨5∨2 1∨6∨5 5∨6 1∨5

and before deciding 3, we could have deduced 5.

Abstract DPLL and Abstract DPLL Modulo Theories – p.11/24

slide-12
SLIDE 12

Basic DPLL System-Correctness

∅ || F =

⇒! fail iff F is unsatisfiable

∅ || F =

⇒! M || F iff F is satisfiable

Key ingredients:

All rules decrease with respect to a

well-founded ordering between states

When M falsifies a clause in F, either Fail or

Backjump apply.

Abstract DPLL and Abstract DPLL Modulo Theories – p.12/24

slide-13
SLIDE 13

The DPLL System

Learning and forgetting clauses:

Learn M || F = ⇒ M || F, C if    all atoms of C occur in F F | = C Forget M || F, C = ⇒ M || F if F | = C

The DPLL system terminates if no clause is learned/forgotten infinitely often

Abstract DPLL and Abstract DPLL Modulo Theories – p.13/24

slide-14
SLIDE 14

The DPLL system - Strategies

Applying one rule of the Basic DPLL system

between each two Learn ensures termination

In practice, Learn is usually (but not only)

applied right after Backjump.

A common strategy is to apply the rules using

the following priorities:

  • 1. If there is a clause in F which is false in M

apply Fail or Backjump + Learn

  • 2. Apply UnitProp
  • 3. Apply Decide

Abstract DPLL and Abstract DPLL Modulo Theories – p.14/24

slide-15
SLIDE 15

Overview of the talk

Motivation: SAT and SMT Proposititonal case The Basic DPLL System The DPLL System SMT case Very Lazy Theory Learning Lazy Theory Learning Theory propagation

Abstract DPLL and Abstract DPLL Modulo Theories – p.15/24

slide-16
SLIDE 16

Very Lazy Approach for SMT

g(a)=c

1

∧ ( f (g(a))=f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

SAT solver returns model [1, 2, 4]

Abstract DPLL and Abstract DPLL Modulo Theories – p.16/24

slide-17
SLIDE 17

Very Lazy Approach for SMT

g(a)=c

1

∧ ( f (g(a))=f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

SAT solver returns model [1, 2, 4] Theory solver detects [1, 2] T-inconsistent

Abstract DPLL and Abstract DPLL Modulo Theories – p.16/24

slide-18
SLIDE 18

Very Lazy Approach for SMT

g(a)=c

1

∧ ( f (g(a))=f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

SAT solver returns model [1, 2, 4] Theory solver detects [1, 2] T-inconsistent Send {1, 2∨3, 4, 1∨2} to SAT solver

Abstract DPLL and Abstract DPLL Modulo Theories – p.16/24

slide-19
SLIDE 19

Very Lazy Approach for SMT

g(a)=c

1

∧ ( f (g(a))=f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

SAT solver returns model [1, 2, 4] Theory solver detects [1, 2] T-inconsistent Send {1, 2∨3, 4, 1∨2} to SAT solver SAT solver returns model [1, 2, 3, 4]

Abstract DPLL and Abstract DPLL Modulo Theories – p.16/24

slide-20
SLIDE 20

Very Lazy Approach for SMT

g(a)=c

1

∧ ( f (g(a))=f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

SAT solver returns model [1, 2, 4] Theory solver detects [1, 2] T-inconsistent Send {1, 2∨3, 4, 1∨2} to SAT solver SAT solver returns model [1, 2, 3, 4] Theory solver detects [1, 3, 4] T-inconsistent

Abstract DPLL and Abstract DPLL Modulo Theories – p.16/24

slide-21
SLIDE 21

Very Lazy Approach for SMT

g(a)=c

1

∧ ( f (g(a))=f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

SAT solver returns model [1, 2, 4] Theory solver detects [1, 2] T-inconsistent Send {1, 2∨3, 4, 1∨2} to SAT solver SAT solver returns model [1, 2, 3, 4] Theory solver detects [1, 3, 4] T-inconsistent SAT solver detects {1, 2∨3, 4, 1∨2, 1∨3∨4}

UNSATISFIABLE

Abstract DPLL and Abstract DPLL Modulo Theories – p.16/24

slide-22
SLIDE 22

Very Lazy Approach - Modelling

The process within the SAT solver is modelled

using the DPLL sytem

The interaction between the theory solver and

the SAT solver is modelled with the rule

Very Lazy Theory Learning M l M1 || F = ⇒ ∅ || F, l1 ∨ . . . ∨ ln ∨ l if        M l M1 | = F {l1, . . . , ln} ⊆ M l1 ∧ . . . ∧ ln | =T l

Abstract DPLL and Abstract DPLL Modulo Theories – p.17/24

slide-23
SLIDE 23

Lazy approach

Detects T-inconsistent partial models using

Lazy Theory Learning M l M1 || F = ⇒ M l M1 || F, l1 ∨ . . . ∨ ln ∨ l if        {l1, . . . , ln} ⊆ M l1∧. . . ∧ ln | =T l l1∨. . .∨ln∨l ∈ F

The learnt clause is false in M l M1 and hence

either Backjump or Fail apply

Abstract DPLL and Abstract DPLL Modulo Theories – p.18/24

slide-24
SLIDE 24

Lazy approach - Strategies

A common strategy is to apply the rules using

the following priorities:

  • 1. If there is a clause in F which is false in M

apply Fail or Backjump + Learn

  • 2. If the model is T-inconsistent apply

Lazy Theory Learning + ( Backjump or Fail)

  • 3. Apply UnitProp
  • 4. Apply Decide

Abstract DPLL and Abstract DPLL Modulo Theories – p.19/24

slide-25
SLIDE 25

DPLL(T) - Eager T-Propagation

Use the theory information as soon as possible

by eagerly applying

Theory Propagate M || F = ⇒ M l || F if        M | =T l l or l occurs in F l is undefined in M

Abstract DPLL and Abstract DPLL Modulo Theories – p.20/24

slide-26
SLIDE 26

Eager T-Propagation - Example

g(a)=c

1

∧ ( f (g(a))=f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

∅ || 1, 2∨3, 4 = ⇒ (UnitProp) 1 || 1, 2∨3, 4 = ⇒ (Theory Propagate) 1 2 || 1, 2∨3, 4 = ⇒ (UnitProp) 1 2 3 || 1, 2∨3, 4 = ⇒ (Theory Propagate) 1 2 3 4 || 1, 2∨3, 4 = ⇒ (Fail) fail

Abstract DPLL and Abstract DPLL Modulo Theories – p.21/24

slide-27
SLIDE 27

Eager Theory Propagation

By eagerly applying Theory Propagate any M will

be T-consistent, since M1 l is T-inconsistent iff M1 | =T l

Therefore, Lazy Theory Learning will never apply For some logics, e.g. separation logic, this

approach is extremely effective

For some other, e.g. EUF, it is too expensive to

detect all T-consequences

Abstract DPLL and Abstract DPLL Modulo Theories – p.22/24

slide-28
SLIDE 28

Non-Exhaustive T-Propagation

If Theory Propagate is not eagerly applied,

Lazy Theory Learning is needed to repair

T-inconsistent models

The six rules of the DPLL system plus

Theory Propagate and Lazy Theory Learning provide

a decision procedure for SMT

Termination is usually ensured this way: Between two Learn applications some rule of

the Basic DPLL is applied

Apply Backjump or Fail immediately after

Lazy Theory Learning

Abstract DPLL and Abstract DPLL Modulo Theories – p.23/24

slide-29
SLIDE 29

Conclusions

The DPLL procedure can be modelled in an

abstract way

Modern features such as backjumping,

learning (also restarts) can be captured with

  • ur transition systems

Extensions to SMT are possible It allows one to describe the strategies of

concrete systems in a clean way

Abstract DPLL and Abstract DPLL Modulo Theories – p.24/24