From 812e565e94b0e926c48614127d0672c4e04e2ce7 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Fri, 20 Jan 2006 17:59:43 +0000 Subject: [PATCH] Yet another strategy for let...ins: a let-in is _NEVER_ simplified. The user has to use unfold to zeta-expand it. (Thus, a let-in is more opaque than a constant in the environment.) --- helm/matita/tests/simpl.ma | 16 ++-------------- helm/ocaml/tactics/proofEngineReduction.ml | 10 ++-------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/helm/matita/tests/simpl.ma b/helm/matita/tests/simpl.ma index 65e9d48a4..898122869 100644 --- a/helm/matita/tests/simpl.ma +++ b/helm/matita/tests/simpl.ma @@ -23,27 +23,15 @@ alias id "not" = "cic:/Coq/Init/Logic/not.con". alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)". alias id "plus_comm" = "cic:/Coq/Arith/Plus/plus_comm.con". -theorem a : - \forall A:Set. - \forall x,y : A. - not (x = y) \to not(y = x). -intros. -unfold not. (* simplify. *) -intro. apply H. -symmetry. -exact H1. -qed. - theorem t: let f \def \lambda x,y. x y in f (\lambda x.S x) O = S O. - intros. simplify. change in \vdash (? ? (? %) ?) with O. + intros. simplify. change in \vdash (? ? (? ? %) ?) with O. reflexivity. qed. - theorem X: \forall x:nat. let myplus \def plus x in myplus (S O) = S x. intros. simplify. change in \vdash (? ? (% ?) ?) with (plus x). rewrite > plus_comm. reflexivity. qed. - + theorem R: \forall x:nat. let uno \def x + O in S O + uno = 1 + x. intros. simplify. change in \vdash (? ? (? %) ?) with (x + O). diff --git a/helm/ocaml/tactics/proofEngineReduction.ml b/helm/ocaml/tactics/proofEngineReduction.ml index fca06f6f0..0dc4ce4ee 100644 --- a/helm/ocaml/tactics/proofEngineReduction.ml +++ b/helm/ocaml/tactics/proofEngineReduction.ml @@ -603,14 +603,8 @@ let simpl context = let module S = CicSubstitution in function C.Rel n as t -> - (try - match List.nth context (n-1) with - Some (_,C.Decl _) -> if l = [] then t else C.Appl (t::l) - | Some (_,C.Def (bo,_)) -> - try_delta_expansion context l t (S.lift n bo) - | None -> raise RelToHiddenHypothesis - with - Failure _ -> assert false) + (* we never perform delta expansion automatically *) + if l = [] then t else C.Appl (t::l) | C.Var (uri,exp_named_subst) -> let exp_named_subst' = reduceaux_exp_named_subst context l exp_named_subst -- 2.39.2