Neural Termination Analysis

by   Mirco Giacobbe, et al.

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.



There are no comments yet.


page 1

page 2

page 3

page 4


Distilling Programs to Prove Termination

The problem of determining whether or not any program terminates was sho...

Termination Analysis of Programs with Multiphase Control-Flow

Programs with multiphase control-flow are programs where the execution p...

Supermartingales, Ranking Functions and Probabilistic Lambda Calculus

We introduce a method for proving almost sure termination in the context...

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

2LS is a framework for analysis of sequential C programs that can verify...

Program Verification via Predicate Constraint Satisfiability Modulo Theories

This paper presents a verification framework based on a new class of pre...

Resource Analysis driven by (Conditional) Termination Proofs

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

Fast Reliability Ranking of Matchstick Minimal Networks

In this article, we take a closer look at the reliability of large minim...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.