[Bug] [kompile] - Error with seqstrict/context alias in non-main module
@PetarMax is already working on this.
Since Oct 20, 2022.
Assessment
This issue has not been assessed yet.
Description
K Version
$ kompile --version
K version: v5.3.68-0-g8d3077659-dirty
Build date: Mon Jun 06 15:03:24 BST 2022
Description
kompile reports an error when a module split into syntax and semantics, the former features a rule label used with seqstrict, the latter uses the same label with context alias, and a different module is designated as the main module.
Origin: K Basic Tutorial, Chapter 14, error reported in module LESSON-14-C when compiling with main module LESSON-14-D.
Input Files
File: kompile-bug.k
module BUGGY-MODULE-SYNTAX
imports BOOL-SYNTAX
syntax Exp ::= Bool
> left: Exp "&&" Exp [seqstrict(exp; 1, 2)]
endmodule
module BUGGY-MODULE
imports BUGGY-MODULE-SYNTAX
imports BOOL
context alias [exp]: <k> HERE ...</k>
syntax Bool ::= isKResult(K) [function, symbol]
endmodule
module EMPTY-MODULE
endmodule
File: kompile-no-bug.k
module BUGGY-MODULE
imports BOOL
syntax Exp ::= Bool
> left: Exp "&&" Exp [seqstrict(exp; 1, 2)]
context alias [exp]: <k> HERE ...</k>
syntax Bool ::= isKResult(K) [function, symbol]
endmodule
module EMPTY-MODULE
endmodule
Reproduction Steps
Run kompile with EMPTY-MODULE as the main module:
$ kompile kompile-bug.k --main-module EMPTY-MODULE
[Error] Compiler: Found rule label "exp" in strictness attribute which did not
refer to any sentence.
Source(/Users/petarmax/Projects/RV/Tutorial/01 - Basic/14/kompile-bug.k)
Location(5,24,5,59)
5 | > left: Exp "&&" Exp [seqstrict(exp; 1, 2)]
. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Warning] Compiler: Could not find main syntax module with name
EMPTY-MODULE-SYNTAX in definition. Use --syntax-module to specify one. Using
EMPTY-MODULE as default.
Note 1: Running kompile with BUGGY-MODULE as main module succeeds:
$ kompile kompile-bug.k --main-module BUGGY-MODULE
$
Note 2: When the syntax is not separate from the semantics (kompile-no-bug.k), the error disappears:
$ kompile kompile-no-bug.k --main-module EMPTY-MODULE
[Warning] Compiler: Could not find main syntax module with name
EMPTY-MODULE-SYNTAX in definition. Use --syntax-module to specify one. Using
EMPTY-MODULE as default.
Expected Behavior
Successful compilation, no errors reported.
- 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