Quantitative Language Automata
Abstract
A quantitative word automaton (QWA) defines a function from infinite words to values. For example, every infinite run of a limit-average QWA obtains a mean payoff, and every word is assigned the maximal mean payoff obtained by nondeterministic runs of overΒ . We introduce quantitative language automata (QLAs) that define functions from language generators (i.e., implementations) to values, where a language generator can be nonprobabilistic, defining a set of infinite words, or probabilistic, defining a probability measure over infinite words. A QLA consists of a QWA and an aggregator function. For example, given a QWA , the infimum aggregator maps each language to the greatest lower bound assigned by to any word inΒ . For boolean value sets, QWAs define boolean properties of traces, and QLAs define boolean properties of sets of traces, i.e., hyperproperties. For more general value sets, QLAs serve as a specification language for a generalization of hyperproperties, called quantitative hyperproperties. A nonprobabilistic (resp.Β probabilistic) quantitative hyperproperty assigns a value to each set (resp.Β distribution) of traces, e.g., the minimal (resp.Β expected) average response time exhibited by the traces inΒ . We give several examples of quantitative hyperproperties and investigate three paradigmatic problems for QLAs: evaluation, nonemptiness, and universality. In the evaluation problem, given a QLA and an implementationΒ , we ask for the value that assigns to . In the nonemptiness (resp.Β universality) problem, given a QLA and a valueΒ , we ask whether assigns at least to some (resp.Β every) language. We provide a comprehensive picture of decidability for these problems for QLAs with common aggregators as well as their restrictions to -regular languages and trace distributions generated by finite-state Markov chains.
Keywords and phrases:
Quantitative hyperproperties, quantitative automata, automata-based verificationCopyright and License:
2012 ACM Subject Classification:
Theory of computation Automata over infinite objects ; Theory of computation Quantitative automataFunding:
This work was supported in part by the ERC-2020-AdG 101020093.Editors:
Patricia Bouyer and Jaco van de PolSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl β Leibniz-Zentrum fΓΌr Informatik
1 Introduction
The specification and verification of system properties traditionally take a boolean view. While this view is appropriate for correctness properties, it lacks the ability to reason about quantitative aspects of system behaviors, such as performance or robustness. Quantitative trace properties and quantitative word automataΒ [12] address this gap: instead of partitioning the set of traces into correct and incorrect traces (as boolean properties do), they define functions from system executions to richer value domains, e.g., the real numbers. Using such a formalism, we can specify the maximal or average response time of a serverβs execution, or how badly a system behavior violates a desired boolean propertyΒ [19].
Many interesting system properties lie beyond the trace setting; especially security properties often refer to multiple traces. In the boolean case, they can be specified by hyperpropertiesΒ [13], which are interpreted over sets of traces rather than over individual traces. For example, a prominent hyperproperty is observational determinism, which requires every pair of executions with matching observable inputs to have matching observable outputs. In general, while trace properties specify which system behaviors are correct, hyperproperties specify which system implementations are correct. In a similar vein, while quantitative trace properties and quantitative word automata describe system properties on the level of individual executions, quantitative hyperproperties are needed to express quantitative aspects of system-wide properties. For example, a quantitative hyperproperty may measure the maximal or average response time of an implementation instead of a single execution, or how badly an implementation violates a desired boolean property. In this paper, we introduce quantitative language automata (QLAs), an automaton model for the specification and verification of quantitative hyperproperties. In contrast to quantitative word automata, quantitative language automata can measure system-wide properties.
Quantitative word automata (QWAs) extend boolean -automata with weighted transitions. An infinite run yields an infinite sequence of weights, which are accumulated by a run aggregator (a.k.a.Β value function). Common run aggregators are (the maximal weight along an infinite run), (the largest weight that occurs infinitely often), or (the long-term average of an infinite sequence of weights). When a given infinite word yields more than one run, as is generally the case for nondeterministic automaton specifications, the possible run values are accumulated by a word aggregator. The most common word aggregator is (the least upper bound of all values that can be achieved by resolving the nondeterministic choices), which generalizes the standard view that a single accepting run suffices to accept a word, but other word aggregators are possible. For example, the word aggregator assigns to each infinite word the l.u.b.Β of the values realized by infinitely many runs overΒ . When the specification is probabilistic (rather than nondeterministic), the word aggregator assigns to an expected value for the automaton readingΒ .
Quantitative language automata extend quantitative word automata with a third kind of aggregator function, called language aggregator, which summarizes the values of all infinite words which are obtained from an implementation and defined by a so-called βlanguage generator.β A language generator can be nonprobabilistic, defining a set of infinite words, or probabilistic, defining a probability measure over infinite words. A QLA consists of a language aggregator and a QWA , and maps each language generator to the value , where is the value assigned by the QWA to the infinite wordΒ , and denotes the accumulation over all words generated byΒ . When is nonprobabilistic, we interpret the aggregator over the words that belong to the language defined byΒ ; when probabilistic, over the words generated with respect to the probability measure defined byΒ . Using the language aggregators and , language automata can measure the best-case and the worst-case values that can be obtained by all executions of an implementation. With language aggregators and , we can express the βalmostβ best- and worst-cases, considering only the values achieved by infinitely many words in the language. Finally, when is probabilistic, the language aggregator captures the average-case with respect to the its probability measure. Using all three aggregator functions, we can specify, for example, the expected value (taken over all possible implementation traces) of the best case (realizable by a nondeterministic specification) of the average weight along a run of the specification.
The standard decision problems for automata extend naturally to our framework. Consider a language automaton and a rational thresholdΒ . Given a finite-state language generatorΒ (i.e., an -regular automaton or a finite Markov chain), the evaluation problem asks to compute the value to which maps . The nonemptiness (resp. universality) problem asks whether maps some (resp. every) language generator to a value of at leastΒ , or strictly aboveΒ . We investigate these problems for QLAs over unrestricted language generators, as well as with regard to natural subclasses of language generators such as finite-state ones.
| Evaluation | Nonemptiness | |||||||
| (a) | ||||||||
| PTime | PSpace | ExpTime | Undecidable | PTime | PTime | PSpace | Undecidable | |
| PTime | Undecidable | Undecidable | Undecidable | PTime | PTime | Undecidable | Undecidable | |
| PTime | Open-hard | Open-hard | Undecidable | PTime | PTime | Open-hard | Undecidable | |
| (b) | Evaluation | Nonemptiness | Universality |
|---|---|---|---|
Contribution and Overview.
Our main contribution is the definition and systematic study of QLAs within a three-dimensional framework of aggregator functions (run, word, and language aggregators), which supports the specification and verification of quantitative hyperproperties over nonprobabilistic and probabilistic language generators.
Section 2 presents our definitional framework and Section 3 gives several examples of QLAs for specifying quantitative hyperproperties. Section 4 introduces the QLA evaluation, nonemptiness, and universality problems that we study. Section 5 focuses on the evaluation problem of QLAs with word and language aggregators , , or , and Section 6 on the nonemptiness and universality problems of these. Section 7 switches the focus to QLAs with word and language aggregators and . Section 8 concludes with potential research directions. We summarize our decidability and complexity results in Table 1. We provide proof sketches in the main text; the details are available in the full version.
To present a comprehensive picture, we overcome several technical challenges: First, for the evaluation problem (Section 5), we demonstrate that the value of an -regular language may not be realized (i) by a lasso word in for limit-average (a.k.a. mean-payoff) QLAs and (ii) by any word in for discounted-sum QLAs. Although the evaluation problem for these automata is not always solvable, for its solvable cases we resolve these issues by proving that (i) in the limit-average case, the value of can still be computed by analyzing strongly connected components even if it is not realized by a lasso word, and (ii) in the discounted-sum case, the value of matches the value of its safety closure and is realized by some word in . These results yield PTime algorithms for the evaluation of these QLAs. We complement these results with hardness proofs via reductions from universality problems of the underlying QWAs.
Second, for nonemptiness and universality (Section 6), we examine the behavior of common QWA classes regarding the greatest lower bound of their values β their so-called bottom valuesΒ [4]. We show (i) discounted-sum QWAs always have a word achieving their bottom value, and (ii) the bottom value of limit-superior-average QWAs can be approximated by lasso words, contrasting sharply with limit-inferior-average QWAsΒ [12]. This enables us to establish the hardness of nonemptiness and universality for certain classes of QLAs. Moreover, we prove that for most classes of QLAs the unrestricted versions of nonemptiness and universality coincide with their finite-state restrictions, indicating a finite-model property.
Third, for QLAs using and as word and language aggregators (Section 7), we study values realized by infinitely many runs of a word and infinitely many words of a given language. Using combinatorial arguments, we characterize structural patterns in -automata that precisely capture when a value is infinitely realizable with the run aggregators , , , and .
Related Work.
Our work builds on quantitative languages and quantitative word automataΒ [12, 10], as well as on games with quantitative objectivesΒ [14]. There have been other definitions of quantitative hyperpropertiesΒ [16, 28, 31].
While our motivations align, QLAs in their current form and the formalisms ofΒ [16, 28] are orthogonal. InΒ [16, 28], a quantitative hyperproperty is based on counting the number of executions that appear in a given relation. Therefore, these formalisms cannot express, e.g., the worst-case server uptime, which QLAs can (see Section 3). Similarly, QLAs with the aggregators we considered cannot express properties that can only be defined using counting or cardinality constraints.
InΒ [31], the authors provide a predicate-transformer theory for reasoning on finite executions of imperative programs. Their formalism can define quantitative hyperproperties that can be expressed as functions from a set or distribution of values at a programβs final state to a single value, which is closer to our view compared to [16, 28]. For example, it can express the maximal value of a variable given the value of variable upon termination (akin to QLAs) or the variance of a random variable. However, it cannot express long-run aggregates such as limit superior or limit averages. Conversely, QLAs cannot express variances with the current aggregators, since it requires combining two expectations at the language-aggregator level. To the best of our knowledge, our work is the first to define quantitative hyperproperties as functions from sets or distributions of infinite words to quantitative values, and therefore the first to study the specification and verification of such properties through automata.
2 Definitional Framework
Let be a finite alphabet of letters. A word (or trace) over is a finite or infinite sequence of letters from . We denote by the length of a finite word . We denote by (resp. ) the set of all finite (resp. infinite) words over . An infinite word is ultimately periodic (a.k.a. lasso) iff for some such that . A language is a set of infinite words. Given and , we write when is a prefix of . We denote by the set of natural numbers (including 0), the set of rational numbers, the set of real numbers. We further let and . Consider a set . An -multiset is a function that maps each element of to a value denoting its multiplicity. The support of a multiset is the set of distinct elements in . A value domain is a nontrivial complete lattice. A quantitative property is a total function .
Quantitative Word Automata.
A weighted labeled transition system is a tuple , where: is a finite alphabet, is a finite nonempty set of states, is the initial state, is a finite transition function over weight-state pairs, and is a probability distribution such that for all and , (i) iff , and (ii) . Given a transition system , the dual of is a copy of with the weights multiplied by .
A transition is a tuple such that , denoted . Given a transition , we denote its weight by . We say that is complete (a.k.a. total) iff for every and , and deterministic iff for every and . Throughout the paper, we assume that weighted labeled transition systems are complete.
Although weighted labeled transition systems are probabilistic by definition, they can be viewed as nondeterministic by considering only the support of , i.e., treating all transitions with positive probability as nondeterministic transitions.
A run of is an infinite sequence of transitions such that and for all . We write for the corresponding infinite sequence of rational weights. Given a word , we denote by the set of runs of over . Let be a run and be a finite prefix of . The probability of is . For each infinite word , we define as the unique probability measure over Borel sets of infinite runs of over , induced by the transition probabilities .
A run aggregator (a.k.a. value function) is a function that accumulates an infinite sequence of weights into a single value. We consider the run aggregators below over an infinite sequence of rational weights and a discount factor . We write when the discount factor is unspecified. The run aggregators and (resp., and , and ) are duals. The dual of is itself.
A word aggregator is a function that accumulates a multiset of values obtained from the runs of a word into a single value. We consider the word aggregators defined below where is an -multiset and is a probability measure over . The word aggregators and (resp., and ) are duals. The dual of is itself.
A quantitative word automaton (QWA)Β [12] is a tuple where is a complete weighted labeled transition system, is a run aggregator, and is a word aggregator. Given a word , a transition system , and a run aggregator , we define an -multiset such that for every the value equals the number of runs of over such that . For all we define . We let for all and write for when is clear from the context.
A QWA is nondeterministic when its word aggregator is , and universal when . The top value of a word automaton is , and its bottom value is . We say that (resp. ) is achievable iff there exists a word with (resp. ). Given a word automaton its dual is where , , and are the duals of , , and , respectively. For a QWA and a word , if is finite for all , then we let when and when .
Boolean word automata are a special case of QWAs with weights in and . In particular, a nondeterministic BΓΌchi automaton is a boolean word automaton with and . Given a boolean word automaton , we write for its language.
Quantitative Language Automata.
A language generator is a function . A language generator is nonprobabilistic iff there is a language such that and for every other language . A nonprobabilistic language generator is nonempty iff . A language generator is probabilistic iff it defines a probability measure over . A nonprobabilistic quantitative hyperproperty (resp. probabilistic quantitative hyperproperty) is a total function from the set of all nonprobabilistic (resp. probabilistic) language generators to a value domain .
A language aggregator is a function that accumulates a multiset of values obtained from a set of words into a single value. We consider the language aggregators , , , , and , which are defined the same as for the word aggregators above.
A quantitative language automaton (QLA) is a pair where is a QWA and is a language aggregator. Consider a language generator and a QWA . If is nonprobabilistic (resp. probabilistic), we define as an -multiset such that for every the value equals the number of words in (resp. in ) such that . Moreover, if is probabilistic, we additionally let . Then, we let for every language generator where is as above. We write for when is clear from the context.
Below, we assume the input to a QLA is a nonprobabilistic (resp. probabilistic) language generator when (resp. ). We write to denote a nonprobabilistic language generator, and to denote a probabilistic one.
The top value of a QLA , denoted , is the supremum of the values over all inputs , and its bottom value, denoted , is the infimum. For a QLA and a nonprobabilistic language generator , if for all (i.e., when ), then we let when and when . Similarly, if is finite for all , then we let when and when .
Proposition 2.1.
Consider a QLA with . Then, and .
Given a QLA its dual is where and are the duals of and .
Proposition 2.2.
Consider a QLA and its dual . Then, for every language generator .
3 Applications of Language Automata
While QWAs describe system specifications per execution, QLAs describe system-wide specifications. We show several applications of QLAs for specifying quantitative hyperproperties. Notice that QLAs are an operational specification language β their underlying word automata serve as part of the specification itself.
Server Uptime.
QWAs can model performance metrics for individual executions. Let be a finite alphabet of observations modeling a serverβs activity. Consider the weighted labeled transition system given in Figure 1, and let be a QWA where and . The automaton maps each infinite word to the long-run ratio of on, i.e., the average uptime of the execution modeled by . For example, if , we have .
QLAs can model system-wide performance metrics. Let . Setting tunes to map any given language , capturing the implementation of a server, to the worst-case uptime over all the executions allowed by the implementation, i.e., . For example, let and consider the language of server executions where each block of onβs is followed by a strictly shorter block of offβs. Although for every there are strictly more onβs than offβs, we have where for each , thus . In particular, notice that the value of cannot be achieved by any ultimately periodic word in ; we will later show that this may happen even for -regular languages (Proposition 5.2). As another example of using QLAs to specify quantitative hyperproperties, setting tunes to express the βalmostβ worst-case uptime by considering only the uptime values realized by infinitely many executions. For example, let . The part yields infinitely many executions with uptime 1, while each with uptime appears only once. Thus, even though the infimum over is 0, only uptime 1 occurs infinitely often, so .
Implementation Distance.
QWAs can specify the distance of individual executions to a desired boolean trace property. Let be a finite alphabet of observations modeling a server receiving requests and issuing grants, and consider the boolean safety property requiring that no two requests are simultaneously open (i.e., there is a gra between every two reqβs). Consider the transition system given in Figure 1, and let be a QWA where and (the choice of does not matter since is deterministic). The automaton maps each infinite word to the smallest Cantor distance between and some word , i.e., . For example, if , we have .
QLAs can specify the distance of systems to a desired boolean trace property. Let . Setting tunes to map any given language , representing a server implementation, to the worst-case distance from to . In other words, where denotes the Cantor distance. For example, if , then . Setting tunes to map each language to the best-case distance from to . For example, if is as above, the value of would be 0 although all the words in violate . This is because for every the word belongs to and , highlight a challenge for the evaluation of discounted-sum QLAs: the value of may not be realized by any word in , even if is omega-regular. Setting tunes to map each language to the average-case distance to . For example, consider the Markov chain from Figure 1. The expected value can be computed by solving the corresponding system of linear equations, resulting in .
Robot Stability.
QWAs can express stability constraints of individual executions. Let be a finite alphabet representing robot movements β left, right, and idle β on a one-dimensional finite grid. An execution is -stable, for some , if there exists such that whenever the system starts within a -ball around the origin, it remains indefinitely within an -ball around the origin. For a fixed , QWAs can express the most permissive associated with each execution. Consider the weighted labeled transition system given in Figure 1, and let . The automaton captures the scenario where , meaning the robot starts at most one step away from the origin. Transition weights indicate distances from the origin, and a runβs value is the maximal distance reached. Thus, the automatonβs value on a word is the worst-case distance (or most permissive ) over all initial positions. For instance, the word has three runs with values 1, 1, and 2, so .
QLAs can express stability constraints of systems. Let . If , then given a language modeling the robotβs behavior, the automaton maps to least upper bound of the set of per-execution values obtained from and . In other words, is the smallest ensuring all executions in are -stable with . Alternatively, if , then captures the smallest such that infinitely many executions are -stable for , allowing to discard βoutlierβ values achieved only by finitely many executions.
Communication Channel Cost.
Probabilistic QWAs can specify the expected cost of individual executions. Let be an alphabet modeling a communication channel. Consider the transition system given in Figure 1, and let be a probabilistic QWA. Each run of the automaton is mapped to a long-term maximal cost, i.e., of the corresponding weight sequence. Then, each infinite word is mapped to the expected value over the distribution of its runs. For example, considering gives us because the set of runs with a value 5 (i.e., those in which the high-cost cycle occurs infinitely often) has probability 1.
QLAs can specify the aggregate cost of a communication channel. Let . If , the QLA specifies the expected cost of the underlying probabilistic model of a communication channel. Consider a Markov chain defining a uniform probability measure over the alphabet . Then, which can be computed by analyzing the product of the Markov chain defining and the underlying word automaton .
4 Problems on Language Automata
Let be a QLA. We study the following problems for .
- Nonprobabilistic Evaluation ().
-
Given a BΓΌchi automaton , compute .
- Probabilistic Evaluation ().
-
Given a finite-state Markov chain , compute .
- -Nonemptiness.
-
Given , is for some (nonempty) language generator ?
- -Universality.
-
Given , is for every (nonempty) language generator ?
For nonemptiness and universality, we also consider the following variants with restricted quantification over language generators.
- Borel.
-
Nonprobabilistic generators with Borel in under the Cantor topology.
- Markov.
-
Probabilistic generators with Markovian.
- Finite-state.
-
Nonprobabilistic generators with -regular; probabilistic generators with finite-state Markovian.
We establish the relations between the questions about QLAs and the corresponding questions about their underlying QWA. For completeness, we provide these problem definitions here. Consider a QWA , a rational , and . Then, is -nonempty (resp -universal) for iff for some (resp. all) . Similarly as for the finite-state restriction for QLAs problems, the lasso-word restriction for these problems requires quantifying over lasso words instead of all words. Moreover, is approximate-nonempty for iff , i.e., if there exists such that or if for every there exists such that . Hence, the achievability of implies that approximate-nonemptiness and -nonemptiness are equivalent problems. Note that iff for some word β it holds independently of the achievability of . Dually, is approximate-universal for iff .
For the classes of QLAs we consider, the Borel (resp. Markov) restrictions of the decision problems coincide with the unrestricted cases. Thus, for their decision problems we only focus on the unrestricted and finite-state cases.
Proposition 4.1.
Consider a QLA with , , , (resp. ), a rational , and . Then, is -nonempty for iff is Borel -nonempty (resp. Markov -nonempty) for . The same holds for universality.
For QLAs with language aggregators , , and , we demonstrate that their decision problems often reduce to those of their underlying QWAs. Moreover, we identify several cases in which QLAs enjoy a finite-model property.
Proposition 4.2.
Consider a QLA with , a rational , and .
-
(a)
Unrestricted variant
-
(i)
If or , then is -nonempty for iff is -nonempty for .
-
(ii)
If , then is -nonempty for iff is approximate-nonempty for .
-
(i)
-
(b)
Finite-state variant
-
(i)
If , then is finite-state -nonempty for iff is -nonempty for .
-
(ii)
If , then is finite-state -nonempty for iff is lasso-word -nonempty for .
-
(iii)
If is achievable by a lasso word, then is finite-state -nonempty for iff is -nonempty for iff is lasso-word -nonempty for .
-
(i)
For universality, we have the duals where we exchange with , with , nonempty with universal, approximate-nonempty with approximate-universal, and with .
We show that approximating top or bottom values via lasso words lets us reduce certain unrestricted variants to their finite-state counterparts, establishing a finite-model property.
Proposition 4.3.
Consider a QLA with and . If for every there is a lasso word such that , then is -nonempty for iff is finite-state -nonempty for . Dually, if for every there is a lasso word such that , then is -universal for iff is finite-state -universal for .
5 Solving Evaluation
In this section, we investigate the evaluation problem for QLAs with language and word aggregators , for which we provide a full picture of complexity results. First, in Section 5.1, we focus on the nonprobabilistic evaluation problem (where ) and then, in Section 5.2, on the probabilistic one (where ).
5.1 Nonprobabilistic Evaluation
First, we consider the evaluation problem for QLAs with . We start with QLAs whose underlying word automata are universal or nondeterministic (i.e., ). We study various run aggregators separately and show that the problem is in PTime when the word aggregator and the language aggregator coincide. When they differ, the problem becomes harder: while it remains algorithmically solvable in PSpace for the βstandardβ run aggregators (i.e., ), we show that it is not computable for limit-average and at least as hard as a long-standing open problem for discounted-sum. Finally, for QLAs whose underlying word automata are probabilistic (i.e., ), we show that the problem is not computable. At their core, the easiness results rely on analyzing the extreme values of the underlying word automata. Similarly, we establish the hardness results by reductions from word automata problems.
QLAs with Standard QWAs.
For QLAs with run aggregators , , , , the nonprobabilistic evaluation problem can be solved by reasoning on lasso words since both top and bottom values of the underlying word automata are realized by lasso words.
Theorem 5.1.
Consider a QLA with , , , and , . Let be an -regular language given by a BΓΌchi automaton. The value is computable in PTime when and in PSpace when .
QLAs with Limit-Average QWAs.
QLAs with run aggregators differ from the previous case in the sense that it is not sufficient to consider only the lasso words in a given -regular language, even when the underlying word automaton is deterministic. To witness this, consider the best-case average uptime QLA as in Sections 3 andΒ 1. Having , we get as there is a word in with infinitely many offβs but longer and longer blocks of onβs, but no lasso word in has an average uptime of 1.
Proposition 5.2.
There is a QLA with a run aggregator and an -regular language such that no lasso word in achieves the value .
Nonetheless, for QLAs with matching word and language aggregators, we show that the value of an -regular language given by a BΓΌchi automaton is computable by analyzing the strongly connected components (SCCs) of the underlying word automatonβs product with as follows: Among all SCCs that are reachable from the initial state, we find the ones that contain at least one state whose BΓΌchi component is accepting. Then, in each such SCC, we compute the maximum mean weight of its cycles by Karpβs algorithm [22]. The largest among these mean values is exactly the value of the given language. Even though such a cycle may not involve an accepting state of , we can construct a run of the product that visits an accepting state infinitely often while going over this cycle with increasing frequency (hence the long-run average converges to the cycleβs mean). When these aggregators differ, the problem is undecidable by reduction from the universality of limit-average QWAsΒ [14, 9, 20].
Theorem 5.3.
Consider a QLA with , and , . Let be an -regular language given by a BΓΌchi automaton. The value is computable in PTime when and not computable when .
QLAs with Discounted-Sum QWAs.
QLAs with the run aggregator have the particular behavior that the value assigned to an -regular language may be not achievable by any word in , even when the underlying word automaton is deterministic. To witness this, consider with as in Figure 1. We have since . However, only for we have .
Proposition 5.4.
There is a QLA with the run aggregator and an -regular language such that no word in achieves the value .
We establish that such a behavior is not possible when the input language includes all its limit points, i.e., it is safe in the boolean senseΒ [24, 2]: Consider a sequence of words in the safety language whose values approach the supremum. We build by a diagonalization argument an infinite word whose every finite prefix already appears in the language, so is in the safety language. Applying the same construction to the corresponding optimal runs yields an infinite run on . This runβs value equals the supremum since the contribution of the remaining tail is bounded by a vanishing geometric series due to discounting.
Proposition 5.5.
Consider a QLA . For every nonempty safety language , the value is achievable by some run of a word in .
The value of a language matches that of its safety closure (i.e., the smallest safety language containing it) because every word in the safety closure can be approximated arbitrarily closely by words from the original language: If achieves a value on a word , we can isolate a prefix of whose contribution is close enough to the value of . By construction, the same prefix also occurs in a word of , and completing the run along this word in can change the total value by at most an arbitrarily small amount due to discounting. Hence the maximal value in can be approximated arbitrarily closely by words in , and the two suprema coincide.
Proposition 5.6.
Consider a QLA . For every language we have where is the safety closure of .
The observation above helps us provide a PTime algorithm when the word and language aggregators match: We first construct the BΓΌchi automatonβs safety closure, so the optimal value is achieved by a run that never reaches the rejecting sink. Then, we compute the product of the underlying word automaton and the safety closure automaton. Computing the best (or worst) discounted sum over all sink-avoiding paths in the product can be done by solving a one-player discounted-payoff gameΒ [3]. When the two aggregators differ, the evaluation problem is at least as hard as the universality problem for nondeterministic discounted-sum automata, which is a long-standing open problemΒ [12, 6].
Theorem 5.7.
Consider a QLA with , . Let be an -regular language given by a BΓΌchi automaton. The value is computable in PTime when . If is computable when , then the -universality of nondeterministic discounted-sum word automata is decidable.
QLAs with Probabilistic QWAs.
When the underlying word automaton is probabilistic, i.e., has the word aggregator , the nonprobabilistic evaluation problem has no algorithmic solution due to inapproximability of their top valuesΒ [26].
Theorem 5.8.
Consider a QLA with , , , , , and , . Let be a probability measure given by a finite-state Markov chain. The value is not computable.
5.2 Probabilistic Evaluation
Now, we consider the evaluation problem for QLAs with and follow the same structure as in Section 5.1: we start with the cases of and study various run aggregators separately, and then look at the case of .
QLAs with Standard QWAs.
First, we provide an ExpTime algorithm for QLAs with the run aggregators , , , . Our proof builds on that of [27, Thm.Β 8], which considers only . The idea is to determinize the underlying word automaton, which leads to an exponential blow-up, and evaluate its product with the given Markov chain.
Theorem 5.9.
Consider a QLA with , , and , . Let be a probability measure given by a finite-state Markov chain. The value is computable in ExpTime.
QLAs with Limit-Average QWAs.
Undecidability of probabilistic evaluation for limit-average QLAs was shown in [27] by a reduction from the universality problem of quantitative automata on finite words with the summation run aggregator and weights in , a.k.a. weighted automata over the tropical semiring of integersΒ [23, 1].
Theorem 5.10 ([27, Thm. 7]).
Consider a QLA with and , . Let be a probability measure given by a finite-state Markov chain. The value is not computable.
QLAs with Discounted-Sum QWAs.
Next, we show the hardness of probabilistic evaluation for QLAs. As in the nonprobabilistic case, we provide a reduction from the universality problem of nondeterministic discounted-sum QWAs.
Theorem 5.11.
Consider a QLA with , . Let be a probability measure given by a finite-state Markov chain. If is computable, then the -universality of nondeterministic discounted-sum word automata is decidable.
QLAs with Probabilistic QWAs.
Finally, for QLAs with , the evaluation problem reduces to evaluating a Markov chain with rewards on infinite words, which is solved using linear programmingΒ [21].
Theorem 5.12 ([21]).
Consider a QLA with , , , , , . Let be a probability measure given by a finite-state Markov chain. The value is computable in PTime.
6 Deciding Nonemptiness and Universality
In this section, we investigate the nonemptiness and universality problems for QLAs with language and word aggregators . We give a complete picture of decidability results for the unrestricted cases. When the unrestricted cases are decidable, our algorithms provide a solution for the finite-state cases in the same complexity class. When they are undecidable or not known to be decidable, some finite-state cases remain open, which we make explicit in the corresponding statements.
Thanks to the duality between nondeterministic and universal automata, solving the nonemptiness problem solves the universality problem as well.
Β Remark 6.1.
Consider a QLA and its dual . Let . Thanks toΒ Proposition 2.2, the QLA is -nonempty (resp. -universal) for iff is not -universal (resp. -nonempty) for . The statement holds also for the finite-state restriction.
The rest of the section focuses on the nonemptiness problem and is organized by the type of the underlying QWAs. We first consider the case of nondeterministic automata (i.e., ) and show that the problem is decidable in PTime for these. Then, we consider universal automata (i.e., ) with various run aggregators separately. Similarly as for the evaluation problem, nonemptiness is in PSpace for the βstandardβ run aggregators, undecidable for limit-average, and at least as hard as a long-standing open problem for discounted sum. Finally, we consider probabilistic automata (i.e., ) and show that the problem is undecidable.
QLAs with Nondeterministic QWAs.
Let us first consider QLAs whose underlying word automata are nondeterministic, i.e., those where the word aggregator is . We show that the nonemptiness problems for such QLAs can be solved efficiently, independently of the choice of the remaining aggregators or additional restrictions on the problem. Intuitively, this is because their top values coincide with those of the underlying QWAs (Proposition 2.1), which are achievable by lasso words and can be computed efficiently.
Theorem 6.2.
Consider a QLA with , , , , , and , , . Let . The -nonemptiness of is in PTime. The statement holds also for the finite-state restriction.
QLAs with Universal Standard QWAs.
We turn our attention to QLAs whose underlying word automata are universal, i.e., those where the word aggregator is . For run aggregators , , , , we show that computing the automatonβs top value suffices, which can be done in PSpace when .
Theorem 6.3.
Consider a QLA with , , , and . Let . The -nonemptiness of is in PSpace. The statement holds also for the finite-state restriction.
QLAs with Universal Limit-Average QWAs.
Next, we focus on QLAs with the limit-average run aggregators. We first show that the bottom value of nondeterministic QWAs (dually, top value of universal QWAs) can be approximated arbitrarily closely by lasso words. This is in stark contrast with nondeterministic QWAs, where an automaton may be lasso-word universal for some threshold while there exist non-lasso words with values below [12, Lem. 4]. The intuition behind this is that for , if for some word and value , then for any , there exists a length such that the average value of any run prefix on of length at least is below , which does not hold in general for . Consequently, we can find two distant-enough occurrences of the same state and pump the low-average segment between them to obtain a lasso whose overall value stays under the threshold.
Proposition 6.4.
Consider a QWA . For every there is a lasso word such that .
In general, all variants of the nonemptiness problem for universal limit-average QWAs (dually, universality for the nondeterministic ones) are undecidableΒ [14, 9, 20]. Combining these with our approximability result above, we obtain the following.
Theorem 6.5.
Consider a QLA with , and . Let . The -nonemptiness of is undecidable. The statement holds also for the finite-state restriction when (i) or (ii) and .
QLAs with Universal Discounted-Sum QWAs.
Now, we consider QLAs with the discounted-sum run aggregators. We show that the bottom value of nondeterministic QWAs (dually, top value of universal QWAs) is achievable. At a high level, we repeatedly extend a finite prefix with a letter that does not increase the current infimum over continuation values. In the limit, this process results in an infinite word whose sequence of prefix infima converges to the automatonβs bottom value. Since discounted-sum automata are co-safe in the quantitative senseΒ [18, 4, 5], i.e., the value of every infinite word equals the limit of its prefix infima, this constructed word attains exactly the bottom value.
Proposition 6.6.
Consider a QWA . There is a word such that .
By combining the achievability result above with Proposition 4.2, we obtain a concise proof to establish that the nonemptiness problem for QLAs whose underlying QWAs are universal QWAs is at least as hard as the universality problem for nondeterministic QWAs, which is a long-standing open problemΒ [12, 6].
Theorem 6.7.
Consider a QLA with . Let . If the -nonemptiness of is decidable, then the universality of nondeterministic discounted-sum word automata is decidable. The statement holds also for the finite-state restriction when (i) or (ii) .
QLAs with Probabilistic QWAs.
Let us now focus on QLAs whose underlying QWA is probabilistic, i.e., where . We show that several variants of the nonemptiness problem for probabilistic QWAs are undecidable by building on the undecidability results of probabilistic word automataΒ [26].
Theorem 6.8.
Consider a QWA with , , , , , . Let . The -nonemptiness of is undecidable, whether we consider all words from or only lasso words. Moreover, its approximate-nonemptiness is also undecidable.
Finally, putting together the above undecidability result with Propositions 4.2 andΒ 4.3, we show the undecidability of the nonemptiness problem for QLAs whose underlying QWA is probabilistic.
Theorem 6.9.
Consider a QLA with , , , , , and . Let . The -nonemptiness of is undecidable. The statement holds also for the finite-state restriction when (i) or (ii) and .
7 Language Automata with Limit Aggregators
We finally focus on QLAs with the aggregators where at least one of the language aggregator or the word aggregator belongs to .
7.1 Deciding Infinite Achievability
To work with QLAs that use or as word or language aggregators, we need to reason about the values that appear infinitely often in a multiset. In this subsection, we develop the necessary tools for this purpose, focusing on QLAs with run aggregators .
We begin by characterizing the conditions under which a state in an automaton can be visited infinitely often by infinitely many words. The following lemma uses proof techniques similar to those used in the characterization of ambiguity in finite-state automataΒ [30, 25].
Lemma 7.1.
Let be a (weighted) labeled transition system with states and its initial state. For every state of , there exist infinitely many words with a run from visiting infinitely often iff complies with the pattern parameterized by and given in Figure 2a.
It is well known that BΓΌchi automata can be effectively complemented in ExpTimeΒ [29, 17]. Moreover, checking whether a finite-state automaton satisfies a given syntactic pattern, such as the one in Figure 2a, is in NLogSpaceΒ [15]. As a direct consequence of Lemma 7.1, keeping a symbolic representation of the complement provides the following PSpace procedure.
Corollary 7.2.
Let and be two BΓΌchi automata. We can decide in PSpace whether is infinite.
By interpreting the transitions of a run as input letters, we can use Figure 2a to reason about runs instead of words. Building on Lemma 7.1, we present a similar pattern that incorporates weights, enabling us to identify the words for which an automaton admits infinitely many runs of a given value.
Lemma 7.3.
Consider a QWA with states, , , , , , , and initial state . Let if and if . For every and every lasso word , we have that admits infinitely many runs of value in iff complies with the pattern in Figure 2b parameterized by , , , and .
As a corollary of Lemma 7.3, we can construct a boolean automaton accepting every lasso word with infinitely many runs of value in . To achieve this, we construct a BΓΌchi or co-BΓΌchi automaton that initially guesses a fixed pair of states and with the same properties as in Figure 2b. The automaton then guesses on-the-fly the segments and from Figure 2b. During the processing of each period , it simulates runs, with , simultaneously verifying weights and connectivity. At the end of each period, the automaton resets (except for the fixed and ) to guess another period and visit an accepting state. Consequently, any accepted lasso word resets infinitely often and ultimately repeats a finite periodic segment , complying with Figure 2b. Conversely, every word conforming to Figure 2b is accepted by appropriately selecting .
Corollary 7.4.
Let be QWA with (resp. ). Given , we can construct in PTime a BΓΌchi automaton (resp. a co-BΓΌchi automaton) recognizing all lasso words admitting infinitely many runs of value in .
7.2 Expressive Power of Limit Aggregators
This subsection investigates the expressive power of word and language aggregators , , , . The following proposition generalizes the results ofΒ [12, 4] to QLAs.
Proposition 7.5.
Consider a QLA with , , , , , , and any language aggregator function. We can construct in PTime a QLA with , such that for all .
Β Remark 7.6.
The construction ofΒ [12] allowing to convert a nondeterministic QWA with run aggregator to one with can be extended to QLAs with word aggregator but not with . By duality, the conversion of a universal QWA to a one can be extended to QLAs with word aggregators but not . This is because deterministic QWA and deterministic QWA are expressively incomparableΒ [12]. Hence, there is no conversion that preserves, for every word , the number runs with the same value over .
We now focus on word aggregators, first showing that and are at least as expressive as and when they are combined with the run aggregators , , , . The construction relies on Corollary 7.4, the closure of QWAs under and operationΒ [11], and an argument that equivalence of QWAs with run and word aggregators in , , , can be determined by considering only lasso words.
Lemma 7.7.
Let be a QLA with , , , , (resp. ), and any language aggregator function. We can construct in PSpace a QLA with and (resp. and ) such that for all .
Now, we prove the other direction: the word aggregators and are at least as expressive as and for any run aggregator and any language aggregator. The idea is to duplicate the transition system so that the automaton can switch between the two copies at any step, ensuring that every word yields infinitely many runs with the same value.
Lemma 7.8.
Let be a QLA with any run aggregator function, (resp. ), and any language aggregator function. We can construct in PTime a QLA where (resp. ) such that for all .
The following comes as a consequence of Lemmas 7.7 andΒ 7.8.
Theorem 7.9.
For QLAs with run aggregators , , , , the word aggregators and (resp. and ) are equally expressive.
Finally, we turn our attention to language aggregators. In contrast to the case of word aggregators, even when combined with run aggregators , the language aggregators and are expressively incomparable with and . Intuitively, when the top or the bottom value of the underlying QWA is achievable by a single word, a QLA with a limit language aggregator cannot achieve this value, while one with a non-limit language aggregator can. Conversely, if the extreme value of a QLA emerges only as the value of finite languages, a limit language aggregator can capture this behavior, while a non-limit aggregator cannot.
Proposition 7.10.
QLAs with the language aggregators and (resp. and ) are expressively incomparable.
7.3 Decision Problems with Limit Aggregators
Finally, we consider the evaluation, nonemptiness, and universality problems for these classes of QLAs. We first provide a PSpace procedure for evaluation. Intuitively, each weight appearing on the underlying transition system are treated individually since the value of an input language must be one of them. For , we leverage Corollary 7.2 to identify the weights achievable by infinitely many words from the input languages in PSpace. The problem reduces to checking the nonemptiness of a BΓΌchi automaton when and to checking their inclusion when . We note that the proof of Theorem 7.11 also establishes the PTime cases presented in Theorem 5.1.
Theorem 7.11.
Consider a QLA with , , , and at least one and belong to , . Let be an -regular language given by a BΓΌchi automaton. The value is computable in PSpace.
Next, we prove that QLAs with , , , , checking whether a given QLA is an upper bound on another (namely, their inclusion problem) is decidable in PSpace. The proof starts by showing that this problem can be solved while reasoning exclusively on -regular languages and then generalizes our algorithm for the evaluation problem (Theorem 5.1) to handle two QLAs.
Theorem 7.12.
Consider two QLAs and with , , , . Let . Deciding whether for every language is in PSpace. The same holds when ranges over -regular languages.
Using Theorem 7.12, we obtain a matching solution to the corresponding nonemptiness and universality problems. Note that Theorems 6.2 andΒ 6.3 capture the cases of non-limit aggregators, including the PTime fragments.
Corollary 7.13.
Consider a QLA with , , , and at least one and belong to , . Let . The -nonemptiness (resp. -universality) of is in PSpace. The statement holds also for the finite-state restriction.
8 Conclusion
We introduced quantitative language automata (QLAs) as a uniform framework for specifying and verifying quantitative hyperproperties. Our framework extends beyond both the traditional boolean perspective of system properties and the βone-trace limitationβ of traditional quantitative properties as system specifications, enabling reasoning about quantitative aspects of system-wide behaviors such as performance and robustness. We established a thorough foundation for QLAs by investigating the evaluation, nonemptiness, and universality problems, for which we provided a extensive picture of decidability results. In addition to closing the finite-state cases we left open, future research directions include exploring aggregators capable of specifying richer relational system properties, investigating decidable expressive fragments of QLAs, studying equivalent logical formalisms, and augmenting the software tool Quantitative Automata Kit (QuAK)Β [7, 8] with a support for QLAs.
References
- [1] Shaull Almagor, Udi Boker, and Orna Kupferman. Whatβs decidable about weighted automata? Inf. Comput., 282:104651, 2022. doi:10.1016/J.IC.2020.104651.
- [2] Bowen Alpern and FredΒ B. Schneider. Defining liveness. Inf. Process. Lett., 21(4):181β185, 1985. doi:10.1016/0020-0190(85)90056-0.
- [3] Daniel Andersson. An improved algorithm for discounted payoff games. In Janneke Huitink and Sophia Katrenko, editors, Proceedings of the 11th ESSLLI Student Session, pages 91β98, August 2006.
- [4] Udi Boker, ThomasΒ A. Henzinger, Nicolas Mazzocchi, and N.Β Ege SaraΓ§. Safety and liveness of quantitative automata. In GuillermoΒ A. PΓ©rez and Jean-FranΓ§ois Raskin, editors, 34th International Conference on Concurrency Theory, CONCUR 2023, September 18-23, 2023, Antwerp, Belgium, volume 279 of LIPIcs, pages 17:1β17:18. Schloss Dagstuhl β Leibniz-Zentrum fΓΌr Informatik, 2023. doi:10.4230/LIPICS.CONCUR.2023.17.
- [5] Udi Boker, ThomasΒ A Henzinger, Nicolas Mazzocchi, and NΒ Ege SaraΓ§. Safety and liveness of quantitative properties and automata. Logical Methods in Computer Science, 21, 2025.
- [6] Udi Boker, ThomasΒ A. Henzinger, and Jan Otop. The target discounted-sum problem. In 30th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2015, Kyoto, Japan, July 6-10, 2015, pages 750β761. IEEE Computer Society, 2015. doi:10.1109/LICS.2015.74.
- [7] Marek Chalupa, ThomasΒ A. Henzinger, Nicolas Mazzocchi, and N.Β Ege SaraΓ§. Quak: Quantitative automata kit. In Tiziana Margaria and Bernhard Steffen, editors, Leveraging Applications of Formal Methods, Verification and Validation. Software Engineering Methodologies - 12th International Symposium, ISoLA 2024, Crete, Greece, October 27-31, 2024, Proceedings, Part IV, volume 15222 of Lecture Notes in Computer Science, pages 3β20. Springer, 2024. doi:10.1007/978-3-031-75387-9_1.
- [8] Marek Chalupa, ThomasΒ A. Henzinger, Nicolas Mazzocchi, and N.Β Ege SaraΓ§. Automating the analysis of quantitative automata with quak. In Arie Gurfinkel and Marijn Heule, editors, Tools and Algorithms for the Construction and Analysis of Systems - 31st International Conference, TACAS 2025, Held as Part of the International Joint Conferences on Theory and Practice of Software, ETAPS 2025, Hamilton, ON, Canada, May 3-8, 2025, Proceedings, Part I, volume 15696 of Lecture Notes in Computer Science, pages 303β312. Springer, 2025. doi:10.1007/978-3-031-90643-5_16.
- [9] Krishnendu Chatterjee, Laurent Doyen, Herbert Edelsbrunner, ThomasΒ A. Henzinger, and Philippe Rannou. Mean-payoff automaton expressions. In Paul Gastin and FranΓ§ois Laroussinie, editors, CONCUR 2010 - Concurrency Theory, 21th International Conference, CONCUR 2010, Paris, France, August 31-September 3, 2010. Proceedings, volume 6269 of Lecture Notes in Computer Science, pages 269β283. Springer, 2010. doi:10.1007/978-3-642-15375-4_19.
- [10] Krishnendu Chatterjee, Laurent Doyen, and ThomasΒ A. Henzinger. Alternating weighted automata. In Miroslaw Kutylowski, Witold Charatonik, and Maciej Gebala, editors, Fundamentals of Computation Theory, 17th International Symposium, FCT 2009, Wroclaw, Poland, September 2-4, 2009. Proceedings, volume 5699 of Lecture Notes in Computer Science, pages 3β13. Springer, 2009. doi:10.1007/978-3-642-03409-1_2.
- [11] Krishnendu Chatterjee, Laurent Doyen, and ThomasΒ A. Henzinger. Expressiveness and closure properties for quantitative languages. Log. Methods Comput. Sci., 6(3), 2010. URL: http://arxiv.org/abs/1007.4018.
- [12] Krishnendu Chatterjee, Laurent Doyen, and ThomasΒ A. Henzinger. Quantitative languages. ACM Trans. Comput. Log., 11(4):23:1β23:38, 2010. doi:10.1145/1805950.1805953.
- [13] MichaelΒ R. Clarkson and FredΒ B. Schneider. Hyperproperties. J. Comput. Secur., 18(6):1157β1210, 2010. doi:10.3233/JCS-2009-0393.
- [14] Aldric Degorre, Laurent Doyen, Raffaella Gentilini, Jean-FranΓ§ois Raskin, and Szymon Torunczyk. Energy and mean-payoff games with imperfect information. In Anuj Dawar and Helmut Veith, editors, Computer Science Logic, 24th International Workshop, CSL 2010, 19th Annual Conference of the EACSL, Brno, Czech Republic, August 23-27, 2010. Proceedings, volume 6247 of Lecture Notes in Computer Science, pages 260β274. Springer, 2010. doi:10.1007/978-3-642-15205-4_22.
- [15] Emmanuel Filiot, Nicolas Mazzocchi, and Jean-FranΓ§ois Raskin. A pattern logic for automata with outputs. In Mizuho Hoshi and Shinnosuke Seki, editors, Developments in Language Theory - 22nd International Conference, DLT 2018, Tokyo, Japan, September 10-14, 2018, Proceedings, volume 11088 of Lecture Notes in Computer Science, pages 304β317. Springer, 2018. doi:10.1007/978-3-319-98654-8_25.
- [16] Bernd Finkbeiner, Christopher Hahn, and Hazem Torfah. Model checking quantitative hyperproperties. In Hana Chockler and Georg Weissenbacher, editors, Computer Aided Verification - 30th International Conference, CAV 2018, Held as Part of the Federated Logic Conference, FloC 2018, Oxford, UK, July 14-17, 2018, Proceedings, Part I, volume 10981 of Lecture Notes in Computer Science, pages 144β163. Springer, 2018. doi:10.1007/978-3-319-96145-3_8.
- [17] Vojtech Havlena, Ondrej LengΓ‘l, and Barbora SmahlΓkovΓ‘. Complementing BΓΌchi automata with ranker. In Sharon Shoham and Yakir Vizel, editors, Computer Aided Verification - 34th International Conference, CAV 2022, Haifa, Israel, August 7-10, 2022, Proceedings, Part II, volume 13372 of Lecture Notes in Computer Science, pages 188β201. Springer, 2022. doi:10.1007/978-3-031-13188-2_10.
- [18] ThomasΒ A. Henzinger, Nicolas Mazzocchi, and N.Β Ege SaraΓ§. Quantitative safety and liveness. In Orna Kupferman and Pawel Sobocinski, editors, Foundations of Software Science and Computation Structures - 26th International Conference, FoSSaCS 2023, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2023, Paris, France, April 22-27, 2023, Proceedings, volume 13992 of Lecture Notes in Computer Science, pages 349β370. Springer, 2023. doi:10.1007/978-3-031-30829-1_17.
- [19] ThomasΒ A. Henzinger and Jan Otop. From model checking to model measuring. In PedroΒ R. DβArgenio and HernΓ‘nΒ C. Melgratti, editors, CONCUR 2013 - Concurrency Theory - 24th International Conference, CONCUR 2013, Buenos Aires, Argentina, August 27-30, 2013. Proceedings, volume 8052 of Lecture Notes in Computer Science, pages 273β287. Springer, 2013. doi:10.1007/978-3-642-40184-8_20.
- [20] Paul Hunter, Arno Pauly, GuillermoΒ A. PΓ©rez, and Jean-FranΓ§ois Raskin. Mean-payoff games with partial observation. Theor. Comput. Sci., 735:82β110, 2018. doi:10.1016/J.TCS.2017.03.038.
- [21] Narendra Karmarkar. A new polynomial-time algorithm for linear programming. Comb., 4(4):373β396, 1984. doi:10.1007/BF02579150.
- [22] RichardΒ M. Karp. A characterization of the minimum cycle mean in a digraph. Discret. Math., 23(3):309β311, 1978. doi:10.1016/0012-365X(78)90011-0.
- [23] Daniel Krob. The equality problem for rational series with multiplicities in the tropical semiring is undecidable. Int. J. Algebra Comput., 4(3):405β426, 1994. doi:10.1142/S0218196794000063.
- [24] Leslie Lamport. Proving the correctness of multiprocess programs. IEEE Trans. Software Eng., 3(2):125β143, 1977. doi:10.1109/TSE.1977.229904.
- [25] Christof LΓΆding and Anton Pirogov. On finitely ambiguous BΓΌchi automata. In Mizuho Hoshi and Shinnosuke Seki, editors, Developments in Language Theory - 22nd International Conference, DLT 2018, Tokyo, Japan, September 10-14, 2018, Proceedings, volume 11088 of Lecture Notes in Computer Science, pages 503β515. Springer, 2018. doi:10.1007/978-3-319-98654-8_41.
- [26] Omid Madani, Steve Hanks, and Anne Condon. On the undecidability of probabilistic planning and related stochastic optimization problems. Artif. Intell., 147(1-2):5β34, 2003. doi:10.1016/S0004-3702(02)00378-8.
- [27] Jakub Michaliszyn and Jan Otop. Non-deterministic weighted automata evaluated over Markov chains. J. Comput. Syst. Sci., 108:118β136, 2020. doi:10.1016/J.JCSS.2019.10.001.
- [28] Shubham Sahai, Pramod Subramanyan, and Rohit Sinha. Verification of quantitative hyperproperties using trace enumeration relations. In ShuvenduΒ K. Lahiri and Chao Wang, editors, Computer Aided Verification - 32nd International Conference, CAV 2020, Los Angeles, CA, USA, July 21-24, 2020, Proceedings, Part I, volume 12224 of Lecture Notes in Computer Science, pages 201β224. Springer, 2020. doi:10.1007/978-3-030-53288-8_11.
- [29] Sven Schewe. BΓΌchi complementation made tight. In Susanne Albers and Jean-Yves Marion, editors, 26th International Symposium on Theoretical Aspects of Computer Science, STACS 2009, February 26-28, 2009, Freiburg, Germany, Proceedings, volumeΒ 3 of LIPIcs, pages 661β672. Schloss Dagstuhl β Leibniz-Zentrum fΓΌr Informatik, Germany, 2009. doi:10.4230/LIPICS.STACS.2009.1854.
- [30] Andreas Weber and Helmut Seidl. On the degree of ambiguity of finite automata. Theor. Comput. Sci., 88(2):325β349, 1991. doi:10.1016/0304-3975(91)90381-B.
- [31] Linpeng Zhang, Noam Zilberstein, BenjaminΒ Lucien Kaminski, and Alexandra Silva. Quantitative weakest hyper pre: Unifying correctness and incorrectness hyperproperties via predicate transformers. CoRR, abs/2404.05097, 2024. doi:10.48550/arXiv.2404.05097.
Appendix A Proofs of Section 7
Lemma 7.1. Let be a (weighted) labeled transition system with states and its initial state. For every state of , there exist infinitely many words with a run from visiting infinitely often iff complies with the pattern parameterized by and given in Figure 2a.
Proof.
We start with the backward implication. Given the state , we assume that complies with the pattern in Figure 2a exhibiting four finite runs of the form , , , . Additionally we have that and . For all , we define the run from over . Since and , we have that and read distinct words for all . In particular, the set of ultimately periodic words with a run visiting infinitely often is infinite.
Next, we prove the forward implication having an infinite set of words admitting some run from the initial state that visits the state infinitely often. Consider a word together with one of its runs that visits infinitely. Let be a finite prefix of for which visits at least times the state while reading , where refers to the number of states of . Assuming that mismatches with all the other words of exclusively over its first letters contradicts . Hence, there exists another word , distinct from , but starting with the finite prefix . Let be a run over that visits infinitely often. Since visits times the state while reading , by the pigeon hole principle, there exists a state such that the pair is visited twice by while reading . Figure 3 displays the two runs and . The finite word refers the factor of corresponding to the synchronized loop, and the finite word stands for the prefix of before . We ensure that by removing inner synchronized loops. We denote by and the synchronized section where and mismatch. In particular, and . Since both and visit infinitely often, we can take and long enough so that leads to . Then, we denote by the continuation of ending in . Additionally, we ensure that . Indeed, any synchronized loop in the factors and appearing before or after the mismatching letter can be removed without changing the reachability of . Moreover, any loop in the factor can be removed as well. Note that are nonempty by construction. By unfolding the synchronized loop, we can assume without loss of generality that all and are nonempty. Hence, all words appearing in Figure 3 are nonempty. From , we define as . This implies that for some . Furthermore, we can assume that , otherwise we lengthen and by pumping the synchronized loop over . In particular for some .
Now we distinguish the following two cases. First, if , then we define , , , and . Second, if , then we define , , , and . Either way, allow to comply with the pattern in Figure 2a.
Lemma A.1.
Consider a QWA with states, , , , , , . Given , we can construct in polynomial time a BΓΌchi automaton such that (i) and (ii) for every word , the automaton admits infinitely many accepting runs over iff admits infinitely many runs of value over .
Proof.
We start by constructing the BΓΌchi automaton that captures the runs visiting infinitely a transition of weight . To do so, we consider two copies of (the transition system of ) such that: (1.i) the states of the first copy are all accepting, (1.ii) firing any transition from the first copy leads to the second copy, (2.i) the states of the second copy are all non-initial and non-accepting, (2.ii) firing a transition from the second copy leads to the first copy if and only if its weight is . Essentially, visits an accepting state only when a transition weighted is fired.
Then, from , we construct the BΓΌchi automaton that captures the runs of value exactly . To do so, we consider three copies of such that: (1.i) the states of the first copy are all non-accepting, (1.ii) firing any transition from the first copy leads nondeterministically to the second or the third copy, (2.i) the states of the second copy are all non-initial and non-accepting, (2.ii) firing a transition from the second copy leads to the first copy if and only if its weight is respectively larger or lower than when or (otherwise it stays in the second copy), (3.i) the states of the third copy are all accepting and non-initial, (3.ii) all transitions weighted more than are removed from the third copy, and the others are unchanged. Essentially, reaches the copy with accepting states (the third one) only once no more transitions dismissing the value can be fired.
Observe that there is a bijection between the accepting runs of and the runs of value in . It follows from the fact that jumps between the copies of deterministically and the nondeterministic choices of in its first copy are unambiguous (in the following sense for : jumping to the second copy and not seeing a weight larger than in and jumping to the third copy and seeing a weight larger than both result in a rejecting run). Note that this does not hold for rejecting runs due to the nondeterminism of . Lemma 7.3. Consider a QWA with states, , , , , , , and initial state . Let if and if . For every and every lasso word , we have that admits infinitely many runs of value in iff complies with the pattern in Figure 2b parameterized by , , , and .
Proof.
We first prove the backward implication. Given a weight and a lasso word , we assume that complies with the pattern given in Figure 2b exhibiting four runs of the form , , and where , , and for some . For all , we define the run in . Since , the run is over and achieves the value thanks to the definition of . As a direct consequence of , we have that for all . In particular, have infinitely many runs of value in .
Next, we prove the forward implication. Given a weight and a lasso word , we assume that has infinitely many runs of value in . Let and be such that .
In the first step, we construct a BΓΌchi automaton that captures the runs over of value in . Thanks to Lemma A.1, we construct the BΓΌchi automaton such that (i) and (ii) for every word , the automaton admits infinitely many accepting runs over iff admits infinitely many runs of value over . Finally, from , we construction the BΓΌchi automaton that captures the runs over of value in . To do so, we consider a deterministic BΓΌchi automaton accepting only and we construct such that . Observe that there is a bijection between the accepting runs of and the runs over of value in . This does not hold for non-accepting runs due to the nondeterminism of .
The second step consists of lifting runs to words and leveraging Lemma 7.1 to get the desired pattern. We thus construct a BΓΌchi automaton from by re-labeling each transition by . Since has infinitely many runs in and , it has infinitely many accepting runs in . By Lemma 7.1, some accepting state of allows to comply with the pattern given in Figure 2a. Consequently there exist such that , , and for some , together with four runs of the form , , , in . Observe that are not over but over the alphabet consisting of the transitions of , called here after. For all finite words we denote the projection of all letters of to , e.g., . We established that admits infinitely many ultimately periodic words of visiting infinitely often, and thus admits infinitely many ultimately periodic runs (over its singleton language ). In particular, the set of ultimately periodic words with a run visiting infinitely often is infinite. However, . It is worth emphasizing that despite we have because .
In the third step, we prove how to ensure . If in the above construction we obtain , called here after, then we can construct to get the desired property as follows. We identified , and in . We recall that Lemma 7.1 ensures and . Since , the mismatch is caused by the states of some letter of . Thus, there are two distinct states of such that , , , in , where , , , and . Let , , , , , and together with the four runs of the form , , , . For all , we define the run over in . Observe that because . In particular, the set of ultimately periodic words with a run visiting infinitely often is infinite. We now prove that new pattern complies with Figure 2b. Since , , and , we have that and . Hence, . Additionally, for some comes as a consequence of for some .
Finally, we decompose into . We identified , , , and where in . Recall that there is a bijection between the accepting runs of and the runs over of value in . By construction of , the accepting run of (which is a word accepted by ) corresponds to a run over of value in . Therefore, the loop corresponds to a loop visiting the weight and other weights of value at most (resp. at least) when (resp. ). To conclude, there exist and such that together with the runs , and the transition . Lemma 7.7. Let be a QLA with , , , , (resp. ), and any language aggregator function. We can construct in PSpace a QLA with and (resp. and ) such that for all .
Proof.
Consider a language automaton where is as in the statement. We show the case , as the case can be solved by duality (Proposition 2.2). Thanks to Proposition 7.5, we can assume that . The proof describes the construction of a QWA such that for every ultimately periodic word , and argue why this equivalence generalizes to all words.
Recall that, by definition (when ), is the smallest weight in such that there is a word with infinitely many runs of value in and at most finitely many runs of value larger than in . Therefore, we can compute as follows: Take a weight in and construct in PTime a BΓΌchi automaton from the transition system , recognizing exactly the set of words with some run of value in . Then, using [25, 15], we can decide in PTime if has an infinite degree of ambiguity, i.e., some word in its language has infinitely many accepting runs (namely, runs of value in ). Let be the set of weights such that has an infinite degree of ambiguity. Then, is the largest such that the automaton is -universal for , which can be computed in PSpace. We can compute similarly when . Now, let be the set of all weights in . By Corollary 7.4, for all , we can construct in PTime a BΓΌchi (if ) or a co-BΓΌchi (if ) automaton recognizing all ultimately periodic words admitting infinitely many runs of value in . From we construct in PTime the QWA such that when and when . The construction consists in changing the transition weight to and to . The QWA is defined by , effectively computable in PTimeΒ [11].
For every ultimately periodic word , the value corresponds to the maximal value such that there exist infinitely many runs of value for in . Let denote the set of values for which admits infinitely many runs in ; equivalently, iff . By construction, we have for each and for each . If , it follows that . Otherwise, if , we have .
Next, we argue that if for every ultimately periodic word , then for every word . We prove the contrapositive. Suppose the existence of a word such that . Clearly, we have and . Using Lemma A.1, we construct a BΓΌchi automaton such that (i) and (ii) for every word , the automaton admits infinitely many accepting runs over iff admits infinitely many runs of value over . Similarly, we construct a BΓΌchi automaton such that (i) and (ii) for every word , the automaton admits infinitely many accepting runs over iff admits infinitely many runs of value over . Thanks toΒ [25], we can construct from an unambiguous BΓΌchi automaton recognizing the same language. The cross product between and yields a BΓΌchi automaton such that (i) and (ii) for every word , the automaton admits infinitely many accepting runs over iff admits infinitely many runs of value over . Observe that and for all we have . ByΒ [30, 25], we can decide whether admits infinitely many accepting runs on some word. Furthermore, it follows fromΒ [30, 25] that if admits infinitely many accepting runs on a word, then it recognizes an ultimately periodic word with infinitely many accepting runs. In this case, admits infinitely many runs of value over , implying that . Otherwise, we have , and since , there exists an ultimately periodic word for which . In either scenario, since , we have . Therefore, we conclude that there is an ultimately periodic word satisfying .
