|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
ExtensionalSet — the canonical small-finite extensional carrier, with std::set / std::unordered_set round-trips.
More...
#include <algorithm>#include <concepts>#include <cstddef>#include <functional>#include <iterator>#include <ranges>#include <set>#include <type_traits>#include <unordered_set>#include <utility>import dedekind.sets:computability;import dedekind.category;
Classes | |
| struct | dedekind::sets::ExtensionalSet< T, L, Hash, Equal > |
| struct | dedekind::sets::detail::insert_into |
| The step of the folds below: insert one element into the container accumulated so far, and hand it on (Rule 3: a fold, not a loop). The element is taken by value and moved in, so a transformed result is moved, not copied (a move-only one included). More... | |
| struct | dedekind::sets::detail::decided< Chi > |
A classifier read as a decided truth value: its answer converted to bool as if would convert it, so a classifier valued in an explicit truth type (Truth<Boole>) is admitted. Applied as a const value. More... | |
Namespaces | |
| namespace | dedekind::sets |
Concepts | |
| concept | dedekind::sets::StdSetLike |
| concept | dedekind::sets::detail::StdSetLikeOf |
Functions | |
|
template<typename StdSetLike, typename T, typename L, typename Hash, typename Equal> requires detail::StdSetLikeOf<StdSetLike, T> | |
| constexpr auto | dedekind::sets::to_std (const dedekind::sets::ExtensionalSet< T, L, Hash, Equal > &source) -> StdSetLike |
| template<typename StdSetLike, typename ExtSet> | |
| constexpr auto | dedekind::sets::to_std (const ExtSet &) -> StdSetLike |
|
template<typename T, typename Alloc> requires dedekind::category::IsHashFunction<std::hash<T>, T> && std::regular<T> | |
| constexpr auto | dedekind::sets::from_std (const std::set< T, std::less< T >, Alloc > &source) -> dedekind::sets::ExtensionalSet< T > |
|
template<typename T, typename Alloc> requires (!dedekind::category::IsHashFunction<std::hash<T>, T> || !std::regular<T>) | |
| constexpr auto | dedekind::sets::from_std (const std::set< T, std::less< T >, Alloc > &) -> dedekind::sets::ExtensionalSet< T > |
|
template<typename T, typename Compare, typename Alloc> requires (!std::same_as<Compare, std::less<T>>) | |
| constexpr auto | dedekind::sets::from_std (const std::set< T, Compare, Alloc > &) -> dedekind::sets::ExtensionalSet< T > |
| template<typename T, typename Hash, typename Equal, typename Alloc> | |
| constexpr auto | dedekind::sets::from_std (const std::unordered_set< T, Hash, Equal, Alloc > &source) -> dedekind::sets::ExtensionalSet< T, dedekind::category::Boole, Hash, Equal > |
|
template<typename StdSetLike> requires dedekind::sets::StdSetLike<StdSetLike> | |
| constexpr auto | dedekind::sets::from_std (const StdSetLike &) -> dedekind::sets::ExtensionalSet< typename StdSetLike::value_type > |
| template<typename ExtSet, typename StdSetLike> | |
| constexpr auto | dedekind::sets::from_std (const StdSetLike &) -> ExtSet |
| template<typename U, typename Chi> requires std::ranges::input_range<const U> && std::totally_ordered<std::ranges::range_value_t<const U>> && std::invocable<const Chi&, std::ranges::range_reference_t<const U>> && std::constructible_from< bool, std::invoke_result_t< const Chi&, std::ranges::range_reference_t<const U>>> | |
| constexpr auto | dedekind::sets::ext (const U &universe, Chi chi) |
μ: Int ⇀ Ext, the partial retraction of ambient_set. | |
|
template<typename T, typename Hash, typename Equal, typename Alloc, typename F> requires std::invocable<F&, const T&> | |
| constexpr auto | dedekind::sets::image (F f, const std::unordered_set< T, Hash, Equal, Alloc > &s) |
| image(f, std::unordered_set<T, Hash, Equal, Alloc>). An rvalue source binds here too: the image is a new container either way. | |
|
template<typename T, typename Compare, typename Alloc, typename F> requires std::invocable<F&, const T&> | |
| constexpr auto | dedekind::sets::image (F f, const std::set< T, Compare, Alloc > &s) |
| image(f, std::set<T, Compare, Alloc>). | |
| template<typename T, typename Hash, typename Equal, typename Alloc, typename P> requires std::predicate<const P&, const T&> | |
| constexpr auto | dedekind::sets::filter (P p, const std::unordered_set< T, Hash, Equal, Alloc > &s) |
| filter(p, std::unordered_set<T, Hash, Equal, Alloc>). | |
|
template<typename T, typename Compare, typename Alloc, typename P> requires std::predicate<const P&, const T&> | |
| constexpr auto | dedekind::sets::filter (P p, const std::set< T, Compare, Alloc > &s) |
| filter(p, std::set<T, Compare, Alloc>). | |
Variables | |
| template<typename...> | |
| constexpr bool | dedekind::sets::detail::always_false_v = false |
ExtensionalSet — the canonical small-finite extensional carrier, with std::set / std::unordered_set round-trips.
@partition :extensional
In any computable representation an extensional set (one defined by listing its elements rather than by predicate) is necessarily finite, so the Finite qualifier is dropped from the carrier name; the finiteness and countability propositions are kept as static_assert breadcrumbs against IsExtensional / IsFinite / IsCountable (#598 acceptance).
The std-container bridges (from_std / to_std) live in this partition rather than in a separate :interop sister, since they are constructors / accessors of ExtensionalSet — there is no "interop" surface independent of the carrier they materialise.