Performs a beam search over executions of this program returning at most beamSize execution results.
Performs a beam search over executions of this program returning at most beamSize execution results. env is the initial global state of the program, and graph is the initial computation graph. These must contain values for any global variables or neural network parameters referenced in the program.
flatMap is the monad's bind operator.
flatMap is the monad's bind operator. It chains two probabilistic computations together in the natural way where f represents a conditional distribution P(B | A). Hence, binding f to a distribution P(A) returns the marginal distribution over B, sum_a P(A=a) P(B | A=a).
Implements a single step of forward sampling.
Implements a single search step of beam search.