We provide following files organized in directories as our formalizations.
ReentryCode
│ Makefile
│ README.md
│ _CoqProject
│
├───WithCall
│ CoarseGrainedLogic.v
│ DenotationalSemantics.v
│ DerivationTheorem.v
│ FineGrainedSemantics.v
│
└───WithoutCall
DenotationalSemantics.v
DerivationTheorem.v
FineGrainedSemantics.v
We only provide the WithCall version of CoarseGrainedLogic.v
, because the coarse-grained logic requires properties of regular function invocations to be complete.
We provide a Makefile to compile two versions of our formalizations: with function call, and without function call.
- WithCall: Run
make WithCall
(or simplymake
) will compile.v
files inWithCall
folder into.vo
files. - WithoutCall: Run
make WithoutCall
will compile.v
files inWithCall
folder into.vo
files.
Running any of the above command will remove all existing compiled files in the current directory to avoid name conflicts.
For the same reason, we do not allow make all
.
You may need to set up your own CONFIGURE file to the bin directory of Coq to compile files.
- Syntax Tree of the Toy Language
- line 14 to line 47 in
WithCall/DenotationalSemantics.v
- line 14 to line 47 in
- Program State Model and Function Model
- line 51 to line 114 in
WithCall/DenotationalSemantics.v
- line 51 to line 114 in
-
Definition of Denotational Semantics ( the
$\Downarrow$ in the paper ) (ceval
)- line 139 to line 178 in
WithCall/DenotationalSemantics.v
- line 139 to line 178 in
-
Definition of Label
- line 18 to line 24 in
WithCall/FineGrainedSemantics.v
- line 18 to line 24 in
- Definition of Stacked State for Regular Function Calls
- line 164 to line 168 in
WithCall/FineGrainedSemantics.v
- line 164 to line 168 in
-
Definition of Fine-Grained Semantics ( the
$\downarrow$ in the paper ) (ceval'
)- line 170 to line 339 in
WithCall/FineGrainedSemantics.v
- line 170 to line 339 in
-
Definition of Reentry Stack ( the
$\Sigma$ in the paper ) (restk
)- line 689 in
WithCall/FineGrainedSemantics.v
- line 689 in
-
Definition of Single-Step Reentry Semantics ( the
$\downdownarrows_1$ in the paper ) (middle_ceval'
)- line 691 to line 717 in
WithCall/FineGrainedSemantics.v
- line 691 to line 717 in
-
Definition of Multi-Step Reentry Semantics ( the
$\downdownarrows_*$ in the paper ) (multi_ceval'
)- line 719 in
WithCall/FineGrainedSemantics.v
- line 719 in
- Congruence Lemmas for Reentry Semantics
- line 790 to line 1690 in
WithCall/FineGrainedSemantics.v
- Congruence Lemma for Seq1 ( the example lemma 5.1 in the paper )
- line 1032 to line 1161
- line 790 to line 1690 in
-
Equivalence between Semantics ( theorem 5.2
ceval_multi_ceval'
and theorem 5.3arbitrary_eval_multi_ceval'
in the paper )- line 1694 to line 2190 in
WithCall/FineGrainedSemantics.v
- line 1694 to line 2190 in
- Assertion Language
- line 17 to line 73 in
WithCall/DerivationTheorem.v
- Special Assertion for Stacked States
- line 60 to line 70
- line 17 to line 73 in
- Validity of Coarse-Grained Judgment
- line 80 to line 84 in
WithCall/DerivationTheorem.v
- line 80 to line 84 in
- Validity of Coarse-Grained Specification
- line 86 to line 90 in
WithCall/DerivationTheorem.v
- line 86 to line 90 in
-
Definition of Index (
index_set
)- line 194 to line 198 in
WithCall/DerivationTheorem.v
- line 194 to line 198 in
-
Definition of Parameter Type ( the
$\Lambda$ in the paper ) (param_type
)- line 200 to line 201 in
WithCall/DerivationTheorem.v
- line 200 to line 201 in
-
Validity of Fine-Grained Specification
- line 208 to line 236 in
WithCall/DerivationTheorem.v
- line 208 to line 236 in
-
Definition of Contract Invariant Type ( the type for
$\mathcal{I}$ and$\mathcal{R}$ in the paper ) (invariants
)- line 203 to line 204 in
WithCall/DerivationTheorem.v
- line 203 to line 204 in
-
Definition of Parameter Transition Relation (
index_relation
)- line 206 to line 207 in
WithCall/DerivationTheorem.v
- line 206 to line 207 in
-
Definition of Generalized Precondition ( the
$\mathcal{P}(\Sigma, P, Q, \mathcal{I}, \mathcal{R})$ in the paper ) (stk_loc_R
andstk_to_pre
)- line 678 to line 729 in
WithCall/DerivationTheorem.v
- line 678 to line 729 in
-
Lemma 5.5 (
reentry_invariant_precondition
)- line 1320 to line 1582 in
WithCall/DerivationTheorem.v
- Main lemmas used in the proof:
-
multi_ceval'_ctop
from line 733 to line 790 inWithCall/DerivationTheorem.v
-
reentry_bottom_level
from line 794 to line 968 inWithCall/DerivationTheorem.v
-
reentry_higher_level
from line 971 to line 1316 inWithCall/DerivationTheorem.v
-
- line 1320 to line 1582 in
-
The Derivation Theorem ( the theorem 5.4 in the paper ) (
derivation_theorem
)- line 1586 to line 1638 in
WithCall/DerivationTheorem.v
- line 1586 to line 1638 in
- Function Assumption ( the
$\Delta$ in the paper ) (func_assumption
)- line 387 in
WithCall/CoarseGrainedLogic.v
- line 387 in
- Hoare Triple
- line 393 to line 396 in
WithCall/CoarseGrainedLogic.v
- line 393 to line 396 in
- The Proof System ( the
$\vdash$ in the paper ) (provable
)- line 398 to line 432 in
WithCall/CoarseGrainedLogic.v
- line 398 to line 432 in
- Triple Valid ( the
$\vDash$ in the paper ) (valid
)- line 434 to line 442 in
WithCall/CoarseGrainedLogic.v
- line 434 to line 442 in
- Validity from Assumptions ( the
$\VDash$ in the paper ) (weak_valid
)- line 444 to line 453 in
WithCall/CoarseGrainedLogic.v
- line 444 to line 453 in
-
Lemma 3.2 (
weak_soundness
)- line 626 to line 640 in
WithCall/CoarseGrainedLogic.v
- Proofs for different branches
- line 460 to line 624 in
WithCall/CoarseGrainedLogic.v
- The one for the reentry rule
- line 460 to 483
- line 460 to line 624 in
- line 626 to line 640 in
-
Lemma 3.3 (
sigma_fp_valid
)- line 667 to line 682 in
WithCall/CoarseGrainedLogic.v
- line 667 to line 682 in
-
Soundness ( theorem 3.1 in the paper ) (
hoare_sound
)- line 685 to line 701 in
WithCall/CoarseGrainedLogic.v
- line 685 to line 701 in
-
Completeness ( theorem 6.1 in the paper ) (
hoare_complete
)- line 1052 to line 1071 in
WithCall/CoarseGrainedLogic.v
- The
hoare_triple_complete
from line 1033 to line 1050 is used here - Proofs for different branches
- line 766 to line 1031 in
WithCall/CoarseGrainedLogic.v
-
The one for the reentry ( lemma 6.2 in the paper ) (
hoare_reentry_complete
)- line 766 to line 835 in
WithCall/CoarseGrainedLogic.v
- line 766 to line 835 in
- line 766 to line 1031 in
- line 1052 to line 1071 in
- Syntax Tree of the Toy Language
- line 12 to line 33 in
WithoutCall/DenotationalSemantics.v
- line 12 to line 33 in
- Program State Model and Function Model
- line 37 to line 99 in
WithoutCall/DenotationalSemantics.v
- line 37 to line 99 in
-
Definition of Denotational Semantics ( the
$\Downarrow$ in the paper ) (ceval
)- line 103 to line 138 in
WithoutCall/DenotationalSemantics.v
- line 103 to line 138 in
-
Definition of Label
- line 18 to line 24 in
WithoutCall/FineGrainedSemantics.v
- line 18 to line 24 in
-
Definition of Fine-Grained Semantics ( the
$\downarrow$ in the paper ) (ceval'
)- line 124 to line 212 in
WithoutCall/FineGrainedSemantics.v
- line 124 to line 212 in
-
Definition of Reentry Stack ( the
$\Sigma$ in the paper ) (restk
)- line 285 in
WithoutCall/FineGrainedSemantics.v
- line 285 in
-
Definition of Single-Step Reentry Semantics ( the
$\downdownarrows_1$ in the paper ) (middle_ceval'
)- line 287 to line 305 in
WithoutCall/FineGrainedSemantics.v
- line 287 to line 305 in
-
Definition of Multi-Step Reentry Semantics ( the
$\downdownarrows_*$ in the paper ) (multi_ceval'
)- line 307 in
WithoutCall/FineGrainedSemantics.v
- line 307 in
- Congruence Lemmas for Reentry Semantics
- line 373 to line 1473 in
WithoutCall/FineGrainedSemantics.v
- Congruence Lemma for Seq1 ( the example lemma 5.1 in the paper )
- line 698 to line 792
- line 373 to line 1473 in
-
Equivalence between Semantics ( theorem 5.2
ceval_multi_ceval'
and theorem 5.3arbitrary_eval_multi_ceval'
in the paper )- line 1477 to line 1696 in
WithoutCall/FineGrainedSemantics.v
- line 1477 to line 1696 in
- Assertion Language
- line 17 to line 55 in
WithoutCall/DerivationTheorem.v
- line 17 to line 55 in
- Validity of Coarse-Grained Judgment
- line 62 to line 66 in
WithoutCall/DerivationTheorem.v
- line 62 to line 66 in
- Validity of Coarse-Grained Specification
- line 68 to line 72 in
WithoutCall/DerivationTheorem.v
- line 68 to line 72 in
-
Definition of Index (
index_set
)- line 120 to line 124 in
WithoutCall/DerivationTheorem.v
- line 120 to line 124 in
-
Definition of Parameter Type ( the
$\Lambda$ in the paper ) (param_type
)- line 126 to line 127 in
WithoutCall/DerivationTheorem.v
- line 126 to line 127 in
-
Validity of Fine-Grained Specification
- line 134 to line 162 in
WithoutCall/DerivationTheorem.v
- line 134 to line 162 in
-
Definition of Contract Invariant Type ( the type for
$\mathcal{I}$ and$\mathcal{R}$ in the paper ) (invariants
)- line 129 to line 130 in
WithoutCall/DerivationTheorem.v
- line 129 to line 130 in
-
Definition of Parameter Transition Relation (
index_relation
)- line 132
WithoutCall/DerivationTheorem.v
- line 132
-
Definition of Generalized Precondition ( the
$\mathcal{P}(\Sigma, P, Q, \mathcal{I}, \mathcal{R})$ in the paper ) (stk_loc_R
andstk_to_pre
)- line 294 to line 343 in
WithoutCall/DerivationTheorem.v
- line 294 to line 343 in
-
Lemma 5.5 (
reentry_invariant_precondition
)- line 703 to line 838 in
WithoutCall/DerivationTheorem.v
- Main lemmas used in the proof:
-
multi_ceval'_ctop
from line 347 to line 404 inWithoutCall/DerivationTheorem.v
-
reentry_bottom_level
from line 408 to line 506 inWithoutCall/DerivationTheorem.v
-
reentry_higher_level
from line 510 to line 699 inWithoutCall/DerivationTheorem.v
-
- line 703 to line 838 in
-
The Derivation Theorem ( the theorem 5.4 in the paper ) (
derivation_theorem
)- line 841 to line 886 in
WithoutCall/DerivationTheorem.v
- line 841 to line 886 in