scispace - formally typeset
Search or ask a question
Topic

Context-free grammar

About: Context-free grammar is a research topic. Over the lifetime, 3449 publications have been published within this topic receiving 92951 citations. The topic is also known as: context free grammar & CFG.


Papers
More filters
Journal ArticleDOI
TL;DR: This paper shows that every efficient algorithm for the smallest grammar problem has approximation ratio at least 8569/8568 unless P=NP, and bound approximation ratios for several of the best known grammar-based compression algorithms, including LZ78, B ISECTION, SEQUENTIAL, LONGEST MATCH, GREEDY, and RE-PAIR.
Abstract: This paper addresses the smallest grammar problem: What is the smallest context-free grammar that generates exactly one given string /spl sigma/? This is a natural question about a fundamental object connected to many fields such as data compression, Kolmogorov complexity, pattern identification, and addition chains. Due to the problem's inherent complexity, our objective is to find an approximation algorithm which finds a small grammar for the input string. We focus attention on the approximation ratio of the algorithm (and implicitly, the worst case behavior) to establish provable performance guarantees and to address shortcomings in the classical measure of redundancy in the literature. Our first results are concern the hardness of approximating the smallest grammar problem. Most notably, we show that every efficient algorithm for the smallest grammar problem has approximation ratio at least 8569/8568 unless P=NP. We then bound approximation ratios for several of the best known grammar-based compression algorithms, including LZ78, B ISECTION, SEQUENTIAL, LONGEST MATCH, GREEDY, and RE-PAIR. Among these, the best upper bound we show is O(n/sup 1/2/). We finish by presenting two novel algorithms with exponentially better ratios of O(log/sup 3/n) and O(log(n/m/sup */)), where m/sup */ is the size of the smallest grammar for that input. The latter algorithm highlights a connection between grammar-based compression and LZ77.

457 citations

Journal ArticleDOI
TL;DR: It is shown that, subject to some mild restrictions, a grammar-based code is a universal code with respect to the family of finite-state information sources over the finite alphabet.
Abstract: We investigate a type of lossless source code called a grammar-based code, which, in response to any input data string x over a fixed finite alphabet, selects a context-free grammar G/sub x/ representing x in the sense that x is the unique string belonging to the language generated by G/sub x/. Lossless compression of x takes place indirectly via compression of the production rules of the grammar G/sub x/. It is shown that, subject to some mild restrictions, a grammar-based code is a universal code with respect to the family of finite-state information sources over the finite alphabet. Redundancy bounds for grammar-based codes are established. Reduction rules for designing grammar-based codes are presented.

437 citations

Book
14 Oct 2011
TL;DR: The aim of this book is to clarify the role that language plays in the development of set theory and to provide a framework for the future development of such a system.
Abstract: Preface. Part A. Set Theory. 1. Basic Concepts of Set Theory. 2. Relations and Functions. 3. Properties of Relations. 4. Infinities. Appendix A1. Part B. Logic and Formal Systems. 5. Basic Concepts of Logic. 6.Statement Logic. 7. Predicate Logic. 8. Formal Systems, Axiomatization, and Model Theory. Appendix B1. Appendix BII. Part C. Algebra. 9. Basic Concepts of Algebra. 10. Operational Structures. 11. Lattices. 12. Boolean and Heyting Algebras. Part D. English as a Formal Language. 13. Basic Concepts of Formal Languages. 14. Generalized Quantifiers. 15. Intensionality. Part E. Languages, Grammars, and Automata. 16. Basic Concepts of Languages, Grammars, and Automata. 17. Finite Automata, Regular Languages and Type 3 Grammars. 18. Pushdown Automata, Context-Free Grammars and Languages. 19. Turing Machines, Recursively Enumberable Languages, and Type 0 Grammars. 20. Linear Bounded Automata, Context-Sensitive Languages and Type 1 Grammars. 21. Languages Between Context-Free and Context-Sensitive. 22. Transformational Grammars. Appendix EI. Appendix EII. Review Problems. Index.

425 citations

Proceedings ArticleDOI
11 Jun 2003
TL;DR: This work performs static analysis of Java programs to answer a simple question: which values may occur as results of string expressions?
Abstract: We perform static analysis of Java programs to answer a simple question: which values may occur as results of string expressions? The answers are summarized for each expression by a regular language that is guaranteed to contain all possible values. We present several applications of this analysis, including statically checking the syntax of dynamically generated expressions, such as SQL queries. Our analysis constructs flow graphs from class files and generates a context-free grammar with a nonterminal for each string expression. The language of this grammar is then widened into a regular language through a variant of an algorithm previously used for speech recognition. The collection of resulting regular languages is compactly represented as a special kind of multi-level automaton from which individual answers may be extracted. If a program error is detected, examples of invalid strings are automatically produced. We present extensive benchmarks demonstrating that the analysis is efficient and produces results of useful precision.

407 citations

Book
01 Jan 1988
TL;DR: A tutorial introduction to the algebraic approach of graph grammars can be found in this paper, where the authors introduce the Hyperedge replacement method and an introduction to parallel map generating systems.
Abstract: Tutorial introduction to the algebraic approach of graph grammars- May we introduce to you: Hyperedge replacement- An introduction to parallel map generating systems- Set theoretic approaches to graph grammars- An introduction to the NLC way of rewriting graphs- Array grammars- Graph grammar based specification of interconnection structures for massively parallel computation- Towards distributed graph grammars- On partially ordered graph grammars- A representation of graphs by algebraic expressions and its use for graph rewriting systems- On context-free sets of graphs and their monadic second-order theory- Restricting the complexity of regular DNLC languages- Apex graph grammars- Graph grammar engineering: A software specification method- A linguistic formalism for engineering solid modeling- Graph grammars and diagram editing- Graphics and their grammars- On network algebras and recursive equations- Ada-concurrency specified by graph grammars- Basic notions of actor grammars- Embedding rule independent theory of graph grammars- Supporting the software development process with attributed NLC graph grammars- Practical applications of precedence graph grammars- Is parallelism already concurrency? Part 1: Derivations in graph grammars- Is parallelism already concurrency? Part 2: Non-sequential processes in graph grammars- Map OL-systems with edge label control: Comparison of marker and cyclic systems- From 0L and 1L map systems to indeterminate and determinate growth in plant morphogenesis- Fundamentals of edge-label controlled graph grammars- Parallelism analysis in rule-based systems using graph grammars- An efficient algorithm for the solution of hierarchical networks of constraints- A software development environment based on graph technology- Map 0L systems with markers- Graph rewriting with unification and composition- Complexity of pattern generation via planar parallel binary fission/fusion grammars- Applications of L-systems to computer imagery- Advances in array languages- Rosenfeld's cycle grammars and kolam- Application of graph grammars in music composing systems- Boundary NLC and partition controlled graph grammars

401 citations


Network Information
Related Topics (5)
Graph (abstract data type)
69.9K papers, 1.2M citations
87% related
Parsing
21.5K papers, 545.4K citations
87% related
Time complexity
36K papers, 879.5K citations
87% related
Semantics
24.9K papers, 653K citations
85% related
Data structure
28.1K papers, 608.6K citations
84% related
Performance
Metrics
No. of papers in the topic in previous years
YearPapers
202316
202234
202131
202047
201954
201838