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

Commit 6ed3f28

Browse files
ehildenbrv-auditor
andauthored
Integrate the APR and APRBMC proof/prover classes into one (#870)
Currently we have a completely separate class hierarchy for `APRProof` and `APRBMCProof` classes, which requires duplicates in the `*Prover` classes and in the `*NodePrinter` classes and in the `*Show` classes. This unifies the classes by making the `bmc_depth` an optional parameter of `APRProof` and tracking the `_bounded` nodes directly in `APRProof`. - `bmc_depth: int | None` is added as a field to `APRProof`, as is the `_bounded: set[int]` set. The various utilities for manipulating the class are updated to account for this. - The `APRProver` class is updated to check if the `bmc_depth` field is present, and if alters its `advance_pending_node` logic to check for loops and take that into account. - The various display classes like `APRNodePrinter` and `APRSummary` are updated. --------- Co-authored-by: devops <[email protected]>
1 parent 170aa33 commit 6ed3f28

File tree

10 files changed

+128
-416
lines changed

10 files changed

+128
-416
lines changed

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
project = 'pyk'
1010
author = 'Runtime Verification, Inc'
1111
copyright = '2024, Runtime Verification, Inc'
12-
version = '0.1.621'
13-
release = '0.1.621'
12+
version = '0.1.622'
13+
release = '0.1.622'
1414

1515
# -- General configuration ---------------------------------------------------
1616
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

package/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.621
1+
0.1.622

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pyk"
7-
version = "0.1.621"
7+
version = "0.1.622"
88
description = ""
99
authors = [
1010
"Runtime Verification, Inc. <[email protected]>",

src/pyk/proof/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .equality import EqualityProof, EqualityProver
22
from .proof import ProofStatus
3-
from .reachability import APRBMCProof, APRBMCProver, APRProof, APRProver
3+
from .reachability import APRProof, APRProver

src/pyk/proof/proof.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ProofStatus(Enum):
2929

3030

3131
class Proof(ABC):
32-
_PROOF_TYPES: Final = {'APRProof', 'APRBMCProof', 'EqualityProof', 'RefutationProof'}
32+
_PROOF_TYPES: Final = {'APRProof', 'EqualityProof', 'RefutationProof'}
3333

3434
id: str
3535
proof_dir: Path | None
@@ -199,7 +199,7 @@ def from_dict(cls: type[Proof], dct: Mapping[str, Any], proof_dir: Path | None =
199199
def read_proof(cls: type[Proof], id: str, proof_dir: Path) -> Proof:
200200
# these local imports allow us to call .to_dict() based on the proof type we read from JSON
201201
from .equality import EqualityProof, RefutationProof # noqa
202-
from .reachability import APRBMCProof, APRProof # noqa
202+
from .reachability import APRProof # noqa
203203

204204
proof_path = proof_dir / f'{hash_str(id)}.json'
205205
if Proof.proof_exists(id, proof_dir):
@@ -216,7 +216,7 @@ def read_proof(cls: type[Proof], id: str, proof_dir: Path) -> Proof:
216216
def read_proof_data(proof_dir: Path, id: str) -> Proof:
217217
# these local imports allow us to call .to_dict() based on the proof type we read from JSON
218218
from .equality import EqualityProof, RefutationProof # noqa
219-
from .reachability import APRBMCProof, APRProof # noqa
219+
from .reachability import APRProof # noqa
220220

221221
proof_path = proof_dir / id / 'proof.json'
222222
if Proof.proof_data_exists(id, proof_dir):

0 commit comments

Comments
 (0)