X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_proof_checking%2FcicSubstitution.ml;h=a7124d4a3186d6512014c0f37a6e695e884401c1;hb=a4f6e8b443d8a676bd2bfbf7f29369e070298aa0;hp=c718524fc3b6d3e099a1eb64f45f7d6838fa51db;hpb=a0b3f70f4dee78cc07baf2e78673b8b7cf573995;p=helm.git diff --git a/helm/ocaml/cic_proof_checking/cicSubstitution.ml b/helm/ocaml/cic_proof_checking/cicSubstitution.ml index c718524fc..a7124d4a3 100644 --- a/helm/ocaml/cic_proof_checking/cicSubstitution.ml +++ b/helm/ocaml/cic_proof_checking/cicSubstitution.ml @@ -30,7 +30,7 @@ exception ReferenceToConstant;; exception ReferenceToCurrentProof;; exception ReferenceToInductiveDefinition;; -let lift n = +let lift_from k n = let rec liftaux k = let module C = Cic in function @@ -95,10 +95,13 @@ let lift n = in C.CoFix (i, liftedfl) in + liftaux k + +let lift n t = if n = 0 then - (function t -> t) + t else - liftaux 1 + lift_from 1 n t ;; let subst arg = @@ -202,7 +205,7 @@ prerr_endline ("@@@POSSIBLE BUG: SUBSTITUTION IS NOT SIMULTANEOUS") ; with Not_found -> let params = - let obj = CicEnvironment.get_obj uri in + let obj,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in (match obj with C.Constant _ -> raise ReferenceToConstant | C.Variable (_,_,_,params) -> params @@ -251,7 +254,7 @@ prerr_endline "---- END\n\n " ; | C.Appl _ -> assert false | C.Const (uri,exp_named_subst') -> let params = - let obj = CicEnvironment.get_obj uri in + let obj,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in (match obj with C.Constant (_,_,_,params) -> params | C.Variable _ -> raise ReferenceToVariable @@ -265,7 +268,7 @@ prerr_endline "---- END\n\n " ; C.Const (uri,exp_named_subst'') | C.MutInd (uri,typeno,exp_named_subst') -> let params = - let obj = CicEnvironment.get_obj uri in + let obj,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in (match obj with C.Constant _ -> raise ReferenceToConstant | C.Variable _ -> raise ReferenceToVariable @@ -279,7 +282,7 @@ prerr_endline "---- END\n\n " ; C.MutInd (uri,typeno,exp_named_subst'') | C.MutConstruct (uri,typeno,consno,exp_named_subst') -> let params = - let obj = CicEnvironment.get_obj uri in + let obj,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in (match obj with C.Constant _ -> raise ReferenceToConstant | C.Variable _ -> raise ReferenceToVariable