C++ concrete-expression types, target adapters and oracles
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
|
Concrete_Expression_Type::bounded_integer() shall create a value identifying the supplied modeled width, representation and overflow interpretation. The admitted widths shall be BITS_8, BITS_16, BITS_32, BITS_64 and BITS_128; representations shall be UNSIGNED and SIGNED_2_COMPLEMENT; overflow interpretations shall be OVERFLOW_WRAPS, OVERFLOW_UNDEFINED and OVERFLOW_IMPOSSIBLE. The result shall classify as bounded integer and not floating point, and its matching-kind getters shall return those attributes exactly. These shall describe analyzed arithmetic, independently of native host integer types and of the configured coefficient storage. Modeling 128 bits shall not require a native 128-bit type. The factory and accessors shall require no PPL initialization, arithmetic evaluation or FPU setup. |
Modeled integer meaning must retain width, sign representation and overflow choices without confusing them with host storage capabilities. |
|
|
|
|
|
Check all 30 named attribute combinations, including 128 bits, under supported and no-native-FP configurations without initialization; compare every matching-kind getter and discriminator. |
src/Concrete_Expression_defs.hh; src/Concrete_Expression_inlines.hh; src/Concrete_Expression_types.hh; src/Concrete_Expression.cc; src/Float_defs.hh; tests/expressionprotocolsspec1.cc; tests/expressionprotocolfixture.hh; tests/expressiontype1.cc; tests/expressionpublic1.cc; src/globals_types.hh. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to their corresponding class templates; target-provided excerpts describe the required adapter protocol. static Concrete_Expression_Type bounded_integer( Bounded_Integer_Type_Width width, Bounded_Integer_Type_Representation representation, Bounded_Integer_Type_Overflow overflow); bool is_bounded_integer() const; bool is_floating_point() const; Bounded_Integer_Type_Width bounded_integer_type_width() const; Bounded_Integer_Type_Representation bounded_integer_type_representation() const; Bounded_Integer_Type_Overflow bounded_integer_type_overflow() const; |
||
|
SW_SPEC
|
2 |
|
|
Incoming link from:
3. Finite floating-format value inclusion
1 |
Concrete_Expression_Type::floating_point() shall create a value identifying the supplied modeled format. The admitted formats shall be IEEE754_HALF, IEEE754_SINGLE, IEEE754_DOUBLE, IEEE754_QUAD, INTEL_DOUBLE_EXTENDED, IBM_SINGLE and IBM_DOUBLE. The value shall classify as floating point and not bounded integer; its matching-kind format getter shall return the supplied format exactly. A modeled format shall remain available as metadata when host arithmetic in that format is unavailable. This factory shall not construct a host floating-point value or imply that every numerical algorithm supports every modeled format. It shall require no PPL initialization or FPU setup. |
Analyzed format identity and availability of a host implementation are different capabilities. |
|
|
|
|
|
Check all seven named formats without numerical evaluation or initialization, including formats unavailable natively and an actual no-native-FP configuration. |
src/Concrete_Expression_defs.hh; src/Concrete_Expression_inlines.hh; src/Concrete_Expression_types.hh; src/Concrete_Expression.cc; src/Float_defs.hh; tests/expressionprotocolsspec1.cc; tests/expressionprotocolfixture.hh; tests/expressiontype1.cc; tests/expressionpublic1.cc; src/globals_types.hh. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to their corresponding class templates; target-provided excerpts describe the required adapter protocol. static Concrete_Expression_Type floating_point(Floating_Point_Format format); bool is_bounded_integer() const; bool is_floating_point() const; Floating_Point_Format floating_point_format() const; |
||
|
SW_SPEC
|
3 |
|
|
|
Implicit copying and assignment of Concrete_Expression_Type shall preserve its discriminator and complete matching-kind attributes as independent values. Assigning the other category shall replace the previous category and attributes. Getter calls shall require the matching category; querying inactive-category fields shall not be a supported way to convert a descriptor. OK() shall accept descriptors constructed from the named admitted attributes and reject stored invalid attribute combinations. Factories shall not be required to throw for unnamed enumeration values. Values used solely for validity diagnostics shall still lie within the enumeration's C++ value range; a rejected descriptor shall not be used as an admitted expression type. Copying, assignment and diagnostics shall require no PPL initialization or FPU setup. |
Category-safe queries and independent metadata values prevent accidental reinterpretation of unrelated attributes. |
|
|
|
|
|
Check copies/self-assignment/category replacement and preserved donors; exercise unnamed in-range widths 0/24/255, overflow 3 and format 7 solely through OK(), and inspect inactive-field invariant checks. |
src/Concrete_Expression_defs.hh; src/Concrete_Expression_inlines.hh; src/Concrete_Expression_types.hh; src/Concrete_Expression.cc; src/Float_defs.hh; tests/expressionprotocolsspec1.cc; tests/expressionprotocolfixture.hh; tests/expressiontype1.cc; tests/expressionpublic1.cc; src/globals_types.hh. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to their corresponding class templates; target-provided excerpts describe the required adapter protocol. Concrete_Expression_Type(const Concrete_Expression_Type&); Concrete_Expression_Type& operator=(const Concrete_Expression_Type&); bool OK() const; |
||
|
SW_SPEC
|
4 |
|
|
Incoming link from:
1. Target-adapted floating expression evaluation
1 |
A target used with the concrete-expression analysis templates shall provide specializations for the expression base and the supported binary, unary, cast, integer-constant, floating-constant and approximable-reference node adapters. Each node kind shall have a distinct KIND matching the base expression's kind() result. type() shall return the node's modeled numeric type. The base adapter shall derive unambiguously and nonvirtually from Concrete_Expression_Common<Target>; a kind-specific adapter shall have the corresponding concrete base lineage required for its downcast. Binary adapters shall expose distinct ADD, SUB, MUL, DIV, REM, BAND, BOR, BXOR, LSHIFT and RSHIFT operator identities and borrowed left/right expression pointers. Unary adapters shall expose UPLUS, UMINUS and BNOT and a borrowed argument pointer. Cast adapters shall expose their borrowed argument pointer. A target used with the general linearize() template shall provide all adapters and operator names needed to instantiate its dispatch, even if a particular input uses fewer kinds. Nodes, children and target-specific payloads shall remain live, type-correct and unchanged throughout analysis. Argument pointers for an admitted operation shall be nonnull; the analyzed graph shall have no recursion cycle. The PPL common adapters shall not take ownership of target nodes or supply a runtime polymorphic deletion protocol. Target-owned storage and callbacks shall retain their own lifetime and synchronization prerequisites. |
Explicit target adapters let an analyzer expose its own expression graph without copying it into a PPL-owned tree. |
|
|
|
|
|
Instantiate a target with distinct nonconsecutive kind/operator codes, borrowed children and every required adapter; verify payload/type/child identities and valid analysis dispatch without assuming a particular host AST layout. |
src/Concrete_Expression_defs.hh; src/Concrete_Expression_inlines.hh; src/Concrete_Expression_types.hh; src/Concrete_Expression.cc; src/Float_defs.hh; tests/expressionprotocolsspec1.cc; tests/expressionprotocolfixture.hh; tests/expressiontype1.cc; tests/expressionpublic1.cc; src/globals_types.hh. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to their corresponding class templates; target-provided excerpts describe the required adapter protocol. template <typename Target> class Concrete_Expression; template <typename Target> class Binary_Operator; template <typename Target> class Unary_Operator; template <typename Target> class Cast_Operator; template <typename Target> class Integer_Constant; template <typename Target> class Floating_Point_Constant; template <typename Target> class Approximable_Reference; typedef int Concrete_Expression_Kind; typedef int Concrete_Expression_BOP; typedef int Concrete_Expression_UOP; // Required target-provided member signatures, on their corresponding adapters: Concrete_Expression_Type type() const; Concrete_Expression_Kind kind() const; Concrete_Expression_BOP binary_operator() const; const Concrete_Expression<Target>* left_hand_side() const; const Concrete_Expression<Target>* right_hand_side() const; Concrete_Expression_UOP unary_operator() const; const Concrete_Expression<Target>* argument() const; |
||
|
SW_SPEC
|
5 |
|
|
|
For a live well-formed target expression, is<Derived>() shall return true exactly when the target's current kind equals Derived<Target>::KIND. It shall not change the expression or acquire its ownership. The mutable and const as<Derived>() operations shall return pointers to the same actual derived node with the respective qualification. Their caller shall first establish a matching kind and correct actual inheritance/dynamic node type. A mismatched cast shall be outside the admitted interface; this shall not be a checked RTTI or allocating conversion. |
Kind tests and borrowed static downcasts require consistent target tags and preserve node identity. |
|
|
|
|
|
Check all kind-test combinations across six node categories and const/mutable casts of each matching actual type; compare exact original pointers and retain payloads/children. |
src/Concrete_Expression_defs.hh; src/Concrete_Expression_inlines.hh; src/Concrete_Expression_types.hh; src/Concrete_Expression.cc; src/Float_defs.hh; tests/expressionprotocolsspec1.cc; tests/expressionprotocolfixture.hh; tests/expressiontype1.cc; tests/expressionpublic1.cc; src/globals_types.hh. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to their corresponding class templates; target-provided excerpts describe the required adapter protocol. template <typename Target> template <template <typename T> class Derived> bool Concrete_Expression_Common<Target>::is() const; template <typename Target> template <template <typename T> class Derived> Derived<Target>* Concrete_Expression_Common<Target>::as(); template <typename Target> template <template <typename T> class Derived> const Derived<Target>* Concrete_Expression_Common<Target>::as() const; |
||
|
SW_SPEC
|
6 |
|
|
Incoming link from:
1. Target-adapted floating expression evaluation
1 |
FP_Oracle<Target, C> shall define an abstract client-supplied query interface for a coordinate interval, a floating-point constant value and an integer expression value. A true return shall mean that the output is an initialized valid interval enclosing all relevant values under the client's current modeled state. A false return shall mean that the query supplies no usable complete enclosure; callers shall not infer an unchanged output value. An admitted oracle shall report refusal rather than certify an unsound enclosure. The oracle and target inputs shall remain live and semantically consistent with the analyzed expression and any affine store throughout one analysis. Callbacks may propagate their documented exceptions. C shall provide the selected valid interval operations; rational interval queries shall not require host floating-point arithmetic merely because the interface is named FP_Oracle. Construction/destruction of the concrete oracle shall remain with its client; the protected nonvirtual base destructor shall not support deleting an owned oracle through a base pointer. |
A true oracle response is an enclosure promise from the analyzer, while explicit refusal prevents a partial query from being treated as established numerical information. |
|
|
|
|
|
Check abstract/protected-destructor type properties, typed callback arguments, direct rational query results, refusals and recovery; verify consuming analyses propagate false without treating stale outputs as evidence. |
src/Concrete_Expression_defs.hh; src/Concrete_Expression_inlines.hh; src/Concrete_Expression_types.hh; src/Concrete_Expression.cc; src/Float_defs.hh; tests/expressionprotocolsspec1.cc; tests/expressionprotocolfixture.hh; tests/expressiontype1.cc; tests/expressionpublic1.cc; src/globals_types.hh. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to their corresponding class templates; target-provided excerpts describe the required adapter protocol. template <typename Target, typename C> class FP_Oracle; virtual bool get_interval(dimension_type coordinate, C& result) const = 0; virtual bool get_fp_constant_value( const Floating_Point_Constant<Target>& expression, C& result) const = 0; virtual bool get_integer_expr_value( const Concrete_Expression<Target>& expression, C& result) const = 0; // Protected base destructor: ~FP_Oracle(); |
||
|
SW_SPEC
|
7 |
|
|
|
get_associated_dimensions() shall provide the possible coordinate identities denoted by an approximable reference. On true return, its output set shall contain every possible associated coordinate and shall not contain not_a_dimension(). An empty successful set shall remain distinguishable from a single identity and multiple possible identities; it shall not by itself authorize a numerical enclosure. On false return the set shall not establish a usable association. Returned coordinate identities shall remain consistent with coordinate-value queries and the affine store during the analysis call. The oracle shall not transfer ownership of the target reference or create a new coordinate merely by reporting its identity. |
Symbolic reference identity and numerical value information are different queries; multiple aliases require conservative handling. |
|
|
|
|
|
Check typed associations for empty/single/multiple coordinate sets, failure/retry and independent output ownership; verify linearization rejects unavailable/empty associations and conservatively handles multiple identities. |
src/Concrete_Expression_defs.hh; src/Concrete_Expression_inlines.hh; src/Concrete_Expression_types.hh; src/Concrete_Expression.cc; src/Float_defs.hh; tests/expressionprotocolsspec1.cc; tests/expressionprotocolfixture.hh; tests/expressiontype1.cc; tests/expressionpublic1.cc; src/globals_types.hh. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to their corresponding class templates; target-provided excerpts describe the required adapter protocol. virtual bool get_associated_dimensions( const Approximable_Reference<Target>& expression, std::set<dimension_type>& result) const = 0; |