lean4-htt/tests/lean/run/coeSort1.lean
Leonardo de Moura 812c47d463 feat: simplify CoeFun and CoeSort
The main issue is nontermination for problems that do not have
solution. When using dependent coercions, we keep creating goals of
the form `CoeSort ... (coe (coe (coe ...))) ...`. Same for `CoeFun`.
I am considering simplifying it even further, and making sure
`CoeDep` can be used at most once in a sequence of coercions `CoeTC`.

Another option is to use a very small amount of fuel to
guarantee termination when solving coercion TC problems.

cc @Kha @dselsam
2020-01-29 21:56:26 -08:00

15 lines
285 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

new_frontend
universes u
def Below (n : Nat) : Nat → Prop :=
(· < n)
def f {n : Nat} (v : Subtype (Below n)) : Nat :=
v + 1
instance pred2subtype {α : Type u} : CoeSort (α → Prop) (Type u) :=
CoeSort.mk (fun p => Subtype p)
def g {n : Nat} (v : Below n) : Nat :=
v.val + 1