Skip to content

Commit 334eab5

Browse files
committed
more explanation about init_ctor spec
1 parent fffa0b2 commit 334eab5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • rocq-brick-libcpp/proof/shared_ptr

rocq-brick-libcpp/proof/shared_ptr/specs.v

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ Section specs.
108108
; info_type := tCtor ("std::shared_ptr".<<Atype ty>>) [Tptr ty] |} (fun (this:ptr) =>
109109
\arg{p:ptr} "ownedPtr" (Vptr p)
110110
\pre{p} dynAllocatedR ty p
111+
(* morally, the caller gives up all the pieces and gets back the 0th piece. The remaining pieces get stored in the invariant.
112+
Should this object be destructed immediately, the destructor will need all the pieces.
113+
We frame away the 0th piece in this spec. A derived spec can be proven where that framing away is not done *)
111114
\pre{Rpiece: nat -> Rep} [∗ list] ctid ∈ allButFirstPieceId,
112115
p |-> Rpiece ctid
113116
\pre [|([∗ list] ctid ∈ allPieceIds, Rpiece ctid)

0 commit comments

Comments
 (0)