A note on the class of languages generated by F-systems over regular languages
aa r X i v : . [ c s . F L ] J u l A note on the class of languages generated byF-systems over regular languages
Jorge C. Lucero ∗ August , Abstract
An F-system is a computational model that performs a folding operation onstrings of a given language, following directions coded on strings of another givenlanguage. This note considers the case in which both given languages are regular,and it shows that such F-system generates linear context-free languages. Thedemonstration is based on constructing a one-turn pushdown automaton for thegenerated language. Introduction
A folding operation on strings of formal languages has been proposed as a simplifiedcomputational model of folding processes in nature [ ]. The operation reorders sym-bols of a given string according to directions coded in another one. Using the foldingoperation, a folding system (F-system) of the form Φ = ( L , L ) may be defined, where L (the core language) is the language that contains the strings to be folded, and L (the folding procedure language) is the language that contains strings with the foldingdirections.The computing power of F-systems has been investigated by comparison with stan-dard language classes from the Chomsky hierarchy (i.e., regular, context-free, context-sensitive, recursive and recursively enumerable languages), and necessary conditionsfor a language to belong to classes generated when the core and the folding procedurelanguages are regular or context-free were proposed in the form of pumping lemmas[ ]. The present note considers the case in which both the core and the folding proce-dure languages are regular. It has been shown that the class of languages generated bysuch F-systems surpasses and strictly contains the regular languages. Further, it hasbeen claimed, without demonstration, that the class is a subset of the class of context-free languages [ ]. Here, the claim will be confirmed by showing that the F-systemclass is a subset of the class of the linear languages (which, in turn, is strictly containedwithin the class of context-free languages). ∗ Dept. Computer Science, University of Brasília, Brazil. E-mail: [email protected] . C. Lucero: Pumping lemmas for F-systems Definitions
Let us first review the definitions of folding operations and systems.
Definition . Let Σ be an alphabet, Γ = { u , d } , and f : Σ ∗ × Σ × Γ → Σ ∗ a function suchthat f ( w , a , b ) = (cid:12) aw , if b = u , wa , if b = d . ( )Then, the folding function h : Σ ∗ × Γ ∗ → Σ ∗ is a partial function defined by h ( w , v ) = f ( f ( . . . f ( ε , a , b ) . . . , a k − , b k − ) , a k , b k ) , if | w | = | v | > 0ε , if | w | = | v | = ,undefined, if | w | = | v | . ( )where w = a a . . . a k , v = b b . . . b k , a i ∈ Σ , with b i ∈ Γ for i = , , · · · , k , and ε isthe empty string.The computation of h ( w , v ) may be regarded as a folding operation that rearrangesthe symbols of w . Strings over Γ describe how each folding must be performed, wheresymbol u represents a “folding up” action and symbol d represents a “folding down”action. The folded string may be written as h ( w , v ) = w R u w d , ( )where w u is the sequence of symbols in w that are folded up, R denotes the reverseorder operator, and w d is the sequence of symbols in w that are folded down (see [ ]for examples and an illustration of the folding mechanism). Definition . A folding system (F-system) is a pair Φ = ( L , L ) , where L ⊆ Σ ∗ is thecore language, and L ⊆ Γ ∗ is the folding procedure language. The language of Φ is L ( Φ ) = { h ( w , v ) | w ∈ L , v ∈ L , | w | = | v |} . ( ) Definition . The class of all languages generated by F-systems with core languagesof a class C and folding procedure languages of a class H is F ( C , H ) = { L ( Φ ) | Φ = ( L , L ) , L ∈ C , L ∈ H} . ( )In addition, finite deterministic automata (FDA), context-free grammars (CFG),and pushdown automata (PDA) are defined as in [ ].Let us also recall: Definition . Let a grammar G = ( V , Σ , R , S ) , where V is the set of variables, Σ is the setof terminals, R is the set of production rules, and S is the start variable. The grammar G is called linear if every production rule is of the form A → uBv or A → u , where u , v ∈ Σ ∗ and A , B ∈ V . A language is linear if it is generated by a linear grammar [ ]. . C. Lucero: Pumping lemmas for F-systems Folding over regular languages
We consider languages of the class F ( REG , REG ) , where REG is the class of regularlanguages, and show that F ( REG , REG ) ⊆ LIN , where
LIN is the class of linear lan-guages.
Theorem . The class of languages generated by F-systems with regular core and procedurelanguages is a subset of the class of linear languages.Proof.
Consider an F-system Φ ( L , L ) with L , L ∈ REG . Then, there are FDAs M =( Q , Σ , δ , q , F ) and M = ( Q , Γ , δ , q , F ) that recognize L and L , respectively,where Q i is the set of states, δ i : Q i × Σ → Q i is the transition function, q i ∈ Q i is thestart state, and F i ⊆ Q i is the set of accept states, for i = , .We may construct a nondeterministic PDA that recognizes L ( Φ ) as follows. Givenan input string s = h ( w , v ) (see Eq. ), the PDA nondeterministically guesses theprefix w R u in s and pushes it into the stack. The remaining unread part of s is then w d .Next, the PDA simulates M and M simultaneously to determine a reordering of thesymbols of w u and w d (by reading from the input or popping from the stack), so as toobtain a string w ∈ L , while at the same time checking if there is a valid string v ∈ L that supports such reordering. For each symbol read in the input, there must be anassociated d symbol in v , and for each symbol popped from the stack, there must bean associated u symbol in v .Thus, the PDA is defined as M = ( Q , Σ , Π , δ , q , F ) , where: • Q = { q , q push , q accept } ∪ ( Q × Q ) is the set of states, • Σ is the input alphabet (equal to L ’s alphabet), • Π = Σ ∪ { $ } is the stack alphabet, where $ / ∈ Σ is a marker for the end of thestack, • q is the start state, • F = { q accept } is the set of accept states, • δ : Q × Σ ε × Π ε → P ( Q × Π ε ) is the transition function, where Σ ε = Σ ∪ { ε } , Π ε = Π ∪ { ε } , ε is the empty string, P denotes the power set, and – δ ( q , ε , ε ) = { ( q push , $ ) } , – δ ( q push , a , ε ) = { ( q push , a ) } for all a ∈ Σ , – δ ( q push , ε , ε ) = { ( q , q ) , ε } , – δ (( q i , q j ) , a , ε ) = { ( δ ( q i , a ) , δ ( q j , d )) , ε } for all a ∈ Σ , – δ (( q i , q j ) , ε , a ) = { ( δ ( q i , a ) , δ ( q j , u )) , ε } for all a ∈ Σ , – δ (( q i , q j ) , ε , $ ) = { q accept , ε } for all ( q i , q j ) ∈ F × F , – δ ( q , a , b ) = ∅ for any other case. . C. Lucero: Pumping lemmas for F-systems q q q ba a ba , b M : q a q b q c du u du , d M : q q push ( q , q a )( q , q b ) q accept ε , ε → $ ε , $ → ε a , ε → ab , ε → b ε , ε → ε b , ε → ε ε , a → εM : Figure : PDA M (bottom) for L ( Φ ( L , L )) = { a n b n | n > } , where L = ( ba ) ∗ , and L = ( du ) ∗ .The PDA was constructed from the FDAs M (top left) and M (top right) for L and L ,respectively. The label a , b → c over a transition arrow means that the PDA reads a fromthe input, pops b from the stack and then pushes c into it. For clarity of the PDA’s diagram,unreachable states from the start state (i.e., states with contain q or q c ), as well as states fromwhich the accept state is unreachable, have been omitted. In all transitions that end in state q push , symbols are pushed into the stack. Oncethe PDA leaves q push , all transitions either pop a symbol from the stack or leave itunchanged. Thus, M is a so called one-turn PDA (i.e., in any computation, the stacknever increases after it has started to decrease) and therefore L ( M ) is a linear language[ ]. Corollary . The class of languages generated by F-systems with regular core and procedurelanguages is a strict subset of the class of context-free languages.Proof.
The corollary follows from the fact that
LIN ⊂ CFL , where
CFL is the class ofcontext-free languages.
Example . Let Φ = (( ba ) ∗ , ( du ) ∗ ) . Fig. shows the PDA M obtained following theabove construction. It is easy to check that L ( M ) = { a n b n | n > } = L ( Φ ) , which isnon-regular and linear context-free. . C. Lucero: Pumping lemmas for F-systems Final remarks
The class F ( REG , REG ) is intermediate between the regular and linear languages, with REG ⊂ F ( REG , REG ) ⊆ LIN ⊂ CFL . A problem that remains open is whether all linearlanguages can be obtained by folding over regular languages or not.A previous work [ ] introduced a weak pumping lemma stating conditions for alanguage to belong to F ( REG , REG ) . However, the present result implies that classmust also satisfy the pumping lemma for linear languages [ ], which has strongerconditions than the previous lemma. References [ ] J.-M. Autebert, J. Berstel, and L. Boasson. Context-free languages and pushdownautomata. In A. Rozenberg and A. Salomaa, editors, Handbook of Formal Languages ,Vol. : Word, Language, Grammar, pp. – . Springer Berlin Heidelberg, .[ ] S. Ginsburg and E. H. Spanier. Finite-turn pushdown automata. SIAM Journal onControl , : – , .[ ] J. C. Lucero. Pumping lemmas for classes of languages gen-erated by folding systems. Natural Computing , . Online at https://doi.org/10.1007/s11047-019-09771-5 .[ ] D. Sburlan. Computing by folding. International Journal of Computers Communica-tions & Control , : – , .[ ] M. Sipser. Introduction to the Theory of Computation . Cengage Learning, Boston, MA, rd edition, ..