20100822 opensmt bruttomesso
-
Upload
computer-science-club -
Category
Documents
-
view
299 -
download
0
Transcript of 20100822 opensmt bruttomesso
opensmt
The OpenSMT Solver
Roberto Bruttomesso
Edgar Pek, Natasha Sharygina, Aliaksei Tsitovich
University of Lugano, Switzerland(Universita della Svizzera Italiana)
September 18, 2010
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 1 / 40
opensmt
Outline
1 Introduction
2 Architecture
3 A Variable Elimination Techique for SMTDP + FM = DPFMA crazy benchmark suiteRelated Work
4 Extending and Using OpenSMTExtending OpenSMT
5 Conclusion
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 2 / 40
opensmt
Introduction
• Satisfiability Modulo Theory (SMT) Solvers are key engines ofseveral verification approaches
• Efficient solvers however are proprietary(Z3, Yices, Barcelogic, MathSAT, . . . )
• OpenSMT is an effort of providing a simple, extensible, and efficientinfrastructure for the development of customized decision procedures
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 3 / 40
opensmt
Introduction
• Satisfiability Modulo Theory (SMT) Solvers are key engines ofseveral verification approaches
• Efficient solvers however are proprietary(Z3, Yices, Barcelogic, MathSAT, . . . )
• OpenSMT is an effort of providing a simple, extensible, and efficientinfrastructure for the development of customized decision procedures
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 3 / 40
opensmt
Introduction
• Satisfiability Modulo Theory (SMT) Solvers are key engines ofseveral verification approaches
• Efficient solvers however are proprietary(Z3, Yices, Barcelogic, MathSAT, . . . )
• OpenSMT is an effort of providing a simple, extensible, and efficientinfrastructure for the development of customized decision procedures
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 3 / 40
opensmt
Introduction
• Satisfiability Modulo Theories combines the efficiencyof SAT and theory-specific decision procedures
a ∧ ((x + y ≤ 0) ∨ ¬a) ∧ ((x = 1) ∨ b)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 4 / 40
opensmt
Introduction
• Satisfiability Modulo Theories combines the efficiencyof SAT and theory-specific decision procedures
a ∧ ((x + y ≤ 0) ∨ ¬a ) ∧ ((x = 1) ∨ b )
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 4 / 40
opensmt
Introduction
• Satisfiability Modulo Theories combines the efficiencyof SAT and theory-specific decision procedures
a ∧ ( (x + y ≤ 0) ∨ ¬a) ∧ ( (x = 1) ∨ b)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 4 / 40
opensmt
Introduction
• Satisfiability Modulo Theories combines the efficiencyof SAT and theory-specific decision procedures
a ∧ ( (x + y ≤ 0)︸ ︷︷ ︸c
∨¬a) ∧ ( (x = 1)︸ ︷︷ ︸d
∨b)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 4 / 40
opensmt
Introduction
• We need to reason about Boolean combinations ofatoms in a theory T (LRA for instance)
SAT (Boolean)(e.g. DPLL) (e.g. Simplex)
Linear Arithmetic
a1x1 + . . . + anxn + b ≤ 0
≤ 0
≤ 0
≤ 0
≤ 0
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 5 / 40
opensmt
Introduction
• We need to reason about Boolean combinations ofatoms in a theory T (LRA for instance)
SAT (Boolean)(e.g. DPLL)
(e.g. Simplex)Linear Arithmetic
a1x1 + . . . + anxn + b ≤ 0
≤ 0
≤ 0
≤ 0
≤ 0
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 5 / 40
opensmt
Introduction
• We need to reason about Boolean combinations ofatoms in a theory T (LRA for instance)
SAT (Boolean)(e.g. DPLL) (e.g. Simplex)
Linear Arithmetic
a1x1 + . . . + anxn + b ≤ 0
≤ 0
≤ 0
≤ 0
≤ 0
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 5 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL + LRA ⇒ DPLL(LRA)
DPLL(LRA)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 6 / 40
opensmt
Introduction
• DPLL(LRA) seems easy to achieve• Let DPLL enumerate Boolean models• Check LRA constraints with Simplex
• However a lot more has to be done to make itefficient
• Don’t wait for complete Boolean model• Theory Propagation• Preprocessing• Conversion to CNF• Theory Layering• . . .
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 7 / 40
opensmt
Introduction
• DPLL(LRA) seems easy to achieve• Let DPLL enumerate Boolean models• Check LRA constraints with Simplex
• However a lot more has to be done to make itefficient
• Don’t wait for complete Boolean model• Theory Propagation• Preprocessing• Conversion to CNF• Theory Layering• . . .
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 7 / 40
opensmt
Introduction
e(DPLL(T)) = e(DPLL) + e(T) + e(COMM)
DPLL T
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 8 / 40
opensmt
Introduction
e(DPLL(T)) = e(DPLL) + e(T) + e(COMM)
DPLL
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 8 / 40
opensmt
Introduction
e(DPLL(T)) ≈ e(T)
DPLL
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 8 / 40
opensmt
Outline
1 Introduction
2 Architecture
3 A Variable Elimination Techique for SMTDP + FM = DPFMA crazy benchmark suiteRelated Work
4 Extending and Using OpenSMTExtending OpenSMT
5 Conclusion
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 9 / 40
opensmt
Architecture
DL BVLRA
EUFPreprocessor
SMT-Level
SAT-Solver T -solvers
Enumerator
Boolean
ϕ
Simplifications
Parser
Preprocessor
sat (model) / unsat (proof)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 10 / 40
opensmt
Architecture
DL BVLRA
EUFPreprocessor
SMT-Level
SAT-Solver T -solvers
Enumerator
Boolean
ϕ
Simplifications
Parser
Preprocessor
sat (model) / unsat (proof)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 10 / 40
opensmt
Architecture
DL BVLRA
EUFPreprocessor
SMT-Level
SAT-Solver T -solvers
Enumerator
Boolean
ϕ
Simplifications
Parser
Preprocessor
sat (model) / unsat (proof)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 10 / 40
opensmt
Outline
1 Introduction
2 Architecture
3 A Variable Elimination Techique for SMTDP + FM = DPFMA crazy benchmark suiteRelated Work
4 Extending and Using OpenSMTExtending OpenSMT
5 Conclusion
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 11 / 40
opensmt
A Generic Template for Variable Elimination Procedures
Variable Types: T1, T2, . . .
Resolution Rules: R1, R2, . . .
Algorithm:
Input: a set of constraints
Repeat
Choose a variable X of type Ti to eliminate
Combine positive and negative occurrences of X, using Ri
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 12 / 40
opensmt
The Davis-Putnam Procedure [DP60]
Variable Types:
Bool
Resolution Rules:
Boolean Resolution (BR)
Algorithm:
Input:
a set of Boolean clauses
Repeat
Choose a variable X of type
Bool
to eliminate
Combine positive and negative occurrences of X, using
BR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 13 / 40
opensmt
The Davis-Putnam Procedure [DP60]
Variable Types: Bool
Resolution Rules:
Boolean Resolution (BR)
Algorithm:
Input:
a set of Boolean clauses
Repeat
Choose a variable X of type
Bool
to eliminate
Combine positive and negative occurrences of X, using
BR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 13 / 40
opensmt
The Davis-Putnam Procedure [DP60]
Variable Types: Bool
Resolution Rules: Boolean Resolution (BR)
Algorithm:
Input:
a set of Boolean clauses
Repeat
Choose a variable X of type
Bool
to eliminate
Combine positive and negative occurrences of X, using
BR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 13 / 40
opensmt
The Davis-Putnam Procedure [DP60]
Variable Types: Bool
Resolution Rules: Boolean Resolution (BR)
Algorithm:
Input: a set of Boolean clauses
Repeat
Choose a variable X of type
Bool
to eliminate
Combine positive and negative occurrences of X, using
BR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 13 / 40
opensmt
The Davis-Putnam Procedure [DP60]
Variable Types: Bool
Resolution Rules: Boolean Resolution (BR)
Algorithm:
Input: a set of Boolean clauses
Repeat
Choose a variable X of type Bool to eliminate
Combine positive and negative occurrences of X, using
BR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 13 / 40
opensmt
The Davis-Putnam Procedure [DP60]
Variable Types: Bool
Resolution Rules: Boolean Resolution (BR)
Algorithm:
Input: a set of Boolean clauses
Repeat
Choose a variable X of type Bool to eliminate
Combine positive and negative occurrences of X, using BR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 13 / 40
opensmt
Boolean Resolution
• Clauses are expressions like (a ∨ ¬b ∨ c), i.e., disjunctions of literals(Boolean variables or negated Boolean variables)
• In the following C1, C2, D1, D2 are disjunctions of literals
Boolean Resolution for two clauses
(C1 ∨ a ∨ C2)⊗a (D1 ∨ ¬a ∨ D2) := (C1 ∨ C2 ∨ D1 ∨ D2)
• Let Sa, S¬a be the set of clauses with positive resp. negativeoccurrences of a
Boolean Resolution for sets of clauses
Sa ⊗a S¬a := {C1 ⊗a C2 | C1 ∈ Sa,C2 ∈ S¬a }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 14 / 40
opensmt
Boolean Resolution
• Clauses are expressions like (a ∨ ¬b ∨ c), i.e., disjunctions of literals(Boolean variables or negated Boolean variables)
• In the following C1, C2, D1, D2 are disjunctions of literals
Boolean Resolution for two clauses
(C1 ∨ a ∨ C2)⊗a (D1 ∨ ¬a ∨ D2) := (C1 ∨ C2 ∨ D1 ∨ D2)
• Let Sa, S¬a be the set of clauses with positive resp. negativeoccurrences of a
Boolean Resolution for sets of clauses
Sa ⊗a S¬a := {C1 ⊗a C2 | C1 ∈ Sa,C2 ∈ S¬a }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 14 / 40
opensmt
Boolean Resolution
• Clauses are expressions like (a ∨ ¬b ∨ c), i.e., disjunctions of literals(Boolean variables or negated Boolean variables)
• In the following C1, C2, D1, D2 are disjunctions of literals
Boolean Resolution for two clauses
(C1 ∨ a ∨ C2)⊗a (D1 ∨ ¬a ∨ D2) := (C1 ∨ C2 ∨ D1 ∨ D2)
• Let Sa, S¬a be the set of clauses with positive resp. negativeoccurrences of a
Boolean Resolution for sets of clauses
Sa ⊗a S¬a := {C1 ⊗a C2 | C1 ∈ Sa,C2 ∈ S¬a }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 14 / 40
opensmt
Boolean Resolution
• Clauses are expressions like (a ∨ ¬b ∨ c), i.e., disjunctions of literals(Boolean variables or negated Boolean variables)
• In the following C1, C2, D1, D2 are disjunctions of literals
Boolean Resolution for two clauses
(C1 ∨ a ∨ C2)⊗a (D1 ∨ ¬a ∨ D2) := (C1 ∨ C2 ∨ D1 ∨ D2)
• Let Sa, S¬a be the set of clauses with positive resp. negativeoccurrences of a
Boolean Resolution for sets of clauses
Sa ⊗a S¬a := {C1 ⊗a C2 | C1 ∈ Sa,C2 ∈ S¬a }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 14 / 40
opensmt
Boolean Resolution
• Clauses are expressions like (a ∨ ¬b ∨ c), i.e., disjunctions of literals(Boolean variables or negated Boolean variables)
• In the following C1, C2, D1, D2 are disjunctions of literals
Boolean Resolution for two clauses
(C1 ∨ a ∨ C2)⊗a (D1 ∨ ¬a ∨ D2) := (C1 ∨ C2 ∨ D1 ∨ D2)
• Let Sa, S¬a be the set of clauses with positive resp. negativeoccurrences of a
Boolean Resolution for sets of clauses
Sa ⊗a S¬a := {C1 ⊗a C2 | C1 ∈ Sa,C2 ∈ S¬a }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 14 / 40
opensmt
Boolean Resolution
• Let Sa, S¬a be the set of clauses with positive resp. negativeoccurrences of a
Boolean Resolution for sets of clauses
Sa ⊗a S¬a := {C1 ⊗a C2 | C1 ∈ Sa,C2 ∈ S¬a }
Theorem [DP60]
Sa ∪ S¬a is equisatisfiable with Sa ⊗a S¬a
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 15 / 40
opensmt
DP - Example (on var a)
OLD NEW
(a ∨ b ∨ c)
(a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
S¬a (¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c)
(a ∨ ¬b ∨ ¬c)
S¬a(¬a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c)
(a ∨ ¬b ∨ ¬c)
S¬a(¬a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c)
S¬a(¬a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c)
S¬a(¬a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c) (b ∨ c ∨ ¬b ∨ c)
S¬a(¬a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c) (b ∨ c ∨ ¬b ∨ c)
S¬a(¬a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c) (b ∨ c ∨ ¬b ∨ c)
S¬a(¬a ∨ ¬b ∨ ¬c) (¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c) (b ∨ c ∨ ¬b ∨ c)
S¬a(¬a ∨ ¬b ∨ ¬c) (¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
Sa(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c) (b ∨ c ∨ ¬b ∨ c)
S¬a(¬a ∨ ¬b ∨ ¬c) (¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c) (¬b ∨ ¬c ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c) (b ∨ c ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c) (¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c) (¬b ∨ ¬c ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
(a ∨ b ∨ c) (b ∨ c ∨ ¬b ∨ ¬c)
(a ∨ ¬b ∨ ¬c) (b ∨ c ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c) (¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c) (¬b ∨ ¬c ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
DP - Example (on var a)
OLD NEW
(a ∨ b ∨ c)
(a ∨ ¬b ∨ ¬c)
(¬a ∨ ¬b ∨ ¬c) (¬b ∨ ¬c)
(¬a ∨ ¬b ∨ c)
(¬a ∨ ¬b ∨ ¬c)Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 16 / 40
opensmt
The Fourier-Motzkin Elimination [Fou26]
Variable Types:
Rational
Resolution Rules:
LRA Resolution (RR)
Algorithm:
Input:
a set of LRA constraints
Repeat
Choose a variable X of type
Rational
to eliminate
Combine positive and negative occurrences of X, using
RR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 17 / 40
opensmt
The Fourier-Motzkin Elimination [Fou26]
Variable Types: Rational
Resolution Rules:
LRA Resolution (RR)
Algorithm:
Input:
a set of LRA constraints
Repeat
Choose a variable X of type
Rational
to eliminate
Combine positive and negative occurrences of X, using
RR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 17 / 40
opensmt
The Fourier-Motzkin Elimination [Fou26]
Variable Types: Rational
Resolution Rules: LRA Resolution (RR)
Algorithm:
Input:
a set of LRA constraints
Repeat
Choose a variable X of type
Rational
to eliminate
Combine positive and negative occurrences of X, using
RR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 17 / 40
opensmt
The Fourier-Motzkin Elimination [Fou26]
Variable Types: Rational
Resolution Rules: LRA Resolution (RR)
Algorithm:
Input: a set of LRA constraints
Repeat
Choose a variable X of type
Rational
to eliminate
Combine positive and negative occurrences of X, using
RR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 17 / 40
opensmt
The Fourier-Motzkin Elimination [Fou26]
Variable Types: Rational
Resolution Rules: LRA Resolution (RR)
Algorithm:
Input: a set of LRA constraints
Repeat
Choose a variable X of type Rational to eliminate
Combine positive and negative occurrences of X, using
RR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 17 / 40
opensmt
The Fourier-Motzkin Elimination [Fou26]
Variable Types: Rational
Resolution Rules: LRA Resolution (RR)
Algorithm:
Input: a set of LRA constraints
Repeat
Choose a variable X of type Rational to eliminate
Combine positive and negative occurrences of X, using RR
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 17 / 40
opensmt
LRA Resolution
• LRA constraints are expressions like 3x − 5y + 10z ≤ 15
• Notice that ≤ is sufficient to represent also {=, <} (see [DdM06])
• LRA constraints can be rewritten in terms of upper bound x ≤ p orlower bound −x ≤ p for a variable x .
LRA Resolution for two constraints
(x ≤ p)⊗x (−x ≤ q) := (−q ≤ p)
• Let Sx , S−x be the set of upper resp. lower bounds for x
LRA Resolution for sets of constraints
Sx ⊗x S−x := {(x ≤ p)⊗x (−x ≤ q) | (x ≤ p) ∈ Sx , (−x ≤ q) ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 18 / 40
opensmt
LRA Resolution
• LRA constraints are expressions like 3x − 5y + 10z ≤ 15
• Notice that ≤ is sufficient to represent also {=, <} (see [DdM06])
• LRA constraints can be rewritten in terms of upper bound x ≤ p orlower bound −x ≤ p for a variable x .
LRA Resolution for two constraints
(x ≤ p)⊗x (−x ≤ q) := (−q ≤ p)
• Let Sx , S−x be the set of upper resp. lower bounds for x
LRA Resolution for sets of constraints
Sx ⊗x S−x := {(x ≤ p)⊗x (−x ≤ q) | (x ≤ p) ∈ Sx , (−x ≤ q) ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 18 / 40
opensmt
LRA Resolution
• LRA constraints are expressions like 3x − 5y + 10z ≤ 15
• Notice that ≤ is sufficient to represent also {=, <} (see [DdM06])
• LRA constraints can be rewritten in terms of upper bound x ≤ p orlower bound −x ≤ p for a variable x .
LRA Resolution for two constraints
(x ≤ p)⊗x (−x ≤ q) := (−q ≤ p)
• Let Sx , S−x be the set of upper resp. lower bounds for x
LRA Resolution for sets of constraints
Sx ⊗x S−x := {(x ≤ p)⊗x (−x ≤ q) | (x ≤ p) ∈ Sx , (−x ≤ q) ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 18 / 40
opensmt
LRA Resolution
• LRA constraints are expressions like 3x − 5y + 10z ≤ 15
• Notice that ≤ is sufficient to represent also {=, <} (see [DdM06])
• LRA constraints can be rewritten in terms of upper bound x ≤ p orlower bound −x ≤ p for a variable x .
LRA Resolution for two constraints
(x ≤ p)⊗x (−x ≤ q) := (−q ≤ p)
• Let Sx , S−x be the set of upper resp. lower bounds for x
LRA Resolution for sets of constraints
Sx ⊗x S−x := {(x ≤ p)⊗x (−x ≤ q) | (x ≤ p) ∈ Sx , (−x ≤ q) ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 18 / 40
opensmt
LRA Resolution
• LRA constraints are expressions like 3x − 5y + 10z ≤ 15
• Notice that ≤ is sufficient to represent also {=, <} (see [DdM06])
• LRA constraints can be rewritten in terms of upper bound x ≤ p orlower bound −x ≤ p for a variable x .
LRA Resolution for two constraints
(x ≤ p)⊗x (−x ≤ q) := (−q ≤ p)
• Let Sx , S−x be the set of upper resp. lower bounds for x
LRA Resolution for sets of constraints
Sx ⊗x S−x := {(x ≤ p)⊗x (−x ≤ q) | (x ≤ p) ∈ Sx , (−x ≤ q) ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 18 / 40
opensmt
LRA Resolution
• LRA constraints are expressions like 3x − 5y + 10z ≤ 15
• Notice that ≤ is sufficient to represent also {=, <} (see [DdM06])
• LRA constraints can be rewritten in terms of upper bound x ≤ p orlower bound −x ≤ p for a variable x .
LRA Resolution for two constraints
(x ≤ p)⊗x (−x ≤ q) := (−q ≤ p)
• Let Sx , S−x be the set of upper resp. lower bounds for x
LRA Resolution for sets of constraints
Sx ⊗x S−x := {(x ≤ p)⊗x (−x ≤ q) | (x ≤ p) ∈ Sx , (−x ≤ q) ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 18 / 40
opensmt
LRA Resolution
• LRA constraints are expressions like 3x − 5y + 10z ≤ 15
• Notice that ≤ is sufficient to represent also {=, <} (see [DdM06])
• LRA constraints can be rewritten in terms of upper bound x ≤ p orlower bound −x ≤ p for a variable x .
LRA Resolution for two constraints
(x ≤ p)⊗x (−x ≤ q) := (−q ≤ p)
• Let Sx , S−x be the set of upper resp. lower bounds for x
LRA Resolution for sets of constraints
Sx ⊗x S−x := {(x ≤ p)⊗x (−x ≤ q) | (x ≤ p) ∈ Sx , (−x ≤ q) ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 18 / 40
opensmt
LRA Resolution
• Let Sx , S−x be the set of upper resp. lower bounds for x
LRA Resolution for sets of constraints
Sx ⊗x S−x := {(x ≤ p)⊗x (−x ≤ q) | (x ≤ p) ∈ Sx , (−x ≤ q) ∈ S−x }
Theorem [Fou26]
Sx ∪ S−x is equisatisfiable with Sx ⊗x S−x
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 19 / 40
opensmt
FM - Example (on var z)
OLD NEW
−x + z ≤ −4
x + z ≤ 18
x − z ≤ 6
−x − z ≤ −16
y ≤ 5
−y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4
x + z ≤ 18
S−zx − z ≤ 6
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4
x + z ≤ 18
S−zx − z ≤ 6
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4 0 ≤ 2
x + z ≤ 18
S−zx − z ≤ 6
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4 0 ≤ 2
x + z ≤ 18
S−zx − z ≤ 6
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4 0 ≤ 2
x + z ≤ 18 −x ≤ −10
S−zx − z ≤ 6
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4 0 ≤ 2
x + z ≤ 18 −x ≤ −10
S−zx − z ≤ 6
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4 0 ≤ 2
x + z ≤ 18 −x ≤ −10
S−zx − z ≤ 6 x ≤ 12
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4 0 ≤ 2
x + z ≤ 18 −x ≤ −10
S−zx − z ≤ 6 x ≤ 12
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4 0 ≤ 2
x + z ≤ 18 −x ≤ −10
S−zx − z ≤ 6 x ≤ 12
−x − z ≤ −16 0 ≤ 2
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
Sz−x + z ≤ −4 0 ≤ 2
x + z ≤ 18 −x ≤ −10
S−zx − z ≤ 6 x ≤ 12
−x − z ≤ −16 0 ≤ 2
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
S−z −x − z ≤ −16
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
OLD NEW
−x + z ≤ −4
x + z ≤ 18 −x ≤ −10
x − z ≤ 6 x ≤ 12
−x − z ≤ −16
y ≤ 5 y ≤ 5
−y ≤ −3 −y ≤ −3
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 20 / 40
opensmt
FM - Example (on var z)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 21 / 40
opensmt
DP + FM = DPFM
Variable Types:
Bool , Rational
Resolution Rules:
BR , SMT(LRA) Resolution (SR)
Algorithm:
Input:
a set of SMT(LRA) clauses in OCCF
Repeat
Choose a variable X of type
Bool ( Rational )
to eliminate
Combine positive and negative occurrences of X, using
BR ( SR )
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 22 / 40
opensmt
DP + FM = DPFM
Variable Types: Bool , Rational
Resolution Rules:
BR , SMT(LRA) Resolution (SR)
Algorithm:
Input:
a set of SMT(LRA) clauses in OCCF
Repeat
Choose a variable X of type
Bool ( Rational )
to eliminate
Combine positive and negative occurrences of X, using
BR ( SR )
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 22 / 40
opensmt
DP + FM = DPFM
Variable Types: Bool , Rational
Resolution Rules: BR , SMT(LRA) Resolution (SR)
Algorithm:
Input:
a set of SMT(LRA) clauses in OCCF
Repeat
Choose a variable X of type
Bool ( Rational )
to eliminate
Combine positive and negative occurrences of X, using
BR ( SR )
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 22 / 40
opensmt
DP + FM = DPFM
Variable Types: Bool , Rational
Resolution Rules: BR , SMT(LRA) Resolution (SR)
Algorithm:
Input: a set of SMT(LRA) clauses in OCCF
Repeat
Choose a variable X of type
Bool ( Rational )
to eliminate
Combine positive and negative occurrences of X, using
BR ( SR )
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 22 / 40
opensmt
DP + FM = DPFM
Variable Types: Bool , Rational
Resolution Rules: BR , SMT(LRA) Resolution (SR)
Algorithm:
Input: a set of SMT(LRA) clauses in OCCF
Repeat
Choose a variable X of type Bool ( Rational ) to eliminate
Combine positive and negative occurrences of X, using
BR ( SR )
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 22 / 40
opensmt
DP + FM = DPFM
Variable Types: Bool , Rational
Resolution Rules: BR , SMT(LRA) Resolution (SR)
Algorithm:
Input: a set of SMT(LRA) clauses in OCCF
Repeat
Choose a variable X of type Bool ( Rational ) to eliminate
Combine positive and negative occurrences of X, using BR ( SR )
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 22 / 40
opensmt
One Constraint per Clause Form (OCCF)
• DPFM requires clauses in OCCF, clauses that containat most one LRA constraint
• it is easy to transform clauses in OCCF, by means of auxiliaryBoolean variables
• E.g. (a ∨ (x ≤ 3) ∨ b ∨ (x + y ≤ 10)) can be rewritten as(a ∨ (x ≤ 3) ∨ b ∨ c ) and ( ¬c ∨ (x + y ≤ 10))
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 23 / 40
opensmt
One Constraint per Clause Form (OCCF)
• DPFM requires clauses in OCCF, clauses that containat most one LRA constraint
• it is easy to transform clauses in OCCF, by means of auxiliaryBoolean variables
• E.g. (a ∨ (x ≤ 3) ∨ b ∨ (x + y ≤ 10)) can be rewritten as(a ∨ (x ≤ 3) ∨ b ∨ c ) and ( ¬c ∨ (x + y ≤ 10))
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 23 / 40
opensmt
One Constraint per Clause Form (OCCF)
• DPFM requires clauses in OCCF, clauses that containat most one LRA constraint
• it is easy to transform clauses in OCCF, by means of auxiliaryBoolean variables
• E.g. (a ∨ (x ≤ 3) ∨ b ∨ (x + y ≤ 10)) can be rewritten as(a ∨ (x ≤ 3) ∨ b ∨ c ) and ( ¬c ∨ (x + y ≤ 10))
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 23 / 40
opensmt
SMT(LRA) Resolution
• negated LRA constr. can be expressed in terms of ≤• e.g. ¬(x ≤ 10) is equiv. to −x ≤ −10− δ, (δ > 0) (see [DdM06])
• LRA constraints in SMT(LRA) clauses can be rewritten in terms ofupper bound x ≤ p or lower bound −x ≤ p for a variable x .
SMT(LRA) Resolution for two clauses in OCCF
(C1∨(x ≤ p)∨C2)⊗x (D1∨(−x ≤ q)∨D2) := C1∨C2∨(−q ≤ p)∨D1∨D2
• Let Sx , S−x be the set of SMT(LRA) clauses where x appears upperbounded resp. lower bounded
SMT(LRA) Resolution for sets of clauses in OCCF
Sx ⊗x S−x := {C1 ⊗x C2 | C1 ∈ Sx ,C2 ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 24 / 40
opensmt
SMT(LRA) Resolution
• negated LRA constr. can be expressed in terms of ≤• e.g. ¬(x ≤ 10) is equiv. to −x ≤ −10− δ, (δ > 0) (see [DdM06])
• LRA constraints in SMT(LRA) clauses can be rewritten in terms ofupper bound x ≤ p or lower bound −x ≤ p for a variable x .
SMT(LRA) Resolution for two clauses in OCCF
(C1∨(x ≤ p)∨C2)⊗x (D1∨(−x ≤ q)∨D2) := C1∨C2∨(−q ≤ p)∨D1∨D2
• Let Sx , S−x be the set of SMT(LRA) clauses where x appears upperbounded resp. lower bounded
SMT(LRA) Resolution for sets of clauses in OCCF
Sx ⊗x S−x := {C1 ⊗x C2 | C1 ∈ Sx ,C2 ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 24 / 40
opensmt
SMT(LRA) Resolution
• negated LRA constr. can be expressed in terms of ≤• e.g. ¬(x ≤ 10) is equiv. to −x ≤ −10− δ, (δ > 0) (see [DdM06])
• LRA constraints in SMT(LRA) clauses can be rewritten in terms ofupper bound x ≤ p or lower bound −x ≤ p for a variable x .
SMT(LRA) Resolution for two clauses in OCCF
(C1∨(x ≤ p)∨C2)⊗x (D1∨(−x ≤ q)∨D2) := C1∨C2∨(−q ≤ p)∨D1∨D2
• Let Sx , S−x be the set of SMT(LRA) clauses where x appears upperbounded resp. lower bounded
SMT(LRA) Resolution for sets of clauses in OCCF
Sx ⊗x S−x := {C1 ⊗x C2 | C1 ∈ Sx ,C2 ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 24 / 40
opensmt
SMT(LRA) Resolution
• negated LRA constr. can be expressed in terms of ≤• e.g. ¬(x ≤ 10) is equiv. to −x ≤ −10− δ, (δ > 0) (see [DdM06])
• LRA constraints in SMT(LRA) clauses can be rewritten in terms ofupper bound x ≤ p or lower bound −x ≤ p for a variable x .
SMT(LRA) Resolution for two clauses in OCCF
(C1∨(x ≤ p)∨C2)⊗x (D1∨(−x ≤ q)∨D2) := C1∨C2∨(−q ≤ p)∨D1∨D2
• Let Sx , S−x be the set of SMT(LRA) clauses where x appears upperbounded resp. lower bounded
SMT(LRA) Resolution for sets of clauses in OCCF
Sx ⊗x S−x := {C1 ⊗x C2 | C1 ∈ Sx ,C2 ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 24 / 40
opensmt
SMT(LRA) Resolution
• negated LRA constr. can be expressed in terms of ≤• e.g. ¬(x ≤ 10) is equiv. to −x ≤ −10− δ, (δ > 0) (see [DdM06])
• LRA constraints in SMT(LRA) clauses can be rewritten in terms ofupper bound x ≤ p or lower bound −x ≤ p for a variable x .
SMT(LRA) Resolution for two clauses in OCCF
(C1∨(x ≤ p)∨C2)⊗x (D1∨(−x ≤ q)∨D2) := C1∨C2∨(−q ≤ p)∨D1∨D2
• Let Sx , S−x be the set of SMT(LRA) clauses where x appears upperbounded resp. lower bounded
SMT(LRA) Resolution for sets of clauses in OCCF
Sx ⊗x S−x := {C1 ⊗x C2 | C1 ∈ Sx ,C2 ∈ S−x }
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 24 / 40
opensmt
SMT(LRA) Resolution
• Let Sx , S−x be the set of SMT(LRA) clauses where x appears upperbounded resp. lower bounded
SMT(LRA) Resolution for sets of clauses in OCCF
Sx ⊗x S−x := {C1 ⊗x C2 | C1 ∈ Sx ,C2 ∈ S−x }
Theorem
Sx ∪ S−x is equisatisfiable with Sx ⊗x S−x
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 25 / 40
opensmt
DPFM - Example (on var z)
¬a1 ∨ (−z ≤ −3) a1 ∨ (z ≤ 3− δ) ∨ a2
¬a1 ∨ (−x ≤ −3) ¬a2 ∨ (x ≤ 3− δ) ∨ a3
¬a1 ∨ (−y ≤ −3) ¬a3 ∨ (y ≤ 3− δ) ∨ a4
¬a1 ∨ (y ≤ 5) ¬a4 ∨ (−y ≤ 5− δ) ∨ a5
¬a1 ∨ (x ≤ 5) ¬a5 ∨ (−x ≤ 5− δ) ∨ a6
¬a1 ∨ (z ≤ 5) ¬a6 ∨ (−z ≤ 5− δ)¬b1 ∨ (−z ≤ −2) b1 ∨ (z ≤ 2− δ) ∨ b2
¬b1 ∨ (−x ≤ −2) ¬b2 ∨ (x ≤ 2− δ) ∨ b3
¬b1 ∨ (−y ≤ −2) ¬b3 ∨ (y ≤ 2− δ) ∨ b4
¬b1 ∨ (y ≤ 4) ¬b4 ∨ (−y ≤ 4− δ) ∨ b5
¬b1 ∨ (x ≤ 4) ¬b5 ∨ (−x ≤ 4− δ) ∨ b6
¬b1 ∨ (z ≤ 4) ¬b6 ∨ (−z ≤ 4− δ)a1 ∨ b1
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 26 / 40
opensmt
DPFM - Example (on var z)
¬a1 ∨ (−z ≤ −3) a1 ∨ (z ≤ 3− δ) ∨ a2
¬a1 ∨ (−x ≤ −3) ¬a2 ∨ (x ≤ 3− δ) ∨ a3
¬a1 ∨ (−y ≤ −3) ¬a3 ∨ (y ≤ 3− δ) ∨ a4
¬a1 ∨ (y ≤ 5) ¬a4 ∨ (−y ≤ −5− δ) ∨ a5
¬a1 ∨ (x ≤ 5) ¬a5 ∨ (−x ≤ −5− δ) ∨ a6
¬a1 ∨ (z ≤ 5) ¬a6 ∨ (−z ≤ −5− δ)
¬b1 ∨ (−z ≤ −2) b1 ∨ (z ≤ 2− δ) ∨ b2
¬b1 ∨ (−x ≤ −2) ¬b2 ∨ (x ≤ 2− δ) ∨ b3
¬b1 ∨ (−y ≤ −2) ¬b3 ∨ (y ≤ 2− δ) ∨ b4
¬b1 ∨ (y ≤ 4) ¬b4 ∨ (−y ≤ −4− δ) ∨ b5
¬b1 ∨ (x ≤ 4) ¬b5 ∨ (−x ≤ −4− δ) ∨ b6
¬b1 ∨ (z ≤ 4) ¬b6 ∨ (−z ≤ −4− δ)
a1 ∨ b1
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 26 / 40
opensmt
DPFM - Example (on var z)
OLD NEW¬a1 ∨ (z ≤ 5)¬b1 ∨ (z ≤ 4)a1 ∨ (z ≤ 3− δ) ∨ a2
b1 ∨ (z ≤ 2− δ) ∨ b2
¬a6 ∨ (−z ≤ −5− δ)¬b6 ∨ (−z ≤ −4− δ)¬a1 ∨ (−z ≤ −3)¬b1 ∨ (−z ≤ −2)
S−z a1 ∨ (z ≤ 3− δ) ∨ a2
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 26 / 40
opensmt
DPFM - Example (on var z)
OLD NEW
Sz
¬a1 ∨ (z ≤ 5)¬b1 ∨ (z ≤ 4)a1 ∨ (z ≤ 3− δ) ∨ a2
b1 ∨ (z ≤ 2− δ) ∨ b2
S−z
¬a6 ∨ (−z ≤ −5− δ)¬b6 ∨ (−z ≤ −4− δ)¬a1 ∨ (−z ≤ −3)¬b1 ∨ (−z ≤ −2)
S−z a1 ∨ (z ≤ 3− δ) ∨ a2
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 26 / 40
opensmt
DPFM - Example (on var z)
OLD NEW
Sz
¬a1 ∨ (z ≤ 5)
¬b1 ∨ (z ≤ 4)a1 ∨ (z ≤ 3− δ) ∨ a2
b1 ∨ (z ≤ 2− δ) ∨ b2
S−z
¬a6 ∨ (−z ≤ −5− δ)
¬b6 ∨ (−z ≤ −4− δ)¬a1 ∨ (−z ≤ −3)¬b1 ∨ (−z ≤ −2)
S−z a1 ∨ (z ≤ 3− δ) ∨ a2
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 26 / 40
opensmt
DPFM - Example (on var z)
OLD NEW
Sz
¬a1 ∨ (z ≤ 5) ¬a1 ∨ (0 ≤ −δ) ∨ ¬a6
¬b1 ∨ (z ≤ 4)a1 ∨ (z ≤ 3− δ) ∨ a2
b1 ∨ (z ≤ 2− δ) ∨ b2
S−z
¬a6 ∨ (−z ≤ −5− δ)
¬b6 ∨ (−z ≤ −4− δ)¬a1 ∨ (−z ≤ −3)¬b1 ∨ (−z ≤ −2)
S−z a1 ∨ (z ≤ 3− δ) ∨ a2
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 26 / 40
opensmt
DPFM - Example (on var z)
OLD NEW
Sz
¬a1 ∨ (z ≤ 5) ¬a1 ∨ (0 ≤ −δ) ∨ ¬a6
¬b1 ∨ (z ≤ 4) ¬a1 ∨ (0 ≤ 1− δ) ∨ ¬b6
a1 ∨ (z ≤ 3− δ) ∨ a2 ¬a1 ∨ (0 ≤ 2)b1 ∨ (z ≤ 2− δ) ∨ b2 ¬a1 ∨ (0 ≤ 3) ∨ ¬b1
S−z
¬a6 ∨ (−z ≤ −5− δ) ¬b1 ∨ (0 ≤ −1− δ) ∨ ¬a6
¬b6 ∨ (−z ≤ −4− δ) ¬b1 ∨ (0 ≤ −δ) ∨ ¬b6
¬a1 ∨ (−z ≤ −3) ¬b1 ∨ (0 ≤ 1) ∨ ¬a1
¬b1 ∨ (−z ≤ −2) ¬b1 ∨ (0 ≤ 2)a1 ∨ (0 ≤ −2− δ) ∨ a2 ∨ ¬a6
a1 ∨ (0 ≤ −1− δ) ∨ a2 ∨ ¬b6
a1 ∨ (0 ≤ −δ) ∨ ¬a1 ∨ a2
a1 ∨ (0 ≤ 1− δ) ∨ ¬b1 ∨ a2
b1 ∨ (0 ≤ −3− δ) ∨ b2 ∨ ¬a6
b1 ∨ (0 ≤ −2− δ) ∨ b2 ∨ ¬b6
b1 ∨ (0 ≤ −1− δ) ∨ ¬a1 ∨ b2
b1 ∨ (0 ≤ −δ) ∨ ¬b1 ∨ b2
S−z a1 ∨ (z ≤ 3− δ) ∨ a2Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 26 / 40
opensmt
DPFM - Example (on var z)
OLD NEW¬a1 ∨ (z ≤ 5) ¬a1 ∨ ¬a6
¬b1 ∨ (z ≤ 4)a1 ∨ (z ≤ 3− δ) ∨ a2
b1 ∨ (z ≤ 2− δ) ∨ b2
¬a6 ∨ (−z ≤ −5− δ) ¬b1 ∨ ¬a6
¬b6 ∨ (−z ≤ −4− δ) ¬b1 ∨ ¬b6
¬a1 ∨ (−z ≤ −3)¬b1 ∨ (−z ≤ −2)
a1 ∨ a2 ∨ ¬a6
a1 ∨ a2 ∨ ¬b6
b1 ∨ b2 ∨ ¬a6
b1 ∨ b2 ∨ ¬b6
b1 ∨ ¬a1 ∨ b2
S−z a1 ∨ (z ≤ 3− δ) ∨ a2Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 26 / 40
opensmt
DPFM - Example (on var z)
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 27 / 40
opensmt
Variable Elimination - Complexity
• High worst-case complexity
• Suppose we have n variables and m initial clauses
• Suppose we eliminate a1: in the worst case |Sa1 | = |S¬a1 | = m2
• After elim. a1 we have m2 ×
m2 = m2
4 clauses
• After elim. a2 we have m2
8 ×m2
8 = m4
43 clauses
• After elim. an we have m2n−1
4(2n−1− 12 )× m2n−1
4(2n−1− 12 )
= m2n
42n−1 clauses
1
100
10000
1e+06
1e+08
1e+10
1e+12
1e+14
0 1 2 3 4 5
m=10
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 28 / 40
opensmt
Variable Elimination - Complexity
• High worst-case complexity
• Suppose we have n variables and m initial clauses
• Suppose we eliminate a1: in the worst case |Sa1 | = |S¬a1 | = m2
• After elim. a1 we have m2 ×
m2 = m2
4 clauses
• After elim. a2 we have m2
8 ×m2
8 = m4
43 clauses
• After elim. an we have m2n−1
4(2n−1− 12 )× m2n−1
4(2n−1− 12 )
= m2n
42n−1 clauses
1
100
10000
1e+06
1e+08
1e+10
1e+12
1e+14
0 1 2 3 4 5
m=10
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 28 / 40
opensmt
Variable Elimination - Complexity
• High worst-case complexity
• Suppose we have n variables and m initial clauses
• Suppose we eliminate a1: in the worst case |Sa1 | = |S¬a1 | = m2
• After elim. a1 we have m2 ×
m2 = m2
4 clauses
• After elim. a2 we have m2
8 ×m2
8 = m4
43 clauses
• After elim. an we have m2n−1
4(2n−1− 12 )× m2n−1
4(2n−1− 12 )
= m2n
42n−1 clauses
1
100
10000
1e+06
1e+08
1e+10
1e+12
1e+14
0 1 2 3 4 5
m=10
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 28 / 40
opensmt
Variable Elimination - Complexity
• High worst-case complexity
• Suppose we have n variables and m initial clauses
• Suppose we eliminate a1: in the worst case |Sa1 | = |S¬a1 | = m2
• After elim. a1 we have m2 ×
m2 = m2
4 clauses
• After elim. a2 we have m2
8 ×m2
8 = m4
43 clauses
• After elim. an we have m2n−1
4(2n−1− 12 )× m2n−1
4(2n−1− 12 )
= m2n
42n−1 clauses
1
100
10000
1e+06
1e+08
1e+10
1e+12
1e+14
0 1 2 3 4 5
m=10
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 28 / 40
opensmt
Variable Elimination - Complexity
• High worst-case complexity
• Suppose we have n variables and m initial clauses
• Suppose we eliminate a1: in the worst case |Sa1 | = |S¬a1 | = m2
• After elim. a1 we have m2 ×
m2 = m2
4 clauses
• After elim. a2 we have m2
8 ×m2
8 = m4
43 clauses
• After elim. an we have m2n−1
4(2n−1− 12 )× m2n−1
4(2n−1− 12 )
= m2n
42n−1 clauses
1
100
10000
1e+06
1e+08
1e+10
1e+12
1e+14
0 1 2 3 4 5
m=10
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 28 / 40
opensmt
Variable Elimination - Complexity
• High worst-case complexity
• Suppose we have n variables and m initial clauses
• Suppose we eliminate a1: in the worst case |Sa1 | = |S¬a1 | = m2
• After elim. a1 we have m2 ×
m2 = m2
4 clauses
• After elim. a2 we have m2
8 ×m2
8 = m4
43 clauses
• After elim. an we have m2n−1
4(2n−1− 12 )× m2n−1
4(2n−1− 12 )
= m2n
42n−1 clauses
1
100
10000
1e+06
1e+08
1e+10
1e+12
1e+14
0 1 2 3 4 5
m=10
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 28 / 40
opensmt
Variable Elimination - Complexity
• High worst-case complexity
• Suppose we have n variables and m initial clauses
• Suppose we eliminate a1: in the worst case |Sa1 | = |S¬a1 | = m2
• After elim. a1 we have m2 ×
m2 = m2
4 clauses
• After elim. a2 we have m2
8 ×m2
8 = m4
43 clauses
• After elim. an we have m2n−1
4(2n−1− 12 )× m2n−1
4(2n−1− 12 )
= m2n
42n−1 clauses
1
100
10000
1e+06
1e+08
1e+10
1e+12
1e+14
0 1 2 3 4 5
m=10
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 28 / 40
opensmt
Formula Simplification and Preprocessing
• Variable Elimination technique for SMT(LRA)
• We apply it for preprocessing, similarly to the SATElite [EB05]preprocessor
• Variable elimination rule (among other rules) is applied in a controlledmanner so that it does not produce too many clauses
• In our case we use two upper bounds for two parametersconcerning Rational variables
• Centrality (for x) : number of distinct variables that appear in someconstraint with x
• Trade-off (for x) : amount of new clauses that we want to “trade”for eliminating x
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 29 / 40
opensmt
Formula Simplification and Preprocessing
• Variable Elimination technique for SMT(LRA)
• We apply it for preprocessing, similarly to the SATElite [EB05]preprocessor
• Variable elimination rule (among other rules) is applied in a controlledmanner so that it does not produce too many clauses
• In our case we use two upper bounds for two parametersconcerning Rational variables
• Centrality (for x) : number of distinct variables that appear in someconstraint with x
• Trade-off (for x) : amount of new clauses that we want to “trade”for eliminating x
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 29 / 40
opensmt
Formula Simplification and Preprocessing
• Variable Elimination technique for SMT(LRA)
• We apply it for preprocessing, similarly to the SATElite [EB05]preprocessor
• Variable elimination rule (among other rules) is applied in a controlledmanner so that it does not produce too many clauses
• In our case we use two upper bounds for two parametersconcerning Rational variables
• Centrality (for x) : number of distinct variables that appear in someconstraint with x
• Trade-off (for x) : amount of new clauses that we want to “trade”for eliminating x
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 29 / 40
opensmt
Formula Simplification and Preprocessing
• Variable Elimination technique for SMT(LRA)
• We apply it for preprocessing, similarly to the SATElite [EB05]preprocessor
• Variable elimination rule (among other rules) is applied in a controlledmanner so that it does not produce too many clauses
• In our case we use two upper bounds for two parametersconcerning Rational variables
• Centrality (for x) : number of distinct variables that appear in someconstraint with x
• Trade-off (for x) : amount of new clauses that we want to “trade”for eliminating x
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 29 / 40
opensmt
Formula Simplification and Preprocessing
• Variable Elimination technique for SMT(LRA)
• We apply it for preprocessing, similarly to the SATElite [EB05]preprocessor
• Variable elimination rule (among other rules) is applied in a controlledmanner so that it does not produce too many clauses
• In our case we use two upper bounds for two parametersconcerning Rational variables
• Centrality (for x) : number of distinct variables that appear in someconstraint with x
• Trade-off (for x) : amount of new clauses that we want to “trade”for eliminating x
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 29 / 40
opensmt
Formula Simplification - (Centrality 2, Trade-off 128)
OpenSMT on QF IDL/qlock Benchmarks - Structural Data
P.Time (s) Clauses TAtoms TVars
Bench WO W WO W WO W WO W
Ind 37 1.08 6.57 41137 35299 6129 5285 829 185Ind 38 1.16 6.62 42265 36244 6299 5423 851 188Ind 39 1.19 7.02 43381 37150 6467 5562 873 189Ind 40 1.17 7.05 44457 38114 6619 5702 895 203Base 18 0.80 1.87 18630 16314 2867 2559 375 137Base 19 0.82 2.31 19780 17269 3045 2702 397 150Base 20 0.95 2.47 20914 18246 3215 2851 419 151Base 21 0.94 2.54 22052 19193 3389 2995 441 155
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 30 / 40
opensmt
Formula Simplification - (Centrality 2, Trade-off 128)
OpenSMT on QF IDL/qlock Benchmarks - Structural Data
P.Time (s) Clauses TAtoms TVars
Bench WO W WO W WO W WO W
Ind 37 1.08 6.57 41137 35299 6129 5285 829 185Ind 38 1.16 6.62 42265 36244 6299 5423 851 188Ind 39 1.19 7.02 43381 37150 6467 5562 873 189Ind 40 1.17 7.05 44457 38114 6619 5702 895 203Base 18 0.80 1.87 18630 16314 2867 2559 375 137Base 19 0.82 2.31 19780 17269 3045 2702 397 150Base 20 0.95 2.47 20914 18246 3215 2851 419 151Base 21 0.94 2.54 22052 19193 3389 2995 441 155
OpenSMT on QF IDL/qlock Benchmarks - Solving Time
Bench Time WO (s) Time W (s) Bench Time WO (s) Time W (s)
Base 18 61.3 59.0 Ind 37 90.5 18.0Base 19 146.1 138.4 Ind 38 105.7 54.6Base 20 > 1800 940.1 Ind 39 64.4 46.7Base 21 1367.9 765.0 Ind 40 98.3 37.3
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 30 / 40
opensmt
Mixed Boolean-Theory Static Learning
OpenSMT on QF IDL/job shop/jobshop12-2-6-6-2-4-9.smt
Centr. Trade-Off VE P.Time Clauses TAtoms BAtoms T.Time (s)
- - 0 0.05 216 612 0 > 1800
12 64 0 0.05 216 612 0 > 180012 256 2 0.06 458 832 22 180.012 1024 4 0.04 1094 968 42 91.412 4096 6 0.09 3076 1032 60 67.212 16384 6 0.10 3076 1032 60 67.1
18 64 0 0.02 216 612 0 > 180018 256 4 0.02 714 1054 56 192.318 1024 8 0.07 2005 1566 109 105.618 4096 12 0.15 5702 2254 156 125.618 16384 12 0.16 5702 2254 156 125.9
24 64 0 0.02 216 612 0 > 180024 256 4 0.03 781 1108 66 193.224 1024 8 0.07 1978 1638 117 157.124 4096 11 0.19 5005 2198 153 89.424 16384 12 0.32 5519 2294 163 92.2
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 31 / 40
opensmt
A crazy benchmark suiteFractal Diamonds
Our preprocessor is effective for those formulæ that are difficult to solvewith the initial fixed set of theory atoms
y1 y2
x1
y3
z1 z2 z3
x2 x3 x4
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 32 / 40
opensmt
A crazy benchmark suiteFractal Diamonds
Our preprocessor is effective for those formulæ that are difficult to solvewith the initial fixed set of theory atoms
y1 y2
x1
y3
z1 z2 z3
x2 x3 x4
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 32 / 40
opensmt
A crazy benchmark suiteFractal Diamonds
Our preprocessor is effective for those formulæ that are difficult to solvewith the initial fixed set of theory atoms
y1 y2
x1
y3
z1 z2 z3
x2 x3 x4
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 32 / 40
opensmt
A crazy benchmark suiteFractal Diamonds
Our preprocessor is effective for those formulæ that are difficult to solvewith the initial fixed set of theory atoms
y1 y2
x1
y3
z1 z2 z3
x2 x3 x4
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 32 / 40
opensmt
A crazy benchmark suiteFractal Diamonds
Our preprocessor is effective for those formulæ that are difficult to solvewith the initial fixed set of theory atoms
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 32 / 40
opensmt
A crazy benchmark suiteFractal Diamonds
Our preprocessor is effective for those formulæ that are difficult to solvewith the initial fixed set of theory atoms
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 32 / 40
opensmt
A crazy benchmark suiteFractal Diamonds (Centrality 18, Trade-off 8192)
B = BarceLogic (SMTCOMP’08 1st place for IDL)Z = Z3 (SMTCOMP’08 2nd place for IDL)O = OpenSMT (with DPFM based preprocessor)
Fractal Diamonds - Solving time (s) - TO = 1200 s
1 2 3 4 5
Or. B Z O B Z O B Z O B Z O B Z O
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 33 / 40
opensmt
A crazy benchmark suiteFractal Diamonds (Centrality 18, Trade-off 8192)
B = BarceLogic (SMTCOMP’08 1st place for IDL)Z = Z3 (SMTCOMP’08 2nd place for IDL)O = OpenSMT (with DPFM based preprocessor)
Fractal Diamonds - Solving time (s) - TO = 1200 s
1 2 3 4 5
Or. B Z O B Z O B Z O B Z O B Z O
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 33 / 40
opensmt
A crazy benchmark suiteFractal Diamonds (Centrality 18, Trade-off 8192)
B = BarceLogic (SMTCOMP’08 1st place for IDL)Z = Z3 (SMTCOMP’08 2nd place for IDL)O = OpenSMT (with DPFM based preprocessor)
Fractal Diamonds - Solving time (s) - TO = 1200 s
1 2 3 4 5
Or. B Z O B Z O B Z O B Z O B Z O
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 118 13 1 T T 3 T T 7
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 33 / 40
opensmt
A crazy benchmark suiteFractal Diamonds (Centrality 18, Trade-off 8192)
B = BarceLogic (SMTCOMP’08 1st place for IDL)Z = Z3 (SMTCOMP’08 2nd place for IDL)O = OpenSMT (with DPFM based preprocessor)
Fractal Diamonds - Solving time (s) - TO = 1200 s
1 2 3 4 5
Or. B Z O B Z O B Z O B Z O B Z O
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 118 13 1 T T 3 T T 7
3 0 0 0 0 T 2 T T 153 M T T T T T
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 33 / 40
opensmt
Related Work
• O. Strichman: “Deciding Disjunctive Linear Arithmetic withSAT” [Str04]
• Eager reduction to SAT, using a procedure based on FM
• N. Een, A. Biere: “Effective Preprocessing in SAT Through Variableand Clause Elimination” [EB05]
• SATElite algorithm for SAT preprocessing
• K. McMillan et al.: “Generalizing DPLL to Richer Logics” [MKS09]• “Shadow Rule” similar to our notion of SMT(LRA) resolution: one
application of the shadow rule is equiv. to many applications ofSMT(LRA) resolution
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 34 / 40
opensmt
Related Work
• O. Strichman: “Deciding Disjunctive Linear Arithmetic withSAT” [Str04]
• Eager reduction to SAT, using a procedure based on FM
• N. Een, A. Biere: “Effective Preprocessing in SAT Through Variableand Clause Elimination” [EB05]
• SATElite algorithm for SAT preprocessing
• K. McMillan et al.: “Generalizing DPLL to Richer Logics” [MKS09]• “Shadow Rule” similar to our notion of SMT(LRA) resolution: one
application of the shadow rule is equiv. to many applications ofSMT(LRA) resolution
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 34 / 40
opensmt
Related Work
• O. Strichman: “Deciding Disjunctive Linear Arithmetic withSAT” [Str04]
• Eager reduction to SAT, using a procedure based on FM
• N. Een, A. Biere: “Effective Preprocessing in SAT Through Variableand Clause Elimination” [EB05]
• SATElite algorithm for SAT preprocessing
• K. McMillan et al.: “Generalizing DPLL to Richer Logics” [MKS09]• “Shadow Rule” similar to our notion of SMT(LRA) resolution: one
application of the shadow rule is equiv. to many applications ofSMT(LRA) resolution
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 34 / 40
opensmt
Outline
1 Introduction
2 Architecture
3 A Variable Elimination Techique for SMTDP + FM = DPFMA crazy benchmark suiteRelated Work
4 Extending and Using OpenSMTExtending OpenSMT
5 Conclusion
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 35 / 40
opensmt
Extending OpenSMT
e(DPLL(T)) ≈ e(T)
DPLL
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 36 / 40
opensmt
Extending OpenSMT
e(DPLL(T)) ≈ e(T)
DPLL T
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 36 / 40
opensmt
Extending OpenSMT
• To create an empty template for a new theory solveruse script create tsolver.sh
• Creates a new directory with basic class files
• Creates/Sets up Makefile for compilation
• Adds a new logic
• Integrates the new solver with the core
• Basically, it creates an incomplete solver
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 37 / 40
opensmt
Extending OpenSMT
• To create an empty template for a new theory solveruse script create tsolver.sh
• Creates a new directory with basic class files
• Creates/Sets up Makefile for compilation
• Adds a new logic
• Integrates the new solver with the core
• Basically, it creates an incomplete solver
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 37 / 40
opensmt
Extending OpenSMT
• To create an empty template for a new theory solveruse script create tsolver.sh
• Creates a new directory with basic class files
• Creates/Sets up Makefile for compilation
• Adds a new logic
• Integrates the new solver with the core
• Basically, it creates an incomplete solver
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 37 / 40
opensmt
Extending OpenSMT
• To create an empty template for a new theory solveruse script create tsolver.sh
• Creates a new directory with basic class files
• Creates/Sets up Makefile for compilation
• Adds a new logic
• Integrates the new solver with the core
• Basically, it creates an incomplete solver
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 37 / 40
opensmt
Extending OpenSMT
• To create an empty template for a new theory solveruse script create tsolver.sh
• Creates a new directory with basic class files
• Creates/Sets up Makefile for compilation
• Adds a new logic
• Integrates the new solver with the core
• Basically, it creates an incomplete solver
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 37 / 40
opensmt
Extending OpenSMT
• To create an empty template for a new theory solveruse script create tsolver.sh
• Creates a new directory with basic class files
• Creates/Sets up Makefile for compilation
• Adds a new logic
• Integrates the new solver with the core
• Basically, it creates an incomplete solver
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 37 / 40
opensmt
Extending OpenSMT
class TSolver{
void inform ( Enode * );bool assertLit ( Enode * );bool check ( bool );void pushBktPoint ( );void popBktPoint ( );bool belongsToT ( Enode * );void computeModel ( );
vector< Enode * > & explanation;vector< Enode * > & deductions;vector< Enode * > & suggestions;}
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 38 / 40
opensmt
Other Features
• C API: you can compile a library and call OpenSMT via the C API
• Interpolation: given two mutually unsatisfiable formulæ A and B, aninterpolant [Cra57] is a formula I such that
• A→ I• B ∧ I is unsatisfiable• I is defined on the variables that are common to A and B
• Basically I is an “overapproximation” of A, that is still unsatisfiablewith B
• It has applications in Model Checking [McM04]
• OpenSMT can compute interpolants for propositional formulæ andsome arithmetic fragments
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 39 / 40
opensmt
Other Features
• C API: you can compile a library and call OpenSMT via the C API
• Interpolation: given two mutually unsatisfiable formulæ A and B, aninterpolant [Cra57] is a formula I such that
• A→ I• B ∧ I is unsatisfiable• I is defined on the variables that are common to A and B
• Basically I is an “overapproximation” of A, that is still unsatisfiablewith B
• It has applications in Model Checking [McM04]
• OpenSMT can compute interpolants for propositional formulæ andsome arithmetic fragments
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 39 / 40
opensmt
Other Features
• C API: you can compile a library and call OpenSMT via the C API
• Interpolation: given two mutually unsatisfiable formulæ A and B, aninterpolant [Cra57] is a formula I such that
• A→ I• B ∧ I is unsatisfiable• I is defined on the variables that are common to A and B
• Basically I is an “overapproximation” of A, that is still unsatisfiablewith B
• It has applications in Model Checking [McM04]
• OpenSMT can compute interpolants for propositional formulæ andsome arithmetic fragments
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 39 / 40
opensmt
Other Features
• C API: you can compile a library and call OpenSMT via the C API
• Interpolation: given two mutually unsatisfiable formulæ A and B, aninterpolant [Cra57] is a formula I such that
• A→ I• B ∧ I is unsatisfiable• I is defined on the variables that are common to A and B
• Basically I is an “overapproximation” of A, that is still unsatisfiablewith B
• It has applications in Model Checking [McM04]
• OpenSMT can compute interpolants for propositional formulæ andsome arithmetic fragments
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 39 / 40
opensmt
Other Features
• C API: you can compile a library and call OpenSMT via the C API
• Interpolation: given two mutually unsatisfiable formulæ A and B, aninterpolant [Cra57] is a formula I such that
• A→ I• B ∧ I is unsatisfiable• I is defined on the variables that are common to A and B
• Basically I is an “overapproximation” of A, that is still unsatisfiablewith B
• It has applications in Model Checking [McM04]
• OpenSMT can compute interpolants for propositional formulæ andsome arithmetic fragments
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 39 / 40
opensmt
Conclusion
• OpenSMT websitehttp://www.verify.inf.unisi.ch/opensmt
• Source repositoryhttp://code.google.com/p/opensmt
• Discussion grouphttp://groups.google.com/group/opensmt
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 40 / 40
opensmt
W. Craig.Three uses of the Herbrand-Gentzen theorem in relating model theory and proof theory.J. Symb. Log., pages 269–285, 1957.
B. Dutertre and L. M. de Moura.A Fast Linear-Arithmetic Solver for DPLL(T).In CAV’06, pages 81–94, 2006.
Martin Davis and Hilary Putnam.A Computing Procedure for Quantification Theory.J. ACM, 7(3):201–215, 1960.
N. Een and A. Biere.Effective Preprocessing in SAT Through Variable and Clause Elimination.In SAT, pages 61–75, 2005.
J.B.J. Fourier.Solution d’une question particulire du calcul des angalits.Oevres, II:314–328, 1826.
K. L. McMillan.Applications of Craig Interpolation to Model Checking.In CSL, pages 22–23, 2004.
K. L. McMillan, A. Kuehlmann, and M. Sagiv.Generalizing dpll to richer logics.In CAV, pages 462–476, 2009.
O. Strichman.
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 40 / 40
opensmt
Deciding Disjunctive Linear Arithmetic with SAT.CoRR, 2004.
Roberto Bruttomesso (USI) The OpenSMT Solver September 18, 2010 40 / 40