]> matita.cs.unibo.it Git - helm.git/commitdiff
Exception raised by delift changed:
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 9 Jun 2005 13:41:22 +0000 (13:41 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 9 Jun 2005 13:41:22 +0000 (13:41 +0000)
Failure ==> DeliftingWouldCaptureAFreeVariable

helm/ocaml/cic_proof_checking/cicSubstitution.ml
helm/ocaml/cic_proof_checking/cicSubstitution.mli
helm/ocaml/cic_unification/cicRefine.ml

index 5f35c54b9d172bad15052cc423e07237f31cd408..229da24f0fdbdf7b5183c288fe1e8d5ac05937c9 100644 (file)
@@ -29,6 +29,7 @@ exception ReferenceToVariable;;
 exception ReferenceToConstant;;
 exception ReferenceToCurrentProof;;
 exception ReferenceToInductiveDefinition;;
+exception DeliftingWouldCaptureAFreeVariable;;
 
 let debug_print = fun _ -> ()
 
@@ -117,7 +118,7 @@ let delift_from k n =
        if m < k then
         C.Rel m
        else if m < k + n then
-         (failwith "delifting this term whould capture free variables")
+         raise DeliftingWouldCaptureAFreeVariable
        else
         C.Rel (m - n)
     | C.Var (uri,exp_named_subst) ->
index b1c09277ba989b086d06e07ab091811f19d1c5b1..5c8fa7ca59b8e31bc3019f71ef0a3cbd91ac0354 100644 (file)
@@ -28,6 +28,7 @@ exception RelToHiddenHypothesis;;
 exception ReferenceToVariable;;
 exception ReferenceToConstant;;
 exception ReferenceToInductiveDefinition;;
+exception DeliftingWouldCaptureAFreeVariable;;
 
 (* lift n t         *)
 (* lifts [t] of [n] *)
index 53dea97e9c43d2d820f61a96c9f37dff176698b9..57e4c5e9d6fff45e438c96cc7f4b3f781ee71700 100644 (file)
@@ -529,7 +529,7 @@ and type_of_aux' metasenv context t ugraph =
                                    in
                                     candidate_oty,ugraph,metasenv,subst
                                  with
-                                    Failure _
+                                    CicSubstitution.DeliftingWouldCaptureAFreeVariable
                                   | CicUnification.UnificationFailure _
                                   | CicUnification.Uncertain _ ->
                                      None,ugraph,metasenv,subst
@@ -549,7 +549,7 @@ and type_of_aux' metasenv context t ugraph =
                            Some
                             (add_lambdas 0 t arity_instantiated_with_left_args),
                            ugraph,metasenv,subst
-                     with Failure s -> 
+                     with CicSubstitution.DeliftingWouldCaptureAFreeVariable -> 
                        None,ugraph4,metasenv,subst
                in
                match candidate with