This section considers the problem of optimization of schemes of computation trees and studies how their decidability depends on the decidability of the problems of solvability and satisfiability. It is proven that, for any strictly limited complexity measure, the problem of optimization is undecidable if the problem of satisfiability is undecidable. It is also proven that the problem of optimization is decidable if the problem of solvability is decidable and the considered strictly limited complexity measure satisfies some additional condition. Note that the problem of solvability and its corresponding problem of satisfiability are either both decidable or both undecidable.
7.1. Equality Is Not Allowed
First, we consider the case when the equality is not allowed.
Let be a finite or countable signature. If is finite, then we represent it in the form , where are predicate and function symbols, each with its own arity. If is infinite, then we represent it in the form . We denote by the set of finite words in the alphabet , including the empty word .
Definition 17. A complexity measure over the signature σ is an arbitrary map . The complexity measure ψ will be called strictly limited if it is computable and, for any , it possesses the following property: if , then .
We now consider some examples of complexity measures. Let . The function is called a weight function for the signature . We extend the function to the set in the following way: if and if . This function is called a weighted depth. If for any , then the function is called the depth and is denoted by h. The depth and any computable weighted depth are strictly limited complexity measures.
Let be a complexity measure over the signature . We extend it to the sets and . Let be a finite sequence of function and predicate expressions of the signature that do not contain the equality. We correspond to a word from . If the length of is equal to 0, then . If , then , where, for , is the symbol of the signature from the expression .
Let be a scheme of problem from the set . Then, .
Let be a scheme of computation tree from the set and be a complete path of the scheme S. We denote as the sequence of function and predicate expressions attached to nodes . Then, , where is the set of complete paths of the scheme S. The value will be called the -complexity of the scheme of computation tree S. We denote by the depth of the scheme of computation tree S. By , we denote the set of symbols of the signature used in the function and predicate expressions in the scheme S.
Lemma 1. Let ψ be a strictly limited complexity measure over the signature σ and S be a scheme of computation tree from the set . Then, the following statements hold:
(a) .
(b) .
Proof. Let . Then, it is easy to show that , where is the length of the word , and for any letter in the word . Using these relations, one can show that the statements of the lemma hold. □
Let us recall that is the set of sentences of the signature that do not contain equality. Let be a strictly limited complexity measure over the signature , C be a nonempty class of structures of the signature , and H be a nonempty subset of the set .
Definition 18. We now define the problem of optimization for the triple : for arbitrary sentence and scheme of problem , we should find a scheme of computation tree which solves the scheme of problem s relative to the class and has the minimum ψ-complexity. We will call such a scheme of computation tree optimal relative to ψ, s, and .
Lemma 2. The ψ-complexity of a scheme of computation tree that is optimal relative to ψ, s, and is at most .
Proof. Let . It is easy to construct a scheme of computation tree , which solves the scheme of problem s relative to the class and for which, for any complete path of S, the sequence of predicate and function expressions attached to the nodes of coincides with . Therefore, . Thus, the -complexity of a scheme of computation tree that is optimal relative to , s, and is at most . □
Let and be schemes of computation trees from the set . We will say that these schemes are equivalent if, for any structure U of the signature , the functions implemented by the computation trees and coincide.
Lemma 3. Any scheme of computation tree can be transformed by changing the variables into a scheme of computation tree , which is equivalent to and in which all variables in the function and predicate expressions belong to the set .
Proof. One can show that the number of function nodes in the scheme
is at most
. Each function node
v of the scheme
is labeled with a function expression
where
is the arity of the function symbol
. Let
be all function nodes of the scheme
for which variables
do not belong to the set
. Let
be all pairwise different variables in the sequence
. Denote
.
In all expressions attached to function and predicate nodes of the scheme , we replace each variable that does not belong to the set with the variable and replace variables with variables , respectively. Denote by the obtained scheme of computation tree. One can show that the scheme is equivalent to the scheme , and all variables in the function and predicate expressions of the scheme belong to the set . □
Let be a strictly limited complexity measure over the signature . For , we denote . Define a partial function as follows. Let . If is a finite set, then . If is an infinite set, then the value is indefinite.
For us, the most interesting situation is when the function is a total recursive function. If is a finite signature, then, evidently, is a total recursive function.
We now consider a class of strictly limited complexity measures over the infinite signature for which is a total recursive function. Let , be a nondecreasing unbounded total recursive function, and be a weighted depth over signature for which for any . Then, is a strictly limited complexity measure over the signature for which is a total recursive function.
Theorem 5. Let ψ be a strictly limited complexity measure over the signature σ for which is a total recursive function, C be a nonempty class of structures of the signature σ, H be a nonempty subset of the set , and the problem of solvability for the quadruple be decidable. Then, the problem of optimization for the triple is decidable.
Proof. Taking into account that the function is a total recursive function, it is not difficult to show that there exists an algorithm constructing the set for any number . From this fact, it follows that there exists an algorithm which, for an arbitrary number , an arbitrary number , and an arbitrary finite nonempty subset M of the set , constructs the set of schemes of computation trees from satisfying the following conditions:
The terminal nodes of S are labeled with numbers from M.
.
.
All variables in the function and predicate expressions in the scheme S belong to the set .
Let be a scheme of problem from , and let be the set of values of the map . Denote . We now shall see that the set contains a scheme of computation tree that is optimal relative to , s, and .
Using Lemma 3, one can show that there exists a scheme of computation tree which is optimal relative to , s, and , in which numbers attached to terminal nodes belong to the set , and in which all variables in function and predicate expressions in the scheme S belong to the set . Using Lemma 2, we obtain that . From this inequality and Lemma 1, it follows that and . Therefore, the scheme S, which is optimal relative to , s, and , belongs to the set .
We now describe an algorithm solving the problem of optimization for the triple . Let and be a scheme of problem from the set . First, we compute the value and construct the set . Next, we construct the set . Using the algorithm solving the problem of solvability for the quadruple , we can find a scheme of computation tree , which solves the scheme of problem s relative to the class and has the minimum -complexity among such schemes of computation trees. The scheme of computation tree S is optimal relative to , s, and . □
Corollary 1. Let σ be a finite signature, ψ be a strictly limited complexity measure over the signature σ, C be a nonempty class of structures of the signature σ, H be a nonempty subset of the set , and the problem of solvability for the quadruple be decidable. Then, the problem of optimization for the triple is decidable.
Theorem 6. Let C be a nonempty class of structures of the signature σ, H be a nonempty subset of the set , ψ be a strictly limited complexity measure over the signature σ, and the problem of satisfiability for the pair be undecidable. Then, the problem of optimization for the triple is undecidable.
Proof. Let us assume the contrary: the problem of optimization for the triple is decidable. We now describe an algorithm for solving the problem of satisfiability for the pair .
Let and . We construct a sentence of the signature that is logically equivalent to the sentence and is of the form , where, for and , and define an atomic formula of the signature of the form , where is a p-ary predicate symbol from , and are terms of the signature with variables from .
For
, we construct a scheme of problem
from
with special representation
such that
and, for any
,
if and only if
. It is clear that, for any structure
U of the signature
and any tuple
, where
A is the universe of
U,
We denote by the scheme of computation tree from , which consists of only one node labeled with the number 0. It is clear that, for any structure U of the signature and any tuple , where A is the universe of U, .
Using an algorithm that solves the problem of optimization for the triple , for , we find a scheme of computation tree which solves the scheme of problem relative to the class and has the minimum -complexity.
Using the properties of the strictly limited complexity measure , it is not difficult to show that a structure C such that exists if and only if there exists for which the scheme of computation tree does not coincide with the scheme of computation tree . Therefore, the problem of satisfiability for the pair is decidable, but this is impossible. □
7.2. Equality Is Allowed
We now consider the case when the equality is allowed.
Let be a finite or countable signature. If is finite, then we represent it in the form . If is infinite, then we represent it in the form . Let , where is the symbol denoting equality =, and is the set of finite words in the alphabet , including the empty word .
Definition 19. An e-complexity measure over the signature σ is an arbitrary map . The e-complexity measure ψ will be called strictly limited if it is computable and, for any , it possesses the following property: if , then .
The prefix “e-” here and later indicates the presence of the equality.
Let be an e-complexity measure over the signature . We extend it to the sets and . Let be a finite sequence of the function and predicate expressions of the signature . We correspond to a word from . If the length of is equal to 0, then . If , then , where, for , is the symbol from contained in the expression . In particular, if has the form , then .
Let be a scheme of problem from the set . Then, .
Let be a scheme of computation tree from the set and be a complete path of the scheme S. We denote as the sequence of function and predicate expressions attached to nodes . Then, , where is the set of complete paths of the scheme S. The value is called the -complexity of the scheme of computation tree S.
Let us recall that is the set of sentences of the signature . Let be a strictly limited e-complexity measure over the signature , C be a nonempty class of structures of the signature , and H be a nonempty subset of the set .
Definition 20. We now define the problem of e-optimization for the triple : for arbitrary sentence and scheme of problem , we should find a scheme of computation tree which solves the scheme of problem s relative to the class and has the minimum ψ-complexity.
Let be a strictly limited e-complexity measure over the signature . For , we denote . Define a partial function as follows. Let . If is a finite set, then . If is an infinite set, then the value is indefinite.
The proof of the next statement is similar to the proof of Theorem 5.
Theorem 7. Let ψ be a strictly limited e-complexity measure over the signature σ for which is a total recursive function, C be a nonempty class of structures of the signature σ, H be a nonempty subset of the set , and the problem of solvability for the quadruple be decidable. Then, the problem of e-optimization for the triple is decidable.
Corollary 2. Let σ be a finite signature, ψ be a strictly limited e-complexity measure over the signature σ, C be a nonempty class of structures of the signature σ, H be a nonempty subset of the set , and the problem of solvability for the quadruple be decidable. Then, the problem of e-optimization for the triple is decidable.
The proof of the next statement is similar to the proof of Theorem 6.
Theorem 8. Let C be a nonempty class of structures of the signature σ, H be a nonempty subset of the set , ψ be a strictly limited e-complexity measure over the signature σ, and the problem of satisfiability for the pair be undecidable. Then, the problem of e-optimization for the triple is undecidable.