A Toolkit for Generating Sentences from Context-Free Grammars

Producing sentences from a grammar, according to various criteria, is required in many applications. It is also a basic building block for grammar engineering. This paper presents a toolkit for context-free grammars, which mainly consists of several algorithms for sentence generation or enumeration and for coverage analysis for context-free grammars. The toolkit deals with general context-free grammars. Besides providing implementations of algorithms, the toolkit also provides a simple graphical user interface, through which the user can use the toolkit directly. The toolkit is implemented in Java and is available at http://lcs.ios.ac.cn/ hiwu/toolkit.php. In the paper, the overview of the toolkit and the description of the GUI are presented, and experimental results and preliminary applications of the toolkit are also contained.

[1]  André Almeida,et al.  CGM: A context-free grammar manipulator , 2008 .

[2]  Haiming Chen,et al.  A Systematic Framework for Grammar Testing , 2009, 2009 Eighth IEEE/ACIS International Conference on Computer and Information Science.

[3]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[4]  Ralf Lämmel,et al.  Grammar Testing , 2001, FASE.

[5]  Pál Dömösi Unusual Algorithms for Lexicographical Enumeration , 2000, Acta Cybern..

[6]  Ralf Lämmel,et al.  Towards an engineering discipline for GRAMMARWARE Draft as of August 17 , 2003 , 2003 .

[7]  Erzsébet Csuhaj-Varjú,et al.  Descriptional Complexity of Context-Free Grammar Forms , 1993, Theor. Comput. Sci..

[8]  Haiming Chen,et al.  Towards Practical Computable Functions on Context-Free Languages , 2006, TAMC.

[9]  董韫美 Recursive functions of context free languages (II)——Validity of CFPRF and CFRF definitions , 2002 .

[10]  P. Purdom A sentence generator for testing parsers , 1972 .

[11]  Zheng Bao,et al.  Neural networks and graph theory , 2008, Science in China Series F: Information Sciences.

[12]  Joost Visser,et al.  A Case Study in Grammar Engineering , 2008, SLE.

[13]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[14]  Perdita Stevens,et al.  Modelling Recursive Calls with UML State Diagrams , 2003, FASE.

[15]  Susan H. Rodger,et al.  A collection of tools for making automata theory and formal languages come alive , 1997, SIGCSE '97.

[16]  YunMei Dong Linear algorithm for lexicographic enumeration of CFG parse trees , 2009, Science in China Series F: Information Sciences.

[17]  Huang Wen Enumerating Sentences of Context Free Language Based on First One in Order , 2004 .

[18]  Lixiao Zheng,et al.  A Sentence Generation Algorithm for Testing Grammars , 2009, 2009 33rd Annual IEEE International Computer Software and Applications Conference.

[19]  Gregg Rothermel,et al.  An experimental determination of sufficient mutant operators , 1996, TSEM.

[20]  Chen Ziming,et al.  Design and Implementation of the Formal Specification Acquisition System SAQ , 2000 .

[21]  Heung Seok Chae,et al.  An Intermediate Representation Approach to Reducing Test Suites for Retargeted Compilers , 2007, Ada-Europe.

[22]  Richard J. Lipton,et al.  Hints on Test Data Selection: Help for the Practicing Programmer , 1978, Computer.

[23]  Shen Yang,et al.  Sentence Generation Based on Context-dependent Rule Coverage , 2005 .

[24]  Brian A. Malloy,et al.  An Interpretation of Purdom's Algorithm forAutomatic Generation of Test Cases , 2001 .

[25]  董韫美 Recursive functions of context free languages (I)——-The definitions of CFPRF and CFRF , 2002 .

[26]  Erkki Mäkinen,et al.  On Lexicographic Enumeration of Regular and Context-Free Languages , 1997, Acta Cybern..

[27]  Giuseppe Castagna,et al.  Set-theoretic foundation of parametric polymorphism and subtyping , 2011, ICFP.