aboutsummaryrefslogtreecommitdiff
path: root/pretyping/termops.ml
diff options
context:
space:
mode:
authorpboutill2010-05-20 12:57:40 +0000
committerpboutill2010-05-20 12:57:40 +0000
commitea188f154f86960008df67fa0266a3aa648ff1e7 (patch)
treedcc392b3078d369f2994a6fc81d209526005d45a /pretyping/termops.ml
parente7fc963667a6cfbf9f8516f49ea1dcb9d6779f2d (diff)
Fix bug 2307
Evars of source "ImpossibleCase" that remain undefined at the end of case analysis are now defined to ID (forall A : Type, A -> A). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13023 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping/termops.ml')
-rw-r--r--pretyping/termops.ml18
1 files changed, 18 insertions, 0 deletions
diff --git a/pretyping/termops.ml b/pretyping/termops.ml
index 1c0bf2fbcf..c099504f6f 100644
--- a/pretyping/termops.ml
+++ b/pretyping/termops.ml
@@ -966,3 +966,21 @@ let context_chop k ctx =
| (_, []) -> anomaly "context_chop"
in chop_aux [] (k,ctx)
+(*******************************************)
+(* Functions to deal with impossible cases *)
+(*******************************************)
+let impossible_default_case = ref None
+
+let set_impossible_default_clause c = impossible_default_case := Some c
+
+let coq_unit_judge =
+ let na1 = Name (id_of_string "A") in
+ let na2 = Name (id_of_string "H") in
+ fun () ->
+ match !impossible_default_case with
+ | Some (id,type_of_id) ->
+ make_judge id type_of_id
+ | None ->
+ (* In case the constants id/ID are not defined *)
+ make_judge (mkLambda (na1,mkProp,mkLambda(na2,mkRel 1,mkRel 1)))
+ (mkProd (na1,mkProp,mkArrow (mkRel 1) (mkRel 2)))