数据类型作为语法引导遗传编程的人机工程学前端
Data types as a more ergonomic frontend for Grammar-Guided Genetic Programming
摘要:
遗传编程(GP)是一种探试法,可以应用于许多机器学习、优化和工程问题。特别是在软件工程中,它被广泛用于测试用例生成、程序合成和软件改进。语法引导的遗传编程(GGGP)方法允许用户细化有效的程序解决方案的域。巴科斯范式是GGGP中描述上下文无关文法(CFG)的最流行的接口。BNF及其衍生物的缺点是使程序的语法语言和目标语言交错。我们建议将语法作为内部特定领域语言嵌入到框架的宿主语言中。这种方法具有与BNF和EBNF相同的表达能力,同时使用宿主语言类型系统来利用所有现有的工具:链接器,格式化程序,类型检查器,自动完成和遗留代码支持。这些工具在一般的软件设计中具有实用性,特别是GP系统。我们还提出了元处理程序,用户定义的树生成系统的覆盖。这种技术扩展了我们的面向对象的编码与更多的实用性和表达能力比现有的CFG方法,实现了相同的属性文法的表达能力,但没有语法与目标语言的二重性。此外,我们证明了这种方法是可行的,并展示了一个Python实现示例作为证明。我们还比较了我们的方法对文本BNF表示w.r.t.表现力和人体工程学。这些优势并不以性能为代价,正如我们对PonyGE 2示例实现的5个基准的经验评估所示。我们的结论是,我们的方法具有更好的人体工程学与相同的表达能力和性能的文本BNF为基础的语法编码。
英文摘要:
Genetic Programming (GP) is an heuristic method that can be applied to many Machine Learning, Optimization and Engineering problems. In particular, it has been widely used in Software Engineering for Test-case generation, Program Synthesis and Improvement of Software (GI). Grammar-Guided Genetic Programming (GGGP) approaches allow the user to refine the domain of valid program solutions. Backus Normal Form is the most popular interface for describing Context-Free Grammars (CFG) for GGGP. BNF and its derivatives have the disadvantage of interleaving the grammar language and the target language of the program. We propose to embed the grammar as an internal Domain-Specific Language in the host language of the framework. This approach has the same expressive power as BNF and EBNF while using the host language type-system to take advantage of all the existing tooling: linters, formatters, type-checkers, autocomplete, and legacy code support. These tools have a practical utility in designing software in general, and GP systems in particular. We also present Meta-Handlers, user-defined overrides of the tree-generation system. This technique extends our object-oriented encoding with more practicability and expressive power than existing CFG approaches, achieving the same expressive power of Attribute Grammars, but without the grammar vs target language duality. Furthermore, we evidence that this approach is feasible, showing an example Python implementation as proof. We also compare our approach against textual BNF-representations w.r.t. expressive power and ergonomics. These advantages do not come at the cost of performance, as shown by our empirical evaluation on 5 benchmarks of our example implementation against PonyGE2. We conclude that our approach has better ergonomics with the same expressive power and performance of textual BNF-based grammar encodings.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。