# Control-Flow Refinement by Partial Evaluation, and its Application to   Termination and Cost Analysis

**Authors:** Jes\'us J. Dom\'enech, John P. Gallagher, Samir Genaim

arXiv: 1907.12345 · 2019-08-01

## TL;DR

This paper introduces a general-purpose control-flow refinement technique using partial evaluation of Horn clauses, enhancing program analysis precision, termination proofs, and complexity inference for integer transition systems.

## Contribution

It presents a novel application of partial evaluation for control-flow refinement, ensuring soundness and enabling termination and complexity analysis for challenging programs.

## Key findings

- Effective control-flow refinement improves analysis precision.
- The technique proves termination and infers complexity where other tools fail.
- Integration with analyzers demonstrates practical benefits.

## Abstract

Control-flow refinement refers to program transformations whose purpose is to make implicit control-flow explicit, and is used in the context of program analysis to increase precision. Several techniques have been suggested for different programming models, typically tailored to improving precision for a particular analysis. In this paper we explore the use of partial evaluation of Horn clauses as a general-purpose technique for control-flow refinement for integer transitions systems. These are control-flow graphs where edges are annotated with linear constraints describing transitions between corresponding nodes, and they are used in many program analysis tools. Using partial evaluation for control-flow refinement has the clear advantage over other approaches in that soundness follows from the general properties of partial evaluation; in particular, properties such as termination and complexity are preserved. We use a partial evaluation algorithm incorporating property-based abstraction, and show how the right choice of properties allows us to prove termination and to infer complexity of challenging programs that cannot be handled by state-of-the-art tools. We report on the integration of the technique in a termination analyzer, and its use as a preprocessing step for several cost analyzers. Under consideration for acceptance in TPLP.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1907.12345/full.md

## Figures

17 figures with captions in the complete paper: https://tomesphere.com/paper/1907.12345/full.md

## References

27 references — full list in the complete paper: https://tomesphere.com/paper/1907.12345/full.md

---
Source: https://tomesphere.com/paper/1907.12345