82
1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule [email protected] ACL2 Seminar, February 17, 2015 adaptation of a CAV’14 talk by Andrei Voronkov

AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule [email protected]

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

1/22

AVATAR: A SAT-based Architecturefor First-Order Theorem-Provers

Marijn J.H. [email protected]

ACL2 Seminar, February 17, 2015

adaptation of a CAV’14 talk by Andrei Voronkov

Page 2: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

2/22

AVATAR

AdvancedVampireArchitecture forTheoriesAndResolution

Definitions of Avatar from various dictionaries:I Science Fiction: a hybrid creature,composed of human and alien DNA andremotely controlled by the mind of agenetically matched human being

I Hindu Mythology: the descent of a deityto the death in an incarnate form ofsome manifest shape; the incarnation ofa god

I Automated Reasoning: a SAT solverembodied in a first-order theorem proverand in fact controlling its behavior

Page 3: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

2/22

AVATAR

AdvancedVampireArchitecture forTheoriesAndResolution

Definitions of Avatar from various dictionaries:

I Science Fiction: a hybrid creature,composed of human and alien DNA andremotely controlled by the mind of agenetically matched human being

I Hindu Mythology: the descent of a deityto the death in an incarnate form ofsome manifest shape; the incarnation ofa god

I Automated Reasoning: a SAT solverembodied in a first-order theorem proverand in fact controlling its behavior

Page 4: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

2/22

AVATAR

AdvancedVampireArchitecture forTheoriesAndResolution

Definitions of Avatar from various dictionaries:I Science Fiction: a hybrid creature,composed of human and alien DNA andremotely controlled by the mind of agenetically matched human being

I Hindu Mythology: the descent of a deityto the death in an incarnate form ofsome manifest shape; the incarnation ofa god

I Automated Reasoning: a SAT solverembodied in a first-order theorem proverand in fact controlling its behavior

Page 5: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

2/22

AVATAR

AdvancedVampireArchitecture forTheoriesAndResolution

Definitions of Avatar from various dictionaries:I Science Fiction: a hybrid creature,composed of human and alien DNA andremotely controlled by the mind of agenetically matched human being

I Hindu Mythology: the descent of a deityto the death in an incarnate form ofsome manifest shape; the incarnation ofa god

I Automated Reasoning: a SAT solverembodied in a first-order theorem proverand in fact controlling its behavior

Page 6: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

2/22

AVATAR

AdvancedVampireArchitecture forTheoriesAndResolution

Definitions of Avatar from various dictionaries:I Science Fiction: a hybrid creature,composed of human and alien DNA andremotely controlled by the mind of agenetically matched human being

I Hindu Mythology: the descent of a deityto the death in an incarnate form ofsome manifest shape; the incarnation ofa god

I Automated Reasoning: a SAT solverembodied in a first-order theorem proverand in fact controlling its behavior

Page 7: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

3/22

Summary

I Original motivation: problems having clauses containingpropositional variables and other clauses that can split intocomponents with disjoint sets of variables.

I Previously: splitting.I New architecture: a first-order theorem-prover tightlyintegrated with a SAT or an SMT solver.

I Future: reasoning with both quantifiers and theories.

Page 8: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SAT

Page 9: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SATSolve!

Page 10: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SATmodel {a, b, c , d , e, f }

Page 11: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SAT

(a ∨ c ∨ d ∨ f ) (contradiction clause)

Page 12: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SATSolve!

Page 13: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SATmodel {a, g , h, i , j , k , l}

Page 14: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SAT

(h ∨ j ∨ k ∨ l) (contradiction clause)

Page 15: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SAT

The loop terminates when either the SAT solver reportsUNSAT or the model satisfies the original problem.

Page 16: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

4/22

Context: Solve a Problem Abstraction using a SAT Solver

Counter-Example Guided Abstraction Refinement (CEGAR):Only translate a subset of the constraints into SAT.

Satisfiability Modulo Theories (SMT):Combine a SAT solver with theory solvers.

CEGARor SMT

SAT

The loop terminates when either the SAT solver reportsUNSAT or the model satisfies the original problem.

Can this architecture be used for first-order theorem provers?

Page 17: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

5/22

Saturation Algorithms in First-Order Theorem-Provers

A formula F is saturated with respect to an inference system Iif for every inference in I with premises in F the conclusion ofthe inferences is in F as well (or subsumed by a clause in F).

Typically three kinds of inferences:I Generation: add new clauses to the formula (resolution);I Simplification: simplify clauses with existing clauses(self-subsumption);

I Deletion: remove clauses from the formula (subsumption).

Possible outcomes of a saturation algorithms:I if the empty clause is derived, then F is unsatisfiable;I if saturation terminates, then F is satisfiable;I if saturation runs , then F is .

Page 18: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

5/22

Saturation Algorithms in First-Order Theorem-Provers

A formula F is saturated with respect to an inference system Iif for every inference in I with premises in F the conclusion ofthe inferences is in F as well (or subsumed by a clause in F).

Typically three kinds of inferences:I Generation: add new clauses to the formula (resolution);I Simplification: simplify clauses with existing clauses(self-subsumption);

I Deletion: remove clauses from the formula (subsumption).

Possible outcomes of a saturation algorithms:I if the empty clause is derived, then F is unsatisfiable;I if saturation terminates, then F is satisfiable;I if saturation runs , then F is .

Page 19: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

5/22

Saturation Algorithms in First-Order Theorem-Provers

A formula F is saturated with respect to an inference system Iif for every inference in I with premises in F the conclusion ofthe inferences is in F as well (or subsumed by a clause in F).

Typically three kinds of inferences:I Generation: add new clauses to the formula (resolution);I Simplification: simplify clauses with existing clauses(self-subsumption);

I Deletion: remove clauses from the formula (subsumption).

Possible outcomes of a saturation algorithms:I if the empty clause is derived, then F is unsatisfiable;I if saturation terminates, then F is satisfiable;I if saturation runs forever, then F is satisfiable.

Page 20: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

5/22

Saturation Algorithms in First-Order Theorem-Provers

A formula F is saturated with respect to an inference system Iif for every inference in I with premises in F the conclusion ofthe inferences is in F as well (or subsumed by a clause in F).

Typically three kinds of inferences:I Generation: add new clauses to the formula (resolution);I Simplification: simplify clauses with existing clauses(self-subsumption);

I Deletion: remove clauses from the formula (subsumption).

Possible outcomes of a saturation algorithms:I if the empty clause is derived, then F is unsatisfiable;I if saturation terminates, then F is satisfiable;I if saturation runs too long, then F is unknown.

Page 21: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

6/22

FLoC Olympic Games

FLoCOlympicGames2014

I CASC (FO solvers versus FO solvers)I SAT (SAT solvers versus SAT solvers)I SMT (SMT solvers versus SMT solvers)I . . .

Why not FO solvers versus SAT solvers ???

Page 22: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

6/22

FLoC Olympic Games

FLoCOlympicGames2014

I CASC (FO solvers versus FO solvers)I SAT (SAT solvers versus SAT solvers)I SMT (SMT solvers versus SMT solvers)I . . .

Why not FO solvers versus SAT solvers ???

Page 23: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

SAT solver won!

Page 24: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x ∨ y)(x ∨ y)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

SAT solver won!

Page 25: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x ∨ y)(x ∨ y)

(x) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

SAT solver won!

Page 26: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x ∨ y)(x ∨ y)

(x) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)∅ | x (decide)

SAT solver won!

Page 27: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x ∨ y)(x ∨ y)

(x) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)∅ | x (decide)∅ | x (unit propagation)

SAT solver won!

Page 28: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

subsumption

(x) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)∅ | x (decide)∅ | x (unit propagation)

SAT solver won!

Page 29: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)

SAT solver won!

Page 30: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!

Page 31: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 32: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 33: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x ∨ y)

(x) (resolution)(y) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 34: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)subsumption

(x) (resolution)(y) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 35: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x) (resolution)(y) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 36: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x ∨ y)(x) (resolution)(y) (resolution)(y) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 37: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

subsumption(x) (resolution)(y) (resolution)(y) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 38: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x) (resolution)(y) (resolution)(y) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 39: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

7/22

Saturation Algorithms versus SAT (CDCL) solvers

Resolution prover:

(x) (resolution)(y) (resolution)(y) (resolution)(∅) (resolution)

SAT solver:

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) (conflict clause)∅| x (unit propagation)

SAT solver won!SAT solver won!

Page 40: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

8/22

Search Space in Saturation Algorithms (1)

Illustrated using bacteria.

In the beginning . . .

(x ∨ y) (x ∨ y) (x ∨ y) (x ∨ y)

precisionnutrition.com

Page 41: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

8/22

Search Space in Saturation Algorithms (1)

Illustrated using bacteria. In the beginning . . .

(x ∨ y) (x ∨ y) (x ∨ y) (x ∨ y)

precisionnutrition.com

Page 42: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

9/22

Search Space in Saturation Algorithms (2)After a few steps . . .

www.nrcs.usda.gov

Page 43: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

9/22

Search Space in Saturation Algorithms (2)After a few steps . . . and notice long clauses

(a∨b∨c∨d∨e∨f)

www.nrcs.usda.gov

Page 44: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

9/22

Search Space in Saturation Algorithms (2)After a few steps . . . and notice long clauses

RAM

(a∨b∨c∨d∨e∨f)

www.nrcs.usda.gov

Page 45: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

10/22

Search Space in Saturation Algorithms (3)After a few more steps . . .

creepypasta.wikia.com

Page 46: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

11/22

Reality of First-Order Theorem Proving

I Growing search spacesI Repeated applications of algorithms whose complexitydepends on clause sizes: resolution, superposition,demodulation, Knuth-Bendix order comparison,subsumption.

I Long clauses are a problem: produce even longer clauses;subsumption is NP-complete.

Page 47: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

12/22

Long Clauses: ResolutionExample: resolving

p(x , f (y)) ∨ p(f (x), y) ∨ p(g(x , z), f (f (y))) ∨ p(f (y), z) ∨p(g(z , z), g(y , f (x)) ∨ p(f (a, x), g(z , g(y , z))) ∨ p(x , y)

against

p(f (w), v) ∨ p(f (v),w) ∨ p(g(v , u), f (f (w))) ∨ p(f (w), u) ∨p(g(u, u), g(w , f (v))) ∨ p(f (a, v), g(u, g(w , u))) ∨ p(v ,w)

gives

p(f (f (w)), y) ∨ p(g(f (w), z), f (f (y))) ∨ p(f (y), z) ∨p(g(z , z), g(y , f (f (w))) ∨ p(f (a, f (w)), g(z , g(y , z))) ∨p(f (w), y) ∨ p(f (f (y)),w) ∨ p(g(f (y), u), f (f (w))) ∨p(f (w), u) ∨ p(g(u, u), g(w , f (f (y)))) ∨p(f (a, f (y)), g(u, g(w , u))) ∨ p(f (y),w).

Page 48: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

12/22

Long Clauses: ResolutionExample: resolving

p(x , f (y)) ∨ p(f (x), y) ∨ p(g(x , z), f (f (y))) ∨ p(f (y), z) ∨p(g(z , z), g(y , f (x)) ∨ p(f (a, x), g(z , g(y , z))) ∨ p(x , y)

against

p(f (w), v) ∨ p(f (v),w) ∨ p(g(v , u), f (f (w))) ∨ p(f (w), u) ∨p(g(u, u), g(w , f (v))) ∨ p(f (a, v), g(u, g(w , u))) ∨ p(v ,w)

gives

p(f (f (w)), y) ∨ p(g(f (w), z), f (f (y))) ∨ p(f (y), z) ∨p(g(z , z), g(y , f (f (w))) ∨ p(f (a, f (w)), g(z , g(y , z))) ∨p(f (w), y) ∨ p(f (f (y)),w) ∨ p(g(f (y), u), f (f (w))) ∨p(f (w), u) ∨ p(g(u, u), g(w , f (f (y)))) ∨p(f (a, f (y)), g(u, g(w , u))) ∨ p(f (y),w).

Page 49: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

13/22

Long Clauses: SubsumptionExample: does

p(f (f (w)), y) ∨ p(g(f (w), z), f (f (y))) ∨ p(f (w), y) ∨p(g(z , z), g(y , f (f (w)))) ∨ p(f (a, f (w)), g(z , g(y , z))) ∨p(f (y), z) ∨ p(f (f (y),w) ∨ p(g(f (y), u), f (f (w))) ∨p(g(u, u), g(w , f (f (y)))) ∨ p(g(a, f (y)), g(u, g(w , u))) ∨p(f (y),w) ∨ p(f (w), u)

subsume

p(g(f (y), u), f (f (g(x , y)))) ∨ p(f (f (g(x , y))), y) ∨p(f (y), z) ∨ p(g(f (g(x , y)), z), f (f (y))) ∨ p(f (g(x , y)), u) ∨p(g(z , z), g(y , f (f (g(x , y))))) ∨ p(f (g(x , y)), y) ∨p(f (a, f (g(x , y))), g(z , g(y , z))) ∨ p(f (f (y)), g(x , y)) ∨p(g(a, f (y)), g(u, g(g(x , y), u))) ∨ p(f (y), g(x , y)) ∨p(g(u, u), g(g(x , y), f (f (y)))) ???

Page 50: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

13/22

Long Clauses: SubsumptionExample: does

p(f (f (w)), y) ∨ p(g(f (w), z), f (f (y))) ∨ p(f (w), y) ∨p(g(z , z), g(y , f (f (w)))) ∨ p(f (a, f (w)), g(z , g(y , z))) ∨p(f (y), z) ∨ p(f (f (y),w) ∨ p(g(f (y), u), f (f (w))) ∨p(g(u, u), g(w , f (f (y)))) ∨ p(g(a, f (y)), g(u, g(w , u))) ∨p(f (y),w) ∨ p(f (w), u)

subsume

p(g(f (y), u), f (f (g(x , y)))) ∨ p(f (f (g(x , y))), y) ∨p(f (y), z) ∨ p(g(f (g(x , y)), z), f (f (y))) ∨ p(f (g(x , y)), u) ∨p(g(z , z), g(y , f (f (g(x , y))))) ∨ p(f (g(x , y)), y) ∨p(f (a, f (g(x , y))), g(z , g(y , z))) ∨ p(f (f (y)), g(x , y)) ∨p(g(a, f (y)), g(u, g(g(x , y), u))) ∨ p(f (y), g(x , y)) ∨p(g(u, u), g(g(x , y), f (f (y)))) ???

Page 51: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

14/22

Basis for DPLL

Consider the formula F ∪ {C1 ∨ · · · ∨ Cn}, where C1 ∨ · · · ∨ Cn

is splittable.

Then F ∪ C1 ∨ · · · ∨ Cn is unsatisfiable is and only if each of

F ∪ C1

. . .

F ∪ Cn

is unsatisfiable too.

Cannot be used in first-order logic:I {p(x) ∨ q(x), p(a), q(b)} is satisfiable, whileI {p(x), p(a), q(b)} and {q(x), p(a), q(b)} are unsatisfiable.

Yet it can be used when C1 ∨ · · · ∨ Cn have pairwise disjointsets of variables.

Page 52: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

14/22

Basis for DPLL

Consider the formula F ∪ {C1 ∨ · · · ∨ Cn}, where C1 ∨ · · · ∨ Cn

is splittable.

Then F ∪ C1 ∨ · · · ∨ Cn is unsatisfiable is and only if each of

F ∪ C1

. . .

F ∪ Cn

is unsatisfiable too.

Cannot be used in first-order logic:I {p(x) ∨ q(x), p(a), q(b)} is satisfiable, whileI {p(x), p(a), q(b)} and {q(x), p(a), q(b)} are unsatisfiable.

Yet it can be used when C1 ∨ · · · ∨ Cn have pairwise disjointsets of variables.

Page 53: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

14/22

Basis for DPLL

Consider the formula F ∪ {C1 ∨ · · · ∨ Cn}, where C1 ∨ · · · ∨ Cn

is splittable.

Then F ∪ C1 ∨ · · · ∨ Cn is unsatisfiable is and only if each of

F ∪ C1

. . .

F ∪ Cn

is unsatisfiable too.

Cannot be used in first-order logic:I {p(x) ∨ q(x), p(a), q(b)} is satisfiable, whileI {p(x), p(a), q(b)} and {q(x), p(a), q(b)} are unsatisfiable.

Yet it can be used when C1 ∨ · · · ∨ Cn have pairwise disjointsets of variables.

Page 54: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

15/22

Components, Splitting

Let C1, . . . ,Cn be clauses with disjoint sets of variables, n ≥ 2.

The clause D = C1 ∨ · · · ∨ Cn is splittable int C1, . . . ,Cn.

If a clause is splittable, it has a maximal splitting, which canbe found by the union-find algorithm.

Previous implementations:I Splitting with backtracking (hard to implement, moderateimprovement);

I Splitting without backtracking (rarely improves);

Page 55: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

Page 56: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

Page 57: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x ∨ y)(x ∨ y)(x ∨ y)(x ∨ y)

(x) | x

split

Page 58: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x ∨ y)(x ∨ y)

(x) | x

subsumption

Page 59: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x ∨ y)(x ∨ y)

(x) | x

(x) | x

split

Page 60: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x) | x

(x) | x

subsumption

Page 61: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x) | x∅ | x , x

(x) | x

resolution

Page 62: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x) | x

(x ∨ y)(x ∨ y)

backtrack

Page 63: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x) | x

(x ∨ y)(x ∨ y)(x ∨ y)

(y)

split

Page 64: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x) | x

(x ∨ y)

(y)

subsumption

Page 65: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(x ∨ y)

(y)

(x) | x

(x) | x

split

Page 66: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(y)

(x) | x

(x) | x

subsumption

Page 67: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(y)(x) | x∅ | x , x

(x) | x

resolution

Page 68: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

16/22

Splitting with Backtracking

(y)(x) | x∅ | x , x

(x) | x

And so on . . .

I Too many steps (for this example);I Backtracking is expensive;I Generally behaves well;I Exploits too many branches . . .

Page 69: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

17/22

Clauses with Assertions

An new data-structure for rapid splitting with backtracking:Assertion clauses D ← A or (C1 ∨ · · · ∨ Cn)← C ′

1, . . . ,C′m

All inference rules can be easily converted using assertionclauses:

D1 . . . Dk

D

D1 ← A1 . . . Dk ← Ak

D ← A1 ∪ · · · ∪ Ak

Page 70: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

18/22

AVATAR

A SAT solver, which treats a component as a propositional variable.

FO SAT

Derives

Page 71: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

18/22

AVATAR

A SAT solver, which treats a component as a propositional variable.

FO SAT

C1 ∨ · · · ∨ Cn ∨ C ′1 ∨ · · · ∨ C ′

m (split clause)

Derives C1 ∨ · · · ∨ Cn | C ′1, . . . ,C

′m

Page 72: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

18/22

AVATAR

A SAT solver, which treats a component as a propositional variable.

FO SAT

C1 ∨ · · · ∨ Cn ∨ C ′1 ∨ · · · ∨ C ′

m (split clause)

Solve!

Derives C1 ∨ · · · ∨ Cn | C ′1, . . . ,C

′m

Page 73: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

18/22

AVATAR

A SAT solver, which treats a component as a propositional variable.

FO SAT

C1 ∨ · · · ∨ Cn ∨ C ′1 ∨ · · · ∨ C ′

m (split clause)

Solve!

model {C1}

Derives C1 ∨ · · · ∨ Cn | C ′1, . . . ,C

′m

Page 74: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

18/22

AVATAR

A SAT solver, which treats a component as a propositional variable.

FO SAT

C1 ∨ · · · ∨ Cn ∨ C ′1 ∨ · · · ∨ C ′

m (split clause)

Solve!

model {C1}

Assert C1 | C1, analogue of backing if model changes

Page 75: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

18/22

AVATAR

A SAT solver, which treats a component as a propositional variable.

FO SAT

C ′1 ∨ · · · ∨ C ′

m (contradiction clause)

Derives ∅ | C ′1, . . . ,C

′m

Page 76: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

18/22

AVATAR

A SAT solver, which treats a component as a propositional variable.

FO SAT

C ′1 ∨ · · · ∨ C ′

m (contradiction clause)

Solve!

Derives ∅ | C ′1, . . . ,C

′m

Page 77: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

18/22

AVATAR

A SAT solver, which treats a component as a propositional variable.

FO SAT

C ′1 ∨ · · · ∨ C ′

m (contradiction clause)

Solve!

UNSAT

Derives ∅ | C ′1, . . . ,C

′m

Page 78: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

19/22

Problems

Implementing AVATAR heavily affect the saturation algorithm,redundancy and indexing.

I Clause deletion and undeletion via frozen clauses;I Redundancy checking;I Indexing with frozen clauses

Page 79: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

20/22

Results

I Over 400 TPTP problems previously unsolved by anyprover (including Vampire), probably unmatched since theTPTP appeared.

I About 5-10% increase in the number of problems solvedby a single strategy.

I All splitting options and a lot of hard-to-maintain coderemoved from Vampire.

CASC 2014 results of first-order theorems:

Page 80: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

20/22

Results

I Over 400 TPTP problems previously unsolved by anyprover (including Vampire), probably unmatched since theTPTP appeared.

I About 5-10% increase in the number of problems solvedby a single strategy.

I All splitting options and a lot of hard-to-maintain coderemoved from Vampire.

CASC 2014 results of first-order theorems:

Page 81: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

21/22

Future Work

I SMT solver instead of SAT solver (already implemented)I Arbitrary theory reasoningI Many questions about AVATAR itself

Page 82: AVATAR: A SAT-based Architecture for First-Order Theorem ...Feb 17, 2015  · 1/22 AVATAR: A SAT-based Architecture for First-Order Theorem-Provers Marijn J.H. Heule marijn@cs.utexas.edu

22/22

AVATAR: A SAT-based Architecturefor First-Order Theorem-Provers

Marijn J.H. [email protected]

ACL2 Seminar, February 17, 2015

adaptation of a CAV’14 talk by Andrei Voronkov