Skip to content

Commit db7a93e

Browse files
committed
Do not call recursively self on subterm strategy.
I do not know why this was done this way, in practice it probably does not matter insofar as virtually all calls to subterm are wrapped in a fixpoint.
1 parent 7c2fbfc commit db7a93e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: tactics/rewrite.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ let unfold_match env sigma sk app =
983983
let is_rew_cast = function RewCast _ -> true | _ -> false
984984

985985
let subterm all flags (s : 'a pure_strategy) : 'a pure_strategy =
986-
let rec aux { state ; env ; unfresh ;
986+
let aux { state ; env ; unfresh ;
987987
term1 = t ; ty1 = ty ; cstr = (prop, cstr) ; evars } =
988988
let cstr' = Option.map (fun c -> (ty, Some c)) cstr in
989989
match EConstr.kind (goalevars evars) t with
@@ -1091,7 +1091,7 @@ let subterm all flags (s : 'a pure_strategy) : 'a pure_strategy =
10911091
else TypeGlobal.arrow_morphism
10921092
in
10931093
let (evars', mor), unfold = arr env evars n.binder_name tx tb x b in
1094-
let state, res = aux { state ; env ; unfresh ;
1094+
let state, res = s.strategy { state ; env ; unfresh ;
10951095
term1 = mor ; ty1 = ty ;
10961096
cstr = (prop,cstr) ; evars = evars' } in
10971097
let res =
@@ -1109,7 +1109,7 @@ let subterm all flags (s : 'a pure_strategy) : 'a pure_strategy =
11091109
let forall = if prop then PropGlobal.rocq_forall else TypeGlobal.rocq_forall in
11101110
(app_poly_sort prop env evars forall [| dom; lam |]), TypeGlobal.unfold_forall
11111111
in
1112-
let state, res = aux { state ; env ; unfresh ;
1112+
let state, res = s.strategy { state ; env ; unfresh ;
11131113
term1 = app ; ty1 = ty ;
11141114
cstr = (prop,cstr) ; evars = evars' } in
11151115
let res =
@@ -1205,7 +1205,7 @@ let subterm all flags (s : 'a pure_strategy) : 'a pure_strategy =
12051205
match try Some (fold_match env (goalevars evars) t) with Not_found -> None with
12061206
| None -> state, c'
12071207
| Some (cst, t') ->
1208-
let state, res = aux { state ; env ; unfresh ;
1208+
let state, res = s.strategy { state ; env ; unfresh ;
12091209
term1 = t' ; ty1 = ty ;
12101210
cstr = (prop,cstr) ; evars } in
12111211
let res =

0 commit comments

Comments
 (0)