fix(kernel/level): is_geq predicate

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-07-09 20:41:41 -07:00
parent 0ec6fa02de
commit 12d89ea0b9
2 changed files with 22 additions and 2 deletions

View file

@ -673,10 +673,10 @@ bool is_geq_core(level l1, level l2) {
return true; return true;
if (is_max(l2)) if (is_max(l2))
return is_geq(l1, max_lhs(l2)) && is_geq(l1, max_rhs(l2)); return is_geq(l1, max_lhs(l2)) && is_geq(l1, max_rhs(l2));
if (is_max(l1) && (is_geq(max_lhs(l1), l2) || is_geq(max_rhs(l1), l2)))
return true;
if (is_imax(l2)) if (is_imax(l2))
return is_geq(l1, imax_lhs(l2)) && is_geq(l1, imax_rhs(l2)); return is_geq(l1, imax_lhs(l2)) && is_geq(l1, imax_rhs(l2));
if (is_max(l1))
return is_geq(max_lhs(l1), l2) || is_geq(max_rhs(l1), l2);
if (is_imax(l1)) if (is_imax(l1))
return is_geq(imax_rhs(l1), l2); return is_geq(imax_rhs(l1), l2);
auto p1 = to_offset(l1); auto p1 = to_offset(l1);

20
tests/lean/run/coe2.lean Normal file
View file

@ -0,0 +1,20 @@
import standard
namespace setoid
inductive setoid : Type :=
| mk_setoid: Π (A : Type), (A → A → Bool) → setoid
definition carrier (s : setoid)
:= setoid_rec (λ a eq, a) s
definition eqv {s : setoid} : carrier s → carrier s → Bool
:= setoid_rec (λ a eqv, eqv) s
infix `≈`:50 := eqv
coercion carrier
inductive morphism (s1 s2 : setoid) : Type :=
| mk_morphism : Π (f : s1 → s2), (∀ x y, x ≈ y → f x ≈ f y) → morphism s1 s2
end