Parma Polyhedra Library requirements
Internal interval metadata and flag storage
1. Boundary sides and interval metadata property keys PPL-SPEC-000661

Boundary_NS::LOWER and UPPER shall identify the lower and upper boundary respectively and have the corresponding ROUND_DOWN and ROUND_UP encodings. round_dir_check(side, check) shall return that bound direction, with ROUND_STRICT_RELATION exactly when check is true. It shall not inspect or change the hardware rounding mode.

Boundary_NS::SPECIAL and OPEN shall identify independent boundary properties. Interval_NS::CARDINALITY_0 and CARDINALITY_1 shall identify cached empty and singleton answers; CARDINALITY_IS shall identify whether the owner's applicable cached answer is established. Property values shall be Boolean, their default setter value true, and their unsupported query value false. Constructing a property key from a named enumeration value shall retain that value.

The metadata containers shall store claims about endpoints or cached answers; the owning interval shall establish their mathematical consistency. Changing an endpoint flag shall not implicitly establish or invalidate cardinality claims. Calls shall use live objects and named boundary sides; property keys shall meet the selected metadata type's interface. Access shall be synchronized against mutation. Metadata storage alone shall require no library or thread initialization, coefficient constants or FPU setup.

For constant-evaluable inputs and property/policy definitions, these operations shall support constant evaluation under the same stated preconditions.

PPL-SPEC-000662
2. Bounded unsigned flag-word updates preserve unrelated bits PPL-SPEC-000662

For a non-Boolean unsigned integer word type T of width w, reset_bits shall set the complete word to zero. Single-bit updates and queries shall require 0 ≤ b < w: reset_bit shall clear exactly bit b, set_bit(..., true) shall set it and set_bit(..., false) shall clear it, and get_bit shall return its Boolean value. Other bits shall be preserved.

Field operations shall require 0 ≤ s < w, 0 ≤ l < w and s + l ≤ w. set_bits shall also require its value v to satisfy 0 ≤ v < 2l; it shall replace exactly the field [s, s + l) with the binary digits of v. get_bits shall return those digits as a right-aligned T value without modifying the word. A zero-length field shall have value zero and perform no update. The operations shall have defined shifts under these preconditions and shall require no numerical initialization.

For constant-evaluable inputs and property/policy definitions, these operations shall support constant evaluation under the same stated preconditions.

3. Stateless interval metadata reports unsupported properties PPL-SPEC-000663

Interval_Info_Null<Policy> shall propagate may_be_empty, may_contain_infinity and check_inexact from its policy, and shall report store_special, store_open, cache_empty and cache_singleton as false. Default construction, copying, assignment, clearing and swapping shall retain no per-object property state.

Boundary and interval-property setters shall have no effect. Each property query shall return its property type's unsupported_value, including custom property types satisfying the required Value and default/unsupported value interface. clear_boundary_properties shall have no effect. Null-owner borrowing and initialization rules shall follow 🔗 1. Boundary sides and interval metadata property keys; text operations shall follow 🔗 8. Metadata ASCII representation and stream failure states.

For constant-evaluable inputs and property/policy definitions, these operations shall support constant evaluation under the same stated preconditions.

PPL-SPEC-000664
4. Shared openness view retains a separate Boolean value PPL-SPEC-000664

Interval_Info_Null_Open<Policy>(open) shall store the supplied Boolean openness value and report store_open as true. Its boundary query shall return that same stored value for OPEN on either side, and false for SPECIAL. Copying and assignment shall retain independent Boolean values. The type shall retain the null base's other policy traits and unsupported interval-property answers.

Inherited null-base setters, clearing and base swapping shall remain stateless and shall not change the derived openness value. This view shall not provide independently mutable lower/upper openness flags. Its own ASCII loading shall replace the shared Boolean as specified in 🔗 8. Metadata ASCII representation and stream failure states. Other prerequisites shall follow 🔗 1. Boundary sides and interval metadata property keys.

For constant-evaluable inputs and property/policy definitions, these operations shall support constant evaluation under the same stated preconditions.

5. Policy-selected metadata layout and cleared construction PPL-SPEC-000665

Interval_Info_Bitset<T, Policy> shall store metadata in one unsigned integer word. The policy shall provide Boolean may_be_empty, may_contain_infinity, check_inexact, store_special, store_open, cache_empty and cache_singleton traits and a nonnegative next_bit position. Each trait shall be exposed unchanged.

Starting at Policy::next_bit, the layout shall allocate lower-special, lower-open, upper-special and upper-open positions in that order, consuming one bit exactly when the corresponding property is stored. It shall then allocate a cardinality-known bit exactly when either cache is enabled, an empty-answer bit exactly when cache_empty is enabled, and a singleton- answer bit exactly when cache_singleton is enabled. Each named position and next_bit shall expose the corresponding layout offset. The selected layout shall fit within the word width.

Default construction and clear() shall establish an all-zero word, including policy-reserved prefix bits. The interval owner shall manage the meaning of any reserved prefix fields and ensure coherence of cached claims. Other validity and initialization conditions shall follow 🔗 1. Boundary sides and interval metadata property keys.

For constant-evaluable inputs and property/policy definitions, these operations shall support constant evaluation under the same stated preconditions.

PPL-SPEC-000666
6. Independent endpoint and cardinality flag updates PPL-SPEC-000666

For a valid layout in 🔗 5. Policy-selected metadata layout and cleared construction, setting SPECIAL or OPEN shall replace exactly that configured property on the selected side. Setting CARDINALITY_0, CARDINALITY_1 or CARDINALITY_IS shall replace exactly its configured bit. Omission of the value shall mean true. Every property query shall return its current configured Boolean value. Unsupported setters shall have no effect, and unsupported queries shall return false. An unnamed but representable Interval_NS::Property::Type enumeration value shall be unsupported.

clear_boundary_properties(side) shall clear exactly the selected side's stored special/open flags. Every other side, cache flag and reserved prefix bit shall be preserved. No setter shall infer relations among empty, singleton, known-status or endpoint flags; their consistent interpretation shall remain the interval owner's obligation. Other prerequisites shall follow 🔗 1. Boundary sides and interval metadata property keys and 🔗 5. Policy-selected metadata layout and cleared construction.

For constant-evaluable inputs and property/policy definitions, these operations shall support constant evaluation under the same stated preconditions.

PPL-SPEC-000667
7. Bitset metadata copies and exchanges preserve the complete word PPL-SPEC-000667

Copy construction and assignment of Interval_Info_Bitset<T, Policy> shall preserve the source's complete word in a distinct owner, including reserved prefix bits. Assignment shall admit self-assignment and return its target. Later mutation or destruction of either owner shall not change the other's stored word. m_swap and free swap shall exchange both complete words, admit self-swapping and preserve every bit. Other valid-use conditions shall follow 🔗 5. Policy-selected metadata layout and cleared construction.

For constant-evaluable inputs and property/policy definitions, these operations shall support constant evaluation under the same stated preconditions.

8. Metadata ASCII representation and stream failure states PPL-SPEC-000668

For Interval_Info_Null, ASCII output shall emit no bytes and loading shall consume no bytes, preserve the object and return true. For Interval_Info_Null_Open, output shall insert open or closed using ordinary string formatting, including the stream's width, fill and alignment. Loading shall extract a token under ordinary string-extraction rules, including the stream's width and whitespace settings; it shall assign the Boolean meaning and return true exactly for open and closed. Invalid or missing tokens shall return false and preserve the preceding Boolean value. With default compatible formatting, output followed by loading shall retain the shared Boolean.

For Interval_Info_Bitset with a noncharacter unsigned integer word type, ASCII output shall insert the complete word in hexadecimal base and loading shall extract a complete word in hexadecimal base using ordinary stream numeric syntax. Other stream formatting shall follow ordinary integer insertion/extraction rules. On normal return, including a failed load that returns false, both operations shall restore the preceding formatting flags. A successful load shall replace the complete word and return true; a failed numeric extraction shall return false and may change the word according to the stream's unsigned-integer extraction rules. Reserved/unused bits shall be retained and shall not cause rejection. With compatible stream formatting, output followed by loading shall retain the complete word.

Stream exceptions shall propagate under the stream's exception-mask rules; partial output/input and temporary hexadecimal base may remain after an exception. Calls shall preserve live valid metadata owners and require live streams, synchronized output/input access and the type's own valid-use rules. No numerical initialization shall be required.