Heriot-Watt University
Functional approaches to evolutionary program synthesis : from evolvability and robustness to fitness using discovered properties
Abstract
dc:description.abstractEvolutionary Program Synthesis (EPS) has historically been dominated by the imperative programming paradigm. While effective, imperative languages rely heavily on mutable state and sequential execution, creating high context dependency between instructions. This thesis investigates the Functional Programming paradigm as an alternative substrate for evolution, positing that its inherent properties — specifically immutability, purity, and higher-order abstractions — offer a more expressive, composable and robust search space for Genetic Programming (GP). The research begins by developing a Grammar-Guided GP system targeting Haskell. Through a comparative study against an imperative Python baseline on the General Program Synthesis Benchmark Suite, the functional approach demonstrates superior generalisation and solution interpretability. An important finding of this stage is the essential role of evolving lambda abstractions; standard higher-order functions alone are insufficient for complex tasks without the ability to synthesise novel logic within them. Following this, the thesis introduces a linear representation, Functional Attributed Grammatical Evolution, which utilises functional grammars and depth attributes to mitigate the mapping fragility and invalidity issues often associated with Grammatical Evolution, though tree-based representations are found to retain superior locality. During the course of this research, the emergence of Large Language Models (LLMs) fundamentally shifted the program synthesis research area. Empirical analysis presented here shows that reasoning-capable LLMs can effectively solve standard synthesis bench marks, motivating a pivot in the application of EPS towards open-ended, exploratory domains. This is demonstrated through a case study in adversarial policy discovery within Deep Reinforcement Learning (RL) environments. In this domain, the functional GP system successfully evolves interpretable, symbolic agents that exploit vulnerabilities in state-of-the-art RL agents — a task where both imperative GP and an iterative LLM search failed. Finally, the thesis proposes a hybrid framework to combine the strengths of both paradigms. Rather than competing with LLMs on code generation, the system leverages them to infer semantic properties from input-output examples. These properties are integrated into a property-based fitness function, guiding the evolutionary search toward more generalisable solutions on tasks from the Abstraction and Reasoning Corpus. Collectively, this work establishes that functional abstractions enhance the evolvability of code and that GP remains a capable tool for novel discovery in the LLM era.
Degree
thesis:*- Grantor dc:publisher
- Heriot-Watt University
- Year dc:date.issued
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Garrow, Fraser
- Advisors dc:contributor.advisor
-
- Lones, Professor Michael
- Stewart, Associate Professor Rob
Rights
- Language dc:language.iso
- en
Identifiers
dc:identifier.*- Repository record dc:identifier.uri
- https://www.ros.hw.ac.uk/handle/10399/5486