aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorMaxime Dénès2018-03-05 13:15:15 +0100
committerMaxime Dénès2018-03-05 13:15:15 +0100
commit736e86e06b5831a0dd4b6a655708b4ffd2b4ee64 (patch)
treef1f572e011f0e5e476256d58517258774bdf149e /engine
parenta46a04577e34c69b42c2728ec1e0babb5be23e31 (diff)
parent7267e31fa4456aee62a1e39dfdb7e38a8832f93f (diff)
Merge PR #6700: [ssr] rewrite Ssripats and Ssrview in the tactic monad
Diffstat (limited to 'engine')
-rw-r--r--engine/proofview.ml7
-rw-r--r--engine/proofview.mli6
2 files changed, 10 insertions, 3 deletions
diff --git a/engine/proofview.ml b/engine/proofview.ml
index 77a884121e..0924b7a028 100644
--- a/engine/proofview.ml
+++ b/engine/proofview.ml
@@ -1067,6 +1067,9 @@ module Goal = struct
}
let assume (gl : t) = (gl : t)
+
+ let print { sigma; self } = { Evd.it = self; sigma }
+
let state { state=state } = state
let env {env} = env
@@ -1199,7 +1202,7 @@ let tclCHECKINTERRUPT =
module V82 = struct
type tac = Evar.t Evd.sigma -> Evar.t list Evd.sigma
- let tactic tac =
+ let tactic ?(nf_evars=true) tac =
(* spiwack: we ignore the dependencies between goals here,
expectingly preserving the semantics of <= 8.2 tactics *)
(* spiwack: convenience notations, waiting for ocaml 3.12 *)
@@ -1218,7 +1221,7 @@ module V82 = struct
let (initgoals_w_state, initevd) =
Evd.Monad.List.map (fun g_w_s s ->
let g, w = drop_state g_w_s, get_state g_w_s in
- let g, s = goal_nf_evar s g in
+ let g, s = if nf_evars then goal_nf_evar s g else g, s in
goal_with_state g w, s) ps.comb ps.solution
in
let (goalss,evd) = Evd.Monad.List.map tac initgoals_w_state initevd in
diff --git a/engine/proofview.mli b/engine/proofview.mli
index 77f30746d8..d2a54e238c 100644
--- a/engine/proofview.mli
+++ b/engine/proofview.mli
@@ -513,6 +513,7 @@ module Goal : sig
(** Compatibility: avoid if possible *)
val goal : t -> Evar.t
+ val print : t -> Goal.goal Evd.sigma
end
@@ -549,7 +550,10 @@ val tclLIFT : 'a NonLogical.t -> 'a tactic
(*** Compatibility layer with <= 8.2 tactics ***)
module V82 : sig
type tac = Evar.t Evd.sigma -> Evar.t list Evd.sigma
- val tactic : tac -> unit tactic
+
+ (* [nf_evars=true] applies the evar (assignment) map to the goals
+ * (conclusion and context) before calling the tactic *)
+ val tactic : ?nf_evars:bool -> tac -> unit tactic
(* normalises the evars in the goals, and stores the result in
solution. *)