Lattice Land Core Library
|
#include <pre_zinc.hpp>
Public Types | |
using | this_type = PreZInc<VT> |
using | dual_type = PreZDec<VT> |
using | value_type = VT |
using | increasing_type = this_type |
Static Public Member Functions | |
CUDA static constexpr value_type | zero () |
CUDA static constexpr value_type | one () |
template<bool diagnose, class F > | |
static CUDA bool | interpret_tell (const F &f, value_type &tell, IDiagnostics &diagnostics) |
template<bool diagnose, class F > | |
static CUDA bool | interpret_ask (const F &f, value_type &ask, IDiagnostics &diagnostics) |
template<bool diagnose, class F > | |
CUDA static NI bool | interpret_type (const F &f, value_type &k, IDiagnostics &diagnostics) |
template<class F > | |
static CUDA F | deinterpret (const value_type &v) |
static CUDA constexpr Sig | sig_order () |
static CUDA constexpr Sig | sig_strict_order () |
static CUDA constexpr value_type | bot () |
static CUDA constexpr value_type | top () |
static CUDA constexpr value_type | join (value_type x, value_type y) |
static CUDA constexpr value_type | meet (value_type x, value_type y) |
static CUDA constexpr bool | order (value_type x, value_type y) |
static CUDA constexpr bool | strict_order (value_type x, value_type y) |
static CUDA constexpr value_type | next (value_type x) |
static CUDA constexpr value_type | prev (value_type x) |
CUDA static NI constexpr bool | is_supported_fun (Sig sig) |
template<Sig sig> | |
static CUDA constexpr value_type | fun (value_type x) |
template<Sig sig> | |
CUDA static NI constexpr value_type | fun (value_type x, value_type y) |
Static Public Attributes | |
static constexpr const bool | is_totally_ordered = true |
static constexpr const bool | preserve_bot = true |
static constexpr const bool | preserve_top = true |
static constexpr const bool | preserve_join = true |
static constexpr const bool | preserve_meet = true |
static constexpr const bool | injective_concretization = true |
static constexpr const bool | preserve_concrete_covers = true |
static constexpr const bool | complemented = false |
static constexpr const bool | increasing = true |
static constexpr const char * | name = "ZInc" |
static constexpr const bool | is_arithmetic = true |
PreZInc
is a pre-abstract universe \( \langle \{-\infty, \ldots, -2, -1, 0, 1, 2, \ldots, \infty\}, \leq \rangle \) totally ordered by the natural arithmetic comparison operator. It is used to represent constraints of the form \( x \geq k \) where \( k \) is an integer.
using lala::PreZInc< VT >::this_type = PreZInc<VT> |
using lala::PreZInc< VT >::dual_type = PreZDec<VT> |
using lala::PreZInc< VT >::value_type = VT |
using lala::PreZInc< VT >::increasing_type = this_type |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestatic |
Interpret a constant in the lattice of increasing integers according to the upset semantics (see universe.hpp for explanation). Overflows are not verified (issue #1). Interpretations: Formulas of kind F::Z
are interpreted exactly: \( [\![ x:\mathbb{Z} \geq k:\mathbb{Z} ]\!] = k \). Formulas of kind F::R
are over-approximated: \( [\![ x:\mathbb{Z} \geq [l..u]:\mathbb{R} ]\!] = \lceil l \rceil \). Note that all elements in \( [l..\lceil l \rceil[\) do not belong to \( \mathbb{Z} \), so they can be safely ignored. Examples: \( [\![x >= [2.5..2.5]:R ]\!] = 3 \). \( [\![x >= [2.9..3.1]:R ]\!] = 3 \).
|
inlinestatic |
Similar to interpret_tell
but the formula is under-approximated, in particular: \( [\![ x:\mathbb{Z} \geq [l..u]:\mathbb{R} ]\!] = \lceil u \rceil \).
|
inlinestatic |
Verify if the type of a variable, introduced by an existential quantifier, is compatible with the current abstract universe. Variables of type Int
are interpreted exactly ( \( \mathbb{Z} = \gamma(\bot) \)). Note that we assume there is no overflow, that might be taken into account the future.
|
inlinestatic |
|
inlinestaticconstexpr |
The logical predicate symbol corresponding to the order of this pre-universe. We have \( a \leq_\mathit{ZInc} b \Leftrightarrow a \leq b \).
LEQ
.
|
inlinestaticconstexpr |
The logical predicate symbol corresponding to the strict order of this pre-universe. We have \( a <_\mathit{ZInc} b \Leftrightarrow a < b \).
LT
.
|
inlinestaticconstexpr |
\( \bot \) is represented by the minimal representable value of the underlying value type.
|
inlinestaticconstexpr |
\( \top \) is represented by the maximal representable value of the underlying value type.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
From a lattice perspective, next: ZInc -> ZInc
returns an element next(x)
such that x
is covered by next(x)
.
x | The element covering the returned element. |
x
in the discrete increasing chain bot, ..., -2, -1, 0, 1, ..., top
. bot
is bot
and the next value of top
is top
.
|
inlinestaticconstexpr |
From a lattice perspective, prev: ZInc -> ZInc
returns an element prev(x)
such that x
covers prev(x)
.
x | The element covered by the returned element. |
x
in the discrete increasing chain bot, ..., -2, -1, 0, 1, ..., top
. bot
is bot
and the previous value of top
is top
.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
fun: value_type -> ZInc
is an abstract function on ZInc
over-approximating the function denoted by sig
on the concrete domain.
sig | The signature of the function to over-approximate, can be either NEG or ABS . |
x | The argument of the function, which is a constant value in the underlying universe of discourse. |
|
inlinestaticconstexpr |
fun: value_type X value_type -> ZInc
is similar to its unary version but with an arity of 2.
|
staticconstexpr |
|
staticconstexpr |
true
if \( \gamma(\bot) = \bot^\flat \).
|
staticconstexpr |
true
if \( \gamma(\top) = \top^\flat \).
|
staticconstexpr |
true
if \( \gamma(a \sqcup b) = \gamma(a) \cap \gamma(b) \) .
|
staticconstexpr |
true
if \( \gamma(a \sqcap b) = \gamma(a) \cup \gamma(b) \) .
|
staticconstexpr |
The concretization is injective when each abstract element maps to a distinct concrete element. This is important for the correctness of prev
and next
because we suppose \( \gamma(x) != \gamma(\mathit{next}(x)) \) when \( x \neq \bot \land x \neq \top \).
|
staticconstexpr |
true
if concrete covers are preserved by the concretization function, i.e., \( \gamma(\mathit{next}(x)) \) is a cover of \( \gamma(x) \), and dually for \( \mathit{prev}(x) \).
preserve_concrete_covers
implies injective_concretization
.
|
staticconstexpr |
true
if for all element \( x \in A \), there exists a unique element \( \lnot x \in A \) such that \( x \sqcup \lnot x = \top \) and \( x \sqcap \lnot x = \bot \).
|
staticconstexpr |
true
if the natural order of the universe of discourse coincides with the lattice order of this pre-universe, false
if it is reversed.
|
staticconstexpr |
|
staticconstexpr |