diff options
| author | gareuselesinge | 2013-08-30 12:20:08 +0000 |
|---|---|---|
| committer | gareuselesinge | 2013-08-30 12:20:08 +0000 |
| commit | 3059c0a5a6fff2c9df537224e3d711cbf52f1d16 (patch) | |
| tree | e875dfd7a494f3aabaa64af71be809b0dd99dc2b | |
| parent | de9798346c7df0593d4d7b83a8f316991f6fb230 (diff) | |
safe Conv_oracle state for type checking
safe_typing is not purely functional, hence we cannot chain it
as if it was a pure computation.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16744 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | lib/future.ml | 16 | ||||
| -rw-r--r-- | proofs/proof_global.ml | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/future.ml b/lib/future.ml index 3cbaa95dc5..1e9cada513 100644 --- a/lib/future.ml +++ b/lib/future.ml @@ -96,9 +96,9 @@ let chain ?(id="none") ?(pure=false) c f = ref (match !c with | Closure _ | Delegated | Dropped -> Closure (fun () -> f (force ~pure c)) | Exn _ as x -> x | Val (v, None) -> Closure (fun () -> f v) - | Val (v, Some _) when pure -> Closure (fun () -> f v) + | Val (v, Some _) when pure -> Closure (fun () -> f v) | Val (v, Some state) -> - prerr_endline ("Future: restarting (check if optimizable): " ^ id); +(* prerr_endline ("Future: restarting (check if optimizable): " ^ id); *) Closure (fun () -> !unfreeze state; f v)) let create_here f = chain ~pure:false (from_here ()) f @@ -127,17 +127,17 @@ let join x = v let split2 x = - chain ~pure:true x (fun x -> fst x), - chain ~pure:true x (fun x -> snd x) + chain ~pure:false x (fun x -> fst x), + chain ~pure:false x (fun x -> snd x) let split3 x = - chain ~pure:true x (fun x -> Util.pi1 x), - chain ~pure:true x (fun x -> Util.pi2 x), - chain ~pure:true x (fun x -> Util.pi3 x) + chain ~pure:false x (fun x -> Util.pi1 x), + chain ~pure:false x (fun x -> Util.pi2 x), + chain ~pure:false x (fun x -> Util.pi3 x) let map2 f x l = CList.map_i (fun i y -> - let xi = chain ~pure:true x (fun x -> + let xi = chain ~pure:false x (fun x -> try List.nth x i with Failure _ | Invalid_argument _ -> Errors.anomaly (Pp.str "Future.map2 length mismatch")) in diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml index 58eb2e21d8..2365e2bdbd 100644 --- a/proofs/proof_global.ml +++ b/proofs/proof_global.ml @@ -274,7 +274,7 @@ let close_proof ~now fpl = const_entry_inline_code = false; const_entry_opaque = true }) fpl initial_goals in if now then - List.iter (fun x -> ignore(Future.join x.Entries.const_entry_body)) entries; + List.iter (fun x -> ignore(Future.compute x.Entries.const_entry_body)) entries; (pid, (entries, compute_guard, strength, hook)) let return_proof ~fix_exn = @@ -293,7 +293,7 @@ let return_proof ~fix_exn = let close_future_proof proof = close_proof ~now:false proof let close_proof () = - close_proof ~now:true (Future.from_val (return_proof ~fix_exn:(fun x -> x))) + close_proof ~now:true (Future.from_here (return_proof ~fix_exn:(fun x -> x))) (**********************************************************) (* *) |
