symbolic-sets 0.1.0

Sets that are stored symbolically
Documentation
// -*- coding: utf-8 -*-
//-------------------------------------------------------------------------------------------------
// SPDX-FileCopyrightText: © 2024 Walland Heavy Research
// SPDX-License-Identifier: AGPL-3.0-only
//-------------------------------------------------------------------------------------------------

//! Provides implementations of sets that are stored symbolically.
//!
//! This means that you are not storing each element of the set directly; instead, a set consists
//! of all elements that satisfy certain properties, which are expressed as code.  You provide some
//! _atomic_ properties, along with rules for simplifying combinations of properties; we handle the
//! rest.

pub mod anf;

#[cfg(any(test, feature = "proptest"))]
pub mod proptest;

/// Defines a property that may be true or false for each possible element of a set.  Each property
/// must match at least one element, and must reject at least one element.
pub trait Property {
    type Element;

    /// Returns whether this property is true for a particular element.
    fn is_satisfied(&self, element: &Self::Element) -> bool;
}