140 likes | 283 Vues
This document examines Strongly Formed Genetic Programming (SFGP), focusing on its integration into programming frameworks and its advantages in generating code. SFGP builds upon Strongly Typed Genetic Programming (STGP) by adding data-type constraints and node restrictions, ensuring program robustness throughout the evolutionary process. Key aspects covered include current advancements, challenges with implementation, and future directions for research and applications. By leveraging SFGP, researchers can effectively compose algorithms that output in various programming languages, enhancing the evolution of programmatic solutions.
E N D
Strongly Formed Genetic Programming 06/19/2013
Agenda • Strongly formed genetic programming (SFGP) • Where it fits • Current progress • Next steps
SFGP • GP for evolving programs [Castle2012] • Uses basic programming constructs to generate code for a given problem • Extends previous work in Strongly Typed Genetic Programming [Montana1995] • Nodes specify data-type constraints on inputs • Removes need for closure • No restraint on tree structure as typical grammars • Data-type constraints provide structure • No control structure found in imperative programming constructs
SFGP • Extends STGP by imposing extra node restrictions • Node must define: • Data-type (integer, float, etc.) • Node-type • Allowable child terminals or non-terminals • For example, Assignment node must have a first child that is both an integer and a variable • Must be satisfied throughout evolutionary process
SFGP Assignment • Extends STGP by imposing extra node restrictions • Node must define: • Data-type (integer, float, etc.) • Node-type • Allowable child terminals or non-terminals • For example, Assignment node must have a first child that is an integer and a variable • Must be satisfied throughout evolutionary process Integer Variable Integer Expression intvar = 5;
SFGP Iterator Upper Bound For Loop • Extends STGP by imposing extra node restrictions • Node must define: • Data-type (integer, float, etc.) • Node-type • Allowable child terminals or non-terminals • For example, Assignment node must have a first child that is an integer and a variable • Must be satisfied throughout evolutionary process Integer Variable Integer Expression Code Block for (inti = 0; i < 20; ++i) { Code Block }
SFGP Types • Top-level • Subroutine • CodeBlock • Statement • Loop • ForLoop • ForEachLoop • IfStatement • Assignment • Expression • Add • Subtract • Multiply • And • OrNot • Literal • Variable
Where it Fits • Tree halves • One half provides role transformations • One half provides code generation • Using SFGP, we will generate the code for the composition strategies • Advantage of SFGP is that we can output into any language • Also high level representations of nodes, as we had before • Initial approach had some roadblocks with post-processing for generating quality code • Allow algorithm to take control
Where it Fits WRAPPER Code Generation Role Transformations
Current Progress • Implementing vanilla SFGP • Creating new primitives and functionality in Puppy • Running into some issues • At 12:30am, I realized… • STGP is already a part of OpenBEAGLE proper
Next Steps • Migrate to OpenBEAGLE and get sample programs up and running • Customize for our needs • Migrate and merge role transformations
Sample Output from Puppy • Best individual at generation 50 is: • (CODEBLOCK (OR (CODEBLOCK X X (VARIABLE X)) (ASSIGNMENT X (SUBROUTINE X X))) (LITERAL (LOOP (MULTIPLY X X) (ASSIGNMENT X X))) (IFSTATEMENT X (ADD X X))) • =================== • CODEBLOCK • VARIABLE • OR • ASSIGNMENT • SUBROUTINE • CODEBLOCK • MULTIPLY • LOOP • ASSIGNMENT • LITERAL • IFSTATEMENT • ADD • ===================
Frameworks • SFGP – EpochX • Java Framework • http://www.epochx.org/ • OpenBEAGLE • Provides STGP support (must be extended for SFGP) • SPAMBASE example uses STGP • Stable release (3.0.3) has a run-time error • Alpha build runs properly (4.0.0 – Alpha 2) • http://code.google.com/p/beagle/downloads/list
New References • [Castle2012] • T. Castle and C. G. Johnson. Evolving high-level imperative program trees with strongly formed genetic programming. In Proceedings of the 15th European Conference on Genetic Programming, EuroGP2012,volume 7244 of LNCS, pages 1–12. Springer, Apr. 2012. • [Montana1995] • Montana, D.J.: Strongly typed genetic programming. Evolutionary Computation 3 (1995) 199-230