Parma Polyhedra Library requirements
C++ octagonal descriptor addition and refinement

C++ octagonal descriptor addition and refinement

1. Addition of supported octagonal constraints
UID: PPL-SPEC-001167
STATUS: APPROVED
COMPONENT: OCTAGONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

add_constraint(c) shall conjoin the receiver with the target-profile normalization of the admitted constraint c. The nonconstant supported forms shall be unary bounds and signed two-coordinate bounds with equal nonzero coefficient magnitudes, including equalities. Constant tautologies shall have no effect; constant falsehoods shall make the receiver empty. Constant strict conditions shall retain their truth value. A nonconstant strict constraint or an unsupported nonconstant linear form shall throw std::invalid_argument without changing the receiver's represented set.

For a unary normalized inequality sxi ≤ b, its stored primitive bound shall be the least admitted target bound at least 2b in the doubled-unary encoding. For a binary normalized inequality sixi + sjxj ≤ b, the bound shall be the least admitted target bound at least b. Signs shall belong to { − 1, 1}. Each side of an equality shall have its own outward bound. The result shall be exactly the intersection of the entry set with these normalized target inequalities; when the normalized bounds are exact, this shall be the concrete conjunction. Every entry point satisfying c shall be retained.

add_constraints(cs) and add_recycled_constraints(cs) shall conjoin all admitted system rows with the same normalization and validation rules. A descriptor or system dimension at most the receiver dimension shall be accepted, with zero coefficients in omitted trailing coordinates. A larger dimension shall throw std::invalid_argument before changing the receiver's represented set. An empty receiver shall still undergo these validation rules.

An ordinary copying call shall preserve its source descriptor or system. The result shall not borrow source storage. After a recycled-system call, including exceptional return, the only required property of cs shall be safe destruction. A rejected system need not undo earlier accepted rows; no particular row visitation order shall be promised.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. All operands and input descriptors shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved. Recycled sources shall retain their explicit destruction-only guarantee.

RATIONALE:

An adding operation validates optimal support instead of silently discarding unsupported information. The doubled unary representation must be normalized before outward rounding, including when the storage type is integral.

INTERFACE:

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

void add_constraint(const Constraint& c);
void add_constraints(const Constraint_System& cs);
void add_recycled_constraints(Constraint_System& cs);
VERIFICATION_CRITERIA:

Normalize raw integer coefficients with exact GMP rationals, using all four binary sign combinations and unary doubled bounds. Conjoin the independent halfspaces with the entry real set. Cover equality, common scales, negative constants, exact and inexact normalization, tautology, falsehood, strict constant rows, unsupported forms, dimension validation on empty and nonempty receivers, ordinary and recycled systems, source ownership and partial batch failure. Do not query recycled donors beyond their destruction guarantee.

BIBLIOGRAPHY:

BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

SOURCE:

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/constraints1.cc; tests/Octagonal_Shape/systemdimension1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

PPL-SPEC-001168
2. Addition of supported octagonal congruences
UID: PPL-SPEC-001168
STATUS: APPROVED
COMPONENT: OCTAGONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

add_congruence(cg) shall accept congruence equalities whose expression is an admitted unary or equal-magnitude signed two-coordinate equality, together with constant tautologies and falsehoods. An accepted equality shall conjoin the two outward-normalized inequalities defined in 🔗 1. Addition of supported octagonal constraints. A tautology shall have no effect; a falsehood shall make the receiver empty.

A nontrivial proper congruence or an unsupported nonconstant equality shall throw std::invalid_argument without changing the receiver's represented set. An adding call shall not silently discard a nontrivial periodic restriction. add_congruences(cgs) and add_recycled_congruences(cgs) shall apply these rules to the system.

A descriptor or system dimension above the receiver dimension shall throw std::invalid_argument before changing its represented set, including on an empty receiver. Smaller dimensions shall have zero trailing coefficients. Ordinary copying forms shall preserve their source values and shall not borrow their storage. A recycled system shall be required only to remain safely destructible after normal or exceptional return. If a later system row is rejected, preceding accepted rows need not be rolled back; no row visitation order shall be promised.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. All operands and input descriptors shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved. Recycled sources shall retain their explicit destruction-only guarantee.

RATIONALE:

Equality is convex and can be expressed by opposite octagonal bounds, while a nontrivial periodic congruence generally cannot. Explicit rejection keeps addition distinct from conservative refinement.

INTERFACE:

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

void add_congruence(const Congruence& cg);
void add_congruences(const Congruence_System& cgs);
void add_recycled_congruences(Congruence_System& cgs);
VERIFICATION_CRITERIA:

Derive equality halfspaces independently and apply the rational normalization oracle for 🔗 1. Addition of supported octagonal constraints. Include scaled unary and all signed binary equalities, constant true/false proper congruences, nontrivial periodic rows, unsupported equalities, trailing dimensions, empty states, ordinary/recycled batches and late rejection. Preserve copying inputs and safely destroy recycled inputs.

BIBLIOGRAPHY:

BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

SOURCE:

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/congruences1.cc; tests/Octagonal_Shape/systemdimension1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh; tests/Octagonal_Shape/constraints1.cc.

PPL-SPEC-001169
3. Conservative refinement by linear constraints
UID: PPL-SPEC-001169
STATUS: APPROVED
COMPONENT: OCTAGONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

refine_with_constraint(c) shall refine the receiver by an admitted linear constraint without rejecting a row merely because its nonconstant form is not octagonal. A supported closed unary or equal-magnitude signed binary row shall have the outward-normalized conjunction in 🔗 1. Addition of supported octagonal constraints. A supported nonconstant strict inequality shall first be relaxed to its non-strict counterpart and then normalized. An unsupported nonconstant linear form shall have no effect.

Constant true rows shall have no effect and constant false rows shall make the receiver empty, including the strict false condition 0 > 0. An empty receiver shall remain empty. refine_with_constraints(cs) shall apply these rules to the entire conjunction. For entry set X, exact condition set C and result R, X∩C ⊆ R ⊆ X shall hold. For a system, the represented result shall be the intersection with all the retained, relaxed and outward-normalized rows; ignored rows shall impose no restriction.

Source dimensions at most the receiver dimension shall be admitted with zero trailing coefficients. A larger descriptor or system dimension shall throw std::invalid_argument before changing the receiver's represented set, including when the receiver is empty. Copying calls shall preserve source descriptors and own any resulting bounds independently. Exceptions during a system call need not roll back previously applied refinements.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. All operands and input descriptors shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

RATIONALE:

Filtering may conservatively relax strictness or omit unsupported rows, while adding has a stricter admission contract. The two operations must still agree on supported closed primitive normalization.

INTERFACE:

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

void refine_with_constraint(const Constraint& c);
void refine_with_constraints(const Constraint_System& cs);
VERIFICATION_CRITERIA:

Conjoin independently normalized supported rows, relax nonconstant strict rows, and leave unsupported rows out of the expected conjunction. Verify exact result equality to that conjunction and containment of every original satisfying point. Cover constants, unsupported sparse forms, all signs, rounded cutoffs, empty/zero dimensions, late inconsistent rows, dimension errors, source preservation and safe failure cleanup.

BIBLIOGRAPHY:

BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

SOURCE:

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/constraints1.cc; tests/Octagonal_Shape/systemdimension1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

PPL-SPEC-001170
4. Conservative refinement by congruences
UID: PPL-SPEC-001170
STATUS: APPROVED
COMPONENT: OCTAGONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

refine_with_congruence(cg) shall conjoin an octagonal congruence equality using the outward-normalized opposite inequalities in 🔗 1. Addition of supported octagonal constraints. An unsupported nonconstant equality shall have no effect. A proper constant false congruence shall make the receiver empty; other proper congruences shall have no effect. A tautology shall have no effect. The real carrier in 🔗 1. Octagonal values, numerical profiles and valid use shall remain unchanged; ignored periodic information shall not turn this call into an integer-valued state restriction.

refine_with_congruences(cgs) shall apply those rules to the conjunction. For entry set X, supplied congruence set C and result R, X∩C ⊆ R ⊆ X shall hold. The result shall equal the intersection with all accepted normalized equality rows, unless a false row makes it empty. Empty receivers shall remain empty.

Larger descriptor or system dimensions shall throw std::invalid_argument before changing the receiver's represented set, including on empty receivers. Smaller dimensions shall use zero trailing coefficients. Copying calls shall preserve their source values; result bounds shall not borrow source storage. A system call that throws need not roll back preceding accepted refinements.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. All operands and input descriptors shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

RATIONALE:

A convex octagonal refinement can retain supported equalities while ignoring nonconvex periodic information. Soundness concerns the real input states satisfying the congruence, not an implicit integer carrier.

INTERFACE:

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

void refine_with_congruence(const Congruence& cg);
void refine_with_congruences(const Congruence_System& cgs);
VERIFICATION_CRITERIA:

Use independent rational equality halfspaces and direct truth tests for constant proper congruences. Exercise all signed binary equalities, unary halves, unsupported unequal-magnitude equalities, periodic rows, dimensions, empty receivers, copying systems and source lifetime. Require both contraction and preservation of states satisfying the original congruences.

BIBLIOGRAPHY:

BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

SOURCE:

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/congruences1.cc; tests/Octagonal_Shape/systemdimension1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh; tests/Octagonal_Shape/constraints1.cc.