Parma Polyhedra Library requirements
Internal interval result flags and cutoff values
1. Interval result possibilities and status-flag set operations PPL-SPEC-000681

I_Result shall encode possible result shapes using independent bits: I_EMPTY = 1, I_SINGLETON = 2, I_SOME = 4 for a nonsingleton non-universe result, and I_UNIVERSE = 8. I_NOT_EMPTY shall be their three nonempty alternatives, I_ANY all four alternatives, I_NOT_UNIVERSE the first three and I_NOT_DEGENERATE the singleton and nonsingleton non-universe alternatives. A set shape bit shall mean that shape remains possible, not that every named possibility is established.

Independent status bits shall be I_EXACT = 16, I_INEXACT = 32, I_CHANGED = 64, I_UNCHANGED = 128 and I_SINGULARITIES = 256. They shall mean definite exactness, definite inexactness, definite set change, definite absence of set change, and undefined combinations of operand values, respectively. Their absence shall not establish the corresponding opposite claim. The operation producing a result shall determine which claims it establishes.

For bit sets A, B within these nine positions, a | b shall encode A∪B, a & b shall encode A∩B, and a - b shall encode A⧵B. These operators shall not reconcile logically conflicting claims or mutate their operands. They shall require no numerical or library initialization.

combine(lower, upper) shall accept numerical endpoint Result values and return I_ANY with no definite status claim. Numerical endpoint outcomes alone shall not establish interval shape, set-operation exactness or entry-to-result change. In particular, numerical V_EQ outcomes shall not be reinterpreted as logical I_EMPTY or I_CHANGED bits.

2. Cutoff value storage and explicit borrowing criteria PPL-SPEC-000682

Use_By_Ref<Use_Slow_Copy, T>::value shall equal Slow_Copy<T>::value; By_Value shall select false and By_Ref true. For owned storage, Val_Or_Ref<T, Criteria> shall contain a distinct T object, use T as both Arg_Type and Return_Type, and default construct that value with T(). Construction, assignment and set shall copy the supplied value using T's ordinary operations. get and the conversion operator shall return its current value by value.

For borrowed storage, Arg_Type shall be T& and Return_Type const T&. Default construction shall leave the holder unbound; no read or value conversion shall be permitted before binding. Construction, assignment and set from a mutable lvalue shall bind its identity; the overload with a const T& and Boolean argument shall bind that same const object's identity. The Boolean argument's value shall not change storage or request a snapshot. get and conversion shall expose the live bound object as a const reference, reflecting subsequent valid donor changes.

Implicit copying/assignment of a holder shall preserve its owned value or borrowed identity according to the selected criterion. Assignment from an argument shall return the holder. Borrowed donors shall outlive every use of their values; copying an unbound holder shall not bind it. All referenced objects shall remain live and access shall be synchronized against mutation. The selected T operations, representability and resource prerequisites shall hold; their exceptions shall propagate without a universal rollback promise. Storage alone shall require no library, coefficient-constant or FPU initialization beyond any prerequisites imposed by the selected T.

3. Interval-constraint relation adapter preserves supported relation codes PPL-SPEC-000683

I_Constraint_Rel constructed from a supported Relation_Symbol shall preserve its numerical relation encoding: equality, strict/nonstrict less, strict/nonstrict greater and disequality shall correspond to V_EQ, V_LT, V_LE, V_GT, V_GE and V_NE. Construction from Result shall require a defined result code satisfying result_relation_class(result) == result; it shall retain that code unchanged. Codes with unrelated status fields shall not meet that precondition.

Its public rel member and conversion to Result shall return the stored code; ordinary copying and assignment shall retain it independently. No cutoff value or numerical initialization shall be required. Interpreting that relation with a cutoff shall follow the selected constraint operation's supported relation/class prerequisites.

4. Interval constraints retain relation and cutoff ownership PPL-SPEC-000684

I_Constraint<T, Criteria, extended> shall combine a relation code with the cutoff holder selected in 🔗 2. Cutoff value storage and explicit borrowing criteria. Default construction shall set rel() to V_LGE; its owned cutoff shall have T()'s value and its borrowed cutoff shall remain unbound until set. value() shall follow the holder's value/reference return type and lifetime rules; an unbound borrowed default shall admit relation inspection but not cutoff access.

Construction from a relation and cutoff shall retain that relation and store or borrow the cutoff according to the criterion. set shall replace the relation and update/rebind the cutoff by those same rules. The Boolean acknowledgment shall not force a copy, regardless of its value. Admitted converting overloads shall apply ordinary T construction/assignment under the source type's valid conversion and representability conditions. extended shall not change the ownership or relation/value access behavior specified here.

Implicit copies and assignments shall retain the relation and the selected owned value or borrowed identity. Owned copies shall survive donor scope and mutate independently; borrowed copies shall retain their donor's lifetime obligation. Self-assignment shall preserve the pair. Underlying value exceptions shall propagate; a failed set may already have replaced the relation and shall not promise atomic replacement of the pair. The type shall derive from I_Constraint_Common and I_Constraint_Base for the supported interval-constraint dispatch. Other prerequisites shall follow 🔗 2. Cutoff value storage and explicit borrowing criteria and 🔗 3. Interval-constraint relation adapter preserves supported relation codes.

PPL-SPEC-000685
5. Interval-constraint factories preserve explicit storage selection PPL-SPEC-000685

The two-argument i_constraint(relation, value) overloads shall return I_Constraint<T, Use_Slow_Copy, false> using the default storage trait. For a borrowed cutoff, the unacknowledged overload shall require a mutable lvalue; borrowing a const cutoff shall require the explicit Boolean argument. For an owned cutoff, mutable or const input shall be copied.

Overloads with an explicit criterion object shall return I_Constraint<T, Criteria, false> and use that criterion, overriding the slow-copy trait. By_Value shall therefore retain an independent snapshot even for an expensive type, and By_Ref shall retain live reference identity even for a cheap type. The Boolean overload shall acknowledge const borrowing without changing ownership when true or false. A criterion object shall select a type; its own lifetime shall not become the cutoff lifetime. The retained relation and cutoff, exception behavior and valid-use conditions shall follow 🔗 4. Interval constraints retain relation and cutoff ownership.