This artifact is the ECOOP submission, Interaction Tree Specifications: A Framework for Specifying Recursive, Effectful Computations that Supports Auto-active Verification, submission #10.
It contains a Coq library containing formalized versions of all definitions and proofs contained in the paper relating to ITree Specifications.
It also contains code for typechecking and extraction for Heapster types, as part of the saw
tool
Finally, it contains the C source code for the mbox
examples, with Heapster types already included, as well as Coq proofs of the correctness of the output specifications.
We have included the source code, relevant build scripts, as well as a Docker image (to quickly verify that the code builds without needing to install dependencies).
We claim this artifact deserves the reusable badge (and therefore functional and available as well). This document provides a mapping from definitions and proofs in the paper to formalized versions in the artifact, as well as all of the code needed to run all examples.
A research team could apply the techniques we used to verify the mbox
examples to other C programs.
This would involve giving correct Heapster types to the program, extracting functional specifications, writing correctness specifications as ITree Specs, and running the prove_refinement
tactic and solving all goals that it provides.
A research team could also use ITree Specifications as a target semantics for another programming language.
This would enable them towrite similar specifications, and use the prove_refinement
tactic to help verify them.
- ghc 8.10.7
- cabal 3.8.1.0
- z3
- coq 8.15.2
- coq-paco >= 4.1.2
- coq-ext-lib >= 0.11.7
- coq-itree >= 5.0.0
To build saw
, which includes the heapster
tool, navigate to the saw-script
directory and run cabal build saw
. This will produce the saw
executable
To build the ITree Specification library, navigate to the entree_specs
directory, and run make && make install
.
To run the mbox
examples, first navigate to saw-script/saw-core-coq/coq
and run make
. Then navigate to saw-script/heapster-saw/examples
and run make
.
Heapster can be run using the saw
executible installed in the Docker image.
For example, running saw mbox.saw
as discussed below.
The mbox
example is located in /home/coq/saw-script/heapster-saw/examples
in the Docker image. The relevant files are:
mbox.c
– the source C filembox.saw
– the saw-script file which, when executed usingsaw mbox.saw
, instructs Heapster to generatembox_gen.v
mbox_gen.v
– contains the Heaspter-generated Coq specifications extracted from the C functions inmbox.c
mbox_proofs.v
– contains proofs of correctness of most of the functions above
The Docker image comes with mbox_gen.v
generated and mbox_proofs.v
verified.
However, you can also generate and verify these files yourself as follows:
$ rm -rf mbox_gen.v
$ make
Instead of calling make
, you can also go through each step individually by running: saw mbox.saw
(or make mbox_gen.v
), make mbox_gen.vo
, and make mbox_proofs.vo
.
paper_name
->repo_name
atfilpath:line#
- Notes
server_impl
->server_impl
attheories/Rel/SortEx.v:600
server_spec
->server_spec
attheories/Rel/SortEx.v:608
EncodingType
->EncodingType
attheories/Basics/HeterogeneousRelations.v:13
- While in the paper, the
EncodingType
class requires a function namedresponse_type
, in the code it is calledencodes
- While in the paper, the
ReSum
->ReSum
attheories/Core/SubEvent.v:18
andtheories/Core/SubEvent.v:19
- While in the paper,
ReSum
is presented as a single typeclass requiring two functions, in the code it is presented as two typeclasses each requiring one function
- While in the paper,
trigger
->trigger
attheories/Core/SubEvent.v:30
itree
->entree
attheories/Core/EnTreeDefinition.v:9-21
- The paper presents
itree
with a positive type coinductive definition, while the code repository uses negative types. This causes minor differences in many definitions related to ITrees
- The paper presents
spin
->spin
attheories/Core/EnTreeDefinition.v:77
euttF
->eqitF
attheories/Eq/Eqit.v:37
eqitF
is more general thaneuttF
, containing boolean parameters that control whether inductiveTau
steps can be made, as well as thevclo
parameter which can be useful for certain interactions with thepaco
library, but to understand this code you can assume it is always set to the identity function and can be ignored
eutt
->eutt
attheories/Eq/Eqit.v:78
- While
eutt
is defined on line78
, the application of thepaco
libraries greatest fixpoint combinator occurs on line74
- While
bind
->bind
attheories/Core/EnTreeDefinition.v:46-61
- In the code,
bind
is defined in terms ofsubst
, which performs an identical computation with the continuation and the tree swapped
- In the code,
interp_mrec
->interp_mrec
attheories/Ref/MRecSpec.v:26-37
mrec
->mrec
attheories/Ref/MRecSpec.v:38
evenodd
->evenodd
attheories/Ref/Example.v:24-44
Rel
->Rel
attheories/Basics/HeterogeneousRelations.v:20
PostRel
->PostRel
attheories/Basics/HeterogeneousRelations.v:21
RComposePostRel
->RComposePostRel
attheories/Basics/HeterogeneousRelations.v:31
CoveredType
->QuantType
attheories/Basics/QuantType.v:33
forall_spec
->forall_spec
attheories/Ref/EnTreeSpecDefinition.v:99
exists_spec
->exists_spec
attheories/Ref/EnTreeSpecDefinition.v:101
assume_spec
->assume_spec
attheories/Ref/EnTreeSpecDefinition.v:104
assert_spec
->assert_spec
attheories/Ref/EnTreeSpecDefinition.v:107
SpecEvent
->SpecEvent
attheories/Ref/EnTreeSpecDefinition.v:26
itree_spec
->entree_spec
attheories/Ref/EnTreeSpecDefinition.v:51
refinesF
->refinesF
attheories/Ref/EnTreeSpecDefinition.v:65
refines
->refines
attheories/Ref/EnTreeSpecDefinition.v:95
padded_refines
->padded_refines
attheories/Ref/EnTreeSpecFacts.v:838
interp_mrec_spec
->interp_mrec_spec
attheories/Ref/MRecSpec.v:43-55
mrec_spec
->mrec_spec
attheories/Ref/MRecSpec.v:56
concreteF
->isConcreteF
attheories/Ref/Concrete.v:29
rec_fix_spec
->rec_fix_spec
attheories/Ref/RecSpecFix.v:50
total_spec
->total_spec'
attheories/Ref/RecFixSpecTotal.v:43
total_spec_fix
->total_spec_fix
attheories/Ref/RecFixSpecTotal.v:53
merge
->merge
attheories/Ref/SortEx.v:241
merge_pre
->merge_pre
attheories/Ref/SortEx.v:261
merge_post
->merge_post
attheories/Ref/SortEx.v:264
rdec_merge
->rdec_merge
attheories/Ref/SortEx.v:107
padded_refines_bind
->padded_refines_bind
attheories/Ref/EnTreeSpecCombinatorFacts.v:110
padded_refines_trans
->padded_refines_trans
attheories/Ref/EnTreeSpecFacts/v:872
padded_refines_mrec
->padded_refine_mrec
attheories/Ref/EnTreeSpecCombinatorFacts.v:423
total_spec_fix_correct
->total_spec_fix_refines_total_spec'
attheories/Ref/RecFixSpecTotal.v:66
merge_correct
->merge_correct
attheories/Ref/SortEx.v:423
server_correct
->server_correct
attheories/Ref/RecFixSpecTotal.v:619