Parma Polyhedra Library requirements
Borrowed widening-function wrappers

Borrowed widening-function wrappers

PPL-SPEC-001571
1. Selected widening-method delegation
UID: PPL-SPEC-001571
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Widening_Function<PSET> shall retain the supplied nonnull widening member pointer. Its application to x, y and tp shall invoke that selected method once, on x, passing the same y reference and the same token pointer. The omitted token argument shall be null. The selected method's domain, dimension, ordering and token-lifetime preconditions shall apply unchanged. Its mutations and exceptions shall propagate without additional copying of the pointsets or tokens. Copying the wrapper shall retain the selected method. widen_fun_ref(wm) shall return a wrapper with that binding.

RATIONALE:

Powerset algorithms must invoke the selected domain widening without changing its direction, tokens or error behavior.

INTERFACE:

Defining header: Widening_Function_defs.hh. Namespace: Parma_Polyhedra_Library.

template <typename PSET> class Widening_Function {
public:
  using Widening_Method = void (PSET::*)(const PSET&, unsigned*);
  explicit Widening_Function(Widening_Method);
  void operator()(PSET&, const PSET&, unsigned* = nullptr) const;
};
template <typename PSET>
Widening_Function<PSET> widen_fun_ref(void (PSET::*)(const PSET&, unsigned*));
VERIFICATION_CRITERIA:

Use a recording pointset to verify exact target/source/pointer identities, alternate selected methods, wrapper copies, null and nonnull tokens, one invocation and exception identity; compare a real polyhedron widening with its independently stated set result.

SOURCE:

src/Widening_Function_defs.hh; src/Widening_Function_inlines.hh; tests/wideningfunctionspec1.cc; tests/Polyhedron/limitedwideningfunctors1.cc.

PPL-SPEC-001572
2. Limited widening with borrowed limiting constraints
UID: PPL-SPEC-001572
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Limited_Widening_Function<PSET,CSYS> shall retain a nonnull selected member pointer and borrow the supplied limiting system. The system shall outlive every application of the wrapper or a copy. Application shall invoke the selected method once on x, passing the same y reference, the same live limiting system and the same token pointer, null when omitted. Changes to the limiting system before an application shall be visible. The selected method's preconditions, mutations and exceptions shall apply unchanged; neither wrapper construction nor application shall copy pointsets or limiting constraints. widen_fun_ref(lwm,cs) shall return this binding; copying the wrapper shall preserve both bindings without taking ownership.

RATIONALE:

Limiting constraints are borrowed algorithm parameters, and copying a wrapper must not silently snapshot or own them.

INTERFACE:

Defining header: Widening_Function_defs.hh. Namespace: Parma_Polyhedra_Library.

template <typename PSET, typename CSYS> class Limited_Widening_Function {
public:
  using Limited_Widening_Method
    = void (PSET::*)(const PSET&, const CSYS&, unsigned*);
  Limited_Widening_Function(Limited_Widening_Method, const CSYS&);
  void operator()(PSET&, const PSET&, unsigned* = nullptr) const;
};
template <typename PSET, typename CSYS>
Limited_Widening_Function<PSET, CSYS>
widen_fun_ref(void (PSET::*)(const PSET&, const CSYS&, unsigned*), const CSYS&);
VERIFICATION_CRITERIA:

Use noncopyable recording arguments, mutate the borrowed limiter between applications and verify exact identities, selected methods, tokens, invocation counts, copies and exception propagation. Check a real limited widening against an exact polyhedral constraint oracle.

SOURCE:

src/Widening_Function_defs.hh; src/Widening_Function_inlines.hh; tests/wideningfunctionspec1.cc; tests/Polyhedron/limitedwideningfunctors1.cc.