extern crate alloc;
use alloc::collections::BTreeSet;
use alloc::vec::Vec;
use crate::metis::{Dot, DotSet};
use proptest::prelude::*;
mod difference;
mod exact;
mod lattice;
mod reads;
mod restriction;
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 model(dots: &[(u32, u64)]) -> BTreeSet<Dot> {
dots.iter()
.copied()
.filter_map(|pair| Dot::try_from(pair).ok())
.collect()
}