Support JavaScript semantics for numbers (behind an option)
メンテナーはふだん 1 日以内に返信
@ranita872 がすでに取り組んでいます。
2026年8月27日 から。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
{
}
}
- 主要言語
- TypeScript
- スター
- 113
- フォーク
- 13
- 平均マージ
- 16時間 22分
- マージ済み PR(30日)
- 40
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
midspiral/LemmaScript のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
midspiral/LemmaScript#308 ·
メンテナーはふだん 1 日以内に返信
-
Dafny: `toUpperCase`/`toLowerCase` are modeled as ASCII-only, so false contracts about non-ASCII text verify対応中かも @quangng2000 が 1 日前に担当しました。 オープン
midspiral/LemmaScript#312 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 56/100
midspiral/LemmaScript#311 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 48/100
midspiral/LemmaScript#310 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
midspiral/LemmaScript#309 ·
メンテナーはふだん 1 日以内に返信
midspiral/LemmaScript の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
gofish-graphics/gofish-graphics#1384 ·
メンテナーはふだん 1 日以内に返信
-
adapter bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Olanetsoft/agent-lookout#353 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
vicharanashala/vibe#1542 ·
メンテナーはふだん 1 日以内に返信
-
bug chore P2 size:XS
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
josephfung/curia#2666 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
devarshishimpi/codra#178 ·
メンテナーはふだん 1 日以内に返信