pub struct WqoInstance {
pub carrier: Vec<u64>,
pub le_matrix: Vec<Vec<bool>>,
}Expand description
Represents a well-quasi-order (WQO) over a finite carrier.
An encoding of the WQO property: every infinite sequence has a good pair (indices i < j with carrier[i] ≤ carrier[j]).
Fields§
§carrier: Vec<u64>The elements of the carrier set (finite approximation).
le_matrix: Vec<Vec<bool>>The quasi-order as a boolean matrix (le_matrix[i][j] = carrier[i] ≤ carrier[j]).
Implementations§
Source§impl WqoInstance
impl WqoInstance
Sourcepub fn new(carrier: Vec<u64>, le: impl Fn(u64, u64) -> bool) -> Self
pub fn new(carrier: Vec<u64>, le: impl Fn(u64, u64) -> bool) -> Self
Create a WQO instance from a carrier and a comparator.
Sourcepub fn has_good_pair(&self, seq: &[usize]) -> bool
pub fn has_good_pair(&self, seq: &[usize]) -> bool
Check if a sequence (given as indices into carrier) has a good pair.
Sourcepub fn find_good_pair(&self, seq: &[usize]) -> Option<(usize, usize)>
pub fn find_good_pair(&self, seq: &[usize]) -> Option<(usize, usize)>
Return the first good pair in a sequence, if one exists.
Sourcepub fn is_reflexive(&self) -> bool
pub fn is_reflexive(&self) -> bool
Check if the relation is reflexive.
Sourcepub fn is_transitive(&self) -> bool
pub fn is_transitive(&self) -> bool
Check if the relation is transitive.
Auto Trait Implementations§
impl Freeze for WqoInstance
impl RefUnwindSafe for WqoInstance
impl Send for WqoInstance
impl Sync for WqoInstance
impl Unpin for WqoInstance
impl UnsafeUnpin for WqoInstance
impl UnwindSafe for WqoInstance
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