X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FgTopLevel%2FproofEngineReduction.ml;h=208864c801f1a2fdeafa99506ade65b46f901f51;hb=a772e377c1ca7c43c3e1e25eb47479fc3c5ceb9e;hp=21f2cbebf72aa68f375e204345dbed3a52b717c0;hpb=6c3502f791a8570c61a5b2fbaf3195f373d805c8;p=helm.git diff --git a/helm/gTopLevel/proofEngineReduction.ml b/helm/gTopLevel/proofEngineReduction.ml index 21f2cbebf..208864c80 100644 --- a/helm/gTopLevel/proofEngineReduction.ml +++ b/helm/gTopLevel/proofEngineReduction.ml @@ -42,6 +42,7 @@ exception ReferenceToVariable;; exception ReferenceToCurrentProof;; exception ReferenceToInductiveDefinition;; exception WrongUriToInductiveDefinition;; +exception WrongUriToConstant;; exception RelToHiddenHypothesis;; let alpha_equivalence = @@ -475,7 +476,7 @@ exception AlreadySimplified;; (*CSC: It does not perform simplification in a Case *) let simpl context = (* reduceaux is equal to the reduceaux locally defined inside *) - (*reduce, but for the const case. *) + (* reduce, but for the const case. *) (**** Step 1 ****) let rec reduceaux context l = let module C = Cic in @@ -583,13 +584,18 @@ let simpl context = aux [] l (CicSubstitution.subst_vars exp_named_subst' body) in (**** Step 3 ****) - let term_to_fold = - match constant_args with - [] -> C.Const (uri,exp_named_subst') - | _ -> C.Appl ((C.Const(uri,exp_named_subst'))::constant_args) + let term_to_fold, delta_expanded_term_to_fold = + let body' = CicSubstitution.subst_vars exp_named_subst' body in + match constant_args with + [] -> C.Const (uri,exp_named_subst'), body' + | _ -> + C.Appl ((C.Const (uri,exp_named_subst'))::constant_args), + C.Appl (body'::constant_args) in - let reduced_term_to_fold = reduce context term_to_fold in - replace (=) reduced_term_to_fold term_to_fold res + let simplified_term_to_fold = + reduceaux context [] delta_expanded_term_to_fold + in + replace (=) simplified_term_to_fold term_to_fold res with WrongShape -> (* The constant does not unfold to a Fix lambda-abstracted *)