Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize JSON output by dropping unused attributes #3568

Merged
merged 7 commits into from
Aug 10, 2023
Merged

Conversation

ehildenb
Copy link
Member

@ehildenb ehildenb commented Aug 10, 2023

Part of: #3540

This PR minimizes the JSON output of definitions dramatically by doing three things:

  • Encoding KVariable sort directly instead of as an attribute (breaking change, version bump induced).
  • Dropping attributes on KTokens, KApply, and InjectedKLabel (the parser was not reading these back in, and pyk is not reading these).
  • Dropping attributes on KRewrite and KAs, as well as dropping reading these in the parser (pyk is not reading these).

This should speed up definition loading time for KEVM a bit, it dropped the overall definition size in compiled.json from 22MB => 9MB.

@ehildenb ehildenb self-assigned this Aug 10, 2023
@rv-jenkins rv-jenkins merged commit 2767970 into develop Aug 10, 2023
@rv-jenkins rv-jenkins deleted the minimize-json branch August 10, 2023 22:24
@Baltoli Baltoli mentioned this pull request Dec 12, 2023
rv-jenkins pushed a commit to runtimeverification/pyk that referenced this pull request Feb 28, 2024
While working on some larger KCFG/CTermSymbolic refactors/cleanups
(https://github.com/runtimeverification/pyk/issues/918 and
https://github.com/runtimeverification/pyk/issues/919), several smaller
changes came up, which are in this PR.

- When inserting `CTerm` into the KCFG, we used to process it to remove
source locations from the term. But since
runtimeverification/k#3568, we no longer have
attributes on `KInner`. So that processing routine is removed from
`Node` insertion, and the routine `remove_source_attributes` is removed
from `kast/manip.py` as well as it's not used.
- A feature of `KCFG.successors`, `KCFG.predecessors`, and
`KCFG.reachable_nodes`, where the user could select which types of edges
to traverse, is removed. This feature is not used anywhere, and only had
a single test (which is now removed).
- It's enforced that subclasses of `KCFG.Successor` must implement the
`to_dict` method.
- All methods of `CTermSymbolic` have the `module_name: str | None`
parameter added to them, and passed through to the RPC server.
- Methods `CTermSymbolic.{simplify,assume_defined}` are refactored to
amke use of existing `CTermSymbolic.kast_simplify` method.
- Several unused methods in `kast/manip.py` are removed,
`omit_large_tokens`, `remove_constraint_clauses_for`, and
`remove_constraints_for`.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit that referenced this pull request Apr 9, 2024
While working on some larger KCFG/CTermSymbolic refactors/cleanups
(https://github.com/runtimeverification/pyk/issues/918 and
https://github.com/runtimeverification/pyk/issues/919), several smaller
changes came up, which are in this PR.

- When inserting `CTerm` into the KCFG, we used to process it to remove
source locations from the term. But since
#3568, we no longer have
attributes on `KInner`. So that processing routine is removed from
`Node` insertion, and the routine `remove_source_attributes` is removed
from `kast/manip.py` as well as it's not used.
- A feature of `KCFG.successors`, `KCFG.predecessors`, and
`KCFG.reachable_nodes`, where the user could select which types of edges
to traverse, is removed. This feature is not used anywhere, and only had
a single test (which is now removed).
- It's enforced that subclasses of `KCFG.Successor` must implement the
`to_dict` method.
- All methods of `CTermSymbolic` have the `module_name: str | None`
parameter added to them, and passed through to the RPC server.
- Methods `CTermSymbolic.{simplify,assume_defined}` are refactored to
amke use of existing `CTermSymbolic.kast_simplify` method.
- Several unused methods in `kast/manip.py` are removed,
`omit_large_tokens`, `remove_constraint_clauses_for`, and
`remove_constraints_for`.

---------

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

While working on some larger KCFG/CTermSymbolic refactors/cleanups
(https://github.com/runtimeverification/pyk/issues/918 and
https://github.com/runtimeverification/pyk/issues/919), several smaller
changes came up, which are in this PR.

- When inserting `CTerm` into the KCFG, we used to process it to remove
source locations from the term. But since
#3568, we no longer have
attributes on `KInner`. So that processing routine is removed from
`Node` insertion, and the routine `remove_source_attributes` is removed
from `kast/manip.py` as well as it's not used.
- A feature of `KCFG.successors`, `KCFG.predecessors`, and
`KCFG.reachable_nodes`, where the user could select which types of edges
to traverse, is removed. This feature is not used anywhere, and only had
a single test (which is now removed).
- It's enforced that subclasses of `KCFG.Successor` must implement the
`to_dict` method.
- All methods of `CTermSymbolic` have the `module_name: str | None`
parameter added to them, and passed through to the RPC server.
- Methods `CTermSymbolic.{simplify,assume_defined}` are refactored to
amke use of existing `CTermSymbolic.kast_simplify` method.
- Several unused methods in `kast/manip.py` are removed,
`omit_large_tokens`, `remove_constraint_clauses_for`, and
`remove_constraints_for`.

---------

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

While working on some larger KCFG/CTermSymbolic refactors/cleanups
(https://github.com/runtimeverification/pyk/issues/918 and
https://github.com/runtimeverification/pyk/issues/919), several smaller
changes came up, which are in this PR.

- When inserting `CTerm` into the KCFG, we used to process it to remove
source locations from the term. But since
#3568, we no longer have
attributes on `KInner`. So that processing routine is removed from
`Node` insertion, and the routine `remove_source_attributes` is removed
from `kast/manip.py` as well as it's not used.
- A feature of `KCFG.successors`, `KCFG.predecessors`, and
`KCFG.reachable_nodes`, where the user could select which types of edges
to traverse, is removed. This feature is not used anywhere, and only had
a single test (which is now removed).
- It's enforced that subclasses of `KCFG.Successor` must implement the
`to_dict` method.
- All methods of `CTermSymbolic` have the `module_name: str | None`
parameter added to them, and passed through to the RPC server.
- Methods `CTermSymbolic.{simplify,assume_defined}` are refactored to
amke use of existing `CTermSymbolic.kast_simplify` method.
- Several unused methods in `kast/manip.py` are removed,
`omit_large_tokens`, `remove_constraint_clauses_for`, and
`remove_constraints_for`.

---------

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

While working on some larger KCFG/CTermSymbolic refactors/cleanups
(https://github.com/runtimeverification/pyk/issues/918 and
https://github.com/runtimeverification/pyk/issues/919), several smaller
changes came up, which are in this PR.

- When inserting `CTerm` into the KCFG, we used to process it to remove
source locations from the term. But since
#3568, we no longer have
attributes on `KInner`. So that processing routine is removed from
`Node` insertion, and the routine `remove_source_attributes` is removed
from `kast/manip.py` as well as it's not used.
- A feature of `KCFG.successors`, `KCFG.predecessors`, and
`KCFG.reachable_nodes`, where the user could select which types of edges
to traverse, is removed. This feature is not used anywhere, and only had
a single test (which is now removed).
- It's enforced that subclasses of `KCFG.Successor` must implement the
`to_dict` method.
- All methods of `CTermSymbolic` have the `module_name: str | None`
parameter added to them, and passed through to the RPC server.
- Methods `CTermSymbolic.{simplify,assume_defined}` are refactored to
amke use of existing `CTermSymbolic.kast_simplify` method.
- Several unused methods in `kast/manip.py` are removed,
`omit_large_tokens`, `remove_constraint_clauses_for`, and
`remove_constraints_for`.

---------

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

While working on some larger KCFG/CTermSymbolic refactors/cleanups
(https://github.com/runtimeverification/pyk/issues/918 and
https://github.com/runtimeverification/pyk/issues/919), several smaller
changes came up, which are in this PR.

- When inserting `CTerm` into the KCFG, we used to process it to remove
source locations from the term. But since
#3568, we no longer have
attributes on `KInner`. So that processing routine is removed from
`Node` insertion, and the routine `remove_source_attributes` is removed
from `kast/manip.py` as well as it's not used.
- A feature of `KCFG.successors`, `KCFG.predecessors`, and
`KCFG.reachable_nodes`, where the user could select which types of edges
to traverse, is removed. This feature is not used anywhere, and only had
a single test (which is now removed).
- It's enforced that subclasses of `KCFG.Successor` must implement the
`to_dict` method.
- All methods of `CTermSymbolic` have the `module_name: str | None`
parameter added to them, and passed through to the RPC server.
- Methods `CTermSymbolic.{simplify,assume_defined}` are refactored to
amke use of existing `CTermSymbolic.kast_simplify` method.
- Several unused methods in `kast/manip.py` are removed,
`omit_large_tokens`, `remove_constraint_clauses_for`, and
`remove_constraints_for`.

---------

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

Successfully merging this pull request may close these issues.

3 participants