Parma Polyhedra Library requirements
BD_Shape<T> internal status
1. BD_Shape<T> internal status value ownership and prerequisites PPL-SPEC-001612

The nested Status shall own a finite set of named Boolean flags: empty, shortest_path_closed, shortest_path_reduced. test_zero_dim_univ() shall recognize the zero flag word; that word shall be the default state. It shall be an encoding predicate, not an independent query of the owning object's dimension or numerical payload. The owning object shall supply that context and establish the truth of its cache claims.

Copy construction and assignment shall preserve all stored flags in an independent value. Assignment shall return its target and admit self-assignment. Mutating or destroying one copy shall not change another. Destruction shall release the status value without destroying an owning domain or its payload. These value operations shall admit any vector of the declared flags, including transient inconsistent combinations used while updating a representation.

Status-only operations shall require live objects and synchronized access against mutation, but no numerical-library/thread initialization or coefficient constant stage. Their selected streams shall remain live. They shall not inspect domain coordinates, reconstruct numerical descriptions or perform coefficient arithmetic. A domain shall use a consistent status whose claims agree with its representation; the local check of 🔗 3. BD_Shape internal status consistency predicate alone shall not certify those numerical facts.

PPL-SPEC-001613
2. BD_Shape<T> internal status flag queries and transitions PPL-SPEC-001613

For a declared mask m and current flag word F, the private test_all(m) shall return (F&m) = m, and test_any(m) shall return (F&m) ≠ 0. The empty mask shall therefore match all and match no individual bit. set(m) shall replace F by F|m; reset(m) shall clear exactly the selected bits. Masks shall contain only the declared flags. Tests shall preserve state.

Each named test_* shall return its stored bit, except the zero-word predicate of 🔗 1. BD_Shape internal status value ownership and prerequisites. set_zero_dim_univ() shall clear all flags. reset_zero_dim_univ() shall replace zero by the empty-only state and preserve every nonzero state. set_empty() shall replace the entire word by the empty-only state; reset_empty() shall clear only the empty bit. Other named setters/resets shall set/clear only the indicated bit, subject to the following reduction rule: clearing shortest-path closure shall also clear shortest-path reduction, and setting reduction shall require closure already set and shall retain it.

Updates shall not generally reconcile other assertions. Transient inconsistent vectors shall remain available to 🔗 3. BD_Shape internal status consistency predicate, but shall not be installed as valid domain state. The prerequisites of 🔗 1. BD_Shape internal status value ownership and prerequisites shall apply.

3. BD_Shape<T> internal status consistency predicate PPL-SPEC-001614

OK() shall return true exactly for the zero word, empty-only, shortest-path-closed-only and closed-plus-reduced words. Empty shall exclude every other flag and reduction shall imply closure. Rounded/bounded arithmetic shall not turn these cache flags into a promise of exact numerical tightness.

The result shall be the same with and without assertions. Invalid combinations shall return false; assertion builds shall also write a diagnostic to the current std::cerr. Valid combinations shall not emit that diagnostic. The query shall preserve the flag word. Stream failures shall follow ordinary stream rules. This local predicate shall not inspect the domain payload or certify its ambient dimension, feasibility or cached numerical facts. The prerequisites of 🔗 1. BD_Shape internal status value ownership and prerequisites shall apply.

4. BD_Shape<T> internal status signed-keyword export PPL-SPEC-001615

ascii_dump(stream) shall write signed keywords in the order ZE EM SPC SPR. ZE shall be positive exactly for the zero flag word; each other sign shall equal its stored named bit. One space shall separate successive fields except for two spaces after EM. The record shall end with one trailing space. The exact separators shall follow the default stream formatting; caller-selected width/fill/alignment shall retain ordinary character/string insertion behavior.

Export shall preserve the stored flags, including transient inconsistent vectors, without reconciling claims or inspecting numerical payload. Partial output, state flags and exceptions shall follow the selected stream. The prerequisites of 🔗 1. BD_Shape internal status value ownership and prerequisites shall apply.

ascii_dump() shall send the same record to std::cerr. print() shall write No user level output operator defined for BD_Shape<T>::Status. followed by a flushed newline to std::cerr.

5. BD_Shape<T> internal status signed-keyword loading and rejection PPL-SPEC-001616

ascii_load(stream) shall extract exactly the signed keywords of 🔗 4. BD_Shape internal status signed-keyword export in that order using ordinary string extraction, including its whitespace/width and exception-mask behavior. Each token shall consist of one + or - followed by the exact expected keyword. Missing, malformed, reordered or truncated fields shall return false when extraction returns normally. A following token shall remain available after a complete record, apart from ordinary separating whitespace.

For parsed zero marker Z and remaining flag word F, success shall require Z ⇔ (F = 0) and the consistency predicate of 🔗 3. BD_Shape internal status consistency predicate. A complete consistent record shall replace all flags and return true independently of the destination's previous consistent state. A contradictory marker or incompatible completed flag vector shall return false with and without assertions; it shall not fail through an invariant assertion. A canonical zero word shall be accepted.

The BD loader shall accumulate fields in a local candidate. Lexical rejection, input exceptions and a contradictory ZE marker shall leave the prior word unchanged. After a complete canonical marker/word pair, it shall install that word and return its consistency result; a false consistency result may thus leave inconsistent loaded flags. The caller shall restore valid status before installing it as domain state. Stream/resource exceptions shall retain their ordinary propagation and completed temporary cleanup. The internal get_field parser shall assign its output Boolean only on a successful signed-keyword match and preserve it on rejection. Its keyword shall be a live nonnull null-terminated string, and its output Boolean shall be live and writable. The prerequisites of 🔗 1. BD_Shape internal status value ownership and prerequisites shall apply. These local checks shall not certify the full numerical payload or its cache claims; the owning domain's record loader shall retain 🔗 3. Compatible bounded-difference record loading and failure state.