chore: improve eqvTypes
This commit is contained in:
parent
43fe67c41a
commit
cf313d2101
3 changed files with 5 additions and 1 deletions
|
|
@ -416,6 +416,9 @@ We have that `List Nat` and `List ◾` are compatible types, but they are not eq
|
|||
partial def eqvTypes (a b : Expr) : Bool :=
|
||||
if a == b then
|
||||
true
|
||||
else if a.isErased && b.isErased then
|
||||
-- `◾ α` is equivalent to `◾`
|
||||
true
|
||||
else
|
||||
let a' := a.headBeta
|
||||
let b' := b.headBeta
|
||||
|
|
|
|||
|
|
@ -113,5 +113,6 @@ builtin_initialize
|
|||
|
||||
builtin_initialize
|
||||
registerTraceClass `Compiler.saveBase (inherited := true)
|
||||
registerTraceClass `Compiler.trace (inherited := true)
|
||||
|
||||
end Lean.Compiler.LCNF
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ partial def inlineProjInst? (e : Expr) (expectedType : Expr) : SimpM (Option (Ar
|
|||
let (fvarId?, decls) ← visit s [i] |>.run |>.run #[]
|
||||
if let some fvarId := fvarId? then
|
||||
let type ← getType fvarId
|
||||
if type.isErased || eqvTypes expectedType type then
|
||||
if expectedType.isErased || type.isErased || eqvTypes expectedType type then
|
||||
return some (decls, fvarId)
|
||||
else
|
||||
let cast ← mkLcCast (.fvar fvarId) expectedType
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue