Parma Polyhedra Library requirements
C++ affine-form abstract-store operations
1. Dependency invalidation UID: PPL-SPEC-000988 STATUS: APPROVED COMPONENT: EXPRESSION_ANALYSIS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

For a well-formed affine store, discard_occurrences(store, var) shall erase exactly those bindings whose linear form has a coefficient for var unequal to the singleton zero interval. It shall preserve every other key and associated value. An absent coordinate beyond a form's stored dimension shall have zero coefficient as specified by 🔗 6. Dimensions and borrowed coefficient access. An uncertain coefficient containing zero and other values shall count as a dependency. The operation shall accept empty stores and shall not create a binding.

Store keys and referenced coordinates shall be valid dimension indices; each form shall meet the interval-coefficient and lifetime prerequisites of 🔗 1. Interval-linear-form meaning and numerical prerequisites. No PPL initialization or native floating-point arithmetic shall be required when the selected exact interval operations require neither. Erasing a binding shall invalidate references to that binding; references to retained bindings shall remain valid.

RATIONALE:

Invalidating all possibly dependent expressions prevents a changed program variable from leaving a stale symbolic relationship.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. C is the selected interval coefficient type.

template <typename C>
void discard_occurrences(
  std::map<dimension_type, Linear_Form<C>>& store, Variable var);
VERIFICATION_CRITERIA:

Compare retained keys and literal coefficients for no dependency, consecutive dependencies, uncertain intervals, empty stores and coordinates beyond stored dimensions.

BIBLIOGRAPHY:

Mine04 | Section 5, Linear Form Propagation (PDF page index 7, zero-based).

SOURCE:

src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionstoresspec1.cc; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/expressionpublic1.cc.

PPL-SPEC-000989
2. Affine assignment and dependency invalidation UID: PPL-SPEC-000989 STATUS: APPROVED COMPONENT: EXPRESSION_ANALYSIS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

affine_form_image(store, var, form) shall first assign a copy of the entry value of form to the key var.id(), inserting or replacing the binding. It shall then perform the dependency invalidation specified by 🔗 1. Dependency invalidation for var across the resulting store. Consequently, a newly assigned form depending on var shall also be discarded. The input may be a form borrowed from the same store, including the target binding; copying shall use its entry value before any removal can destroy that donor. An independent donor shall remain unchanged.

Valid keys, interval operations and lifetimes shall meet 🔗 1. Dependency invalidation. Allocation or coefficient-operation exceptions may propagate; no rollback of the entire store shall be promised, but existing owners shall remain safely destructible. After normal return, every retained binding shall be independent of the assigned coordinate.

RATIONALE:

Assignment records the new expression and then conservatively removes relationships that cannot remain valid when the coordinate changes.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. C is the selected interval coefficient type.

template <typename C>
void affine_form_image(
  std::map<dimension_type, Linear_Form<C>>& store,
  Variable var, const Linear_Form<C>& form);
VERIFICATION_CRITERIA:

Check insertion/replacement, independent inputs, same-store borrowed donors that are removed during invalidation, same-target aliasing and self-dependent assignments; compare all remaining mappings to independent entry-value snapshots.

BIBLIOGRAPHY:

Mine04 | Section 5, Linear Form Propagation (PDF page index 7, zero-based).

SOURCE:

src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionstoresspec1.cc; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/expressionpublic1.cc.

PPL-SPEC-000990
3. Common-binding affine-store join UID: PPL-SPEC-000990 STATUS: APPROVED COMPONENT: EXPRESSION_ANALYSIS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

upper_bound_assign(left, right) shall retain exactly the bindings of left whose keys also occur in right and whose associated linear forms are equal according to 🔗 14. Coefficient equality with implicit trailing zeros. Every other left binding shall be erased. No right-only binding shall be inserted. The retained forms and the right operand shall remain unchanged. Explicit trailing zero coefficients shall not cause mathematically equal forms to be discarded. Joining a store with itself shall preserve all bindings.

Both stores shall meet 🔗 1. Dependency invalidation and describe consistent coordinate identities. Coefficient comparison shall be supported for their selected interval type. Empty operands shall be admitted; an empty right operand shall remove every left binding. Exceptions from selected coefficient comparisons may propagate without a whole-store rollback promise; surviving owners shall remain safely destructible.

RATIONALE:

Only a symbolic relationship established on both alternatives can survive their conservative join.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. C is the selected interval coefficient type.

template <typename C>
void upper_bound_assign(
  std::map<dimension_type, Linear_Form<C>>& left,
  const std::map<dimension_type, Linear_Form<C>>& right);
VERIFICATION_CRITERIA:

Compare independent literal mappings for equal and unequal common bindings, missing right keys, right-only keys, explicit zero tails, empty operands and self-aliasing; retain an independent right snapshot.

BIBLIOGRAPHY:

Mine04 | Section 5, Linear Form Propagation (PDF page index 7, zero-based).

SOURCE:

src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionstoresspec1.cc; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/expressionpublic1.cc.