fn reservoir_sample<'a, R: Rand, PT: ProtocolTypes, P: Fn(&Term<PT>) -> bool + Copy>( trace: &'a Trace<PT>, filter: P, constraints: TermConstraints, rand: &mut R, ) -> Option<(&'a Term<PT>, TracePath)>
https://en.wikipedia.org/wiki/Reservoir_sampling#Simple_algorithm