Neural Termination Analysis

02/07/2021
by   Mirco Giacobbe, et al.
0

We introduce a novel approach to the automated termination analysis of computer programs: we train neural networks to act as ranking functions. Ranking functions map program states to values that are bounded from below and decrease as the program runs. The existence of a valid ranking function proves that the program terminates. While in the past ranking functions were usually constructed using static analysis, our method learns them from sampled executions. We train a neural network so that its output decreases along execution traces as a ranking function would; then, we use formal reasoning to verify whether it generalises to all possible executions. We present a custom loss function for learning lexicographic ranking functions and use satisfiability modulo theories for verification. Thanks to the ability of neural networks to generalise well, our method succeeds over a wide variety of programs. This includes programs that use data structures from standard libraries. We built a prototype analyser for Java bytecode and show the efficacy of our method over a standard dataset of benchmarks.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/07/2020

Distilling Programs to Prove Termination

The problem of determining whether or not any program terminates was sho...
research
09/10/2021

Termination Analysis of Programs with Multiphase Control-Flow

Programs with multiphase control-flow are programs where the execution p...
research
01/15/2023

Quantitative Verification With Neural Networks For Probabilistic Programs and Stochastic Systems

We present a machine learning approach to quantitative verification. We ...
research
02/22/2021

Supermartingales, Ranking Functions and Probabilistic Lambda Calculus

We introduce a method for proving almost sure termination in the context...
research
03/02/2019

2LS: Heap Analysis and Memory Safety (Competition Contribution)

2LS is a framework for analysis of sequential C programs that can verify...
research
07/07/2020

Program Verification via Predicate Constraint Satisfiability Modulo Theories

This paper presents a verification framework based on a new class of pre...
research
07/23/2019

Resource Analysis driven by (Conditional) Termination Proofs

When programs feature a complex control flow, existing techniques for re...

Please sign up or login with your details

Forgot password? Click here to reset