@@ -309,23 +309,21 @@ and declare_module ?(continuation = ignore) ?name arity mb =
309
309
let command_variable ?(continuation = default_continuation) arity variable names =
310
310
error (Pp. str " Cannot translate an axiom nor a variable. Please use the 'Parametricity Realizer' command." )
311
311
312
- let translateFullName ~fullname arity (constant : Names.constant ) : string =
312
+ let translateFullName ~fullname arity (kername : Names.KerName.t ) : string =
313
313
let nstr =
314
314
(translate_string arity
315
315
@@ Names.Label. to_string
316
- @@ Names.Constant . label
317
- @@ constant) in
316
+ @@ Names.KerName . label
317
+ @@ kername) in
318
318
let pstr =
319
319
(Names.ModPath. to_string
320
320
@@ Names. modpath
321
- @@ Names. canonical_con
322
- @@ constant) in
321
+ @@ kername) in
323
322
let plstr = Str. split (Str. regexp (" \. " )) pstr in
324
323
if fullname then
325
324
(String. concat " _o_" (plstr@ [nstr]))
326
325
else nstr
327
326
328
-
329
327
let command_constant ?(continuation = default_continuation) ~fullname arity constant names =
330
328
let poly, opaque =
331
329
let cb = Global. lookup_constant constant in
@@ -337,7 +335,10 @@ let command_constant ?(continuation = default_continuation) ~fullname arity cons
337
335
(match cb.const_body with Def _ -> false | _ -> true )
338
336
in
339
337
let name = match names with
340
- | None -> Names. id_of_string (translateFullName ~fullname arity constant)
338
+ | None -> Names. id_of_string
339
+ @@ translateFullName ~fullname arity
340
+ @@ Names.Constant. canonical
341
+ @@ constant
341
342
| Some name -> name
342
343
in
343
344
let kind = Decl_kinds. (Global , poly, DefinitionBody Definition ) in
@@ -348,25 +349,23 @@ let command_constant ?(continuation = default_continuation) ~fullname arity cons
348
349
let constr = mkConstU (fst pconst, EInstance. make @@ snd pconst) in
349
350
declare_abstraction ~continuation ~opaque ~kind arity (ref evd) env constr name
350
351
351
- let command_inductive ?(continuation = default_continuation) arity inductive names =
352
+ let command_inductive ?(continuation = default_continuation) ~ fullname arity inductive names =
352
353
let (evd, env) = Lemmas. get_current_context () in
353
354
let evd, pind =
354
355
Evd. (with_context_set univ_rigid evd (Universes. fresh_inductive_instance env inductive))
355
356
in
356
357
let name = match names with
357
358
| None ->
358
359
Names. id_of_string
359
- @@ translate_string arity
360
- @@ Names.Label. to_string
361
- @@ Names.MutInd. label
360
+ @@ translateFullName ~fullname arity
361
+ @@ Names.MutInd. canonical
362
362
@@ fst
363
363
@@ fst
364
364
@@ pind
365
365
| Some name -> name
366
366
in
367
367
declare_inductive name ~continuation arity (ref evd) env pind
368
368
369
-
370
369
let command_constructor ?(continuation = default_continuation) arity gref names =
371
370
let open Pp in
372
371
error ((str " '" )
@@ -382,7 +381,7 @@ let command_reference ?(continuation = default_continuation) ?(fullname = false)
382
381
| ConstRef constant ->
383
382
command_constant ~continuation ~fullname arity constant names
384
383
| IndRef inductive ->
385
- command_inductive ~continuation arity inductive names
384
+ command_inductive ~continuation ~fullname arity inductive names
386
385
| ConstructRef constructor ->
387
386
command_constructor ~continuation arity gref names
388
387
0 commit comments