Data types as a more ergonomic frontend for Grammar-Guided Genetic Programming

10/10/2022
by   Guilherme Espada, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/09/2020

Code Building Genetic Programming

In recent years the field of genetic programming has made significant ad...
research
04/15/2022

Initialisation and Grammar Design in Grammar-Guided Evolutionary Computation

Grammars provide a convenient and powerful mechanism to define the space...
research
08/23/2023

Saggitarius: A DSL for Specifying Grammatical Domains

Common data types like dates, addresses, phone numbers and tables can ha...
research
06/09/2022

Functional Code Building Genetic Programming

General program synthesis has become an important application area for g...
research
02/19/2022

Simple Genetic Operators are Universal Approximators of Probability Distributions (and other Advantages of Expressive Encodings)

This paper characterizes the inherent power of evolutionary algorithms. ...
research
07/22/2018

Generating an ATL Model Checker using an Attribute Grammar

In this paper we present the attribute grammars as a formal approach for...
research
04/27/2022

Evolving Generalizable Multigrid-Based Helmholtz Preconditioners with Grammar-Guided Genetic Programming

Solving the indefinite Helmholtz equation is not only crucial for the un...

Please sign up or login with your details

Forgot password? Click here to reset