minerva 0.2.0

Causal ordering for distributed systems
extern crate alloc;

use crate::metis::{Dot, DotSet};
use alloc::vec::Vec;
use proptest::prelude::*;

mod polis_envelope;
mod rejection;
mod round_trip;
mod totality;

fn arb_dots() -> impl Strategy<Value = Vec<(u32, u64)>> {
    prop::collection::vec((0u32..4, 0u64..16), 0..32)
}

fn have(dots: &[(u32, u64)]) -> DotSet {
    let mut set = DotSet::new();
    for &pair in dots {
        // A drawn zero counter is no dot and cannot cross into the identity
        // type: the same no-op the door's zero refusal gave (ruling R-91).
        if let Ok(dot) = Dot::try_from(pair) {
            let _ = set.insert(dot);
        }
    }
    set
}