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

Conversation

@ehildenb
Copy link
Member

@ehildenb ehildenb commented Jun 12, 2023

Fixes: #413

This PR introduces proof-specific viewers, and does a few refactors to make that possible:

  • Helpers are added to KCFG for turning into modules, including:
    • KCFG.Split.covers which returns each individual split as a reverse cover.
    • KCFG.NDBranch.edges, which returns each non-deterministic step as an edge.
    • KCFG.Edge.to_rule, which converts an edge into a K rule (or claim).
  • Small refactorings to KCFGShow structure:
    • KCFGShow.dot returns a Digraph directly (for further manipulation) instead of a list of str.
    • KCFGShow.to_module which returns a KFlatModule is factored out and used directly in KCFGShow.show.
    • Helper methods embedded in other methods in KCFGShow are factored out directly to staticmethods of KCFGShow so they can be reused easily.
    • We just treat stuck as a node attribute now, printed at the beginning of a node, instead of printing it a second time following a node too.
  • The way that KCFGShow calculates node attributes is adjusted and factor out.
    • A new class NodePrinter is factored out, which by default just uses the attributes the KCFG knows about for printing out nodes.
    • That class is extended by APRProofNodePrinter and APRBMCProofNodePrinter, which add the additional information about the nodes pending,terminal,bounded state. If a node is terminal or bounded, then the stuck attribute is no longer printed for less confusion.
    • KCFGShow now takes an optional *NodePrinter as an argument (or builds on itself), so instantiating that class is how you can customize how nodes are displayed in text.
    • The tests are adapted to use the more specific *NodePrinter classes, and the output checked that the more specific node information is indeed being included.
  • Adds helper predicates APRProof.is_{pending,terminal} and APRProof.is_bounded, which should behave better in case there are qualified node ids passed in.

@ehildenb ehildenb self-assigned this Jun 12, 2023
@ehildenb
Copy link
Member Author

ehildenb commented Jun 14, 2023

Running bmc-loop-symbolic-1 test with log level set to INFO now prints out something looking like this for BMC depth-bounded nodes:

image

You can see that it includes the bounded label in that node, and the stuck is not there anymore, which is less confusing.

In addition, for a node that is terminal, we similarly remove the stuck attribute at print time, for less confusion:

image

@ehildenb ehildenb marked this pull request as ready for review June 14, 2023 20:52
@ehildenb ehildenb changed the title APRProof specific viewer APRProof specific proof visualization Jun 14, 2023
@ehildenb ehildenb changed the title APRProof specific proof visualization APRProof specific proof state visualization Jun 14, 2023
'┃ ┣━━┓\n'
'┃ ┃ │\n'
'┃ ┃ └─ \033[1m24 (frontier, leaf)\033[0m\n'
'┃ ┃ └─ 24 (frontier, leaf)\n'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id-s are no longer bold, is this deliberate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I removed the bolding.

@rv-jenkins rv-jenkins merged commit 9720f2c into master Jun 15, 2023
@rv-jenkins rv-jenkins deleted the proof-viewers branch June 15, 2023 20:25
rv-jenkins pushed a commit that referenced this pull request Jun 20, 2023
Following #489, it turns
out that KEVM's TUI is broken because it relies on the old way of doing
Node printing.

This makes a new `APRProofViewer` class, which largely inherits from
`KCFGViewer`, but adjusts it to handle the more spceific node viewers.

I have tested this with both KEVM+Foundry and raw KEVM specs, and it
seems to work.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
Following runtimeverification/pyk#489, it turns
out that KEVM's TUI is broken because it relies on the old way of doing
Node printing.

This makes a new `APRProofViewer` class, which largely inherits from
`KCFGViewer`, but adjusts it to handle the more spceific node viewers.

I have tested this with both KEVM+Foundry and raw KEVM specs, and it
seems to work.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
)

Fixes: #413 

This PR introduces proof-specific viewers, and does a few refactors to
make that possible:

- Helpers are added to `KCFG` for turning into modules, including:
- `KCFG.Split.covers` which returns each individual split as a reverse
cover.
- `KCFG.NDBranch.edges`, which returns each non-deterministic step as an
edge.
- `KCFG.Edge.to_rule`, which converts an edge into a K rule (or claim).
- Small refactorings to `KCFGShow` structure:
- `KCFGShow.dot` returns a `Digraph` directly (for further manipulation)
instead of a list of `str`.
- `KCFGShow.to_module` which returns a `KFlatModule` is factored out and
used directly in `KCFGShow.show`.
- Helper methods embedded in other methods in `KCFGShow` are factored
out directly to staticmethods of `KCFGShow` so they can be reused
easily.
- We just treat `stuck` as a node attribute now, printed at the
beginning of a node, instead of printing it a second time following a
node too.
- The way that `KCFGShow` calculates node attributes is adjusted and
factor out.
- A new class `NodePrinter` is factored out, which by default just uses
the attributes the `KCFG` knows about for printing out nodes.
- That class is extended by `APRProofNodePrinter` and
`APRBMCProofNodePrinter`, which add the additional information about the
nodes `pending,terminal,bounded` state. If a node is `terminal` or
`bounded`, then the `stuck` attribute is no longer printed for less
confusion.
- `KCFGShow` now takes an optional `*NodePrinter` as an argument (or
builds on itself), so instantiating that class is how you can customize
how nodes are displayed in text.
- The tests are adapted to use the more specific `*NodePrinter` classes,
and the output checked that the more specific node information is indeed
being included.
- Adds helper predicates `APRProof.is_{pending,terminal}` and
`APRProof.is_bounded`, which should behave better in case there are
qualified node ids passed in.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
…tion/pyk#507)

Following runtimeverification/pyk#489, it turns
out that KEVM's TUI is broken because it relies on the old way of doing
Node printing.

This makes a new `APRProofViewer` class, which largely inherits from
`KCFGViewer`, but adjusts it to handle the more spceific node viewers.

I have tested this with both KEVM+Foundry and raw KEVM specs, and it
seems to work.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
)

Fixes: #413 

This PR introduces proof-specific viewers, and does a few refactors to
make that possible:

- Helpers are added to `KCFG` for turning into modules, including:
- `KCFG.Split.covers` which returns each individual split as a reverse
cover.
- `KCFG.NDBranch.edges`, which returns each non-deterministic step as an
edge.
- `KCFG.Edge.to_rule`, which converts an edge into a K rule (or claim).
- Small refactorings to `KCFGShow` structure:
- `KCFGShow.dot` returns a `Digraph` directly (for further manipulation)
instead of a list of `str`.
- `KCFGShow.to_module` which returns a `KFlatModule` is factored out and
used directly in `KCFGShow.show`.
- Helper methods embedded in other methods in `KCFGShow` are factored
out directly to staticmethods of `KCFGShow` so they can be reused
easily.
- We just treat `stuck` as a node attribute now, printed at the
beginning of a node, instead of printing it a second time following a
node too.
- The way that `KCFGShow` calculates node attributes is adjusted and
factor out.
- A new class `NodePrinter` is factored out, which by default just uses
the attributes the `KCFG` knows about for printing out nodes.
- That class is extended by `APRProofNodePrinter` and
`APRBMCProofNodePrinter`, which add the additional information about the
nodes `pending,terminal,bounded` state. If a node is `terminal` or
`bounded`, then the `stuck` attribute is no longer printed for less
confusion.
- `KCFGShow` now takes an optional `*NodePrinter` as an argument (or
builds on itself), so instantiating that class is how you can customize
how nodes are displayed in text.
- The tests are adapted to use the more specific `*NodePrinter` classes,
and the output checked that the more specific node information is indeed
being included.
- Adds helper predicates `APRProof.is_{pending,terminal}` and
`APRProof.is_bounded`, which should behave better in case there are
qualified node ids passed in.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
…tion/pyk#507)

Following runtimeverification/pyk#489, it turns
out that KEVM's TUI is broken because it relies on the old way of doing
Node printing.

This makes a new `APRProofViewer` class, which largely inherits from
`KCFGViewer`, but adjusts it to handle the more spceific node viewers.

I have tested this with both KEVM+Foundry and raw KEVM specs, and it
seems to work.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
)

Fixes: #413 

This PR introduces proof-specific viewers, and does a few refactors to
make that possible:

- Helpers are added to `KCFG` for turning into modules, including:
- `KCFG.Split.covers` which returns each individual split as a reverse
cover.
- `KCFG.NDBranch.edges`, which returns each non-deterministic step as an
edge.
- `KCFG.Edge.to_rule`, which converts an edge into a K rule (or claim).
- Small refactorings to `KCFGShow` structure:
- `KCFGShow.dot` returns a `Digraph` directly (for further manipulation)
instead of a list of `str`.
- `KCFGShow.to_module` which returns a `KFlatModule` is factored out and
used directly in `KCFGShow.show`.
- Helper methods embedded in other methods in `KCFGShow` are factored
out directly to staticmethods of `KCFGShow` so they can be reused
easily.
- We just treat `stuck` as a node attribute now, printed at the
beginning of a node, instead of printing it a second time following a
node too.
- The way that `KCFGShow` calculates node attributes is adjusted and
factor out.
- A new class `NodePrinter` is factored out, which by default just uses
the attributes the `KCFG` knows about for printing out nodes.
- That class is extended by `APRProofNodePrinter` and
`APRBMCProofNodePrinter`, which add the additional information about the
nodes `pending,terminal,bounded` state. If a node is `terminal` or
`bounded`, then the `stuck` attribute is no longer printed for less
confusion.
- `KCFGShow` now takes an optional `*NodePrinter` as an argument (or
builds on itself), so instantiating that class is how you can customize
how nodes are displayed in text.
- The tests are adapted to use the more specific `*NodePrinter` classes,
and the output checked that the more specific node information is indeed
being included.
- Adds helper predicates `APRProof.is_{pending,terminal}` and
`APRProof.is_bounded`, which should behave better in case there are
qualified node ids passed in.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
…tion/pyk#507)

Following runtimeverification/pyk#489, it turns
out that KEVM's TUI is broken because it relies on the old way of doing
Node printing.

This makes a new `APRProofViewer` class, which largely inherits from
`KCFGViewer`, but adjusts it to handle the more spceific node viewers.

I have tested this with both KEVM+Foundry and raw KEVM specs, and it
seems to work.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
)

Fixes: #413 

This PR introduces proof-specific viewers, and does a few refactors to
make that possible:

- Helpers are added to `KCFG` for turning into modules, including:
- `KCFG.Split.covers` which returns each individual split as a reverse
cover.
- `KCFG.NDBranch.edges`, which returns each non-deterministic step as an
edge.
- `KCFG.Edge.to_rule`, which converts an edge into a K rule (or claim).
- Small refactorings to `KCFGShow` structure:
- `KCFGShow.dot` returns a `Digraph` directly (for further manipulation)
instead of a list of `str`.
- `KCFGShow.to_module` which returns a `KFlatModule` is factored out and
used directly in `KCFGShow.show`.
- Helper methods embedded in other methods in `KCFGShow` are factored
out directly to staticmethods of `KCFGShow` so they can be reused
easily.
- We just treat `stuck` as a node attribute now, printed at the
beginning of a node, instead of printing it a second time following a
node too.
- The way that `KCFGShow` calculates node attributes is adjusted and
factor out.
- A new class `NodePrinter` is factored out, which by default just uses
the attributes the `KCFG` knows about for printing out nodes.
- That class is extended by `APRProofNodePrinter` and
`APRBMCProofNodePrinter`, which add the additional information about the
nodes `pending,terminal,bounded` state. If a node is `terminal` or
`bounded`, then the `stuck` attribute is no longer printed for less
confusion.
- `KCFGShow` now takes an optional `*NodePrinter` as an argument (or
builds on itself), so instantiating that class is how you can customize
how nodes are displayed in text.
- The tests are adapted to use the more specific `*NodePrinter` classes,
and the output checked that the more specific node information is indeed
being included.
- Adds helper predicates `APRProof.is_{pending,terminal}` and
`APRProof.is_bounded`, which should behave better in case there are
qualified node ids passed in.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
…tion/pyk#507)

Following runtimeverification/pyk#489, it turns
out that KEVM's TUI is broken because it relies on the old way of doing
Node printing.

This makes a new `APRProofViewer` class, which largely inherits from
`KCFGViewer`, but adjusts it to handle the more spceific node viewers.

I have tested this with both KEVM+Foundry and raw KEVM specs, and it
seems to work.

---------

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.

Proof-specific viewers for Each proof type

6 participants