C++ affine ranking
|
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:
|
|
A single transition input of dimension 2n shall place after-state coordinates x’ in indices 0, …, n − 1 and before-state coordinates x in indices n, …, 2n − 1. An odd dimension shall raise std::invalid_argument. Paired inputs shall have dimensions n and 2n; otherwise they shall raise std::invalid_argument before analysis. The first input shall restrict before states in its own indices 0, …, n − 1; the second shall use the single-input ordering. Their aligned conjunction shall define the analyzed relation. For paired inputs, emptiness of the conjunction shall be determined with strict rows intact before relaxation. If the exact conjunction is empty, the paired Boolean tests shall succeed and the paired witness operations shall return an admissible coefficient point of dimension n + 1. The input type shall provide supported minimized linear constraints. Numerical guarantees shall concern the rational transition approximation defined by those constraints, with sound positive conclusions for every represented concrete transition. A coefficient point of dimension n + 1 shall encode f(x) = c + ∑iaixi with slopes in indices 0, …, n − 1 and constant c at index n. A ranking argument shall require a finite uniform lower bound and a uniform decrease δ > 0 over transitions. Strict positivity at individual transitions alone shall not replace uniform decrease. Input mathematical values shall remain unchanged. Separate outputs shall not alias one another or the inputs. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
A ranking for a misaligned relation proves nothing about the intended loop; uniform decrease and a lower bound rule out infinite transition sequences. |
BagnaraMPZ12IC | Sections 3–5; journal article author manuscript, ranking conditions and the two synthesis methods. |
|
|
|
|
Compare single and paired encodings, independently decoded coefficients, coordinate permutations, odd or mismatched dimensions, zero dimensions and discrete input relaxations. Check a conjunction made empty only by strict boundaries through paired Boolean, witness and coefficient-space calls. |
src/termination.cc; src/termination_defs.hh; src/termination_templates.hh; src/termination_types.hh; tests/Polyhedron/rankingpairs1.cc; tests/Polyhedron/termination1.cc; tests/Polyhedron/termination2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. template<class PSET> bool termination_test_MS(const PSET&); template<class PSET> bool termination_test_PR(const PSET&); |
|
|
SW_SPEC
|
2 |
|
|
|
A completed true result shall certify an affine ranking for the analyzed transition approximation under 🔗 1. Transition encoding and ranking interpretation. False shall mean that this test is inconclusive about termination. It shall not mean that the loop has an infinite execution, even for an exact input relation. Single and paired forms shall use the same coordinate convention and preserve input values. Resource or arithmetic exceptions shall not constitute a true result. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Affine rankings are sufficient arguments but do not characterize all terminating programs. |
BagnaraMPZ12IC | Sections 3–5; journal article author manuscript, ranking conditions and the two synthesis methods. |
|
|
|
|
Check decreasing rational loops, stuttering and bidirectional relations, empty relations and terminating loops with no affine ranking; compare equivalent encodings. |
src/termination.cc; src/termination_defs.hh; src/termination_templates.hh; src/termination_types.hh; tests/Polyhedron/rankingpairs1.cc; tests/Polyhedron/termination1.cc; tests/Polyhedron/termination2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. template<class PSET> bool termination_test_MS(const PSET&); template<class PSET> bool termination_test_MS_2(const PSET& before, const PSET& after); |
||
|
SW_SPEC
|
3 |
|
|
Parents:
|
|
On true, the output shall be assigned a point of dimension n + 1 encoding an affine function satisfying the MS nonnegative and unit-decrease ranking obligations over the analyzed approximation. No particular witness shall be selected. On false, no witness value shall be promised and termination shall remain inconclusive. The layout and dimension admission rules in 🔗 1. Transition encoding and ranking interpretation shall apply. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
A returned coefficient point must substantiate the positive ranking claim rather than merely carry a success flag. |
BagnaraMPZ12IC | Sections 3–5; journal article author manuscript, ranking conditions and the two synthesis methods. |
|
|
|
|
Independently minimize the lower-bound and decrease expressions over original rational transition constraints; check dimension/constant placement, strict and empty relations and false-output admission. |
src/termination.cc; src/termination_defs.hh; src/termination_templates.hh; src/termination_types.hh; tests/Polyhedron/rankingpairs1.cc; tests/Polyhedron/termination1.cc; tests/Polyhedron/termination2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. template<class PSET> bool one_affine_ranking_function_MS(const PSET&, Generator& mu); template<class PSET> bool one_affine_ranking_function_MS_2(const PSET& before, const PSET& after, Generator& mu); |
|
|
SW_SPEC
|
4 |
|
|
Incoming link from:
5. MS affine quasi-ranking spaces
1 |
The output shall replace its prior value with a closed polyhedron of dimension n + 1 containing exactly the affine coefficient tuples that satisfy f(x) ≥ 0 and f(x) − f(x’) ≥ 1 on every rational transition described by the input constraints. For an empty relation it shall be universe, including an empty conjunction of individually nonempty paired inputs. Strict constraints shall be preserved when establishing that emptiness; for nonempty relations these weak ranking obligations also hold on the closure. An empty output shall mean no normalized affine ranking exists and shall not establish nontermination. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Universal transition obligations are vacuous on empty relations; relaxing strict constraints too early can incorrectly create obligations. |
BagnaraMPZ12IC | Sections 3–5; journal article author manuscript, ranking conditions and the two synthesis methods. |
|
|
|
|
Check exact coefficient-space inequalities for rational translations and bounded boxes, explicit/latent/paired strict emptiness, generator directions and fresh output replacement. |
src/termination.cc; src/termination_defs.hh; src/termination_templates.hh; src/termination_types.hh; tests/Polyhedron/termination1.cc; tests/Polyhedron/termination2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. template<class PSET> void all_affine_ranking_functions_MS(const PSET&, C_Polyhedron& mu_space); template<class PSET> void all_affine_ranking_functions_MS_2(const PSET& before, const PSET& after, C_Polyhedron& mu_space); |
||
|
SW_SPEC
|
5 |
|
|
|
The two distinct outputs shall be closed polyhedra of dimension n + 1. The decreasing space shall contain exactly tuples satisfying f(x) − f(x’) ≥ 1 on every analyzed rational transition, with unrestricted additive constant. The bounded space shall contain exactly tuples satisfying f(x) ≥ 0 on every such before state. It shall use that nonnegative normalization rather than accept every arbitrary finite lower bound. Their intersection shall equal the normalized MS ranking space. Empty relations shall yield universe in both outputs; the zero function shall always belong to the bounded space. Strict boundaries and paired conjunction emptiness shall be handled as in 🔗 4. Normalized MS affine ranking spaces. Neither an empty decreasing space nor an empty intersection shall establish nontermination. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Lower-bound and decrease obligations can be represented separately and recombined by intersection. |
BagnaraMPZ12IC | Sections 3–5; journal article author manuscript, ranking conditions and the two synthesis methods. |
|
|
|
|
Check independent literal coefficient spaces, free constants, zero membership, intersection equality, strict empty conjunctions and output dimensions. |
src/termination.cc; src/termination_defs.hh; src/termination_templates.hh; src/termination_types.hh; tests/Polyhedron/termination1.cc; tests/Polyhedron/termination2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. template<class PSET> void all_affine_quasi_ranking_functions_MS(const PSET&, C_Polyhedron& decreasing, C_Polyhedron& bounded); template<class PSET> void all_affine_quasi_ranking_functions_MS_2(const PSET& before, const PSET& after, C_Polyhedron& decreasing, C_Polyhedron& bounded); |
||
|
SW_SPEC
|
6 |
|
|
|
A completed true result shall certify an affine ranking with a finite lower bound and uniformly positive decrease over the analyzed transition approximation. For the paired form both obligations apply to the aligned conjunction, including bounds implied by the transition description. False shall be inconclusive about termination. Unit decrease and nonnegative normalization shall not be required for the PR certificate. The coordinate and valid-use rules in 🔗 1. Transition encoding and ranking interpretation shall apply to both the single and paired forms. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Positive scaling and additive shifts preserve a ranking argument but change its normalization. |
BagnaraMPZ12IC | Sections 3–5; journal article author manuscript, ranking conditions and the two synthesis methods. |
|
|
|
|
Check descending and ascending guarded rays with negative state bounds, rational steps, stuttering, empty relations and equivalent single/paired encodings. |
src/termination.cc; src/termination_defs.hh; src/termination_templates.hh; src/termination_types.hh; tests/Polyhedron/rankingpairs1.cc; tests/Polyhedron/termination1.cc; tests/Polyhedron/termination2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. template<class PSET> bool termination_test_PR(const PSET&); template<class PSET> bool termination_test_PR_2(const PSET& before, const PSET& after); |
||
|
SW_SPEC
|
7 |
|
|
Parents:
|
|
On true, the output shall be assigned a point of dimension n + 1 encoding an affine function with a finite uniform lower bound and uniformly positive decrease over the analyzed approximation. Its constant coordinate shall follow 🔗 1. Transition encoding and ranking interpretation; no nonnegative normalization or particular witness shall be required. On false, no output value shall be promised and termination shall remain inconclusive. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
A zero additive constant can still be a valid PR ranking when the function has a negative finite lower bound. |
BagnaraMPZ12IC | Sections 3–5; journal article author manuscript, ranking conditions and the two synthesis methods. |
|
|
|
|
Independently establish finite lower bound and strictly positive minimum decrease, including rational steps, negative states and constant layout; check false cases separately. |
src/termination.cc; src/termination_defs.hh; src/termination_templates.hh; src/termination_types.hh; tests/Polyhedron/rankingpairs1.cc; tests/Polyhedron/termination1.cc; tests/Polyhedron/termination2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. template<class PSET> bool one_affine_ranking_function_PR(const PSET&, Generator& mu); template<class PSET> bool one_affine_ranking_function_PR_2(const PSET& before, const PSET& after, Generator& mu); |
|
|
SW_SPEC
|
8 |
|
|
|
The output shall replace its prior value with an NNC polyhedron of dimension n + 1 describing the affine coefficient tuples with a finite lower bound and a uniform decrease δ > 0 over the rational relation defined by the input constraints. For the paired form both obligations apply to the same aligned conjunction. In particular, the lower bound may follow from the transition description. The additive constant shall be unrestricted. No unit-decrease or nonnegative normalization shall be imposed. For an empty relation the space shall be universe, including empty aligned conjunctions of individually nonempty paired inputs. Strict boundaries shall not be discarded before establishing such emptiness. An empty output shall exclude rankings of this form and shall not establish nontermination. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
The positive-decrease space can have strict coefficient boundaries and differs from the closed normalized MS space. |
BagnaraMPZ12IC | Sections 3–5; journal article author manuscript, ranking conditions and the two synthesis methods. |
|
|
|
|
Compare full coefficient spaces for guarded rational translations, positive scaling and free constants; check stuttering, explicit/latent/paired strict emptiness and output replacement. |
src/termination.cc; src/termination_defs.hh; src/termination_templates.hh; src/termination_types.hh; tests/Polyhedron/rankingpairs1.cc; tests/Polyhedron/termination1.cc; tests/Polyhedron/termination2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. template<class PSET> void all_affine_ranking_functions_PR(const PSET&, NNC_Polyhedron& mu_space); template<class PSET> void all_affine_ranking_functions_PR_2(const PSET& before, const PSET& after, NNC_Polyhedron& mu_space); |