feat(kernel/type_checker): expose get_arity function

This commit is contained in:
Leonardo de Moura 2015-01-20 14:25:07 -08:00
parent c43b2c8640
commit c51e2ac428
2 changed files with 3 additions and 1 deletions

View file

@ -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);

View file

@ -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) {