Remove `do` blocks from generated Lean code when possible
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- compilers
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 591
- Fork
- 163
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di runtimeverification/k
-
Introduce composable symbolic execution interface in pyxForse di nuovo libera @Stevengre l’ha presa 97 giorni fa e non c’è nessuna pull request aperta. Aperta
runtimeverification/k#4939 · 1 assegnatario ·
-
Concolic ExplorerAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 32/100
runtimeverification/k#4937 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
runtimeverification/k#4936 ·
-
Accelerating all-path reachability proofs with one-path reachability proofsForse di nuovo libera @Stevengre l’ha presa 103 giorni fa e non c’è nessuna pull request aperta. Apertatype:epic
runtimeverification/k#4934 · 4 commenti · 1 assegnatario ·
-
Support progressive depth halving as a generic policy in `Prover.advance_proof`Forse di nuovo libera @Stevengre l’ha presa 123 giorni fa e non c’è nessuna pull request aperta. Aperta
runtimeverification/k#4924 · 1 assegnatario ·
Tutte le issue di runtimeverification/k
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
PedestrianDynamics/pyFDS-Evac#343 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
theskumar/python-dotenv#708 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 2 giorni
-
Docs Timedelta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pandas-dev/pandas#69919 ·
I maintainer di solito rispondono entro 1 giorno
-
API documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
zephyrproject-rtos/west#1009 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni