feat(kernel/type_checker): expose get_arity function
This commit is contained in:
parent
c43b2c8640
commit
c51e2ac428
2 changed files with 3 additions and 1 deletions
|
@ -30,7 +30,7 @@ expr replace_range(expr const & type, expr const & new_range) {
|
|||
}
|
||||
|
||||
/** \brief Return the "arity" of the given type. The arity is the number of nested pi-expressions. */
|
||||
static unsigned get_arity(expr type) {
|
||||
unsigned get_arity(expr type) {
|
||||
unsigned r = 0;
|
||||
while (is_pi(type)) {
|
||||
type = binding_body(type);
|
||||
|
|
|
@ -18,6 +18,8 @@ Author: Leonardo de Moura
|
|||
#include "kernel/expr_maps.h"
|
||||
|
||||
namespace lean {
|
||||
/** \brief Return the "arity" of the given type. The arity is the number of nested pi-expressions. */
|
||||
unsigned get_arity(expr type);
|
||||
|
||||
inline pair<expr, constraint_seq> to_ecs(expr const & e) { return mk_pair(e, empty_cs()); }
|
||||
inline pair<expr, constraint_seq> to_ecs(expr const & e, constraint const & c, constraint_seq const & cs) {
|
||||
|
|
Loading…
Reference in a new issue