From e1b9407afc8cce2be00ff83101e29b2dd16844eb Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Fri, 23 Feb 2024 17:34:15 -0700 Subject: [PATCH] Add cterm module for cterm.py (#912) We've had `cterm.py` at the top-level of the pyk library. This moves it into a submodule in preparation for refactors to `KCFGExplore` to factor out basic cterm manipulation commands from more complicated KCFG manipulation commands. - `cterm.py` is moved to `cterm/cterm.py`. Imports are adjusted. - `cterm/__init__.py` is added, and setup so that almost no imports elsewhere need to change. --------- Co-authored-by: devops --- docs/conf.py | 4 ++-- package/version | 2 +- pyproject.toml | 2 +- src/pyk/cterm/__init__.py | 1 + src/pyk/{ => cterm}/cterm.py | 18 +++++++++--------- 5 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 src/pyk/cterm/__init__.py rename src/pyk/{ => cterm}/cterm.py (97%) diff --git a/docs/conf.py b/docs/conf.py index 0827ccb8d..c0d5fe413 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,8 +9,8 @@ project = 'pyk' author = 'Runtime Verification, Inc' copyright = '2024, Runtime Verification, Inc' -version = '0.1.650' -release = '0.1.650' +version = '0.1.651' +release = '0.1.651' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/package/version b/package/version index d79f29315..3b0aef7c2 100644 --- a/package/version +++ b/package/version @@ -1 +1 @@ -0.1.650 +0.1.651 diff --git a/pyproject.toml b/pyproject.toml index 52e48308c..ec5c676bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "pyk" -version = "0.1.650" +version = "0.1.651" description = "" authors = [ "Runtime Verification, Inc. ", diff --git a/src/pyk/cterm/__init__.py b/src/pyk/cterm/__init__.py new file mode 100644 index 000000000..9993912f6 --- /dev/null +++ b/src/pyk/cterm/__init__.py @@ -0,0 +1 @@ +from .cterm import CSubst, CTerm, build_claim, build_rule diff --git a/src/pyk/cterm.py b/src/pyk/cterm/cterm.py similarity index 97% rename from src/pyk/cterm.py rename to src/pyk/cterm/cterm.py index 2c6e6e01e..86aca0f7f 100644 --- a/src/pyk/cterm.py +++ b/src/pyk/cterm/cterm.py @@ -5,9 +5,9 @@ from itertools import chain from typing import TYPE_CHECKING -from .kast import Atts, KAtt, KInner -from .kast.inner import KApply, KRewrite, KToken, KVariable, Subst, bottom_up -from .kast.manip import ( +from ..kast import Atts, KAtt, KInner +from ..kast.inner import KApply, KRewrite, KToken, KVariable, Subst, bottom_up +from ..kast.manip import ( abstract_term_safely, apply_existential_substitutions, count_vars, @@ -19,17 +19,17 @@ split_config_and_constraints, split_config_from, ) -from .kast.outer import KClaim, KRule -from .prelude.k import GENERATED_TOP_CELL -from .prelude.kbool import andBool, orBool -from .prelude.ml import is_bottom, is_top, mlAnd, mlBottom, mlEqualsTrue, mlImplies, mlTop -from .utils import single, unique +from ..kast.outer import KClaim, KRule +from ..prelude.k import GENERATED_TOP_CELL +from ..prelude.kbool import andBool, orBool +from ..prelude.ml import is_bottom, is_top, mlAnd, mlBottom, mlEqualsTrue, mlImplies, mlTop +from ..utils import single, unique if TYPE_CHECKING: from collections.abc import Iterable, Iterator from typing import Any - from .kast.outer import KDefinition + from ..kast.outer import KDefinition @dataclass(frozen=True, order=True)