feat(kernel/formatter): adjust simple formatter to the new convention for displaying universe levels
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
d4922daedf
commit
b18263a014
3 changed files with 9 additions and 2 deletions
|
@ -40,9 +40,11 @@ struct print_expr_fn {
|
|||
|
||||
void print_sort(expr const & a) {
|
||||
if (is_zero(sort_level(a))) {
|
||||
out () << "Bool";
|
||||
out() << "Bool";
|
||||
} else if (is_one(sort_level(a))) {
|
||||
out() << "Type";
|
||||
} else {
|
||||
out() << "(Type " << sort_level(a) << ")";
|
||||
out() << "Type.{" << sort_level(a) << "}";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -248,6 +248,10 @@ level const & mk_level_one() {
|
|||
return g_one;
|
||||
}
|
||||
|
||||
bool is_one(level const & l) {
|
||||
return l == mk_level_one();
|
||||
}
|
||||
|
||||
level::level():level(mk_level_zero()) {}
|
||||
level::level(level_cell * ptr):m_ptr(ptr) { if (m_ptr) m_ptr->inc_ref(); }
|
||||
level::level(level const & s):m_ptr(s.m_ptr) { if (m_ptr) m_ptr->inc_ref(); }
|
||||
|
|
|
@ -95,6 +95,7 @@ inline bool is_meta(level const & l) { return kind(l) == level_kind::Meta; }
|
|||
inline bool is_succ(level const & l) { return kind(l) == level_kind::Succ; }
|
||||
inline bool is_max(level const & l) { return kind(l) == level_kind::Max; }
|
||||
inline bool is_imax(level const & l) { return kind(l) == level_kind::IMax; }
|
||||
bool is_one(level const & l);
|
||||
|
||||
unsigned get_depth(level const & l);
|
||||
|
||||
|
|
Loading…
Reference in a new issue