Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[K-Bug] The LLVM backend ignores rule priorities #4676

Open
1 of 6 tasks
virgil-serbanuta opened this issue Oct 25, 2024 · 0 comments
Open
1 of 6 tasks

[K-Bug] The LLVM backend ignores rule priorities #4676

virgil-serbanuta opened this issue Oct 25, 2024 · 0 comments

Comments

@virgil-serbanuta
Copy link
Contributor

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant