Parma Polyhedra Library requirements
Low-Level Requirements: Java Interface
  • PPL-HLR-000007
    7. Access through supported language interfaces PPL-HLR-000007

    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.

PPL-LLR-000204
1. Java coefficient value preservation PPL-LLR-000204

The Java interface shall preserve integral coefficient values when transferring them between Java objects and the native library, provided the values are representable by the configured native coefficient type. It shall not reduce an otherwise representable coefficient to the range of Java's fixed-width primitive integers.

  • 1. Java integral coefficient exchange PPL-SPEC-001688

    Coefficient shall hold the integer supplied through its integer, decimal string or BigInteger constructor, and copying and getBigInteger shall preserve that value. toString shall return its decimal representation. bits shall return the configured native coefficient width, or zero for unbounded native coefficients.

    For a valid coefficient representable by the native coefficient type, conversion through a supported native operation and back to Java shall preserve its integral value, including its sign and zero. Conversion shall use the full decimal value, without narrowing it through int or long. In an unbounded configuration this includes integers outside both primitive ranges. Native arithmetic retains its configured range and policy; Java's BigInteger does not extend that range. Checked out-of-range conversion shall use 🔗 3. Java native failure and pending-exception protocol.

  • PPL-HLR-000007
    7. Access through supported language interfaces PPL-HLR-000007

    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.

PPL-LLR-000205
2. Java library lifecycle PPL-LLR-000205

The Java interface shall provide explicit initialization and finalization of the native library after its native interface library has been loaded. Finalization shall release the interface's library-level resources, and subsequent initialization shall permit a new valid period of library use.

  • 2. Java library initialization and finalization PPL-SPEC-001689

    After loading the configured JNI library, initialize_library shall establish native library state and the Java class cache before supported operations. finalize_library shall release that cache, the calling thread's variable stringifier and deterministic-timeout state, and the native initialization owner. A later initialization shall establish a new valid period of use.

    Clients shall release owned objects, cease using borrowed views, and end worker thread participation before finalization. Requests shall alternate valid initialization and finalization; duplicate library requests are outside this protocol. Participating workers shall obey 🔗 6. Thread entry and shared-facility use.

  • PPL-HLR-000007
    7. Access through supported language interfaces PPL-HLR-000007

    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.

PPL-LLR-000206
3. Java boundary exception translation PPL-LLR-000206

The Java interface shall report every native failure designated by its supported failure model through the Java exception mechanism, distinguishing the declared categories including invalid arguments, arithmetic overflow and resource exhaustion. Native C++ exceptions raised by supported operations shall be contained at the Java native-call boundary. An already pending Java exception shall be preserved.

  • 3. Java native failure and pending-exception protocol PPL-SPEC-001690

    Supported JNI numerical entry points shall contain native exceptions. Native invalid_argument, domain_error, length_error, logic_error and overflow_error shall become the corresponding Java binding exceptions. Supported native interruption shall become Timeout_Exception. Allocation failure shall become a Java exception describing out-of-memory failure; other standard and unexpected native exceptions shall become RuntimeException with a diagnostic.

    A Java exception already pending after a host callback or object creation shall be returned to Java without replacement by a translated native exception. Argument-conversion callbacks shall complete before native access to a receiver that they may release; released receivers shall be rejected. Host-runtime termination and undefined behavior are outside the failure model.

  • PPL-SPEC-001729
    7. Java dimension limits and exact native counts PPL-SPEC-001729

    For an unsigned integral native type, java_dimension_limit shall return the smaller of the supplied native limit and the greatest Java long value. java_unsigned_value shall return the exact supplied count when representable by Java long and otherwise throw std::overflow_error. check_java_dimension_growth shall check the current dimension and both successive increments against that effective limit without unsigned wraparound. It shall throw std::length_error if the resulting dimension is inadmissible, before either increment is applied to the numerical object.

    JNI count queries for PIP parameter dimensions, constraints and artificial parameters shall return the corresponding native cardinalities. They require valid problem/node handles; wrapper failures follow 🔗 3. Java native failure and pending-exception protocol. A constraint count already represented by a signed iterator difference shall be representable by Java long; other unsigned count conversion uses the checked conversion above.

  • PPL-HLR-000007
    7. Access through supported language interfaces PPL-HLR-000007

    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.

PPL-LLR-000436
4. Java native object ownership PPL-LLR-000436

The Java interface shall distinguish owned native objects from borrowed native views. When explicit release or managed cleanup of an owned wrapper occurs, it shall release the owned native allocation without repeated cleanup releasing that allocation again. Creating a borrowed view shall not transfer ownership of the underlying allocation. The interface shall define the owner-lifetime and mutation-validity preconditions for each borrowed view.

  • PPL-SPEC-001691
    4. Java owned wrappers and borrowed views PPL-SPEC-001691

    An owned numerical wrapper shall release its native allocation through explicit free or managed finalization, without a later cleanup deleting that allocation again. Copy construction shall produce an independent native object. Borrowed-wrapper cleanup shall not delete the underlying owned object.

    Factories shall bind view owners before allocating native cursor storage, or retain native results in an exception-safe owner until all fallible publication steps complete. Failed JNI allocation or native computation shall leave no stranded native result. Replacing a ranking-function output shall release its previous value while preserving ownership of the output wrapper.

    MIP and partial-function wrappers shall reject native access after release. Powerset cursors and disjuncts shall retain their owner, validate its current generation, and reject stale use; disjuncts shall be read-only and copying one shall produce an independent writable object. Cursor operations shall reject boundary and foreign-owner misuse. Mutating or potentially normalizing a powerset shall invalidate its dependent views except for the documented cursor returned by single removal. Stable metadata queries shall preserve them.

    PIP tree views shall retain their problem owner and reject access after owner release or a mutation invalidating the captured tree generation. View cleanup shall leave independently owned problems usable. Managed cleanup timing is controlled by the JVM. Clients shall obey 🔗 2. Java library initialization and finalization and the operation-specific borrowing and synchronization prerequisites.