Running a Computation Multiple Times #
This file defines a function replicate oa n that runs the computation oa a total of n times,
returning the result as a list of length n.
Note that while the executions are independent, they may no longer be after calling simulate.
Run the computation oa repeatedly n times to get a list of n results.
Instances For
Instances For
Bind-style unfolding of replicate, convenient for program-logic proofs.
The tail-recursive replicateTR agrees with the recursive replicate. The
@[simp] annotation lets every later proof about replicateTR reduce to the
recursive form automatically.
The probability of getting a list from replicate is the product of the chances of
getting each of the individual elements.
Possible outputs of replicate n oa are lists of length n where
each element in the list is a possible output of oa.