From 36488400952da5e12c8af451b1a936a34b26039d Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Wed, 3 Apr 2019 15:39:11 +0200 Subject: [ssr] under: optimization of the tactic for (under eq_bigl => *) so it acts "more naturally" like (under eq_bigl; [hnf|]); move=> [*|]. Also: replace "by over." in the doc example with "over." --- plugins/ssr/ssrfwd.ml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/ssr/ssrfwd.ml b/plugins/ssr/ssrfwd.ml index 313b46ddc3..01d71aa96a 100644 --- a/plugins/ssr/ssrfwd.ml +++ b/plugins/ssr/ssrfwd.ml @@ -331,7 +331,15 @@ let is_app_evar sigma t = | _ -> false end | _ -> false +let rec ncons n e = match n with + | 0 -> [] + | n when n > 0 -> e :: ncons (n - 1) e + | _ -> failwith "ncons" + let intro_lock ipats = + let hnf' = Proofview.numgoals >>= fun ng -> + Proofview.tclDISPATCH + (ncons (ng - 1) ssrsmovetac @ [Proofview.tclUNIT ()]) in let rec lock_eq () : unit Proofview.tactic = Proofview.Goal.enter begin fun _ -> Proofview.tclORELSE (Ssripats.tclIPAT [Ssripats.IOpTemporay; Ssripats.IOpEqGen (lock_eq ())]) @@ -372,7 +380,7 @@ let intro_lock ipats = end) end in - Ssripats.tclIPATssr ipats <*> lock_eq () + hnf' <*> Ssripats.tclIPATssr ipats <*> lock_eq () let pretty_rename evar_map term varnames = let rec aux term vars = @@ -406,11 +414,6 @@ let check_numgoals ?(minus = 0) nh = else Proofview.tclUNIT () -let rec ncons n e = match n with - | 0 -> [] - | n when n > 0 -> e :: ncons (n - 1) e - | _ -> failwith "ncons" - let undertac ?(pad_intro = false) ist ipats ((dir,_),_ as rule) hint = (* total number of implied hints *) -- cgit v1.2.3