While monadic second-order logic is a prominent logic for specifying languages of finite words, it lacks the power to compute quantitative properties, e.g. to count. An automata model capable of computing such properties are weighted...
moreWhile monadic second-order logic is a prominent logic for specifying languages of finite words, it lacks the power to compute quantitative properties, e.g. to count. An automata model capable of computing such properties are weighted automata, but logics equivalent to these automata have only recently emerged. We propose a new framework for adding quantitative properties to logics specifying Boolean properties of words. We use this to define Quantitative Monadic Second-Order Logic (QMSO). In this way we obtain a simple logic which is equally expressive to weighted automata. We analyse its evaluation complexity, both data and combined complexity, and show completeness results for combined complexity. We further refine the analysis of this logic and obtain fragments that characterise exactly subclasses of weighted automata defined by the level of ambiguity allowed in the automata. In this way, we define a quantitative logic which has good decidability properties while being resonably expressive and enjoying a simple syntactical definition. I. INTRODUCTION Using logics as specification languages for properties of finite and infinite words or trees has a long history in computer science. Of particular importance in this context is Monadic Second-Order Logic (MSO), the extension of first-order logic by quantification over sets of positions in the input word (see e.g. [23], [10]). The prominence of MSO as logic over words has many causes: It is a very expressive and yet simple logic in which many properties can be expressed very naturally. In fact, Büchi's classical theorem [6] states that a language is recognisable by a finite state automaton if, and only if, it is definable in MSO. Hence, MSO can define precisely the regular languages and provides an elegant specification mechanism for regular properties. Furthermore , the proof of the theorem is algorithmic which implies that MSO formulas can effectively be compiled into finite automata which can then be run in linear time on any input word. Finally, MSO has very good decidability properties and standard problems such as satisfiability and therefore equivalence and containment of formulas are decidable over finite words. While MSO is an elegant and highly successful mechanism for specifying word languages, there are many ap