Lattice Land Core Library
|
Namespaces | |
namespace | local |
Classes | |
class | AbstractDeps |
class | ArithBound |
struct | AtomicExtraction |
class | AVar |
class | B |
class | CartesianProduct |
struct | DispatchIndex |
class | FlatUniverse |
class | GaussSeidelIteration |
struct | HashMapVarIndex |
class | IDiagnostics |
class | Interval |
struct | ListVarIndex |
class | NBitset |
struct | NonAtomicExtraction |
struct | PreFLB |
struct | PreFUB |
struct | PreSDec |
struct | PreSInc |
struct | PreZLB |
struct | PreZUB |
class | Simplifier |
struct | Sort |
class | TFormula |
class | VarEnv |
struct | Variable |
class | VStore |
Typedefs | |
template<class A > | |
using | abstract_ptr = battery::shared_ptr<A, typename A::allocator_type> |
template<class Allocator > | |
using | LVar = battery::string<Allocator> |
using | AType = int |
using | logic_bool = bool |
using | logic_int = long long int |
using | logic_real = battery::tuple<double, double> |
template<class F > | |
using | logic_set = battery::vector<battery::tuple<F, F>, typename F::allocator_type> |
template<class VT , class Mem > | |
using | ZLB = ArithBound<PreZLB<VT>, Mem> |
template<class VT , class Mem > | |
using | ZUB = ArithBound<PreZUB<VT>, Mem> |
template<class VT , class Mem > | |
using | FLB = ArithBound<PreFLB<VT>, Mem> |
template<class VT , class Mem > | |
using | FUB = ArithBound<PreFUB<VT>, Mem> |
template<class VT , class Mem > | |
using | ZFlat = FlatUniverse<PreZUB<VT>, Mem> |
template<class VT , class Mem > | |
using | FFlat = FlatUniverse<PreFUB<VT>, Mem> |
Enumerations | |
enum class | IKind { ASK , TELL } |
enum | Sig { NEG , ABS , ADD , SUB , MUL , POW , MIN , MAX , SQRT , EXP , LN , NROOT , LOG , SIN , COS , TAN , ASIN , ACOS , ATAN , SINH , COSH , TANH , ASINH , ACOSH , ATANH , DIV , MOD , TDIV , TMOD , FDIV , FMOD , CDIV , CMOD , EDIV , EMOD , UNION , INTERSECTION , DIFFERENCE , SYMMETRIC_DIFFERENCE , COMPLEMENT , SUBSET , SUBSETEQ , SUPSET , SUPSETEQ , IN , CARD , HULL , CONVEX , EQ , NEQ , LEQ , GEQ , LT , GT , AND , OR , IMPLY , EQUIV , NOT , XOR , ITE , MAXIMIZE , MINIMIZE } |
Functions | |
template<size_t i, class... As> | |
CUDA constexpr const CartesianProduct< As... >::template type_of< i > & | project (const CartesianProduct< As... > &cp) |
Similar to cp.template project<i>() , just to avoid the ".template" syntax. | |
template<size_t i, class... As> | |
CUDA constexpr CartesianProduct< As... >::template type_of< i > & | project (CartesianProduct< As... > &cp) |
template<class... As, class... Bs> | |
CUDA constexpr auto | fjoin (const CartesianProduct< As... > &a, const CartesianProduct< Bs... > &b) |
template<class... As, class... Bs> | |
CUDA constexpr auto | fmeet (const CartesianProduct< As... > &a, const CartesianProduct< Bs... > &b) |
template<class... As, class... Bs> | |
CUDA constexpr bool | operator< (const CartesianProduct< As... > &a, const CartesianProduct< Bs... > &b) |
template<class... As, class... Bs> | |
CUDA constexpr bool | operator> (const CartesianProduct< As... > &a, const CartesianProduct< Bs... > &b) |
template<class... As, class... Bs> | |
CUDA constexpr bool | operator== (const CartesianProduct< As... > &a, const CartesianProduct< Bs... > &b) |
template<class A , class... As> | |
std::ostream & | operator<< (std::ostream &s, const CartesianProduct< A, As... > &cp) |
template<class L , IKind kind, bool diagnose = false, class F > | |
CUDA bool | ginterpret_true (const F &f, IDiagnostics &diagnostics) |
template<IKind kind, bool diagnose = false, class A , class F , class Env , class I > | |
CUDA bool | ginterpret_in (const A &a, const F &f, Env &env, I &intermediate, IDiagnostics &diagnostics) |
template<IKind kind, bool diagnose = false, class F , class Env , class U > | |
CUDA bool | ginterpret_in (const F &f, const Env &env, U &value, IDiagnostics &diagnostics) |
template<IKind kind, bool diagnose = false, class A , class F , class Env , class I > | |
CUDA bool | top_level_ginterpret_in (const A &a, const F &f, Env &env, I &intermediate, IDiagnostics &diagnostics) |
template<class A , class Alloc = battery::standard_allocator, class Env > | |
CUDA A | make_top (Env &env, Alloc alloc=Alloc{}) |
template<bool diagnose = false, class TellAlloc = battery::standard_allocator, class F , class Env , class L > | |
CUDA bool | interpret_and_tell (const F &f, Env &env, L &value, IDiagnostics &diagnostics, TellAlloc tell_alloc=TellAlloc{}) |
template<class A , bool diagnose = false, class F , class Env , class TellAlloc = typename A::allocator_type> | |
CUDA std::optional< A > | create_and_interpret_and_tell (const F &f, Env &env, IDiagnostics &diagnostics, typename A::allocator_type alloc=typename A::allocator_type{}, TellAlloc tell_alloc=TellAlloc{}) |
template<class L , class K > | |
CUDA constexpr auto | meet (const Interval< L > &, const Interval< K > &) |
template<class L , class K > | |
CUDA constexpr auto | fjoin (const Interval< L > &a, const Interval< K > &b) |
template<class L , class K > | |
CUDA constexpr auto | fmeet (const Interval< L > &a, const Interval< K > &b) |
template<class L , class K > | |
CUDA constexpr bool | operator< (const Interval< L > &a, const Interval< K > &b) |
template<class L , class K > | |
CUDA constexpr bool | operator> (const Interval< L > &a, const Interval< K > &b) |
template<class L , class K > | |
CUDA constexpr bool | operator== (const Interval< L > &a, const Interval< K > &b) |
template<class L > | |
std::ostream & | operator<< (std::ostream &s, const Interval< L > &itv) |
template<class Allocator , class ExtendedSig > | |
CUDA NI bool | is_v_op_constant (const TFormula< Allocator, ExtendedSig > &f, Sig sig) |
template<class Allocator , class ExtendedSig > | |
CUDA NI bool | is_v_op_z (const TFormula< Allocator, ExtendedSig > &f, Sig sig) |
template<class Allocator , class ExtendedSig > | |
CUDA NI bool | is_var_equality (const TFormula< Allocator, ExtendedSig > &f) |
template<class Allocator > | |
CUDA NI TFormula< Allocator > | make_v_op_z (LVar< Allocator > v, Sig sig, logic_int z, AType aty=UNTYPED, const Allocator &allocator=Allocator()) |
template<class Allocator > | |
CUDA NI TFormula< Allocator > | make_v_op_z (AVar v, Sig sig, logic_int z, AType aty=UNTYPED, const Allocator &allocator=Allocator()) |
template<class Allocator > | |
CUDA Sig | geq_of_constant (const TFormula< Allocator > &f) |
template<class Allocator > | |
CUDA Sig | leq_of_constant (const TFormula< Allocator > &f) |
template<typename Allocator , typename ExtendedSig > | |
CUDA const TFormula< Allocator, ExtendedSig > & | var_in (const TFormula< Allocator, ExtendedSig > &f) |
template<class F > | |
CUDA NI int | num_vars (const F &f) |
template<class F > | |
CUDA int | num_quantified_vars (const F &f) |
template<class F > | |
CUDA int | num_quantified_vars (const F &f, AType aty) |
template<class F > | |
CUDA NI AType | type_of_conjunction (const typename F::Sequence &seq) |
template<class F > | |
CUDA NI battery::tuple< F, F > | extract_ty (const F &f, AType ty) |
template<class F > | |
CUDA NI std::optional< F > | negate (const F &f) |
template<class F > | |
CUDA NI std::optional< F > | de_morgan_law (Sig sig_neg, const F &f) |
template<class F > | |
CUDA NI std::optional< F > | negate_eq (const F &f) |
CUDA Sig | negate_arithmetic_comparison (Sig sig) |
template<class F > | |
CUDA NI bool | is_arithmetic_comparison (const F &f) |
template<class F > | |
CUDA NI bool | is_set_comparison (const F &f) |
template<class F > | |
CUDA NI bool | is_comparison (const F &f) |
CUDA NI Sig | converse_comparison (Sig sig) |
template<class F , class Env > | |
CUDA NI void | map_avar_to_lvar (F &f, const Env &env, bool erase_type=false) |
template<class F > | |
CUDA NI F | eval (const F &f) |
CUDA NI const char * | string_of_sig (Sig sig) |
CUDA NI constexpr bool | is_prefix (Sig sig) |
CUDA NI constexpr bool | is_division (Sig sig) |
CUDA NI constexpr bool | is_modulo (Sig sig) |
CUDA NI constexpr bool | is_associative (Sig sig) |
template<typename Allocator , typename ExtendedSig > | |
CUDA bool | operator== (const TFormula< Allocator, ExtendedSig > &lhs, const TFormula< Allocator, ExtendedSig > &rhs) |
template<class F , class Env > | |
CUDA NI std::optional< std::reference_wrapper< const typename Env::variable_type > > | var_in (const F &f, const Env &env) |
template<class Alloc1 , class Alloc2 > | |
CUDA NI bool | operator== (const Sort< Alloc1 > &lhs, const Sort< Alloc2 > &rhs) |
template<class A , class R = A> | |
R | project_fun (Sig fun, const A &a, const A &b) |
template<class A , class R = A> | |
R | project_fun (Sig fun, const A &a) |
template<class LDual , class L > | |
CUDA constexpr LDual | dual (const L &x) |
template<class Pre , class M1 , class M2 > | |
CUDA constexpr ArithBound< Pre, battery::local_memory > | fjoin (const ArithBound< Pre, M1 > &a, const ArithBound< Pre, M2 > &b) |
template<class Pre , class M1 , class M2 > | |
CUDA constexpr ArithBound< Pre, battery::local_memory > | fmeet (const ArithBound< Pre, M1 > &a, const ArithBound< Pre, M2 > &b) |
template<class Pre , class M1 , class M2 > | |
CUDA constexpr bool | operator< (const ArithBound< Pre, M1 > &a, const ArithBound< Pre, M2 > &b) |
template<class Pre , class M1 , class M2 > | |
CUDA constexpr bool | operator> (const ArithBound< Pre, M1 > &a, const ArithBound< Pre, M2 > &b) |
template<class Pre , class M1 , class M2 > | |
CUDA constexpr bool | operator== (const ArithBound< Pre, M1 > &a, const ArithBound< Pre, M2 > &b) |
template<class Pre , class M > | |
std::ostream & | operator<< (std::ostream &s, const ArithBound< Pre, M > &a) |
template<class Pre > | |
CUDA constexpr FlatUniverse< Pre, battery::local_memory > | fjoin (const FlatUniverse< Pre, battery::local_memory > &a, const FlatUniverse< Pre, battery::local_memory > &b) |
template<class Pre > | |
CUDA constexpr FlatUniverse< Pre, battery::local_memory > | fmeet (const FlatUniverse< Pre, battery::local_memory > &a, const FlatUniverse< Pre, battery::local_memory > &b) |
template<class Pre , class M1 , class M2 > | |
CUDA constexpr bool | operator< (const FlatUniverse< Pre, M1 > &a, const FlatUniverse< Pre, M2 > &b) |
template<class Pre , class M1 , class M2 > | |
CUDA constexpr bool | operator> (const FlatUniverse< Pre, M1 > &a, const FlatUniverse< Pre, M2 > &b) |
template<class Pre , class M1 , class M2 > | |
CUDA constexpr bool | operator== (const FlatUniverse< Pre, M1 > &a, const FlatUniverse< Pre, M2 > &b) |
template<class Pre , class M > | |
std::ostream & | operator<< (std::ostream &s, const FlatUniverse< Pre, M > &a) |
template<size_t N, class M1 , class M2 , class T > | |
CUDA constexpr NBitset< N, battery::local_memory, T > | fjoin (const NBitset< N, M1, T > &a, const NBitset< N, M2, T > &b) |
template<size_t N, class M1 , class M2 , class T > | |
CUDA constexpr NBitset< N, battery::local_memory, T > | fmeet (const NBitset< N, M1, T > &a, const NBitset< N, M2, T > &b) |
template<size_t N, class M1 , class M2 , class T > | |
CUDA constexpr bool | operator< (const NBitset< N, M1, T > &a, const NBitset< N, M2, T > &b) |
template<size_t N, class M1 , class M2 , class T > | |
CUDA constexpr bool | operator> (const NBitset< N, M1, T > &a, const NBitset< N, M2, T > &b) |
template<size_t N, class M1 , class M2 , class T > | |
CUDA constexpr bool | operator== (const NBitset< N, M1, T > &a, const NBitset< N, M2, T > &b) |
template<size_t N, class M , class T > | |
std::ostream & | operator<< (std::ostream &s, const NBitset< N, M, T > &a) |
template<class L , class K , class Alloc > | |
CUDA auto | fmeet (const VStore< L, Alloc > &a, const VStore< K, Alloc > &b) |
template<class L , class K , class Alloc > | |
CUDA auto | fjoin (const VStore< L, Alloc > &a, const VStore< K, Alloc > &b) |
template<class L , class K , class Alloc1 , class Alloc2 > | |
CUDA bool | operator< (const VStore< L, Alloc1 > &a, const VStore< K, Alloc2 > &b) |
template<class L , class K , class Alloc1 , class Alloc2 > | |
CUDA bool | operator> (const VStore< L, Alloc1 > &a, const VStore< K, Alloc2 > &b) |
template<class L , class K , class Alloc1 , class Alloc2 > | |
CUDA bool | operator== (const VStore< L, Alloc1 > &a, const VStore< K, Alloc2 > &b) |
template<class L , class Alloc > | |
std::ostream & | operator<< (std::ostream &s, const VStore< L, Alloc > &vstore) |
This file provides an extended interface to interpret formulas in abstract domains and abstract universes. It also provides a unified interface for tell and ask interpretation using a template parameter IKind
.
A pre-abstract universe is a lattice (with usual operations join, order, ...) equipped with a simple logical interpretation function and a next/prev functions. We consider totally ordered pre-abstract universes with a downset semantics. For any lattice \( L \), we consider an element \( a \in L \) to represent all the concrete elements equal to or below it. This set is called the downset of \( a \) and is denoted \( \mathord{\downarrow}{a} \). The concretization function \( \gamma \) formalizes this idea: \( \gamma(a) = \{x \mapsto b \;|\; b \in \mathord{\downarrow}{a} \cap U \} \) where \( U \) is the universe of discourse. The intersection with \( U \) is necessary to remove potential elements in the abstract universe that are not in the concrete universe of discourse (e.g., \( -\infty, \infty \) below).
The downset semantics associates each element of a lattice to its concrete downset. It is possible to decide that each element is associated to the concrete upset instead. Doing so will reverse our usage of the lattice-theoretic operations (join instead of meet, <= instead of >=, etc.). Instead of considering the upset semantics, it is more convenient to consider the downset semantics of the dual lattice.
Example: The lattice of increasing integer \( \mathit{ZUB} = \langle \{-\infty, \ldots, -2, -1, 0, 1, 2, \ldots, \infty\}, \leq \rangle \) is ordered by the natural arithmetic comparison operator, it represents an upper bound on the set of integers represented. Using the downset semantics, we can represent simple constraints such as \( x \leq 3 \), in which case the downset \( \mathord{\downarrow}{3} = \{\ldots, 1, 2, 3\} \) represents all the values of \( x \) satisfying the constraints \( x \leq 3 \), that is, the solutions of the constraints. By taking the upset semantics of \( \mathit{ZUB} \), we can represent constraints such as \( x \geq 3 \). Alternatively, we can take the dual lattice of decreasing integers \( \mathit{ZLB} = \langle \{\infty, \ldots, 2, 1, 0, -1, -2, \ldots, -\infty\}, \geq \rangle \). The downset semantics of \( \mathit{ZLB} \) corresponds to the upset semantics of \( \mathit{ZUB} \).
From a pre-abstract universe, we obtain an abstract universe using the Universe
class below. We also define various aliases to abstract universes such as ZLB
, ZUB
, etc.
using lala::abstract_ptr = battery::shared_ptr<A, typename A::allocator_type> |
using lala::LVar = battery::string<Allocator> |
A "logical variable" is just the name of the variable.
using lala::AType = int |
Each abstract domain is uniquely identified by an UID. We call it an abstract type. Each formula (and recursively, its subformulas) is assigned to an abstract type indicating in what abstract domain this formula should be interpreted.
using lala::logic_bool = bool |
The type of Boolean used in logic formulas.
using lala::logic_int = long long int |
The type of integers used in logic formulas. Integers are represented by the set \( \{-\infty, \infty\} \cup Z (\text{ with} Z \subset \mathbb{Z}) \). The minimal and maximal values of logic_int
represents \( -\infty \) and \( \infty \) respectively.
using lala::logic_real = battery::tuple<double, double> |
The type of real numbers used in logic formulas. Real numbers are approximated by the set \( \mathbb{F} \times \mathbb{F} \). When a real number \( r \in \mathbb{R} \) is also a floating-point number, then it is represented by \( (r, r) \), otherwise it is represented by \( (\lfloor r \rfloor, \lceil r \rceil) \) such that \( \lfloor r \rfloor < r < \lceil r \rceil \) and there is no floating-point number \( f \) such that \( \lfloor r \rfloor < f < \lceil r \rceil \).
using lala::logic_set = battery::vector<battery::tuple<F, F>, typename F::allocator_type> |
A set is parametric in a universe of discourse. For instance, logic_set<F>
, with F representing an integer constant, is a set of integers. Sets are defined in extension: we explicitly list the values belonging to the set. To avoid using too much memory with large sets, we use an interval representation, e.g., \( \{1..3, 5..5, 10..12\} = \{1, 2, 3, 5, 10, 11, 12\} \). When sets occur in intervals, they are ordered by set inclusion, e.g., \( \{\{1..2\}..\{1..4\}\} = \{\{1,2\}, \{1,2,3\}, \{1,2,4\}, \{1,2,3,4\}\} \).
using lala::ZLB = ArithBound<PreZLB<VT>, Mem> |
Lattice of integer lower bounds.
using lala::ZUB = ArithBound<PreZUB<VT>, Mem> |
Lattice of integer upper bounds.
using lala::FLB = ArithBound<PreFLB<VT>, Mem> |
Lattice of floating-point lower bounds.
using lala::FUB = ArithBound<PreFUB<VT>, Mem> |
Lattice of floating-point upper bounds.
using lala::ZFlat = FlatUniverse<PreZUB<VT>, Mem> |
Lattice of flat integers.
using lala::FFlat = FlatUniverse<PreFUB<VT>, Mem> |
Lattice of flat floating-point numbers.
|
strong |
enum lala::Sig |
A first-order signature is a triple \( (X, F, P) \) where \( X \) is the set of variables, \( F \) the set of function symbols and \( P \) the set of predicates. We represent \( X \) by strings (see LVar
), while \( F \) and \( P \) are described in the following enumeration Sig
. For programming conveniency, we suppose that logical connectors are included in the set of predicates and thus are in the signature as well. Finally, function symbols and predicates are at the "same level". Hence a predicate can occur as the argument of a function, which is convenient when modelling, consider for example a cardinality constraint: \( ((x > 4) + (y < 4) + (z = 3)) \neq 2 \).
Symbols are sometimes overloaded across different universe of discourse. For instance, ADD
can be used over integers, reals and even set of integers (pairwise addition).
Division and modulus are defined as usual over continuous domains such as rational and real numbers. However, it gets more tricky when defined over discrete domains such as integers and floating-point numbers, since there is not a single definition of division and modulus. The various kinds of discrete divisions are explained in (Leijend D. (2003). Division and Modulus for Computer Scientists), and we add four of those definitions to the logical signature. There are several use-cases of modulus and division: If you write a constraint model, you probably want to use euclidean division and modulus (EDIV, EMOD) as this is the most "mathematical" definition. If you intend to model the semantics of a programming language, you should use the same kind of division as the one present in your programming language (most likely truncated division).
|
constexpr |
Similar to cp.template project<i>()
, just to avoid the ".template" syntax.
|
constexpr |
|
constexpr |
\( (a_1, \ldots, a_n) \sqcup (b_1, \ldots, b_n) = (a_1 \sqcup_1 b_1, \ldots, a_n \sqcup_n b_n) \)
|
constexpr |
\( (a_1, \ldots, a_n) \sqcap (b_1, \ldots, b_n) = (a_1 \sqcap_1 b_1, \ldots, a_n \sqcap_n b_n) \)
|
constexpr |
|
constexpr |
|
constexpr |
std::ostream & lala::operator<< | ( | std::ostream & | s, |
const CartesianProduct< A, As... > & | cp ) |
CUDA bool lala::ginterpret_true | ( | const F & | f, |
IDiagnostics & | diagnostics ) |
Interpret true
in the lattice L
.
true
if L
preserves the top element w.r.t. the concrete domain or if true
is interpreted by under-approximation (kind == ASK). CUDA bool lala::ginterpret_in | ( | const A & | a, |
const F & | f, | ||
Env & | env, | ||
I & | intermediate, | ||
IDiagnostics & | diagnostics ) |
This function provides an extended and unified interface to ask and tell interpretation of formula in abstract domains. It provides default interpretation for common formulas such as true
, false
and conjunction of formulas whenever A
satisfies some lattice-theoretic conditions.
CUDA bool lala::ginterpret_in | ( | const F & | f, |
const Env & | env, | ||
U & | value, | ||
IDiagnostics & | diagnostics ) |
This function provides an extended and unified interface to ask and tell interpretation of formula in abstract universes. It provides default interpretation for common formulas such as true
, false
, conjunction and disjunction of formulas whenever U
satisfies some lattice-theoretic conditions.
CUDA bool lala::top_level_ginterpret_in | ( | const A & | a, |
const F & | f, | ||
Env & | env, | ||
I & | intermediate, | ||
IDiagnostics & | diagnostics ) |
Top-level version of ginterpret_in
, we restore env
and intermediate
in case of failure.
CUDA A lala::make_top | ( | Env & | env, |
Alloc | alloc = Alloc{} ) |
CUDA bool lala::interpret_and_tell | ( | const F & | f, |
Env & | env, | ||
L & | value, | ||
IDiagnostics & | diagnostics, | ||
TellAlloc | tell_alloc = TellAlloc{} ) |
CUDA std::optional< A > lala::create_and_interpret_and_tell | ( | const F & | f, |
Env & | env, | ||
IDiagnostics & | diagnostics, | ||
typename A::allocator_type | alloc = typename A::allocator_type{}, | ||
TellAlloc | tell_alloc = TellAlloc{} ) |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
std::ostream & lala::operator<< | ( | std::ostream & | s, |
const Interval< L > & | itv ) |
CUDA NI bool lala::is_v_op_constant | ( | const TFormula< Allocator, ExtendedSig > & | f, |
Sig | sig ) |
true
if the formula f
has the shape variable <sig> constant
. CUDA NI bool lala::is_v_op_z | ( | const TFormula< Allocator, ExtendedSig > & | f, |
Sig | sig ) |
true
if the formula f
has the shape variable op integer constant
, e.g., x < 4
. CUDA NI bool lala::is_var_equality | ( | const TFormula< Allocator, ExtendedSig > & | f | ) |
true
if the formula f
has the shape variable = variable
or variable <=> variable
. CUDA NI TFormula< Allocator > lala::make_v_op_z | ( | LVar< Allocator > | v, |
Sig | sig, | ||
logic_int | z, | ||
AType | aty = UNTYPED, | ||
const Allocator & | allocator = Allocator() ) |
CUDA NI TFormula< Allocator > lala::make_v_op_z | ( | AVar | v, |
Sig | sig, | ||
logic_int | z, | ||
AType | aty = UNTYPED, | ||
const Allocator & | allocator = Allocator() ) |
CUDA const TFormula< Allocator, ExtendedSig > & lala::var_in | ( | const TFormula< Allocator, ExtendedSig > & | f | ) |
CUDA NI int lala::num_vars | ( | const F & | f | ) |
F
including existential quantifier, logical variables and abstract variables. Each occurrence of a variable is added up (duplicates are counted). CUDA int lala::num_quantified_vars | ( | const F & | f | ) |
CUDA int lala::num_quantified_vars | ( | const F & | f, |
AType | aty ) |
aty
. CUDA NI AType lala::type_of_conjunction | ( | const typename F::Sequence & | seq | ) |
CUDA NI battery::tuple< F, F > lala::extract_ty | ( | const F & | f, |
AType | ty ) |
Given a conjunctive formula f
of the form \( c_1 \land ... \land c_n \), it returns a pair \( \langle c_i \land .. \land c_j, c_k \land ... \land c_l \rangle \) such that the first component contains all formulas with the type ty
, and the second component, all other formulas.
CUDA NI std::optional< F > lala::negate | ( | const F & | f | ) |
CUDA NI std::optional< F > lala::de_morgan_law | ( | Sig | sig_neg, |
const F & | f ) |
not(f1 \/ ... \/ fn) --> not(f1) /\ ... /\ not(fn) not(f1 /\ ... /\ fn) --> not(f1) \/ ... \/ not(fn)
CUDA NI std::optional< F > lala::negate_eq | ( | const F & | f | ) |
CUDA NI bool lala::is_arithmetic_comparison | ( | const F & | f | ) |
True for the operators <=, <, >, >=, =, !=
CUDA NI bool lala::is_set_comparison | ( | const F & | f | ) |
True for the operators =, !=, subset, subseteq, supset, supseteq
CUDA NI bool lala::is_comparison | ( | const F & | f | ) |
True for the operators <=, <, >, >=, =, !=, subset, subseteq, supset, supseteq
Returns the converse of a comparison operator (see is_comparison
).
CUDA NI void lala::map_avar_to_lvar | ( | F & | f, |
const Env & | env, | ||
bool | erase_type = false ) |
Given a formula f
, we transform all occurrences of AVar
into logical variables.
CUDA NI F lala::eval | ( | const F & | f | ) |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
CUDA bool lala::operator== | ( | const TFormula< Allocator, ExtendedSig > & | lhs, |
const TFormula< Allocator, ExtendedSig > & | rhs ) |
CUDA NI std::optional< std::reference_wrapper< const typename Env::variable_type > > lala::var_in | ( | const F & | f, |
const Env & | env ) |
Given a formula f
and an environment, return the first variable occurring in f
or {}
if f
has no variable in env
.
|
inline |
R lala::project_fun | ( | Sig | fun, |
const A & | a, | ||
const A & | b ) |
R lala::project_fun | ( | Sig | fun, |
const A & | a ) |
|
constexpr |
This function is useful when we need to convert a value to its dual. The dual is the upset of the current element, therefore, if we have \( x <= 10 \), the dual is given by the formula \( x >= 10 \) interpreted in the dual lattice. In that case, it just changes the type of the lattice without changing the value. A difference occurs on the bottom and top element. Indeed, by our representation of bot and top, the bottom value in a lattice L equals the top value in its dual, but we need them to remain the same, so the dual of L::bot()
is LDual::bot()
.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
std::ostream & lala::operator<< | ( | std::ostream & | s, |
const ArithBound< Pre, M > & | a ) |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
std::ostream & lala::operator<< | ( | std::ostream & | s, |
const FlatUniverse< Pre, M > & | a ) |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
std::ostream & lala::operator<< | ( | std::ostream & | s, |
const NBitset< N, M, T > & | a ) |
CUDA auto lala::fmeet | ( | const VStore< L, Alloc > & | a, |
const VStore< K, Alloc > & | b ) |
CUDA auto lala::fjoin | ( | const VStore< L, Alloc > & | a, |
const VStore< K, Alloc > & | b ) |
CUDA bool lala::operator< | ( | const VStore< L, Alloc1 > & | a, |
const VStore< K, Alloc2 > & | b ) |
CUDA bool lala::operator> | ( | const VStore< L, Alloc1 > & | a, |
const VStore< K, Alloc2 > & | b ) |
CUDA bool lala::operator== | ( | const VStore< L, Alloc1 > & | a, |
const VStore< K, Alloc2 > & | b ) |
std::ostream & lala::operator<< | ( | std::ostream & | s, |
const VStore< L, Alloc > & | vstore ) |