ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
persistent_set< K, Hash > Class Template Reference

Persistent set with O(1) copy, the value-less analogue of persistent_map. More...

#include <persistent_map.h>

Public Types

using const_iterator = typename set_t::iterator

Public Member Functions

 persistent_set ()=default
std::size_t size () const
bool empty () const
std::size_t count (const K &k) const
void insert (const K &k)
bool erase (const K &k)
const_iterator begin () const
const_iterator end () const
template<class Added, class Removed>
void diff (const persistent_set &other, Added &&added, Removed &&removed) const

Detailed Description

template<typename K, typename Hash>
class persistent_set< K, Hash >

Persistent set with O(1) copy, the value-less analogue of persistent_map.

framet::local_variables and declaration_history hold the frame's L1 name records. local_variables is copied into every per-branch merge_statet and union-merged at each join (merge_locality); with a std::unordered_set that is O(N) per branch, so a method holding N locals across N joins is O(N^2). Backing it with immer::set makes the snapshot O(1) and the union O(|diff|) — see the diff() note below and persistent_map's header.

Member Typedef Documentation

◆ const_iterator

template<typename K, typename Hash>
using persistent_set< K, Hash >::const_iterator = typename set_t::iterator

Constructor & Destructor Documentation

◆ persistent_set()

template<typename K, typename Hash>
persistent_set< K, Hash >::persistent_set ( )
default

Member Function Documentation

◆ begin()

template<typename K, typename Hash>
const_iterator persistent_set< K, Hash >::begin ( ) const
inline

◆ count()

template<typename K, typename Hash>
std::size_t persistent_set< K, Hash >::count ( const K & k) const
inline

◆ diff()

template<typename K, typename Hash>
template<class Added, class Removed>
void persistent_set< K, Hash >::diff ( const persistent_set< K, Hash > & other,
Added && added,
Removed && removed ) const
inline

◆ empty()

template<typename K, typename Hash>
bool persistent_set< K, Hash >::empty ( ) const
inline

◆ end()

template<typename K, typename Hash>
const_iterator persistent_set< K, Hash >::end ( ) const
inline

◆ erase()

template<typename K, typename Hash>
bool persistent_set< K, Hash >::erase ( const K & k)
inline

◆ insert()

template<typename K, typename Hash>
void persistent_set< K, Hash >::insert ( const K & k)
inline

◆ size()

template<typename K, typename Hash>
std::size_t persistent_set< K, Hash >::size ( ) const
inline

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