Consolidate special collection attributes
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Read kernel/src/main/java/org/kframework/backend/kore/ModuleToKORE.java at the special-sort handling and attribute extraction, then compare the corresponding declarations in k-distribution/include/kframework/builtin/domains.md. Decide on a single representation for collection attributes and ensure generated KORE declarations include the required concat, element, unit, and hook metadata exactly for special collection sorts.
Written by the indexing model from the issue text.
Description
Module-to-KORE conversion defines a few special collection sorts:
SET.Set
MAP.Map
LIST.List
ARRAY.Array
RANGEMAP.RangeMap
When generating the KORE declarations for these sorts, a few special attributes are included:
hooked-sort SortSet{} [
concat{}(Lbl'Unds'Set'Unds'{}()),
element{}(LblSetItem{}()), hook{}("SET.Set"),
unit{}(Lbl'Stop'Set{}()),
...
]
The source of these attributes is the corresponding concat production: https://github.com/runtimeverification/k/blob/7d5882aa7a28139cb733bfadedf36794a360a60b/k-distribution/include/kframework/builtin/domains.md?plain=1#L721
In particular, concat is taken from the klabel, whereas element and unit are taken from the respective K attribute (source).
There are two approaches this for improving on this.
- A single multiary attribute on the concat production
syntax Set ::= Set Set [concat(SetItem, .Set)]
- A family of nullary attributes, each on the corresponding production
syntax Set [collection] // When this is defined, the corresponding productions are checked for existence and well-sortedness
syntax Set ::= Set Set [concat]
syntax Set ::= SetItem(KItem) [element]
syntax Set ::= ".Set" [unit]
If collections require special handling on the backend, then it should also be ensured that the corresponding attributes are included exactly on the special collection sorts.
- Dominant language
- Python
- Stars
- 591
- Forks
- 163
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from runtimeverification/k
-
runtimeverification/k#4939 · 1 assignee ·
-
Concolic Explorer Open
Difficulty 5/5 Over a week Newbie friendliness 32/100
runtimeverification/k#4937 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
runtimeverification/k#4936 ·
-
type:epic
runtimeverification/k#4934 · 4 comments · 1 assignee ·
-
runtimeverification/k#4924 · 1 assignee ·
All issues in runtimeverification/k
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100