Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.

Fix bugs in node refutation functionality #877

Merged
merged 7 commits into from
Feb 14, 2024
Merged

Conversation

lucasmt
Copy link
Contributor

@lucasmt lucasmt commented Feb 13, 2024

This PR fixes bugs in the implementation of node refutation, in advance of implementing a kontrol refute-node command as part of runtimeverification/evm-semantics#1752. The following changes are introduced:

  1. Fix the way node refutations are read from a JSON file:
    1. When iterating over the node_refutations dictionary, the .items() method was missing, meaning that only the keys were being iterated over, rather than both keys and values.
    2. In the same line, the node id needed to be converted back to an int before being passed to _resolve, since the JSON file stores the key as a string.
  2. Prevent refuting a node that has successors (otherwise execution of the refuted branch, which should have been paused, will continue from the successor nodes).
  3. Add refuted to the list of attributes for a node when displaying the KCFG.

Lucas MT and others added 4 commits February 13, 2024 14:59
* Add `.items()` when iterating over dictionary, otherwise iteration is only over keys
* Convert `node_id` to int before passing it to `_resolve`
@lucasmt lucasmt self-assigned this Feb 13, 2024
@lucasmt lucasmt marked this pull request as ready for review February 14, 2024 00:15
@rv-jenkins rv-jenkins merged commit d7b42ff into master Feb 14, 2024
@rv-jenkins rv-jenkins deleted the refute-node-bugfixes branch February 14, 2024 01:01
rv-jenkins pushed a commit that referenced this pull request Feb 16, 2024
Adds tests in `test_refute_node.py` for the fixes from #877.

* Initialization of the prover is factored out to its own function
`build_prover`.
* `test_apr_proof_read_node_refutations` tests that the node refutations
can be successfully and correctly read from the `.json` file (before the
above PR this would raise an error).
* `test_apr_proof_refute_node_no_successors` tests that a node can only
be refuted if it has no successors.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
This PR fixes bugs in the implementation of node refutation, in advance
of implementing a `kontrol refute-node` command as part of
runtimeverification/evm-semantics#1752. The following changes are
introduced:
1. Fix the way node refutations are read from a JSON file:
1. When iterating over the `node_refutations` dictionary, the `.items()`
method was missing, meaning that only the keys were being iterated over,
rather than both keys and values.
2. In the same line, the node id needed to be converted back to an int
before being passed to `_resolve`, since the JSON file stores the key as
a string.
2. Prevent refuting a node that has successors (otherwise execution of
the refuted branch, which should have been paused, will continue from
the successor nodes).
3. Add `refuted` to the list of attributes for a node when displaying
the KCFG.

---------

Co-authored-by: Lucas MT <[email protected]>
Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
This PR fixes bugs in the implementation of node refutation, in advance
of implementing a `kontrol refute-node` command as part of
runtimeverification/evm-semantics#1752. The following changes are
introduced:
1. Fix the way node refutations are read from a JSON file:
1. When iterating over the `node_refutations` dictionary, the `.items()`
method was missing, meaning that only the keys were being iterated over,
rather than both keys and values.
2. In the same line, the node id needed to be converted back to an int
before being passed to `_resolve`, since the JSON file stores the key as
a string.
2. Prevent refuting a node that has successors (otherwise execution of
the refuted branch, which should have been paused, will continue from
the successor nodes).
3. Add `refuted` to the list of attributes for a node when displaying
the KCFG.

---------

Co-authored-by: Lucas MT <[email protected]>
Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
This PR fixes bugs in the implementation of node refutation, in advance
of implementing a `kontrol refute-node` command as part of
runtimeverification/evm-semantics#1752. The following changes are
introduced:
1. Fix the way node refutations are read from a JSON file:
1. When iterating over the `node_refutations` dictionary, the `.items()`
method was missing, meaning that only the keys were being iterated over,
rather than both keys and values.
2. In the same line, the node id needed to be converted back to an int
before being passed to `_resolve`, since the JSON file stores the key as
a string.
2. Prevent refuting a node that has successors (otherwise execution of
the refuted branch, which should have been paused, will continue from
the successor nodes).
3. Add `refuted` to the list of attributes for a node when displaying
the KCFG.

---------

Co-authored-by: Lucas MT <[email protected]>
Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
This PR fixes bugs in the implementation of node refutation, in advance
of implementing a `kontrol refute-node` command as part of
runtimeverification/evm-semantics#1752. The following changes are
introduced:
1. Fix the way node refutations are read from a JSON file:
1. When iterating over the `node_refutations` dictionary, the `.items()`
method was missing, meaning that only the keys were being iterated over,
rather than both keys and values.
2. In the same line, the node id needed to be converted back to an int
before being passed to `_resolve`, since the JSON file stores the key as
a string.
2. Prevent refuting a node that has successors (otherwise execution of
the refuted branch, which should have been paused, will continue from
the successor nodes).
3. Add `refuted` to the list of attributes for a node when displaying
the KCFG.

---------

Co-authored-by: Lucas MT <[email protected]>
Co-authored-by: devops <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants