Parma Polyhedra Library requirements
Polyhedron internal status

Polyhedron internal status

UID:
VERSION:
CLASSIFICATION:
PREFIX:
Type
Level
MID
UID
REFS
Title
Statement
Rationale
Comment
BIBLIOGRAPHY
STATUS
COMPONENT
APPLICABILITY
VERIFICATION_METHODS
VERIFICATION_CRITERIA
SOURCE
LANGUAGE
VISIBILITY
INTERFACE
SW_SPEC
1
PPL-SPEC-001602

The nested Status shall own a finite set of named Boolean flags: empty, c_up_to_date, g_up_to_date, c_minimized, g_minimized, sat_c_up_to_date, sat_g_up_to_date, c_pending, g_pending. 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. Polyhedron internal status consistency predicate alone shall not certify those numerical facts.

Cached facts need an independent value and an explicit distinction between status-bit consistency and the truth of claims about a numerical object.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check default/copy/assignment, self-assignment, independent mutation and source destruction over every declared flag vector. Use status-only tests without a numerical initialization owner; inspect payload independence.

src/Polyhedron_defs.hh; src/Ph_Status_idefs.hh; src/Ph_Status_inlines.hh; src/Ph_Status.cc; tests/statushelpersspec1.cc; tests/statusloadpublic1.cc.

CPP
Internal

Internal nested type Polyhedron::Status in Ph_Status_idefs.hh, included through Polyhedron_defs.hh. Names belong to Parma_Polyhedra_Library; member excerpts apply within that nested class. The owning class retains its declared access restrictions.

Status();
Status(const Status&);
Status& operator=(const Status&);
~Status();
SW_SPEC
2
PPL-SPEC-001603
PPL-SPEC-001603
Polyhedron internal status flag queries and transitions

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. Polyhedron 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 no additional flag dependencies enforced by these individual updates.

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

Representation algorithms need exact local cache updates without implicit numerical recomputation or unrelated changes to known facts.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Compare all flag words and declared masks against independent set algebra. Check every named update and query, both zero-reset cases, whole-word empty replacement, and independent copies.

src/Polyhedron_defs.hh; src/Ph_Status_idefs.hh; src/Ph_Status_inlines.hh; src/Ph_Status.cc; tests/statushelpersspec1.cc; tests/statusloadpublic1.cc.

CPP
Internal

Internal nested type Polyhedron::Status in Ph_Status_idefs.hh, included through Polyhedron_defs.hh. Names belong to Parma_Polyhedra_Library; member excerpts apply within that nested class. The owning class retains its declared access restrictions.

bool test_zero_dim_univ() const;
void set_zero_dim_univ();
void reset_zero_dim_univ();
bool test_empty() const;
void set_empty();
void reset_empty();
bool test_c_up_to_date() const;
void set_c_up_to_date();
void reset_c_up_to_date();
bool test_g_up_to_date() const;
void set_g_up_to_date();
void reset_g_up_to_date();
bool test_c_minimized() const;
void set_c_minimized();
void reset_c_minimized();
bool test_g_minimized() const;
void set_g_minimized();
void reset_g_minimized();
bool test_sat_c_up_to_date() const;
void set_sat_c_up_to_date();
void reset_sat_c_up_to_date();
bool test_sat_g_up_to_date() const;
void set_sat_g_up_to_date();
void reset_sat_g_up_to_date();
bool test_c_pending() const;
void set_c_pending();
void reset_c_pending();
bool test_g_pending() const;
void set_g_pending();
void reset_g_pending();
// Private primitives; flags_t is the declared unsigned flag-word type.
bool test_all(flags_t mask) const;
bool test_any(flags_t mask) const;
void set(flags_t mask);
void reset(flags_t mask);
SW_SPEC
3
PPL-SPEC-001604

Let E, C, G, MC, MG, SC, SG, PC, PG denote respectively empty, current constraints, current generators, minimized constraints, minimized generators, the two current saturation matrices, pending constraints and pending generators. OK() shall return true exactly for the following consistent combinations of the declared flags:

  • The zero word and the empty-only word shall be consistent.
  • Empty shall exclude every other flag.
  • MC ⇒ C and MG ⇒ G.
  • (SC∨SG) ⇒ (C∧G).
  • ¬(PC∧PG).
  • (PC∨PG) ⇒ (MC∧MG∧(SC∨SG)).

These rules shall admit 28 flag words, including zero.

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. Polyhedron internal status value ownership and prerequisites shall apply.

Cache assertions have logical dependencies. Checking their finite Boolean model must remain distinct from checking the numerical representation.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Enumerate every flag vector against an independent propositional oracle; check accepted-state counts, source preservation and diagnostic presence in assertion/release builds. Inspect payload independence.

src/Polyhedron_defs.hh; src/Ph_Status_idefs.hh; src/Ph_Status_inlines.hh; src/Ph_Status.cc; tests/statushelpersspec1.cc; tests/statusloadpublic1.cc.

CPP
Internal

Internal nested type Polyhedron::Status in Ph_Status_idefs.hh, included through Polyhedron_defs.hh. Names belong to Parma_Polyhedra_Library; member excerpts apply within that nested class. The owning class retains its declared access restrictions.

bool OK() const;
SW_SPEC
4
PPL-SPEC-001605
Polyhedron internal status signed-keyword export

ascii_dump(stream) shall write signed keywords in the order ZE EM CM GM CS GS CP GP SC SG. ZE shall be positive exactly for the zero flag word; each other sign shall equal its stored named bit. One space shall separate ZE/EM, CM/GM, CS/GS, CP/GP and SC/SG; two spaces shall separate the successive pairs. 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. Polyhedron 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 class Polyhedron::Status. followed by a flushed newline to std::cerr.

Serialized cache claims and diagnostics must retain the actual flag state without triggering domain normalization.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check exact field signs/order/separators over every flag word, stream formatting and source preservation. Exercise returning/throwing output failures and the declared stderr routes, including their flush behavior.

src/Polyhedron_defs.hh; src/Ph_Status_idefs.hh; src/Ph_Status_inlines.hh; src/Ph_Status.cc; tests/statushelpersspec1.cc; tests/statusloadpublic1.cc.

CPP
Internal

Internal nested type Polyhedron::Status in Ph_Status_idefs.hh, included through Polyhedron_defs.hh. Names belong to Parma_Polyhedra_Library; member excerpts apply within that nested class. The owning class retains its declared access restrictions.

void ascii_dump(std::ostream& stream) const;
void ascii_dump() const;
void print() const;
SW_SPEC
5
PPL-SPEC-001606
PPL-SPEC-001606
Polyhedron internal status signed-keyword loading and rejection

ascii_load(stream) shall extract exactly the signed keywords of 🔗 4. Polyhedron 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. Polyhedron 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 loader shall reset its word to zero before reading the first field. Successfully parsed fields may already have updated the receiver when a later field is rejected or throws. Completed invalid flags may remain installed. Rollback and status consistency after rejection shall not be promised. 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. Polyhedron 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 🔗 1. Reloadable polyhedral ASCII descriptions.

The redundant zero marker and the remaining flags must describe one status. Local inconsistency is a recoverable parse rejection in every build mode.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Enumerate all flag/ZE pairs against the propositional oracle and preserve all canonical valid records. Load every valid source over every consistent prior state and retain a suffix token. Reject every malformed/truncated field position; exercise width/whitespace settings, returning failures, input exceptions and output preservation of the translation-unit-local parser by inspection. Check the stated partial-state behavior and reject contradictory markers through full public-domain loaders.

src/Polyhedron_defs.hh; src/Ph_Status_idefs.hh; src/Ph_Status_inlines.hh; src/Ph_Status.cc; tests/statushelpersspec1.cc; tests/statusloadpublic1.cc.

CPP
Internal

Internal nested type Polyhedron::Status in Ph_Status_idefs.hh, included through Polyhedron_defs.hh. Names belong to Parma_Polyhedra_Library; member excerpts apply within that nested class. The owning class retains its declared access restrictions.

bool ascii_load(std::istream& stream);
// Internal helper, in its defining translation unit or implementation namespace:
bool get_field(std::istream& stream, const char* keyword, bool& positive);