Commit graph

9 commits

Author SHA1 Message Date
Leonardo de Moura
dbf5366704 feat: ignore {} annotation at constructors 2022-04-13 08:30:21 -07:00
Leonardo de Moura
4ee131981d feat: in an inductive family the longest fixed prefix of indices is now promoted to parameters
This modification is relevant for fixing regressions on recent changes
to the auto implicit behavior for inductive families.

The following declarations are now accepted:
```lean
inductive HasType : Fin n → Vector Ty n → Ty → Type where
  | stop : HasType 0 (ty :: ctx) ty
  | pop  : HasType k ctx ty → HasType k.succ (u :: ctx) ty

inductive Sublist : List α → List α → Prop
  | slnil : Sublist [] []
  | cons l₁ l₂ a : Sublist l₁ l₂ → Sublist l₁ (a :: l₂)
  | cons2 l₁ l₂ a : Sublist l₁ l₂ → Sublist (a :: l₁) (a :: l₂)

inductive Lst : Type u → Type u
  | nil  : Lst α
  | cons : α → Lst α → Lst α
```

TODO: universe inference for `inductive` should be improved. The
current approach is not good enough when we have auto implicits.

TODO: allow implicit fixed indices that do not depend on indices that
cannot be moved to become parameters.
2022-03-08 17:56:34 -08:00
Leonardo de Moura
764a1d9f51 chore: fix tests 2022-02-14 15:47:12 -08:00
Leonardo de Moura
157ef80c5a feat: match auto generalization 2021-04-16 21:48:38 -07:00
Leonardo de Moura
f11a003526 test: add "discriminant refinement" tests 2021-03-24 19:10:50 -07:00
Leonardo de Moura
db9e390b4d chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
Leonardo de Moura
0be9516bd8 fix: instantiate metavariables in alternative local decls 2020-08-15 08:18:00 -07:00
Leonardo de Moura
7eed45dd45 fix: generalize isNatValueTransition 2020-08-15 07:59:31 -07:00
Leonardo de Moura
5d56cc5505 refactor: DepElim
We go back to the original approach where we pattern matching
alternative variables as `FVar`s.
We fix the original problem we had by implementing a simple
unification procedure for alternative `FVar`s.
2020-08-14 19:03:22 -07:00