Proofs in Conflict-Driven Theory Combination Maria Paola Bonacina, - - PowerPoint PPT Presentation

proofs in conflict driven theory combination
SMART_READER_LITE
LIVE PREVIEW

Proofs in Conflict-Driven Theory Combination Maria Paola Bonacina, - - PowerPoint PPT Presentation

Proofs in Conflict-Driven Theory Combination Maria Paola Bonacina, Stphane Graham-Lengrand, and Natarajan Shankar CPP2018, 9th January 2018 1/30 Context: Satisfiability Modulo Theories (SMT) CDCL (Conflict-Driven Clause Learning)


slide-1
SLIDE 1

Proofs in Conflict-Driven Theory Combination

Maria Paola Bonacina, Stéphane Graham-Lengrand, and Natarajan Shankar CPP’2018, 9th January 2018

1/30

slide-2
SLIDE 2

Context: Satisfiability Modulo Theories (SMT)

CDCL (Conflict-Driven Clause Learning)

◮ procedure for deciding the satisfiability of Boolean formulae ◮ uses assignments of Boolean values to variables, e.g., l←true

MCSAT (Model-Constructing Satisfiability) [dMJ13, Jov17]

◮ generalises CDCL to theory reasoning ◮ uses first-order assignments, e.g., x←

√ 2

2/30

slide-3
SLIDE 3

Context: Satisfiability Modulo Theories (SMT)

CDCL (Conflict-Driven Clause Learning)

◮ procedure for deciding the satisfiability of Boolean formulae ◮ uses assignments of Boolean values to variables, e.g., l←true

MCSAT (Model-Constructing Satisfiability) [dMJ13, Jov17]

◮ generalises CDCL to theory reasoning ◮ uses first-order assignments, e.g., x←

√ 2 CDSAT (Conflict-Driven Satisfiability) [BGLS17]

◮ generalises MCSAT: generic combinations of abstract theories ◮ can also use first-order assignments ◮ models theory reasoning with modules made of inference rules

2/30

slide-4
SLIDE 4

Context: Satisfiability Modulo Theories (SMT)

CDCL (Conflict-Driven Clause Learning)

◮ procedure for deciding the satisfiability of Boolean formulae ◮ uses assignments of Boolean values to variables, e.g., l←true

MCSAT (Model-Constructing Satisfiability) [dMJ13, Jov17]

◮ generalises CDCL to theory reasoning ◮ uses first-order assignments, e.g., x←

√ 2 CDSAT (Conflict-Driven Satisfiability) [BGLS17]

◮ generalises MCSAT: generic combinations of abstract theories ◮ can also use first-order assignments ◮ models theory reasoning with modules made of inference rules

MCSAT and CDSAT can explicitly provide, for satisfiable formulae, the model’s assignments of values to variables

2/30

slide-5
SLIDE 5

Context: Satisfiability Modulo Theories (SMT)

CDCL (Conflict-Driven Clause Learning)

◮ procedure for deciding the satisfiability of Boolean formulae ◮ uses assignments of Boolean values to variables, e.g., l←true

MCSAT (Model-Constructing Satisfiability) [dMJ13, Jov17]

◮ generalises CDCL to theory reasoning ◮ uses first-order assignments, e.g., x←

√ 2 CDSAT (Conflict-Driven Satisfiability) [BGLS17]

◮ generalises MCSAT: generic combinations of abstract theories ◮ can also use first-order assignments ◮ models theory reasoning with modules made of inference rules

MCSAT and CDSAT can explicitly provide, for satisfiable formulae, the model’s assignments of values to variables This paper concerns the dual situation of unsatisfiable formulae: there exists a proof (of the formula’s negation)

2/30

slide-6
SLIDE 6

Questions addressed

◮ Which information does CDSAT need to record, during a run,

in order to justify an answer “unsat” by a proof?

3/30

slide-7
SLIDE 7

Questions addressed

◮ Which information does CDSAT need to record, during a run,

in order to justify an answer “unsat” by a proof?

◮ Is the production of a proof by CDSAT tied to a particular

proof format?

3/30

slide-8
SLIDE 8

Questions addressed

◮ Which information does CDSAT need to record, during a run,

in order to justify an answer “unsat” by a proof?

◮ Is the production of a proof by CDSAT tied to a particular

proof format?

◮ Can we trust a CDSAT implementation to produce correct

answers “unsat” without building proofs in memory? If so which parts of the implementation are critical (i.e., can affect the correctness of an answer “unsat”)?

3/30

slide-9
SLIDE 9

Questions addressed

◮ Which information does CDSAT need to record, during a run,

in order to justify an answer “unsat” by a proof?

◮ Is the production of a proof by CDSAT tied to a particular

proof format?

◮ Can we trust a CDSAT implementation to produce correct

answers “unsat” without building proofs in memory? If so which parts of the implementation are critical (i.e., can affect the correctness of an answer “unsat”)?

◮ Is the issue of producing proofs, or correct answers “unsat”,

related to learning mechanisms, as in pure SAT-solving?

3/30

slide-10
SLIDE 10

Questions addressed

◮ Which information does CDSAT need to record, during a run,

in order to justify an answer “unsat” by a proof?

◮ Is the production of a proof by CDSAT tied to a particular

proof format?

◮ Can we trust a CDSAT implementation to produce correct

answers “unsat” without building proofs in memory? If so which parts of the implementation are critical (i.e., can affect the correctness of an answer “unsat”)?

◮ Is the issue of producing proofs, or correct answers “unsat”,

related to learning mechanisms, as in pure SAT-solving?

◮ Actually, is there a learning mechanism on CDSAT?

3/30

slide-11
SLIDE 11

Questions addressed

◮ Which information does CDSAT need to record, during a run,

in order to justify an answer “unsat” by a proof?

◮ Is the production of a proof by CDSAT tied to a particular

proof format?

◮ Can we trust a CDSAT implementation to produce correct

answers “unsat” without building proofs in memory? If so which parts of the implementation are critical (i.e., can affect the correctness of an answer “unsat”)?

◮ Is the issue of producing proofs, or correct answers “unsat”,

related to learning mechanisms, as in pure SAT-solving?

◮ Actually, is there a learning mechanism on CDSAT?

CADE’2017 version of CDSAT: no clause learning mechanism

3/30

slide-12
SLIDE 12

Questions addressed

◮ Which information does CDSAT need to record, during a run,

in order to justify an answer “unsat” by a proof?

◮ Is the production of a proof by CDSAT tied to a particular

proof format?

◮ Can we trust a CDSAT implementation to produce correct

answers “unsat” without building proofs in memory? If so which parts of the implementation are critical (i.e., can affect the correctness of an answer “unsat”)?

◮ Is the issue of producing proofs, or correct answers “unsat”,

related to learning mechanisms, as in pure SAT-solving?

◮ Actually, is there a learning mechanism on CDSAT?

CADE’2017 version of CDSAT: no clause learning mechanism By design: simpler to present + emphasis that learning is not needed for completeness

3/30

slide-13
SLIDE 13

Questions addressed

◮ Which information does CDSAT need to record, during a run,

in order to justify an answer “unsat” by a proof?

◮ Is the production of a proof by CDSAT tied to a particular

proof format?

◮ Can we trust a CDSAT implementation to produce correct

answers “unsat” without building proofs in memory? If so which parts of the implementation are critical (i.e., can affect the correctness of an answer “unsat”)?

◮ Is the issue of producing proofs, or correct answers “unsat”,

related to learning mechanisms, as in pure SAT-solving?

◮ Actually, is there a learning mechanism on CDSAT?

CADE’2017 version of CDSAT: no clause learning mechanism By design: simpler to present + emphasis that learning is not needed for completeness Here, we start by adding learning mechanisms to CDSAT.

3/30

slide-14
SLIDE 14

Conflict-driven theory combination The CDSAT system - with learning Proof production

4/30

slide-15
SLIDE 15
  • 1. Conflict-driven theory combination

5/30

slide-16
SLIDE 16

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy.

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

6/30

slide-17
SLIDE 17

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy.

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

6/30

slide-18
SLIDE 18

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy.

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

6/30

slide-19
SLIDE 19

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy.

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

6/30

slide-20
SLIDE 20

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy.

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

. . . . . .

6/30

slide-21
SLIDE 21

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy.

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

. . . . . . conflict

6/30

slide-22
SLIDE 22

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

. . . . . . d e c i s i

  • n

m a k i n g , p r

  • p

a g a t i

  • n

s b a c k j u m p i n g , c

  • n

f l i c t a n a l y s i s

6/30

slide-23
SLIDE 23

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified a ⇒ b b ⇒ a a ⇒ b b ⇒ a

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

6/30

slide-24
SLIDE 24

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified a ⇒ b b ⇒ a a ⇒ b b ⇒ a

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

?a

6/30

slide-25
SLIDE 25

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified a ⇒ b b ⇒ a a ⇒ b b ⇒ a

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

?a b

6/30

slide-26
SLIDE 26

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified a ⇒ b b ⇒ a a ⇒ b b ⇒ a

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

conflict

?a b

6/30

slide-27
SLIDE 27

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified a ⇒ b b ⇒ a a ⇒ b b ⇒ a a

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

conflict fixed a

6/30

slide-28
SLIDE 28

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified a ⇒ b b ⇒ a a ⇒ b b ⇒ a a

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

a b

6/30

slide-29
SLIDE 29

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified a ⇒ b b ⇒ a a ⇒ b b ⇒ a a

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

conflict a b

6/30

slide-30
SLIDE 30

Conflict-driven reasoning

2-player game to determine whether a formula is satisfiable. It involves a trail where a putative model is being specified. It relies on a notion of conflict between the putative model and the formula it should satisfy. Archetype of conflict-driven reasoning: CDCL a conflict occurs when a clause is falsified a ⇒ b b ⇒ a a ⇒ b b ⇒ a a ⊥

m

  • d

e l b u i l d i n g SAT

player

UNSAT

player

p r

  • f

b u i l d i n g

6/30

slide-31
SLIDE 31

Conflict-driven reasoning can be used for (other) theories

l0

  • (−2·x − y < 0),

l1

  • (x + y < 0),

l2

  • (x < −1)

unsatisfiable in Linear Rational Arithmetic (LRA).

7/30

slide-32
SLIDE 32

Conflict-driven reasoning can be used for (other) theories

l0

  • (−2·x − y < 0),

l1

  • (x + y < 0),

l2

  • (x < −1)

unsatisfiable in Linear Rational Arithmetic (LRA).

◮ Guess a value, e.g., y←0

7/30

slide-33
SLIDE 33

Conflict-driven reasoning can be used for (other) theories

l0

  • (−2·x − y < 0),

l1

  • (x + y < 0),

l2

  • (x < −1)

unsatisfiable in Linear Rational Arithmetic (LRA).

◮ Guess a value, e.g., y←0

Then l0 yields lower bound x > 0

7/30

slide-34
SLIDE 34

Conflict-driven reasoning can be used for (other) theories

l0

  • (−2·x − y < 0),

l1

  • (x + y < 0),

l2

  • (x < −1)

unsatisfiable in Linear Rational Arithmetic (LRA).

◮ Guess a value, e.g., y←0

Then l0 yields lower bound x > 0 Together with l2, range of possible values for x is empty What to do? just undo y←0 and remember that y = 0?

7/30

slide-35
SLIDE 35

Conflict-driven reasoning can be used for (other) theories

l0

  • (−2·x − y < 0),

l1

  • (x + y < 0),

l2

  • (x < −1)

unsatisfiable in Linear Rational Arithmetic (LRA).

◮ Guess a value, e.g., y←0

Then l0 yields lower bound x > 0 Together with l2, range of possible values for x is empty What to do? just undo y←0 and remember that y = 0?

◮ No! Clash of bounds suggests a better conflict explanation,

by inferring l0 + 2l2, i.e.,

l3

  • (−y < −2)

It rules out y←0, but also many values that would fail for the same reasons.

7/30

slide-36
SLIDE 36

Conflict-driven reasoning can be used for (other) theories

l0

  • (−2·x − y < 0),

l1

  • (x + y < 0),

l2

  • (x < −1)

unsatisfiable in Linear Rational Arithmetic (LRA).

◮ Guess a value, e.g., y←0

Then l0 yields lower bound x > 0 Together with l2, range of possible values for x is empty What to do? just undo y←0 and remember that y = 0?

◮ No! Clash of bounds suggests a better conflict explanation,

by inferring l0 + 2l2, i.e.,

l3

  • (−y < −2)

It rules out y←0, but also many values that would fail for the same reasons.

◮ Now undo the guess but keep l3.

7/30

slide-37
SLIDE 37

Conflict-driven reasoning can be used for (other) theories

l0

  • (−2·x − y < 0),

l1

  • (x + y < 0),

l2

  • (x < −1)

unsatisfiable in Linear Rational Arithmetic (LRA).

◮ Guess a value, e.g., y←0

Then l0 yields lower bound x > 0 Together with l2, range of possible values for x is empty What to do? just undo y←0 and remember that y = 0?

◮ No! Clash of bounds suggests a better conflict explanation,

by inferring l0 + 2l2, i.e.,

l3

  • (−y < −2)

It rules out y←0, but also many values that would fail for the same reasons.

◮ Now undo the guess but keep l3. ◮ and so on. . .

(when there is no guess to undo, problem is UNSAT)

7/30

slide-38
SLIDE 38

Traditional architecture of SMT-solving

SAT-solver (CDCL) Comb.∗ T1 T2 T3 T4 T5 * e.g. equality sharing / Nelson-Oppen [NO79]

8/30

slide-39
SLIDE 39

In CDSAT

. . . the theory combination is organised directly in the main conflict-driven loop: As in MCSAT, trail contains

◮ Boolean assignments

a ← true

◮ First-order assignments

y ← 3/4 T2 T1 Bool Bool T1 T2

m

  • d

e l b u i l d i n g p r

  • f

b u i l d i n g

. . . . . .

9/30

slide-40
SLIDE 40

In CDSAT

. . . the theory combination is organised directly in the main conflict-driven loop: As in MCSAT, trail contains

◮ Boolean assignments

a ← true

◮ First-order assignments

y ← 3/4 Features of conflict-driven satisfiability:

◮ Boolean theory can have the

same status as other theories.

◮ Theory-specific reasoning often consists of fine-grained

reasoning inferences, e.g., Fourier-Motzkin resolution for LRA: (t1 < x), (x < t2) ⊢ ⊢ ⊢ t1 < t2 T2 T1 Bool Bool T1 T2

m

  • d

e l b u i l d i n g p r

  • f

b u i l d i n g

. . . . . .

9/30

slide-41
SLIDE 41
  • 2. The CDSAT system - with learning

10/30

slide-42
SLIDE 42

What is a theory module?

A set of inferences of the form (t1←c1), . . . , (tk←ck) ⊢ ⊢ ⊢T (l←b) where

◮ each ti←ci is a single T -assignment

(a term ti and a T -value ci of matching sorts)

◮ l←b is a single Boolean assignment

(a term l of sort Bool and a truth value b)

11/30

slide-43
SLIDE 43

What is a theory module?

A set of inferences of the form (t1←c1), . . . , (tk←ck) ⊢ ⊢ ⊢T (l←b) where

◮ each ti←ci is a single T -assignment

(a term ti and a T -value ci of matching sorts)

◮ l←b is a single Boolean assignment

(a term l of sort Bool and a truth value b) Abbreviations: (l←true) as l and (l←false) as l

11/30

slide-44
SLIDE 44

What is a theory module?

A set of inferences of the form (t1←c1), . . . , (tk←ck) ⊢ ⊢ ⊢T (l←b) where

◮ each ti←ci is a single T -assignment

(a term ti and a T -value ci of matching sorts)

◮ l←b is a single Boolean assignment

(a term l of sort Bool and a truth value b) Abbreviations: (l←true) as l and (l←false) as l

◮ Soundness requirement:

Every model of the premisses is a model of the conclusion: (t1←c1), . . . , (tk←ck) | = (l←b)

11/30

slide-45
SLIDE 45

What is a theory module?

A set of inferences of the form (t1←c1), . . . , (tk←ck) ⊢ ⊢ ⊢T (l←b) where

◮ each ti←ci is a single T -assignment

(a term ti and a T -value ci of matching sorts)

◮ l←b is a single Boolean assignment

(a term l of sort Bool and a truth value b) Abbreviations: (l←true) as l and (l←false) as l

◮ Soundness requirement:

Every model of the premisses is a model of the conclusion: (t1←c1), . . . , (tk←ck) | = (l←b) Examples: (x← √ 2), (y← √ 2) ⊢ ⊢ ⊢NLRA (x · y ≃ 2) (evaluation inference) (l1 ∨ · · · ∨ ln), l1 . . . , ln−1 ⊢ ⊢ ⊢Bool ln (unit propagation)

11/30

slide-46
SLIDE 46

What is a theory module? (Equality inferences)

All theory modules have the equality inferences: t1←c1, t2←c2 ⊢ ⊢ ⊢T t1 ≃ t2 if c1 and c2 are the same value t1←c1, t2←c2 ⊢ ⊢ ⊢T t1 ≃ t2 if c1 and c2 are distinct values ⊢ ⊢ ⊢T t1 ≃ t1 reflexivity t1 ≃ t2 ⊢ ⊢ ⊢T t2 ≃ t1 symmetry t1 ≃ t2, t2 ≃ t3 ⊢ ⊢ ⊢T t1 ≃ t3 transitivity

12/30

slide-47
SLIDE 47

CDSAT states

Search states: simply trails. A trail is a stack of justified assignments H ⊢(t←c) and decisions ?(t←c) coming from different theories Justification H: a set of assignments that appear earlier on the trail

13/30

slide-48
SLIDE 48

CDSAT states

Search states: simply trails. A trail is a stack of justified assignments H ⊢(t←c) and decisions ?(t←c) coming from different theories Justification H: a set of assignments that appear earlier on the trail Example (trail grows from left to right):

∅⊢(x ≃ z), ∅⊢(y ≃ z), ?(x←

√ 2), ?(y←blue), ?(x←red), H ⊢(x = y) where H is {(y←blue), (x←red)} Everything is on the trail, including assertions from the input problem, with empty justifications (e.g., ∅⊢(C←true) for an input clause C),

13/30

slide-49
SLIDE 49

CDSAT states

Search states: simply trails. A trail is a stack of justified assignments H ⊢(t←c) and decisions ?(t←c) coming from different theories Justification H: a set of assignments that appear earlier on the trail Example (trail grows from left to right):

∅⊢(x ≃ z), ∅⊢(y ≃ z), ?(x←

√ 2), ?(y←blue), ?(x←red), H ⊢(x = y) where H is {(y←blue), (x←red)} Everything is on the trail, including assertions from the input problem, with empty justifications (e.g., ∅⊢(C←true) for an input clause C), Conflict states: Γ; H, trail Γ + set H of trail assignments that are in conflict

13/30

slide-50
SLIDE 50

CDSAT states

Search states: simply trails. A trail is a stack of justified assignments H ⊢(t←c) and decisions ?(t←c) coming from different theories Justification H: a set of assignments that appear earlier on the trail Example (trail grows from left to right):

∅⊢(x ≃ z), ∅⊢(y ≃ z), ?(x←

√ 2), ?(y←blue), ?(x←red), H ⊢(x = y) where H is {(y←blue), (x←red)} Everything is on the trail, including assertions from the input problem, with empty justifications (e.g., ∅⊢(C←true) for an input clause C), Conflict states: Γ; H, trail Γ + set H of trail assignments that are in conflict In this paper, new rule for solving/exiting conflicts: Learn

13/30

slide-51
SLIDE 51

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic

14/30

slide-52
SLIDE 52

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

14/30

slide-53
SLIDE 53

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0

14/30

slide-54
SLIDE 54

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1

14/30

slide-55
SLIDE 55

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2

14/30

slide-56
SLIDE 56

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3

14/30

slide-57
SLIDE 57

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4

14/30

slide-58
SLIDE 58

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

14/30

slide-59
SLIDE 59

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3)

14/30

slide-60
SLIDE 60

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3) First conflict: Γ; (¬l2∨¬l4∨¬l5), l2, l4, l5

14/30

slide-61
SLIDE 61

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3) First conflict: Γ; (¬l2∨¬l4∨¬l5), l2, l4, l5 Resolving l5: Γ; (¬l2∨¬l4∨¬l5), l2, l4

14/30

slide-62
SLIDE 62

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3) First conflict: Γ; (¬l2∨¬l4∨¬l5), l2, l4, l5 Resolving l5: Γ; (¬l2∨¬l4∨¬l5), l2, l4 In first conflict, both l4 and l5 depend on the latest decision ?l4. After applying Resolve, only l4 does. Time to stop conflict analysis.

14/30

slide-63
SLIDE 63

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3) First conflict: Γ; (¬l2∨¬l4∨¬l5), l2, l4, l5 Resolving l5: Γ; (¬l2∨¬l4∨¬l5), l2, l4 In first conflict, both l4 and l5 depend on the latest decision ?l4. After applying Resolve, only l4 does. Time to stop conflict analysis. Rule Learn can exit the conflict with trail Γ0, ?A1, ?l2,

H ⊢l4

where H is {(¬l2∨¬l4∨¬l5), l2}

14/30

slide-64
SLIDE 64

Example: exiting a conflict without learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3) First conflict: Γ; (¬l2∨¬l4∨¬l5), l2, l4, l5 Resolving l5: Γ; (¬l2∨¬l4∨¬l5), l2, l4 In first conflict, both l4 and l5 depend on the latest decision ?l4. After applying Resolve, only l4 does. Time to stop conflict analysis. Rule Learn can exit the conflict with trail Γ0, ?A1, ?l2,

H ⊢l4

where H is {(¬l2∨¬l4∨¬l5), l2}

14/30

slide-65
SLIDE 65

Example: exiting a conflict learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3) First conflict: Γ; (¬l2∨¬l4∨¬l5), l2, l4, l5 Resolving l5: Γ; (¬l2∨¬l4∨¬l5), l2, l4 In first conflict, both l4 and l5 depend on the latest decision ?l4. After applying Resolve, only l4 does. Time to stop conflict analysis. Rule Learn can exit the conflict and learn a clause: Γ0, ?A1, ?l2,

H′ ⊢(¬l2 ∨ ¬l4)

where H′ is {(¬l2∨¬l4∨¬l5)}

14/30

slide-66
SLIDE 66

Example: exiting a conflict learning a clause

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3) First conflict: Γ; (¬l2∨¬l4∨¬l5), l2, l4, l5 Resolving l5: Γ; (¬l2∨¬l4∨¬l5), l2, l4 In first conflict, both l4 and l5 depend on the latest decision ?l4. After applying Resolve, only l4 does. Time to stop conflict analysis. Rule Learn can exit the conflict and learn a clause: Γ0, ?A1, ?l2,

H′ ⊢(¬l2 ∨ ¬l4)

where H′ is {(¬l2∨¬l4∨¬l5)} Then Deduce can derive l4 as before: Γ0, ?A1, ?l2,

H′ ⊢(¬l2 ∨ ¬l4), {(¬l2 ∨ ¬l4), l2}⊢l4

14/30

slide-67
SLIDE 67

Example: exiting a conflict learning a clause & restarting

Input problem H0 including: (¬l2∨¬l4∨¬l5) with l4 = (x≤y) and l5 = (f (x)≤f (y)) in a theory where f is monotonic Initial trail Γ0 including:

∅⊢(¬l2∨¬l4∨¬l5)

Search rules extend Γ0 into Γ = Γ0, ?A1, ?l2, ?A3, ?l4,

l4 ⊢l5

(involving unrelated decisions A1 and A3) First conflict: Γ; (¬l2∨¬l4∨¬l5), l2, l4, l5 Resolving l5: Γ; (¬l2∨¬l4∨¬l5), l2, l4 In first conflict, both l4 and l5 depend on the latest decision ?l4. After applying Resolve, only l4 does. Time to stop conflict analysis. Rule Learn can exit the conflict and learn a clause, and restart: Γ0,

H′ ⊢(¬l2 ∨ ¬l4)

where H′ is {(¬l2∨¬l4∨¬l5)}

14/30

slide-68
SLIDE 68

The Learn rule introduced in this paper

Γ; E ⊎ H − → Γ′, E ⊢L if L is a “clausal form of H”, L / ∈ Γ, L / ∈ Γ Γ′: a pruning of Γ undoing at least the latest decision involved, E ⊆ Γ′

15/30

slide-69
SLIDE 69

The Learn rule introduced in this paper

Γ; E ⊎ H − → Γ′, E ⊢L if L is a “clausal form of H”, L / ∈ Γ, L / ∈ Γ Γ′: a pruning of Γ undoing at least the latest decision involved, E ⊆ Γ′

15/30

slide-70
SLIDE 70

The Learn rule introduced in this paper

Γ; E ⊎ H − → Γ′, E ⊢L if L is a “clausal form of H”, L / ∈ Γ, L / ∈ Γ Γ′: a pruning of Γ undoing at least the latest decision involved, E ⊆ Γ′ “Clausal forms of H” reify H in Boolean logic: ((

(l←true)∈H l) ∧ ( (l←false)∈H ¬l))←false

15/30

slide-71
SLIDE 71

The Learn rule introduced in this paper

Γ; E ⊎ H − → Γ′, E ⊢L if L is a “clausal form of H”, L / ∈ Γ, L / ∈ Γ Γ′: a pruning of Γ undoing at least the latest decision involved, E ⊆ Γ′ “Clausal forms of H” reify H in Boolean logic: ((

(l←true)∈H l) ∧ ( (l←false)∈H ¬l))←false

((

(l←true)∈H ¬l) ∨ ( (l←false)∈H l))←true

15/30

slide-72
SLIDE 72

The Learn rule introduced in this paper

Γ; E ⊎ H − → Γ′, E ⊢L if L is a “clausal form of H”, L / ∈ Γ, L / ∈ Γ Γ′: a pruning of Γ undoing at least the latest decision involved, E ⊆ Γ′ “Clausal forms of H” reify H in Boolean logic: ((

(l←true)∈H l) ∧ ( (l←false)∈H ¬l))←false

((

(l←true)∈H ¬l) ∨ ( (l←false)∈H l))←true

This rule

◮ generalises the CADE’2017 one (sufficient for completeness) ◮ models clause learning by reifying (Boolean parts of) conflicts ◮ models clause learning + restarts,

a common practice in SAT/SMT-solving

15/30

slide-73
SLIDE 73

The Learn rule introduced in this paper

Γ; E ⊎ H − → Γ′, E ⊢L if L is a “clausal form of H”, L / ∈ Γ, L / ∈ Γ Γ′: a pruning of Γ undoing at least the latest decision involved, E ⊆ Γ′ “Clausal forms of H” reify H in Boolean logic: ((

(l←true)∈H l) ∧ ( (l←false)∈H ¬l))←false

((

(l←true)∈H ¬l) ∨ ( (l←false)∈H l))←true

This rule

◮ generalises the CADE’2017 one (sufficient for completeness) ◮ models clause learning by reifying (Boolean parts of) conflicts ◮ models clause learning + restarts,

a common practice in SAT/SMT-solving Which version to apply depends on your search strategy (particularly for restarts)

15/30

slide-74
SLIDE 74

The Learn rule introduced in this paper

Γ; E ⊎ H − → Γ′, E ⊢L if L is a “clausal form of H”, L / ∈ Γ, L / ∈ Γ Γ′: a pruning of Γ undoing at least the latest decision involved, E ⊆ Γ′ “Clausal forms of H” reify H in Boolean logic: ((

(l←true)∈H l) ∧ ( (l←false)∈H ¬l))←false

((

(l←true)∈H ¬l) ∨ ( (l←false)∈H l))←true

This rule

◮ generalises the CADE’2017 one (sufficient for completeness) ◮ models clause learning by reifying (Boolean parts of) conflicts ◮ models clause learning + restarts,

a common practice in SAT/SMT-solving Which version to apply depends on your search strategy (particularly for restarts) All version are OK with respect to termination of CDSAT

15/30

slide-75
SLIDE 75
  • 3. Proof production

16/30

slide-76
SLIDE 76

Soundness invariants, and rules that may affect them

◮ For every assignment H ⊢A on the trail, H |

= A;

◮ For every conflict state Γ; E, E |

= ⊥.

17/30

slide-77
SLIDE 77

Soundness invariants, and rules that may affect them

◮ For every assignment H ⊢A on the trail, H |

= A;

◮ For every conflict state Γ; E, E |

= ⊥. Next step: keep track of invariant via proof-theoretical information

17/30

slide-78
SLIDE 78

Soundness invariants, and rules that may affect them

◮ For every assignment H ⊢A on the trail, H |

= A;

◮ For every conflict state Γ; E, E |

= ⊥. Next step: keep track of invariant via proof-theoretical information Let T be a theory with a specific T -module. Deduce Γ − → Γ, J ⊢(t←b) if J ⊢ ⊢ ⊢T (t←b) and J ⊆ Γ, and t←b is not in Γ

17/30

slide-79
SLIDE 79

Soundness invariants, and rules that may affect them

◮ For every assignment H ⊢A on the trail, H |

= A;

◮ For every conflict state Γ; E, E |

= ⊥. Next step: keep track of invariant via proof-theoretical information Let T be a theory with a specific T -module. Deduce Γ − → Γ, J ⊢(t←b) if J ⊢ ⊢ ⊢T (t←b) and J ⊆ Γ, and t←b is not in Γ Conflict Γ − → Γ; J, (t←b) if J ⊢ ⊢ ⊢T (t←b) and J ⊆ Γ, and t←b is in Γ

17/30

slide-80
SLIDE 80

Soundness invariants, and rules that may affect them

◮ For every assignment H ⊢A on the trail, H |

= A;

◮ For every conflict state Γ; E, E |

= ⊥. Next step: keep track of invariant via proof-theoretical information Let T be a theory with a specific T -module. Deduce Γ − → Γ, J ⊢(t←b) if J ⊢ ⊢ ⊢T (t←b) and J ⊆ Γ, and t←b is not in Γ Conflict Γ − → Γ; J, (t←b) if J ⊢ ⊢ ⊢T (t←b) and J ⊆ Γ, and t←b is in Γ Resolve Γ; E ⊎ {A} − → Γ; E∪H if H ⊢A is in Γ

17/30

slide-81
SLIDE 81

Soundness invariants, and rules that may affect them

◮ For every assignment H ⊢A on the trail, H |

= A;

◮ For every conflict state Γ; E, E |

= ⊥. Next step: keep track of invariant via proof-theoretical information Let T be a theory with a specific T -module. Deduce Γ − → Γ, J ⊢(t←b) if J ⊢ ⊢ ⊢T (t←b) and J ⊆ Γ, and t←b is not in Γ Conflict Γ − → Γ; J, (t←b) if J ⊢ ⊢ ⊢T (t←b) and J ⊆ Γ, and t←b is in Γ Resolve Γ; E ⊎ {A} − → Γ; E∪H if H ⊢A is in Γ Learn Γ; E ⊎ H − → Γ′, E ⊢L if L is a “clausal form” of H L / ∈ Γ, L / ∈ Γ, and E ⊆ Γ′

17/30

slide-82
SLIDE 82

Theory proofs

To keep track of the soundness invariants, we need to refer to theory inferences

18/30

slide-83
SLIDE 83

Theory proofs

To keep track of the soundness invariants, we need to refer to theory inferences Each theory module comes with a “proof annotation system” (t1←c1), . . . , (tk←ck) ⊢ ⊢ ⊢T (l←b) is annotated as

a1(t1←c1), . . . , ak(tk←ck) ⊢

⊢ ⊢T jT : (l←b)

18/30

slide-84
SLIDE 84

Theory proofs

To keep track of the soundness invariants, we need to refer to theory inferences Each theory module comes with a “proof annotation system” (t1←c1), . . . , (tk←ck) ⊢ ⊢ ⊢T (l←b) is annotated as

a1(t1←c1), . . . , ak(tk←ck) ⊢

⊢ ⊢T jT : (l←b) Examples:

a1(x←

√ 2), a2(y← √ 2) ⊢ ⊢ ⊢NLRA eval({a1, a2}): (x · y ≃ 2) (evaluation inference)

a0(l1 ∨ · · · ∨ ln), a1(l1), . . . , ak−1(ln−1) ⊢

⊢ ⊢Bool UP(a0, {a1, . . . , an}): ln (unit propagation)

18/30

slide-85
SLIDE 85

Proof-terms and proof-carrying CDSAT

◮ A proof-carrying trail is a stack

◮ of justified assignments H ⊢j : (t←c) ◮ and decisions ?(t←c)

◮ A proof-carrying conflict state is of the form Γ; H ; c

. . . where j and c respectively range over Deduction proof terms j ::= in jT lem(H.c) Conflict proof term c ::= cfl(jT , a) res(j, aA.c) in annotates an input assignment, jT ranges over theory proofs for T , used for Deduce lem(H.c) annotates justified assignments that Learn places on trail (clausal forms of H), binding the identifiers of H in c cfl(jT , a) annotates a conflict when it is created by Conflict res(j, aA.c) annotates a conflict resulting from the Resolve rule, binding a in c

19/30

slide-86
SLIDE 86

Provability invariants that proof-terms keep track of

A is an input ∅ ⊢ ⊢ ⊢ in: A J ⊢ ⊢ ⊢T jT : L J ⊢ ⊢ ⊢ jT : L E ⊎ H ⊢ ⊢ ⊢ c : ⊥ L clausal form of H E ⊢ ⊢ ⊢ lem(H.c): L J ⊢ ⊢ ⊢T jT : L J ∪ {aL} ⊢ ⊢ ⊢ cfl(jT , a): ⊥ H ⊢ ⊢ ⊢ j : A E, aA ⊢ ⊢ ⊢ c : ⊥ E ∪ H ⊢ ⊢ ⊢ res(j, aA.c): ⊥

20/30

slide-87
SLIDE 87

Provability invariants that proof-terms keep track of

A is an input ∅ ⊢ ⊢ ⊢ in: A J ⊢ ⊢ ⊢T jT : L J ⊢ ⊢ ⊢ jT : L E ⊎ H ⊢ ⊢ ⊢ c : ⊥ L clausal form of H E ⊢ ⊢ ⊢ lem(H.c): L J ⊢ ⊢ ⊢T jT : L J ∪ {aL} ⊢ ⊢ ⊢ cfl(jT , a): ⊥ H ⊢ ⊢ ⊢ j : A E, aA ⊢ ⊢ ⊢ c : ⊥ E ∪ H ⊢ ⊢ ⊢ res(j, aA.c): ⊥ Rules of CDSAT are adapted so as to use those proof-terms, and the soundness invariants are materialised as:

Theorem

◮ For every assignment H ⊢j : A on the trail,

H ⊢ ⊢ ⊢ j : A

◮ For every conflict state Γ; E ; c,

E ⊢ ⊢ ⊢ c : ⊥.

20/30

slide-88
SLIDE 88

Provability invariants that proof-terms keep track of

A is an input ∅ ⊢ ⊢ ⊢ in: A J ⊢ ⊢ ⊢T jT : L J ⊢ ⊢ ⊢ jT : L E ⊎ H ⊢ ⊢ ⊢ c : ⊥ L clausal form of H E ⊢ ⊢ ⊢ lem(H.c): L J ⊢ ⊢ ⊢T jT : L J ∪ {aL} ⊢ ⊢ ⊢ cfl(jT , a): ⊥ H ⊢ ⊢ ⊢ j : A E, aA ⊢ ⊢ ⊢ c : ⊥ E ∪ H ⊢ ⊢ ⊢ res(j, aA.c): ⊥ Rules of CDSAT are adapted so as to use those proof-terms, and the soundness invariants are materialised as:

Theorem

◮ For every assignment H ⊢j : A on the trail,

H ⊢ ⊢ ⊢ j : A

◮ For every conflict state Γ; E ; c,

E ⊢ ⊢ ⊢ c : ⊥. The proof system above can be seen as glueing a collection of inference systems (⊢ ⊢ ⊢T )T

20/30

slide-89
SLIDE 89

Provability invariants that proof-terms keep track of

A is an input ∅ ⊢ ⊢ ⊢ in: A J ⊢ ⊢ ⊢T jT : L J ⊢ ⊢ ⊢ jT : L E ⊎ H ⊢ ⊢ ⊢ c : ⊥ L clausal form of H E ⊢ ⊢ ⊢ lem(H.c): L J ⊢ ⊢ ⊢T jT : L J ∪ {aL} ⊢ ⊢ ⊢ cfl(jT , a): ⊥ H ⊢ ⊢ ⊢ j : A E, aA ⊢ ⊢ ⊢ c : ⊥ E ∪ H ⊢ ⊢ ⊢ res(j, aA.c): ⊥ Rules of CDSAT are adapted so as to use those proof-terms, and the soundness invariants are materialised as:

Theorem

◮ For every assignment H ⊢j : A on the trail,

H ⊢ ⊢ ⊢ j : A

◮ For every conflict state Γ; E ; c,

E ⊢ ⊢ ⊢ c : ⊥. The proof system above can be seen as glueing a collection of inference systems (⊢ ⊢ ⊢T )T CDSAT is a search procedure for the resulting system

20/30

slide-90
SLIDE 90

Satisfiability Modulo Assignments (SMA)

An SMT-problem with input clauses C1, . . . , Cn is treated by running CDSAT on the initial trail ∅⊢in: C1, . . . , ∅⊢in: Cn

21/30

slide-91
SLIDE 91

Satisfiability Modulo Assignments (SMA)

An SMT-problem with input clauses C1, . . . , Cn is treated by running CDSAT on the initial trail ∅⊢in: C1, . . . , ∅⊢in: Cn But the CDSAT system can accept inputs with first-order assignments, e.g: ∅⊢in: (x←3/

4), ∅⊢in: (x≤y), ∅⊢in: (y≤0)

Such problems are called SMA problems.

21/30

slide-92
SLIDE 92

Satisfiability Modulo Assignments (SMA)

An SMT-problem with input clauses C1, . . . , Cn is treated by running CDSAT on the initial trail ∅⊢in: C1, . . . , ∅⊢in: Cn But the CDSAT system can accept inputs with first-order assignments, e.g: ∅⊢in: (x←3/

4), ∅⊢in: (x≤y), ∅⊢in: (y≤0)

Such problems are called SMA problems. If there are no first-order inputs and the problem is unsat, then the final proof-term will not mention any deduction proof-term H ⊢ ⊢ ⊢ j : L nor any conflict proof H ⊢ ⊢ ⊢ c : ⊥ such that H contains a first-order assignment

21/30

slide-93
SLIDE 93

Satisfiability Modulo Assignments (SMA)

An SMT-problem with input clauses C1, . . . , Cn is treated by running CDSAT on the initial trail ∅⊢in: C1, . . . , ∅⊢in: Cn But the CDSAT system can accept inputs with first-order assignments, e.g: ∅⊢in: (x←3/

4), ∅⊢in: (x≤y), ∅⊢in: (y≤0)

Such problems are called SMA problems. If there are no first-order inputs and the problem is unsat, then the final proof-term will not mention any deduction proof-term H ⊢ ⊢ ⊢ j : L nor any conflict proof H ⊢ ⊢ ⊢ c : ⊥ such that H contains a first-order assignment Easy optimisation in that case: the construction of any such proof-term during the run can be omitted

21/30

slide-94
SLIDE 94

Satisfiability Modulo Assignments (SMA)

An SMT-problem with input clauses C1, . . . , Cn is treated by running CDSAT on the initial trail ∅⊢in: C1, . . . , ∅⊢in: Cn But the CDSAT system can accept inputs with first-order assignments, e.g: ∅⊢in: (x←3/

4), ∅⊢in: (x≤y), ∅⊢in: (y≤0)

Such problems are called SMA problems. If there are no first-order inputs and the problem is unsat, then the final proof-term will not mention any deduction proof-term H ⊢ ⊢ ⊢ j : L nor any conflict proof H ⊢ ⊢ ⊢ c : ⊥ such that H contains a first-order assignment Easy optimisation in that case: the construction of any such proof-term during the run can be omitted Theory modules do not have to provide theory proofs H ⊢ ⊢ ⊢T jT : L if H contains a first-order assign. (typically: evaluation inferences)

21/30

slide-95
SLIDE 95

Different views about proof objects

Proof-carrying CDSAT can be considered exactly as defined above, where in, jT , lem(H.c), cfl(jT , a), res(j, aA.c) are terms.

22/30

slide-96
SLIDE 96

Different views about proof objects

Proof-carrying CDSAT can be considered exactly as defined above, where in, jT , lem(H.c), cfl(jT , a), res(j, aA.c) are terms. Another proof format is desired for output? Just interpret the terms in that format after the run (proof reconstruction)

22/30

slide-97
SLIDE 97

Different views about proof objects

Proof-carrying CDSAT can be considered exactly as defined above, where in, jT , lem(H.c), cfl(jT , a), res(j, aA.c) are terms. Another proof format is desired for output? Just interpret the terms in that format after the run (proof reconstruction) Alternatively, proof-carrying CDSAT can directly manipulate proofs in the format, if equipped with the operations corresponding to the term constructs. The proof-terms denote the manipulated proofs, but are never constructed.

22/30

slide-98
SLIDE 98

Example: resolution proofs

If input contains no first-order assignments, resolution trees (or DAGs) form a proof format equipped with the right operations

23/30

slide-99
SLIDE 99

Example: resolution proofs

If input contains no first-order assignments, resolution trees (or DAGs) form a proof format equipped with the right operations Leaves of resolution proofs are labeled by

◮ either literals corresponding to input assignments ∅ ⊢

⊢ ⊢ in: A

◮ or theory lemmas corresponding to theory proofs J ⊢

⊢ ⊢T jT : L Internal nodes are obtained by applying resolution rule, corresponding to H ⊢ ⊢ ⊢ res(j, aA.c): ⊥ constructs.

23/30

slide-100
SLIDE 100

Example: resolution proofs

If input contains no first-order assignments, resolution trees (or DAGs) form a proof format equipped with the right operations Leaves of resolution proofs are labeled by

◮ either literals corresponding to input assignments ∅ ⊢

⊢ ⊢ in: A

◮ or theory lemmas corresponding to theory proofs J ⊢

⊢ ⊢T jT : L Internal nodes are obtained by applying resolution rule, corresponding to H ⊢ ⊢ ⊢ res(j, aA.c): ⊥ constructs. If input does contains first-order assignments (SMA problems) the resolution format has to be slightly extended, so that it manipulates guarded clauses of the form {(t1←c1), . . . , (tn←cn)} ⇒ C where (t1←c1), . . . , (tn←cn) are first-order assign. guarding clause C Details in the paper.

23/30

slide-101
SLIDE 101

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H.

24/30

slide-102
SLIDE 102

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H. No proof-checking.

24/30

slide-103
SLIDE 103

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H. No proof-checking. But the LCF architecture [Mil79, GMW79] can be used to ensure the correctness of answers.

24/30

slide-104
SLIDE 104

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H. No proof-checking. But the LCF architecture [Mil79, GMW79] can be used to ensure the correctness of answers. LCF in a nutshell:

◮ A type theorem is defined for provable formulae

in a module of the prover called kernel

24/30

slide-105
SLIDE 105

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H. No proof-checking. But the LCF architecture [Mil79, GMW79] can be used to ensure the correctness of answers. LCF in a nutshell:

◮ A type theorem is defined for provable formulae

in a module of the prover called kernel

◮ The definition of theorem is hidden outside the kernel

24/30

slide-106
SLIDE 106

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H. No proof-checking. But the LCF architecture [Mil79, GMW79] can be used to ensure the correctness of answers. LCF in a nutshell:

◮ A type theorem is defined for provable formulae

in a module of the prover called kernel

◮ The definition of theorem is hidden outside the kernel ◮ The kernel exports primitives to construct its inhabitants,

e.g. modus_ponens : theorem -> theorem -> theorem takes as arguments F and G, checks that F is of the form G ⇒ R, and returns R as an inhabitant of theorem.

24/30

slide-107
SLIDE 107

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H. No proof-checking. But the LCF architecture [Mil79, GMW79] can be used to ensure the correctness of answers. LCF in a nutshell:

◮ A type theorem is defined for provable formulae

in a module of the prover called kernel

◮ The definition of theorem is hidden outside the kernel ◮ The kernel exports primitives to construct its inhabitants,

e.g. modus_ponens : theorem -> theorem -> theorem takes as arguments F and G, checks that F is of the form G ⇒ R, and returns R as an inhabitant of theorem.

◮ Search procedures can be programmed using the primitives.

24/30

slide-108
SLIDE 108

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H. No proof-checking. But the LCF architecture [Mil79, GMW79] can be used to ensure the correctness of answers. LCF in a nutshell:

◮ A type theorem is defined for provable formulae

in a module of the prover called kernel

◮ The definition of theorem is hidden outside the kernel ◮ The kernel exports primitives to construct its inhabitants,

e.g. modus_ponens : theorem -> theorem -> theorem takes as arguments F and G, checks that F is of the form G ⇒ R, and returns R as an inhabitant of theorem.

◮ Search procedures can be programmed using the primitives. ◮ Bugs in these procedures cannot jeopardise the property that

any inhabitant of theorem is provable, if kernel is trusted

24/30

slide-109
SLIDE 109

LCF: answers that are correct-by-construction

Other “proof format”:

◮ A deduction proof j with H ⊢

⊢ ⊢ j : L is the pair H, L, and

◮ A conflict proof c with H ⊢

⊢ ⊢ c : ⊥ is H. No proof-checking. But the LCF architecture [Mil79, GMW79] can be used to ensure the correctness of answers. LCF in a nutshell:

◮ A type theorem is defined for provable formulae

in a module of the prover called kernel

◮ The definition of theorem is hidden outside the kernel ◮ The kernel exports primitives to construct its inhabitants,

e.g. modus_ponens : theorem -> theorem -> theorem takes as arguments F and G, checks that F is of the form G ⇒ R, and returns R as an inhabitant of theorem.

◮ Search procedures can be programmed using the primitives. ◮ Bugs in these procedures cannot jeopardise the property that

any inhabitant of theorem is provable, if kernel is trusted No proof object needs to be built in memory

24/30

slide-110
SLIDE 110

CDSAT is well-suited to the LCF approach 1/2

Given a type assign for multiple assignments and single_assign for singleton assignments, a trusted kernel defines type deduction = assign*single_assign type conflict = assign and exports type deduction type conflict in : single_assign

  • > deduction

coerc : ’k theory_handler

  • > ’k theory_proof
  • > deduction

lem : conflict

  • > assign
  • > deduction

cfl : ’k theory_handler

  • > ’k theory_proof
  • > conflict

res : deduction

  • > conflict
  • > conflict

25/30

slide-111
SLIDE 111

CDSAT is well-suited to the LCF approach 2/2

If the empty assignment is constructed in type conflict, input problem is guaranteed to be unsat, provided the kernel primitives and the implementation of theory proofs are trusted (code for the search plan does not have to be certified)

26/30

slide-112
SLIDE 112

CDSAT is well-suited to the LCF approach 2/2

If the empty assignment is constructed in type conflict, input problem is guaranteed to be unsat, provided the kernel primitives and the implementation of theory proofs are trusted (code for the search plan does not have to be certified) Answer is correct-by-construction, no proof object in memory.

26/30

slide-113
SLIDE 113

Conclusion

◮ Proof-producing CDSAT clarifies at what point CDSAT needs

to record proof information to justify answers “unsat”, and how.

27/30

slide-114
SLIDE 114

Conclusion

◮ Proof-producing CDSAT clarifies at what point CDSAT needs

to record proof information to justify answers “unsat”, and how.

◮ Proof-producing CDSAT only requires a small proof system,

which glues together a collection of inferences systems in a modular way.

27/30

slide-115
SLIDE 115

Conclusion

◮ Proof-producing CDSAT clarifies at what point CDSAT needs

to record proof information to justify answers “unsat”, and how.

◮ Proof-producing CDSAT only requires a small proof system,

which glues together a collection of inferences systems in a modular way.

◮ Clause learning is still not needed for completeness of CDSAT

/ its proof system . . . but is critical for efficiency of search, and compresses proofs by sharing subproofs.

27/30

slide-116
SLIDE 116

Conclusion

◮ Proof-producing CDSAT clarifies at what point CDSAT needs

to record proof information to justify answers “unsat”, and how.

◮ Proof-producing CDSAT only requires a small proof system,

which glues together a collection of inferences systems in a modular way.

◮ Clause learning is still not needed for completeness of CDSAT

/ its proof system . . . but is critical for efficiency of search, and compresses proofs by sharing subproofs.

◮ Nothing exotic:

◮ Proof terms map to resolution proofs + theory lemmas

if this is preferred format. If inputs contain first-order assignments, this format has to be generalised with guarded clauses

◮ Proof-terms can be convenient for translations to proof

assistants (c.f. SMTCoq [AFG+11])

◮ CDSAT is suited to the LCF principles, which are standard 27/30

slide-117
SLIDE 117

Conclusion

◮ Proof-producing CDSAT clarifies at what point CDSAT needs

to record proof information to justify answers “unsat”, and how.

◮ Proof-producing CDSAT only requires a small proof system,

which glues together a collection of inferences systems in a modular way.

◮ Clause learning is still not needed for completeness of CDSAT

/ its proof system . . . but is critical for efficiency of search, and compresses proofs by sharing subproofs.

◮ Nothing exotic:

◮ Proof terms map to resolution proofs + theory lemmas

if this is preferred format. If inputs contain first-order assignments, this format has to be generalised with guarded clauses

◮ Proof-terms can be convenient for translations to proof

assistants (c.f. SMTCoq [AFG+11])

◮ CDSAT is suited to the LCF principles, which are standard 27/30

slide-118
SLIDE 118

Ongoing and future work

◮ Proof-of-concept implementation is available at

https://github.com/disteph/cdsat Currently working on more performance-driven implementation.

28/30

slide-119
SLIDE 119

Ongoing and future work

◮ Proof-of-concept implementation is available at

https://github.com/disteph/cdsat Currently working on more performance-driven implementation.

◮ Issue of cost: Penalty of building proof-terms?

Penalty of having a code developed in the correct-by-construction approach?

28/30

slide-120
SLIDE 120

Ongoing and future work

◮ Proof-of-concept implementation is available at

https://github.com/disteph/cdsat Currently working on more performance-driven implementation.

◮ Issue of cost: Penalty of building proof-terms?

Penalty of having a code developed in the correct-by-construction approach?

◮ Use proof-terms for interpolation?

(See Tanja Schindler’s talk on interpolation in a related context! 16:30 at VMCAI)

28/30

slide-121
SLIDE 121
  • M. Armand, G. Faure, B. Grégoire, C. Keller, L. Théry, and
  • B. Wener.

Verifying SAT and SMT in Coq for a fully automated decision procedure. In G. Faure, S. Lengrand, and A. Mahboubi, editors, Proc. of the 2011 Work. on Proof-Search in Axiomatic Theories and Type Theories (PSATTT’11), 2011. Available at http://hal.inria.fr/PSATTT11

  • M. P. Bonacina, S. Graham-Lengrand, and N. Shankar.

Satisfiability modulo theories and assignments. In L. de Moura, editor, Proc. of the 26th Int. Conf. on Automated Deduction (CADE’17), volume 10395 of LNAI. Springer-Verlag, 2017.

  • L. M. de Moura and D. Jovanovic.

A model-constructing satisfiability calculus. In R. Giacobazzi, J. Berdine, and I. Mastroeni, editors, Proc.

  • f the 14th Int. Conf. on Verification, Model Checking, and

Abstract Interpretation (VMCAI’13), volume 7737 of LNCS, pages 1–12. Springer-Verlag, 2013.

29/30

slide-122
SLIDE 122

Adapting the rules

Deduce Γ − → Γ, J ⊢jT : (t←b) if J ⊢ ⊢ ⊢T jT : (t←b), J ⊆ Γ, and t←b is not in Γ Conflict Γ − → Γ; J, (t←b) ; cfl(jk, a) if J ⊢ ⊢ ⊢T jT : (t←b), J ⊆ Γ, and t←b is in Γ with id a Resolve Γ; E ⊎ {A} ; c − → Γ; E∪H ; res(j, aA.c) if H ⊢j : A is in Γ with id a Learn Γ; E ⊎ H ; c − → Γ′, E ⊢lem(H.c): L if L is a “clausal form” of H L / ∈ Γ, L / ∈ Γ, and E ⊆ Γ′

30/30