feat(api): add lean_get_recursor_name

This commit is contained in:
Leonardo de Moura 2015-08-24 14:22:36 -07:00
parent 1299e6ab24
commit 0fb52a9a13
2 changed files with 10 additions and 0 deletions

View file

@ -29,6 +29,13 @@ void lean_inductive_type_del(lean_inductive_type t) {
delete to_inductive_type(t);
}
lean_bool lean_get_recursor_name(lean_name n, lean_name * r, lean_exception * ex) {
LEAN_TRY;
check_nonnull(n);
*r = of_name(new name(get_elim_name(to_name_ref(n))));
LEAN_CATCH;
}
lean_bool lean_inductive_type_get_name(lean_inductive_type t, lean_name * r, lean_exception * ex) {
LEAN_TRY;
check_nonnull(t);

View file

@ -31,6 +31,9 @@ lean_bool lean_inductive_type_mk(lean_name n, lean_expr t, lean_list_expr cs, le
/** \brief Dispose/delete the given inductive type */
void lean_inductive_type_del(lean_inductive_type t);
/** \brief Return the name of the recursor (aka eliminator) associated with an inductive type name \c n */
lean_bool lean_get_recursor_name(lean_name n, lean_name * r, lean_exception * ex);
/** \brief Store in \c r the name of the given inductive type. */
lean_bool lean_inductive_type_get_name(lean_inductive_type t, lean_name * r, lean_exception * ex);
/** \brief Store in \c r the type of the given inductive type. */