Incomplete requirements for nested inductive types
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Ambito
- compilers, documentation
Direzione di ricerca
Inizia con la sezione Nested Inductive Types collegata nell’issue e rivedi l’elenco esistente dei requisiti insieme agli esempi forniti. Controlla lean4#6371 per il vincolo aggiuntivo sulla posizione dei parametri. Il lavoro è completato quando la documentazione copre le due restrizioni mancanti e la condizione più ampia di stretta positività, rendendo espliciti, ove possibile, i criteri esatti di accettazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The section on Nested Inductive Types, and in particular, the list of requirements nested recursive occurrences must satisfy, is incomplete.
Nested recursive occurrences must satisfy the following requirements:
- They must be nested directly under an inductive type's type constructor. Terms that reduce to such nested occurrences are not accepted.
- Local variables such as the constructor's parameters may not occur in the arguments to the nested occurrence.
- The nested occurrences must occur strictly positively.
In what way is the content incorrect?
The list of requirements misses on two known requirements that must be satisfied in order for a nested inductive type to be correctly translated.
- A nested occurrence may not be used inside the rest of the constructor in a way that would have it rely explicitly on the type it's nested in, as that could lead to the construction of an inductive-recursive type. e.g
def Option.IsNone : Option α → Type := Option.rec Unit (fun _ => Empty)
inductive Foo where
| foo : (l : Option Foo) → l.IsNone → Foo
Would need to be translated as the following inductive-recursive type to be well-formed:
mutual
inductive Foo where
| foo : OptionFoo → Foo
inductive OptionFoo where
| none
| some : Foo → Option Foo
def OptionFoo.IsNone : OptionFoo → Type
| none => Unit
| some _ => Empty
end
Instead, lean tries the naive mutual translation, and errors out when checking the translated constructors.
- A nested recursive occurrence may not appear in a parameter position that an index of the inductive type it's nested in may depend on. This one is further documented at lean4#6371, and also fails during translation instead of giving a good early error.
Furthermore, it should probably be noted that, in order for the translation to give rise to a strictly positive type, it is not only necessary that the nested recursive occurrence appear strictly positively inside another inductive type's type constructor (as pointed out in the list of requirements), but also that the type constructors the nested occurrences appear in appear themselves in a strictly positive manner. e.g in the following code, the recursive occurrence Foo appears strictly positively in Option Foo, but Option Foo itself does not appear strictly positively in the constructor, and is thus not accepted.
inductive Foo where
| foo : (Option Foo → Nat) → Foo
Lastly, this is more of a suggestion, but Lean, might benefit from making explicit the exact positivity criteria(s) the system allows for, similarly to Rocq's presentation on the matter.
- Lingua principale
- Lean
- Stelle
- 147
- Fork
- 72
- Merge medio
- 1g 17h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di leanprover/reference-manual
-
doc-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
leanprover/reference-manual#955 ·
I maintainer di solito rispondono entro 1 giorno
-
Document `strong_coinduct`Apertadoc-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
leanprover/reference-manual#937 ·
I maintainer di solito rispondono entro 1 giorno
-
Document `monotonicity_by`Apertadoc-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
leanprover/reference-manual#936 ·
I maintainer di solito rispondono entro 1 giorno
-
Instances are always exposedApertadoc-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
leanprover/reference-manual#935 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
leanprover/reference-manual#896 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di leanprover/reference-manual
Issue simili
-
chat compiler P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
HerringtonDarkholme/hd-lang#2793 ·
I maintainer di solito rispondono entro 1 giorno
-
area-dart-model gardening
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
I maintainer di solito rispondono entro 1 giorno
-
`shift(x, y)` with a uint256 shift amount >= 2**255 shifts in the wrong directionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
facebookexperimental/semcode#195 ·
I maintainer di solito rispondono entro 2 giorni