| 1 |
(************************************************************************) |
| 2 |
(* * The Rocq Prover / The Rocq Development Team *) |
| 3 |
(* v * Copyright INRIA, CNRS and contributors *) |
| 4 |
(* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 |
(* \VV/ **************************************************************) |
| 6 |
(* // * This file is distributed under the terms of the *) |
| 7 |
(* * GNU Lesser General Public License Version 2.1 *) |
| 8 |
(* * (see LICENSE file for the text of the license) *) |
| 9 |
(************************************************************************) |
| 10 |
|
| 11 |
Require Import Ltac2.Init. |
| 12 |
|
| 13 |
Ltac2 Type t := constructor. |
| 14 |
|
| 15 |
Ltac2 @ external equal : t -> t -> bool := "rocq-runtime.plugins.ltac2" "constructor_equal". |
| 16 |
(** Constructors obtained through module aliases or Include are not |
| 17 |
considered equal by this function. *) |
| 18 |
|
| 19 |
Ltac2 @ external inductive : t -> inductive := "rocq-runtime.plugins.ltac2" "constructor_inductive". |
| 20 |
(** Returns the inductive to which the given constructor belongs. *) |
| 21 |
|
| 22 |
Ltac2 @ external index : t -> int := "rocq-runtime.plugins.ltac2" "constructor_index". |
| 23 |
(** Returns the index of the given constructor |
| 24 |
(such that [c] is [Ind.get_constructor (Ind.data (inductive c)) (index c)]). *) |
| 25 |
|
| 26 |
Ltac2 @external print : t -> message |
| 27 |
:= "rocq-runtime.plugins.ltac2" "constructor_print". |
| 28 |
(** Print the constructor using the shortest qualified identifier which refers to it. |
| 29 |
Does not avoid variable names in the current or global environment. *) |