EasyCrypt's duniform (theories/distributions/Distr.ec, theory MUniform) #
duniform s: the uniform distribution on the elements of the list s (the empty
sub-distribution for the empty list), with EC's duniform1E and duniformE; and the list
operations they are stated with, undup and count. Names are EasyCrypt's.
op count: the number of elements of s that satisfy p.
Equations
- GaudisCrypt.EC.count p s = ↑(List.countP (fun (x : α) => decide (p x)) s)
Instances For
op duniform (s : 'a list): the uniform distribution on the elements of s.
Equations
- GaudisCrypt.EC.duniform s = if h : s.toFinset.Nonempty then GaudisCrypt.SubProbability.uniformOfFinset s.toFinset h else ⊥