@@ -1331,6 +1331,40 @@ let coq_header_builtins =
1331
1331
|} ;
1332
1332
]
1333
1333
1334
+ [%%if coq = " 8.19" || coq = " 8.20" ]
1335
+ let compat_reduction_behavior_set ~local gref strategy =
1336
+ Reductionops.ReductionBehaviour. set ~local gref strategy
1337
+ [%% else ]
1338
+ let compat_reduction_behavior_set ~local gref strategy =
1339
+ Reductionops.ReductionBehaviour. set ~local gref (Some strategy)
1340
+ [%% endif]
1341
+
1342
+ [%% if coq = " 8.19" || coq = " 8.20" ]
1343
+ let compat_reset_simplification = []
1344
+ [%% else ]
1345
+ let compat_reset_simplification =
1346
+ let open API.BuiltIn in
1347
+ let open Pred in
1348
+ let open Notation in
1349
+ let open CConv in
1350
+ let pp ~depth = P. term depth in
1351
+ [MLCode (Pred (" coq.arguments.reset-simplification" ,
1352
+ In (gref," GR" ,
1353
+ Full (global,
1354
+ {| resets the behavior of the simplification tactics.
1355
+ Also resets the ! and / modifiers for the Arguments command.
1356
+ Supported attributes:
1357
+ - @ global! (default: false )| })),
1358
+ (fun gref ~depth { options } _ -> grab_global_env " coq.arguments.reset-simplification" (fun state ->
1359
+ match gref with
1360
+ | ConstRef gref ->
1361
+ let local = options.local <> Some false in
1362
+ Reductionops.ReductionBehaviour. set ~local gref None ;
1363
+ state, () , []
1364
+ | _ -> err Pp. (str " reset-simplification must be called on constant" )))),
1365
+ DocAbove )]
1366
+ [%% endif]
1367
+
1334
1368
let coq_misc_builtins =
1335
1369
let open API.BuiltIn in
1336
1370
let open Pred in
@@ -3083,10 +3117,12 @@ Supported attributes:
3083
3117
match gref with
3084
3118
| ConstRef gref ->
3085
3119
let local = options.local <> Some false in
3086
- Reductionops.ReductionBehaviour.set ~local gref strategy;
3120
+ compat_reduction_behavior_set ~local gref strategy;
3087
3121
state, (), []
3088
3122
| _ -> err Pp.(str " set -simplification must be called on constant ")))),
3089
- DocAbove);
3123
+ DocAbove)
3124
+
3125
+ ] @ compat_reset_simplification @ [
3090
3126
3091
3127
MLCode(Pred(" coq .locate -abbreviation ",
3092
3128
In(id, " Name",
0 commit comments