Aperiodicity, Star-freeness, and First-order Definability of Structured Context-Free Languages (original) (raw)
Related papers
Aperiodicity, Star-freeness, and First-order Logic Definability of Operator Precedence Languages
Logical Methods in Computer Science, 2023
A classic result in formal language theory is the equivalence among noncounting, 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 contextfree 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.
Algebraic properties of structured context-free languages: old approaches and novel developments
Eprint Arxiv 0907 2130, 2009
The historical research line on the algebraic properties of structured CF languages initiated by McNaughton's Parenthesis Languages has recently attracted much renewed interest with the Balanced Languages, the Visibly Pushdown Automata languages (VPDA), the Synchronized Languages, and the Height-deterministic ones. Such families preserve to a varying degree the basic algebraic properties of Regular languages: boolean closure, closure under reversal, under concatenation, and Kleene star. We prove that the VPDA family is strictly contained within the Floyd Grammars (FG) family historically known as operator precedence. Languages over the same precedence matrix are known to be closed under boolean operations, and are recognized by a machine whose pop or push operations on the stack are purely determined by terminal letters. We characterize VPDA's as the subclass of FG having a peculiarly structured set of precedence relations, and balanced grammars as a further restricted case. The non-counting invariance property of FG has a direct implication for VPDA too.
Operator Precedence Languages: Their Automata-Theoretic and Logic Characterization
SIAM Journal on Computing, 2015
Operator precedence languages were introduced half a century ago by Robert Floyd to support deterministic and efficient parsing of context-free languages. Recently, we renewed our interest in this class of languages thanks to a few distinguishing properties that make them attractive for exploiting various modern technologies. Precisely, their local parsability enables parallel and incremental parsing, whereas their closure properties make them amenable for automatic verification techniques, including model checking. In this paper we provide a fairly complete theory of this class of languages: we introduce a class of automata with the same recognizing power as the generative power of their grammars; we provide a characterization of their sentences in terms of monadic second order logic as it has been done in previous literature for more restricted language classes such as regular, parenthesis, and input-driven ones; we investigate preserved and lost properties when extending the language sentences from finite length to infinite length (ω-languages). As a result, we obtain a class of languages that enjoys many nice properties of regular languages (closure and decidability properties, logic characterization) but is considerably larger than other families-typically parenthesis and input-driven ones-with the same properties, covering "almost" all deterministic languages. 1
On the complexity of the syntax of tree languages
Lecture Notes in Computer Science, 2009
The syntactic complexity of a tree language is defined according to the number of the distinct syntactic classes of all trees with a fixed yield length. This leads to a syntactic classification of tree languages and it turns out that the class of recognizable tree languages is properly contained in that of languages with bounded complexity. A refined syntactic complexity notion is also presented, appropriate exclusively for the class of recognizable tree languages. A tree language is recognizable if and only if it has finitely many refined syntactic classes. The constructive complexity of a tree automaton is also investigated and we prove that for any reachable tree automaton it is equal with the refined syntactic complexity of its behavior. © 2009 Springer.
Word- and Tree-based Temporal Logics for Operator Precedence Languages
Italian Conference on Theoretical Computer Science, 2019
In recent years we resumed the study of operator precedence languages (OPL), inspired by their algebraic and parallel parsability properties. OPL significantly generalize visibly pushdown languages in expressive power. We have shown that OPL enjoy a characterization in terms of monadic second order logic in the style of the traditional one for regular languages. We are investigating a characterization of a subclass of OPL in terms of first-order logic, retracing the literature on regular languages. The algebraic properties of OPL naturally suggested a further step, devoted to devising model checking techniques for them. In this communication we briefly report on early steps already moved in this direction and we outline a roadmap for next developments. In doing so, we plan to exploit a distinguishing feature of OPL which allows to manage them both as string languages and as tree-structured languages, thus joining two traditional but different approaches to the study of context-free languages. We expect to achieve a temporal logic-style language that is well suited to express properties of systems in application fields wider than those based on regular languages. We anticipate to obtain model-checking procedures with comparable performances.
First-Order Logic Definability of Free Languages
Lecture Notes in Computer Science, 2015
Operator Precedence Grammars (OPGs) define a deterministic class of context-free languages, which extend input-driven languages and still enjoy many properties: they are closed w.r.t. Boolean operations, concatenation and Kleene star; the emptiness problem is decidable; they are recognized by a suitable model of pushdown automaton; they can be characterized in terms of a monadic second-order logic. Also, they admit efficient parallel parsing. In this paper we introduce a subclass of OPGs, namely Free Grammars (FrGs); we prove some of its basic properties, and that, for each such grammar G, a firstorder logic formula ψ can effectively be built so that L(G) is the set of all and only strings satisfying ψ. FrGs were originally introduced for grammatical inference of programming languages. Our result can naturally boost their applicability; to this end, a tool is made freely available for the semiautomatic construction of FrGs.
Temporal Logic and Model Checking for Operator Precedence Languages
Electronic Proceedings in Theoretical Computer Science
In the last decades much research effort has been devoted to extending the success of model checking from the traditional field of finite state machines and various versions of temporal logics to suitable subclasses of context-free languages and appropriate extensions of temporal logics. To the best of our knowledge such attempts only covered structured languages, i.e. languages whose structure is immediately "visible" in their sentences, such as tree-languages or visibly pushdown ones. In this paper we present a new temporal logic suitable to express and automatically verify properties of operator precedence languages. This "historical" language family has been recently proved to enjoy fundamental algebraic and logic properties that make it suitable for model checking applications yet breaking the barrier of visible-structure languages (in fact the original motivation of its inventor Floyd was just to support efficient parsing, i.e. building the "hidden syntax tree" of language sentences). We prove that our logic is at least as expressive as analogous logics defined for visible pushdown languages yet covering a much more powerful family; we design a procedure that, given a formula in our logic builds an automaton recognizing the sentences satisfying the formula, whose size is at most exponential in the length of the formula.
Linear Temporal Logics for Structured Context-Free Languages
2020
The need to extend traditional temporal logics to express and prove properties typical of stack-based formalisms led, among others, to CaRet and NWTL on Visibly Pushdown Languages (VPL). Such formalisms support, e.g., model checking of procedural programs and other context-free languages (CFL). To further and significantly extend their expressive power, we recently introduced the logic OPTL, based on Operator Precedence Languages (OPL) which cover a much wider subclass of CFL. In this communication we survey the latest developments of our work. We introduced a novel temporal logic, POTL, that redefines OPTL to be First-Order complete. Furthermore, POTL’s semantics is better connected to the typical treestructure of CFL while retaining the ability to reason about linear time. Besides the theoretical advancements, we are also moving steps toward the implementation of POTL model checking.
A First-Order Complete Temporal Logic for Structured Context-Free Languages
2021
The problem of model checking procedural programs has fostered much research towards the definition of temporal logics for reasoning on context-free structures. The most notable of such results are temporal logics on Nested Words, such as CaRet and NWTL. Recently, the logic OPTL was introduced, based on the class of Operator Precedence Languages (OPLs), more powerful than Nested Words. We define the new OPL-based logic POTL and prove its FO-completeness. POTL improves on NWTL by enabling the formulation of requirements involving pre/post-conditions, stack inspection, and others in the presence of exception-like constructs. It improves on OPTL too, which instead we show not to be FO-complete; it also allows to express more easily stack inspection and function-local properties. In a companion paper we report a model checking procedure for POTL and experimental results based on a prototype tool developed therefor. For completeness a short summary of this complementary result is provide...