package mopsa
Install
Dune Dependency
Authors
Maintainers
Sources
md5=fdee20e988343751de440b4f6b67c0f4
sha512=f5cbf1328785d3f5ce40155dada2d95e5de5cce4f084ea30cfb04d1ab10cc9403a26cfb3fa55d0f9da72244482130fdb89c286a9aed0d640bba46b7c00e09500
doc/congUtils/CongUtils/IntCong/index.html
Module CongUtils.IntCong
Source
IntCong - Integer congruences.
We rely on Zarith for arithmetic operations.
Types
offset
The type of possibly empty congruence sets.
module I = ItvUtils.IntItv
module B = ItvUtils.IntBound
Arithmetic utilities
Greatest common divisor of |a| and |b|. 0 is neutral.
Returns the gcd, lcm and cofactors u, v such that ua+vb=gcd. Undefined if a or b is 0.
Wheter b is a multiple of a. Always true if b = 0.
As Z.erem, but rem_zero a 0 = a.
Constructors
Congruence overapproximating an interval.
Predicates
A total ordering (lexical ordering) returning -1, 0, or 1. Can be used as compare for sets, maps, etc.
Total ordering on possibly empty congruences.
Whether the congruence is included in the range lo,up
.
Printing
Set operations
Abstract intersection.
Abstract intersection with lo,up
.
Positive and negative part.
Intersects with
.
Keeps only non-zero elements.
Forward operations
Division (with truncation).
Remainder. Uses the C semantics for remainder (%).
Conversion from integer to boolean in 0,1
: maps 0 to 0 (false) and non-zero to 1 (true). 0;1
is over-approximated as ℤ.
Logical negation. Logical operation use the C semantics: they accept 0 and non-0 respectively as false and true, but they always return 0 and 1 respectively for false and true. 0;1
is over-approximated as ℤ.
C comparison tests. Returns an interval included in 0,1
(a boolean)
C comparison tests. Returns a boolean if the test may succeed
Bitshift left: multiplication by a power of 2.
Bitshift right: division by a power of 2 rounding towards -∞.
Unsigned bitshift right: division by a power of 2 with truncation.
Filters
Given two interval aruments, return the arguments assuming that the predicate holds.
Backward operations
Given one or two interval argument(s) and a result interval, return the argument(s) assuming the result in the operation is in the given result.
Backward join: both arguments and intersected with the result.