Lattice Land Core Library
Loading...
Searching...
No Matches
lala::NBitset< N, Mem, T > Class Template Reference

#include <nbitset.hpp>

Public Types

using memory_type = Mem
 
using bitset_type = battery::bitset<N, Mem, T>
 
using this_type = NBitset<N, Mem, T>
 
template<class M >
using this_type2 = NBitset<N, M, T>
 
using local_type = this_type2<battery::local_memory>
 
using LB = local::ZInc
 
using UB = local::ZDec
 
using value_type = typename LB::value_type
 

Public Member Functions

CUDA constexpr NBitset ()
 
CUDA constexpr NBitset (const this_type &other)
 
constexpr NBitset (this_type &&)=default
 
CUDA constexpr NBitset (value_type x)
 
CUDA constexpr NBitset (value_type lb, value_type ub)
 
template<class M >
CUDA constexpr NBitset (const this_type2< M > &other)
 
template<class M >
CUDA constexpr NBitset (this_type2< M > &&other)
 
template<class M >
CUDA constexpr NBitset (const battery::bitset< N, M, T > &bits)
 
template<class M >
CUDA constexpr this_typeoperator= (const this_type2< M > &other)
 
CUDA constexpr this_typeoperator= (const this_type &other)
 
CUDA constexpr local::BInc is_top () const
 
CUDA constexpr local::BDec is_bot () const
 
CUDA constexpr const bitset_typevalue () const
 
CUDA constexpr LB lb () const
 
CUDA constexpr UB ub () const
 
CUDA constexpr local_type complement () const
 
CUDA constexpr this_typetell_top ()
 
template<class A , class M >
CUDA constexpr this_typetell_lb (const A &lb, BInc< M > &has_changed)
 
template<class A , class M >
CUDA constexpr this_typetell_ub (const A &ub, BInc< M > &has_changed)
 
template<class M1 , class M2 >
CUDA constexpr this_typetell (const this_type2< M1 > &other, BInc< M2 > &has_changed)
 
template<class M >
CUDA constexpr this_typetell (const this_type2< M > &other)
 
CUDA constexpr this_typedtell_bot ()
 
template<class M1 , class M2 >
CUDA constexpr this_typedtell (const this_type2< M1 > &other, BInc< M2 > &has_changed)
 
template<class M >
CUDA constexpr this_typedtell (const this_type2< M > &other)
 
template<class M >
CUDA constexpr bool extract (this_type2< M > &ua) const
 
template<class Env >
CUDA TFormula< typename Env::allocator_type > deinterpret (AVar x, const Env &env) const
 
template<class F >
CUDA NI F deinterpret () const
 
CUDA NI void print () const
 
CUDA constexpr local_type width () const
 
CUDA constexpr local_type median () const
 

Static Public Member Functions

CUDA static constexpr this_type from_set (const battery::vector< int > &values)
 
CUDA static constexpr local_type eq_zero ()
 
CUDA static constexpr local_type eq_one ()
 
CUDA static constexpr local_type bot ()
 
CUDA static constexpr local_type top ()
 
template<bool diagnose = false, class F , class Env , class M >
CUDA static NI bool interpret_tell (const F &f, const Env &env, this_type2< M > &tell, IDiagnostics &diagnostics)
 
template<bool diagnose = false, class F , class Env , class M >
CUDA static NI bool interpret_ask (const F &f, const Env &env, this_type2< M > &k, IDiagnostics &diagnostics)
 
template<IKind kind, bool diagnose = false, class F , class Env , class M >
CUDA static NI bool interpret (const F &f, const Env &env, this_type2< M > &k, IDiagnostics &diagnostics)
 
CUDA NI static constexpr bool is_supported_fun (Sig sig)
 
template<class M >
CUDA static constexpr local_type neg (const this_type2< M > &x)
 
template<class M >
CUDA static constexpr local_type abs (const this_type2< M > &x)
 
template<Sig sig, class M >
CUDA static constexpr local_type fun (const this_type2< M > &x)
 
template<class M >
CUDA static constexpr local_type additive_inverse (const this_type2< M > &x)
 
template<Sig sig, class M1 , class M2 >
CUDA static constexpr local_type fun (const this_type2< M1 > &x, const this_type2< M2 > &y)
 

Static Public Attributes

static constexpr const bool is_abstract_universe = true
 
static constexpr const bool sequential = Mem::sequential
 
static constexpr const bool is_totally_ordered = false
 
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 = false
 
static constexpr const bool complemented = true
 
static constexpr const char * name = "NBitset"
 

Friends

template<size_t N2, class Mem2 , class T2 >
class NBitset
 

Detailed Description

template<size_t N, class Mem, class T = unsigned long long>
class lala::NBitset< N, Mem, T >

This class represents a set of integer values with a fixed-size bitset. In order to have well-defined arithmetic operations preserving bottom and top elements, the first and last bits (written L and R below) of the bitset are reserved. The meaning of L is to include all negative integers and the meaning of R is to include all integers greater than the size of the bitset. Given a bitset \( Lb_0b_1...b_nR \) of size n + 3, the concretization function is given as follows: \( \gamma(Lb_0b_1...b_nR) = \{ i \in \mathbb{Z} \mid 0 \leq i \leq n \land b_i = 1 \} \cup \{ i \in \mathbb{Z} \;|\; i < 0 \land L = 1 \} \cup \{ i \in \mathbb{Z} \;|\; i > n \land R = 1 \} \)

Member Typedef Documentation

◆ memory_type

template<size_t N, class Mem , class T = unsigned long long>
using lala::NBitset< N, Mem, T >::memory_type = Mem

◆ bitset_type

template<size_t N, class Mem , class T = unsigned long long>
using lala::NBitset< N, Mem, T >::bitset_type = battery::bitset<N, Mem, T>

◆ this_type

template<size_t N, class Mem , class T = unsigned long long>
using lala::NBitset< N, Mem, T >::this_type = NBitset<N, Mem, T>

◆ this_type2

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
using lala::NBitset< N, Mem, T >::this_type2 = NBitset<N, M, T>

◆ local_type

template<size_t N, class Mem , class T = unsigned long long>
using lala::NBitset< N, Mem, T >::local_type = this_type2<battery::local_memory>

◆ LB

template<size_t N, class Mem , class T = unsigned long long>
using lala::NBitset< N, Mem, T >::LB = local::ZInc

◆ UB

template<size_t N, class Mem , class T = unsigned long long>
using lala::NBitset< N, Mem, T >::UB = local::ZDec

◆ value_type

template<size_t N, class Mem , class T = unsigned long long>
using lala::NBitset< N, Mem, T >::value_type = typename LB::value_type

Constructor & Destructor Documentation

◆ NBitset() [1/8]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr lala::NBitset< N, Mem, T >::NBitset ( )
inlineconstexpr

Initialize to bottom (all bits at 1).

◆ NBitset() [2/8]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr lala::NBitset< N, Mem, T >::NBitset ( const this_type & other)
inlineconstexpr

◆ NBitset() [3/8]

template<size_t N, class Mem , class T = unsigned long long>
constexpr lala::NBitset< N, Mem, T >::NBitset ( this_type && )
constexprdefault

◆ NBitset() [4/8]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr lala::NBitset< N, Mem, T >::NBitset ( value_type x)
inlineconstexpr

Given a value \( x \in U \) where \( U \) is the universe of discourse, we initialize a singleton bitset \( 0_0..1_{x+1}...0_n \).

◆ NBitset() [5/8]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr lala::NBitset< N, Mem, T >::NBitset ( value_type lb,
value_type ub )
inlineconstexpr

◆ NBitset() [6/8]

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA constexpr lala::NBitset< N, Mem, T >::NBitset ( const this_type2< M > & other)
inlineconstexpr

◆ NBitset() [7/8]

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA constexpr lala::NBitset< N, Mem, T >::NBitset ( this_type2< M > && other)
inlineconstexpr

◆ NBitset() [8/8]

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA constexpr lala::NBitset< N, Mem, T >::NBitset ( const battery::bitset< N, M, T > & bits)
inlineconstexpr

Member Function Documentation

◆ from_set()

template<size_t N, class Mem , class T = unsigned long long>
CUDA static constexpr this_type lala::NBitset< N, Mem, T >::from_set ( const battery::vector< int > & values)
inlinestaticconstexpr

◆ operator=() [1/2]

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::operator= ( const this_type2< M > & other)
inlineconstexpr

The assignment operator can only be used in a sequential context. It is monotone but not extensive.

◆ operator=() [2/2]

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::operator= ( const this_type & other)
inlineconstexpr

◆ eq_zero()

template<size_t N, class Mem , class T = unsigned long long>
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::eq_zero ( )
inlinestaticconstexpr

Pre-interpreted formula x == 0.

◆ eq_one()

template<size_t N, class Mem , class T = unsigned long long>
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::eq_one ( )
inlinestaticconstexpr

Pre-interpreted formula x == 1.

◆ bot()

template<size_t N, class Mem , class T = unsigned long long>
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::bot ( )
inlinestaticconstexpr

◆ top()

template<size_t N, class Mem , class T = unsigned long long>
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::top ( )
inlinestaticconstexpr

◆ is_top()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr local::BInc lala::NBitset< N, Mem, T >::is_top ( ) const
inlineconstexpr

◆ is_bot()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr local::BDec lala::NBitset< N, Mem, T >::is_bot ( ) const
inlineconstexpr

◆ value()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr const bitset_type & lala::NBitset< N, Mem, T >::value ( ) const
inlineconstexpr

◆ interpret_tell()

template<size_t N, class Mem , class T = unsigned long long>
template<bool diagnose = false, class F , class Env , class M >
CUDA static NI bool lala::NBitset< N, Mem, T >::interpret_tell ( const F & f,
const Env & env,
this_type2< M > & tell,
IDiagnostics & diagnostics )
inlinestatic

Support the following language where all constants k are integer or Boolean values:

  • var x:Z
  • var x:B
  • x <op> k where k is an integer constant and <op> in {==, !=, <, <=, >, >=}.
  • x in S where S is a set of integers. It can be over-approximated if the element k falls out of the bitset.

◆ interpret_ask()

template<size_t N, class Mem , class T = unsigned long long>
template<bool diagnose = false, class F , class Env , class M >
CUDA static NI bool lala::NBitset< N, Mem, T >::interpret_ask ( const F & f,
const Env & env,
this_type2< M > & k,
IDiagnostics & diagnostics )
inlinestatic

Support the same language than the "tell language" without existential.

◆ interpret()

template<size_t N, class Mem , class T = unsigned long long>
template<IKind kind, bool diagnose = false, class F , class Env , class M >
CUDA static NI bool lala::NBitset< N, Mem, T >::interpret ( const F & f,
const Env & env,
this_type2< M > & k,
IDiagnostics & diagnostics )
inlinestatic

◆ lb()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr LB lala::NBitset< N, Mem, T >::lb ( ) const
inlineconstexpr

◆ ub()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr UB lala::NBitset< N, Mem, T >::ub ( ) const
inlineconstexpr

◆ complement()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr local_type lala::NBitset< N, Mem, T >::complement ( ) const
inlineconstexpr

◆ tell_top()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::tell_top ( )
inlineconstexpr

◆ tell_lb()

template<size_t N, class Mem , class T = unsigned long long>
template<class A , class M >
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::tell_lb ( const A & lb,
BInc< M > & has_changed )
inlineconstexpr

◆ tell_ub()

template<size_t N, class Mem , class T = unsigned long long>
template<class A , class M >
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::tell_ub ( const A & ub,
BInc< M > & has_changed )
inlineconstexpr

◆ tell() [1/2]

template<size_t N, class Mem , class T = unsigned long long>
template<class M1 , class M2 >
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::tell ( const this_type2< M1 > & other,
BInc< M2 > & has_changed )
inlineconstexpr

◆ tell() [2/2]

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::tell ( const this_type2< M > & other)
inlineconstexpr

◆ dtell_bot()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::dtell_bot ( )
inlineconstexpr

◆ dtell() [1/2]

template<size_t N, class Mem , class T = unsigned long long>
template<class M1 , class M2 >
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::dtell ( const this_type2< M1 > & other,
BInc< M2 > & has_changed )
inlineconstexpr

◆ dtell() [2/2]

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA constexpr this_type & lala::NBitset< N, Mem, T >::dtell ( const this_type2< M > & other)
inlineconstexpr

◆ extract()

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA constexpr bool lala::NBitset< N, Mem, T >::extract ( this_type2< M > & ua) const
inlineconstexpr

◆ deinterpret() [1/2]

template<size_t N, class Mem , class T = unsigned long long>
template<class Env >
CUDA TFormula< typename Env::allocator_type > lala::NBitset< N, Mem, T >::deinterpret ( AVar x,
const Env & env ) const
inline

◆ deinterpret() [2/2]

template<size_t N, class Mem , class T = unsigned long long>
template<class F >
CUDA NI F lala::NBitset< N, Mem, T >::deinterpret ( ) const
inline

Deinterpret the current value to a logical constant. The lower bound is deinterpreted, and it is up to the user to check that interval is a singleton.

◆ print()

template<size_t N, class Mem , class T = unsigned long long>
CUDA NI void lala::NBitset< N, Mem, T >::print ( ) const
inline

◆ is_supported_fun()

template<size_t N, class Mem , class T = unsigned long long>
CUDA NI static constexpr bool lala::NBitset< N, Mem, T >::is_supported_fun ( Sig sig)
inlinestaticconstexpr

◆ neg()

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::neg ( const this_type2< M > & x)
inlinestaticconstexpr

◆ abs()

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::abs ( const this_type2< M > & x)
inlinestaticconstexpr

◆ fun() [1/2]

template<size_t N, class Mem , class T = unsigned long long>
template<Sig sig, class M >
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::fun ( const this_type2< M > & x)
inlinestaticconstexpr

◆ additive_inverse()

template<size_t N, class Mem , class T = unsigned long long>
template<class M >
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::additive_inverse ( const this_type2< M > & x)
inlinestaticconstexpr

◆ fun() [2/2]

template<size_t N, class Mem , class T = unsigned long long>
template<Sig sig, class M1 , class M2 >
CUDA static constexpr local_type lala::NBitset< N, Mem, T >::fun ( const this_type2< M1 > & x,
const this_type2< M2 > & y )
inlinestaticconstexpr

◆ width()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr local_type lala::NBitset< N, Mem, T >::width ( ) const
inlineconstexpr

◆ median()

template<size_t N, class Mem , class T = unsigned long long>
CUDA constexpr local_type lala::NBitset< N, Mem, T >::median ( ) const
inlineconstexpr
Returns
The median value of the bitset.

Friends And Related Symbol Documentation

◆ NBitset

template<size_t N, class Mem , class T = unsigned long long>
template<size_t N2, class Mem2 , class T2 >
friend class NBitset
friend

Member Data Documentation

◆ is_abstract_universe

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::is_abstract_universe = true
staticconstexpr

◆ sequential

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::sequential = Mem::sequential
staticconstexpr

◆ is_totally_ordered

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::is_totally_ordered = false
staticconstexpr

◆ preserve_bot

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::preserve_bot = true
staticconstexpr

◆ preserve_top

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::preserve_top = true
staticconstexpr

◆ preserve_join

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::preserve_join = true
staticconstexpr

◆ preserve_meet

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::preserve_meet = true
staticconstexpr

◆ injective_concretization

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::injective_concretization = true
staticconstexpr

◆ preserve_concrete_covers

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::preserve_concrete_covers = false
staticconstexpr

◆ complemented

template<size_t N, class Mem , class T = unsigned long long>
constexpr const bool lala::NBitset< N, Mem, T >::complemented = true
staticconstexpr

◆ name

template<size_t N, class Mem , class T = unsigned long long>
constexpr const char* lala::NBitset< N, Mem, T >::name = "NBitset"
staticconstexpr

The documentation for this class was generated from the following file: