Incomplete requirements for nested inductive types
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- compilers, documentation
Hướng nghiên cứu
Bắt đầu với phần Nested Inductive Types được liên kết trong issue và xem lại danh sách yêu cầu hiện có cùng với các ví dụ được cung cấp. Kiểm tra lean4#6371 để biết ràng buộc bổ sung về vị trí tham số. Công việc được xem là hoàn tất khi tài liệu bao quát hai hạn chế còn thiếu và điều kiện rộng hơn về tính dương nghiêm ngặt, đồng thời nêu rõ các tiêu chí chấp nhận chính xác khi có thể.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Lean
- Star
- 147
- Fork
- 72
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của leanprover/reference-manual
-
doc-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
leanprover/reference-manual#955 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Document `strong_coinduct`Đang mởdoc-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
leanprover/reference-manual#937 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Document `monotonicity_by`Đang mởdoc-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
leanprover/reference-manual#936 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Instances are always exposedĐang mởdoc-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
leanprover/reference-manual#935 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
leanprover/reference-manual#896 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của leanprover/reference-manual
Issue tương tự
-
chat compiler P1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
HerringtonDarkholme/hd-lang#2793 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-dart-model gardening
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`shift(x, y)` with a uint256 shift amount >= 2**255 shifts in the wrong directionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
facebookexperimental/semcode#195 ·
Maintainer thường phản hồi trong vòng 2 ngày