Traversing a list with an oracle program #
Running an oracle program on each entry of a list with ordinary List.mapM makes the calls of
the entries one after the other. When each call q may be answered by any element of
possible q, the possible results of the traversal are exactly the lists whose entries are
possible results of the corresponding programs (OracleComp.mem_supportWith_mapM_iff), and the
traversal of k entries each costing at most n costs at most k * n
(OracleComp.IsCostBounded.mapM). Folding a list xs with List.foldlM whose step costs at most
k costs at most xs.length * k (OracleComp.IsCostBounded.foldlM).
This is the oracle analogue of Cslib.ProbComp.mem_support_mapM_iff.
Main results #
Cslib.OracleComp.mem_supportWith_mapM_iff: the possible results of a traversal are the pointwise possible results.Cslib.OracleComp.IsCostBounded.mapM: a traversal of a list of lengthkwhose entries each cost at mostncosts at mostk * n.Cslib.OracleComp.QueriesSatisfy.mapM: a traversal makes only the calls its entries make.Cslib.OracleComp.IsCostBounded.foldlM: a fold of a listxswhose step costs at mostkcosts at mostxs.length * k.Cslib.ProbOracleComp.run_mapM: running a traversal runs its steps in list order.Cslib.ProbOracleComp.run_mapM_query: a list of queries to a fixed function returns its image.
Running a traversal runs each step with the same oracle.
The possible results of a list traversal are the lists whose entries are possible results of the corresponding programs.
A traversal of inputs whose entries each cost at most n costs at most
inputs.length * n.
A traversal whose entries' calls all satisfy p makes only calls satisfying p.
Folding xs by steps that each cost at most k costs at most xs.length * k.