Skip to content

Commit 0aaf7da

Browse files
committed
Add source location for Derive Inversion
1 parent 742ed9c commit 0aaf7da

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

doc/tools/docgram/common.edit_mlg

+6-6
Original file line numberDiff line numberDiff line change
@@ -1293,12 +1293,12 @@ command: [
12931293
| REPLACE "Debug" "Off"
12941294
| WITH "Debug" [ "On" | "Off" ]
12951295
| EDIT "Defined" ADD_OPT identref
1296-
| REPLACE "Derive" "Inversion" ident "with" constr "Sort" sort_family
1297-
| WITH "Derive" "Inversion" ident "with" constr OPT ( "Sort" sort_family )
1298-
| DELETE "Derive" "Inversion" ident "with" constr
1299-
| REPLACE "Derive" "Inversion_clear" ident "with" constr "Sort" sort_family
1300-
| WITH "Derive" "Inversion_clear" ident "with" constr OPT ( "Sort" sort_family )
1301-
| DELETE "Derive" "Inversion_clear" ident "with" constr
1296+
| REPLACE "Derive" "Inversion" identref "with" constr "Sort" sort_family
1297+
| WITH "Derive" "Inversion" identref "with" constr OPT ( "Sort" sort_family )
1298+
| DELETE "Derive" "Inversion" identref "with" constr
1299+
| REPLACE "Derive" "Inversion_clear" identref "with" constr "Sort" sort_family
1300+
| WITH "Derive" "Inversion_clear" identref "with" constr OPT ( "Sort" sort_family )
1301+
| DELETE "Derive" "Inversion_clear" identref "with" constr
13021302
| EDIT "Focus" ADD_OPT natural
13031303
| DELETE "Hint" "Rewrite" orient LIST1 constr ":" LIST1 preident
13041304
| REPLACE "Hint" "Rewrite" orient LIST1 constr "using" tactic ":" LIST1 preident

doc/tools/docgram/fullGrammar

+6-6
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,12 @@ command: [
599599
| "Hint" "Rewrite" orient LIST1 constr "using" tactic ":" LIST1 preident
600600
| "Hint" "Rewrite" orient LIST1 constr
601601
| "Hint" "Rewrite" orient LIST1 constr "using" tactic
602-
| "Derive" "Inversion_clear" ident "with" constr "Sort" sort_family
603-
| "Derive" "Inversion_clear" ident "with" constr
604-
| "Derive" "Inversion" ident "with" constr "Sort" sort_family
605-
| "Derive" "Inversion" ident "with" constr
606-
| "Derive" "Dependent" "Inversion" ident "with" constr "Sort" sort_family
607-
| "Derive" "Dependent" "Inversion_clear" ident "with" constr "Sort" sort_family
602+
| "Derive" "Inversion_clear" identref "with" constr "Sort" sort_family
603+
| "Derive" "Inversion_clear" identref "with" constr
604+
| "Derive" "Inversion" identref "with" constr "Sort" sort_family
605+
| "Derive" "Inversion" identref "with" constr
606+
| "Derive" "Dependent" "Inversion" identref "with" constr "Sort" sort_family
607+
| "Derive" "Dependent" "Inversion_clear" identref "with" constr "Sort" sort_family
608608
| "Declare" "Left" "Step" constr
609609
| "Declare" "Right" "Step" constr
610610
| "Unshelve"

plugins/ltac/extratactics.mlg

+7-7
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ END
292292
open Inv
293293
open Leminv
294294

295-
let seff id = VtSideff ([id], VtLater)
295+
let seff id = VtSideff ([id.CAst.v], VtLater)
296296

297297
}
298298

@@ -303,36 +303,36 @@ let seff id = VtSideff ([id], VtLater)
303303
END*)
304304

305305
VERNAC COMMAND EXTEND DeriveInversionClear
306-
| #[ polymorphic; ] [ "Derive" "Inversion_clear" ident(na) "with" constr(c) "Sort" sort_family(s) ]
306+
| #[ polymorphic; ] [ "Derive" "Inversion_clear" identref(na) "with" constr(c) "Sort" sort_family(s) ]
307307
=> { seff na }
308308
-> {
309309
add_inversion_lemma_exn ~poly:polymorphic na c s false inv_clear_tac }
310310

311-
| #[ polymorphic; ] [ "Derive" "Inversion_clear" ident(na) "with" constr(c) ] => { seff na }
311+
| #[ polymorphic; ] [ "Derive" "Inversion_clear" identref(na) "with" constr(c) ] => { seff na }
312312
-> {
313313
add_inversion_lemma_exn ~poly:polymorphic na c Sorts.InProp false inv_clear_tac }
314314
END
315315

316316
VERNAC COMMAND EXTEND DeriveInversion
317-
| #[ polymorphic; ] [ "Derive" "Inversion" ident(na) "with" constr(c) "Sort" sort_family(s) ]
317+
| #[ polymorphic; ] [ "Derive" "Inversion" identref(na) "with" constr(c) "Sort" sort_family(s) ]
318318
=> { seff na }
319319
-> {
320320
add_inversion_lemma_exn ~poly:polymorphic na c s false inv_tac }
321321

322-
| #[ polymorphic; ] [ "Derive" "Inversion" ident(na) "with" constr(c) ] => { seff na }
322+
| #[ polymorphic; ] [ "Derive" "Inversion" identref(na) "with" constr(c) ] => { seff na }
323323
-> {
324324
add_inversion_lemma_exn ~poly:polymorphic na c Sorts.InProp false inv_tac }
325325
END
326326

327327
VERNAC COMMAND EXTEND DeriveDependentInversion
328-
| #[ polymorphic; ] [ "Derive" "Dependent" "Inversion" ident(na) "with" constr(c) "Sort" sort_family(s) ]
328+
| #[ polymorphic; ] [ "Derive" "Dependent" "Inversion" identref(na) "with" constr(c) "Sort" sort_family(s) ]
329329
=> { seff na }
330330
-> {
331331
add_inversion_lemma_exn ~poly:polymorphic na c s true dinv_tac }
332332
END
333333

334334
VERNAC COMMAND EXTEND DeriveDependentInversionClear
335-
| #[ polymorphic; ] [ "Derive" "Dependent" "Inversion_clear" ident(na) "with" constr(c) "Sort" sort_family(s) ]
335+
| #[ polymorphic; ] [ "Derive" "Dependent" "Inversion_clear" identref(na) "with" constr(c) "Sort" sort_family(s) ]
336336
=> { seff na }
337337
-> {
338338
add_inversion_lemma_exn ~poly:polymorphic na c s true dinv_clear_tac }

plugins/ltac/leminv.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ let inversion_scheme ~name ~poly env sigma t sort dep_option inv_op =
229229
let invProof = it_mkNamedLambda_or_LetIn sigma c !ownSign in
230230
invProof, sigma
231231

232-
let add_inversion_lemma ~poly name env sigma t sort dep inv_op =
233-
let invProof, sigma = inversion_scheme ~name ~poly env sigma t sort dep inv_op in
234-
let cinfo = Declare.CInfo.make ~name ~typ:None () in
232+
let add_inversion_lemma ~poly (name:lident) env sigma t sort dep inv_op =
233+
let invProof, sigma = inversion_scheme ~name:name.v ~poly env sigma t sort dep inv_op in
234+
let cinfo = Declare.CInfo.make ?loc:name.loc ~name:name.v ~typ:None () in
235235
let info = Declare.Info.make ~poly ~kind:Decls.(IsProof Lemma) () in
236236
let _ : Names.GlobRef.t =
237237
Declare.declare_definition ~cinfo ~info ~opaque:false ~body:invProof sigma

plugins/ltac/leminv.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ val lemInv_clause :
1717
quantified_hypothesis -> constr -> Id.t list -> unit Proofview.tactic
1818

1919
val add_inversion_lemma_exn : poly:bool ->
20-
Id.t -> constr_expr -> Sorts.family -> bool -> (Id.t -> unit Proofview.tactic) ->
20+
lident -> constr_expr -> Sorts.family -> bool -> (Id.t -> unit Proofview.tactic) ->
2121
unit

0 commit comments

Comments
 (0)