Parma Polyhedra Library requirements
C++ octagonal readable presentation and owned storage
PPL-SPEC-001234
1. Human-readable octagonal presentation UID: PPL-SPEC-001234 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

Stream insertion shall write false for a shape whose emptiness is already certified, and true for a universe shape, including their zero-dimensional forms. Otherwise it shall write a conjunction of the stored finite unary and signed binary bounds. A logically empty shape whose emptiness has not been classified may be displayed as a contradictory conjunction. Presentation shall not require computing strong closure or provide a canonical constraint list.

Unary constraints shall precede binary constraints and shall be ordered by increasing coordinate identity. Each unary equality shall be displayed once; otherwise a finite lower side shall precede a finite upper side. For a stored unary bound on twice a coordinate, exact representable halving shall permit the form variable relation value. If such halving is not exact and representable in the selected bound profile, the doubled coefficient shall remain explicit. A sign may be moved to the coefficient side, including -2*variable <= bound, when this denotes the same halfspace. Printed relations, signs and constants shall retain the exact mathematical meaning of the stored bound.

Binary constraints shall be ordered by increasing larger coordinate identity, then increasing smaller coordinate identity. Difference constraints for each pair shall precede sum constraints. Two opposite finite bounds that are additive inverses shall be displayed as one equality; other finite sides shall be displayed as non-strict inequalities. Difference forms may reverse the coordinate order and relation to display a nonnegative constant. Sum forms shall keep the smaller-index coordinate first. Positive-infinite sides shall not be displayed. Consecutive constraints shall be separated by ", "; no ambient-dimension header shall be inserted.

Variable occurrences shall follow the active formatter and its live-callback prerequisites in 🔗 7. Active Variable formatter and initialized thread state and 🔗 8. Variable names, formatter dispatch and output failures. Bound values shall follow the admitted mathematical numeric stream output of 🔗 5. Mathematical numeric output and stream delivery status and 🔗 6. Checked numeric stream policy integration. Interpreted with their coordinate identities, the printed conjunction shall denote the source's represented real set.

Insertion shall return the supplied stream reference without adding a newline or explicitly flushing it. print() shall send the same presentation to the current std::cerr. Both operations shall preserve the source set, ambient dimension, stored status, matrix and ownership. Stream and formatter failures shall retain their applicable state, exception-mask and partial-output behavior. Rendering callbacks shall not mutate or invalidate traversed source objects.

The selected representation, numerical-runtime, lifetime and synchronization prerequisites of 🔗 1. Octagonal values, numerical profiles and valid use shall apply. The borrowed stream and its callback environment shall remain live throughout the call. Recoverable resource exceptions may propagate; discarded owned temporaries shall be released.

RATIONALE:

A readable conjunction preserves the meaning of signed unary, difference and sum bounds without requiring normalization or confusing the display with a reloadable stored record. Retaining a doubled unary coefficient prevents inexact halving from changing the displayed set.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library:

namespace IO_Operators {
  template <typename T>
  std::ostream& operator<<(std::ostream& stream,
                           const Octagonal_Shape<T>& value);
}
// Member of Octagonal_Shape<T>:
void print() const;
VERIFICATION_CRITERIA:

Compare independent literal text and the exact rational meaning of printed constraints for certified and unclassified empty states, universe, unary halves, equalities, all binary signs, both inequality orientations, zero and negative constants, and absent infinite sides. Exercise native integer, floating, GMP and admitted unsigned profiles. Cover custom variable names, stream flags/locales, no newline, stream identity, stderr forwarding and throwing/failed streams or formatters. Check source records before and after presentation rather than warming the source to form the expected text. For binary native bounds, cover odd and even subnormal significands, both signs, signed zeros and neighbors of the normal/subnormal transition. Compare unary equalities and both inequality orientations with exact rational values, retaining doubled coefficients for unrepresentable halves. Check exactness classification independently of the FPU inexact flag, including destination aliases and preservation of the caller's rounding direction.

SOURCE:

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_templates.hh; src/globals_defs.hh; tests/Octagonal_Shape/outputcontracts1.cc; tests/Octagonal_Shape/writeoctagon1.cc; tests/octagonalshapevalueoracle.hh; tests/octagonalshapetextmemoryspec1.cc; tests/octagonalshapetextmemorypublic1.cc.

PPL-SPEC-001235
2. Owned octagonal memory accounting UID: PPL-SPEC-001235 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

external_memory_in_bytes() shall report the owned external storage of the pseudo-triangular bound matrix under 🔗 4. Owned backing storage and live-payload memory accounting, including its backing-row allocation, retained capacity, owned row metadata and external payload of every physically live selected coefficient. Logically empty shapes, inactive geometric content or reduced ambient dimensions shall not remove still-owned allocated capacity from the count. Borrowed views, independently owned runtime temporaries, other objects and allocator bookkeeping shall be excluded.

total_memory_in_bytes() shall equal sizeof(Octagonal_Shape<T>) plus the external count. Sizes shall be those of the selected build/profile, and the sum shall fit memory_size_type. The selected live coefficient memory hooks shall be well-formed. Both queries shall preserve the source set, ambient dimension, stored status, matrix, ownership and lifetimes. They shall not classify emptiness or recompute strong closure.

The selected representation, numerical-runtime, lifetime and synchronization prerequisites of 🔗 1. Octagonal values, numerical profiles and valid use shall apply. Live owned storage shall remain unchanged during either query.

RATIONALE:

The logical number of constraints does not measure retained matrix capacity or multi-limb coefficient payloads. The enclosing object's fixed storage and its owned external allocation require distinct counts.

INTERFACE:

Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

memory_size_type external_memory_in_bytes() const;
memory_size_type total_memory_in_bytes() const;
VERIFICATION_CRITERIA:

Compare total/external identity and independent owned-allocation observations for native matrices, then account separately for live GMP integer/rational payloads. Cover zero dimensions, copies, assignment, exchange, coordinate growth/removal, empty values and retained capacities. Preserve raw records and cache conditions; exclude allocator administration and reusable scratch.

SOURCE:

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/OR_Matrix_defs.hh; src/OR_Matrix_templates.hh; src/DB_Row_templates.hh; tests/Octagonal_Shape/membytes1.cc; tests/ormatrixoperationsspec1.cc; tests/boxallocationfixture.hh; tests/octagonalshapetextmemoryspec1.cc; tests/octagonalshapetextmemorypublic1.cc.