This repository contains the Coq formalization of the paper:
- A Conceptual framework for Safe Object initialization, (submitted to OOPSLA 2022) Clément Blaudeau and Fengyun Liu
See INSTALL.md
- src/LibTactics: tactics borrowed from Software Foundations
- src/Tactics: additional tactics adapted from SystemFr
- src/Language.v: definition of the Celsius calculus and global parameters.
- src/Notations.v: all notations are reserved in this file, with type classes for overloaded notations.
- src/Helpers.v: basic functions, lemmas and tactics for getters, updates, assignments, etc.
- src/Semantics.v: big-step semantic rules and custom induction predicate on the rules.
- src/Eval.v: definitional interpreter for the language and equivalence result with the big step rules.
- src/Reachability.v: definition of the accessibility inside a store, and the semantic meaning of modes
- src/PartialMonotonicity.v: (semantic) partial monotonicity definition and theorem
- src/Wellformedness.v: wellformedness conditions and theorem
- src/Stackability.v: (semantic) stackability definition and theorem
- src/Scopatibility.v: scopatibility definition and theorem
- src/LocalReasoning.v: semantic local reasoning, promotion and local reasoning for typing theorems.
- src/Typing.v: Typing rules and inversion lemmas
- src/MetaTheory.v: Typing definition of the core principles, store typing definition and lemmas
- src/Soundness.v: Soundness theorem (and helper lemmas)
The powerful notation mechanism of Coq allowed us to have notations that match the paper quite directly.
Paper and Coq notation | Coq term | File | |
---|---|---|---|
Reachability | reachability |
src/Reachability.v | |
Semantic modes | semantic_mode |
src/Reachability.v | |
BS semantics | evalP |
src/Semantics.v | |
Partial monotonicity | partial_monotonicity |
src/PartialMonotonicity.v | |
Monotonicity | monotonicity |
src/MetaTheory.v | |
Authority |
|
authority and authority_st
|
src/Authority.v and src/MetaTheory.v |
Stackability |
|
stackability and stackability_st
|
src/Stackability.v and src/MetaTheory.v |
Scopability | scopability |
src/Scopability.v | |
Typing | expr_typing |
src/Typing.v | |
Object typing | object_typing |
src/MetaTheory.v | |
Store typing abstraction | store_typing |
src/MetaTheory.v | |
Env typing | env_typing |
src/MetaTheory.v |
Theorem, lemma, statement | Coq term | File |
---|---|---|
Partial monotonicity theorem | pM_theorem |
src/PartialMonotonicity.v |
Authority theorem | aty_theorem |
src/Authority.v |
Stackability theorem | stk_theorem |
src/Stackability.v |
Scopability theorem | scp_theorem |
src/Scopability.v |
Local reasoning | Local_reasoning |
src/LocalReasoning.v |
Promotion lemma | promotion |
src/MetaTheory.v |
Local reasoning for typing | Local_reasoning_for_typing |
src/LocalReasoning.v |
Soundness statement (expressions) | expr_soundness |
src/Soundness.v |
Soundness statement (initialization) | init_soundness |
src/Soundness.v |
Soundness theorem | Soundness |
src/Soundness.v |
Program soundness corollary | Program_soundness |
src/Soundness.v |
Our implementation makes some assumptions and representation choices, which we believe are without loss of generality:
- We represent variables, fields, locations (and thus, values) as integers.
- We represent stores and (local) environments as lists.
- We assume a globally accessible class table
ct
(defined as aParameter
) and an entry classEntryClass
. - We added the axiom of classical logic:
Axiom classicT : forall (P : Prop), {P} + {~ P}.
- For the soundness result, we assume the classtable is well typed :
Parameter typable_classes: T_Classes.