Elsevier

Theoretical Computer Science

Volume 862, 16 March 2021, Pages 119-129
Theoretical Computer Science

Remarks on external contextual grammars with selection

https://doi.org/10.1016/j.tcs.2020.07.028Get rights and content

Abstract

In an external contextual grammar with selection, contexts are associated with selection languages, and the context (u,v) can be wrapped around a word w if and only if w belongs to the selection language associated with (u,v). In the papers [1], [3], [4], and [6], some hierarchies are presented if selection languages are taken from subregular language families, defined by automata-theoretic and combinatorial properties, codes, and ideals. In this paper we merge and complete the hierarchies.

Introduction

In 1969, contextual grammars and languages were introduced by Solomon Marcus in [17] in order to model natural languages. Since that time this type of grammars was studied intensively. The first book [19] on contextual grammars and languages appeared in 1982 and was written by Gheorghe Păun. Summaries of results can be found in the monograph [20] and the surveys [11] and [18] in the Handbook of Formal Languages ([22]).

The simplest type of contextual grammar is that with the external mode of derivation. It is given by a finite set of axioms and a finite set of pairs of words, called contexts; a derivation step is performed from a word x to the word uxv if (u,v) is a context; the generated language consists of all words which can be obtained from the axioms by iterated wrappings of contexts.

It is very obvious that this simple model does not reflect enough features. Therefore Marcus defined selective contextual grammars where, with a word x, a set φ(x) of contexts is associated and the context (u,v) can only be wrapped around x, if (u,v)φ(x). This is equivalent to requiring that a given context (u,v) can only be wrapped around the words of the set R(u,v) which consists of all words x such that (u,v)φ(x). Such sets R(u,v) are called selection languages. In [15], Istrail started the investigation of the special case, where the selection languages belong to some level of the Chomsky hierarchy.

Obviously, in order to know which contexts can be wrapped around a word x, one has to determine the selection languages which contain x. Thus it is natural to require that the membership problem for the sets R(u,v) is effectively solvable. If one restricts to regular languages in the approach by Istrail, one has a membership problem which is solvable in linear time.

In some practical cases, only some special regular languages reflect/describe the desired circumstances. Thus it is an interesting question how the generative power is decreased if one considers families of special regular languages. In [1] this problem was studied for the families of monoidal, combinational, definite, nilpotent, commutative regular, and suffix-closed regular languages; and it was continued in [6], [14], [3], and [4] for circular regular, ordered, union-free, special definite, strongly locally testable, and star-free languages, ideals, some codes, and languages which are obtained by restrictions to their descriptional complexity.

However, since each of the papers only considered some of the mentioned selection languages, it contains only hierarchies concerning these selection languages. In this paper, we continue the investigation and combine and complete some of the existing hierarchies.

We mention that the use of subregular language families is also studied for other types of language generating devices where the applicability of rules depends on some regular set as, e.g., for regularly controlled grammars, conditional grammars, tree controlled grammars, conditional Lindenmayer systems, and systems of evolutionary processors. For details we refer to the survey article [2] and the papers [3], [9], [8], [5], [10], and the references given in these papers.

Section snippets

Definitions

We assume that the reader is familiar with the basic concepts of the theory of formal languages. In this section we only recall some notations and some definitions such that a reader can understand the results and follow the argumentations. For more details, we refer to [22].

For an alphabet V, i.e., V is a finite non-empty set, the set of all words and all non-empty words over V are denoted by V and V+, respectively. The empty word is denoted by λ. For a language L, let alph(L) be the minimal

Some lemmas on special languages

In this section, we prove that certain languages belong to some family EC(X), but do not belong to some other family EC(Y). These facts are then used to prove incomparabilities and strictness of inclusions of language families.

Lemma 3

Let V be an alphabet. Then V+EC(MON), V+EC(COMB) and V+EC(C).

Proof

i) The external contextual grammar (V,(V,{(λ,a)|aV}),V) generates V+. Since its selection language V is in MON, we get V+EC(MON). In order to prove V+EC(COMB) we replace the selection language of G by

The hierarchy

We start with an inclusion.

Lemma 11

We have EC(NIL)EC(rId).

Proof

By [1], Lemma 4.3, for any language LEC(NIL), LV, there are a natural number r, a set C of contexts, and a finite set BV such that the external contextual grammar G=(V,(VVr,C),B) generates L. Because VVr=VrV, any LEC(NIL) can be generated by an external contextual grammar whose selection languages are right ideals. 

For lId, we have a little stronger result.

Lemma 12

We have EC(DEF)EC(lId).

Proof

Let LEC(DEF). Then L=L(G) for some external

Unary languages

In the above proofs, the witnesses were given over alphabets with two or three letters. This is also true for the languages considered in the papers [1], [6], and [4]. Thus the hierarchy presented in Fig. 3 also holds for languages over an alphabet with at least three letters.

One of the unknown referees mentioned that Lemma 5, Lemma 6, Lemma 7, Lemma 9 also hold for binary languages. To see this, we replace each a by aba, each b by abba, and each c by abbba. Furthermore, this encoding also

Conclusion

In this paper we have shown the set-theoretic relations between the families EC(X) with XGG. We have obtained a complete picture.

However, there are investigations of some further subregular families such as strictly locally testable, reverse definite, and ordered languages. There are some relations of these families with families EC(X), XG, but it remains to find the relations with families EC(Y), where YG.

Besides the external derivation mode considered in this paper, there is also an

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgements

I thank the anonymous referees for their suggestions which led to an improvement of the paper.

References (24)

  • J. Dassow et al.

    On external contextual grammars with subregular selection languages

    Theor. Comput. Sci.

    (2012)
  • A. Gill et al.

    Multiple-entry finite automata

    J. Comput. Syst. Sci.

    (1974)
  • J. Dassow

    Contextual grammars with subregular choice

    Fundam. Inform.

    (2005)
  • J. Dassow

    Subregular restrictions for some language generating devices

  • J. Dassow

    Contextual languages strictly locally testable and star free selection languages

    An. Univ. Bucur.

    (2015)
  • J. Dassow

    Grammars with control by ideals and codes

    J. Autom. Lang. Comb.

    (2018)
  • J. Dassow

    Lindenmayer systems with control by ideals and codes

    J. Autom. Lang. Comb.

    (2020)
  • J. Dassow et al.

    On subregular selection languages in internal contextual grammars

    J. Autom. Lang. Comb.

    (2012)
  • J. Dassow et al.

    Conditional Lindenmayer systems with subregular conditions: the extended case

    RAIRO Theor. Inform. Appl.

    (2014)
  • J. Dassow et al.

    Generative capacity of subregularly tree controlled grammars

    Int. J. Found. Comput. Sci.

    (2010)
  • J. Dassow et al.

    Networks with evolutionary processors and ideals and codes as filters

    Int. J. Found. Comput. Sci.

    (2020)
  • A. Ehrenfeucht, Gh. Păun, G. Rozenberg, Contextual grammars and formal languages, in: [22], vol. II, pp....
  • View full text