Skip to content

Commit 4fef74b

Browse files
Make evaluation eager in from_dict (runtimeverification/pyk#769)
Co-authored-by: devops <[email protected]>
1 parent 9cd35cf commit 4fef74b

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

pyk/package/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.539
1+
0.1.540

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

pyk/src/pyk/kore/syntax.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def _tag(cls) -> str:
250250
@classmethod
251251
def from_dict(cls: type[SortApp], dct: Mapping[str, Any]) -> SortApp:
252252
cls._check_tag(dct)
253-
return SortApp(name=dct['name'], sorts=(Sort.from_dict(arg) for arg in dct['args']))
253+
return SortApp(name=dct['name'], sorts=tuple(Sort.from_dict(arg) for arg in dct['args']))
254254

255255
@property
256256
def dict(self) -> dict[str, Any]:
@@ -449,8 +449,8 @@ def from_dict(cls: type[App], dct: Mapping[str, Any]) -> App:
449449
cls._check_tag(dct)
450450
return App(
451451
symbol=dct['name'],
452-
sorts=(Sort.from_dict(sort) for sort in dct['sorts']),
453-
args=(Pattern.from_dict(arg) for arg in dct['args']),
452+
sorts=tuple(Sort.from_dict(sort) for sort in dct['sorts']),
453+
args=tuple(Pattern.from_dict(arg) for arg in dct['args']),
454454
)
455455

456456
@property
@@ -847,9 +847,10 @@ def of(cls: type[And], symbol: str, sorts: Iterable[Sort] = (), patterns: Iterab
847847
@classmethod
848848
def from_dict(cls: type[And], dct: Mapping[str, Any]) -> And:
849849
cls._check_tag(dct)
850-
sort = Sort.from_dict(dct['sort'])
851-
ops = [Pattern.from_dict(op) for op in dct['patterns']]
852-
return And(sort=sort, ops=ops)
850+
return And(
851+
sort=Sort.from_dict(dct['sort']),
852+
ops=tuple(Pattern.from_dict(op) for op in dct['patterns']),
853+
)
853854

854855

855856
@final
@@ -895,9 +896,10 @@ def of(cls: type[Or], symbol: str, sorts: Iterable[Sort] = (), patterns: Iterabl
895896
@classmethod
896897
def from_dict(cls: type[Or], dct: Mapping[str, Any]) -> Or:
897898
cls._check_tag(dct)
898-
sort = Sort.from_dict(dct['sort'])
899-
ops = [Pattern.from_dict(op) for op in dct['patterns']]
900-
return Or(sort=sort, ops=ops)
899+
return Or(
900+
sort=Sort.from_dict(dct['sort']),
901+
ops=tuple(Pattern.from_dict(op) for op in dct['patterns']),
902+
)
901903

902904

903905
class MLQuant(MLPattern, WithSort):

0 commit comments

Comments
 (0)