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

Split out CTerm manipulation functionalities of KCFGExplore #915

Merged
merged 12 commits into from
Feb 26, 2024

Conversation

ehildenb
Copy link
Member

@ehildenb ehildenb commented Feb 24, 2024

KCFGExplore class has grown quite a bit, and broadly contains two types of things: (i) wrappers around the KoreClient for the CTerm class, and (ii) functionalities for manipulating KCFGs using said wrappers. This PR pulls the first category out into a new submodule of the cterm submodule.

  • Module cterm/symbolic.py is added, with class CTermSymbolic, which wraps a KoreClient and lifts its functionalities to from Kore to CTerm level.
    • The class CTermSymbolic doesn't need access to a KPrint, instead just a KDefinition and a KompiledKore.
    • The class CTermSymbolic implements two new methods CTermSymbolic.kast_to_kore(KInner) -> Pattern and CTermSymbolic.kore_to_kast(Pattern) -> KInner as wrappers around the methods in konvert which have the definitions applied, and uses them in the various methods instead. In particular, that means we do not have fallback to kast binary for these methods (instead crashes), but these codepaths are very well tested now.
  • The methods from KCFGExplore.cterm_* are moved to the CTermSymbolic class, with the prefix cterm_ dropped.
  • The KCFGExplore is updated to use this class instead of a KoreClient directly, and various *Prover classes are updated as well.
  • Updates to the testing harness are made:
    • A new fixture CTermSymbolic is added, for when only that is needed.
    • The directory src/tests/integration/kcfg is moved to src/tests/integration/cterm, and lowered to CTermSymbolic instead of KCFGExplore.

@ehildenb ehildenb self-assigned this Feb 24, 2024
@ehildenb ehildenb marked this pull request as ready for review February 26, 2024 14:47
src/pyk/testing/_kompiler.py Outdated Show resolved Hide resolved
src/pyk/testing/_kompiler.py Outdated Show resolved Hide resolved
src/pyk/cterm/symbolic.py Show resolved Hide resolved
@rv-jenkins rv-jenkins merged commit 6fd119b into master Feb 26, 2024
11 checks passed
@rv-jenkins rv-jenkins deleted the kcfg-explore-refactor branch February 26, 2024 23:57
@nwatson22 nwatson22 mentioned this pull request Feb 27, 2024
rv-jenkins pushed a commit that referenced this pull request Feb 27, 2024
#915 introduced a circular import crash which is triggered when
executing `pyk rpc-kast` `rpc.py > kprove.py > cterm > symbolic.py >
rpc.py`

Moves `KoreExecLogFormat` to `kore/rpc.py`

---------

Co-authored-by: devops <devops@runtimeverification.com>
Co-authored-by: lucasmt <36549752+lucasmt@users.noreply.github.com>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
…erification/pyk#915)

`KCFGExplore` class has grown quite a bit, and broadly contains two
types of things: (i) wrappers around the `KoreClient` for the `CTerm`
class, and (ii) functionalities for manipulating KCFGs using said
wrappers. This PR pulls the first category out into a new submodule of
the `cterm` submodule.

- Module `cterm/symbolic.py` is added, with class `CTermSymbolic`, which
wraps a `KoreClient` and lifts its functionalities to from Kore to
`CTerm` level.
- The class `CTermSymbolic` doesn't need access to a `KPrint`, instead
just a `KDefinition` and a `KompiledKore`.
- The class `CTermSymbolic` implements two new methods
`CTermSymbolic.kast_to_kore(KInner) -> Pattern` and
`CTermSymbolic.kore_to_kast(Pattern) -> KInner` as wrappers around the
methods in `konvert` which have the definitions applied, and uses them
in the various methods instead. In particular, that means we do _not_
have fallback to `kast` binary for these methods (instead crashes), but
these codepaths are very well tested now.
- The methods from `KCFGExplore.cterm_*` are moved to the
`CTermSymbolic` class, with the prefix `cterm_` dropped.
- The `KCFGExplore` is updated to use this class instead of a
`KoreClient` directly, and various `*Prover` classes are updated as
well.
- Updates to the testing harness are made:
- A new fixture `CTermSymbolic` is added, for when only that is needed.
- The directory `src/tests/integration/kcfg` is moved to
`src/tests/integration/cterm`, and lowered to `CTermSymbolic` instead of
`KCFGExplore`.

---------

Co-authored-by: devops <devops@runtimeverification.com>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
…erification/pyk#915)

`KCFGExplore` class has grown quite a bit, and broadly contains two
types of things: (i) wrappers around the `KoreClient` for the `CTerm`
class, and (ii) functionalities for manipulating KCFGs using said
wrappers. This PR pulls the first category out into a new submodule of
the `cterm` submodule.

- Module `cterm/symbolic.py` is added, with class `CTermSymbolic`, which
wraps a `KoreClient` and lifts its functionalities to from Kore to
`CTerm` level.
- The class `CTermSymbolic` doesn't need access to a `KPrint`, instead
just a `KDefinition` and a `KompiledKore`.
- The class `CTermSymbolic` implements two new methods
`CTermSymbolic.kast_to_kore(KInner) -> Pattern` and
`CTermSymbolic.kore_to_kast(Pattern) -> KInner` as wrappers around the
methods in `konvert` which have the definitions applied, and uses them
in the various methods instead. In particular, that means we do _not_
have fallback to `kast` binary for these methods (instead crashes), but
these codepaths are very well tested now.
- The methods from `KCFGExplore.cterm_*` are moved to the
`CTermSymbolic` class, with the prefix `cterm_` dropped.
- The `KCFGExplore` is updated to use this class instead of a
`KoreClient` directly, and various `*Prover` classes are updated as
well.
- Updates to the testing harness are made:
- A new fixture `CTermSymbolic` is added, for when only that is needed.
- The directory `src/tests/integration/kcfg` is moved to
`src/tests/integration/cterm`, and lowered to `CTermSymbolic` instead of
`KCFGExplore`.

---------

Co-authored-by: devops <devops@runtimeverification.com>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
…erification/pyk#915)

`KCFGExplore` class has grown quite a bit, and broadly contains two
types of things: (i) wrappers around the `KoreClient` for the `CTerm`
class, and (ii) functionalities for manipulating KCFGs using said
wrappers. This PR pulls the first category out into a new submodule of
the `cterm` submodule.

- Module `cterm/symbolic.py` is added, with class `CTermSymbolic`, which
wraps a `KoreClient` and lifts its functionalities to from Kore to
`CTerm` level.
- The class `CTermSymbolic` doesn't need access to a `KPrint`, instead
just a `KDefinition` and a `KompiledKore`.
- The class `CTermSymbolic` implements two new methods
`CTermSymbolic.kast_to_kore(KInner) -> Pattern` and
`CTermSymbolic.kore_to_kast(Pattern) -> KInner` as wrappers around the
methods in `konvert` which have the definitions applied, and uses them
in the various methods instead. In particular, that means we do _not_
have fallback to `kast` binary for these methods (instead crashes), but
these codepaths are very well tested now.
- The methods from `KCFGExplore.cterm_*` are moved to the
`CTermSymbolic` class, with the prefix `cterm_` dropped.
- The `KCFGExplore` is updated to use this class instead of a
`KoreClient` directly, and various `*Prover` classes are updated as
well.
- Updates to the testing harness are made:
- A new fixture `CTermSymbolic` is added, for when only that is needed.
- The directory `src/tests/integration/kcfg` is moved to
`src/tests/integration/cterm`, and lowered to `CTermSymbolic` instead of
`KCFGExplore`.

---------

Co-authored-by: devops <devops@runtimeverification.com>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
…erification/pyk#915)

`KCFGExplore` class has grown quite a bit, and broadly contains two
types of things: (i) wrappers around the `KoreClient` for the `CTerm`
class, and (ii) functionalities for manipulating KCFGs using said
wrappers. This PR pulls the first category out into a new submodule of
the `cterm` submodule.

- Module `cterm/symbolic.py` is added, with class `CTermSymbolic`, which
wraps a `KoreClient` and lifts its functionalities to from Kore to
`CTerm` level.
- The class `CTermSymbolic` doesn't need access to a `KPrint`, instead
just a `KDefinition` and a `KompiledKore`.
- The class `CTermSymbolic` implements two new methods
`CTermSymbolic.kast_to_kore(KInner) -> Pattern` and
`CTermSymbolic.kore_to_kast(Pattern) -> KInner` as wrappers around the
methods in `konvert` which have the definitions applied, and uses them
in the various methods instead. In particular, that means we do _not_
have fallback to `kast` binary for these methods (instead crashes), but
these codepaths are very well tested now.
- The methods from `KCFGExplore.cterm_*` are moved to the
`CTermSymbolic` class, with the prefix `cterm_` dropped.
- The `KCFGExplore` is updated to use this class instead of a
`KoreClient` directly, and various `*Prover` classes are updated as
well.
- Updates to the testing harness are made:
- A new fixture `CTermSymbolic` is added, for when only that is needed.
- The directory `src/tests/integration/kcfg` is moved to
`src/tests/integration/cterm`, and lowered to `CTermSymbolic` instead of
`KCFGExplore`.

---------

Co-authored-by: devops <devops@runtimeverification.com>
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.

None yet

3 participants