Regular Functions, Cost Register Automata, and Generalized Min-Cost Problems

Rajeev Alur, Loris D'Antoni, Jyotirmoy V. Deshmukh, Mukund Raghothaman, Yifei YuanarXiv 2011 · OpenReview

Abstract

Motivated by the successful application of the theory of regular languages to formal verification of finite-state systems, there is a renewed interest in developing a theory of analyzable functions from strings to numerical values that can provide a foundation for analyzing quantitative properties of finite-state systems. In this paper, we propose a deterministic model for associating costs with strings that is parameterized by operations of interest (such as addition, scaling, and $\min$), a notion of regularity that provides a yardstick to measure expressiveness, and study decision problems and theoretical properties of resulting classes of cost functions. Our definition of regularity relies on the theory of string-to-tree transducers, and allows associating costs with events that are conditional upon regular properties of future events. Our model of cost register automata allows computation of regular functions using multiple "write-only" registers whose values can be combined using the allowed set of operations. We show that classical shortest-path algorithms as well as algorithms designed for computing discounted costs, can be adopted for solving the min-cost problems for the more general classes of functions specified in our model. Cost register automata with $\min$ and increment give a deterministic model that is equivalent to weighted automata, an extensively studied nondeterministic model, and this connection results in new insights and new open problems.

Introduction

In formal verification, while we excel at checking qualitative properties (whether a system can perform an action), analyzing quantitative properties—such as fuel consumption, time, or monetary cost—remains a challenge. Traditionally, Weighted Automata (WA) have been the standard for such quantitative analysis. However, WA suffer from two major drawbacks: they are generally not determinizable, and they are restricted to rigid semiring operations (like plus and times), making it difficult to handle "speculative" costs where current costs might be discounted based on future events.

This paper introduces Cost Register Automata (CRA), a deterministic model designed to define and compute "regular" functions from strings to numbers. By combining finite-state control with a set of registers, CRA provides a robust framework that generalizes weighted automata and enables efficient solutions for complex min-cost problems.

The Cost Register Automata Model

A CRA is a deterministic machine that reads an input string and maintains a set of registers. Unlike general register machines, CRA registers are "write-only": the machine can update them (e.g., $x := y + c$), but it cannot branch its control flow based on a register's value. This restriction is vital for maintaining decidability.

Figure 1: Comparison of a standard CRA (M1) and a copyless CRA with min (M2).

Key features of the model include:

  • Copyless Restriction: To prevent costs from growing exponentially and maintain "regularity," the authors often employ a "single-use" restriction where each register appears at most once on the right-hand side of an update.
  • Regularity via Tree Transducers: Regular functions are defined by borrowing from the theory of streaming string-to-tree transducers. A function is regular if it can be represented as a composition of a regular transformation into a mathematical term and the subsequent evaluation of that term.
  • Regular Look-Ahead: The model can make decisions based on whether the remaining part of the string belongs to a specific regular language, allowing for costs that depend on future events.

Key Theoretical Insights

One of the most significant findings is that while Weighted Automata are not determinizable in the classical sense, they are equivalent to deterministic CRAs when multiple registers are permitted. These multiple registers allow the machine to track "alternative futures" simultaneously—for instance, tracking one cost assuming a future discount and another assuming none.

Furthermore, by incorporating regular look-ahead, regular cost functions exhibit a symmetry of time, remaining closed under string reversal. This ensures the model treats the "past" and "future" of a string with mathematical consistency.

Results and Complexity

The paper establishes that for any commutative monoid, the class of regular functions is precisely what copyless CRAs can compute. Crucially, the "min-cost" problem—finding the string that results in the lowest value—is solvable in polynomial time (PTIME) for several complex models, including those involving discounting.

Figure 2: Examples of CRAs over different operation sets, illustrating min-plus (M3) and scaling (M4) operations.

Additionally, for CRAs using only addition, checking the equivalence of two machines is solvable in PTIME using linear algebra. The authors also establish a clear hierarchy of models based on restrictions (copyless vs. copyful) and available operations (addition vs. min-plus).

Conclusion and Future Work

While CRA provides a powerful new lens for quantitative verification, several challenges remain. The equivalence problem for CRAs over the "tropical semiring" (min and addition) is not yet fully resolved, though it is conjectured to be decidable in the copyless case. Future research will focus on extending the model to infinite strings (Büchi-style) for long-running systems, developing efficient approximation algorithms for NP-hard global discounting problems, and translating these theoretical foundations into practical software verification tools.

Summary updated

Abstract

Motivated by the successful application of the theory of regular languages to formal verification of finite-state systems, there is a renewed interest in developing a theory of analyzable functions from strings to numerical values that can provide a foundation for analyzing {\em quantitative} properties of finite-state systems. In this paper, we propose a deterministic model for associating costs with strings that is parameterized by operations of interest (such as addition, scaling, and $\min$), a notion of {\em regularity} that provides a yardstick to measure expressiveness, and study decision problems and theoretical properties of resulting classes of cost functions. Our definition of regularity relies on the theory of string-to-tree transducers, and allows associating costs with events that are conditional upon regular properties of future events. Our model of {\em cost register automata} allows computation of regular functions using multiple "write-only" registers whose values can be combined using the allowed set of operations. We show that classical shortest-path algorithms as well as algorithms designed for computing {\em discounted costs}, can be adopted for solving the min-cost problems for the more general classes of functions specified in our model. Cost register automata with $\min$ and increment give a deterministic model that is equivalent to {\em weighted automata}, an extensively studied nondeterministic model, and this connection results in new insights and new open problems.
BibTeX
@misc{alur2011regular,
  author = {Rajeev Alur and Loris D'Antoni and Jyotirmoy V. Deshmukh and Mukund Raghothaman and Yifei Yuan},
  title = {{Regular Functions, Cost Register Automata, and Generalized Min-Cost Problems}},
  year = {2011},
  eprint = {1111.0670},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1111.0670},
}
Figure