Jump to content

Graph-structured stack

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Borneq (talk | contribs) at 21:42, 12 March 2017 (New images - stack grows with intuition to right; +root node). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer science, a graph-structured stack is a directed acyclic graph where each directed path represents a stack. The graph-structured stack is an essential part of Tomita's algorithm, where it replaces the usual stack of a pushdown automaton. This allows the algorithm to encode the nondeterministic choices in parsing an ambiguous grammar, sometimes with greater efficiency.

In the following diagram, there are four stacks: {7,3,1,0}, {7,4,1,0}, {7,5,2,0}, and {8,6,2,0}.

Graph-structured_stack_-_Borneq.png

Another way to simulate nondeterminism would be to duplicate the stack as needed. The duplication would be less efficient since vertices would not be shared. For this example, 16 vertices would be needed instead of 9.

Stacks_-_Borneq.dot.png


References

  • Masaru Tomita. Graph-Structured Stack And Natural Language Parsing. Annual Meeting of the Association of Computational Linguistics, 1988. [1]
  • Elizabeth Scott, Adrian Johnstone GLL Parsing [2]