X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Ftactics%2FequalityTactics.ml;h=a663282207c6057ae94cf4fdf4e7360bc74ba58f;hb=e7e2a523299d807370b292b44e77f46fad1638c9;hp=8cb794ff6e17e918eefd4f0696276a41fc806822;hpb=bac72fcaa876137ab7a5630e0c1badc2a627dce8;p=helm.git diff --git a/helm/ocaml/tactics/equalityTactics.ml b/helm/ocaml/tactics/equalityTactics.ml index 8cb794ff6..a66328220 100644 --- a/helm/ocaml/tactics/equalityTactics.ml +++ b/helm/ocaml/tactics/equalityTactics.ml @@ -159,22 +159,31 @@ let replace_tac ~what ~with_what ~status:((proof, goal) as status) = let wty = CicTypeChecker.type_of_aux' metasenv context what in try if (wty = (CicTypeChecker.type_of_aux' metasenv context with_what)) - then T.thens - ~start:( - P.cut_tac - (C.Appl [ - (C.MutInd ((U.uri_of_string "cic:/Coq/Init/Logic/eq.ind"), 0, [])) ; (* quale uguaglianza usare, eq o eqT ? *) - wty ; - what ; - with_what])) - ~continuations:[ - T.then_ - ~start:(rewrite_back_tac ~term:(C.Rel 1)) - ~continuation:( - ProofEngineStructuralRules.clear - ~hyp:(List.hd context)) ; - T.id_tac] - ~status + then + let equality = + match CicTypeChecker.type_of_aux' metasenv context wty with + C.Sort C.Set -> "cic:/Coq/Init/Logic/eq.ind" + | C.Sort C.Type + | C.Sort C.CProp + | C.Sort C.Prop -> "cic:/Coq/Init/Logic_Type/eqT.ind" + | _ -> assert false + in + T.thens + ~start:( + P.cut_tac + (C.Appl [ + (C.MutInd ((U.uri_of_string equality), 0, [])) ; + wty ; + what ; + with_what])) + ~continuations:[ + T.then_ + ~start:(rewrite_simpl_tac ~term:(C.Rel 1)) + ~continuation:( + ProofEngineStructuralRules.clear + ~hyp:(List.hd context)) ; + T.id_tac] + ~status else raise (ProofEngineTypes.Fail "Replace: terms not replaceable") with (Failure "hd") -> raise (ProofEngineTypes.Fail "Replace: empty context") ;;