]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gTopLevel/proofEngine.ml
1. All the reduction tactics have been modified to reduce several (sub)terms
[helm.git] / helm / gTopLevel / proofEngine.ml
index 99e6a081cdeaccb8940fe687eb30ae6bb380ea35..4751cb23f93b725dd15292f6bac8c95c5711375a 100644 (file)
@@ -116,7 +116,7 @@ let perforate context term ty =
         let irl = identity_relocation_list_for_metavariable context in
 (*CSC: Bug: se ci sono due term uguali nella prova dovrei bucarne uno solo!!!*)
         let bo' =
-         ProofEngineReduction.replace (==) term (C.Meta (newmeta,irl)) bo
+         ProofEngineReduction.replace (==) [term] [C.Meta (newmeta,irl)] bo
         in
         (* It may be possible that some metavariables occurred only in *)
         (* the term we are perforating and they now occurs no more. We *)
@@ -137,7 +137,7 @@ let perforate context term ty =
 (************************************************************)
 
 (* Reduces [term] using [reduction_function] in the current scratch goal [ty] *)
-let reduction_tactic_in_scratch reduction_function term ty =
+let reduction_tactic_in_scratch reduction_function terms ty =
  let metasenv =
   match !proof with
      None -> []
@@ -148,9 +148,9 @@ let reduction_tactic_in_scratch reduction_function term ty =
      None -> assert false
    | Some metano -> List.find (function (m,_,_) -> m=metano) metasenv
  in
-  let term' = reduction_function context term in
+  let terms' = List.map (reduction_function context) terms in
    ProofEngineReduction.replace
-    ~equality:(==) ~what:term ~with_what:term' ~where:ty
+    ~equality:(==) ~what:terms ~with_what:terms' ~where:ty
 ;;
 
 let whd_in_scratch    = reduction_tactic_in_scratch CicReduction.whd
@@ -184,15 +184,15 @@ let clear hyp = apply_tactic (ProofEngineStructuralRules.clear ~hyp)
 
   (* reduction tactics *)
 
-let whd term =
+let whd terms =
  apply_tactic
-  (ReductionTactics.whd_tac ~also_in_hypotheses:true ~term:(Some term))
-let reduce term =
+  (ReductionTactics.whd_tac ~also_in_hypotheses:true ~terms:(Some terms))
+let reduce terms =
  apply_tactic
-  (ReductionTactics.reduce_tac ~also_in_hypotheses:true ~term:(Some term))
-let simpl term =
+  (ReductionTactics.reduce_tac ~also_in_hypotheses:true ~terms:(Some terms))
+let simpl terms =
  apply_tactic
-  (ReductionTactics.simpl_tac ~also_in_hypotheses:true ~term:(Some term))
+  (ReductionTactics.simpl_tac ~also_in_hypotheses:true ~terms:(Some terms))
 
 let fold_whd term =
  apply_tactic