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

quint verify fails when --invariant is not Boolean #1460

Open
konnov opened this issue Jul 10, 2024 · 2 comments
Open

quint verify fails when --invariant is not Boolean #1460

konnov opened this issue Jul 10, 2024 · 2 comments
Labels
error messages Collects issues steming from poor error messages

Comments

@konnov
Copy link
Contributor

konnov commented Jul 10, 2024

Consider the following spec:

module t {                                                                                                                              
  var x: int
  val DEFAULT = 0
  action init = x' = DEFAULT
  action step = x' = x + 1
}

Execute the following command:

quint verify --invariant=DEFAULT t.qnt
error: internal error: while parsing in Apalache:
'key not found: 22'
Please report an issue: https://github.com/informalsystems/quint/issues/new 

The reason for the failure is that DEFAULT is not a value of type bool. Unfortunately, it's impossible to figure that out from the error message. It would be great, if quint verify could print a readable error message.

@bugarela bugarela added the error messages Collects issues steming from poor error messages label Jul 18, 2024
@bugarela
Copy link
Collaborator

The error for quint run is not so bad, but it should also be a proper error (this one is throwing). Commenting here since the fix for both should be the same.

Error: Expected a Boolean value
    at RuntimeValueInt.toBool (/home/gabriela/projects/quint/quint/dist/src/runtime/impl/runtimeValue.js:366:19)
    at isTrue (/home/gabriela/projects/quint/quint/dist/src/runtime/impl/compilerImpl.js:1268:55)
    at /home/gabriela/projects/quint/quint/dist/src/runtime/impl/compilerImpl.js:1300:30
    at EitherConstructor.chain (/home/gabriela/projects/quint/quint/node_modules/@sweet-monads/either/cjs/index.js:119:16)
    at doRun (/home/gabriela/projects/quint/quint/dist/src/runtime/impl/compilerImpl.js:1266:18)
    at Object.eval (/home/gabriela/projects/quint/quint/dist/src/runtime/impl/base.js:98:20)
    at compileAndRun (/home/gabriela/projects/quint/quint/dist/src/simulation.js:75:19)
    at runSimulator (/home/gabriela/projects/quint/quint/dist/src/cliCommands.js:422:51)
    at EitherConstructor.asyncChain (/home/gabriela/projects/quint/quint/node_modules/@sweet-monads/either/cjs/index.js:125:16)
    at /home/gabriela/projects/quint/quint/dist/src/cli.js:60:39

@konnov
Copy link
Contributor Author

konnov commented Jul 22, 2024

The error for quint run is not so bad, but it should also be a proper error (this one is throwing). Commenting here since the fix for both should be the same.

Error: Expected a Boolean value

Yeah, I agree that this error would give the user a slight better hint about what is going on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Collects issues steming from poor error messages
Projects
None yet
Development

No branches or pull requests

2 participants