<p>It's actually surprisingly hard to relate SMT to type-theoretic/categorical approaches to logic -- the results in this area are very recent! This is because categorical logic is primarily conceived of as a semantics of <em>proofs</em>, and SMT arises from the model-theoretic view of logic, which is a semantics of <em>provability</em>. </p>

<p>A formula in SMT is a boolean combination of primitive assertions over some theory. For example, for linear arithmetic you might have the following terms and primitive formulas.</p>

<p>$$
\newcommand{\bnfalt}{\;\;|\;\;}
\array{
\mbox{Terms} &amp; t &amp; ::= &amp; x \bnfalt n \bnfalt t + t \bnfalt -t \\
\mbox{Primitive Formulas} &amp; p &amp; ::= &amp; t \leq t \bnfalt t = t \bnfalt t &lt; t \\
\mbox{SMT Formulas} &amp; \phi &amp; ::= &amp; p \bnfalt \top \bnfalt \phi \land \phi' \bnfalt \lnot \phi \\
}$$</p>

<p>Given a formula $\phi$, an SMT solver will either give you a <em>satisfying assignment</em> for the variables -- i.e., it will give you a number for each variable, such that substituting that number for each variable gives you a true boolean formula -- or it will tell you that the formula $\phi$ is unsatisfiable.</p>

<p>The fact that this is all happening in classical logic is quite important; the architecture of SMT solvers relies upon this fact. Basically, SMT solvers are built as a combination of an DPLL-based SAT solver, which communicates with a <em>theory solver</em>, which deduces equalities from pure conjunctions of theory formulas. There are also various conditions under which you can combine solvers for different theories, which is important because it gives researchers a good "API" for figuring out if particular theories will fit together nicely. </p>

<p>A good reference to the standard view of SMT is Clark Barrett and Cesare Tinelli's handbook chapter on <a href="http://homepage.divms.uiowa.edu/~tinelli/papers/BarTin-14.pdf" rel="noreferrer"><em>Satisfiability Modulo Theories</em></a>.  </p>

<p>Work on how to interpret SMT in terms of proof theory is much newer. The basic idea is to relate DPLL(T) with "focused" or "polarized" calculi for proof search. Focused calculi are variants of the sequent calculus originally designed to optimize proof search, but which turned out to work because they expose fundamental ideas in proof theory. </p>

<p>Two good references to this are 
Mahfuza Farooque's PhD thesis, <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.428.4994&amp;rep=rep1&amp;type=pdf" rel="noreferrer"><em>Automated reasoning techniques
as proof-search in sequent calculus</em></a>, in which she relates the actions of a DPLL(T) algorithm to search in a particular focused calculus, and Stéphane Graham-Lengrand's habilitation thesis <a href="https://tel.archives-ouvertes.fr/tel-01094980/file/Main.pdf" rel="noreferrer"><em>Polarities &amp; Focussing: a journey from Realisability to Automated Reasoning</em></a>, in which he gives a broader perspective on this work (eg, by connecting it to work on biorthogonality). </p>

CC BY-SA 4.0
2018-05-04T13:22:11.503Z
SMT doesn't really have anything to do with DPLL as such, you could do SMT solving with other approaches to SAT solving. The key idea is simply how the SAT and theory solvers interact. In practise most high-performance SAT solvers are descending from DPLL, albeit just how much DPLL is still in modern CDCL solvers is debatable.
Martin Berger
CC BY-SA 4.0
2018-05-04T10:50:17.647Z
2018-05-04T10:50:17.647Z
Neel Krishnaswami
<p>Apologies if this is not a well-thought-out question, but I am interested in formalizing a problem which is ultimately described by a SMT formula in the theory of quantified arrays and linear arithmetic, and I realized that, while I understand what SMT formulas are useful for in a practical sense, I do not have a good sense for how to fit what I know about foundations of logic/computing/type theory/category theory with the idea of SMT theories and formulas.  What can be said formally about the general theory about statements which can in some way be turned into SAT instances?</p>

<p>Edit: I understand that SAT solvers work with propositional logic and SMT solvers work with fragments of first-order logic, but how exactly do we understand what a "fragment of logic" is and how it chops up the whole universe of first-order logic?  Obviously we have different predicates and functions for linear arithmetic vs the theory of data types, but how at a formal level can we come up with a mathematical universe in which certain statements can be combined and others can't?</p>

CC BY-SA 4.0
2018-05-03T21:13:07.980Z
It's somewhat unclear what you are asking. SAT typically referes to propositional satisfiability. SMT heavily depends on the theories one considers. E.g. do you need quantifiers? If so, how many alternations? Typically a particular theory represents a fragment of first order logic (this fragment may or may not be decidable).
Mikolas
CC BY-SA 4.0
2018-05-03T22:25:51.657Z
Edited for clarity - does this make more sense?
lightning
CC BY-SA 4.0
2018-05-04T05:05:26.193Z
A FOL theory is simply a set of FOL axioms. Combining theories means taking the union of the axioms. The difficult part is how to combine the accompanying decision procedures, which are specialized for particular theories. For that, see either the original Nelson--Oppen, or something newer like DPLL(T). The basic idea is to start with a SAT solver, and hang other decision procedures on it, while communicating only formulas of a certain shape (equalities).
Radu GRIGore
<sat><formal-methods>
Ways to think formally about Satisfiability Modulo Theories
lightning
# Ways to think formally about Satisfiability Modulo Theories

(Asked by: username_0 on 2018-05-03)

Apologies if this is not a well-thought-out question, but I am interested in formalizing a problem which is ultimately described by a SMT formula in the theory of quantified arrays and linear arithmetic, and I realized that, while I understand what SMT formulas are useful for in a practical sense, I do not have a good sense for how to fit what I know about foundations of logic/computing/type theory/category theory with the idea of SMT theories and formulas. What can be said formally about the general theory about statements which can in some way be turned into SAT instances?

Edit: I understand that SAT solvers work with propositional logic and SMT solvers work with fragments of first-order logic, but how exactly do we understand what a "fragment of logic" is and how it chops up the whole universe of first-order logic? Obviously we have different predicates and functions for linear arithmetic vs the theory of data types, but how at a formal level can we come up with a mathematical universe in which certain statements can be combined and others can't?

**Tags:** sat, formal-methods
> **Comments:**
> **username_1**: It's somewhat unclear what you are asking. SAT typically referes to propositional satisfiability. SMT heavily depends on the theories one considers. E.g. do you need quantifiers? If so, how many alternations? Typically a particular theory represents a fragment of first order logic (this fragment may or may not be decidable).  
> **username_0**: Edited for clarity - does this make more sense?  
> **username_2**: A FOL theory is simply a set of FOL axioms. Combining theories means taking the union of the axioms. The difficult part is how to combine the accompanying decision procedures, which are specialized for particular theories. For that, see either the original Nelson--Oppen, or something newer like DPLL(T). The basic idea is to start with a SAT solver, and hang other decision procedures on it, while communicating only formulas of a certain shape (equalities).  

---

## 1 answers

### Answer by username_3 on 2018-05-04. Score: 8

It's actually surprisingly hard to relate SMT to type-theoretic/categorical approaches to logic -- the results in this area are very recent! This is because categorical logic is primarily conceived of as a semantics of *proofs*, and SMT arises from the model-theoretic view of logic, which is a semantics of *provability*.

A formula in SMT is a boolean combination of primitive assertions over some theory. For example, for linear arithmetic you might have the following terms and primitive formulas.

$$
\newcommand{\bnfalt}{\;\;|\;\;}
\array{
\mbox{Terms} & t & ::= & x \bnfalt n \bnfalt t + t \bnfalt -t \\
\mbox{Primitive Formulas} & p & ::= & t \leq t \bnfalt t = t \bnfalt t < t \\
\mbox{SMT Formulas} & \phi & ::= & p \bnfalt \top \bnfalt \phi \land \phi' \bnfalt \lnot \phi \\
}$$

Given a formula $\phi$, an SMT solver will either give you a *satisfying assignment* for the variables -- i.e., it will give you a number for each variable, such that substituting that number for each variable gives you a true boolean formula -- or it will tell you that the formula $\phi$ is unsatisfiable.

The fact that this is all happening in classical logic is quite important; the architecture of SMT solvers relies upon this fact. Basically, SMT solvers are built as a combination of an DPLL-based SAT solver, which communicates with a *theory solver*, which deduces equalities from pure conjunctions of theory formulas. There are also various conditions under which you can combine solvers for different theories, which is important because it gives researchers a good "API" for figuring out if particular theories will fit together nicely.

A good reference to the standard view of SMT is Clark Barrett and Cesare Tinelli's handbook chapter on [*Satisfiability Modulo Theories*](http://homepage.divms.uiowa.edu/~tinelli/papers/BarTin-14.pdf).

Work on how to interpret SMT in terms of proof theory is much newer. The basic idea is to relate DPLL(T) with "focused" or "polarized" calculi for proof search. Focused calculi are variants of the sequent calculus originally designed to optimize proof search, but which turned out to work because they expose fundamental ideas in proof theory.

Two good references to this are
Mahfuza Farooque's PhD thesis, [*Automated reasoning techniques
as proof-search in sequent calculus*](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.428.4994&rep=rep1&type=pdf), in which she relates the actions of a DPLL(T) algorithm to search in a particular focused calculus, and Stéphane Graham-Lengrand's habilitation thesis [*Polarities & Focussing: a journey from Realisability to Automated Reasoning*](https://tel.archives-ouvertes.fr/tel-01094980/file/Main.pdf), in which he gives a broader perspective on this work (eg, by connecting it to work on biorthogonality).

> **Comments:**
> **username_4**: SMT doesn't really have anything to do with DPLL as such, you could do SMT solving with other approaches to SAT solving. The key idea is simply how the SAT and theory solvers interact. In practise most high-performance SAT solvers are descending from DPLL, albeit just how much DPLL is still in modern CDCL solvers is debatable.  

---

