extern crate alloc;
use crate::metis::{Cut, Dot, DotSet};
use alloc::vec::Vec;
use proptest::prelude::*;
mod lattice;
mod sources;
mod views;
fn arb_dots() -> impl Strategy<Value = Vec<(u32, u64)>> {
prop::collection::vec((0u32..4, 0u64..12), 0..24)
}
fn arb_subroster() -> impl Strategy<Value = Vec<u32>> {
prop::collection::vec(0u32..6, 0..6)
}
fn have(dots: &[(u32, u64)]) -> DotSet {
let mut set = DotSet::new();
for &pair in dots {
if let Ok(dot) = Dot::try_from(pair) {
let _ = set.insert(dot);
}
}
set
}
fn arb_cut() -> impl Strategy<Value = Cut> {
arb_dots().prop_map(|dots| Cut::floor_of(&have(&dots)))
}
fn is_genuine_cut(cut: &Cut) -> bool {
let vector = cut.as_vector();
DotSet::from_cut(vector).floor() == *vector
}