Aperiodicity, Star-freeness, and First-order Logic Definability of Operator Precedence Languages

Dino Mandrioli,Matteo Pradella,Stefano Crespi Reghizzi
DOI: https://doi.org/10.46298/lmcs-19%284%3A12%292023
2023-11-21
Abstract:A classic result in formal language theory is the equivalence among non-counting, or aperiodic, regular languages, and languages defined through star-free regular expressions, or first-order logic. Past attempts to extend this result beyond the realm of regular languages have met with difficulties: for instance it is known that star-free tree languages may violate the non-counting property and there are aperiodic tree languages that cannot be defined through first-order logic. We extend such classic equivalence results to a significant family of deterministic context-free languages, the operator-precedence languages (OPL), which strictly includes the widely investigated visibly pushdown, alias input-driven, family and other structured context-free languages. The OP model originated in the '60s for defining programming languages and is still used by high performance compilers; its rich algebraic properties have been investigated initially in connection with grammar learning and recently completed with further closure properties and with monadic second order logic definition. We introduce an extension of regular expressions, the OP-expressions (OPE) which define the OPLs and, under the star-free hypothesis, define first-order definable and non-counting OPLs. Then, we prove, through a fairly articulated grammar transformation, that aperiodic OPLs are first-order definable. Thus, the classic equivalence of star-freeness, aperiodicity, and first-order definability is established for the large and powerful class of OPLs. We argue that the same approach can be exploited to obtain analogous results for visibly pushdown languages too.
Formal Languages and Automata Theory,Logic in Computer Science
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to extend the equivalent properties of non - countability (or aperiodicity), star - freedom and first - order logic (FO) definability in the classical formal language theory, making them applicable to a broader category of languages - namely Operator Precedence Languages (OPLs). Specifically, the paper explores how to extend these properties from Regular Languages to an important subset of Deterministic Context - Free Languages (DCFLs), that is, Operator Precedence Languages. This includes proving that for OPLs, non - countability, star - freedom and first - order logic definability are equivalent. This result is of great significance for understanding and processing programming languages and other structured context - free languages, as these languages are very common in practical applications. The main contribution of the paper lies in introducing an extended form of regular expressions, called Operator Precedence Expressions (OPE), to define OPLs, and under the star - free assumption, defines first - order logic definable and non - counting OPLs. Through complex syntactic transformations, the paper proves that aperiodic OPLs are first - order logic definable. Therefore, the equivalent properties in the classical formal language theory - star - freedom, aperiodicity and first - order logic definability - are successfully generalized to the large and powerful language category of OPLs. In addition, the paper also points out that the same method can be used to obtain similar results for Visibly Pushdown Languages (VPLs).