Top Banner
A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system CDSAT: conflict-driven theory combination 1 Maria Paola Bonacina Dipartimento di Informatica, Universit` a degli Studi di Verona, Verona, Italy, EU 28 September 2017 1 Joint work with St´ ephane Graham-Lengrand and Natarajan Shankar Maria Paola Bonacina CDSAT: conflict-driven theory combination
54

CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

Mar 21, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

CDSAT: conflict-driven theory combination1

Maria Paola Bonacina

Dipartimento di Informatica, Universita degli Studi di Verona,

Verona, Italy, EU

28 September 2017

1Joint work with Stephane Graham-Lengrand and Natarajan ShankarMaria Paola Bonacina CDSAT: conflict-driven theory combination

Page 2: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

A paradigm of conflict-driven reasoning

Conflict-driven reasoning in theory combination

The CDSAT inference system

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 3: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Archetype of conflict-driven reasoning: CDCL

◮ SAT: satisfiability of a set of clauses in propositional logic

◮ Conflict-Driven Clause Learning (CDCL) procedure[Marques-Silva, Sakallah: ICCAD 1996]

[Marques-Silva, Sakallah: IEEE Trans. on Computers 1999]

[Moskewicz, Madigan, Zhao, Zhang, Malik: DAC 2001]

[Marques-Silva, Lynce, Malik: SAT Handbook 2009]

◮ CDCL is conflict-driven SAT-solving

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 4: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

A taste of CDCL: decisions and propagations

{¬a ∨ b, ¬c ∨ d , ¬e ∨ ¬f , f ∨ ¬e ∨ ¬b} ⊆ S

1. Decide: a is true; Propagate: b must be true

2. Decide: c is true; Propagate: d must be true

3. Decide: e is true; Propagate: ¬f must be true

◮ Trail M = a, b, c , d , e, ¬f◮ Conflict: f ∨ ¬e ∨ ¬b is false

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 5: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

A taste of CDCL: conflict-solving

{¬a ∨ b, ¬c ∨ d , ¬e ∨ ¬f , f ∨ ¬e ∨ ¬b} ⊆ S

M = a, b, c , d , e, ¬f1. Conflict: f ∨ ¬e ∨ ¬b2. Explain by resolving f ∨ ¬e ∨ ¬b with ¬e ∨ ¬f : ¬e ∨ ¬b3. Learn ¬e ∨ ¬b: no model with e and b true

4. Backjump to earliest state with ¬b false and ¬e unassigned:M = a, b, ¬e

5. Continue until it finds a satisfying assignment (model) or nonecan be found (conflict at level 0)

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 6: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Conflict-driven reasoning: what is a conflict?

◮ Conflict: between constraints to be satisfied and a candidatepartial model

◮ Methods that build a candidate partial model: model-basedreasoning

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 7: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Model-based reasoning

◮ A reasoning method is model-based if it works with acandidate (partial) model of a set of clauses

◮ The state of the derivation includes a representation of thecurrent candidate model

◮ Inferences transform the candidate model

◮ The candidate model drives the inferences

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 8: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Conflict-driven reasoning

◮ Conflict: one of the clauses is false in the current candidatemodel

◮ A model-based reasoning method is conflict-driven ifinferences

◮ Explain the conflict◮ Solve the conflict repairing the model

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 9: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Two directions of generalization of CDCL

◮ Towards first-order logic

◮ Towards theory reasoning, satisfiability modulo theories(SMT), and beyond

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 10: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Towards first-order logic

◮ The Bernays-Schonfinkel class aka EPR(∃∗∀∗ϕ: no quantifiers, no function symbols in ϕ)

◮ DPLL(SX )[Piskac, de Moura, Bjørner: JAR 2010]

◮ NRCL (Non-Redundant Clause Learning)[Alagi, Weidenbach: FroCoS 2015]

◮ Full first-order logic (without equality)◮ SGGS (Semantically-Guided Goal-Sensitive reasoning)

[Bonacina, Plaisted: JAR 2016, JAR 2017]◮ Conflict-Resolution

[Slaney, Woltzenlogel Paleo: JAR to appear]

[Itegulov, Slaney, Woltzenlogel Paleo: CADE 2017]

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 11: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Two directions of generalization of CDCL

◮ Towards first-order logic

◮ Towards theory reasoning, SMT, and beyond: this talk

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 12: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Conflict-driven reasoning in fragments of arithmetic

◮ Early forerunners, e.g.:◮ LPSAT [Wolfman, Weld: IJCAI 1999]◮ Separation logic [Wang, Ivancic, Ganai, Gupta: LPAR 2005]

◮ Linear rational arithmetic, e.g.:◮ Generalized DPLL [McMillan, Kuehlmann, Sagiv: CAV 2009]◮ Conflict Resolution [Korovin, Tsiskaridze, Voronkov: CP 2009]◮ Natural domain SMT [Cotton: FORMATS 2010]

◮ Linear integer arithmetic, e.g.:Cutting-to-the-chase method [Jovanovic, de Moura: CADE 2011]

◮ Non-linear arithmetic, e.g.:NLSAT [Jovanovic, de Moura: IJCAR 2012]

◮ Floating-point binary arithmetic, e.g.:Systematic abstraction [Haller, Griggio, Brain, Kroening: FMCAD 2012]

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 13: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Conflict-driven T -satisfiability procedures

◮ T -satisfiability procedure: decides satisfiability of a set ofliterals in the quantifier-free fragment of a theory T

◮ Conflict-driven T -satisfiability procedures generalize CDCLwith at least two key features:

◮ Assignments to first-order variables◮ Explanation of conflicts with lemmas containing new atoms

(i.e., non-input)

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 14: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Example in linear rational arithmetic

R = {L0 : (−2x − y < 0), L1 : (x + y < 0), L2 : (x < −1)}1. Decide a first-order assignment: y ← 0;

2. Propagate: L0 yields x > 0

3. Conflict between x > 0 and L2 : (x < −1)4. Explanation: deduce −y < −2 by the linear combination of L0

and L2 that eliminates xNote that −y < −2 is a new (non-input) atomthat excludes not only y ← 0, but all assignments y ← c

where c ≤ 2

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 15: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

From sets of literals to arbitrary QF formulas

◮ How to combine a conflict-driven T -satisfiability procedurewith CDCL to decide the satisfiability of an arbitrary formulain the quantifier-free fragment of theory T ?

◮ Using the standard DPLL(T ) framework?[Nieuwenhuis, Oliveras, Tinelli: JACM 2006]

No: it allows neither first-order assignment nor new atoms

◮ Answer: MCSAT (Model-Constructing SATisfiability)[de Moura, Jovanovic: VMCAI 2013]

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 16: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Key features of MCSAT

◮ CDCL-based SAT-solver + conflict-driven T -satisfiabilityprocedure: cooperate on the same level

◮ Trail M: both L (meaning L← true) and x ← 3

◮ Any T equipped with an inference system to explain theoryconflicts

◮ Such inferences may introduce new atoms

◮ Beyond input literals: finite basis for termination

◮ MCSAT lifts CDCL to Satisfiability Modulo one Theory

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 17: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Instances of MCSAT

◮ One generic theory[de Moura, Jovanovic: VMCAI 2013]

◮ Equality + linear rational arithmetic[Jovanovic, de Moura, Barrett: FMCAD 2013]

◮ Bit-vectors[Zeljic, Wintersteiger, Rummer: SAT 2016]

[Graham-Lengrand, Jovanovic: SMT 2017]

◮ Equality + non-linear arithmetic (mixed integer-real problems)[Jovanovic: VMCAI 2017]

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 18: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Open questions

Problems from applications require combinations of theories:

◮ How to combine multiple conflict-driven T -satisfiabilityprocedures with CDCL?

◮ Better: How to combine multiple conflict-drivenT -satisfiability procedure one of which is CDCL?

◮ Equivalently: How to generalize MCSAT to genericcombinations of theories?

◮ Which requirements should theories and procedures satisfy toensure soundness, completeness, and termination of theconflict-driven combination?

Answer: The new system CDSAT (Conflict-Driven SATisfiability)

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 19: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Classical approach to theory combination: equality sharing

Equality sharing aka Nelson-Oppen method[Nelson, Oppen: ACM TOPLAS 1979]

◮ Given theories T1, . . . ,Tn with Tk-satisfiability procedures

◮ Get T -satisfiability procedure for T =⋃n

k=1 Tk◮ Disjoint theories: share sorts, ≃, uninterpreted constants

◮ Mixed terms separated by introducing new constants(e.g., f (g(a)) ≃ b becomes f (c) ≃ b ∧ g(a) ≃ c , with c new,

if f and g belong to different theories)

◮ The Tk-satisfiability procedures need to agree on:◮ Shared constants◮ Cardinalities of shared sorts

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 20: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Theory combination by equality sharing

◮ For cardinality: assume stably infinite: every Tk -satisfiableground formula has Tk-model with infinite cardinality

◮ For equality: compute an arrangement saying which sharedconstants are equal and which are not by lettingthe Tk-satisfiability procedures generate and propagate allentailed (disjunctions of) equalities between shared constants

◮ Minimize interaction: the Tk -satisfiability procedures aretreated as black-boxes

◮ Integrated in DPLL(T ) with new atoms only for equalitiesbetween shared constants [Barrett, Nieuwenhuis, Oliveras, Tinelli:

LPAR 2006] [Krstic, Goel: FroCoS 2007]

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 21: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

More open questions

◮ Conflict-driven behavior and black-box behavior seem at odds:e.g., in MCSAT the T -satisfiability procedure accesses thecentral trail and performs deductions to explain conflicts on apar with CDCL

◮ Can we generalize equality sharing to the case where theTk -satisfiability procedures are conflict-driven?

◮ How can we combine multiple Tk-satisfiability proceduressome conflict-driven and some black-boxes?

Answer: The new system CDSAT (Conflict-Driven SATisfiability)

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 22: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

What is CDSAT (Conflict-Driven SATisfiability)

◮ CDSAT is a new method for theory combination

◮ CDSAT generalizes conflict-driven reasoning to genericcombinations of disjoint theories T1, . . . ,Tn

◮ CDSAT solves the problem of combining multipleconflict-driven Tk -satisfiability procedures into aconflict-driven T -satisfiability procedure for T =

⋃nk=1 Tk

◮ CDSAT reduces to MCSAT if there are two theories:propositional logic with CDCLa T with a conflict-driven T -satisfiability procedure

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 23: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Basic features of CDSAT

◮ CDSAT treats propositional and theory reasoning uniformly:formulas are terms of sort prop; all theories have sort prop

◮ Propositional logic is one of T1, . . . ,TnCDCL is one of the Tk -satisfiability procedures

◮ With formulas reduced to terms, assignments become thebasic data for inferences

◮ Key abstraction: CDSAT combines inference systems calledtheory modules I1, . . . ,In for T1, . . . ,Tn

◮ CDSAT is sound, complete, and terminating

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 24: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

How about black-box procedures?

◮ CDSAT treats a non-conflict-driven Tk -satisfiability procedureas a theory module whose only inference rule invokes theprocedure to detect the Tk -unsatisfiability of a set ofassignments

◮ Thus CDSAT generalizes equality sharing:CDSAT reduces to equality sharing, if none of the theories hasa conflict-driven T -satisfiability procedure

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 25: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Running example

P = {f (select(store(a, i , v), j)) ≃ w , f (u) ≃ w − 2, i ≃ j , u ≃ v}

Combination of

◮ Equality (EUF)

◮ Linear rational arithmetic (LRA)

◮ Arrays (Arr)

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 26: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Running example

◮ LRA has sorts {prop,Q}≃ on each sort0, 1: Q +: Q × Q → Q

c · : Q → Q for all rational number c

◮ Arr has sorts {prop,V , I ,A}≃ on each sortselect : A× I → V store : A× I × V → A

◮ EUF has sorts {prop,Q,V }≃ on each sortf : V → Q

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 27: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Everything is assignment

Initial state of the trail:

M = {f (select(store(a, i , v), j)) ≃ w , f (u) ≃ w −2, i ≃ j , u ≃ v}meansM = { f (select(store(a, i , v), j)) ≃ w ← true

f (u) ≃ w−2 ← true

i ≃ j ← true

u ≃ v ← true }Assignments such as x ← 3 in the input: satisfiability moduloassignment (SMA)

One central trail shared by all theories

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 28: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Assignment

◮ Assignments to propositional variables: L← true

◮ Assignments to first-order variables: x ← 3

◮ Assignments to first-order terms: select(a, i)← 3

◮ Assignments to first-order atoms, literals, clauses ... all seenas first-order terms of sort prop:a ≥ b ← true P(a, b) ← false

a ≥ b ∨ P(a, b) ← true

◮ Abbreviations: L for L← true, L for L← false

t1 6≃ t2 for t1 ≃ t2 ← false

◮ Flipping a Boolean assignment: from L to L or vice versa

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 29: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Assignment

◮ {t1 ← c1, . . . , tm ← cm}◮ t1, . . . , tm: terms

◮ c1, . . . , cm: values

◮ ci has the same sort as ti◮ ti ← 3 is a T1-assignment

◮ tj ←√2 is a T2-assignment

◮ What are values? 3,√2 are not in the signature of the theory

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 30: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Theory extension

◮ Theory Tk◮ Theory extension T +

k : add new constant symbols

◮ Example: add a constant symbol for every number√2 is a constant symbol interpreted as

√2

◮ The values in assignments are these constant symbols (alsofor true and false)

◮ Conservative theory extension: a T +k-unsatisfiable set of

Tk -formulas is Tk -unsatisfiable

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 31: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Plausible assignment

◮ An assignment is plausible ifit does not contain L← true and L← false

◮ Assignments are required to be plausible

◮ A plausible assignment may contain{t ← 3.1, u ← 5.4, t ← green, u ← yellow}two by T1 and two by T2

◮ When building a model from this assignment3.1 is identified with green and 5.4 with yellow

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 32: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Theory view of an assignment

Theory TAssignment: H = {t1 ← c1, . . . , tm ← cm}T -view of H:

◮ The T -assignments

◮ t ≃ s if there are e.g. t ← 3 and s ← 3 by another theory

◮ t 6≃ s if there are e.g. t ← 3 and s ← 4 by another theory

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 33: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Theory modules

◮ Theories T1, . . . ,Tn◮ Equipped with theory modules I1, . . . ,In◮ Ik is the inference system for Tk◮ Ik -inferences transforms assignments

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 34: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Examples of inferences

◮ Theory of arithmetic on the reals (RA)

◮ (x ←√2), (y ←

√2) ⊢ (x · y ≃ 1 + 1)

◮ (y ←√2), (x ←

√2) ⊢ (y ≃ x)

◮ (y ←√2), (x ←

√3) ⊢ (y 6≃ x)

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 35: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Inferences in theory modules

◮ Inference J ⊢ L

◮ J is an assignment

◮ L is a singleton Boolean assignment

◮ Only Boolean assignments are inferred

◮ Getting y ← 2 from x ← 1 and (x + y)← 3is not treated as inference in CDSAT

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 36: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Equality inferences

All theory modules include equality inferences:

◮ Same value: t ← c, s ← c ⊢ t ≃ s

◮ Different values: t ← c, s ← q ⊢ t 6≃ s

◮ Reflexivity: ⊢ t ≃ t

◮ Symmetry: t ≃ s ⊢ s ≃ t

◮ Transitivity: t ≃ s, s ≃ u ⊢ t ≃ u

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 37: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Acceptability

Given Tk -assignment J (e.g., the Tk-view of the trail)

Assignment t ← c is acceptable for J and the Tk-module Ik if

1. J does not already assign a value to t:◮ No repetition◮ No contradiction if t ← c is Boolean

2. It does not happen J ′ ∪ {t ← c} ⊢Ik Lwhere J ′ ⊆ J and L ∈ J

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 38: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Relevance

Subdivision of labor among theories:

◮ H = {x ←√5, f (x)←

√2, f (y)←

√3}

◮ x and y of sort real are RA-relevant, not EUF-relevant

◮ x ≃ y is EUF-relevant (assume EUF has sort R), notRA-relevant

◮ RA can make x and y equal/different by assigning them thesame/different value

◮ EUF can make x and y equal/different by deciding the truthvalue of x ≃ y

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 39: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

We have theory modules for

◮ Propositional logic

◮ Linear rational arithmetic (LRA)

◮ Equality (EUF)

◮ Arrays (Arr)

◮ Any stably infinite theory Tk equipped with a Tk -satisfiabilityprocedure that detects the Tk -unsatisfiability of a set ofBoolean assignments:{L1 ← b1, . . . , Lm ← bm} ⊢Tk⊥

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 40: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

The CDSAT trail

◮ Trail: sequence of assignments that areeither decisionsor justified assignments

◮ A justified assignment A has a justification J

◮ Justification: a set of assignments J that appear before A inthe trail and yields A, e.g., by an inference J ⊢Ik A

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 41: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

The CDSAT trail

◮ Every assignment has a level

◮ The level of a decision is defined as in CDCL

◮ The level of a justified assignment is that of its justification

◮ The level of a justification is the maximum among those of itselements

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 42: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

The CDSAT inference system

◮ Search rules

◮ Conflict-resolution rules

◮ Finite global basis for termination

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 43: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Search rules

◮ Apply to the trail

◮ Decide: adds an acceptable assignment to a relevant term

◮ Deduce: adds L with justification J if J ⊢Ik L◮ Conflict: J ⊢Ik L and L is on the trail

J ∪ L is the conflict

◮ Fail: declares unsatisfiability if the level of the conflict is 0

◮ ConflictSolve: solves a conflict of level > 0 by calling theconflict-resolution rules

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 44: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Conflict-resolution rules

◮ Apply to trail and conflict

◮ Backjumping rules: Undo and Backjump

◮ Explanation rules: Resolve and UndoDecide

◮ If the conflict contains an assignment A of level n greaterthan that of the rest E of the conflict:a backjumping rule applies

◮ Otherwise, an explanation rule applies

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 45: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Conflict-resolution rules: backjumping rules

◮ The conflict contains an assignment A of level n greater thanthat of the rest E of the conflict:

◮ Undo: A is a first-order decision:remove A and all assignments of level ≥ n

(equivalently: backjump to n − 1)

◮ Backjump: A is a Boolean assignment L:backjump to the level of E and add L with justification E :if E ∪ {L} ⊢⊥ then E ⊢ L

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 46: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Example I

P = {f (select(store(a, i , v), j)) ≃ w , f (u) ≃ w − 2, i ≃ j , u ≃ v}◮ Decide: u ← c, v ← c

◮ Decide: select(store(a, i , v), j) ← c, w ← 0

◮ Decide: f (select(store(a, i , v), j)) ← 0, f (u)← −2◮ Deduce: u ≃ select(store(a, i , v), j),

f (u) 6≃ f (select(store(a, i , v), j))

◮ Conflict: the last two yield ⊥ in IEUF◮ Backjump: flips f (u) 6≃ f (select(store(a, i , v), j)) and clears

the trail saving u ≃ select(store(a, i , v), j) and its justification

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 47: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Example II

P = {f (select(store(a, i , v), j)) ≃ w , f (u) ≃ w − 2, i ≃ j , u ≃ v}◮ Decide: u ← c, v ← c, select(store(a, i , v), j) ← c

◮ Deduce: u ≃ select(store(a, i , v), j)

◮ Deduce: f (u) ≃ f (select(store(a, i , v), j))

◮ Deduce: f (u) ≃ w , w − 2 ≃ w by transitivity of equality

◮ Conflict: w − 2 ≃ w yields ⊥ in ILRA◮ Resolve: f (u) ≃ w , f (u) ≃ w − 2

◮ Resolve: f (u) ≃ f (select(store(a, i , v), j)),f (select(store(a, i , v), j)) ≃ w , f (u) ≃ w − 2

◮ Resolve: u ≃ select(store(a, i , v), j),f (select(store(a, i , v), j)) ≃ w , f (u) ≃ w − 2

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 48: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Example III

P = {f (select(store(a, i , v), j)) ≃ w , f (u) ≃ w − 2, i ≃ j , u ≃ v}◮ Backjump: flips u ≃ select(store(a, i , v), j) and jumps back to

level 0

◮ u 6≃ select(store(a, i , v), j)

◮ Decide: u ← c, v ← c, select(store(a, i , v), j) ← d

◮ Deduce: v 6≃ select(store(a, i , v), j)

◮ Conflict: i ≃ j , v 6≃ select(store(a, i , v), j) yield ⊥ in IArr

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 49: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Example IV

P = {f (select(store(a, i , v), j)) ≃ w , f (u) ≃ w − 2, i ≃ j , u ≃ v}◮ u 6≃ select(store(a, i , v), j)

◮ Backjump: flips v 6≃ select(store(a, i , v), j) and jumps back tolevel 0

◮ v ≃ select(store(a, i , v), j)

◮ Conflict: u ≃ v , u 6≃ select(store(a, i , v), j), andv ≃ select(store(a, i , v), j) yield ⊥ at level 0

◮ Fail: P is unsatisfiable

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 50: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Conflict-resolution rules: explanation rules

◮ The explanation rules unfolds the conflict by replacing anassignment in the conflict E with its justification H

◮ Resolve applies if H does not contain a first-order assignmentA of the same level as E

◮ Otherwise UndoDecide applies:there are two Boolean assignments L and F both dependingon A; the rule undoes A and flips either L or F

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 51: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Example I

{x > 1 ∨ y < 0, x < −1 ∨ y > 0}◮ Decide: x ← 0

◮ Deduce: (x > 1)← false, (x < −1)← false

◮ Deduce: y < 0, y > 0

◮ Conflict: 0 < 0

◮ Resolve: {y < 0, y > 0}◮ Resolve: {x > 1 ∨ y < 0, x < −1 ∨ y > 0,

x > 1← false, x < −1← false}

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 52: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Example II

{x > 1 ∨ y < 0, x < −1 ∨ y > 0}◮ UndoDecide: x > 1

◮ Decide: x ← 2

◮ Deduce: (x < −1)← false

◮ Deduce: y > 0

◮ Decide: y ← 1

◮ Deduce: (y < 0)← false

◮ Satisfiable

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 53: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

Three main theorems

◮ Soundness: if CDSAT returns unsatisfiable, there is no model

◮ Termination: CDSAT is guaranteed to terminate if the globalbasis is finite

◮ Completeness: if CDSAT terminates without returningunsatisfiable, there is a model

Maria Paola Bonacina CDSAT: conflict-driven theory combination

Page 54: CDSAT: conflict-driven theory combination1 · A paradigm of conflict-driven reasoning Conflict-driven reasoning in theory combination The CDSAT inference system Model-based reasoning

A paradigm of conflict-driven reasoningConflict-driven reasoning in theory combination

The CDSAT inference system

References

◮ Maria Paola Bonacina, Stephane Graham-Lengrand, andNatarajan Shankar. Satisfiability modulo theories andassignments. In the Proceedings of CADE-26, LNAI 10395,42–59, Springer, August 2017.

◮ Maria Paola Bonacina, Stephane Graham-Lengrand, andNatarajan Shankar. A model-constructing framework fortheory combination. Research Report No. 99/2016,Dipartimento di Informatica, Universita degli Studi di Verona,and Technical Report, SRI International, andCNRS–INRIA–Ecole Polytechnique, November 2016 (revisedAugust 2017), 1–48.

Maria Paola Bonacina CDSAT: conflict-driven theory combination