runtimeverification / runtimeverification/kontrol

add_invariant is called on unsimplified term

Open
#295 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
122
Forks
16
PR merge metrics
No merged PRs in 30d

Description

In prove.py, KEVM.add_invariant is called. This function takes the contents of the callData cell and adds a predicate asserting something about the length of the callData. Because the term it is called on is unsimplified, it contains function symbols that when evaluated, add new constraints to the path condition. The necessity of supporting the equations needed in the Maude backend to propagate these constraints correctly causes the time spent loading KEVM in the Maude backend to increase from 2 seconds to 15 seconds. Ideally, we would simplify the term we create, then add the invariant using the simplified term. This is not hugely urgent, but it causes quite significantly quality of life improvement for developers working on improving the Maude backend's support for kontrol, so I'd like to know what might be able to be done.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in prove.py at the call to KEVM.add_invariant and trace how the callData cell term is constructed and simplified. Check the Maude backend behavior when the invariant is added from the unsimplified versus simplified term, including the resulting path constraints and KEVM loading time. Done means the invariant uses the simplified term without requiring the extra equations that cause the reported slowdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.