Construction of partial Dijkstra monads using the Dijkstra monads for all construction.
Should work fine with Coq 8.14-8.19 and Equations 1.3.
Just build with make.
These examples should type-check in F* because of the existence of a lift from
PURE.
They explain the need for deep assertions (require) in the effect
representation.
State:
let s₀ = get () in
let s₁ = get () in
assert (s₀ = s₁)ND:
let x = choose l in
assert (x `memP` l)The Coq development is all in theories.
structures.vcontains definitions of monads, Dijkstra monads, monad transformers…guarded.vdescribes the partiality monad.PURE.vproposes a simple encoding of F*'sPUREeffect.PDM.vcontains the general partial Dijkstra monad construction.
GuardedPDM.vproposes a construction of partial DM from a monad withoutrequire.DM4Free.vmakes the Dijkstra monads for free work fit in the current framework.FreePDM.v: get a partial Dijkstra monad from a free monad signature and a specification monad.
StateSpec.v: Specification monad for state.State.v: State using the state monad (equivalent toDM4FreeState.v)StateFree.v: State defined with a free monad.DM4FreeState.v: State using DM4Free construction.ND.v: Non-determinism.Div.v: Non-termination using an evaluation relation (uses classical logic, including functional choice).⚠️ The spec of iter is not fully worked out.⚠️ IIOStDiv.v: Non-termination with instrumented I/O and state using a more axiomatic semantics.IIOStDivAlt.v: Similar but more direct, keeping the notion of silent steps in the specifications.
They are found in the fstar directory and tested with
F* 2021.11.05~dev
commit=d20e32ca8ef7ab2e4cc79e0f553687ee2ae4a2ed
ND.fst: Non-determinism.