{{Short description|Existence of values making formula true}} In [[mathematical logic]], a [[Well-formed formula|formula]] is '''satisfiable''' if it is true under some assignment of values to its [[Variable (mathematics)|variables]]. For example, the formula <math>x+3=y</math> is satisfiable because it is true when <math>x=3</math> and <math>y=6</math>, while the formula <math>x+1=x</math> is not satisfiable over the integers. The dual concept to satisfiability is [[Validity (logic)|validity]]; a formula is ''valid'' if every assignment of values to its variables makes the formula true. For example, <math>x+3=3+x</math> is valid over the integers, but <math>x+3=y</math> is not.

Formally, satisfiability is studied with respect to a fixed logic defining the [[Syntax (logic)|syntax]] of allowed symbols, such as [[first-order logic]], [[second-order logic]] or [[propositional calculus|propositional logic]]. Rather than being syntactic, however, satisfiability is a [[semantics|semantic]] property because it relates to the ''meaning'' of the symbols, for example, the meaning of <math>+</math> in a formula such as <math>x+1=x</math>. Formally, we define an [[interpretation (logic)|interpretation]] (or [[model theory|model]]) to be an assignment of values to the variables and an assignment of meaning to all other non-logical symbols, and a formula is said to be satisfiable if there is some interpretation which makes it true.{{sfn|Boolos|Burgess|Jeffrey|2007|loc=p. 120: "A set of sentences [...] is ''satisfiable'' if some interpretation [makes it true]."}} While this allows non-standard interpretations of symbols such as <math>+</math>, one can restrict their meaning by providing additional [[axiom]]s. The [[satisfiability modulo theories]] problem considers satisfiability of a formula with respect to a [[Theory (mathematical logic)|formal theory]], which is a (finite or infinite) set of axioms.

Satisfiability and validity are defined for a single formula, but can be generalized to an arbitrary theory or set of formulas: a theory is satisfiable if at least one interpretation makes every formula in the theory true, and valid if every formula is true in every interpretation. For example, theories of arithmetic such as [[Peano axioms|Peano arithmetic]] are satisfiable because they are true in the natural numbers. This concept is closely related to the [[consistency]] of a theory, and in fact is equivalent to consistency for first-order logic, a result known as [[Gödel's completeness theorem]]. The negation of satisfiability is unsatisfiability, and the negation of validity is invalidity. These four concepts are related to each other in a manner exactly analogous to [[Aristotle]]'s [[square of opposition]].

The [[Decision problem|problem]] of determining whether a formula in [[propositional logic]] is satisfiable is [[decidable problem|decidable]], and is known as the [[Boolean satisfiability problem]], or SAT. In general, the problem of determining whether a sentence of [[first-order logic]] is satisfiable is not decidable. In [[universal algebra]], [[equational theory]], and [[automated theorem proving]], the methods of [[term rewriting]], [[congruence closure]] and [[unification (computer science)|unification]] are used to attempt to decide satisfiability. Whether a particular [[theory (logic)|theory]] is decidable or not depends whether the theory is [[variable-free]] and on other conditions.<ref>{{cite book|author1=Franz Baader|author-link=Franz Baader|author2=Tobias Nipkow|author2-link=Tobias Nipkow|title=Term Rewriting and All That|year=1998|publisher=Cambridge University Press|isbn=0-521-77920-0|pages=58–92|url=https://books.google.com/books?id=N7BvXVUCQk8C&q=satisfiability+OR+satisfiable}}</ref>

==Reduction of validity to satisfiability==

For [[classical logic]]s with negation, it is generally possible to re-express the question of the validity of a formula to one involving satisfiability, because of the relationships between the concepts expressed in the above square of opposition. In particular φ is valid if and only if ¬φ is unsatisfiable, which is to say it is false that ¬φ is satisfiable. Put another way, φ is satisfiable if and only if ¬φ is invalid.

For logics without negation, such as the [[List of logic systems#Positive propositional calculus|positive propositional calculus]], the questions of validity and satisfiability may be unrelated. In the case of the [[List of logic systems#Positive propositional calculus|positive propositional calculus]], the satisfiability problem is trivial, as every formula is satisfiable, while the validity problem is [[Co-NP-complete|co-NP complete]].

==Propositional satisfiability for classical logic== {{main|Propositional satisfiability}} In the case of [[classical propositional logic]], satisfiability is decidable for propositional formulae. In particular, satisfiability is an [[NP-complete]] problem, and is one of the most intensively studied problems in [[computational complexity theory]].

==Satisfiability in first-order logic== For [[first-order logic]] (FOL), satisfiability is [[undecidable problem|undecidable]]. More specifically, it is a [[RE_(complexity)#co-RE-complete|co-RE-complete]] problem and therefore not [[semidecidable]].<ref>{{Cite web |url= https://www.inf.tu-dresden.de/content/institutes/thi/algi/lehre/SS12/AL12/skript/script120413.pdf |title= Chapter 1.3 Undecidability of FOL |accessdate= 21 July 2012 <!-- at 13:25 --> |author= Baier, Christel |author-link= Christel Baier |year= 2012 |work= Lecture Notes&nbsp;— Advanced Logics |publisher= Technische Universität Dresden&nbsp;— Institute for Technical Computer Science |pages= 28–32 |archive-date= 14 October 2020 |archive-url= https://web.archive.org/web/20201014044350/http://www.inf.tu-dresden.de/index.php?node_id=404 |url-status= dead }}</ref> This fact has to do with the undecidability of the validity problem for FOL. The question of the status of the validity problem was posed firstly by [[David Hilbert]], as the so-called [[Entscheidungsproblem]]. The universal validity of a formula is a semi-decidable problem by [[Gödel's completeness theorem]]. If satisfiability were also a semi-decidable problem, then the problem of the existence of counter-models would be too (a formula has counter-models iff its negation is satisfiable). So the problem of logical validity would be decidable, which contradicts the [[Entscheidungsproblem#Negative answer|Church–Turing theorem]], a result stating the negative answer for the Entscheidungsproblem.

==Satisfiability in model theory== In [[model theory]], an [[atomic formula]] is satisfiable if there is a collection of elements of a [[structure (logic)|structure]] that render the formula true.<ref>{{cite book|author1=Wilifrid Hodges|title=A Shorter Model Theory|year=1997|publisher=Cambridge University Press|isbn=0-521-58713-1|pages=12}}</ref> If ''A'' is a structure, φ is a formula, and ''a'' is a collection of elements, taken from the structure, that satisfy φ, then it is commonly written that

:''A'' ⊧ φ [a]

If φ has no free variables, that is, if φ is an [[atomic sentence]], and it is satisfied by ''A'', then one writes

:''A'' ⊧ φ

In this case, one may also say that ''A'' is a model for φ, or that φ is ''true'' in ''A''. If ''T'' is a collection of atomic sentences (a theory) satisfied by ''A'', one writes

:''A'' ⊧ ''T''

==Finite satisfiability==

A problem related to satisfiability is that of '''finite satisfiability''', which is the question of determining whether a formula admits a ''finite'' model that makes it true. For a logic that has the [[finite model property]], the problems of satisfiability and finite satisfiability coincide, as a formula of that logic has a model if and only if it has a finite model. This question is important in the mathematical field of [[finite model theory]].

Finite satisfiability and satisfiability need not coincide in general. For instance, consider the [[first-order logic]] formula obtained as the [[logical conjunction|conjunction]] of the following sentences, where <math>a_0</math> and <math>a_1</math> are [[logical constant|constants]]:

* <math>R(a_0, a_1)</math> * <math>\forall x y (R(x, y) \rightarrow \exists z R(y, z))</math> * <math>\forall x y z (R(y, x) \wedge R(z, x) \rightarrow y = z))</math> * <math>\forall x \neg R(x, a_0)</math>

The resulting formula has the infinite model <math>R(a_0, a_1), R(a_1, a_2), \ldots</math>, but it can be shown that it has no finite model (starting at the fact <math>R(a_0, a_1)</math> and following the chain of <math>R</math> [[atomic formula|atoms]] that must exist by the second axiom, the finiteness of a model would require the existence of a loop, which would violate the third and fourth axioms, whether it loops back on <math>a_0</math> or on a different element).

The [[Computational complexity theory|computational complexity]] of deciding satisfiability for an input formula in a given logic may differ from that of deciding finite satisfiability; in fact, for some logics, only one of them is [[decidability (logic)|decidable]].

For classical [[first-order logic]], finite satisfiability is [[computably enumerable|recursively enumerable]] (in class [[RE (complexity)|RE]]) and [[undecidable problem|undecidable]] by [[Trakhtenbrot's theorem]] applied to the negation of the formula.

== Numerical constraints == {{further|Satisfiability modulo theories|Constraint satisfaction problem}} {{clarify span|Numerical constraints|reason=Elaborate on the admitted forms of constraints; in particular, give definitions of all kinds of contraints used in the following tables.|date=July 2021}} often appear in the field of [[mathematical optimization]], where one usually wants to maximize (or minimize) an objective function subject to some constraints. However, leaving aside the objective function, the basic issue of simply deciding whether the constraints are satisfiable can be challenging or undecidable in some settings. The following table summarizes the main cases.

{| class="wikitable" |- ! Constraints over: !! reals !! integers |- | Linear || [[PTIME]] (see [[linear programming]]) || [[NP-complete]] (see [[integer programming]]) |- | Polynomial || [[decision problem|decidable]] through e.g. [[Cylindrical algebraic decomposition]] || undecidable ([[Hilbert's tenth problem]]) |}

''Table source: Bockmayr and Weispfenning''.<ref name="BockmayrWeispfenning2001">{{cite book|editor1=John Alan Robinson |editor2=Andrei Voronkov |title=Handbook of Automated Reasoning Volume I|year=2001|publisher=Elsevier and MIT Press|id= (Elsevier) (MIT Press)|author1=Alexander Bockmayr |author2=Volker Weispfenning |chapter=Solving Numerical Constraints|isbn=0-444-82949-0 }}</ref>{{rp|754}}

For linear constraints, a fuller picture is provided by the following table.

{| class="wikitable" |- ! Constraints over: !! rationals !! integers !! natural numbers |- | [[System of linear equations|Linear equations]] || PTIME || PTIME || NP-complete |- | [[Linear inequality#Systems of linear inequalities|Linear inequalities]] || PTIME || NP-complete || NP-complete |}

''Table source: Bockmayr and Weispfenning''.<ref name="BockmayrWeispfenning2001" />{{rp|755}}

==See also== *[[2-satisfiability]] *[[Boolean satisfiability problem]] *[[Circuit satisfiability]] *[[Karp's 21 NP-complete problems]] *[[Validity (logic)|Validity]] *[[Constraint satisfaction]]

==Notes== {{Reflist}}

==References== *{{cite book |last1=Boolos |first1=George |last2=Burgess |first2=John |last3=Jeffrey |first3=Richard |title=Computability and Logic |date=2007 |publisher=Cambridge University Press |edition=5th}}

==Further reading== * {{cite book|author1=Daniel Kroening|author-link=Daniel Kroening|author2=[[Ofer Strichman]]|title=Decision Procedures: An Algorithmic Point of View|year=2008|publisher=Springer Science & Business Media|isbn=978-3-540-74104-6}} * {{cite book|editor1=A. Biere |editor2=M. Heule |editor3=H. van Maaren |editor4=T. Walsh |title=Handbook of Satisfiability|year=2009|publisher=IOS Press|isbn=978-1-60750-376-7}}

{{Mathematical logic}} {{Metalogic}}

[[Category:Concepts in logic]] [[Category:Logical truth]] [[Category:Model theory]] [[Category:Philosophy of logic]]