Resolution (logic)
The resolution is a method of formal logic , a logical formula to test for validity.
The resolution procedure, also called resolution calculus , is a refutation procedure : Instead of directly showing the general validity of a formula, it derives a logical contradiction from its negation.
This derivation takes place by means of an algorithm in a purely formal way and can therefore be carried out by a computer program. Resolution is one of the most well-known machine-aided proofing techniques .
The resolution method in propositional logic
Resolvent (also: resolvent)
Be , clauses of a propositional formula that is in conjunctive normal form. If there is a literal that occurs in positive and negative, the union of both clauses without the positive and negative literal is a resolvent (also: the resolvent) . In particular, this means: If there is no complementary literal, there are also no resolvents.
Only one literal can be resolved at a time. Depending on the initial clauses, the formation of different resolvents is possible.
Notated differently: Off
will be on the resolvent
closed.
The resolvent is not equivalent to the exit clauses. Rather, the significance of the resolvent lies in the fact that the exit clauses can only both be fulfilled at the same time if the resolvent can also be fulfilled ( necessary condition ). If we succeed in resolving the empty clause, which is always unsatisfiable, the unsatisfiability of the entire formula is shown.
proof
Since the resolvent is a necessary condition for the exit clauses and , applies
- .
One says follows from and . From this follows the proof of the correctness of the resolution:
Res operator
The execution of a single resolution step is noted with the res operator:
- , where a resolvent of two clauses is off
With one denotes the union of all possible resolution steps .
Thus the following statements are possible:
- is the empty clause element of , is unsatisfiable and
- is the empty clause element of , is a tautology
Resolution and predicate logic
Problem
Propositional logic is not sufficient for more interesting problems. It should be possible to extend the principle of resolution from simple propositional logic to first-level predicate logic . In addition to logical literals, the following must be taken into account:
- Variables (such as number variables), usuallylabeledwith symbols likeand
- the quantifiers ( the existential quantifier ) and ( the universal quantifier ),
- Constants , for example
- single and multi-valued functions , usually denoted by symbols such as or .
A typical example of a predicate logic statement is:
1) |
(Note: If we set and , the above formula gives us the formal-logical definition of the continuity of the function in the point .)
So that the resolution can be applied to such statements, they must be transformed and the procedure described above expanded.
normalization
The first steps are to bring the statement to be refuted into a form that is similar to the conjunctive normal form of propositional logic.
- The formula to be refuted is brought into prenex form . After this transformation, the quantifiers are all at the beginning of the formula, and the rest of the formula has the form of a conjunctive normal form.
- By using Skolem functions one eliminates all existential quantifiers from the formula and brings them into Skolem form .
- Now all variables in the function are bound to universal quantifiers . If one agrees to denote constants and variables differently, for example constants with and variables with , then the explicit notation of the universal quantifier can be dispensed with. You also leave it out and get the clause form of the statement.
For example, the clause form of formula 1) from the previous section is:
2) |
Substitution and standardization
The formulas
and |
do not seem to be resolvable at first glance, since they differ in and . Since the free variable but implicitly a proxy for all is, must (among other things) for be used.
So you get the two terms
and |
which can obviously be resolved together.
The following replacements are possible:
3a) | Replace variable with constant: | |||
3b) | Replace variable with another variable: | |||
3c) | Replace variable with function of a variable: |
The replacement of variables in a literal must be carried out consistently: If a variable is replaced by a term at one point, this must be done everywhere within the literal:
4a) | Correct replacement: | |||
4b) | Prohibited substitution: |
Be a set of variables. Be a set of terms that can be composed of functions, variables or constants.
- A system of substitutions is called a substitution .
Let literals be over the same predicate , which in turn are terms.
- A substitution is called a unification (or also unifier) of when the arguments of all literals are brought into agreement by using, that is, when .
Two literals over the same predicate do not necessarily have a unification. For example, and cannot be unified if and are different constants.
- A standardization of literals is called the most general standardization if there is a substitution for every other standardization of these literals , so that .
If a set of literals has a unification, then it has a most general unification. This can be determined using a relatively simple algorithm.
Resolution of predicate clauses
With this set of instruments the resolution procedure can be extended to statements of the predicate logic.
- Let be two clauses of a normalized predicate statement. Without loss of generality, it can be assumed that these do not contain any matching variables (since they are bound by a universal quantifier, we can rename variables with the same name in a clause, even if the universal quantifier is no longer explicitly written).
- Be and positive or negated literals occurring in or , which have the most general unification .
Then is called
- a binary resolvent of and .
- Furthermore, let be a clause with a subset of literals that has the most general unification .
Then is called
- a factor of .
Is a resolvent of two clauses
- either a binary resolvent of and .
- or a binary resolvent of and a factor of .
- or a binary resolvent of a factor of and .
- or a binary resolvent of a factor of and a factor of .
The resolution procedure for statements based on predicate logic consists in generating such resolvents until the empty clause is generated and thus the contradiction proof is provided.
example
A logical puzzle
We want to illustrate the principle with the example of a small, not to be taken literally logical puzzle:
It has been known since ancient times that all Athenians are clever (1) and all Spartans are heroic (2). It is also known that there is a profound mistrust between the two cities, so that dual city citizenship is ruled out (3). Our researcher, who was sent to Greece, recently attended a conference. With the exception of our researcher, everyone present came from one of the two cities (4).
The researcher got into conversation with Messrs Diogenes, Plato and Euclid. The only thing they had in common with their famous role models was their name. The gentlemen pulled the leather vigorously over each other. Euclid said: “If Plato is a Spartan, then Diogenes is a coward!” (5) - Plato claimed: “Diogenes is a coward if Euclid is a Spartan!” (6) “If Diogenes is an Athenian, then Euclid is a washcloth! "(7) - Whereupon Diogenes smoothed his beard and postulated:" If Plato is an Athenian, then Euclid is a fool! "(8)
In spite of all their nimbleness, the three gentlemen remained true to their claims. Who is from which city?
The puzzle in clause form
We put p for Plato, d for Diogenes, e for Euclid. We denote the predicates "is Athenian", "is Spartan", "is heroic" and "is clever" with A, S, H and K. We translate the above statements into the clause form and get:
¬A (x) v K (x) | (1) | |
¬S (x) v H (x) | (2) | |
¬A (x) v ¬S (x) | (3) | |
A (x) v S (x) | (4) | |
¬S (p) v ¬H (d) | (5) | |
¬S (e) v ¬H (d) | (6) | |
¬A (d) v ¬H (e) | (7) | |
¬A (p) v ¬K (e) | (8th) |
The resolution
We assume that Plato is an Athenian:
A (p) | {Adoption} | (9) |
Now we apply the principle of resolution and get:
¬K (e) | {from resolution of (9) with (8)} | (10) |
¬A (e) | {from substitution of e for x and resolution (10,1)} | (11) |
S (e) | {Subs. (e: x), res. (11,4)} | (12) |
¬H (d) | {Res. (12.6)} | (13) |
¬S (d) | {Subs. (d: x), res. (13,2)} | (14) |
A (d) | {Subs. (d: x), res. (14,4)} | (15) |
¬H (e) | {Res. (15.7)} | (16) |
¬S (e) | {Subs. (e: x), res. (16,2)} | (17) |
empty clause | {Res. (17.12)} | (18) |
Thus, assumption (9) is contradicted. It is to be rejected together with the clauses (10) to (18) derived from it. Instead we get:
¬A (p) | {since (9) is false} | (19) |
S (p) | {Subs. (p: x), res. (19.4)} | (20) |
Let us now assume that Diogenes is a Spartan and let us continue to apply the principle of resolution:
S (d) | {Adoption} | (21) |
H (d) | {Subs. (d: x), res. (21,2)} | (22) |
¬S (p) | {Res. (22.5)} | (23) |
empty clause | {Res. (23.20)} | (24) |
Assumption (21) is thus refuted and together with the clauses (22) - (24) derived from it must be rejected. Instead we get:
¬S (d) | {since (21) is false} | (25) |
A (d) | {Subs. (d: x), res. (25,4)} | (26) |
Let us assume that Euclid is a Spartan. We obtain:
S (e) | {Adoption} | (27) |
H (e) | {Subs. (e: x), Res. (27, 2)} | (28) |
¬A (d) | {Res. (28, 7)} | (29) |
empty clause | {Res. (29.26)} | (30) |
So (27) is false and all (28) - (30) must be rejected. Instead we get:
¬S (e) | {since (27) is false} | (31) |
A (e) | {Subs. (e: x), Res. (31,4)} | (32) |
Plato is a Spartan (20). Diogenes is an Athenian (26), as is Euclid (32).
Scheduling and Complexity
In the case of propositional logic, the procedure terminates : It provides a result in a finite time as to whether a given statement can be fulfilled. The computation time increases in the general case and with the currently known methods exponentially with the number of literals. The problem is NP-complete .
In the case of predicate logic, the method always terminates with the correct result if it is applied to an unsatisfiable formula. In the case of a formula that can be fulfilled, however, the process never ends. One speaks of semi-decidability . If it were different, then the resolution method would be an algorithm to decide predicate logic formulas in general - which is impossible, since the validity problem in the predicate logic cannot be decided .
Other calculations in logical use
- Tree calculus : in a certain way the closest relative of the calculus of resolution among the calculi
- axiomatic calculi
- Systems of natural reasoning
- Sequence calculus
- Existential graphs
swell
- ^ Davis, Martin: Eliminating the Irrelevant from Mechanical Proofs. in: Journal of Symbolic Logic , ISSN 0022-4812 , Vol. 32, No. 1 (Mar., 1967), pp. 118-119
- ↑ Chang, Chin-Liang; Lee, Richard Char-Tung: Symbolic Logic and Mechanical Theorem Proving , Academic Press, 1973, ISBN 0-12-170350-9 , pp. 77ff
- ↑ Chang, Chin-Liang; Lee, Richard Char-Tung: S ymbolic Logic and Mechanical Theorem Proving , Academic Press, 1973, ISBN 0-12-170350-9 , pp. 80-81
- ↑ Haken, A. "The Intractability of Resolution", Theoretical Computer Science 39 (1985), pp. 297-308.
literature
- Chang, Chin-Liang; Lee, Richard Char-Tung: Symbolic Logic and Mechanical Theorem Proving , Academic Press, 1973, ISBN 0-12-170350-9
Web links
- Lecture script by Habel and Eschenbach , 2009, Department of Computer Science, University of Hamburg, with clear graphic representations (PDF file; 410 kB)
- Lecture notes by Bernhard Beckert , 2006, University of Koblenz-Landau (PDF file; 197 kB)
- Logic for Computer Scientists , by Ulrich Furbach , University of Koblenz-Landau