Machine learning for function synthesis

<p>Function synthesis is the process of automatically constructing functions that satisfy a given specification. The space of functions as well as the format of the specifications vary greatly with each area of application. In this thesis, we consider synthesis in the context of satisfiability...

Full description

Bibliographic Details
Main Author: Parsert, J
Other Authors: Kröning, D
Format: Thesis
Language:English
Published: 2024
Subjects:
_version_ 1826313163301191680
author Parsert, J
author2 Kröning, D
author_facet Kröning, D
Parsert, J
author_sort Parsert, J
collection OXFORD
description <p>Function synthesis is the process of automatically constructing functions that satisfy a given specification. The space of functions as well as the format of the specifications vary greatly with each area of application. In this thesis, we consider synthesis in the context of satisfiability modulo theories. Within this domain, the goal is to synthesise mathematical expressions that adhere to abstract logical formulas. These types of synthesis problems find many applications in the field of computer-aided verification. One of the main challenges of function synthesis arises from the combinatorial explosion in the number of potential candidates within a certain size. The hypothesis of this thesis is that machine learning methods can be applied to make function synthesis more tractable.</p> <br> <p>The first contribution of this thesis is a Monte-Carlo based search method for function synthesis. The search algorithm uses machine learned heuristics to guide the search. This is part of a reinforcement learning loop that trains the machine learning models with data generated from previous search attempts. To increase the set of benchmark problems to train and test synthesis methods, we also present a technique for generating synthesis problems from pre-existing satisfiability modulo theories problems. We implement the Monte-Carlo based synthesis algorithm and evaluate it on standard synthesis benchmarks as well as our newly generated benchmarks. An experimental evaluation shows that the learned heuristics greatly improve on the baseline without trained models. Furthermore, the machine learned guidance demonstrates comparable performance to CVC5 and, in some experiments, even surpasses it.</p> <br> <p>Next, this thesis explores the application of machine learning to more restricted function synthesis domains. We hypothesise that narrowing the scope enables the use of machine learning techniques that are not possible in the general setting. We test this hypothesis by considering the problem of ranking function synthesis. Ranking functions are used in program analysis to prove termination of programs by mapping consecutive program states to decreasing elements of a well-founded set. The second contribution of this dissertation is a novel technique for synthesising ranking functions, using neural networks. The key insight is that instead of synthesising a mathematical expression that represents a ranking function, we can train a neural network to act as a ranking function. Hence, the synthesis procedure is replaced by neural network training. We introduce Neural Termination Analysis as a framework that leverages this. We train neural networks from sampled execution traces of the program we want to prove terminating. We enforce the synthesis specifications of ranking functions using the loss function and network design. After training, we use symbolic reasoning to formally verify that the resulting function is indeed a correct ranking function for the target program. We demonstrate that our method succeeds in synthesising ranking functions for programs that are beyond the reach of state-of-the-art tools. This includes programs with disjunctions and non-linear expressions in the loop guards.</p>
first_indexed 2024-09-25T04:06:56Z
format Thesis
id oxford-uuid:5d420d6d-e924-4a80-b44c-5cc59f4b3902
institution University of Oxford
language English
last_indexed 2024-09-25T04:06:56Z
publishDate 2024
record_format dspace
spelling oxford-uuid:5d420d6d-e924-4a80-b44c-5cc59f4b39022024-06-05T13:19:57ZMachine learning for function synthesisThesishttp://purl.org/coar/resource_type/c_db06uuid:5d420d6d-e924-4a80-b44c-5cc59f4b3902Program synthesisFunction synthesisMachine learningSynthesisVerification (logic)Reinforcement learningComputer software--verificationComputer programs--terminationLogic, symbolic and mathematicalEnglishHyrax Deposit2024Parsert, JKröning, DMelham, T<p>Function synthesis is the process of automatically constructing functions that satisfy a given specification. The space of functions as well as the format of the specifications vary greatly with each area of application. In this thesis, we consider synthesis in the context of satisfiability modulo theories. Within this domain, the goal is to synthesise mathematical expressions that adhere to abstract logical formulas. These types of synthesis problems find many applications in the field of computer-aided verification. One of the main challenges of function synthesis arises from the combinatorial explosion in the number of potential candidates within a certain size. The hypothesis of this thesis is that machine learning methods can be applied to make function synthesis more tractable.</p> <br> <p>The first contribution of this thesis is a Monte-Carlo based search method for function synthesis. The search algorithm uses machine learned heuristics to guide the search. This is part of a reinforcement learning loop that trains the machine learning models with data generated from previous search attempts. To increase the set of benchmark problems to train and test synthesis methods, we also present a technique for generating synthesis problems from pre-existing satisfiability modulo theories problems. We implement the Monte-Carlo based synthesis algorithm and evaluate it on standard synthesis benchmarks as well as our newly generated benchmarks. An experimental evaluation shows that the learned heuristics greatly improve on the baseline without trained models. Furthermore, the machine learned guidance demonstrates comparable performance to CVC5 and, in some experiments, even surpasses it.</p> <br> <p>Next, this thesis explores the application of machine learning to more restricted function synthesis domains. We hypothesise that narrowing the scope enables the use of machine learning techniques that are not possible in the general setting. We test this hypothesis by considering the problem of ranking function synthesis. Ranking functions are used in program analysis to prove termination of programs by mapping consecutive program states to decreasing elements of a well-founded set. The second contribution of this dissertation is a novel technique for synthesising ranking functions, using neural networks. The key insight is that instead of synthesising a mathematical expression that represents a ranking function, we can train a neural network to act as a ranking function. Hence, the synthesis procedure is replaced by neural network training. We introduce Neural Termination Analysis as a framework that leverages this. We train neural networks from sampled execution traces of the program we want to prove terminating. We enforce the synthesis specifications of ranking functions using the loss function and network design. After training, we use symbolic reasoning to formally verify that the resulting function is indeed a correct ranking function for the target program. We demonstrate that our method succeeds in synthesising ranking functions for programs that are beyond the reach of state-of-the-art tools. This includes programs with disjunctions and non-linear expressions in the loop guards.</p>
spellingShingle Program synthesis
Function synthesis
Machine learning
Synthesis
Verification (logic)
Reinforcement learning
Computer software--verification
Computer programs--termination
Logic, symbolic and mathematical
Parsert, J
Machine learning for function synthesis
title Machine learning for function synthesis
title_full Machine learning for function synthesis
title_fullStr Machine learning for function synthesis
title_full_unstemmed Machine learning for function synthesis
title_short Machine learning for function synthesis
title_sort machine learning for function synthesis
topic Program synthesis
Function synthesis
Machine learning
Synthesis
Verification (logic)
Reinforcement learning
Computer software--verification
Computer programs--termination
Logic, symbolic and mathematical
work_keys_str_mv AT parsertj machinelearningforfunctionsynthesis