-
7. Access through supported language interfaces UID: PPL-HLR-000007 STATUS: APPROVED COMPONENT: LIBRARY_WIDE APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis, Review RELATIONS (Child): - PPL-LLR-000213 Configured binding domain selection (Refined by)
- PPL-LLR-000214 Mathematical consistency of corresponding binding operations (Refined by)
- PPL-LLR-000215 Consistent binding type dependencies (Refined by)
- PPL-LLR-000439 Binding interruption support and state changes (Refined by)
- PPL-LLR-000201 Explicit C library lifecycle (Refined by)
- PPL-LLR-000202 C object ownership and borrowed access (Refined by)
- PPL-LLR-000203 C boundary error reporting (Refined by)
- PPL-LLR-000311 Public C++ access to supported facilities (Refined by)
- PPL-LLR-000312 Independent values after copying domain objects (Refined by)
- PPL-LLR-000204 Java coefficient value preservation (Refined by)
- PPL-LLR-000205 Java library lifecycle (Refined by)
- PPL-LLR-000206 Java boundary exception translation (Refined by)
- PPL-LLR-000436 Java native object ownership (Refined by)
- PPL-LLR-000207 OCaml numerical term conversion (Refined by)
- PPL-LLR-000208 OCaml native object reclamation (Refined by)
- PPL-LLR-000209 OCaml boundary error translation (Refined by)
- PPL-LLR-000210 Prolog mathematical term interpretation (Refined by)
- PPL-LLR-000211 Prolog predicate outcomes (Refined by)
- PPL-LLR-000212 Prolog object lifetime operations (Refined by)
- PPL-LLR-000437 Prolog library lifecycle (Refined by)
STATEMENT: PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.
RATIONALE: Language-specific representations and error mechanisms must not silently change the numerical meaning of an exposed facility.
VERIFICATION_CRITERIA: Review the supported facility set for each interface and compare equivalent computations across enabled interfaces, including value conversion, object lifetime and error reporting.
BIBLIOGRAPHY: BagnaraHZ08SCP | Whole work (background on the library's numerical abstractions and design).
SOURCE: doc/definitions.dox: PPL_CXX_interface; interfaces/Makefile.am; interfaces/C/C_interface.dox; interfaces/Java/README.java.md; interfaces/OCaml/OCaml_interface.dox; interfaces/Prolog/Prolog_interface.dox.
For each enabled supported Prolog system, the Prolog interface shall interpret its documented mathematical terms with the same numerical meaning. Conversion of supported linear expressions, constraints and generators shall preserve representable coefficient values, variable identities and relation meanings.
Differences between Prolog foreign-language interfaces must not change the mathematics of the common binding.
Verification covers each supported engine's mathematical term conversion contracts. Common conversion cases and engine-specific inspection verify equal mathematical meaning within supported numeric limits. Availability of an engine adapter does not imply arbitrary-size integer support or every loading mode.
The common conversion cases produce equivalent mathematical objects on each tested enabled engine; cases cover signed coefficients, variable positions, relation kinds and generator kinds within that engine's documented numeric limits.
interfaces/Prolog/Prolog_interface_sysindep.dox, mathematical term representations; interfaces/Prolog/ppl_prolog_common_defs.hh; interfaces/Prolog/ppl_prolog_common.cc.
-
1. Prolog mathematical term exchange UID: PPL-SPEC-001695 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): - PPL-LLR-000011 Coordinate identity and ambient dimension (Specifies)
- PPL-LLR-000012 Affine meaning of linear expressions (Specifies)
- PPL-LLR-000013 Meaning of linear constraints (Specifies)
- PPL-LLR-000014 Meaning of linear congruences (Specifies)
- PPL-LLR-000015 Distinct meanings of geometric generators (Specifies)
- PPL-LLR-000210 Prolog mathematical term interpretation (Specifies)
- PPL-LLR-000214 Mathematical consistency of corresponding binding operations (Specifies)
STATEMENT: For each configured supported Prolog engine, supported integral terms, affine expressions, constraints, congruences and generators shall be interpreted with their documented native mathematical meaning. '$VAR'(I) shall denote the zero-based coordinate I. Unary negation, addition, subtraction and integral scalar multiplication shall preserve affine meaning. Relations shall preserve equality and strict/non-strict order. Point and closure-point coordinates shall be divided by the supplied nonzero divisor; lines and rays denote directions. Returned terms may be normalized but shall denote the native result.
Values shall be representable by both the engine and configured native coefficient type. A bounded engine does not acquire arbitrary-size integers from GMP in the native library. Malformed or nonlinear expressions and invalid native objects shall follow 🔗 2. Prolog success failure and exception outcomes.
RATIONALE: The common term protocol must express the same mathematics independently of the selected foreign runtime.
INTERFACE: Common numerical term protocol:
'$VAR'(I) -E E + F E - F N * E E = F E =< F E < F E >= F E > F point(E, D) closure_point(E, D) ray(E) line(E)
Here I is a valid coordinate index, N an integral coefficient and E/F supported affine expressions. Lists of such terms are the system interfaces accepted and returned by configured domain and solver predicates. Grid-point, parameter and congruence terms follow the common Prolog manual's rational-divisor and modulus conventions.
VERIFICATION_CRITERIA: Across each available configured engine, compare coefficient round trips and independently reconstructed expressions/constraints/generators. Cover signs, zero, multiple indices, all relation and generator kinds, and each engine/native range intersection; check unsupported numeric and malformed cases separately.
SOURCE: interfaces/Prolog/Prolog_interface_sysindep.dox; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/pl_check.pl.
-
7. Prolog operation-option correspondence UID: PPL-SPEC-001732 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT: Option terms shall select the identically named native meanings: true or false, universe or empty, bits_8, bits_16, bits_32, bits_64 or bits_128, unsigned or signed_2_complement, and overflow_wraps, overflow_undefined or overflow_impossible. min and max select optimization direction; polynomial, simplex and any select complexity. The documented pricing, cutting and pivot atoms shall select the corresponding native solver controls. Unsupported option terms shall be rejected through 🔗 2. Prolog success failure and exception outcomes; policies retain native preconditions and guarantees.
RATIONALE: Prolog option terms have no static type guarantee; admission must reject unsupported terms without changing the requested native policy.
INTERFACE: Option arguments of the documented Prolog predicates: Boolean and empty/universe selection; bounded-integer width, representation and overflow; optimization mode; complexity class; and MIP/PIP control-parameter names and values. These terms are interpreted by the corresponding term_to_* conversion helpers.
VERIFICATION_CRITERIA: Compare every accepted atom with its native policy or enumerator. Inspect all rejection paths and generated option forwarding. Exercise each accepted option and malformed, non-atom, unbound and unknown values through the supported public predicates, distinguishing conversion errors from a false numerical result.
SOURCE: interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/ppl_prolog_common_defs.hh; interfaces/Prolog/Prolog_interface.dox.
-
7. Access through supported language interfaces UID: PPL-HLR-000007 STATUS: APPROVED COMPONENT: LIBRARY_WIDE APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis, Review RELATIONS (Child): - PPL-LLR-000213 Configured binding domain selection (Refined by)
- PPL-LLR-000214 Mathematical consistency of corresponding binding operations (Refined by)
- PPL-LLR-000215 Consistent binding type dependencies (Refined by)
- PPL-LLR-000439 Binding interruption support and state changes (Refined by)
- PPL-LLR-000201 Explicit C library lifecycle (Refined by)
- PPL-LLR-000202 C object ownership and borrowed access (Refined by)
- PPL-LLR-000203 C boundary error reporting (Refined by)
- PPL-LLR-000311 Public C++ access to supported facilities (Refined by)
- PPL-LLR-000312 Independent values after copying domain objects (Refined by)
- PPL-LLR-000204 Java coefficient value preservation (Refined by)
- PPL-LLR-000205 Java library lifecycle (Refined by)
- PPL-LLR-000206 Java boundary exception translation (Refined by)
- PPL-LLR-000436 Java native object ownership (Refined by)
- PPL-LLR-000207 OCaml numerical term conversion (Refined by)
- PPL-LLR-000208 OCaml native object reclamation (Refined by)
- PPL-LLR-000209 OCaml boundary error translation (Refined by)
- PPL-LLR-000210 Prolog mathematical term interpretation (Refined by)
- PPL-LLR-000211 Prolog predicate outcomes (Refined by)
- PPL-LLR-000212 Prolog object lifetime operations (Refined by)
- PPL-LLR-000437 Prolog library lifecycle (Refined by)
STATEMENT: PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.
RATIONALE: Language-specific representations and error mechanisms must not silently change the numerical meaning of an exposed facility.
VERIFICATION_CRITERIA: Review the supported facility set for each interface and compare equivalent computations across enabled interfaces, including value conversion, object lifetime and error reporting.
BIBLIOGRAPHY: BagnaraHZ08SCP | Whole work (background on the library's numerical abstractions and design).
SOURCE: doc/definitions.dox: PPL_CXX_interface; interfaces/Makefile.am; interfaces/C/C_interface.dox; interfaces/Java/README.java.md; interfaces/OCaml/OCaml_interface.dox; interfaces/Prolog/Prolog_interface.dox.
The Prolog interface shall express a successful numerical query through the predicate's documented success and output bindings, and a false numerical predicate through ordinary predicate failure. Every malformed argument or native failure designated by the supported failure model shall be reported through Prolog error handling rather than being treated as a false numerical result. Native C++ exceptions raised by supported operations shall be contained at the Prolog boundary.
Logical failure and a failure to perform a computation have different meanings to a Prolog caller.
Verification covers predicate truth, output unification, supported error categories and native exception containment on each selected engine. Truth/error distinction tests and boundary-path inspection verify these contracts. Ordinary predicate failure does not imply that mutations of foreign objects are automatically undone; operation-specific failure and ownership postconditions must be specified under 🔗 3. Failure and resource safety.
For each selected supported engine, check that true queries succeed, false numerical predicates fail normally, and supported malformed-argument and native-failure categories reach the declared Prolog error mechanism. Check output bindings for successful result-producing predicates, exception containment, and cleanup when output unification or error reporting fails.
interfaces/Prolog/Prolog_interface_sysindep.dox, Predicate Specifications; interfaces/Prolog/Prolog_interface_sysindep_domains.dox; interfaces/Prolog/ppl_prolog_common_defs.hh, handled error categories.
-
2. Prolog success failure and exception outcomes UID: PPL-SPEC-001696 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT: A true numerical predicate shall succeed; a false numerical predicate shall fail normally. Result-producing predicates shall unify the documented output terms on success. Incompatible output bindings shall cause ordinary failure, without changing that into a numerical falsehood or promising rollback of foreign mutations. Newly allocated owned results whose output cannot be unified shall be released.
Malformed arguments and supported native failures shall be reported through the selected engine's Prolog exception mechanism. Native exception unwinding shall be contained at the foreign boundary. Error terms shall distinguish the common invalid-argument/type/range, arithmetic-overflow, allocation, native logic/runtime and supported interruption categories according to the engine adapter. Ordinary false queries shall not be used to conceal those errors.
RATIONALE: Logical falsehood, failed output unification and an inability to perform a numerical operation have different meanings.
INTERFACE: Configured ppl_* predicates use the success/failure and output arguments specified by the common and generated Prolog predicate documentation. On a supported error they raise the common binding error term through the selected engine adapter; callers may use catch/3. For example:
ppl_MIP_Problem_is_satisfiable(Problem) ppl_MIP_Problem_solve(Problem, Status) ppl_delete_MIP_Problem(Problem)
Handles shall satisfy 🔗 3. Prolog owned domain and MIP handles through 🔗 5. Prolog PIP owner and tree generations, as applicable.
VERIFICATION_CRITERIA: Check true/false numerical queries, literal output bindings, incompatible outputs and constructor cleanup. Catch malformed/type/stale-handle errors and supported native categories on each configured engine; inspect containment and error-reporting cleanup.
SOURCE: interfaces/Prolog/ppl_prolog_common_defs.hh; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/pl_check.pl.
-
7. Prolog operation-option correspondence UID: PPL-SPEC-001732 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT: Option terms shall select the identically named native meanings: true or false, universe or empty, bits_8, bits_16, bits_32, bits_64 or bits_128, unsigned or signed_2_complement, and overflow_wraps, overflow_undefined or overflow_impossible. min and max select optimization direction; polynomial, simplex and any select complexity. The documented pricing, cutting and pivot atoms shall select the corresponding native solver controls. Unsupported option terms shall be rejected through 🔗 2. Prolog success failure and exception outcomes; policies retain native preconditions and guarantees.
RATIONALE: Prolog option terms have no static type guarantee; admission must reject unsupported terms without changing the requested native policy.
INTERFACE: Option arguments of the documented Prolog predicates: Boolean and empty/universe selection; bounded-integer width, representation and overflow; optimization mode; complexity class; and MIP/PIP control-parameter names and values. These terms are interpreted by the corresponding term_to_* conversion helpers.
VERIFICATION_CRITERIA: Compare every accepted atom with its native policy or enumerator. Inspect all rejection paths and generated option forwarding. Exercise each accepted option and malformed, non-atom, unbound and unknown values through the supported public predicates, distinguishing conversion errors from a false numerical result.
SOURCE: interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/ppl_prolog_common_defs.hh; interfaces/Prolog/Prolog_interface.dox.
-
7. Access through supported language interfaces UID: PPL-HLR-000007 STATUS: APPROVED COMPONENT: LIBRARY_WIDE APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis, Review RELATIONS (Child): - PPL-LLR-000213 Configured binding domain selection (Refined by)
- PPL-LLR-000214 Mathematical consistency of corresponding binding operations (Refined by)
- PPL-LLR-000215 Consistent binding type dependencies (Refined by)
- PPL-LLR-000439 Binding interruption support and state changes (Refined by)
- PPL-LLR-000201 Explicit C library lifecycle (Refined by)
- PPL-LLR-000202 C object ownership and borrowed access (Refined by)
- PPL-LLR-000203 C boundary error reporting (Refined by)
- PPL-LLR-000311 Public C++ access to supported facilities (Refined by)
- PPL-LLR-000312 Independent values after copying domain objects (Refined by)
- PPL-LLR-000204 Java coefficient value preservation (Refined by)
- PPL-LLR-000205 Java library lifecycle (Refined by)
- PPL-LLR-000206 Java boundary exception translation (Refined by)
- PPL-LLR-000436 Java native object ownership (Refined by)
- PPL-LLR-000207 OCaml numerical term conversion (Refined by)
- PPL-LLR-000208 OCaml native object reclamation (Refined by)
- PPL-LLR-000209 OCaml boundary error translation (Refined by)
- PPL-LLR-000210 Prolog mathematical term interpretation (Refined by)
- PPL-LLR-000211 Prolog predicate outcomes (Refined by)
- PPL-LLR-000212 Prolog object lifetime operations (Refined by)
- PPL-LLR-000437 Prolog library lifecycle (Refined by)
STATEMENT: PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.
RATIONALE: Language-specific representations and error mechanisms must not silently change the numerical meaning of an exposed facility.
VERIFICATION_CRITERIA: Review the supported facility set for each interface and compare equivalent computations across enabled interfaces, including value conversion, object lifetime and error reporting.
BIBLIOGRAPHY: BagnaraHZ08SCP | Whole work (background on the library's numerical abstractions and design).
SOURCE: doc/definitions.dox: PPL_CXX_interface; interfaces/Makefile.am; interfaces/C/C_interface.dox; interfaces/Java/README.java.md; interfaces/OCaml/OCaml_interface.dox; interfaces/Prolog/Prolog_interface.dox.
The Prolog interface shall provide construction, copying and deletion of owned native numerical objects exposed through handles, including supported domain, MIP problem and PIP problem objects. Copy construction shall create an independent object, and deletion shall release the owned object and invalidate access through its handles and dependent views. Numerical-domain and MIP problem handles shall be checked for native type and live owner identity before native access. Powerset iterator and disjunct handles shall also be checked against the current owner generation. Borrowed powerset disjuncts shall be read-only. Iterator traversal shall reject boundary violations and operations combining different owners. Stale iterator objects shall remain explicitly releasable until finalization. PIP problem and tree handles shall be checked against a live owner identity and current generation before native access. PIP mutations shall invalidate previous tree views, and malformed, stale, unknown or wrong-type domain, MIP, powerset iterator/view and PIP handles shall raise a Prolog invalid-argument exception rather than dereferencing native storage.
Prolog term lifetime alone does not determine the lifetime of foreign numerical objects.
Verification covers Prolog owned domain and solver object creation, copying, deletion and dependent-view invalidation. Normal-lifetime release checks, independent-copy tests and ownership inspection verify those contracts. Numerical-domain, MIP, powerset iterator/view and PIP handles require automatic rejection of stale, malformed, unknown and wrong-type inputs. Their opaque identities are independent of coefficient width and never wrap or revive after finalization/reinitialization. Calls that may normalize a powerset conservatively invalidate its views and iterators; documented stable queries preserve them. MIP problems use the shared owned-object registry and are released at finalization; mutations preserve their problem handles. Constructor and copy outputs are discarded when unification fails or raises. The former optional allocation-tracking mechanism is retired. Prolog term collection or backtracking alone does not release an owned foreign numerical object. Library lifecycle is governed separately by 🔗 4. Prolog library lifecycle.
For supported domain, MIP problem and PIP problem objects, create an owned object and copy, modify one without changing the other, and delete each through its valid owned handle. Check normal-lifetime release of the corresponding native allocations. Review deletion invalidation and borrowed domain and solver views for their owner-lifetime and mutation-validity restrictions. For powersets, check borrowed-view mutation and deletion rejection, independent writable copies, aliasing inputs, both sides of swap, normalizing queries, stale views and iterators, iterator boundaries, foreign owners, reversed ranges, cursor refresh on single removal, range removal, release after owner deletion and failed output unification. Exercise registry address reuse, counter exhaustion and finalization/reinitialization. For MIP problems, exercise every predicate with deleted, malformed, unknown and wrong-type handles, both swap arguments, independent copies, failed constructor/copy output unification, finalization/reinitialization and identities beyond checked coefficient width. Confirm that clear, swap and ordinary updates preserve live problem handles. For PIP problems, exercise every mutation, both sides of swap, deletion, repeated deletion, finalization/reinitialization, and root, descendant and bottom views. Check stable repeated queries, wrong node kinds, failed output unification, native-address reuse, bounded registry storage and counter exhaustion. Coordinate these cases with the permitted library lifecycle transitions in 🔗 1. Initialization and finalization lifecycle.
interfaces/Prolog/Prolog_interface_sysindep.dox, object handles, ownership and MIP and PIP problem construction, copying and deletion; interfaces/Prolog/Prolog_interface_sysindep_domains.dox, domain constructors, copies, deletion and iterators; interfaces/Prolog/ppl_prolog_common_defs.hh and interfaces/Prolog/ppl_prolog_common.cc, typed object ownership and problem lifetime operations; interfaces/Prolog/ppl_prolog_domain_handles.hh and interfaces/Prolog/tests/domain_handles1.cc, typed numerical-domain ownership and powerset iterator/view registry and regressions; interfaces/Prolog/ppl_prolog_pip_handles.hh, typed PIP owner and generation registry; interfaces/Prolog/tests/pip_handles1.cc and interfaces/Prolog/tests/pl_check.pl, PIP lifetime regressions.
-
Incoming link from: 2. Prolog success failure and exception outcomes1
3. Prolog owned domain and MIP handles UID: PPL-SPEC-001697 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT: Constructors shall return an opaque typed handle owning the new domain or MIP object. Copy constructors shall create an independent owned object. Deletion shall release the object and invalidate all aliases of its identity. Native access shall first check live owner identity and required native type; malformed, stale, unknown and wrong-type handles shall raise invalid-argument errors through 🔗 2. Prolog success failure and exception outcomes.
Owner identities shall not wrap or be reused, including across finalization and reinitialization. Registry exhaustion shall reject construction rather than revive an old identity. MIP clear, swap and normal updates shall preserve live problem handles. Finalization shall release registered owned objects. A failed constructor/copy output unification shall discard the unpublished allocation. Term collection and backtracking alone shall not delete a foreign owned object.
RATIONALE: Non-reused typed identities distinguish ownership from native addresses, preventing stale terms from accessing recycled storage.
INTERFACE: Configured domain construction/copy/deletion predicates and the common MIP operations, including:
ppl_new_MIP_Problem_from_space_dimension(Dimension, Handle) ppl_new_MIP_Problem_from_MIP_Problem(Source, Copy) ppl_delete_MIP_Problem(Handle)
Handles are opaque terms; applications shall not construct or inspect their encoding. Registry lookup, native use and mutation obey the interface lock.
VERIFICATION_CRITERIA: Check independent copies, deletion/repeated deletion and every MIP entry point with malformed, wrong-type and stale handles. Exercise failed output unification, concrete destruction, address reuse, identity exhaustion and finalize/reinitialize sequences, including checked coefficients narrower than handle identities.
SOURCE: interfaces/Prolog/ppl_prolog_domain_handles.hh; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/domain_handles1.cc; interfaces/Prolog/tests/pl_check.pl.
-
4. Prolog powerset iterator and disjunct validity UID: PPL-SPEC-001698 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT: Powerset iterator and disjunct access shall validate live owner identity, required native type and captured owner generation. Potentially normalizing queries and mutations shall invalidate dependent views; documented stable metadata queries shall preserve them. Swap shall invalidate views of both owners. Borrowed disjuncts shall be read-only; copying one shall produce an independent writable object.
Traversal shall reject end dereference, advancement past the end, movement before the beginning and operations combining different owners. Range removal shall reject reversed ranges. Single removal shall refresh its returned cursor while invalidating other captured cursors and views. Stale iterators shall remain explicitly deletable without dereferencing their former native node until library finalization. Failed view-output unification shall not leak a registry object. Invalid uses shall raise invalid-argument errors.
RATIONALE: An iterator address alone cannot establish ownership or validity after a container changes.
INTERFACE: Configured Pointset_Powerset construction/copy, begin_iterator, end_iterator, iterator-copy, increment/decrement/equality, get_disjunct, single/range-removal and iterator-deletion predicates, with the concrete names generated for the selected disjunct type. Iterators are explicitly owned handles; disjuncts are borrowed read-only views of their registered owner.
VERIFICATION_CRITERIA: Check each boundary, foreign-owner and reversed-range case, read-only rejection, independent copies, normalizing versus stable queries, both swap operands, owner deletion, cursor refresh, failed output unification and release of stale iterators.
SOURCE: interfaces/Prolog/ppl_prolog_domain_handles.hh; generated Prolog domain predicates; interfaces/Prolog/tests/domain_handles1.cc; interfaces/Prolog/tests/pl_check.pl.
-
Incoming link from: 2. Prolog success failure and exception outcomes1
5. Prolog PIP owner and tree generations UID: PPL-SPEC-001699 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT: PIP problem and tree handles shall validate live typed owner identity before native access. A tree view shall additionally match the current problem generation and required node kind. Mutations, clear, swap of either operand, problem deletion and finalization shall invalidate prior tree views. Repeated stable solution queries shall preserve valid current-generation identities.
Unknown, malformed, stale and wrong-kind handles shall raise invalid-argument errors. Owner and view identity counters shall reject exhaustion rather than wrap; finalization/reinitialization and native-address reuse shall not revive old terms. Registry storage for old tree generations shall be reclaimed when invalidated. Failed constructor/copy/view output unification shall discard unpublished owned resources without deleting an independently owned object.
RATIONALE: PIP solves and mutations can replace an entire tree while reusing native addresses; ownership and generation must therefore be checked independently.
INTERFACE: Common ppl_new_PIP_Problem*, ppl_delete_PIP_Problem, ppl_PIP_Problem_solution, optimizing-solution, mutation and swap predicates, and ppl_PIP_Tree_Node_* queries. Root, descendant and bottom handles belong to a particular live problem generation; a tree view never owns the problem's native tree allocation.
VERIFICATION_CRITERIA: Check every mutation and both swap sides, node-kind errors, roots/descendants/bottom, deletion, repeated deletion, address reuse, failed unification, generation-storage bounds, counter exhaustion and finalization/reinitialization.
SOURCE: interfaces/Prolog/ppl_prolog_pip_handles.hh; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/pip_handles1.cc; interfaces/Prolog/tests/pl_check.pl.
-
7. Access through supported language interfaces UID: PPL-HLR-000007 STATUS: APPROVED COMPONENT: LIBRARY_WIDE APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis, Review RELATIONS (Child): - PPL-LLR-000213 Configured binding domain selection (Refined by)
- PPL-LLR-000214 Mathematical consistency of corresponding binding operations (Refined by)
- PPL-LLR-000215 Consistent binding type dependencies (Refined by)
- PPL-LLR-000439 Binding interruption support and state changes (Refined by)
- PPL-LLR-000201 Explicit C library lifecycle (Refined by)
- PPL-LLR-000202 C object ownership and borrowed access (Refined by)
- PPL-LLR-000203 C boundary error reporting (Refined by)
- PPL-LLR-000311 Public C++ access to supported facilities (Refined by)
- PPL-LLR-000312 Independent values after copying domain objects (Refined by)
- PPL-LLR-000204 Java coefficient value preservation (Refined by)
- PPL-LLR-000205 Java library lifecycle (Refined by)
- PPL-LLR-000206 Java boundary exception translation (Refined by)
- PPL-LLR-000436 Java native object ownership (Refined by)
- PPL-LLR-000207 OCaml numerical term conversion (Refined by)
- PPL-LLR-000208 OCaml native object reclamation (Refined by)
- PPL-LLR-000209 OCaml boundary error translation (Refined by)
- PPL-LLR-000210 Prolog mathematical term interpretation (Refined by)
- PPL-LLR-000211 Prolog predicate outcomes (Refined by)
- PPL-LLR-000212 Prolog object lifetime operations (Refined by)
- PPL-LLR-000437 Prolog library lifecycle (Refined by)
STATEMENT: PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.
RATIONALE: Language-specific representations and error mechanisms must not silently change the numerical meaning of an exposed facility.
VERIFICATION_CRITERIA: Review the supported facility set for each interface and compare equivalent computations across enabled interfaces, including value conversion, object lifetime and error reporting.
BIBLIOGRAPHY: BagnaraHZ08SCP | Whole work (background on the library's numerical abstractions and design).
SOURCE: doc/definitions.dox: PPL_CXX_interface; interfaces/Makefile.am; interfaces/C/C_interface.dox; interfaces/Java/README.java.md; interfaces/OCaml/OCaml_interface.dox; interfaces/Prolog/Prolog_interface.dox.
Each supported Prolog adapter shall establish library initialization before supported predicate use, explicitly or automatically according to its documented loading protocol. Repeated initialization and finalization requests shall be harmless. Following finalization, only the documented lifecycle operations shall be permitted until initialization establishes a new valid period of use.
Supported engines differ in automatic foreign-module loading hooks, while the common Prolog interface has an idempotent lifecycle distinct from the C lifecycle protocol.
Verification covers common Prolog lifecycle predicates and each supported adapter's automatic loading hooks. Lifecycle sequence checks and adapter inspection verify the protocol. The lifecycle protocol does not require automatic diagnosis of every operation invoked outside its lifecycle preconditions. Object ownership remains governed by 🔗 3. Prolog object lifetime operations; its protocol need not match the duplicate-request errors of 🔗 1. Explicit C library lifecycle.
For each selected supported engine and loading mode, review automatic initialization and finalization hooks and exercise explicit initialization, repeated initialization, finalization, repeated finalization and reinitialization. Check the documented permitted-call state transitions without treating stale foreign-object handles as newly valid after reinitialization.
interfaces/Prolog/Prolog_interface_sysindep.dox: Initialization and Finalization and engine-dependent loading hooks; interfaces/Prolog/ppl_prolog_common.cc: common lifecycle operations; interfaces/Prolog/Prolog_interface.dox: supported adapter documentation.
-
6. Prolog library lifecycle protocol UID: PPL-SPEC-001700 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT: ppl_initialize shall establish the common native state if it is not already initialized; a repeated request shall succeed harmlessly. ppl_finalize shall release binding-owned interruption resources and registered objects and leave the interface uninitialized; a repeated request shall also be harmless. A subsequent initialization shall permit a new valid period of use without making old handles valid. Fixed interface atom names cached during initialization shall remain valid across the engine's atom and string garbage collection.
Each engine adapter shall invoke initialization through its documented loading hook or require explicit initialization before numerical predicate use. After finalization, clients shall use only lifecycle operations until the next initialization. The protocol does not require diagnosis of every violation of these call-state preconditions.
RATIONALE: Engine loading hooks differ, while the common lifecycle must remain safe under repeated requests.
INTERFACE: ppl_initialize ppl_finalize
Both predicates have arity zero. Automatic hooks depend on the configured Prolog runtime and loading mode; they establish the same common lifecycle.
VERIFICATION_CRITERIA: Check repeated initialize/finalize, use in two valid periods, stale-handle rejection across those periods and each configured engine loading hook. Inspect timer, registry and initialization-owner cleanup. In a fresh XSB engine, collect atoms before using cached names, then check the first returned control-parameter atom in two initialization periods.
SOURCE: interfaces/Prolog/ppl_prolog_common.cc; engine adapters; interfaces/Prolog/tests/pl_check.pl; interfaces/Prolog/XSB/xsb_cached_atoms_gc.P.