[K-Bug] The LLVM backend ignores rule priorities
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- linux
- Domain
- compilers
Research direction
Start with the minimal definition in a.k and input in a.in, then run kompile followed by krun to reproduce the LLVM backend result. Compare the priority and requires cases described in the issue; done means both produce b rather than c and neither enters an infinite loop.
Written by the indexing model from the issue text.
Description
What component is the issue in?
llvm-backend
Which command
- kompile
- kast
- krun
- kprove
- kprovex
- ksearch
What K Version?
v7.1.164-0-g459fdd7b84
Operating System
Linux
K Definitions (If Possible)
a.k:
module A
imports K-EQUAL-SYNTAX
syntax Stuff ::= "a" | "b" | "c"
rule A:Stuff => b requires A ==K a [priority(10)]
rule a => c
endmodule
Steps to Reproduce
use this a.in file:
a
Then, kompile a.k && krun a.in produces
<k>
c ~> .K
</k>
This is wrong, it should have produced b instead of c.
A few more notes:
Commenting out rule a => c produces b as a result. Removing the requires clause from rule A:Stuff => b requires A ==K a makes the backend enter an infinite loop. Replacing the same rule with rule a => b, while keeping the priority produces the expected result.
Expected Results
The command above should have produced this (both in the main case described above and in the infinite loop one):
<k>
b ~> .K
</k>
- 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