14
Automated Reasoning Building Blocks Part I Christoph Weidenbach Max Planck Institute for Informatics September 21, 2015 Motivation Propositional Reasoning Outline Motivation Propositional Reasoning September 21, 2015 2/54 Motivation Propositional Reasoning Automated Reasoning Building Blocks Learn Fresh Do Indexing Consider Models Compact Datastructs Flexible Models Don’t Guess Find Invariants Always Learn Eliminate Redundancy Consider Orderings Be Lazy Consider Theories Use Toolbox Be Small September 21, 2015 3/54 Motivation Propositional Reasoning Propositional Clause Logic Syntax Clauses have the form P ∨¬R Q Q where P , Q, R Σ Clauses denoted by C, D, empty clause denoted by Clause sets N , M are interpreted as conjunctions of clauses Semantics (Partial) Valuations A →{0, 1} Clause Set N satisfiable if A(N )= 1 for some A, A| = N Clause Set N unsatisfiable if A(N )= 0 for all A Clause Set N valid if A(N )= 1 for all A, | = N N = {P Q, ¬P Q, P ∨¬Q, ¬P ∨¬Q} September 21, 2015 4/54

Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Automated Reasoning Building BlocksPart I

Christoph Weidenbach

Max Planck Institute for Informatics

September 21, 2015

Motivation Propositional Reasoning

Outline

Motivation

Propositional Reasoning

September 21, 2015 2/54

Motivation Propositional Reasoning

Automated Reasoning Building Blocks

LearnFresh

DoIndexing

ConsiderModels

CompactDatastructs

FlexibleModels

Don’tGuess

FindInvariants

AlwaysLearn

EliminateRedundancy

ConsiderOrderings

BeLazy

ConsiderTheories

UseToolbox

BeSmall

September 21, 2015 3/54

Motivation Propositional Reasoning

Propositional Clause Logic

SyntaxClauses have the form P ∨ ¬R ∨Q ∨Q where P, Q, R ∈ Σ

Clauses denoted by C, D, empty clause denoted by ⊥Clause sets N, M are interpreted as conjunctions of clauses

Semantics(Partial) Valuations A : Σ→ {0, 1}Clause Set N satisfiable if A(N) = 1 for some A, A |= NClause Set N unsatisfiable if A(N) = 0 for all AClause Set N valid if A(N) = 1 for all A, |= N

N = {P ∨Q, ¬P ∨Q, P ∨ ¬Q, ¬P ∨ ¬Q}

September 21, 2015 4/54

Page 2: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Analytic Models

Beth 55, Smullyan 68, Fitting 90Tableau Procedure: Close Branch & Backtrack, Split Disjunction

N = {P ∨Q, R ∨ S, ¬P ∨Q, ¬Q}

⇒TAB ([],>) ⇒TAB ([Q],>)

⇒TAB ([PP∨Q],>) ⇒TAB ([Q ¬Q],⊥)

⇒TAB ([PP∨Q RR∨S],>) ⇒TAB ([],⊥)

⇒TAB ([PP∨Q RR∨S ¬P¬P∨Q],⊥)

⇒TAB ([PP∨Q RR∨S Q],>)

⇒TAB ([PP∨Q RR∨S Q ¬Q],⊥)

⇒TAB ([PP∨Q S],>) . . .

Only Guessing &No ModelConsideration

September 21, 2015 5/54

Motivation Propositional Reasoning

Consider Models

Davis & Logman & Loveland 1962DPLL Procedure: Find Conflict & Backtrack, Propagate, Guess

N = {P ∨Q, R ∨ S, ¬P ∨Q, ¬Q}

⇒DPLL ([],>)

⇒DPLL ([¬Q¬Q],>)

⇒DPLL ([¬Q¬QPP∨Q],>)

⇒DPLL ([¬Q¬QPP∨Q],¬P ∨Q)

⇒DPLL ([],⊥)

Propagation &No Guessing

September 21, 2015 6/54

Motivation Propositional Reasoning

DPLL Minimal Proof Length

N = {P ∨Q, ¬P ∨Q, P ∨ ¬Q, ¬P ∨ ¬Q}

⇒DPLL ([],>)

⇒DPLL ([P1],>)

⇒DPLL ([P1Q¬P∨Q],>)

⇒DPLL ([P1Q¬P∨Q],¬P ∨ ¬Q)

⇒DPLL ([¬P],>)

⇒DPLL ([¬P, QP∨Q],>)

⇒DPLL ([¬P, QP∨Q], P ∨ ¬Q)

⇒DPLL ([],⊥)

No LearningO(2n)

September 21, 2015 7/54

Motivation Propositional Reasoning

Always Learn

Robinson 1965Resolution: C ∨ P, ¬P ∨ D ⇒RES C ∨ D

N = {P ∨Q, ¬P ∨Q, P ∨ ¬Q, ¬P ∨ ¬Q}

¬P ∨Q, ¬P ∨ ¬Q ⇒RES ¬PP ∨Q, P ∨ ¬Q ⇒RES PP, ¬P ⇒RES ⊥

O(n)No ModelConsideration

September 21, 2015 8/54

Page 3: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Eliminate Redundancy

N = {P ∨Q, ¬P ∨ ¬Q}P ∨Q, ¬P ∨ ¬Q ⇒RES Q ∨ ¬QMay we eliminate Q ∨ ¬Q?

N = {P ∨Q ∨ R, ¬P ∨Q, P ∨ R}¬P ∨Q, P ∨ R ⇒RES Q ∨ RMay we eliminate P ∨Q ∨ R?

Number of clauses generated in a typical resolution run:42, 420, 42000, 42000000, . . .

September 21, 2015 9/54

Motivation Propositional Reasoning

Redundancy: A First-Class Citizen

Boyer 1971Lock Resolution: C ∨ Pk ,¬Pl ∨ D ⇒LRES C ∨ Dif k , l are maximal indexes, respectively

N = {P5 ∨Q4, ¬P4 ∨Q5, P4 ∨ ¬Q5, ¬P5 ∨ ¬Q4}⇒LRES Q4 ∨ ¬Q4

⇒LRES ¬P4 ∨ P4

Redundancy needs to be considered in the context of a calculus.

September 21, 2015 10/54

Motivation Propositional Reasoning

Learn Fresh, Eliminate Redundancy

Bachmair & Ganzinger 1990Superposition: C ∨ P,¬P ∨ D ⇒LRES C ∨ Dif P, ¬P are maximal in their respective clauses

Ordering≺ is a total strict ordering on Σ: P ≺ Q≺ on literals: P ≺ ¬P ≺ Q ≺ ¬Q≺ on clauses: multiset extension: {P, Q} ≺ {P, Q, Q} ≺ {¬Q}N≺C = {D ∈ N | D ≺ C}

September 21, 2015 11/54

Motivation Propositional Reasoning

Superposition Redundancy

Definition (Redundancy)

A clause C is redundant with respect to a clause set N if N≺C |= C.

P ≺ Q ≺ RN = {P ∨Q, R ∨ ¬P} clauses P ∨Q ∨ ¬R, Q ∨ R redundant

Superposition Static Model NINC :=

⋃D≺C δD

δD :=

{{P} if D = D′ ∨ P, P strictly maximal ND 6|= D∅ otherwise

NI :=⋃

C∈N δC

September 21, 2015 12/54

Page 4: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Superposition Results

Theorem (Completeness, Models, Redundancy)If all superposition inferences in N up to redundancy are performedand ⊥ /∈ N then N is satisfiable and NI |= N.It is sufficient to consider inferences between a minimal false clause¬P ∨ C, NI 6|= ¬P ∨ C and its productive counterpart P ∨ D.The result C ∨ D of the superposition inference is not redundant.

Model Properties

- fixed by ordering: P ∨Q, P ∨ ¬Q- minimal: P ∨Q, ¬P ∨ R, where R ≺ Q ≺ P then NI = {P}

Static Ordering &Model

September 21, 2015 13/54

Motivation Propositional Reasoning

Always Learn Fresh, Flexible Models

Silva, Sakallah, Bayardo, Schrag, Et Al 2000-CDCL: Find Conflict & Backtrack & Learn, Propagate, Guess

N = {P ∨Q, ¬P ∨Q, P ∨ ¬Q, ¬P ∨ ¬Q}

⇒CDCL ([], ∅,>)

⇒CDCL ([P1], ∅,>)

⇒CDCL ([P1Q¬P∨Q], ∅,>)

⇒CDCL ([P1Q¬P∨Q], ∅,¬P ∨ ¬Q)

⇒CDCL ([¬P], {¬P},>)

⇒CDCL ([¬P, QP∨Q], {¬P},>)

⇒CDCL ([¬P, QP∨Q], {¬P}, P ∨ ¬Q)

⇒CDCL ([], {¬P, ⊥},⊥)

O(n)No Redundancy

September 21, 2015 14/54

Motivation Propositional Reasoning

Consider Theories

while Program Analysis

1 n = 0; ¬P1(n, x , y) ∨ P2(0, x , y)

2 while (x > 0) { ¬x > 0 ∨ ¬P2(n, x , y) ∨ P3(n, x , y)

¬x ≤ 0 ∨ ¬P2(n, x , y) ∨ P6(n, x , y)

3 n = n + y ; ¬P3(n, x , y) ∨ P4(n + y , x , y)

4 x = x − 1; ¬P4(n, x , y) ∨ P5(n, x − 1, y)

5 } ¬P5(n, x , y) ∨ P2(n, x , y)

6 return n;

September 21, 2015 15/54

Motivation Propositional Reasoning

Axiomatize Theories

Program Formalization

¬x > 0 ∨ ¬P2(n, x , y) ∨ P3(n, x , y)¬x ≤ 0 ∨ ¬P2(n, x , y) ∨ P6(n, x , y)¬P3(n, x , y) ∨ P4(n + y , x , y)¬P4(n, x , y) ∨ P5(n, x − 1, y)

Theory Axioms

x = 0 ∨ x > 0 ∧ s(x) > xs(x) + y = s(x + y) ∧ 0 + y = y ∧ x + y = y + x. . .

Incomplete & No Decision Procedure

September 21, 2015 16/54

Page 5: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Combine Theories

Program Formalization

¬x > 0 ∨ ¬P2(n, x , y) ∨ P3(n, x , y)¬x ≤ 0 ∨ ¬P2(n, x , y) ∨ P6(n, x , y)¬P3(n, x , y) ∨ P4(n + y , x , y)¬P4(n, x , y) ∨ P5(n, x − 1, y)

Combinationx > 0 ‖¬P2(n, x , y) ∨ P3(n, x , y)x ≤ 0 ‖¬P2(n, x , y) ∨ P6(n, x , y)z = n + y ‖¬P3(n, x , y) ∨ P4(z, x , y)z = x − 1 ‖¬P4(n, x , y) ∨ P5(n, z, y)

Expressive Logic & Difficult AutomationSeptember 21, 2015 17/54

Motivation Propositional Reasoning

Summary

Open QuestionsCan redundancy and completeness be combined?Can redundancy and ordering restrictions be combined?Can model building and inferences be combined?How does reasoning in combination of theories work?

AnswersSuperposition [BachmairGanzinger90]CDCL [BayardoSchrag96, SilvaSakallah96, NieuwenhuisEtAl06]CDCL(T)/SMT [NieuwenhuisEtAl06]HierarchicSuperposition [BachmairEtAl94, KruglovW12, FietzkeW12]

September 21, 2015 18/54

Motivation Propositional Reasoning

Disclaimer

Simplified PresentationMany Technical Details OmittedAlmost no EqualitySee References for Further Reading

GoalGet the Ideas/Intuition

September 21, 2015 19/54

Motivation Propositional Reasoning

References Tableau

E.W. Beth.Semantic entailment and formal derivability.Mededelingen van de Koninklijke Nederlandse Akademie vanWetenschappen, Afdeling Letterkunde, 18(13):309–342, 1955.

Raymond M. Smullyan.First-Order Logic.Ergebnisse der Mathematik und ihrer Grenzgebiete. Springer,1968.

Melvin Fitting.First-Order Logic and Automated Theorem Proving.Texts and Monographs in Computer Science. Springer, 1990.

September 21, 2015 20/54

Page 6: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

References Superposition

Leo Bachmair and Harald Ganzinger.On restrictions of ordered paramodulation with simplification.In CADE-10, LNCS 449, pages 427–441. Springer, 1990.

R.S. Boyer.Locking: A Restriction of Resolution.PhD thesis, University of Texas at Austin, August 1971.

John Alan Robinson.A machine-oriented logic based on the resolution principle.Journal of the ACM, 12(1):23–41, January 1965.

September 21, 2015 21/54

Motivation Propositional Reasoning

References CDCL

Roberto J. Bayardo Jr. and Robert Schrag.Using CSP look-back techniques to solve exceptionally hard SATinstances.In Eugene C. Freuder, editor, CP 1996, Cambridge,Massachusetts, USA, August 19-22, LNCS 1118, pages 46–60.Springer, 1996.

João P. Marques Silva and Karem A. Sakallah.Grasp - a new search algorithm for satisfiability.In ICCAD 1996, pages 220–227. IEEE Press, 1996.

Robert Nieuwenhuis, Albert Oliveras, and Cesare Tinelli.Solving sat and SAT modulo theories: From an abstractDavis–Putnam–Logemann–Loveland procedure to DPLL(T).Journal of the ACM, 53:937–977, November 2006.

September 21, 2015 22/54

Motivation Propositional Reasoning

References Combination

Leo Bachmair, Harald Ganzinger, and Uwe Waldmann.Refutational theorem proving for hierarchic first-order theories.AAECC, 5(3/4):193–212, 1994.

Evgeny Kruglov and Christoph Weidenbach.Superposition decides the first-order logic fragment over groundtheories.MCS, 6(4):427–456, 2012.

Arnaud Fietzke and Christoph Weidenbach.Superposition as a decision procedure for timed automata.MCS, 6(4):409–425, 2012.

September 21, 2015 23/54

Motivation Propositional Reasoning

Propositional Resolution

Resolution [Robinson65]Resolution(N ] {C ∨ P, D ∨ ¬P}) ⇒RES (N ∪ {C ∨ P, D ∨ ¬P, C ∨ D})

Factoring(N ] {C ∨ L ∨ L}) ⇒RES (N ∪ {C ∨ L ∨ L} ∪ {C ∨ L})

Theorem (Resolution is Sound and Complete)N is unsatisfiable iff N ⇒∗RES N ′ ∪ {⊥}

September 21, 2015 24/54

Page 7: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Soundness

Resolution(N ] {C ∨ P, D ∨ ¬P}) ⇒RES (N ∪ {C ∨ P, D ∨ ¬P, C ∨ D})

if A((C ∨ P) ∧ (D ∨ ¬P)) = 1 then A(C ∨ D) = 1

Factoring(N ] {C ∨ L ∨ L}) ⇒RES (N ∪ {C ∨ L ∨ L} ∪ {C ∨ L})

if A(C ∨ L ∨ L) = 1 then A(C ∨ L) = 1

September 21, 2015 25/54

Motivation Propositional Reasoning

Completeness: Semantic Trees

N = {P ∨Q, ¬P ∨ ¬Q, P ∨ ¬Q, ¬P ∨Q ∨ R, ¬P ∨Q ∨ ¬R}

¬P ∨ ¬Q

Q

¬P ∨Q ∨ ¬R

R

¬P ∨Q ∨ R

¬R

¬Q

P

P ∨ ¬Q

Q

P ∨Q

¬Q

¬P

⇒RES P ∨ P⇒RES P

September 21, 2015 26/54

Motivation Propositional Reasoning

Semantic Tree Redundancy

N = {P ∨Q, ¬P ∨ ¬Q, P ∨ ¬Q, ¬P ∨Q ∨ R, ¬P ∨Q ∨ ¬R, P}

¬P ∨ ¬Q

Q

¬P ∨Q ∨ ¬R

R

¬P ∨Q ∨ R

¬R

¬Q

P

P

¬P

⇒RES P ∨ P⇒RES Premoved P ∨ P

September 21, 2015 27/54

Motivation Propositional Reasoning

Eliminate Redundancy

Well-Founded Semantic Tree OrderingA clause C is redundant if D ⊆ C for some DAny clause C not occurring in any semantic tree is redundant

Subsumption(N ] {C, D}) ⇒RES (N ∪ {C})provided C ⊂ D

Condensation(N ] {C ∨ L ∨ L}) ⇒RES (N ∪ {C ∨ L})

Tautology Deletion(N ] {C ∨ P ∨ ¬P}) ⇒RES (N)

Can redundancy and completeness be combined?September 21, 2015 28/54

Page 8: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

TerminationN0 ⇒RES N1 ⇒RES . . .

How Many Different Clause Sets?at most 3n different clauses, n = |Σ|, modulo condensationat most 2(3n) different clause sets

ExamplesN = {P ∨ C1, P ∨ C2, . . .} obviously satisfiableN = {P ∨Q, P ∨ ¬Q}

under A(P) = 1 why consider P ∨ ¬Q for resolution?

Can model building and inferences be combined?

September 21, 2015 29/54

Motivation Propositional Reasoning

Propositional Superposition

Ordering≺ is a total strict ordering on Σ: P ≺ Q≺ on literals: P ≺ ¬P ≺ Q ≺ ¬Q≺ on clauses: multiset extension: {P, Q} ≺ {P, Q, Q} ≺ {¬Q}N≺C = {D ∈ N | D ≺ C}

Definition (Redundancy)

A clause C is redundant with respect to a clause set N if N≺C |= C.

P ≺ Q ≺ RN = {P ∨Q, R ∨ ¬P} clauses P ∨Q ∨ ¬R, Q ∨ R redundant

September 21, 2015 30/54

Motivation Propositional Reasoning

ModelsDefinition (Selection Function)

sel maps clauses to one of its negative literals or ⊥if sel(C) = ¬P then ¬P is called selected in Cif sel(C) = ⊥ then no literal in C is selected

Partial Herbrand Model Construction

NC :=⋃

D≺C δD

δD :=

{P} if D = D′ ∨ P, P strictly maximal, no literal

selected in D and ND 6|= D∅ otherwise

NI :=⋃

C∈N δC

September 21, 2015 31/54

Motivation Propositional Reasoning

Partial Herbrand Model Properties

NC :=⋃

D≺C δD

δD :=

{P} if D = D′ ∨ P, P strictly maximal, no literal

selected in D and ND 6|= D∅ otherwise

NI :=⋃

C∈N δC

PropertiesNI is minimal with respect to set inclusionif D ≺ C and NC |= D then NI |= Dif P ∨ P ≺ C then δC 6= {P}if δC = {P} then NC ∪ δC |= C

September 21, 2015 32/54

Page 9: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Propositional Superposition

SuperpositionSuperposition Left(N ] {C ∨ P, D ∨ ¬P}) ⇒SUP (N ∪ {C ∨ P, D ∨ ¬P} ∪ {C ∨ D})where (i) P is strictly maximal in C ∨ P(ii) no literal in C ∨ P is selected(iii) ¬P is maximal and no literal selected in D ∨ ¬P, or¬P is selected in D ∨ ¬P

Factoring(N ] {C ∨ P ∨ P}) ⇒SUP (N ∪ {C ∨ P ∨ P} ∪ {C ∨ P})where (i) P is maximal in C ∨ P ∨ P(ii) no literal is selected in C ∨ P ∨ P

September 21, 2015 33/54

Motivation Propositional Reasoning

Saturation and Completeness

Definition (Saturation)A set N of clauses is called saturated up to redundancy, if any clausegenerated by Superposition Left or Factoring from non-redundantclauses in N is redundant with respect to N or contained in N.

Theorem (Superposition Completeness)If N is saturated up to redundancy and ⊥ /∈ N then N is satisfiableand NI |= N.

September 21, 2015 34/54

Motivation Propositional Reasoning

Superposition Completeness Proof

Theorem (Superposition Completeness)If N is saturated up to redundancy and ⊥ /∈ N then N is satisfiableand NI |= N.

Proof.By contradiction. I assume:(i) if N ⇒SUP N ∪ D then N≺D |= D or D ∈ N, (ii) ⊥ /∈ N and(iii) NI 6|= N.Then there is a minimal clause C ∨ L ∈ N such that NI 6|= C ∨ Land L is selected or nothing selected and L maximal. This clausemust exist because ⊥ /∈ N.C ∨ L is not redundant and by Superposition Left or Factoring wecan derive a non-redundant clause that is smaller than C ∨ L andfalse in NI , a contradiction.

September 21, 2015 35/54

Motivation Propositional Reasoning

Proof: More Details.if C ∨ L redundant, then NC∨L |= C ∨ L, a contradictionL positive, L not strictly maximal, do Factoring, a contradictionL positive, L strictly maximal, L ∈ NI , a contradictionL negative, do Superposition Left, a contradiction

September 21, 2015 36/54

Page 10: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Completeness Summary

Superposition Completenessdoes inferences with respect to a candidate model NIonly inferences on false clauses needed: see proofsupports ordering restrictions: ≺supports redundancy: NC |= C

September 21, 2015 37/54

Motivation Propositional Reasoning

Superposition Results

Theorem (Completeness, Models, Redundancy)If all superposition inferences in N up to redundancy are performedand ⊥ /∈ N then N is satisfiable and NI |= N.It is sufficient to consider inferences between a minimal false clause¬P ∨ C, NI 6|= ¬P ∨ C and its productive counterpart P ∨ D.The result C ∨ D of the superposition inference is not redundant.

Propositional SpecialitiesNI can be effectively constructedNI 6|= ¬P ∨ C easy to decideunsatisfiability is co-NP, saturation always terminates

September 21, 2015 38/54

Motivation Propositional Reasoning

Concrete Redundancy

Subsumption(N ] {C, D}) ⇒SUP (N ∪ {C})provided C ⊂ D

Condensation(N ] {C ∨ L ∨ L}) ⇒SUP (N ∪ {C ∨ L})

Tautology Deletion(N ] {C ∨ P ∨ ¬P}) ⇒SUP (N)

Subsumption Resolution(N ] {C1 ∨ L, C2 ∨ ¬L}) ⇒SUP (N ∪ {C1 ∨ L, C2})where C1 ⊆ C2

September 21, 2015 39/54

Motivation Propositional Reasoning

Extension I: Saturation

Example (N saturated vs. NI |= N)

N = {P, ¬P ∨ ¬Q} with ordering Q ≺ P.Then NI |= N but N is not saturated.

FixAlways check whether NI |= N.

September 21, 2015 40/54

Page 11: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Extension II: Flexible Model Operator

Example (Inflexible Model Operator)

N = {P ∨Q, ¬P ∨ R} with ordering R ≺ Q ≺ P.Then NI = {P} and NI 6|= NBut NI ∪ {R} |= N.

FixUse a different model operator.

September 21, 2015 41/54

Motivation Propositional Reasoning

Flexible Model Operator

H is a decision heuristic: H : Σ→ {0, 1}

NHP :=

⋃Q≺P δ

HQ

δHP :=

{P} if (D ∨ P) ∈ N, with NH

P |= ¬Dand P strictly maximal, nothing selected orH(P) = 1 no clause (D′ ∨ ¬P) ∈ N, D′ ≺ Psuch that NH

P |= ¬D′

∅ otherwise

NHΣ :=

⋃P∈Σ δ

HP

September 21, 2015 42/54

Motivation Propositional Reasoning

NHΣ Properties [W2015]

Theorem (Superposition Completeness)If N is saturated up to redundancy and ⊥ /∈ N then N is satisfiableand NH

Σ |= N.

Example (Flexible Model Operator)

N = {P ∨Q, ¬P ∨ R} with ordering R ≺ Q ≺ P, H(R) = 1Then NH

Σ = {P, R} and NHΣ |= N

September 21, 2015 43/54

Motivation Propositional Reasoning

CDCL States

(ε; N; ∅; 0;>) is the start state for some clause set N(M; N; U; k ;>) is a final state, if M |= N and all literals from N

are defined in M(M; N; U; k ;⊥) is a final state, where N has no model(M; N; U; k ;>) is an intermediate model search state if M 6|= N or

not all literals from N are defined in M(M; N; U; k ; D) is a backtracking state if D 6∈ {>,⊥}

September 21, 2015 44/54

Page 12: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

CDCL Rules I

Model Extension RulesPropagate(M; N; U; k ;>) ⇒CDCL (MLC∨L; N; U; k ;>)

provided C ∨ L ∈ (N ∪ U), M |= ¬C, and L is undefined in MDecide(M; N; U; k ;>) ⇒CDCL (MLk+1; N; U; k + 1;>)

provided L is undefined in MConflict(M; N; U; k ;>) ⇒CDCL (M; N; U; k ; D)

provided D ∈ (N ∪ U) and M |= ¬D

September 21, 2015 45/54

Motivation Propositional Reasoning

CDCL Rules II

Backtracking RulesSkip(MLC∨L; N; U; k ; D) ⇒CDCL (M; N; U; k ; D)

provided D 6∈ {>,⊥} and comp(L) does not occur in DResolve(MLC∨L; N; U; k ; D ∨ comp(L)) ⇒CDCL (M; N; U; k ; D ∨ C)

provided D is of level kBacktrack(M1K i+1M2; N; U; k ; D ∨ L) ⇒CDCL (M1LD∨L; N; U ∪{D ∨ L}; i ;>)

provided L is of level k and D is of level i .

September 21, 2015 46/54

Motivation Propositional Reasoning

CDCL Properties

Theorem (CDCL Soundness)CDCL terminates reasonably in two different final states:(M; N; U; k ;>) where M |= N and (M; N; U; k ;⊥) where N isunsatisfiable.

Theorem (CDCL Strong Completeness)For any interpretation M, there is a reasonable sequence of ruleapplications generating (M ′; N; U; k ;>) as a final state, where Mand M ′ only differ in the order of literals.

Theorem (CDCL Termination)CDCL always terminates reasonably in a state (M; N; U; k ; D) withD ∈ {>,⊥}.

September 21, 2015 47/54

Motivation Propositional Reasoning

Superposition & CDCL

Theorem (NHΣ & CDCL)

If (L1 . . . Ln; N; U; k ;>) is a CDCL state, atom(Li) = Pi andP1 ≺ P2 ≺ . . . ≺ Pn and H(Pi) = 1 if Pi is a decision literal, thenNH

P1,P2,...,Pncontains exactly the atoms from L1 . . . Ln.

CDCL & RedundancyA learned CDCL clause is the result of a superposition inference andnot redundant.

September 21, 2015 48/54

Page 13: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

Extension III: Ordering Change

N = { ¬P1 ∨ P2 ∨ . . . ∨ Pn, P1 ∨ P2 ∨ . . . ∨ Pn¬P2 ∨ P′

2, ¬P2 ∨ ¬P′2,

. . .¬Pn ∨ P′

n, ¬Pn ∨ ¬P′n}

O(n) refutation: Pn ≺ Pn−1 . . . ≺ P1 ≺ P′n ≺ P′

n−1 . . . ≺ P′2

O(2n) refutation: Pn � Pn−1 . . . � P1 � P′n � P′

n−1 . . . � P′2

N = { Q ∨ ¬P1 ∨ P2 ∨ . . . ∨ Pn, Q ∨ P1 ∨ P2 ∨ . . . ∨ PnQ ∨ ¬P2 ∨ P′

2, Q ∨ ¬P2 ∨ ¬P′2,

. . .Q ∨ ¬Pn ∨ P′

n, Q ∨ ¬Pn ∨ ¬P′n}

Consider N ∪ N{Pi 7→ P′i , P′

i 7→ Pi , Q 7→ ¬Q}

September 21, 2015 49/54

Motivation Propositional Reasoning

Flexible Model & Redundancy

N = {P ∨Q, R ∨ ¬P} ordering R ≺ Q ≺ P model NI = {P}

⇒SUP Q ∨ R not redundant

change ordering P ≺ Q ≺ R

now Q ∨ R redundant

- flexible ordering not compatible with redundancy

- superposition redundancy is not compatible with CDCL reasoning

- flexible models enable only weaker notions of redundancy

- still: at any point in time, learned CDCL clauses are non-redundant

September 21, 2015 50/54

Motivation Propositional Reasoning

Be Small

Implementing CDCLis subject for an independent tutoriallike resolution CDCL learns many clausesnot redundant at creation, but become redundantabout 10% are subsumed by subsequent learned clausechecking subsumption for every learned clause is too expensivegreedily throw away learned clauses by activity heuristicslowly increase number of overall kept learned clauses

September 21, 2015 51/54

Motivation Propositional Reasoning

Summary

Propositional Superpositioncombines static models, fresh learning, redundancy eliminationexplicit orderingordering changes conflict with redundancy

CDCLcombines flexible models, fresh learningimplicit orderingmodel changes conflict with redundancy

Future ResearchRelationship between flexible models and redundancy.

September 21, 2015 52/54

Page 14: Automated Reasoning Building Blocks - Part Itableaux2015.ii.uni.wroc.pl/weidenbach1.pdf · AutomatedReasoningBuildingBlocks PartI ChristophWeidenbach Max Planck Institute for Informatics

Motivation Propositional Reasoning

References Propositional Reasoning

Christoph Weidenbach.Automated Reasoning.Lecture Script WS14/15.http://www.mpi-inf.mpg.de/departments/automation-of-logic/teaching/.

Christoph Weidenbach.Automated reasoning building blocks.In Roland Meyer, André Platzer, and Heike Wehrheim, editors,Correct System Design, volume 9360 of LNCS, pages 172–188.Springer, 2015.

Christoph Weidenbach.Automated Reasoning.CRC. 201X. To appear.

September 21, 2015 53/54

Motivation Propositional Reasoning

References Propositional Reasoning

Armin Biere, Marijn Heule, Hans van Maaren, and Toby Walsh,editors.Handbook of Satisfiability, volume 185 of Frontiers in ArtificialIntelligence and Applications. IOS Press, 2009.

September 21, 2015 54/54