1 / 23

Languages Generated by Programmed Grammars with Various Graphs

Explore the classification of programmed grammars as graphs and their impact on language generation, including complete, planar, connected, Eulerian, Hamiltonian, bipartite graphs, and more.

abdalla
Download Presentation

Languages Generated by Programmed Grammars with Various Graphs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Languages Generated by Programmed Grammars with Various Graphs Jurgen Dassow, Benedek Nagy, Cristina Bibire, Madalina Barbaiani, Szilard Fazekas, Aidan Delaney, Mihai Ionescu, GuangWu Liu, Atif Lodhi

  2. A programmed grammar is a quadruple G=(N, T, S, P) where: • N, T and S are specified as in a context-free grammar and • P is a finite set of triples r = (p, σ, φ) where p is a context-free production and σ and φ are subsets of P (σ and φ are called the success field and the failure field, respectively). If the failure field of any rule in P is empty we say that G is a programmed grammar without appearance checking. Otherwise G is a programmed grammar with appearance checking.

  3. We will consider another interpretation of the programmed grammars: as graphs. From now on, we will consider only programmed grammars without appearance checking. Let G = (N, T, S, P) be a programmed grammar. We can construct a graph H=(P, E), where P is the set of rules from G and (r, r’) is in E if and only if r’ is one of the rules from the success field of r.

  4. The corresponding graph is:

  5. For a particular class of restricted graphs, one can determine which class of languages can be generated with it. Types of graphs that we had in mind: • Complete graphs • Planar graphs • Connected graphs • Eulerian graphs • Hamiltonian graphs • Bipartite graphs • Ring backbones • Graphs with limited degree ( )

  6. Complete Graphs Theorem The language obtained by a programmed grammar in which the corresponding graph is a complete one is context-free. Proof: We know that the rules in a programmed grammar are all context-free. A complete graph is simply telling us that each rule of the grammar can be followed (in the derivation) by any of the other rules. That reduces the power of the given programmed grammar to an arbitrary context-free grammar.

  7. Planar Graphs Theorem All languages obtained by a programmed grammar can be obtained by a programmed grammar using a planar graph. Proof: Planar graphs are graphs which can be drawn in such a way that their edges do not intersect each other, so our task here is to avoid the intersections without altering the generated language. It suffices to consider a simpler case, with only four vertices. We will apply this algorithm to all the other intersections from the graph.

  8. A → u B → v

  9. A → u B → v

  10. A → u X → λ B → v

  11. A → u B → BX X → λ A → AX B → v

  12. A → u B → BXA1 A2→ λ X → λ A → AXA2 A1→ λ B → v

  13. Connected Graphs Theorem Any language obtained by a programmed grammar can be obtained by a programmed grammar with a connected graph. Proof: Consider the programmed grammar associated with the graph . We define: • - the union of all maximally connected subgraphs of containing at least one of the vertices from the set .

  14. We introduce a new terminal symbol , which will be the new start symbol for our grammar and we define . The grammar is a programmed grammar in which the associated graph is connected, and it generates the same language as

  15. Eulerian Graphs Theorem Any language obtained by a programmed grammar can be obtained by a programmed grammar with an eulerian graph. Proof: Let be a programmed grammar and the associated graph. We denote the vertices by . A directed connected graph is eulerian if and only if for every vertex, the in-degree equals the out-degree. We will extend our graph to a new one by introducing the vertices where . The new non-terminals are meant to block the undesired derivations. Our goal is to connect the old nodes to the new one such that the in-degree for each node equals the out-degree.

  16. Put the new edges in the following way: • For each connect the node to the node if and only if there was not an edge from to . In this way all vertices will have out-degree . • For each connect the node to the node if and only if there was not an edge from to . In this way all vertices will have in-degree . In this way in our new graph, for all nodes , we have that the in-degree equals the out-degree. • All we have to do now is to make sure that this property will hold also for each .

  17. The following property is true for any directed graph: But we know that: From and we obtain: Connect any node which has higher in-degree than out-degree to any node having higher out-degree than in-degree. In this way the number of in-degrees and out-degrees will increase both, and after finitely many steps (the difference for any node is not more than n) each node will have equal number of in- and out-degree.

  18. Hamiltonian Graphs Theorem Any language obtained by a programmed grammar can be obtained by a programmed grammar with an Hamiltonian graph. Proof: Given a programmed grammar , let ( is the number of rules in ) be new non-terminal symbols which were not in . Let . We introduce new nodes: and we connect each node to the node

  19. Other Results • Any language obtained by a programmed grammar can be obtained by a programmed grammar with a bipartite graph. • Any language obtained by a programmed grammar can be obtained by a programmed grammar with the graph having the nodes’ degree at most 3.

  20. Conclusions and Further Research Combining our constructive proofs one can generate any language obtained by a programmed grammar without appearance checking with a connected planar graph having nodes degree at most 3. There are some related open questions, for example what is the language family generated by programmed grammars such a way that there is a word which is generated by a Hamiltonian or Eulerian trail/cycle.

  21. Thank you!

More Related