Remove `do` blocks from generated Lean code when possible
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- compilers
調査の方向性
Start by locating the code-generation path that emits Lean function definitions, then inspect how Option-returning functions and their dependencies are represented. The change is complete when unnecessary do blocks are omitted, while blocks that chain Option-returning functions remain and dependent total functions can use non-Option signatures.
索引モデルが issue の本文から書いたものです。
説明
The Lean generated code currently uses more do blocks for function definitions than strictly necessary, as an example
def _742a262 : SortScheduleConst → SortSchedule → Option SortInt
| SortScheduleConst.Rb_SCHEDULE_ScheduleConst, SortSchedule.CONSTANTINOPLE_EVM => do
let _Val0 <- «_*Int_» 2 1000000000000000000
return _Val0
| _, _ => none
could be defined as
def _742a262 : SortScheduleConst → SortSchedule → Option SortInt
| SortScheduleConst.Rb_SCHEDULE_ScheduleConst, SortSchedule.CONSTANTINOPLE_EVM => «_*Int_» 2 1000000000000000000
| _, _ => none
In particular, unless the do block is used to chain functions that return an Option type, it can be removed.
Additionally, functions which depend on total functions could be redefined without the do block once their dependencies are stripped of the Option return type. For example
def _432555e : SortWordStack → SortInt → Option SortInt
| SortWordStack.«_:__EVM-TYPES_WordStack_Int_WordStack» _Gen0 WS, SIZE => do
let _Val0 <- «_+Int_» SIZE 1
let _Val1 <- sizeWordStackAux WS _Val0
return _Val1
| _, _ => none
Once «_+Int_» and sizeWordStackAux return a SortInt type instead of Option SortInt, it could be redefined as the following or similar
def _432555e : SortWordStack → SortInt → SortInt
| SortWordStack.«_:__EVM-TYPES_WordStack_Int_WordStack» _Gen0 WS, SIZE =>
let _Val0 := «_+Int_» SIZE 1
sizeWordStackAux WS _Val0
| _, _ => 0
- 主要言語
- Python
- スター
- 594
- フォーク
- 164
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
runtimeverification/k のほかの issue
-
Introduce composable symbolic execution interface in pyx再び着手できるかも @Stevengre が 99 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
runtimeverification/k#4939 · 担当者 1 名 ·
-
Concolic Explorerオープン
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
runtimeverification/k#4937 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
runtimeverification/k#4936 ·
-
Accelerating all-path reachability proofs with one-path reachability proofs再び着手できるかも @Stevengre が 105 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンtype:epic
runtimeverification/k#4934 · コメント 4 件 · 担当者 1 名 ·
-
Support progressive depth halving as a generic policy in `Prover.advance_proof`再び着手できるかも @Stevengre が 125 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
runtimeverification/k#4924 · 担当者 1 名 ·
runtimeverification/k の issue をすべて見る
似ている issue
-
repo-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
scverse/repo-health#20 ·
メンテナーはふだん 1 日以内に返信
-
/context/prime scope override double-prefixes an entity-ref project and drops its scoped memoriesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
phasespace-labs/palinode#232 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
collective/icalendar#1858 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
langflow-ai/langflow#15496 ·
メンテナーはふだん 1 日以内に返信