Internal embedded chain and owning-list interfaces
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
Incoming links from:
2. Embedded-node construction and link initialization
3. Insertion before and after a live embedded position
4. Embedded-node erasure and automatic unlink on destruction
5. Empty owning-list construction and remaining-node destruction
6. Owning-list front, back and positional insertion
9. Owning-list node validity hooks
6 |
Implementation::Doubly_Linked_Object shall provide an embedded forward/backward link pair; Implementation::EList<T> shall use a distinct owner-resident sentinel to form an ordered ring of T nodes. Valid linked use shall require live mutually reciprocal neighbor links and each node to belong to at most one chain. Node addresses shall remain fixed while linked. Copying or moving memberwise link fields shall not establish an independent ring; independent owner copying or relocation shall remain outside valid linked use. List nodes shall expose their accessible Doubly_Linked_Object base, support the selected T::OK() const hook, and remain compatible with scalar delete T* while list-owned. Destructors shall not throw. A linked node shall remain alive until explicitly removed or destroyed; borrowed iterators shall obey 🔗 7. Embedded-list iterator borrowing and valid linked positions. These structures shall require no numerical-library initialization. The link operations themselves shall neither allocate nor copy element values. |
Embedded links must preserve actual node identity and distinguish ring structure from ownership of numerical payloads. |
|
|
|
|
|
Check exact pointer order and surviving-node identities in valid rings and lists using noncopyable over-aligned nodes, including node destruction and owner destruction. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: Doubly_Linked_Object_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to Doubly_Linked_Object; list iterator aliases have the declared mutable/const types. class Doubly_Linked_Object; template <typename T> class EList; |
||
|
SW_SPEC
|
2 |
|
|
|
Construction with forward and backward pointers shall store those two pointers without updating neighbor objects. A self/self pair shall form an isolated reciprocal ring. Other supplied pairs shall require the caller to establish reciprocal links before linked use or destruction. Default construction shall leave link storage unbound. Before navigation, erasure or destruction, the node shall be bound by a valid insertion operation or otherwise have a valid reciprocal link pair. Fresh default node storage may be supplied as the unlinked donor of 🔗 3. Insertion before and after a live embedded position, which shall initialize both links before using them. 🔗 1. Embedded chain identity, links and ownership prerequisites shall apply. |
Low-level embedded nodes can acquire their first valid links through insertion, while sentinel construction supplies an immediately valid self-ring. |
|
|
|
|
|
Construct self-linked sentinels and bind default-constructed node storage by insertion before any read/destruction; verify forward/backward positions and automatic unlink. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: Doubly_Linked_Object_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to Doubly_Linked_Object; list iterator aliases have the declared mutable/const types. Doubly_Linked_Object(); Doubly_Linked_Object(Doubly_Linked_Object* f, Doubly_Linked_Object* b); |
||
|
SW_SPEC
|
3 |
|
|
Incoming link from:
2. Embedded-node construction and link initialization
1 |
Inserting an unlinked donor before or after a live linked target shall place exactly that donor between the target and its preceding or following neighbor, respectively. The donor shall be distinct from the target and shall not currently belong to a chain. Fresh unbound donors, isolated self-linked donors and previously removed donors shall be admitted. Both donor links and the corresponding reciprocal neighbor links shall be established. All other links, node values and object lifetimes shall be preserved. These base operations shall not transfer payload ownership or delete a donor; 🔗 1. Embedded chain identity, links and ownership prerequisites shall apply. |
Insertion must update both directions of an embedded chain without copying or reallocating its nodes. |
|
|
|
|
|
Insert before/after sentinels and ordinary nodes, compare independent pointer sequences in both directions, and reinsert an explicitly removed donor. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: Doubly_Linked_Object_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to Doubly_Linked_Object; list iterator aliases have the declared mutable/const types. void insert_before(Doubly_Linked_Object& y); void insert_after(Doubly_Linked_Object& y); |
||
|
SW_SPEC
|
4 |
|
|
Incoming link from:
7. Owning-list removal returns successor and node ownership
1 |
Erasing a live linked node shall reconnect its preceding and following neighbors, return its former following node, and leave every unrelated node's order and value unchanged. The removed node shall remain alive and caller-owned. It shall be independently destructible or insertable again; later operations on the surviving chain shall not cause its eventual destruction to remove or corrupt surviving nodes. Erasing an isolated self-linked node shall return that same node. Destroying a currently linked node shall unlink it without destroying its neighbors or their payloads. Removal and destruction shall require valid initialized link use under 🔗 1. Embedded chain identity, links and ownership prerequisites and 🔗 2. Embedded-node construction and link initialization. |
A removed node and its surviving chain need separate lifetimes, and live linked destruction must preserve the remaining ring. |
|
|
|
|
|
Check exact successor and survivor order, immediate removed-node destruction, reinsertion, automatic live-node unlink, isolated nodes, and independent removed-node destruction after later surviving-chain edits. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: Doubly_Linked_Object_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to Doubly_Linked_Object; list iterator aliases have the declared mutable/const types. Doubly_Linked_Object* erase(); ~Doubly_Linked_Object(); |
||
|
SW_SPEC
|
5 |
|
|
Incoming link from:
1. Threshold-ordered pending events and caller prerequisites
1 |
A new EList<T> shall contain no nodes and shall establish its own live sentinel with empty mutable and const iterator ranges. No element shall be constructed or allocated by empty-list construction. The list shall own nodes admitted by 🔗 1. Embedded chain identity, links and ownership prerequisites while they remain linked in it. List destruction shall remove and scalar-delete every remaining node exactly once, then destroy the empty sentinel. Previously removed nodes shall remain outside this destruction obligation. Destruction shall not invoke handlers or other unrelated client actions beyond the nodes' own destruction effects. |
Owning-list lifetime must release its remaining heap nodes while keeping explicitly removed ownership separate. |
|
|
|
|
|
Check empty construction/destruction, ordinary and over-aligned heap nodes, destructor counts and final zero live-node count through lists with inserted, removed and retained nodes. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: EList_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to EList<T>; list iterator aliases have the declared mutable/const types. EList(); ~EList(); |
||
|
SW_SPEC
|
6 |
|
|
|
Pushing a donor to the front or back shall add it as the first or last node, respectively. Positional insertion shall insert it immediately before the supplied current same-list position, admitting the end sentinel, and shall return an iterator to that donor. Each operation shall require a live unlinked donor eligible for list ownership under 🔗 1. Embedded chain identity, links and ownership prerequisites; it shall take ownership on successful insertion. Insertion shall preserve existing node identity, relative order and values, including every retained iterator to existing nodes and the same owner sentinel. It shall not construct/copy a replacement payload or allocate backing storage. Empty, first, interior and end insertion shall be admitted. |
Owning insertion must retain exact node identities and positional meaning without replacing their payload objects. |
|
|
|
|
|
For every insertion position in small lists, compare exact addresses and order with an independent pointer vector, retain old node iterators/end, and check front/back shorthands and eventual ownership cleanup. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: EList_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to EList<T>; list iterator aliases have the declared mutable/const types. void push_front(T& obj); void push_back(T& obj); iterator insert(iterator position, T& obj); |
||
|
SW_SPEC
|
7 |
|
|
|
Erasure shall require an occupied current same-list iterator. It shall remove exactly that node without deleting it, return its former following element or the same list's end, and transfer the removed node's ownership to the caller. Other node addresses, values and relative order, their live iterators and the owner sentinel shall remain unchanged. First, interior, last and sole-node removal shall be admitted. The removed node shall be independently destructible or insertable into an eligible list, including after intervening operations on its former owner; its eventual cleanup shall not alter surviving-node membership. An emptied list shall remain reusable. Safe detachment shall retain 🔗 4. Embedded-node erasure and automatic unlink on destruction. |
Removing membership must return both the precise traversal continuation and independent ownership of the detached node. |
|
|
|
|
|
Enumerate every occupied removal position and successor, check no premature destruction, reinsertion in a second list, immediate deletion, sole-node reuse, and later detached cleanup after independent surviving-list changes. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: EList_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to EList<T>; list iterator aliases have the declared mutable/const types. iterator erase(iterator position); |
||
|
SW_SPEC
|
8 |
|
|
|
empty() shall return true exactly when no nodes are linked between the list's sentinel links. Mutable and const begin() shall refer to the first node or, for an empty list, the owner sentinel. Each end() shall refer to that sentinel, whose identity shall remain stable during valid insertions/removals for the owner's lifetime. Mutable and const ranges shall traverse the same actual nodes in order, obeying 🔗 7. Embedded-list iterator borrowing and valid linked positions and 🔗 10. Embedded-list bidirectional traversal. No endpoint query shall copy, remove, allocate or delete a node. |
The sentinel identifies a list's own range independently of current membership and must remain a safe traversal endpoint. |
|
|
|
|
|
Check empty and populated mutable/const ranges against independent address sequences, reverse traversal from nonempty end, and retained end identities across insertion/removal and reuse. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: EList_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to EList<T>; list iterator aliases have the declared mutable/const types. typedef EList_Iterator<T> iterator; typedef EList_Iterator<const T> const_iterator; bool empty() const; iterator begin(); iterator end(); const_iterator begin() const; const_iterator end() const; |
||
|
SW_SPEC
|
9 |
|
|
|
For a structurally valid live list under 🔗 1. Embedded chain identity, links and ownership prerequisites, OK() shall call the nodes' const OK() hooks in list order until the first false result or the end. It shall return false at the first false hook and true if all hooks return true, including an empty list. This result shall describe those node-hook outcomes; structural validity shall remain a precondition rather than a conclusion supplied by this query. Hooks shall retain chain structure and ownership. An exception from a hook shall propagate, preserving list membership and node ownership when the hook itself preserves them. The list shall not destroy nodes or interpret such an exception as a successful true or false query result. |
Per-node payload checks are useful on a valid ring but cannot replace the ring's own lifetime and link preconditions. |
|
|
|
|
|
Use independent true/false hooks at every node position, count call order/early return and empty conjunction, then inject a hook exception and verify membership, ownership and subsequent successful reuse. |
src/Doubly_Linked_Object_defs.hh; src/Doubly_Linked_Object_inlines.hh; src/EList_defs.hh; src/EList_inlines.hh; tests/embeddedlistsspec1.cc; tests/embeddedlistlegacy1.cc. |
|
|
Internal source header: EList_defs.hh. Names belong to Parma_Polyhedra_Library::Implementation. Member signatures apply to EList<T>; list iterator aliases have the declared mutable/const types. bool OK() const; |