[K-Bug] Two configuration declarations in a single module produces an unhelpful error message

Open
#4,705 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
compilers

Research direction

Start by saving the provided definition as tmp.k and running kompile tmp.k to reproduce the malformed external cell error. Trace the configuration-declaration validation in the kompile front end; done means two declarations in one module produce a clear diagnostic explaining the one-declaration limit and how to resolve it.

Written by the indexing model from the issue text.

Description

What component is the issue in?

Front-End

Which command
  • kompile
  • kast
  • krun
  • kprove
  • kprovex
  • ksearch
What K Version?

v7.1.170-0-g5c84d48f69

Operating System

Linux

K Definitions (If Possible)
module TMP
  imports INT
  configuration <extraLocalConfig> 1 </extraLocalConfig>
  configuration <mainConfig> <extraLocalConfig/> </mainConfig>
endmodule
Steps to Reproduce

Save above definition to tmp.k and run kompile tmp.k.

An error message of the form below will be emitted:

[Error] Compiler: Malformed external cell in configuration declaration.
        Source(/home/stephen/rv/tmp.k)
        Location(4,30,4,49)
        4 |       configuration <mainConfig> <extraLocalConfig/> </mainConfig>
          .                                  ^~~~~~~~~~~~~~~~~~~
[Error] Compiler: Had 1 parsing errors.
Expected Results

I expect to get an error that says something like:

A module may only have up to one configuration declaration; please merge the two configuration declarations into one (or) put the two configuration declarations into separate modules.

I just made this on the fly --- there is definitely a better way to word it, but this is just for a start.

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.