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

Commit e68db42

Browse files
Implement KAST-to-KORE conversion of symbol declarations (#861)
Process attributes on symbol productions (i.e. productions with at least one non-terminal that are not `bracket` productions), then transform these productions to KORE symbol declarations. Attributes that are addressed: * `hook` * `macro` * `anywhere` * `function` * `injective` * `constructor` Attributes that are not addressed: * `colors`, `format`, `left`, `priorities`, `right`, `strict`, `terminals` is ignored by the test * `production` is discarded by the transformation --------- Co-authored-by: devops <[email protected]>
1 parent e151952 commit e68db42

File tree

6 files changed

+424
-30
lines changed

6 files changed

+424
-30
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.618'
13-
release = '0.1.618'
12+
version = '0.1.619'
13+
release = '0.1.619'
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.618
1+
0.1.619

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

src/pyk/kast/kast.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,34 @@ def _as_shallow_tuple(self) -> tuple[Any, ...]:
5656
class KAtt(KAst, Mapping[str, Any]):
5757
atts: FrozenDict[str, Any]
5858

59-
SORT: ClassVar[str] = 'org.kframework.kore.Sort'
60-
LOCATION: ClassVar[str] = 'org.kframework.attributes.Location'
61-
SOURCE: ClassVar[str] = 'org.kframework.attributes.Source'
62-
HOOK: ClassVar[str] = 'hook'
59+
ALIAS: ClassVar[str] = 'alias'
60+
ALIAS_REC: ClassVar[str] = 'alias-rec'
61+
ANYWHERE: ClassVar[str] = 'anywhere'
62+
ASSOC: ClassVar[str] = 'assoc'
63+
COLORS: ClassVar[str] = 'colors'
64+
COMM: ClassVar[str] = 'comm'
6365
CONCAT: ClassVar[str] = 'concat'
66+
CONSTRUCTOR: ClassVar[str] = 'constructor'
6467
ELEMENT: ClassVar[str] = 'element'
65-
UNIT: ClassVar[str] = 'unit'
66-
KLABEL: ClassVar[str] = 'klabel'
68+
FORMAT: ClassVar[str] = 'format'
69+
FUNCTION: ClassVar[str] = 'function'
70+
FUNCTIONAL: ClassVar[str] = 'functional'
6771
HAS_DOMAIN_VALUES: ClassVar[str] = 'hasDomainValues'
72+
HOOK: ClassVar[str] = 'hook'
73+
IDEM: ClassVar[str] = 'idem'
74+
INJECTIVE: ClassVar[str] = 'injective'
75+
KLABEL: ClassVar[str] = 'klabel'
76+
LEFT: ClassVar[str] = 'left'
77+
LOCATION: ClassVar[str] = 'org.kframework.attributes.Location'
78+
MACRO: ClassVar[str] = 'macro'
79+
MACRO_REC: ClassVar[str] = 'macro-rec'
80+
PRODUCTION: ClassVar[str] = 'org.kframework.definition.Production'
81+
RIGHT: ClassVar[str] = 'right'
82+
SORT: ClassVar[str] = 'org.kframework.kore.Sort'
83+
SOURCE: ClassVar[str] = 'org.kframework.attributes.Source'
6884
TOKEN: ClassVar[str] = 'token'
85+
TOTAL: ClassVar[str] = 'total'
86+
UNIT: ClassVar[str] = 'unit'
6987

7088
def __init__(self, atts: Mapping[str, Any] = EMPTY_FROZEN_DICT):
7189
def _freeze(m: Any) -> Any:

0 commit comments

Comments
 (0)