spot  2.16
Public Member Functions | Static Public Member Functions | List of all members
spot::acc_cond::mark_t Struct Reference

An acceptance mark. More...

#include <spot/twa/acc.hh>

Collaboration diagram for spot::acc_cond::mark_t:

Public Member Functions

 mark_t ()=default
 Initialize an empty mark_t. More...
 
template<class iterator >
 mark_t (const iterator &begin, const iterator &end)
 Create a mark_t from a range of set numbers. More...
 
 mark_t (std::initializer_list< unsigned > vals)
 Create a mark_t from a list of set numbers. More...
 
size_t hash () const noexcept
 Returns a hash value for this mark. More...
 
bool operator== (mark_t o) const
 Equality comparison. More...
 
bool operator!= (mark_t o) const
 Inequality comparison. More...
 
bool operator< (mark_t o) const
 Less-than comparison. More...
 
bool operator<= (mark_t o) const
 Less-or-equal comparison. More...
 
bool operator> (mark_t o) const
 Greater-than comparison. More...
 
bool operator>= (mark_t o) const
 Greater-or-equal comparison. More...
 
 operator bool () const
 Returns true iff the mark is non-empty (at least one bit set). More...
 
bool has (unsigned u) const
 Returns true iff acceptance set u is in this mark. More...
 
void set (unsigned u)
 Add acceptance set u to this mark. More...
 
void clear (unsigned u)
 Remove acceptance set u from this mark. More...
 
mark_toperator&= (mark_t r)
 Intersection-assignment. More...
 
mark_toperator|= (mark_t r)
 Union-assignment. More...
 
mark_toperator-= (mark_t r)
 Difference-assignment (removes bits set in r). More...
 
mark_toperator^= (mark_t r)
 Symmetric-difference-assignment. More...
 
mark_t operator& (mark_t r) const
 Intersection. More...
 
mark_t operator| (mark_t r) const
 Union. More...
 
mark_t operator- (mark_t r) const
 Difference (bits in this mark but not in r). More...
 
mark_t operator~ () const
 Bitwise complement. More...
 
mark_t operator^ (mark_t r) const
 Symmetric difference. More...
 
mark_t operator<< (unsigned i) const
 Left-shift all acceptance set indices by i. More...
 
mark_toperator<<= (unsigned i)
 Left-shift-assignment. More...
 
mark_t operator>> (unsigned i) const
 Right-shift all acceptance set indices by i. More...
 
mark_toperator>>= (unsigned i)
 Right-shift-assignment. More...
 
mark_t strip (mark_t y) const
 Remove bits indexed by y and compact the remaining bits. More...
 
bool subset (mark_t m) const
 Whether the set of bits represented by *this is a subset of those represented by m. More...
 
bool proper_subset (mark_t m) const
 Whether the set of bits represented by *this is a proper subset of those represented by m. More...
 
unsigned count () const
 Number of bits set. More...
 
unsigned max_set () const
 The number of the highest set used plus one. More...
 
unsigned min_set () const
 The number of the lowest set used plus one. More...
 
mark_t lowest () const
 A mark_t where all bits have been removed except the lowest one. More...
 
bool is_singleton () const
 Whether the mark contains only one bit set. More...
 
bool has_many () const
 Whether the mark contains at least two bits set. More...
 
mark_tremove_some (unsigned n)
 Remove n bits that were set. More...
 
template<class iterator >
void fill (iterator here) const
 Fill a container with the indices of the bits that are set. More...
 
spot::internal::mark_container sets () const
 Returns some iterable object that contains the used sets. More...
 
std::string as_string () const
 Returns a string representation of this mark. More...
 

Static Public Member Functions

constexpr static unsigned max_accsets ()
 The maximum number of acceptance sets supported by this implementation. More...
 
static mark_t all ()
 A mark_t with all bits set to one. More...
 

Detailed Description

An acceptance mark.

This type is used to represent a set of acceptance sets. It works (and is implemented) like a bit vector where bit at index i represents the membership to the i-th acceptance set.

Typically, each transition of an automaton is labeled by a mark_t that represents the membership of the transition to each of the acceptance sets.

For efficiency reason, the maximum number of acceptance sets (i.e., the size of the bit vector) supported is a compile-time constant. It can be changed by passing an option to the configure script of Spot.

Constructor & Destructor Documentation

◆ mark_t() [1/3]

spot::acc_cond::mark_t::mark_t ( )
default

Initialize an empty mark_t.

◆ mark_t() [2/3]

template<class iterator >
spot::acc_cond::mark_t::mark_t ( const iterator &  begin,
const iterator &  end 
)
inline

Create a mark_t from a range of set numbers.

◆ mark_t() [3/3]

spot::acc_cond::mark_t::mark_t ( std::initializer_list< unsigned >  vals)
inline

Create a mark_t from a list of set numbers.

Member Function Documentation

◆ all()

static mark_t spot::acc_cond::mark_t::all ( )
inlinestatic

A mark_t with all bits set to one.

Beware that all bits are sets, not just the bits used in the acceptance condition. This class is unaware of the acceptance condition.

◆ as_string()

std::string spot::acc_cond::mark_t::as_string ( ) const

Returns a string representation of this mark.

◆ clear()

void spot::acc_cond::mark_t::clear ( unsigned  u)
inline

Remove acceptance set u from this mark.

◆ count()

unsigned spot::acc_cond::mark_t::count ( ) const
inline

Number of bits set.

◆ fill()

template<class iterator >
void spot::acc_cond::mark_t::fill ( iterator  here) const

Fill a container with the indices of the bits that are set.

◆ has()

bool spot::acc_cond::mark_t::has ( unsigned  u) const
inline

Returns true iff acceptance set u is in this mark.

References spot::operator&().

Referenced by spot::acc_cond::useless().

◆ has_many()

bool spot::acc_cond::mark_t::has_many ( ) const
inline

Whether the mark contains at least two bits set.

◆ hash()

size_t spot::acc_cond::mark_t::hash ( ) const
inlinenoexcept

Returns a hash value for this mark.

◆ is_singleton()

bool spot::acc_cond::mark_t::is_singleton ( ) const
inline

Whether the mark contains only one bit set.

◆ lowest()

mark_t spot::acc_cond::mark_t::lowest ( ) const
inline

A mark_t where all bits have been removed except the lowest one.

For instance if this contains {1,3,8}, the output is {1}.

◆ max_accsets()

constexpr static unsigned spot::acc_cond::mark_t::max_accsets ( )
inlinestaticconstexpr

The maximum number of acceptance sets supported by this implementation.

The value can be changed at compile-time using configure's –enable-max-accsets=N option.

Referenced by spot::acc_cond::all_sets_().

◆ max_set()

unsigned spot::acc_cond::mark_t::max_set ( ) const
inline

The number of the highest set used plus one.

If no set is used, this returns 0, If the sets {1,3,8} are used, this returns 9.

◆ min_set()

unsigned spot::acc_cond::mark_t::min_set ( ) const
inline

The number of the lowest set used plus one.

If no set is used, this returns 0. If the sets {1,3,8} are used, this returns 2.

◆ operator bool()

spot::acc_cond::mark_t::operator bool ( ) const
inlineexplicit

Returns true iff the mark is non-empty (at least one bit set).

◆ operator!=()

bool spot::acc_cond::mark_t::operator!= ( mark_t  o) const
inline

Inequality comparison.

◆ operator&()

mark_t spot::acc_cond::mark_t::operator& ( mark_t  r) const
inline

Intersection.

◆ operator&=()

mark_t& spot::acc_cond::mark_t::operator&= ( mark_t  r)
inline

Intersection-assignment.

◆ operator-()

mark_t spot::acc_cond::mark_t::operator- ( mark_t  r) const
inline

Difference (bits in this mark but not in r).

◆ operator-=()

mark_t& spot::acc_cond::mark_t::operator-= ( mark_t  r)
inline

Difference-assignment (removes bits set in r).

◆ operator<()

bool spot::acc_cond::mark_t::operator< ( mark_t  o) const
inline

Less-than comparison.

◆ operator<<()

mark_t spot::acc_cond::mark_t::operator<< ( unsigned  i) const
inline

Left-shift all acceptance set indices by i.

◆ operator<<=()

mark_t& spot::acc_cond::mark_t::operator<<= ( unsigned  i)
inline

Left-shift-assignment.

◆ operator<=()

bool spot::acc_cond::mark_t::operator<= ( mark_t  o) const
inline

Less-or-equal comparison.

◆ operator==()

bool spot::acc_cond::mark_t::operator== ( mark_t  o) const
inline

Equality comparison.

◆ operator>()

bool spot::acc_cond::mark_t::operator> ( mark_t  o) const
inline

Greater-than comparison.

◆ operator>=()

bool spot::acc_cond::mark_t::operator>= ( mark_t  o) const
inline

Greater-or-equal comparison.

◆ operator>>()

mark_t spot::acc_cond::mark_t::operator>> ( unsigned  i) const
inline

Right-shift all acceptance set indices by i.

◆ operator>>=()

mark_t& spot::acc_cond::mark_t::operator>>= ( unsigned  i)
inline

Right-shift-assignment.

◆ operator^()

mark_t spot::acc_cond::mark_t::operator^ ( mark_t  r) const
inline

Symmetric difference.

◆ operator^=()

mark_t& spot::acc_cond::mark_t::operator^= ( mark_t  r)
inline

Symmetric-difference-assignment.

◆ operator|()

mark_t spot::acc_cond::mark_t::operator| ( mark_t  r) const
inline

Union.

◆ operator|=()

mark_t& spot::acc_cond::mark_t::operator|= ( mark_t  r)
inline

Union-assignment.

◆ operator~()

mark_t spot::acc_cond::mark_t::operator~ ( ) const
inline

Bitwise complement.

◆ proper_subset()

bool spot::acc_cond::mark_t::proper_subset ( mark_t  m) const
inline

Whether the set of bits represented by *this is a proper subset of those represented by m.

◆ remove_some()

mark_t& spot::acc_cond::mark_t::remove_some ( unsigned  n)
inline

Remove n bits that were set.

If there are less than n bits set, the output is empty.

◆ set()

void spot::acc_cond::mark_t::set ( unsigned  u)
inline

Add acceptance set u to this mark.

Referenced by spot::acc_cond::acc_code::generalized_rabin().

◆ sets()

spot::internal::mark_container spot::acc_cond::mark_t::sets ( ) const
inline

Returns some iterable object that contains the used sets.

◆ strip()

mark_t spot::acc_cond::mark_t::strip ( mark_t  y) const
inline

Remove bits indexed by y and compact the remaining bits.

Each bit position set in y is removed from this mark, and the surviving bits are shifted down to fill the gaps.

◆ subset()

bool spot::acc_cond::mark_t::subset ( mark_t  m) const
inline

Whether the set of bits represented by *this is a subset of those represented by m.


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

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.1