Unify definedness binders for function applications
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Trace the code generator's handling of definedness binders for identical function applications, including applications introduced by inlined aliases. Start from the generated requires clauses described for the KEVM optimized.add rule and determine where duplicate applications receive separate binders. Done means equivalent applications share one definedness binder without breaking generated rule proofs.
Written by the indexing model from the issue text.
Description
There is some redundancy in the generated requires clauses for rules. As an example, for the KEVM optimized.add rule. In the Lean generated rule, we have:
(defn_Val0 : «_<_>_SCHEDULE_Int_ScheduleConst_Schedule» (SortScheduleConst.Gverylow_SCHEDULE_ScheduleConst) SCHED = some _Val0)
So _Val0 is the gas cost of ADD according to SCHED.
We also have:
(defn_Val9 : «_<_>_SCHEDULE_Int_ScheduleConst_Schedule» (SortScheduleConst.Gverylow_SCHEDULE_ScheduleConst) SCHED = some _Val9)
Which means that _Val9 is also the gas cost of ADD according to SCHED.
Now, _Val0 is used to check if we have enough gas for the execution of the opcode:
(defn_Val1 : «_<=Gas__GAS-SYNTAX_Bool_Gas_Gas» ((@inj SortInt SortGas) _Val0) GAVAIL = some _Val1)
And then _Val9 is used to deduct the gas cost of ADD to GAVAIL:
(defn_Val10 : «_-Gas__GAS-SYNTAX_Gas_Gas_Gas» GAVAIL ((@inj SortInt SortGas) _Val9) = some _Val10)
This means that to prove Rewrites lhs rhs, even if we use the constructor for the ADD opcode summary, we need to discharge an extra proof obligation that boils down to showing _Val0 = _Val9. Luckily, this is easily discharged by a single tactic (cc), but maybe it would be ideal if we only had _Val0.
As per @tothtamas28:
When there are two identical function applications in a rule, separate binders for their definedness are generated.
It's possible that these two instances of the same application are not in the original KORE in this form, but through an alias.
The code generator inlines these aliases, so that's where the duplication might come from.
We could unify these definedness binders for ease of proving.
- Dominant language
- Python
- Stars
- 591
- Forks
- 163
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from runtimeverification/k
-
runtimeverification/k#4939 · 1 assignee ·
-
Concolic Explorer Open
Difficulty 5/5 Over a week Newbie friendliness 32/100
runtimeverification/k#4937 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
runtimeverification/k#4936 ·
-
type:epic
runtimeverification/k#4934 · 4 comments · 1 assignee ·
-
runtimeverification/k#4924 · 1 assignee ·
All issues in runtimeverification/k
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100