-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Type compatibility error message, when reading from .cfg #2757
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
37aafa4
Manual type check
Kukovec 5335e0e
regression
Kukovec c7417b8
test files
Kukovec 72aaea0
UL support
Kukovec 64671f3
.
Kukovec 4e41ba5
Merge branch 'main' into jk/2750
Kukovec fb952ff
Update test/tla/Bug2750.cfg
Kukovec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\* Add statements after this line. | ||
SPECIFICATION Spec | ||
CONSTANTS | ||
Producers = {p1,p2} | ||
Consumers = {c1,c2} | ||
BufCapacity = 1 | ||
INVARIANT Inv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--------------------------- MODULE Bug2750 --------------------------- | ||
(***************************************************************************) | ||
(* Original problem and spec by Michel Charpentier *) | ||
(* http://www.cs.unh.edu/~charpov/programming-tlabuffer.html *) | ||
(***************************************************************************) | ||
EXTENDS Naturals, Sequences | ||
|
||
CONSTANTS | ||
\* @type: Set(PROC); | ||
Producers, (* the (nonempty) set of producers *) | ||
\* @type: Set(PROC); | ||
Consumers, (* the (nonempty) set of consumers *) | ||
\* @type: Int; | ||
BufCapacity (* the maximum number of messages in the bounded buffer *) | ||
|
||
ASSUME Assumption == | ||
/\ Producers # {} (* at least one producer *) | ||
/\ Consumers # {} (* at least one consumer *) | ||
/\ Producers \intersect Consumers = {} (* no thread is both consumer and producer *) | ||
/\ BufCapacity \in (Nat \ {0}) (* buffer capacity is at least 1 *) | ||
|
||
----------------------------------------------------------------------------- | ||
|
||
VARIABLES | ||
\* @type: Seq(PROC); | ||
buffer, | ||
\* @type: Set(PROC); | ||
waitP, | ||
\* @type: Set(PROC); | ||
waitC | ||
|
||
(* define statement *) | ||
isfull(b) == Len(b) = BufCapacity | ||
isempty(b) == Len(b) = 0 | ||
|
||
\* @type: << Seq(PROC), Set(PROC), Set(PROC) >>; | ||
vars == << buffer, waitP, waitC >> | ||
|
||
ProcSet == (Producers) \cup (Consumers) | ||
|
||
Init == (* Global variables *) | ||
/\ buffer = << >> | ||
/\ waitP = {} | ||
/\ waitC = {} | ||
|
||
p(self) == /\ (self \notin waitP) | ||
/\ IF isfull(buffer) | ||
THEN /\ IF self \in Producers | ||
THEN /\ waitP' = (waitP \union {self}) | ||
/\ waitC' = waitC | ||
ELSE /\ waitC' = (waitC \union {self}) | ||
/\ waitP' = waitP | ||
/\ UNCHANGED buffer | ||
ELSE /\ buffer' = Append(buffer, self) | ||
/\ IF waitC # {} | ||
THEN /\ \E t \in waitC: | ||
waitC' = waitC \ {t} | ||
ELSE /\ TRUE | ||
/\ waitC' = waitC | ||
/\ waitP' = waitP | ||
|
||
c(self) == /\ (self \notin waitC) | ||
/\ IF isempty(buffer) | ||
THEN /\ IF self \in Producers | ||
THEN /\ waitP' = (waitP \union {self}) | ||
/\ waitC' = waitC | ||
ELSE /\ waitC' = (waitC \union {self}) | ||
/\ waitP' = waitP | ||
/\ UNCHANGED buffer | ||
ELSE /\ buffer' = Tail(buffer) | ||
/\ IF waitP # {} | ||
THEN /\ \E t \in waitP: | ||
waitP' = waitP \ {t} | ||
ELSE /\ TRUE | ||
/\ waitP' = waitP | ||
/\ waitC' = waitC | ||
|
||
Next == (\E self \in Producers: p(self)) | ||
\/ (\E self \in Consumers: c(self)) | ||
|
||
Spec == Init /\ [][Next]_vars | ||
|
||
\* END TRANSLATION | ||
|
||
Inv == ~(waitP = Producers /\ waitC = Consumers) | ||
|
||
============================================================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
INIT | ||
Init | ||
NEXT | ||
Next | ||
INVARIANT | ||
Inv | ||
CONSTANT | ||
C = "1_OF_A" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
----------------------- MODULE Test2750 ----------------------------- | ||
VARIABLES | ||
\* @type: A; | ||
x | ||
|
||
CONSTANT | ||
\* @type: A; | ||
C | ||
|
||
|
||
Init == | ||
/\ x = C | ||
|
||
Next == | ||
UNCHANGED x | ||
|
||
Inv == TRUE | ||
|
||
=============================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between
ConfigModelValue
andConfigStrValue
now? It looks likeConfigStrValue
handles model values too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigModelValue
is what you get when TLC model values are parsed (e.g.a
andb
inProducers = {a,b}
).ConfigStrValue
is what you get when a"
-value is parsed (e.g."abc"
or"1_OF_X"
)