kompile should disallow duplicate productions

Open
#2,257 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Domain
cli, compilers

Research direction

Start by running kompile tmp.k with the reproduction input to confirm the duplicate productions are accepted. Trace the kompile validation path for duplicate productions; done means this input fails to compile with an error while valid definitions continue to compile.

Written by the indexing model from the issue text.

Description

bug

K Version

$ kompile --version
K version:    v5.1.219-0-g30d285a844-dirty

Description

kompile should give an error on definitions with more than one duplicate production

Input Files

module TMP
  imports BOOL
  imports INT
  imports K-EQUAL

  syntax KItem ::= a(Int)
  syntax Int ::= f(Int)  [function, functional]
  syntax Int ::= f(Int)  [function, functional, smtlib(asdf)]

  rule f(0) => 0
  rule f(_) => 1  [owise]

  rule f(_) >Int -1 => true  [simplification, smt-lemma]

  rule a(X) => .K requires f(X) >=Int -1

endmodule

Reproduction Steps

kompile tmp.k

Expected Behavior

The above file should not compile successfully.

Dominant language
Python
Stars
591
Forks
163
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from runtimeverification/k

All issues in runtimeverification/k

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.