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] #Equals of #Equals produces invalid kore #3605

Open
1 of 6 tasks
virgil-serbanuta opened this issue Aug 25, 2023 · 5 comments
Open
1 of 6 tasks

[K-Bug] #Equals of #Equals produces invalid kore #3605

virgil-serbanuta opened this issue Aug 25, 2023 · 5 comments

Comments

@virgil-serbanuta
Copy link
Contributor

What component is the issue in?

Front-End

Which command

  • kompile
  • kast
  • krun
  • kprove
  • kprovex
  • ksearch

What K Version?

v6.0.57-0-ga91e8fd25a-dirty

Operating System

Linux

K Definitions (If Possible)

module A-SYNTAX
  imports BOOL
  syntax A ::= "a" | "b"
endmodule

module A
  import A-SYNTAX
  import INT

  syntax Int ::= #bool(Bool)  [function, total]
  rule #bool(true) => 1
  rule #bool(false) => 0

  rule a => b
    requires true
        #And { { 0 #Equals #bool(B:Bool) } #Equals {false #Equals B} }
endmodule

Steps to Reproduce

$ kompile a.k --backend haskell
kore-exec: [100320] Error (ErrorVerify):
    Error:
      module 'A':
      axiom declaration:
      \rewrites (definition.kore 715:21):
      \and (definition.kore 716:12):
      \equals (definition.kore 718:28):
      \and (definition.kore 719:14):
      \equals (definition.kore 719:63):
      (definition.kore 719:58):
        Sort variable Q10 not declared.
Created bug report: kore-exec.tar.gz
[Error] Critical: Haskell backend reported errors validating compiled
definition.
Examine output to see errors.

Expected Results

The source above should just compile. If that's unfeasible, #Iff should be available (it does not show up in kast.md).

@gtrepta
Copy link
Contributor

gtrepta commented Sep 13, 2023

Is this another problem with the type inferencer, @radumereuta? It complains Sort variable Q10 not declared., but the generated rule has the attribute sortParams({Q10})

The kore term that gets generated:

\equals{SortBool{},SortGeneratedTopCell{}}(
    \and{SortBool{}}(                                                                                                                                                                                                                           \dv{SortBool{}}("true"),                                                                                                                                                                                                                \equals{Q10, SortBool{}}(
            \equals{SortInt{}, Q10}(
                \dv{SortInt{}}("0"),
                Lbl'Hash'bool'LParUndsRParUnds'A'Unds'Int'Unds'Bool{}(VarB:SortBool{})
            ),
            \equals{SortBool{}, Q10}(
                \dv{SortBool{}}("false"),
                VarB:SortBool{}
            )
        )
    ),
    \dv{SortBool{}}("true")
)

@radumereuta
Copy link
Contributor

Ah, I missed this issue. Thank you for adding it to the board.
@virgil-serbanuta can you please add the issues you post in the K repo to the K Development board? Just to make sure we don't miss it.

@gtrepta I'm not sure. It might be an issue with ModuleToKore. This needs more investigation.

@radumereuta
Copy link
Contributor

Try to fix the generated file and see if it passes.
Then we can see if we can fix it when it's being generated.

@gtrepta
Copy link
Contributor

gtrepta commented Sep 14, 2023

I tried changing Q10 to SortK{} and kore-exec stopped complaining about it. I wasn't able to get a full run of it though because the example produced in kore-exec.tar.gz doesn't have an argument for --pattern which kore-exec requires.

@radumereuta
Copy link
Contributor

Check again when we make more progress on: #3601

@gtrepta gtrepta removed their assignment Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants