Parma Polyhedra Library requirements
C++ rational-grid generator insertion

C++ rational-grid generator insertion

1. Copying bulk insertion of rational-grid generators
UID: PPL-SPEC-001271
STATUS: APPROVED
COMPONENT: GRIDS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

add_grid_generators(input) shall add the input points, parameters and lines to a generator description of the receiver, with the meaning in 🔗 1. Rational-grid values, coefficient profile and valid use. For nonempty G = p + H, input points ri, parameters qj and lines lk shall produce p + H + ∑iZ(ri − p) + ∑jZqj + ∑kRlk. In particular, adding points shall form a grid hull, not a finite union.

A system with no stored rows shall be a no-op. If the receiver is empty and the nonempty input has no point, the operation shall throw std::invalid_argument. Otherwise an empty receiver shall acquire exactly the grid generated by the input. A zero-dimensional point shall turn zero-dimensional empty into universe; zero-dimensional universe shall be preserved. Zero parameters omitted by the generator-system contract shall not constitute stored rows.

The input's value, dimension and storage shall be preserved, including when an exception propagates. A current generator-system view borrowed from the receiver may be supplied: its pre-call generators shall be used as the input, and normal receiver-view invalidation shall apply during mutation.

The receiver's ambient dimension shall be preserved. Missing coordinates in lower-dimensional input generators shall be zero extended. Greater declared input dimension shall throw std::invalid_argument before receiver mutation, including empty inputs and empty receivers. The result shall be independent of input order, redundant rows, storage choice and current-description caches. Previously undetected inconsistency shall have the same meaning as empty.

The initialization, arithmetic-profile, lifetime and synchronization conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including every intermediate calculation. Input and receiver objects shall remain live for their specified uses. Resource and numerical exceptions may propagate. Surviving receiver ownership shall permit destruction; rollback or further queries after an exception shall not be assumed. Borrowed receiver views shall follow 🔗 10. Borrowed congruence and generator views of grid values.

RATIONALE:

The copying interface must preserve its source while combining integer displacements and real line directions, including when cached congruences are inconsistent.

INTERFACE:

Public header: <ppl.hh>; member of Parma_Polyhedra_Library::Grid.

void add_grid_generators(const Grid_Generator_System& input);
VERIFICATION_CRITERIA:

Use independent rational coset calculations for points, parameters and lines under invertible coordinate transformations. Cross empty, singleton, periodic and continuous receivers with both descriptions and cache histories. Exercise pending contradictory rows, lower-dimensional inputs, dense/sparse storage, reversed/redundant rows, borrowed self views, unchanged source records, dimension errors, zero dimensions and allocation failures.

BIBLIOGRAPHY:

BagnaraDHMZ07 | Section 3, grid and generator definitions (PDF page indices 6–8, zero-based).

SOURCE:

src/Grid_public.cc; src/Grid_nonpublic.cc; src/Grid_inlines.hh; tests/gridinsertionspec1.cc; tests/gridinsertionpublic1.cc; tests/gridinsertionfailure1.cc; tests/Grid/addgenerators1.cc; tests/Grid/grid1.cc.

PPL-SPEC-001272
2. Recycling bulk insertion of rational-grid generators
UID: PPL-SPEC-001272
STATUS: APPROVED
COMPONENT: GRIDS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

add_grid_generators(std::move(input)) and add_recycled_grid_generators(input) shall produce the same mathematical receiver value, ambient dimension and ordinary input-rejection outcomes as 🔗 1. Copying bulk insertion of rational-grid generators. These operations may transfer ownership from the supplied system. The input shall be a separate writable object; it shall not alias receiver-owned storage. After successful or exceptional return the input shall retain ownership sufficient for destruction. Its rows, dimension, storage and suitability for subsequent queries shall not be assumed.

A receiver discovered empty while converting its congruences shall use the same insertion rules as an already marked empty receiver. Nonempty input without a supporting point shall therefore be rejected; input with a point shall establish the generated grid. Conversion shall not leave subsequent normalization dependent on a nonexistent old supporting point.

The receiver's ambient dimension shall be preserved. Missing coordinates in lower-dimensional input generators shall be zero extended. Greater declared input dimension shall throw std::invalid_argument before receiver mutation, including empty inputs and empty receivers. The result shall be independent of input order, redundant rows, storage choice and current-description caches. Previously undetected inconsistency shall have the same meaning as empty.

The initialization, arithmetic-profile, lifetime and synchronization conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including every intermediate calculation. Input and receiver objects shall remain live for their specified uses. Resource and numerical exceptions may propagate. Surviving receiver ownership shall permit destruction; rollback or further queries after an exception shall not be assumed. Borrowed receiver views shall follow 🔗 10. Borrowed congruence and generator views of grid values.

RATIONALE:

Recycling changes ownership permissions, while the generated set and empty-grid point requirement remain the same as for copying insertion.

INTERFACE:

Public header: <ppl.hh>; member of Parma_Polyhedra_Library::Grid.

void add_grid_generators(Grid_Generator_System&& input);
void add_recycled_grid_generators(Grid_Generator_System& input);
VERIFICATION_CRITERIA:

Check recycling and copying separately against the same independent coset oracle. Include empty inputs, lower-dimensional rows, zero dimensions, systems with no points, latent contradictions, mixed point/parameter/line systems, every observed allocation-failure frontier and destruction of both surviving objects.

BIBLIOGRAPHY:

BagnaraDHMZ07 | Section 3, grid and generator definitions (PDF page indices 6–8, zero-based).

SOURCE:

src/Grid_public.cc; src/Grid_nonpublic.cc; src/Grid_inlines.hh; tests/gridinsertionspec1.cc; tests/gridinsertionpublic1.cc; tests/gridinsertionfailure1.cc; tests/Grid/addgenerators1.cc; tests/Grid/grid1.cc; tests/gridconsuminginsertions1.cc.

PPL-SPEC-001273
3. Copying insertion of a single rational-grid generator
UID: PPL-SPEC-001273
STATUS: APPROVED
COMPONENT: GRIDS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

add_grid_generator(g) shall add the pre-call generator value to a generator description of the receiver, preserving its ambient dimension. For nonempty G = p + H, adding a point r shall produce p + H + Z(r − p); adding a parameter q shall produce p + H + Zq; adding a line l shall produce p + H + Rl. Insertion of an already supplied generator shall be mathematically idempotent. A zero parameter shall preserve a nonempty grid.

An empty receiver shall accept a point and become that singleton. A parameter or line supplied to empty shall throw std::invalid_argument, including a zero parameter. Previously undetected inconsistency shall have the same meaning as already marked empty. In zero dimensions a point shall establish universe; a parameter shall preserve universe and be rejected by empty.

Missing coordinates shall be zero extended. Greater declared input dimension shall throw std::invalid_argument before receiver mutation, including an empty receiver or a zero parameter. Input type and value shall be captured safely when the argument is borrowed from the receiver's generator view. Receiver mutation may invalidate that view according to 🔗 10. Borrowed congruence and generator views of grid values; the external input case shall preserve its source. The result shall not depend on storage, redundant rows or cache history.

The initialization, arithmetic-profile, lifetime and synchronization conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including every intermediate calculation. Resource and numerical exceptions may propagate. Surviving receiver ownership shall permit destruction; rollback or further queries after an exception shall not be assumed. External input descriptors shall retain their value.

RATIONALE:

Points, integer parameters and real lines extend a grid in different ways. The copy-taking interface must not inspect a borrowed argument after receiver storage growth invalidates it.

INTERFACE:

Public header: <ppl.hh>; member of Parma_Polyhedra_Library::Grid.

void add_grid_generator(const Grid_Generator& g);
VERIFICATION_CRITERIA:

Use independent rational coset calculations for each generator kind. Check empty and latent-empty receivers, zero dimensions and parameters, lower or excess declared dimension, fractional points, storage and cache histories. Insert borrowed points, parameters and lines across storage growth and compare with their pre-call grid. Exercise external-input preservation and every observed allocation-failure frontier, checking surviving ownership.

BIBLIOGRAPHY:

BagnaraDHMZ07 | Section 3, grid and generator definitions (PDF page indices 6–8, zero-based).

SOURCE:

src/Grid_public.cc; src/Grid_nonpublic.cc; src/Grid_inlines.hh; tests/gridsingleinsertionspec1.cc; tests/gridinsertionpublic1.cc; tests/gridinsertionfailure1.cc; tests/Grid/addgenerators1.cc; tests/Grid/grid1.cc.