Replies: 6 comments
-
This is not a bug, you're using uninterpreted types, described here. |
Beta Was this translation helpful? Give feedback.
-
The minimal-edit fix to your spec is changing the lines to Ids == { "0_OF_ID", "1_OF_ID"}
Names == { "leslie_OF_NAME", "ada_OF_NAME" } You might want them in this form, if you're going to be using some of the name literals explicitly: leslie == "leslie_OF_NAME"
ada == "ada_OF_NAME"
Names == { leslie, ada } |
Beta Was this translation helpful? Give feedback.
-
I'm aware of type aliases, as you'll see in my example. How would they help me here? The |
Beta Was this translation helpful? Give feedback.
-
Another alternative would have been to define CONSTANT
\* @type: Set($id);
Ids,
...
\* @typeAlias: id = Int;
Ids == { 0, 1} |
Beta Was this translation helpful? Give feedback.
-
The downside would be that the inner module would cease to be type-checkable in a vacuum. Uninterpreted literals are the better solution, IMO. |
Beta Was this translation helpful? Give feedback.
-
Just to give you a bit more context. The string literals of the form Hence, the type checker behaves as expected. It may be confusing, since we also changed the notation for uninterpreted types and values, before we found this relatively simple solution. Although it is not a bug, it is an interesting discussion. I will convert it to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Description
When I have a module which has some
CONSTANTS
like:I expect to be able to substitute these with concrete values for model checking and/or unit tests, like so:
Or maybe even like so:
However, it reports type checking errors, saying it expected
ID
but foundInt
, or expectedNAME
but foundStr
.Is this a known problem? Am I doing it wrong? Can anybody point me to the part of the code where I might be able to fix this?
Impact
Not terrible, but I can't typecheck my unit test modules.
Input specification
The command line parameters used to run the tool
Log files
CLI output:
And the output when trying to annotate the concrete sets with
Set(ID)
orSet(NAME)
:System information
apalache-mc version
]:main
built from sourceTriage checklist (for maintainers)
Beta Was this translation helpful? Give feedback.
All reactions