Testing a Saturation-Based Theorem Prover: Experiences and - - PowerPoint PPT Presentation

testing a saturation based theorem prover experiences and
SMART_READER_LITE
LIVE PREVIEW

Testing a Saturation-Based Theorem Prover: Experiences and - - PowerPoint PPT Presentation

Testing a Saturation-Based Theorem Prover: Experiences and Challenges Giles Reger 1 , Martin Suda 2 , and Andrei Voronkov 1 , 2 1 School of Computer Science, University of Manchester, UK 2 TU Wien, Vienna, Austria TAP 2017 Marburg, July 19,


slide-1
SLIDE 1

1/16

Testing a Saturation-Based Theorem Prover: Experiences and Challenges

Giles Reger1, Martin Suda2, and Andrei Voronkov1,2

1School of Computer Science, University of Manchester, UK 2TU Wien, Vienna, Austria

TAP 2017 – Marburg, July 19, 2017

slide-2
SLIDE 2

1/16

Introduction

First-order Automatic Theorem Proving: a well-established discipline of automated deduction main approach: refutational, saturation-based proving example systems: E, SPASS, Vampire

slide-3
SLIDE 3

1/16

Introduction

First-order Automatic Theorem Proving: a well-established discipline of automated deduction main approach: refutational, saturation-based proving example systems: E, SPASS, Vampire Often used in larger projects and systems as black boxes e.g., program verification, static analysis, interpolation, . . .

slide-4
SLIDE 4

1/16

Introduction

First-order Automatic Theorem Proving: a well-established discipline of automated deduction main approach: refutational, saturation-based proving example systems: E, SPASS, Vampire Often used in larger projects and systems as black boxes e.g., program verification, static analysis, interpolation, . . .

➥ Importance of ensuring correctness

slide-5
SLIDE 5

1/16

Introduction

First-order Automatic Theorem Proving: a well-established discipline of automated deduction main approach: refutational, saturation-based proving example systems: E, SPASS, Vampire Often used in larger projects and systems as black boxes e.g., program verification, static analysis, interpolation, . . .

➥ Importance of ensuring correctness

How are we doing?

slide-6
SLIDE 6

1/16

Introduction

First-order Automatic Theorem Proving: a well-established discipline of automated deduction main approach: refutational, saturation-based proving example systems: E, SPASS, Vampire Often used in larger projects and systems as black boxes e.g., program verification, static analysis, interpolation, . . .

➥ Importance of ensuring correctness

How are we doing? CASC competition: preliminary period for testing soundness

slide-7
SLIDE 7

1/16

Introduction

First-order Automatic Theorem Proving: a well-established discipline of automated deduction main approach: refutational, saturation-based proving example systems: E, SPASS, Vampire Often used in larger projects and systems as black boxes e.g., program verification, static analysis, interpolation, . . .

➥ Importance of ensuring correctness

How are we doing? CASC competition: preliminary period for testing soundness SMT-COMP 2016: 79 answers classified as incorrect

slide-8
SLIDE 8

2/16

Our Prover

Vampire Automatic Theorem Prover for first-order logic and theories

slide-9
SLIDE 9

2/16

Our Prover

Vampire Automatic Theorem Prover for first-order logic and theories regular winner of the main divisions of the CASC competition since 2016, also a successful participant of SMT-COMP

slide-10
SLIDE 10

2/16

Our Prover

Vampire Automatic Theorem Prover for first-order logic and theories regular winner of the main divisions of the CASC competition since 2016, also a successful participant of SMT-COMP Quite complex piece of software (≈194000 lines of C++)

➥ easy to introduce incorrectness when adding a new feature

slide-11
SLIDE 11

3/16

Outline

1

What Does Correctness Means for Us

2

Detecting and Investigating Bugs

3

Challenges

4

Conclusion

slide-12
SLIDE 12

4/16

Theorem proving basics

Standard form of the input: F := (Axiom1 ∧ . . . ∧ Axiomn) → Conjecture

slide-13
SLIDE 13

4/16

Theorem proving basics

Standard form of the input: F := (Axiom1 ∧ . . . ∧ Axiomn) → Conjecture

1 Negate F (to seek a refutation):

¬F := Axiom1 ∧ . . . ∧ Axiomn ∧ ¬Conjecture

slide-14
SLIDE 14

4/16

Theorem proving basics

Standard form of the input: F := (Axiom1 ∧ . . . ∧ Axiomn) → Conjecture

1 Negate F (to seek a refutation):

¬F := Axiom1 ∧ . . . ∧ Axiomn ∧ ¬Conjecture

2 Preprocess and transform ¬F to a normal form

S := {C1, . . . , Cn}

slide-15
SLIDE 15

4/16

Theorem proving basics

Standard form of the input: F := (Axiom1 ∧ . . . ∧ Axiomn) → Conjecture

1 Negate F (to seek a refutation):

¬F := Axiom1 ∧ . . . ∧ Axiomn ∧ ¬Conjecture

2 Preprocess and transform ¬F to a normal form

S := {C1, . . . , Cn}

3 saturate S with respect to an inference system I

slide-16
SLIDE 16

4/16

Theorem proving basics

Standard form of the input: F := (Axiom1 ∧ . . . ∧ Axiomn) → Conjecture

1 Negate F (to seek a refutation):

¬F := Axiom1 ∧ . . . ∧ Axiomn ∧ ¬Conjecture

2 Preprocess and transform ¬F to a normal form

S := {C1, . . . , Cn}

3 saturate S with respect to an inference system I

Example inference rule: C1 ∨ P C2 ∨ ¬P C1 ∨ C2

slide-17
SLIDE 17

5/16

The Saturation Process

Saturation = fixed-point (closure) computation

slide-18
SLIDE 18

5/16

The Saturation Process

Saturation = fixed-point (closure) computation Does the final set S contain false?

slide-19
SLIDE 19

5/16

The Saturation Process

Saturation = fixed-point (closure) computation Does the final set S contain false? Basic properties:

slide-20
SLIDE 20

5/16

The Saturation Process

Saturation = fixed-point (closure) computation Does the final set S contain false? Basic properties: explosive in nature

slide-21
SLIDE 21

5/16

The Saturation Process

Saturation = fixed-point (closure) computation Does the final set S contain false? Basic properties: explosive in nature may not terminate

slide-22
SLIDE 22

5/16

The Saturation Process

Saturation = fixed-point (closure) computation Does the final set S contain false? Basic properties: explosive in nature may not terminate various tricks to mitigate the explosion

slide-23
SLIDE 23

6/16

Possible Answers:

Theorem (together with a proof)

if the input F is logically valid

slide-24
SLIDE 24

6/16

Possible Answers:

Theorem (together with a proof)

if the input F is logically valid

Non-theorem

if F is invalid (there is a counter-example)

slide-25
SLIDE 25

6/16

Possible Answers:

Theorem (together with a proof)

if the input F is logically valid

Non-theorem

if F is invalid (there is a counter-example) relies on a completeness argument

slide-26
SLIDE 26

6/16

Possible Answers:

Theorem (together with a proof)

if the input F is logically valid

Non-theorem

if F is invalid (there is a counter-example) relies on a completeness argument

Unknown

slide-27
SLIDE 27

6/16

Possible Answers:

Theorem (together with a proof)

if the input F is logically valid

Non-theorem

if F is invalid (there is a counter-example) relies on a completeness argument

Unknown

1

time limit / memory limit

slide-28
SLIDE 28

6/16

Possible Answers:

Theorem (together with a proof)

if the input F is logically valid

Non-theorem

if F is invalid (there is a counter-example) relies on a completeness argument

Unknown

1

time limit / memory limit

2

incomplete strategy failed

slide-29
SLIDE 29

7/16

Different Ways of Being Incorrect

unsoundness: Reports Theorem for an invalid F. (Derives false for a satisfiable S.)

slide-30
SLIDE 30

7/16

Different Ways of Being Incorrect

unsoundness: Reports Theorem for an invalid F. (Derives false for a satisfiable S.) Check the proof and see what went wrong.

slide-31
SLIDE 31

7/16

Different Ways of Being Incorrect

unsoundness: Reports Theorem for an invalid F. (Derives false for a satisfiable S.) Check the proof and see what went wrong. completeness issue: Reports Non-theorem for a valid F. (Finitely saturates unsat. S without deriving false.)

slide-32
SLIDE 32

7/16

Different Ways of Being Incorrect

unsoundness: Reports Theorem for an invalid F. (Derives false for a satisfiable S.) Check the proof and see what went wrong. completeness issue: Reports Non-theorem for a valid F. (Finitely saturates unsat. S without deriving false.) Should have said Unknown here!

slide-33
SLIDE 33

7/16

Different Ways of Being Incorrect

unsoundness: Reports Theorem for an invalid F. (Derives false for a satisfiable S.) Check the proof and see what went wrong. completeness issue: Reports Non-theorem for a valid F. (Finitely saturates unsat. S without deriving false.) Should have said Unknown here! fairness issue: Prover runs indefinitely, while a proof exists. (Violation of fairness criteria in saturation.)

slide-34
SLIDE 34

7/16

Different Ways of Being Incorrect

unsoundness: Reports Theorem for an invalid F. (Derives false for a satisfiable S.) Check the proof and see what went wrong. completeness issue: Reports Non-theorem for a valid F. (Finitely saturates unsat. S without deriving false.) Should have said Unknown here! fairness issue: Prover runs indefinitely, while a proof exists. (Violation of fairness criteria in saturation.) never (strictly) violated after finitely many steps

slide-35
SLIDE 35

8/16

Violating the Contract of Proper Behaviour

General error conditions shared by any other program: program crash E.g.,

slide-36
SLIDE 36

8/16

Violating the Contract of Proper Behaviour

General error conditions shared by any other program: program crash E.g., unhandled exceptions

slide-37
SLIDE 37

8/16

Violating the Contract of Proper Behaviour

General error conditions shared by any other program: program crash E.g., unhandled exceptions signal interrupts (SIGFPE, SIGSEG)

slide-38
SLIDE 38

8/16

Violating the Contract of Proper Behaviour

General error conditions shared by any other program: program crash E.g., unhandled exceptions signal interrupts (SIGFPE, SIGSEG) assertion violation defensive development via assertions around 2500 assertions in total; (one per 77 lines on average) potential errors detected early on

slide-39
SLIDE 39

9/16

Outline

1

What Does Correctness Means for Us

2

Detecting and Investigating Bugs

3

Challenges

4

Conclusion

slide-40
SLIDE 40

10/16

Input Search Space

Problem input space: infinite, in principle in practice, we sample representative benchmarks, e.g.:

the TPTP library (∼20k problems) SMT-LIB (∼46k relevant problems)

slide-41
SLIDE 41

10/16

Input Search Space

Problem input space: infinite, in principle in practice, we sample representative benchmarks, e.g.:

the TPTP library (∼20k problems) SMT-LIB (∼46k relevant problems)

Configuration space: around 75 proof search parameters (boolean, multi-valued, numeric) the search space > 275 (too large to explore systematically)

slide-42
SLIDE 42

11/16

The Debugging Process

Bug reports: from users / non-core developers; via email from random testing (dedicated cluster)

slide-43
SLIDE 43

11/16

The Debugging Process

Bug reports: from users / non-core developers; via email from random testing (dedicated cluster) Debugger’s inventory: the good old: cout << "Here" << endl;

slide-44
SLIDE 44

11/16

The Debugging Process

Bug reports: from users / non-core developers; via email from random testing (dedicated cluster) Debugger’s inventory: the good old: cout << "Here" << endl; tracing home-made library of tracing macros CALL added at the start of each function explicit stack maintained

slide-45
SLIDE 45

11/16

The Debugging Process

Bug reports: from users / non-core developers; via email from random testing (dedicated cluster) Debugger’s inventory: the good old: cout << "Here" << endl; tracing home-made library of tracing macros CALL added at the start of each function explicit stack maintained memory checking own memory manager tune performance, enforce memory limits memory leak reporting

slide-46
SLIDE 46

11/16

The Debugging Process

Bug reports: from users / non-core developers; via email from random testing (dedicated cluster) Debugger’s inventory: the good old: cout << "Here" << endl; tracing home-made library of tracing macros CALL added at the start of each function explicit stack maintained memory checking own memory manager tune performance, enforce memory limits memory leak reporting silent memory issues and segmentation faults

  • ne of the most difficult kinds to resolve

Valgrind is usually of great help here

slide-47
SLIDE 47

12/16

Proof Checking

Independent way of verifying Theorem results (checking soundness)

slide-48
SLIDE 48

12/16

Proof Checking

Independent way of verifying Theorem results (checking soundness) Example (Consider the following input:) p(a) ¬p(x) ∨ b = x ¬p(b)

slide-49
SLIDE 49

12/16

Proof Checking

Independent way of verifying Theorem results (checking soundness) Example (Consider the following input:) p(a) ¬p(x) ∨ b = x ¬p(b) following proof in TPTP format produced

  • 1. p(a) [input]
  • 2. ~p(X0) | b = X0 [input]
  • 3. ~p(b) [input]
  • 4. a = b [resolution 2,1]
  • 5. ~p(a) [backward demodulation 4,3]
  • 7. $false [subsumption resolution 5,1]
slide-50
SLIDE 50

12/16

Proof Checking

Independent way of verifying Theorem results (checking soundness) Example (Consider the following input:) p(a) ¬p(x) ∨ b = x ¬p(b) following proof in TPTP format produced

  • 1. p(a) [input]
  • 2. ~p(X0) | b = X0 [input]
  • 3. ~p(b) [input]
  • 4. a = b [resolution 2,1]
  • 5. ~p(a) [backward demodulation 4,3]
  • 7. $false [subsumption resolution 5,1]

“vampire -p proofcheck” for step 5:

fof(pr4,axiom, a = b ). fof(pr3,axiom, ~p(b) ). fof(r5,conjecture, ~p(a) ).

slide-51
SLIDE 51

13/16

Outline

1

What Does Correctness Means for Us

2

Detecting and Investigating Bugs

3

Challenges

4

Conclusion

slide-52
SLIDE 52

14/16

Full and Automated Proof Checking

Currently, proof checking skips:

slide-53
SLIDE 53

14/16

Full and Automated Proof Checking

Currently, proof checking skips: symbol introducing preprocessing

e.g., Skolemization, formula naming, . . . does not preserve logical equivalence (only equisatisfiability) global “freshness” condition

slide-54
SLIDE 54

14/16

Full and Automated Proof Checking

Currently, proof checking skips: symbol introducing preprocessing

e.g., Skolemization, formula naming, . . . does not preserve logical equivalence (only equisatisfiability) global “freshness” condition

inferences backed by SAT and SMT solving

as of now, trusted as black boxes

slide-55
SLIDE 55

14/16

Full and Automated Proof Checking

Currently, proof checking skips: symbol introducing preprocessing

e.g., Skolemization, formula naming, . . . does not preserve logical equivalence (only equisatisfiability) global “freshness” condition

inferences backed by SAT and SMT solving

as of now, trusted as black boxes

Level of detail provided: more details in the proof − → larger overhead

slide-56
SLIDE 56

14/16

Full and Automated Proof Checking

Currently, proof checking skips: symbol introducing preprocessing

e.g., Skolemization, formula naming, . . . does not preserve logical equivalence (only equisatisfiability) global “freshness” condition

inferences backed by SAT and SMT solving

as of now, trusted as black boxes

Level of detail provided: more details in the proof − → larger overhead independent checking prover may fail to reprove a step

slide-57
SLIDE 57

14/16

Full and Automated Proof Checking

Currently, proof checking skips: symbol introducing preprocessing

e.g., Skolemization, formula naming, . . . does not preserve logical equivalence (only equisatisfiability) global “freshness” condition

inferences backed by SAT and SMT solving

as of now, trusted as black boxes

Level of detail provided: more details in the proof − → larger overhead independent checking prover may fail to reprove a step Ideally, . . . . . . strive for a standalone proof format with formal semantics!

slide-58
SLIDE 58

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated?

slide-59
SLIDE 59

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated? specific instantiation of the calculus

slide-60
SLIDE 60

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated? specific instantiation of the calculus all skipped inferences / removed clauses must be redundant

slide-61
SLIDE 61

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated? specific instantiation of the calculus all skipped inferences / removed clauses must be redundant saturated sets tend to be much larger than proofs!

slide-62
SLIDE 62

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated? specific instantiation of the calculus all skipped inferences / removed clauses must be redundant saturated sets tend to be much larger than proofs!

➥ Currently, no standard way for certifying satisfiability!

slide-63
SLIDE 63

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated? specific instantiation of the calculus all skipped inferences / removed clauses must be redundant saturated sets tend to be much larger than proofs!

➥ Currently, no standard way for certifying satisfiability!

A related challenge – monitoring fairness

slide-64
SLIDE 64

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated? specific instantiation of the calculus all skipped inferences / removed clauses must be redundant saturated sets tend to be much larger than proofs!

➥ Currently, no standard way for certifying satisfiability!

A related challenge – monitoring fairness liveness property - strictly speaking impossible to monitor

slide-65
SLIDE 65

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated? specific instantiation of the calculus all skipped inferences / removed clauses must be redundant saturated sets tend to be much larger than proofs!

➥ Currently, no standard way for certifying satisfiability!

A related challenge – monitoring fairness liveness property - strictly speaking impossible to monitor strengthen to bounded fairness, e.g. clause of age A will be processed no later than after kA steps

slide-66
SLIDE 66

15/16

Handling Non-theorem Results

A challenging research topic How to practically check that a saturated set is indeed saturated? specific instantiation of the calculus all skipped inferences / removed clauses must be redundant saturated sets tend to be much larger than proofs!

➥ Currently, no standard way for certifying satisfiability!

A related challenge – monitoring fairness liveness property - strictly speaking impossible to monitor strengthen to bounded fairness, e.g. clause of age A will be processed no later than after kA steps

➥ turned into a response property

slide-67
SLIDE 67

16/16

Achieving Better Coverage with Random Testing

How to improve the current random sampling approach?

slide-68
SLIDE 68

16/16

Achieving Better Coverage with Random Testing

How to improve the current random sampling approach? parameter space coverage direct random sampling to under-tested areas? target new features / untested combinations

slide-69
SLIDE 69

16/16

Achieving Better Coverage with Random Testing

How to improve the current random sampling approach? parameter space coverage direct random sampling to under-tested areas? target new features / untested combinations problem space coverage little work done so far libraries may lack inputs for testing a new feature experiment with fuzzing?

slide-70
SLIDE 70

17/16

Conclusion

Summary: described challenges in testing an automated theorem prover based on experience with Vampire generalises to other ATPs

slide-71
SLIDE 71

17/16

Conclusion

Summary: described challenges in testing an automated theorem prover based on experience with Vampire generalises to other ATPs Concrete future work: 100% reliable proof checking better input problem coverage

slide-72
SLIDE 72

17/16

Conclusion

Summary: described challenges in testing an automated theorem prover based on experience with Vampire generalises to other ATPs Concrete future work: 100% reliable proof checking better input problem coverage Thank you for your attention!