Abstract

We present a novel denotational semantics for the untyped call-by-value λ-calculus, where terms are interpreted as stable relations , i.e. as binary relations between substitutions and values, enjoying a monotonicity property. The denotation captures the input-output behaviour of higher-order programs, and is proved sound and complete with respect to the operational semantics. The definition also admits a presentation as a program logic. Following the principles of abstract interpretation, we use our denotational semantics as a collecting semantics to derive a modular relational analysis for higher-order programs. The analysis infers equalities between the arguments of a program and its result—a form of frame condition for functional programs.

Highlights

  • Finding an upper bound of the effect that a program can have on its environment is a central problem in semantics and program verification

  • We follow the same methodology: we first define a denotational semantics of a higher-order language, that we prove sound and complete, and obtain a static analysis in a second stage, by applying several abstractions

  • We demonstrate the relevance of the collecting semantics by deriving, by means of successive abstractions, a static analyser for typed λ-terms that infers relations between inputs and outputs (ğ5), thereby computing frame conditions for functional programs

Read more

Summary

INTRODUCTION

Finding an upper bound of the effect that a program can have on its environment is a central problem in semantics and program verification. Cachera and Pichardie [2010] closely follow this approach for a While language They first define a denotational interpreter, that computes concrete properties, which they formally prove sound with respect to an operational semantics. We define a novel collecting semantics, that builds relations between the unknown inputs of a program and its output values We use this semantics as an intermediate step to derive a relational, modular analysis for a higher-order language. We demonstrate the relevance of the collecting semantics by deriving, by means of successive abstractions, a static analyser for typed λ-terms that infers relations between inputs and outputs (ğ5), thereby computing frame conditions for functional programs. T ⇝u πi t ⇝ πi u t ⇝u inji t ⇝ inji u t ⇝u match t with match u with | inj x1 → t1 ⇝ | inj x1 → t1 | inj x2 → t2 | inj x2 → t2 i ∈ {1, 2} match inji v with | inj x1 → t1 ⇝ ti [xi ← v] | inj x2 → t2

Preliminary Definitions
Substitutions and Stable Relations
Interpretation of Products
Interpretation of let-Bindings
Examples
PROGRAM LOGICS AND DENOTATIONAL SEMANTICS
Denoting Terms as Input-Output Relations
Soundness and Completeness
Handling Recursive Functions
ABSTRACTING THE DENOTATION INTO A STATIC ANALYSIS
A First Abstraction
A Second Abstraction
FORMALISATION IN COQ AND IMPLEMENTATION
RELATED WORK
Findings
CONCLUSIONS AND FUTURE WORK
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call