Skip to Main content Skip to Navigation
Reports

Oracle-based Differential Operational Semantics (long version)

Thibaut Girka 1 David Mentré 1 Yann Régis-Gianas 2, 3
3 PI.R2 - Design, study and implementation of languages for proofs and programs
PPS - Preuves, Programmes et Systèmes, Inria Paris-Rocquencourt, UPD7 - Université Paris Diderot - Paris 7, CNRS - Centre National de la Recherche Scientifique : UMR7126
Abstract : Program dierences are pervasive in software development and understanding them is crucial. However, such changes are usually represented as textual dierences with no regard to the syntactic nature of programs or their semantics. Such a representation may be hard to read or reason about and often fails to convey insight on the semantic implications of a change. In this paper, we propose a formal framework to characterize the dierence of behavior between two close programs equivalent or notin terms of their small-step semantics. To this end, we introduce small-step-prediction oracles that consume one reduction step of one program and produce a sequence of reduction steps of the other. Such oracles are operational, handle diverging or stuck computations, and are well-suited for describing local changes, while expressive enough to describe arbitrary ones. They can also be composed, to characterize a dierence as a sequence of simpler dierences. Last but not least, small-prediction-step oracles can be explained to programmers in terms of evaluation of the compared programs. We illustrate this framework by instantiating it on the Imp imperative language, with oracles ranging from trivial equivalence-preserving syntactic transformations to characterized semantic dierences. Through these examples, we show how our framework can be used to relate syntactic changes with their eect on the semantics, or to describe higher-level changes by abstracting away from the small-step semantics presentation. We have dened and proved the framework and the presented examples in the Coq proof assistant, and implemented a proof-of-concept inference tool for the Imp language.
Document type :
Reports
Complete list of metadata

https://hal.inria.fr/hal-01419860
Contributor : Yann Regis-Gianas <>
Submitted on : Tuesday, December 20, 2016 - 8:39:33 AM
Last modification on : Friday, March 27, 2020 - 3:53:20 AM
Long-term archiving on: : Monday, March 20, 2017 - 7:10:42 PM

File

long-version.pdf
Files produced by the author(s)

Identifiers

  • HAL Id : hal-01419860, version 1

Collections

Citation

Thibaut Girka, David Mentré, Yann Régis-Gianas. Oracle-based Differential Operational Semantics (long version). [Research Report] Université Paris Diderot / Sorbonne Paris Cité. 2016. ⟨hal-01419860⟩

Share

Metrics

Record views

2525

Files downloads

6786