Submitted to CPP 2015

Browse the Coq development

Our compositional semantics

Section II. Language-independent infrastructure (borrowed from Compcert)
smallstepSmall-step and big-step operational semantics
smallstep_guidedGuided infinite executions (not part of CompCert)
smallstep_exists_behLemma 1: Existence of behaviors
 
Section III. Procedural semantics
procProcedural semantics
 
Section IV. Compositional semantics
compCompositional semantics
 
Section V. Linking
resolutionInternal call resolution by behavior simulation. Semantic linking
linkTheorem 1: linking in the same language
proc_comp_stuckLemma 2: Relationship between procedural and compositional semantics thanks to linking.
 
Section VI. Refinement
refinementCompositional refinement. Theorems 2 and 3.
ccimprovesTheorem 4: The CompCert improvement relation is a refinement relation.
 
Library files
mapApplicative maps
streamInfinite streams
classicClassical logic
tacUseful tactics

Instantiation with CompCert RTL and common subexpression elimination

instanceRedefinition of RTL as a procedural/compositional semantics, and proof of equivalence. Making CSE proof compositional.
unifyCorrespondence between our definitions and CompCert's for semantics and behaviors
 
CompCert RTL language and its optimization
RegistersRegister maps.
RTLRegister Transfer Language.
KildallData-flow analysis.
SelectOpSrcOffset addressing.
CombineOpRecognition of combined operations, addressing modes and conditions.
CSECommon subexpression elimination through value numbering: definition of the transformation.
CombineOpproofProof of the recognition phase.
CSEproofCorrectness of the CSE transformation.
 
When we ported the proofs of CSE, we did not even need to understand how they worked. Once we suitably adapted the CompCert event system, they simply went through.
 
CompCert general setting
ASTMemory chunks, global variables and program transformations.
Integers32-bit machine integers
ValuesRun-time integer and pointer values. (We dropped floating-point values because of some assumption in CompCert that an external function call has to return a value of the type expected by its caller (see the offical CompCert development), which is not yet supported by our compositional semantics.)
MemdataConcrete bytewise representation of data in memory
MemtypeSpecification of the memory model
MemoryImplementation of the memory model
EventsCompCert events. We also integrate our external call events into CompCert's setting.
GlobalenvsGlobal environments, mapping syntactic declared program symbols to memory locations. Our instantiation is parameterized over the global environment, and we clearly distinguish a symbol declaration from an actual function definition. In other words, we assume that all symbols are fixed and their corresponding memory locations are fixed in advance. Only actual function definitions actually change.
SmallstepCompCert definitions for small-step semantics
BehaviorsCompCert definitions for big-step semantics. Behavior improvement and correctness of two useful proof techniques, namely forward and backward simulations, wrt. behavior improvement.
OpArchitecture-specific (here we took x86) CPU low-level operators and addressing modes.
 
CompCert library files
AxiomsAxioms needed by CompCert: functional extensionality and propositional extensionality.
CoqlibTactics
IntvInteger intervals
ErrorsError reporting and the Error monad
MapsApplicative finite maps
IterationBounded and unbounded iterators.
LatticeSemi-lattices.
OrderedOrdered sets.
HeapsHeap data structure.
WfsimplWell-founded Noetherian recursion.

Global index

Download

Note: you will need Coq 8.3pl3 (and an estimated 15 minutes) to process the files.