Incomplete requirements for nested inductive types
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
調査の方向性
issue にリンクされている Nested Inductive Types セクションから始め、既存の要件一覧を提示されている例と併せて確認してください。パラメータ位置に関する追加の制約については lean4#6371 を確認してください。ドキュメントが不足している2つの制約と、より広い厳密な正値性の条件をカバーし、可能な場合には正確な受け入れ基準を明示できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Lean
- スター
- 147
- フォーク
- 72
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
leanprover/reference-manual のほかの issue
-
doc-request
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
leanprover/reference-manual#955 ·
メンテナーはふだん 1 日以内に返信
-
doc-request
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
leanprover/reference-manual#937 ·
メンテナーはふだん 1 日以内に返信
-
doc-request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
leanprover/reference-manual#936 ·
メンテナーはふだん 1 日以内に返信
-
doc-request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
leanprover/reference-manual#935 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
leanprover/reference-manual#896 ·
メンテナーはふだん 1 日以内に返信
leanprover/reference-manual の issue をすべて見る
似ている issue
-
chat compiler P1
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
HerringtonDarkholme/hd-lang#2793 ·
メンテナーはふだん 1 日以内に返信
-
area-dart-model gardening
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
`shift(x, y)` with a uint256 shift amount >= 2**255 shifts in the wrong direction対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
facebookexperimental/semcode#195 ·
メンテナーはふだん 2 日以内に返信