This project is the companion Rocq development of the paper "TypeDis: A Type System for Disentanglement".
See INSTALL.md.
Rocq files are located in the src/ directory.
The architecture is as follows:
lang/contains the syntax and semantics of the language.newlang/contains an alternative definition of the semantics that we use in the proofs. Our final theorems all make use of the original semantics inlang/.logic/contains the DisLog2 logic.- The
wpg.vfile defines the generalwpg. - The
wp.vfile defineswp, the specialization ofwpgto leaves, and gather lemmas. - The
wpg_adequacy.vfile contains the soundness theorem ofwpgwhich is specialized towpinwp_adequacy.v.
- The
types/contains the TypeDis type system.- The
typing.vfile defines the syntax of types. - The
syntactical.vfile defines the type system. - The
logrel.vfile defines logical relations. - The
final_theorem.vfile proves the fundamental theorem of the logical relation and the soundness theorem.
- The
examples/contains various examples.utils/contains some utility files.
Rocq files are located in the src/ directory.
TypeDis' typing judgment Δ | Γ ⊢ e : ρ ⊲ δ,
takes in Rocq the form typed δ Δ Ω Γ e ρ,
where Ω is the environment associating type variables to their kind
(merged with Γ in the paper).
Compared with the paper, soundness theorems require that the initial
program e does not contain any location value---such locations are
allocated dynamically. This hypothesis is written locs e = ∅.
- Figures 3 and 4: file
examples/key_ideas.v - Figures 5 and 6: file
examples/itree.vThe code presented in the paper omits technical fold/unfold instructions. In the formalization, type for theleafandnodeconstructor are polymorphic in the type of the leaves. - Figure 7: file
lang/syntax.v - Figure 8: file
lang/head_semantics.v - Figure 9: file
lang/semantics_cycle.v(which is re-exported fromlang/semantics.v) - Figure 10: file
lang/disentangled.vCompared to the paper, the functionleavesis namedfrontier. - Section 3.3, paragraph "Difference with Previous Semantics for Disentanglement":
file
lang/old_semantics/semantics_equiv_more.v, lemmasrtc_step_old_to_newandrtc_step_new_to_old. - Figure 11: file
types/typing.v- Timestamp variables are of type
stimestamp. - Logical graphs are set edges, represented as pair of stimestamps.
- Kinds are integers.
- Unboxed types are of type
tbase. - Boxed types are of type
typat. - Types are of type
typ. - Environments are maps from type variables to types.
- As explained above, the environment of kinds
Ωis separated from the environmentΓin the formalization.
- Timestamp variables are of type
- Figure 12: file
types/syntactical.v, inductivetyped - Figure 13: file
types/syntactical.v, inductivesubtime_typ - Figure 14:
- The predicate
AllRedOrOOBis calledreducibleand appears in filelang/reducible.v. It is parameterized by a boolean indicating if an OOB is allowed to occur. This parameter is instantiated totrueduring the soundness proof of TypeDis, but can be left tofalseto have a stronger statement. - The predicate Safe appears in
logic/wpg_adequacy.v.
- The predicate
- Theorem 5.1: file
types/final_theorem.v, lemmasoundness - Figure 15:
- D-Load: file
logic/wp.v, lemmawp_load - D-LoadOOB: file
logic/wpg_load.v, lemmawpg_load_escape - D-Par: file
logic/wp.v, lemmawp_par - D-ClockMono: file
logic/interp.v, lemmaclock_mon
- D-Load: file
- Theorem 5.2: file
logic/wp_adequacy.v, lemmawp_adequacy - Figure 16: file
types/fundamental.v, definitionlog_typed. Please unfold definitions when needed, the figure in the paper inlines a lot of intermediate names. - Theorem 5.3: file
types/final_theorem.v, lemmafundamental - Figure 17: file
examples/stdlib.v, definitionsparforandparfor_typed. - Figure 18: file
examples/dedup.v, definitionshs_addanddedupas well ashs_add_typedanddedup_typed
Appendix:
- Figure 19: file
types/typing.v, definitionwk_typ - Figure 20: file
types/syntactical.v, definitionvery_pure - Figure 21: file
utils/graph.v, definitionreachable - Figure 22: file
types/syntactical.v, definitionvalid_variable_typ - Figure 23: file
types/troot.v, definitiontroot - Figure 24: file
types/logrel.v, definitioninterp_typ
Users can check that all files compile and that no Admitted or Axiom
remains. It suffices to open the file src/noaxioms.v and play with it
interactively.
If the Rocq command Print Assumptions xxx prints "Closed under the
global context", it indicates that xxx has no dependencies (reference).
Users can also open some selected .v files inside CoqIDE or Proof
General and evaluate the whole file to check that no errors occur and
to verify that the objects and statements mentioned in the claims are
what they are supposed to be.
NB: There is a hack to work with ProofGeneral.
We have a dumb src/_CoqProject which makes visible the files
produced by dune.
See issue: ProofGeneral/PG#477