C++ pip trees
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
|
A returned tree shall be interpreted at parameter assignments in the scope defined by 🔗 1. Parametric problem and context interpretation. At each node, local artificial parameters shall be introduced in stored order after all original coordinates and inherited artificial parameters. An artificial parameter a = ⌊e ⁄ d⌋ shall use mathematical floor, including for negative numerators. Its expression shall refer only to original parameters and earlier artificial parameters in scope. A decision's true branch shall require all local guards; its false branch, when present, shall require the complement of its single guard. A solution leaf shall require its own guards in addition to the path context. Missing branches and failed leaf guards shall mean infeasibility within that result's scope. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Guard evaluation and the scope of floor expressions jointly determine the meaning of a symbolic leaf. |
|
|
|
|
|
Use an independent integer-floor tree interpreter on bounded contexts, negative numerators, inherited/local artificial parameters, false decisions and guarded leaves. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/boundedcontexts1.cc; tests/PIP_Problem/contextrefinement1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipproblem1.cc; tests/PIP_Problem/zerofaces1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. class PIP_Tree_Node; class PIP_Solution_Node; class PIP_Decision_Node; |
||
|
SW_SPEC
|
2 |
|
|
|
constraints shall return a borrowed const view of the node's local parameter guards. Artificial-parameter iterators shall traverse the local stored sequence in introduction order; the count shall report its size, without including ancestor parameters. The half-open range shall be empty when no local artificial parameter is introduced. Storage changes and node destruction may invalidate these borrowed views and iterators. Borrowing local constraints or artificial-parameter iterators shall require an lvalue node. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Local scope must be distinguished from the inherited parameter environment when traversing a tree. |
|
|
|
|
|
Check counts, range order and local versus ancestor scope on deep trees and round trips, and evaluate each guard independently. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/contextrefinement1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipproblem1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. const Constraint_System& constraints() const &; Artificial_Parameter_Sequence::const_iterator art_parameter_begin() const &; Artificial_Parameter_Sequence::const_iterator art_parameter_end() const &; dimension_type art_parameter_count() const; |
||
|
SW_SPEC
|
3 |
|
|
|
get_owner shall return the node's non-owning problem association. set_owner shall update that association throughout the receiver's subtree; check_ownership shall report whether every node in that subtree has the supplied owner. Rebinding shall not copy nodes or re-solve a problem. Callers rebinding a tree for interpretation shall provide a live owner with compatible original dimensions and parameter meanings. Every tree returned by a problem shall refer to that problem throughout its subtree. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Original coordinate interpretation is obtained through the problem association rather than stored independently in each leaf. |
|
|
|
|
|
Check every node after problem copy, assignment, exchange and loading, and explicit rebinding of a separately owned clone. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/ascii_dump_load1.cc; tests/PIP_Problem/contextrefinement1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipproblem3.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. The base-class constructors and owner-association operations are protected. const PIP_Problem* get_owner() const; virtual void set_owner(const PIP_Problem*) = 0; virtual bool check_ownership(const PIP_Problem*) const = 0; |
||
|
SW_SPEC
|
4 |
|
|
|
clone shall allocate a structurally independent copy of the subtree, including guards, artificial parameters and solution representation, and return ownership of that copy to its caller. It shall preserve the original owner association but detach the clone's root from its former parent. Copied children shall refer to their copied parent. Deleting a tree through its virtual base shall release every owned descendant. Failed cloning shall release any subtree already acquired. Initial solution-node construction shall create solver state associated with the supplied owner; numerical leaf access shall require a complete solved representation. Temporary ownership during recursive solving shall protect the successfully returned subtree or newly adopting parent. Retargeting that protection shall not delete a root already consumed by solving or adopted by the parent. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Tree storage can be independent while the problem association remains borrowed. |
|
|
|
|
|
Clone nested true/false subtrees, destroy source or copies in valid ownership order, rebind compatible owners and inject failures during child copying. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/ascii_dump_load1.cc; tests/PIP_Problem/contextrefinement1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipproblem1.cc; tests/PIP_Problem/pipproblem3.cc; tests/pipcolumnsspec1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. The base-class constructors and owner-association operations are protected. explicit PIP_Tree_Node(const PIP_Problem*); PIP_Tree_Node(const PIP_Tree_Node&); explicit PIP_Solution_Node(const PIP_Problem*); virtual PIP_Tree_Node* clone() const = 0; virtual ~PIP_Tree_Node(); |
||
|
SW_SPEC
|
5 |
|
|
|
Default construction shall represent zero with denominator one. Construction from expr and nonzero d shall preserve their rational ratio while normalizing the denominator to positive and dividing numerator coefficients, constant and denominator by their common factor. Zero denominator shall raise std::invalid_argument. In tree interpretation the value shall be the floor of that normalized rational expression. Copying and assignment shall preserve the stored numerator expression, dimension and denominator, with independent later mutations. Exchange shall swap them. Equality shall compare stored dimension, numerator and denominator; inequality shall negate it. Equality shall not identify all distinct formulas that happen to have equal floors on a particular context. Inherited expression mutations shall follow the linear-expression contracts and shall not implicitly renormalize this denominator. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Joint normalization preserves the rational expression, whereas changing only the denominator would change the integer floor. |
|
|
|
|
|
Check both denominator signs, zero numerator, common factors including constants, negative floors, dimensions, copy/assignment/exchange and structurally distinct equivalent expressions. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/ascii_dump_load1.cc; tests/PIP_Problem/contextrefinement1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipproblem2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. class PIP_Tree_Node::Artificial_Parameter : public Linear_Expression { public: Artificial_Parameter(); Artificial_Parameter(const Linear_Expression&, Coefficient_traits::const_reference); Artificial_Parameter(const Artificial_Parameter&); Artificial_Parameter& operator=(const Artificial_Parameter&) = default; Coefficient_traits::const_reference denominator() const; void m_swap(Artificial_Parameter&); bool operator==(const Artificial_Parameter&) const; bool operator!=(const Artificial_Parameter&) const; }; |
||
|
SW_SPEC
|
6 |
|
|
Parents:
|
|
Serialization shall retain numerator dimension, coefficients and the positive denominator. Loading shall preserve an admitted stored representation, including a common factor, without constructor normalization. Malformed or nonpositive denominators shall return false in both build modes. False shall not promise rollback or further queries; owned storage shall remain destructible. OK shall require a positive denominator. Human output shall display the expression and integer-division denominator and return its stream. External memory shall estimate expression storage; total shall add the artificial-parameter object's own size. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
An admitted serialized denominator must support a defined integer floor, while persistence need not canonicalize its representation. |
|
|
|
|
|
Check noncanonical positive round trips, replacement loads, zero/negative denominators, truncations, stream identity and byte relationships. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/ascii_dump_load1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipproblem2.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. void ascii_dump(std::ostream&) const; void ascii_dump() const; bool ascii_load(std::istream&); bool OK() const; void print() const; memory_size_type external_memory_in_bytes() const; memory_size_type total_memory_in_bytes() const; std::ostream& IO_Operators::operator<<( std::ostream&, const PIP_Tree_Node::Artificial_Parameter&); |
|
|
SW_SPEC
|
7 |
|
|
Parents:
|
|
Node dumping shall write local guards and artificial parameters; concrete solution and decision dumping shall additionally write their complete respective representation. Concrete loading shall replace the corresponding stored state, retain the receiver's live owner association and restore parent and owner links for loaded children. Reloading shall not append old artificial parameters. Recursive decision subtrees shall be supported on both branches. Malformed fields, nonpositive tableau denominators, incompatible vector/matrix sizes, out-of-range mappings and invalid decision structure shall return false in both build modes, before unsafe indexing or successful use of the broken representation. Surviving ownership shall remain destructible after false, without a rollback or further-query guarantee. A tree shall be interpreted only after association with a compatible live problem. Stream and resource exceptions may propagate. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Local formulas, tableau coordinates and ownership links must describe the same tree after replacement. |
|
|
|
|
|
Round-trip fresh and populated clones, including local artificial parameters and recursive false branches; reject mismatched vector extents, mapping indices, denominators, kinds, guards and truncations with sanitizers. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/ascii_dump_load1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipmalformedvalues1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. void PIP_Tree_Node::ascii_dump(std::ostream&) const; bool PIP_Tree_Node::ascii_load(std::istream&); void PIP_Solution_Node::ascii_dump(std::ostream&) const; bool PIP_Solution_Node::ascii_load(std::istream&); void PIP_Decision_Node::ascii_dump(std::ostream&) const; bool PIP_Decision_Node::ascii_load(std::istream&); |
|
|
SW_SPEC
|
8 |
|
|
|
A solution node shall return itself from as_solution and null from as_decision. On a complete solved leaf associated with a live problem, parametric_values(var) shall return a borrowed affine expression in original and in-scope artificial parameters describing that decision coordinate on the leaf's valid path context. Its coordinate shall be an original problem variable; a parameter coordinate or dimension-incompatible variable shall raise std::invalid_argument. Cached expressions may be materialized lazily. No tuple shall be inferred from the leaf when its guards fail. Returning a parametric-value reference shall require an lvalue solution node. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Coordinate formulas are meaningful only after interpreting artificial parameters and the guards that select the leaf. |
|
|
|
|
|
Evaluate every decision coordinate against bounded lexicographic enumeration, including interleaved parameters, lazy/repeated access and invalid variable requests. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/contextrefinement1.cc; tests/PIP_Problem/exceptions1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipproblem1.cc; tests/PIP_Problem/zerofaces1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. const PIP_Solution_Node* as_solution() const; const PIP_Decision_Node* as_decision() const; const Linear_Expression& parametric_values(Variable) const &; |
||
|
SW_SPEC
|
9 |
|
|
|
A decision node shall return itself from as_decision and null from as_solution. child_node(true) and child_node(false) shall expose the respective borrowed subtree, with null denoting an absent branch. A valid decision shall have a true child. A decision with a false child shall have exactly one local guard. The mutable accessor shall expose the same node as the const accessor; callers shall preserve the owner's structure, backlinks and coordinate meaning when mutating an independently owned tree. Borrowing a child pointer shall require an lvalue decision node. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
A false branch complements one predicate, whereas a missing false branch leaves the excluded context infeasible. |
|
|
|
|
|
Traverse nested true and false decisions, missing branches and guarded leaves, compare const/mutable access and verify parent/owner associations after reload. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/contextrefinement1.cc; tests/PIP_Problem/pipproblem1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. const PIP_Decision_Node* as_decision() const; const PIP_Solution_Node* as_solution() const; const PIP_Tree_Node* child_node(bool) const &; PIP_Tree_Node* child_node(bool) &; |
||
|
SW_SPEC
|
10 |
|
|
|
OK shall check local guard, tableau/vector and decision-structure invariants and recursively check owned children. Invalid mapping indices shall be rejected before indexing the corresponding vector. These checks shall not prove lexicographic optimality. Printing shall show the subtree's guards, artificial parameters and decision-coordinate formulas under its compatible live owner, with nonnegative indentation. Stream insertion shall return its stream. Memory estimates shall include local storage and owned descendants; total shall add the concrete object's own size. The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply. |
Structural diagnostics must not themselves dereference a malformed index, and tree accounting must include descendant ownership. |
|
|
|
|
|
Check leaf and deep-decision storage relationships, stream identity, every owner and safe rejection of malformed vector mappings. |
src/PIP_Tree.cc; src/PIP_Tree_defs.hh; src/PIP_Tree_inlines.hh; src/PIP_Tree_types.hh; tests/PIP_Problem/ascii_dump_load1.cc; tests/PIP_Problem/persistenceadmission1.cc; tests/PIP_Problem/pipproblem1.cc. |
|
|
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of PIP_Tree_Node or the concrete type named below. virtual bool OK() const = 0; void print(std::ostream&, int indent=0) const; virtual memory_size_type external_memory_in_bytes() const = 0; virtual memory_size_type total_memory_in_bytes() const = 0; std::ostream& IO_Operators::operator<<(std::ostream&, const PIP_Tree_Node&); |