scispace - formally typeset
Open AccessProceedings ArticleDOI

A guess-and-assume approach to loop fusion for program verification

TLDR
This paper proposes a new loop fusion strategy, which can fuse any loops—even loops with data dependence—and shows that it is useful for program verification because it can simplify loop invariants, and extends the “guess-and-assume” technique to reversing loop execution, which is useful to verify a certain type of consecutive loops.
Abstract
Loop fusion—a program transformation to merge multiple consecutive loops into a single one—has been studied mainly for compiler optimization. In this paper, we propose a new loop fusion strategy, which can fuse any loops—even loops with data dependence—and show that it is useful for program verification because it can simplify loop invariants. The crux of our loop fusion is the following observation: if the state after the first loop were known, the two loop bodies could be computed at the same time without suffering from data dependence by renaming program variables. Our loop fusion produces a program that guesses the unknown state after the first loop nondeterministically, executes the fused loop where variables are renamed, compares the guessed state and the state actually computed by the fused loop, and, if they do not match, diverges. The last two steps of comparison and divergence are crucial to preserve partial correctness. We call our approach “guess-and-assume” because, in addition to the first step to guess, the last two steps can be expressed by the pseudo-instruction assume, used in program verification. We formalize our loop fusion for a simple imperative language and prove that it preserves partial correctness. We further extend the “guess-and-assume” technique to reversing loop execution, which is useful to verify a certain type of consecutive loops. Finally, we confirm by experiments that our transformation techniques are indeed effective for state-of-the-art model checkers to verify a few small programs that they could not.

read more

Citations
More filters
Book ChapterDOI

Modular Product Programs

TL;DR: Many interesting program properties like determinism or information flow security are hyperproperties, that is, they relate multiple executions of the same program to trace properties of the product.
Journal ArticleDOI

Modular Product Programs

TL;DR: This work presents modular product programs, a novel kind of product program that permits hyperproperties in procedure specifications and, thus, can reason about calls modularly and demonstrates its expressiveness by applying it to information flow security with advanced features such as declassification and termination-sensitivity.
Journal ArticleDOI

Deep reinforcement learning in loop fusion problem

TL;DR: In this article , a Deep Reinforcement Learning Loop Fusion (DRLLF) algorithm was proposed to solve the problem of loop performance optimization by using reinforcement learning (RL) techniques.
References
More filters
Journal ArticleDOI

The program dependence graph and its use in optimization

TL;DR: An intermediate program representation, called the program dependence graph (PDG), that makes explicit both the data and control dependences for each operation in a program, allowing transformations to be triggered by one another and applied only to affected dependences.
Proceedings ArticleDOI

Separation logic: a logic for shared mutable data structures

TL;DR: An extension of Hoare logic that permits reasoning about low-level imperative programs that use shared mutable data structure is developed, including extensions that permit unrestricted address arithmetic, dynamically allocated arrays, and recursive procedures.
Proceedings ArticleDOI

Security Policies and Security Models

TL;DR: The reader is familiar with the ubiquity of information in the modern world and is sympathetic with the need for restricting rights to read, add, modify, or delete information in specific contexts.
Book ChapterDOI

CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs

TL;DR: The structure of CIL is described, with a focus on how it disambiguates those features of C that were found to be most confusing for program analysis and transformation, allowing a complete project to be viewed as a single compilation unit.
Book

The Formal Semantics of Programming Languages: An Introduction

TL;DR: The Formal Semantics of Programming Languages" provides the basic mathematical techniques necessary for those who are beginning a study of semantics and logics of programming languages, including the vital area of concurrency.
Related Papers (5)