]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gTopLevel/proofEngine.ml
Bug fixed: reduction in the scratch window now works even if there is no
[helm.git] / helm / gTopLevel / proofEngine.ml
index 90d18998111695f18578ddc6ae031f27c89876e0..8f5d0c96e9ef749811d7370a33fc3be52984811c 100644 (file)
@@ -574,10 +574,31 @@ let reduction_tactic reduction_function term =
       goal := Some (metano,(context',ty'))
 ;;
 
+let reduction_tactic_in_scratch reduction_function ty term =
+ let metasenv =
+  match !proof with
+     None -> []
+   | Some (_,metasenv,_,_) -> metasenv
+ in
+ let context =
+  match !goal with
+     None -> []
+   | Some (_,(context,_)) -> context
+ in
+  let term' = reduction_function term in
+   ProofEngineReduction.replace ~what:term ~with_what:term' ~where:ty
+;;
+
 let whd    = reduction_tactic CicReduction.whd;;
 let reduce = reduction_tactic ProofEngineReduction.reduce;;
 let simpl  = reduction_tactic ProofEngineReduction.simpl;;
 
+let whd_in_scratch    = reduction_tactic_in_scratch CicReduction.whd;;
+let reduce_in_scratch =
+ reduction_tactic_in_scratch ProofEngineReduction.reduce;;
+let simpl_in_scratch  =
+ reduction_tactic_in_scratch ProofEngineReduction.simpl;;
+
 (* It is just the opposite of whd. The code should probably be merged. *)
 let fold term =
  let curi,metasenv,pbo,pty =