Should a checker reject a let type mismatch that disappears after substitution?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- compilers, documentation
Hướng nghiên cứu
Đọc src/kernel/type_checker.cpp tại infer_let và nhánh rút gọn let, sau đó xem xét format_ndjson.md và gói làm rõ được liên kết. Chỉ so sánh candidate và matching control như được mô tả trong issue. Được coi là hoàn tất khi guarantee về việc chấp nhận đã được quyết định và nêu trong tài liệu format thích hợp hoặc tài liệu tham chiếu Lean.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
We are preparing shared regression tests for external Lean checkers and want
to clarify what a checker is expected to validate when it reads an exported
declaration.
Consider this existing serialized declaration, shown here in readable notation:
def EcosystemCase : Sort 2 := let u : Sort 1 := Sort 1; u
The let contains a type mismatch: its value, Sort 1, has type Sort 2, but
its annotation says Sort 1.
If we first substitute the value for u (zeta reduction), the expression becomes:
def EcosystemCase : Sort 2 := Sort 1
That resulting declaration has matching types. The simplification has removed
the incorrect annotation.
Should a full external checker reject the original declaration because of
that mismatch, or is it permitted to simplify the let first and accept the
result? If the interface assumes that incoming expressions have already been
type-checked, could that assumption be stated explicitly instead?
This matters for shared tests: we need to know whether acceptance promises that
the supplied expression was checked, or that a permitted transformation of it
was checked. We are asking about that guarantee, not reporting a false theorem
or asking every reducer to repeat checks on already-validated expressions.
We found separate checking and reduction paths in Lean v4.33.0:
infer_let
checks the annotation/value relationship in checking mode, while the
let reduction branch
substitutes directly. The
3.1.0 format description
lists the let fields but does not state which acceptance guarantee applies.
Is there an existing policy we should cite, or would a short clarification in
that document or the Lean reference manual be appropriate?
For reproducibility, the unchanged candidate NDJSON
and matching control
are each 601 bytes. The notation above explains those bytes; it is not an
elaboration result or a new test run. The body uses u, and the control changes
both the let value and the enclosing declaration type. The
source review
records the exact versions and remaining qualifications.
- Ngôn ngữ chính
- Lean
- Star
- 52
- Fork
- 30
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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/lean4export
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
leanprover/lean4export#40 · 6 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
leanprover/lean4export#64 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
leanprover/lean4export#62 · 2 bình luận ·
-
Exported binder names and binder info depend on what else is exportedCó thể đã có người làm @JoAdo07 đã nhận 31 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
leanprover/lean4export#58 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
leanprover/lean4export#8 · 2 bình luận ·
Tất cả issue của leanprover/lean4export
Issue tương tự
-
bug core-lang
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Call-argument syntax diagnostic needs example spacing and removal of confusing trailing sentenceĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mw00/project-maya#1368 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
test(bind-json): legacy Solidity fixture requires an unavailable solc on Linux ARM64Có 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
foundry-rs/foundry#18828 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày