Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tla2bAST
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tla2bAST
Commits
42f4b4b0
Commit
42f4b4b0
authored
Mar 23, 2021
by
Michael Leuschel
Browse files
Options
Downloads
Patches
Plain Diff
fix new UNCHANGED treatment also for tuples
e.g., required for Bakery example
parent
6f022bbb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tla2bAst/BAstCreator.java
+19
-13
19 additions, 13 deletions
src/main/java/de/tla2bAst/BAstCreator.java
with
19 additions
and
13 deletions
src/main/java/de/tla2bAst/BAstCreator.java
+
19
−
13
View file @
42f4b4b0
...
...
@@ -2189,15 +2189,9 @@ public class BAstCreator extends BuiltInOPs
case
OPCODE_unchanged:
{
OpApplNode
node
=
(
OpApplNode
)
n
.
getArgs
()[
0
];
// System.out.println(" Translating UNCHANGED : " + node.toString());
// System.out.println(" Top-level unchanged for this operation: " + this.toplevelUnchangedVariableNames);
if
(
node
.
getOperator
().
getKind
()
==
VariableDeclKind
)
{
if
(!
this
.
toplevelUnchangedVariableNames
.
contains
(
getName
(
node
.
getOperator
())))
{
AEqualPredicate
equal
=
new
AEqualPredicate
();
equal
.
setLeft
(
createIdentifierNode
(
getName
(
node
.
getOperator
())
+
"_n"
));
equal
.
setRight
(
createIdentifierNode
(
node
.
getOperator
()));
return
equal
;
}
else
{
return
new
AEqualPredicate
(
new
ABooleanTrueExpression
(),
new
ABooleanTrueExpression
());
}
return
CreateUnchangedPrimeEquality
(
node
);
}
else
if
(
node
.
getOperator
().
getKind
()
==
UserDefinedOpKind
)
{
OpDefNode
operator
=
(
OpDefNode
)
node
.
getOperator
();
...
...
@@ -2209,10 +2203,7 @@ public class BAstCreator extends BuiltInOPs
ArrayList
<
PPredicate
>
list
=
new
ArrayList
<
PPredicate
>();
for
(
int
i
=
0
;
i
<
node
.
getArgs
().
length
;
i
++)
{
OpApplNode
var
=
(
OpApplNode
)
node
.
getArgs
()[
i
];
AEqualPredicate
equal
=
new
AEqualPredicate
();
equal
.
setLeft
(
createIdentifierNode
(
getName
(
var
.
getOperator
())
+
"_n"
));
equal
.
setRight
(
createIdentifierNode
(
var
.
getOperator
()));
list
.
add
(
equal
);
list
.
add
(
CreateUnchangedPrimeEquality
(
var
));
}
returnNode
=
createConjunction
(
list
);
// returnNode = new AEqualPredicate(new ABooleanTrueExpression(),
...
...
@@ -2248,6 +2239,21 @@ public class BAstCreator extends BuiltInOPs
return
createPositionedNode
(
returnNode
,
n
);
}
// create an equality predicate var_n = var if required
private
AEqualPredicate
CreateUnchangedPrimeEquality
(
OpApplNode
var
)
{
if
(!
this
.
toplevelUnchangedVariableNames
.
contains
(
getName
(
var
.
getOperator
())))
{
AEqualPredicate
equal
=
new
AEqualPredicate
();
equal
.
setLeft
(
createIdentifierNode
(
getName
(
var
.
getOperator
())
+
"_n"
));
equal
.
setRight
(
createIdentifierNode
(
var
.
getOperator
()));
return
equal
;
}
else
{
// the variable is marked UNCHANGED in a top-level UNCHANGED predicate
// Hence it will not be added to the ANY variables and we do not need it
return
new
AEqualPredicate
(
new
ABooleanTrueExpression
(),
new
ABooleanTrueExpression
());
}
}
public
PPredicate
visitBoundsOfLocalVariables
(
OpApplNode
n
)
{
FormalParamNode
[][]
params
=
n
.
getBdedQuantSymbolLists
();
ExprNode
[]
in
=
n
.
getBdedQuantBounds
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment