Predicate linearAccess
Holds if expr
is equivalent to p*v + q
, where p
is a non-zero
number. This takes into account the associativity, commutativity and
distributivity of arithmetic operations.
Import path
import semmle.code.cpp.rangeanalysis.RangeAnalysisUtils
predicate linearAccess(Expr expr, VariableAccess v, float p, float q)