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

Commit 9715693

Browse files
Make constraints optional in CTerm initializer (#493)
Fixes #295 --------- Co-authored-by: devops <[email protected]>
1 parent e3ef933 commit 9715693

File tree

8 files changed

+7
-11
lines changed

8 files changed

+7
-11
lines changed

package/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.330
1+
0.1.331

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.330"
7+
version = "0.1.331"
88
description = ""
99
authors = [
1010
"Runtime Verification, Inc. <[email protected]>",

src/pyk/cterm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CTerm:
3434
config: KInner # TODO Optional?
3535
constraints: tuple[KInner, ...]
3636

37-
def __init__(self, config: KInner, constraints: Iterable[KInner]) -> None:
37+
def __init__(self, config: KInner, constraints: Iterable[KInner] = ()) -> None:
3838
self._check_config(config)
3939
constraints = self._normalize_constraints(constraints)
4040
object.__setattr__(self, 'config', config)

src/tests/integration/kcfg/test_cell_map.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def _parse(kt: KToken) -> KInner:
8585
KApply('<accounts>', _accounts),
8686
KVariable('GENERATED_COUNTER_CELL'),
8787
),
88-
(),
8988
)
9089

9190
@pytest.mark.parametrize(

src/tests/integration/kcfg/test_imp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ def config(kprint: KPrint, k: str, state: str, constraint: KInner | None = None)
533533
),
534534
KVariable('GENERATED_COUNTER_CELL'),
535535
),
536-
(),
537536
)
538537
if constraint is not None:
539538
_config = _config.add_constraint(constraint)

src/tests/integration/kprove/test_prove_cterm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ def test_prove_cterm(
5252
expected_next_states: Iterable[tuple[str, str]],
5353
) -> None:
5454
def config(k: str, state: str) -> CTerm:
55-
return CTerm(
56-
KApply('<T>', (KApply('<k>', (KToken(k, 'K'),)), KApply('<state>', (KToken(state, 'Map'),)))), ()
57-
)
55+
return CTerm(KApply('<T>', (KApply('<k>', (KToken(k, 'K'),)), KApply('<state>', (KToken(state, 'Map'),)))))
5856

5957
# Given
6058
state = '.Map'

src/tests/unit/test_cterm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636

3737
def _as_cterm(term: KInner) -> CTerm:
38-
return CTerm(KApply(KLabel('<generatedTop>', GENERATED_TOP_CELL), term), ())
38+
return CTerm(KApply(KLabel('<generatedTop>', GENERATED_TOP_CELL), term))
3939

4040

4141
MATCH_TEST_DATA: Final[tuple[tuple[KInner, KInner], ...]] = (

src/tests/unit/test_kcfg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ def test_cover_then_remove() -> None:
243243
cfg = KCFG()
244244

245245
# When
246-
node1 = cfg.create_node(CTerm(KApply('<top>', token(1)), ()))
247-
node2 = cfg.create_node(CTerm(KApply('<top>', KVariable('X')), ()))
246+
node1 = cfg.create_node(CTerm(KApply('<top>', token(1))))
247+
node2 = cfg.create_node(CTerm(KApply('<top>', KVariable('X'))))
248248
cover = cfg.create_cover(node1.id, node2.id)
249249

250250
# Then

0 commit comments

Comments
 (0)