aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/EphemeralRelation.mli
blob: d0823941ff83f68e13abf6eef1bc692d8dfebfb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module type DERIVATION = sig
  type plan

  (** the hash of the plan, taken over the branch-local names of its
      inputs rather than over their content addresses. The idea is to
      have the same expression denote one object on every branch and
      at every point in time. *)
  val identity : plan -> Concepts.Hash.hash

  val describe :
    plan -> (Protocols.Schematics.relation_description, Concepts.Condition.condition) result

  val modes : plan -> (Concepts.Mode.t, Concepts.Condition.condition) result

  val generate :
    plan ->
    Protocols.Generative.binding ->
    (Protocols.Handle.t, Concepts.Condition.condition) result
end

module Make (D : DERIVATION) : sig
  (** unpinned, the identity of the derivation itself; pinned to a
      branch commit, the identity of that derivation against one
      reconstructible state, which is the only form for which equal
      identity implies equal extension. *)
  val identity : ?pinned:Concepts.Hash.hash -> D.plan -> Concepts.Hash.hash

  (** edges are the handles the derivation reads, which are released
      when the relation is also. Rejection of a derivation surfaces
      here instead of when a cursor is being drained. *)
  val derive :
    ?pinned:Concepts.Hash.hash ->
    ?edges:Protocols.Handle.t list ->
    D.plan ->
    (Protocols.Handle.t, Concepts.Condition.condition) result
end