CodeQL library for Java/Kotlin
codeql/java-all 0.9.1 (changelog, source)
Search

Module SignAnalysisCommon

Provides sign analysis to determine whether expression are always positive or negative.

The analysis is implemented as an abstract interpretation over the three-valued domain {negative, zero, positive}.

Import path

import semmle.code.java.dataflow.internal.rangeanalysis.SignAnalysisCommon

Predicates

anySign

Dummy predicate that holds for any sign. This is added to improve readability of cases where the sign is unrestricted.

exprSign

Gets a possible sign for e.

negative

Holds if e can be negative and cannot be positive.

positive

Holds if e can be positive and cannot be negative.

strictlyNegative

Holds if e is strictly negative.

strictlyPositive

Holds if e is strictly positive.