diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2014-12-03 20:34:09 +0100 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2014-12-16 13:15:12 +0100 |
commit | bff51607cfdda137d7bc55d802895d7f794d5768 (patch) | |
tree | 1a159136a88ddc6561b814fb4ecbacdf9de0dd70 /tactics/contradiction.ml | |
parent | 37ed28dfe253615729763b5d81a533094fb5425e (diff) |
Getting rid of Exninfo hacks.
Instead of modifying exceptions to wear additional information, we instead use
a dedicated type now. All exception-using functions were modified to support
this new type, in particular Future's fix_exn-s and the tactic monad.
To solve the problem of enriching exceptions at raise time and recover this
data in the try-with handler, we use a global datastructure recording the
given piece of data imperatively that we retrieve in the try-with handler.
We ensure that such instrumented try-with destroy the data so that there
may not be confusion with another exception. To further harden the correction
of this structure, we also check for pointer equality with the last raised
exception.
The global data structure is not thread-safe for now, which is incorrect as
the STM uses threads and enriched exceptions. Yet, we splitted the patch in
two parts, so that we do not introduce dependencies to the Thread library
immediatly. This will allow to revert only the second patch if ever we
switch to OCaml-coded lightweight threads.
Diffstat (limited to 'tactics/contradiction.ml')
-rw-r--r-- | tactics/contradiction.ml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tactics/contradiction.ml b/tactics/contradiction.ml index 9a241c7ef..13742f740 100644 --- a/tactics/contradiction.ml +++ b/tactics/contradiction.ml @@ -71,9 +71,9 @@ let contradiction_context = filter_hyp (fun typ -> is_conv_leq typ t) (fun id' -> simplest_elim (mkApp (mkVar id,[|mkVar id'|]))) end) - begin function + begin function (e, info) -> match e with | Not_found -> seek_neg rest - | e -> Proofview.tclZERO e + | e -> Proofview.tclZERO ~info e end) | _ -> seek_neg rest in @@ -108,9 +108,9 @@ let contradiction_term (c,lbind as cl) = else Proofview.tclZERO Not_found end - begin function + begin function (e, info) -> match e with | Not_found -> Proofview.tclZERO (Errors.UserError ("",Pp.str"Not a contradiction.")) - | e -> Proofview.tclZERO e + | e -> Proofview.tclZERO ~info e end end |