Support JavaScript semantics for numbers (behind an option)
Maintainer thường phản hồi trong vòng 1 ngày
@ranita872 đang làm issue này rồi.
Từ ngày 27/8/2026.
Đá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ính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start by investigating how LemmaScript translates JavaScript numbers into Dafny, using the listed Dafny type-system and newtype options and the uint64 wrapping example as a test case. The configuration form is still undecided, so first establish the design for optional semantics; done means JavaScript number behavior is modeled and verified without changing defaults for existing users.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The goal would be to support faithful semantics for JavaScript numbers. For backward compatibility, this support would be optional, with the exact form of the configuration TBD.
This support would require some investigation of the best way to go about it in Dafny.
Below some preliminary investigations.
Some useful Dafny options: --type-system-refresh --general-traits=datatype --general-newtypes
In dfyconfig.toml:
includes = ["**/*.dfy"]
[options]
type-system-refresh = true
general-traits = "datatype"
general-newtypes = true
Possible encoding:
// Run with the new type system + general newtypes:
// dafny verify --type-system-refresh --general-traits=datatype --general-newtypes n_overflow.dfy
// (or just `dafny verify dfyconfig.toml`, which sets those flags for the project)
//
// A newtype over bv64 gives wrapping (mod 2^64) arithmetic, like a C
// `uint64_t`. Without the flags above this declaration is rejected
// ("newtypes must be based on some numeric type"). With overflow,
// factorial(n) wraps below n, so factorial_greater no longer holds and
// the postcondition fails to verify -- which is the overflow we wanted
// to surface. (With `nat`, it verifies: nat never overflows.)
module Wrapping {
newtype uint64 = b: bv64 | true
function factorial(n: uint64): uint64
decreases n
{
if n == 0 then
1
else
n * factorial(n - 1)
}
lemma factorial_greater(n: uint64)
requires n >= 3
ensures factorial(n) > n // FAILS: factorial wraps mod 2^64 for large n
{
}
}
- Ngôn ngữ chính
- TypeScript
- Star
- 113
- Fork
- 13
- Merge trung bình
- 16 giờ 22 phút
- Pull request đã merge (30 ngày)
- 40
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 midspiral/LemmaScript
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
midspiral/LemmaScript#308 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dafny: `toUpperCase`/`toLowerCase` are modeled as ASCII-only, so false contracts about non-ASCII text verifyCó thể đã có người làm @quangng2000 đã nhận 1 ngày trước. Đang mở
midspiral/LemmaScript#312 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 56/100
midspiral/LemmaScript#311 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 48/100
midspiral/LemmaScript#310 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
midspiral/LemmaScript#309 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của midspiral/LemmaScript
Issue tương tự
-
area: batch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
inabagumi/shinju-date#7294 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
streaming-video-technology-alliance/common-media-library#700 ·
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 82/100
vercel-labs/ui#809 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
KrisCris/village-in-the-shade-guide#75 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bot:ai-assisted component:platform-js status:untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
midnightntwrk/platform-js#38 ·