All paths are relative to the theories/
directory.
General notes:
- Hoare-triples shown in the paper will sometimes omit "later" modalities (▷) that appear in front of preconditions of the Coq version. Later modalities in preconditions make the Coq statement slightly stronger than the paper version. In other words, omitting the "later" on paper is sound, and the on-paper rule is a consequence of the corresponding rule in Coq.
- The syntax
"foo_name" ∷ foo
is equivalent tofoo
. The extra string is a naming hint for tactics and has no semantic meaning. - The Coq scripts sometimes formulate rules in terms of weakest-preconditions
(
WP e {{ Q }}
) where the paper uses Hoare-triples ({ P } e { Q }
). To help matching the two, in first approach, a triple{ P } e { Q }
can be read as sugar for (P -∗ WP e {{ Q }}
). (The exact definition is slightly different and includes extra modalities, see "Texan triples" in iris, inbi/weakestpre.v
.)
Section 2.1:
- λC (toy) implementation of the compression library functions (Fig 2): in
examples/compression/compression_proofs.v
snappy_max_compressed_length
:buffy_max_len_code
snappy_compress
:buffy_compress_code
.
- λML implementation of
is_compressible
(Fig 2): inexamples/compression/buffers_client.v
is_compressible
:ML_client_code
.
Section 2.2:
-
Definition of λC (Fig 3):
- values and state are defined in
c_interface/defs.v
(val
andc_state
) - expressions and programs are defined in
c_lang/lang.v
(expr
,program
)
- values and state are defined in
-
Definition of λML (Fig 3):
- values, expressions and state are defined in
ml_lang/lang.v
(val
,expr
,state
)
- values, expressions and state are defined in
-
IrisC program logic rules (Fig 4):
READ-C
iswp_load
inc_lang/primitive_laws.v
WRITE-C
iswp_store
inc_lang/primitive_laws.v
ALLOC-C
iswp_Malloc_vec
inc_lang/derived_laws.v
FREE-C
iswp_free_array
inc_lang/derived_laws.v
-
IrisML program logic rules (Fig 4):
READ-ML
iswp_loadN
inml_lang/primitive_laws.v
WRITE-ML
iswp_storeN
inml_lang/primitive_laws.v
ALLOC-ML
iswp_allocN
inml_lang/primitive_laws.v
-
CALL-INTERNAL
(Fig 4) iswp_call
inlanguage/weakestpre.v
(formulated as a rule on weakest preconditions instead of triples). It applies to both the WP of λML and λC. -
CALL-EXTERNAL
(Fig 4) iswp_extern'
inlanguage/weakestpre.v
(formulated as a rule on weakest preconditions instead of triples). It applies to both the WP of λML and λC. -
The triple for
snappy_max_compressed_length
and forsnappy_compress
is specified inexamples/compression/compression_specs.v
, the proofs are inexamples/compression/compression_proofs.v
-
The triple for
is_compressible
appears inexamples/compression/buffers_client.v
(ML_client_spec
, albeit with a stronger specification wrt the return boolean) -
The λML interface Ψbuf_alloc for
buf_alloc
is defined inexamples/compression/buffers_specs_simpler.v
(buf_alloc_spec_ML_simple
). Note that the interface shown in the paper is derived from a stronger specification ofbuf_alloc
, shown inexamples/compression/buffers_specs.v
(buf_alloc_spec_ML
). -
Note: we currently only have binary pairs in the Coq formalization, whereas the paper use tuples with 3 elements for representing λML buffers. In the Coq formalization we have nested pairs instead.
Section 2.3:
- The λC implementation for
buf_alloc
(Fig 5) appears inexamples/compression/buffers_code.v
(buf_alloc_code
).
Section 2.4:
-
Runtime values are defined in
interop/basics.v
(lval
) -
Separation logic runtime resources are defined in
interop/basics_resources.v
:γ ↦vblk[ m ] (t, vs)
is a standard block storing valuesvs
, with tagt
and mutabilitym
γ ↦foreign a
is a custom block (custom blocks are called foreign blocks in the Coq development)
-
The relation between runtime values and λC values (
v ~_C^θ w
in the paper) is defined ininterop/basics.v
asrepr_lval
. -
The type of θ maps is defined in
interop/basics.v
(addr_map
) -
The interface of the alloc primitive Ψalloc is
alloc_proto
ininterop/prims_proto.v
. -
The interface of the FFI Ψ_FFI is
prims_proto
ininterop/prims_proto.v
(at this point of the paper its parameter is omitted, see §4). -
The Hoare triple for the λC
buf_alloc
function isbuf_alloc_spec_C
inexamples/compression/buffers_proof_alloc.v
.
Section 2.5:
-
ML-TO-FFI
(Fig 6) isml_to_mut
ininterop/update_laws.v
-
FFI-TO-ML
(Fig 6) ismut_to_ml
ininterop/update_laws.v
-
The view reconciliation rule for buffers is proved in
examples/compression/buffers_laws.v
(bufToML
).
Section 3:
- Small-step operational semantics of λML appear in
ml_lang/lang.v
(head_step
) - Small-step operational semantics of λC appear in
c_lang/lang.v
(head_step
) - The linking operational semantics appear in
linking/lang.v
(prim_step_mrel
) - The wrapper operational semantics appear in
interop/lang.v
(prim_step_mrel
, usingc_prim_step
as an auxiliary definition) - [e]_FFI (as a program) is
wrap_prog
defined ininterop/lang.v
- Linking of two programs is
link_prog
defined inlinking/lang.v
Section 3.1:
- The runtime state of the wrapper is defined in
interop/lang.v
(state
), using auxiliary definitions ininterop/state.v
andinterop/basics.v
- The generic lifting from languages with relational semantics to multirelation
semantics is defined in
lang_to_mlang/lang.v
(prim_step_mrel
) - The definition
closed
corresponds toGC_correct
ininterop/basics.v
- The definition
roots
corresponds toroots_are_live
ininterop/basics.v
- The list of runtime primitives is defined in
interop/prims.v
- The operational semantics of runtime primitives is defined in
interop/lang.v
(c_prim_step
), except forcallback
andmain
which are cases ofprim_step_mrel
.
Section 4.1:
-
Theorem 4.1 is
combined_correct
incombined/rules.v
-
The FFI wrapper for interfaces [.]_FFI is
wrap_proto
ininterop/prims_proto.v
-
The interface of the FFI Ψ_FFI^Π is
prims_proto
ininterop/prims_proto.v
-
IntfImplement
(Fig 8) isprove_prog_correct
inlanguage/weakestpre.v
-
IntfConseq
(Fig 8) isprog_triple_mono
inlanguage/weakestpre.v
-
Link
(Fig 8) islink_close_correct
inlinking/weakestpre.v
-
EmbedML
(Fig 8) iswrap_correct
ininterop/wp_simulation.v
(the Coq theorem is slightly more general, by settingP
to true one gets the rule from the paper) -
EmbedC
(Fig 8) iscombined_embed_c
incombined/rules.v
-
Rules of Fig 9 are formulated in Coq as rules of the form "Ψ |- p : Π"; they desugar to the rules given in the paper.
AllocCustom
isalloc_foreign_correct
ininterop/wp_prims/alloc_foreign.v
RegisterRoot
isregisterroot_correct
ininterop/wp_prims/registerroot.v
ExecCallback
iscallback_correct
ininterop/wp_simulation.v
Section 4.2:
- The definition of the GC resource is in
interop/gctoken.v
(GC
)
Section 4.3:
- Theorem 4.2 is
main_adequacy_trace
incombined/adequacy.v
- The coinductive definition of program executions is
umrel.trace
, defined inmultirelations.v
- The definition (Fig 10) of the weakest-precondition predicate for
multirelation semantics with external calls is
wp_pre
/wp_pre_cases
inmlanguage/weakestpre.v
- The definition of the weakest-precondition predicate for usual relational
semantics (used by IrisML and IrisC) is
wp_pre
inlanguage/weakestpre.v
Section 5:
-
The specification for
buf_upd
is inexamples/compression/buffers_specs_simpler.v
, again the on-paper version differs from the one originally verified (examples/compression/buffers_specs.v
). The correctness proof is inexamples/compression/buffers_proof_update_.v
. -
The iseq example is in
examples/iseq
-
Logical relation is defined in
theories/ml_lang/logrel
- the interpretation of external calls is defined in
theories/ml_lang/logrel/logrel.v
, calledprog_env_proto
- the corresponding interface for external calls is in
theories/ml_lang/logrel/logrel.v
, calledinterp_prog_env
- the interpretation of external calls is defined in
-
Landin's knot is in
examples/landins_knot.v
-
Event listeners are in
examples/listener.v
- This includes an application of adequacy using the logical relation,
called
listener_client_1_adequacy.v
- This includes an application of adequacy using the logical relation,
called