C++: Include the actual number of lower/upper bounds for added context in expected files

This commit is contained in:
Simon Friis Vindum
2026-02-16 13:51:08 +01:00
parent da527ffc19
commit 032c7ea034
3 changed files with 5256 additions and 5234 deletions

View File

@@ -2180,6 +2180,16 @@ module SimpleRangeAnalysisInternal {
/** Gets the estimate of the number of bounds for `e`. */
float estimateNrOfBounds(Expr e) { result = BoundsEstimate::nrOfBoundsExpr(e) }
/** Counts the numbers of lower bounds that are computed internally for `e`. */
float countNrOfLowerBounds(Expr e) {
result = strictcount(float lb | lb = getLowerBoundsImpl(e) | lb)
}
/** Counts the numbers of upper bounds that are computed internally for `e`. */
float countNrOfUpperBounds(Expr e) {
result = strictcount(float ub | ub = getUpperBoundsImpl(e) | ub)
}
}
/** Provides predicates for debugging the simple range analysis library. */
@@ -2208,7 +2218,7 @@ private module Debug {
*/
predicate countGetLowerBoundsImpl(Expr e, int n) {
e = getRelevantLocatable() and
n = strictcount(float lb | lb = getLowerBoundsImpl(e) | lb)
n = SimpleRangeAnalysisInternal::countNrOfLowerBounds(e)
}
float debugNrOfBounds(Expr e) {