pub struct Algebra {
pub carrier_size: usize,
pub signature: Signature,
pub tables: HashMap<String, Vec<Vec<usize>>>,
}Expand description
A finite concrete algebra over a signature.
The carrier is {0, 1, ..., carrier_size - 1}.
Fields§
§carrier_size: usize§signature: Signature§tables: HashMap<String, Vec<Vec<usize>>>Implementations§
Source§impl Algebra
impl Algebra
Sourcepub fn new(carrier: usize, sig: Signature) -> Self
pub fn new(carrier: usize, sig: Signature) -> Self
Create a new algebra with the given carrier size and signature.
Sourcepub fn define_op(&mut self, name: &str, table: Vec<Vec<usize>>)
pub fn define_op(&mut self, name: &str, table: Vec<Vec<usize>>)
Define the operation table for a named operation.
Sourcepub fn apply_op(&self, name: &str, args: &[usize]) -> Option<usize>
pub fn apply_op(&self, name: &str, args: &[usize]) -> Option<usize>
Apply the named operation to the given arguments, returning the result.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Check whether all table entries refer to elements within the carrier.
Sourcepub fn find_congruences(&self) -> usize
pub fn find_congruences(&self) -> usize
Return a stub count of valid congruences (placeholder implementation).
Auto Trait Implementations§
impl Freeze for Algebra
impl RefUnwindSafe for Algebra
impl Send for Algebra
impl Sync for Algebra
impl Unpin for Algebra
impl UnsafeUnpin for Algebra
impl UnwindSafe for Algebra
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more