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

[Bug] [kompile] - Reporting a requires clause variable as RHS #2687

Closed
ehildenb opened this issue Jun 28, 2022 · 1 comment · Fixed by #2690
Closed

[Bug] [kompile] - Reporting a requires clause variable as RHS #2687

ehildenb opened this issue Jun 28, 2022 · 1 comment · Fixed by #2690
Assignees
Labels

Comments

@ehildenb
Copy link
Member

K Version

+ kompile --version
K version:    5.3.0
Build date:   Tue Jun 28 15:38:19 UTC 2022

Actual version: 6f12ca3

Description

A variable on the LHS of the rule is being seen as on teh RHS of the rule for the haskell backend.

Input Files

module TEST
    imports MAP
    imports INT
    imports BOOL

    syntax Pgm ::= "a" | "b"

    rule <k> a => b </k>

    syntax Int ::= f ( Int ) [function, functional, no-evaluators]

    configuration <k> $PGM:Pgm </k>

    rule <k> a => b </k> requires f(_X) ==Int 3

endmodule

Reproduction Steps

+ kompile --backend haskell test.k --main-module TEST --syntax-module TEST
[Error] Compiler: Found variable _X on right hand side of rule, not bound on
left hand side. Did you mean "?_X"?
        Source(/home/dev/src/k/test.k)
        Location(14,37,14,39)
        14 |        rule <k> a => b </k> requires f(_X) ==Int 3
           .                                        ^~
[Error] Compiler: Had 1 structural errors.

Expected Behavior

This should kompile just fine for the haskell backend, variables in the requires clause should be considered as part of LHS for haskell backend.

@ehildenb ehildenb added the bug label Jun 28, 2022
@ehildenb
Copy link
Member Author

Disabling this line of code fixes this:

errors.add(KEMException.compilerError("Found variable " + k.name()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants