Eliminator. Prenex translator - although the prenex normal form representation is the first step for performing the quantifier elimination method in most theoretic.
THEOREM PROVERS BASED ON THE QUANTIFIER ELIMINATION METHOD ˇ Filip Mari´c, Miroslav Mari´c, Zarko Mijajlovi´c, Aleksandar Jovanovi´c, GIS (Group for Intelligent Systems), Faculty of Mathematics, University of Belgrade
Abstract Here we describe quantifier elimination based theorem provers that were developed in GIS - Group for Inteligent Systems on the Faculty of Mathematics, University of Belgrade; Specially, we present CRACKEN - theorem prover for monadic logic, with potential applications.
1
INTRODUCTION
One of the most important tasks that have to be solved during the construction of a theorem prover for the first order logic theory T is decidability analysis, i.e. constructing the algorithm that determines, for an arbitrary sentence of theory T , if it is a theorem. Although, during the long period of time, mathematicians considered decidable theories uninteresting and trivial, during the 70-es it was shown (Fisher, Meyer, Rabin) that many decidable theories in fact are not practically decidable. E.g. it was shown that in additive (Presburger) arithmetic, for each algorithm A and for every natural number n, exists a senn tence ϕ of length n for which 22 steps of A have to be applied until it is determined if ϕ is a theorem. Some of the most used techniques for proving the decidability of the first order logic theories are: • Model theory method • Quantifier elimination method
T ⊢ ϕ ⇔ ψ(λ1 , λ2 , . . . , λn ) The name quantifier elimination, which is due to Tarski, is used because formula ψ does not contain quantifiers. In order to find a boolean formula ψ, for an arbitrary formula ϕ of theory T , it suffices to show that each formula which is
• Interpretation method
1. either atomic
• Tableau method
2. or has the form (∃vm )θ, where θ is a Boolean combination of basic formulas
• Automation method During the last few years, the Group for Intelligent Systems, on the Faculty of Mathematics, University of Belgrade, based its researches on the Quantifier elimination method. 2
theories that arise in mathematics (e.g., number theory, set theory, groups, fields, partial order, . . . ) are not decidable, and this method does not work for them. Although the method can be applied only to very special theories, it is extremely valuable when it can be carried out, because it gives a tremendous amount of information about a theory. It directly leads to the decision procedure for the theory. It can also be used for some other purposes, such as proving the completeness of a theory, because it describes all its complete extensions. The basic step that has to be taken when one tries to apply the quantifier elimination method to the theory T is to show that each formula of T can be transcribed to a T -equivalent Boolean combination of formulas that are in some fixed set of so called basic formulas. In other words, if Λ is a set of basic formulas, for each formula ϕ there exists a Boolean formula ψ(p1 , p2 , . . . , pn ) and λ1 , λ2 , . . . , λn ∈ Λ, so that:
QUANTIFIER ELIMINATION
Quantifier elimination method was used for the first time around 1930. There are several very important theories which have been analyzed using the elimination of quantifiers. For example additive number theory (Presburger, 1929), the theory of Abelian groups (Szmielew, 1955), the theory of Boolean algebras (Tarski, 1949), the theory of all well-ordered models (Mostowski and Tarski, 1949), and the theories of real closed fields, and algebraically closed fields (Tarski, 1948.). On the other hand, many important
can be represented as a Boolean combination of basic formulas. The former might be achieved using Prenex normal form representation of a formula, and an inductive process of ”taking off one by one quantifier starting from the innermost”. Further on, it is very useful to represent the matrix of a formula in Disjunctive normal form and to use the following valid formulas when needed. ∃x(ϕ(x) ∨ ψ(x))
⇔
∃xϕ(x) ∨ ∃xψ(x)
∃x(ϕ(x) ∧ ψ) ⇔ ∃xϕ(x) ∧ ψ ∀xϕ(x) ⇔ ¬∃x¬ϕ(x)
(1) (2) (3)
where formula ψ in (2) does not contain a free occurrence of x. Here is what a general quantifier elimination scheme would look like:
Algorithm : Quantifier elimination In : Formula ϕ Out: A boolean combination of basic formulas that is equivalent to ϕ Convert ϕ to Prenex normal form (Q1 )(Q2 )...(Qn )θ i := n while i > 0 If Qi is universal quantifier, convert it to existential Convert the matrix of formula to DNF Let the existential quantifier Qi ”pass trough” the disjunctions Using the specific algorithm for the theory, eliminate Qi from each conjuction i := i − 1 end Figure 1: Quantifier elimination algorithm scheme
2.1
PURE IDENTITY LANGUAGE
In this chapter, we will try to show the application of this method on the example of the pure identity language J, i.e. the language with no constants, functions or predicates. The set of axioms will consist just of the first order logic axioms and the identity axioms. The first very important question that has to be answered is what to take for Λ i.e. the set of basic formulas. The set of atomic formulas is not enough, because, for example, the formula (∀v0 , v1 )(v0 = v1 ) can not be represented as a Boolean combination of atomic formulas. We shall show that it is satisfactory to construct Λ to contain all the atomic formulas (the formulas that are of the form vm = vn and vm 6= vn ), and all the sentences of the form ^ σn = (∃v0 , v2 , . . . , vn−1 ) vi 6= vj i 0. In the case that ψi is inconsistent, (4) is equivalent to ¬σ0 . In the other case we have to eliminate the quantifier from the formula of the form: ^ ^ vi 6= vj ) (5) vi = v j ∧ (∃vn )( (i,j)∈I2
(i,j)∈I1
We can write (5) in the form: ^ ^ (∃vn )( vn = v i ∧ vn 6= vi ) ∧ ψi∗ (v0 , . . . , vn−1 ) i∈I ′
i∈I ′′
where ψi∗ (v0 , . . . , vn−1 ) is a conjunction of atoms over the variables {v0 , . . . , vn−1 }. The following cases arise: 1. If I ′ contains an index k < n (5) is equivalent to: ^ ^ vk = v i ∧ vk 6= vi ∧ ψi∗ i∈I ′
i∈I ′′
2. If (5) is of the form
(∃vm )θ(v0 , v1 , . . . , vn ) where θ is a Boolean combination of basic formulas, can be represented as a Boolean combination of basic formulas. Using the DNF theorem, we can convert θ to a form: θ = (ψ0 ∧ θ0 ) ∨ . . . ∨ (ψp ∧ θp ) where ψi is an open formula, and θi is a Boolean combination of sentences σ0 , σ1 , . . .. Using the valid formulas
(4)
(∃vn )(
^
vn 6= vi ) ∧ ψi∗
(6)
i∈I ′′
we have a little bit harder task. Let ∆j denote all the partitions of the set {v0 . . . vn−1 }. For every partition ∆j we can form a formula δj that describes it. E.g. if ∆j = {v0 , v1 }{v2 }, formula δj is v0 = v1 ∧ v0 6= v2 ∧ v1 6= v2 . Now, let J be a set of all those indices j, so that J ⊢ ψi∗ ⇒ δj . It can be
W shown that ψi∗ = j∈J δj . Using that, the formula (5) is equivalent to: ^ _ ((∃vn )( vn 6= vi ) ∧ δj (v0 , . . . , vn−1 ))
3.1
SILOGISMS
The classic example of monadic calculus are the Aristotels silogisms. E.g. silogism Bocardo:
i∈I ′′
j∈J
Let u1 , . . . , usj be representatives of the elements of the partition ∆j . Let δj′ be an equivalent reduced form of the formula δj that contains all the equality atoms as δj and contains just the inequality atoms that involve the class representatives. Then (5) is equivalent to _ ^ ((∃vn )( vn 6= ui ) ∧ δj′ )
Some M are not P Every M is S Some S are not P can be expressed with the following monadic calculus sentence: ((∃x(M (x) ∧ ¬P (x))) ∧ (∀x(M (x) ⇒ S(x)))) ⇒
i