Commit graph

10 commits

Author SHA1 Message Date
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
Daniel Fabian
b7ecc1acc3 refactor: Make the non-below version of a premise in the below type for inductive predicates implicit.
Since it is always fully implied by the below version thereof, it carries no real information and shouldn't be used in pattern matching.
2021-06-06 06:40:09 -07:00
Daniel Fabian
822c551aa2 test: Add a bunch of test for structural recursion on predicates. 2021-06-06 06:40:09 -07:00
Daniel Fabian
c426a816a1 refactor: Make the non-below version of a premise in the below type for inductive predicates implicit.
Since it is always fully implied by the below version thereof, it carries no real information and shouldn't be used in pattern matching.
2021-05-22 18:09:32 -07:00
Daniel Fabian
ab0ef229ac feat: add getBelowIndices. 2021-05-19 07:28:14 -07:00
Leonardo de Moura
56d5d6c564 chore: fix tests 2021-05-04 15:42:03 -07:00
Daniel Fabian
1f05f5bf11 chore: rename ProofBelow to below. 2021-04-26 20:33:21 +02:00
Daniel Fabian
eda4bdd337 test: extend inductive_pred.lean with tests using the new construction. 2021-04-25 20:02:22 -07:00
Leonardo de Moura
964fd3f520 chore: fixes tests
closes #405
2021-04-22 20:22:43 -07:00
Leonardo de Moura
f631bd8df9 test: inductive predicate example 2021-04-02 16:21:54 -07:00