C++ rational-grid refinement
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
Parents:
|
Incoming link from:
2. Copying congruence-system addition and refinement
1 |
add_congruence(cg) and refine_with_congruence(cg) shall replace the receiver G by G∩{x ∣ cg(x)}. Equalities and proper congruences shall have their meanings in 🔗 1. Rational-grid values, coefficient profile and valid use. Tautologies shall preserve the grid and contradictions shall produce empty. Lower-dimensional rows shall be zero extended; excess declared row dimension shall throw std::invalid_argument before mutation, including for an empty receiver. The external row value shall be preserved. The initialization, lifetime, synchronization and computational-arithmetic conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is stated, ambient dimension shall be preserved. Resource and numerical exceptions may propagate; surviving ownership shall permit destruction, without an assumed rollback or guarantee that further queries are valid. Receiver-owned views may be invalidated as in 🔗 10. Borrowed congruence and generator views of grid values. |
Adding a congruence is an exact meet, including modular inconsistency that is detected only when descriptions are normalized. |
BagnaraDHMZ07 | Section 3, grid definitions, representations and operations. |
|
|
|
|
Cross equality, proper, tautological and contradictory rows with empty, singleton, periodic and continuous grids, both storage choices, pending contradictions and both cached descriptions. Check lower/excess dimensions and source preservation. |
src/Grid_defs.hh; src/Grid_inlines.hh; src/Grid_public.cc; src/Grid_nonpublic.cc; tests/Grid/addcongruence1.cc; tests/Grid/refinewithcongruences1.cc; tests/gridrefinementspec1.cc; tests/gridoperationsfailure1.cc; tests/gridedgespec1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Member declarations of Grid. void add_congruence(const Congruence& cg); void refine_with_congruence(const Congruence& cg); |
|
|
SW_SPEC
|
2 |
|
|
Parents:
|
Incoming link from:
3. Recycling congruence-system addition
1 |
add_congruences(cgs) and refine_with_congruences(cgs) shall intersect the receiver with the conjunction of all input rows, exactly as repeated 🔗 1. Single congruence addition and refinement. An empty system shall preserve the grid. An independently supplied input shall retain its value, declared dimension and storage, including on exceptional return. The receiver's current congruence view may be supplied; its entry value shall be used before invalidation. Excess declared input dimension shall throw std::invalid_argument before mutation, even for no rows or an empty receiver. The initialization, lifetime, synchronization and computational-arithmetic conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is stated, ambient dimension shall be preserved. Resource and numerical exceptions may propagate; surviving ownership shall permit destruction, without an assumed rollback or guarantee that further queries are valid. Receiver-owned views may be invalidated as in 🔗 10. Borrowed congruence and generator views of grid values. |
Copying a conjunction must not depend on row order, redundancy or whether the source is a receiver-owned current view. |
BagnaraDHMZ07 | Section 3, grid definitions, representations and operations. |
|
|
|
|
Compare bulk and single-row exact meets with independent cosets. Include borrowed self systems, unused declared dimensions, empty systems, contradictions and source records. |
src/Grid_defs.hh; src/Grid_inlines.hh; src/Grid_public.cc; src/Grid_nonpublic.cc; tests/Grid/addcongruences1.cc; tests/Grid/refinewithcongruences1.cc; tests/gridrefinementspec1.cc; tests/gridoperationsfailure1.cc; tests/gridedgespec1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Member declarations of Grid. void add_congruences(const Congruence_System& cgs); void refine_with_congruences(const Congruence_System& cgs); |
|
|
SW_SPEC
|
3 |
|
|
Parents:
|
|
add_congruences(std::move(cgs)) and add_recycled_congruences(cgs) shall produce the same mathematical grid and dimension-rejection behavior as 🔗 2. Copying congruence-system addition and refinement. The source shall be a separate writable system without receiver-owned storage. Its storage may be transferred; after successful or exceptional return it shall retain ownership sufficient for destruction, without a guarantee about its rows or suitability for queries. The initialization, lifetime, synchronization and computational-arithmetic conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is stated, ambient dimension shall be preserved. Resource and numerical exceptions may propagate; surviving ownership shall permit destruction, without an assumed rollback or guarantee that further queries are valid. Receiver-owned views may be invalidated as in 🔗 10. Borrowed congruence and generator views of grid values. |
Recycling changes source ownership permissions without changing conjunction semantics. |
BagnaraDHMZ07 | Section 3, grid definitions, representations and operations. |
|
|
|
|
Check copied and recycled systems against the same independent intersections, including empty, contradictory, lower-dimensional and excess-dimensional systems. Exercise allocation failures and destruction of both objects. |
src/Grid_defs.hh; src/Grid_inlines.hh; src/Grid_public.cc; src/Grid_nonpublic.cc; tests/Grid/addcongruences1.cc; tests/gridrefinementspec1.cc; tests/gridoperationsfailure1.cc; tests/gridedgespec1.cc; tests/gridconsuminginsertions1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Member declarations of Grid. void add_congruences(Congruence_System&& cgs); void add_recycled_congruences(Congruence_System& cgs); |
|
|
SW_SPEC
|
4 |
|
|
Parents:
|
Incoming link from:
5. Copying and recycling strict constraint-system addition
1 |
add_constraint(c) shall intersect the receiver exactly with an equality or constant constraint. A constant true inequality shall preserve the grid; a constant false inequality shall produce empty. A nonconstant inequality shall throw std::invalid_argument when processed. An already marked empty receiver may return without processing a dimension-compatible row. Excess declared constraint dimension shall throw std::invalid_argument before mutation, even for empty. The initialization, lifetime, synchronization and computational-arithmetic conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is stated, ambient dimension shall be preserved. Resource and numerical exceptions may propagate; surviving ownership shall permit destruction, without an assumed rollback or guarantee that further queries are valid. Receiver-owned views may be invalidated as in 🔗 10. Borrowed congruence and generator views of grid values. |
A grid can represent affine equalities and the two constant truth values; a general half-space is not a grid. |
BagnaraDHMZ07 | Section 3, grid definitions, representations and operations. |
|
|
|
|
Check equalities, strict/non-strict constant truth values, nonconstant inequalities, zero dimensions and dimension errors. Distinguish unsupported-row processing from the marked-empty early return. |
src/Grid_defs.hh; src/Grid_inlines.hh; src/Grid_public.cc; src/Grid_nonpublic.cc; tests/Grid/addconstraint1.cc; tests/gridrefinementspec1.cc; tests/gridoperationsfailure1.cc; tests/gridedgespec1.cc; tests/Grid/addconstraints1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Member declarations of Grid. void add_constraint(const Constraint& c); |
|
|
SW_SPEC
|
5 |
|
|
Parents:
|
|
add_constraints(cs) and add_recycled_constraints(cs) shall process the conjunction using the supported-constraint rules in 🔗 4. Strict addition of a single linear constraint. Excess declared system dimension shall throw std::invalid_argument before mutation, even for no rows or empty. Copying shall preserve the source value, dimension and storage. Recycling requires a separate writable source and guarantees its destruction after return; it need not actually transfer its storage. When an unsupported inequality is reached, earlier accepted rows may already have changed the receiver; rollback shall not be assumed. The initialization, lifetime, synchronization and computational-arithmetic conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is stated, ambient dimension shall be preserved. Resource and numerical exceptions may propagate; surviving ownership shall permit destruction, without an assumed rollback or guarantee that further queries are valid. Receiver-owned views may be invalidated as in 🔗 10. Borrowed congruence and generator views of grid values. |
System processing preserves exact supported meets but does not offer transactional rejection of a later unsupported row. |
BagnaraDHMZ07 | Section 3, grid definitions, representations and operations. |
|
|
|
|
Check empty and mixed supported systems, row ordering, a later unsupported inequality, source preservation, zero dimensions, excess declared dimensions and allocation failure ownership. Check coefficient storage transfer for an equality when source and destination representations match, and NNC equality rows with hidden epsilon coordinates, including dimension extension. |
src/Grid_defs.hh; src/Grid_inlines.hh; src/Grid_public.cc; src/Grid_nonpublic.cc; tests/Grid/addconstraints1.cc; tests/gridrefinementspec1.cc; tests/gridoperationsfailure1.cc; tests/gridedgespec1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Member declarations of Grid. void add_constraints(const Constraint_System& cs); void add_recycled_constraints(Constraint_System& cs); |
|
|
SW_SPEC
|
6 |
|
|
Parents:
|
|
refine_with_constraint(c) and refine_with_constraints(cs) shall intersect with every equality and produce empty for an inconsistent constant constraint. Other inequalities shall be ignored. Thus the result shall contain the concrete constrained set and shall never introduce points outside the entry grid. Input values shall be preserved. Excess declared input dimension shall throw std::invalid_argument before mutation, including an empty receiver or system. The initialization, lifetime, synchronization and computational-arithmetic conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is stated, ambient dimension shall be preserved. Resource and numerical exceptions may propagate; surviving ownership shall permit destruction, without an assumed rollback or guarantee that further queries are valid. Receiver-owned views may be invalidated as in 🔗 10. Borrowed congruence and generator views of grid values. |
Conservative refinement can ignore unsupported half-spaces while still recognizing a false constant constraint. |
BagnaraDHMZ07 | Section 3, grid definitions, representations and operations. |
|
|
|
|
Compare with the conjunction of equalities and constant truth values; cross nonconstant inequalities, inconsistency, dimensions, source storage and cache histories. |
src/Grid_defs.hh; src/Grid_inlines.hh; src/Grid_public.cc; src/Grid_nonpublic.cc; tests/Grid/refinewithconstraints1.cc; tests/gridrefinementspec1.cc; tests/gridoperationsfailure1.cc; tests/gridedgespec1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Member declarations of Grid. void refine_with_constraint(const Constraint& c); void refine_with_constraints(const Constraint_System& cs); |
|
|
SW_SPEC
|
7 |
|
|
Parents:
|
|
constraints() shall return an independently owned equality-constraint system defining the real affine hull of the receiver. Empty shall yield an inconsistent system, including when emptiness follows from incompatible proper congruences not previously normalized. minimized_constraints() shall return a minimal equality description of the same affine hull. Both shall preserve ambient dimension, receiver value and ownership, while normalization caches may change. The result shall be independent of storage, redundant rows and description history. The initialization, lifetime, synchronization and computational-arithmetic conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is stated, ambient dimension shall be preserved. Resource and numerical exceptions may propagate; surviving ownership shall permit destruction, without an assumed rollback or guarantee that further queries are valid. Receiver-owned views may be invalidated as in 🔗 10. Borrowed congruence and generator views of grid values. |
Dropping proper congruences is correct only after any latent inconsistency has been resolved. |
BagnaraDHMZ07 | Section 3, grid definitions, representations and operations. |
|
|
|
|
Use consistent and inconsistent proper congruences, contradictions among equalities, unused coordinates, dense/sparse storage, all addition/refinement routes and both extraction methods. Check returned ownership and affine hulls with an independent equality oracle. |
src/Grid_defs.hh; src/Grid_inlines.hh; src/Grid_public.cc; src/Grid_nonpublic.cc; tests/Grid/constraints1.cc; tests/gridrefinementspec1.cc; tests/gridoperationsfailure1.cc; tests/gridedgespec1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Member declarations of Grid. Constraint_System constraints() const; Constraint_System minimized_constraints() const; |