(* Copyright 2012-2015 by Adam Petcher.				* * Use of this source code is governed by the license described	* * in the LICENSE file at the root of the source tree.		*)
(* Definitions related to pseudoradom functions.  This file copies some items from ConstructedFunc.v, so we probably need to refactor this in the future. *)
Set Implicit Arguments.
Require Export FCF.Array.
Require Export FCF.Hybrid.
Local Open Scope list_scope.
Local Open Scope array_scope.
Definition oracleMap(D R S: Set)(eqds : EqDec S)(eqdr : EqDec R)(oracle : S  -> D -> Comp (R * S))(s : S)(ds : list D) :=
compFold _
(fun acc d => [rs, s] <-2 acc; [r, s] <-$2 oracle s d; ret (rs ++ r :: nil, s))
(nil, s) ds.

Theorem oracleMap_wf :
forall (D R S : Set)(eqds : EqDec S)(eqdr : EqDec R) (oracle : S -> D -> Comp (R * S))ds s,
(forall s x, well_formed_comp (oracle s x)) ->
well_formed_comp (@oracleMap D R S _ _ oracle s ds).