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
9b3e6f0d
Commit
9b3e6f0d
authored
1 year ago
by
Jan Gruteser
Browse files
Options
Downloads
Patches
Plain Diff
cleanup and fix imported module in real tests
parent
1c64c81f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#134729
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/tla2b/analysis/SymbolRenamer.java
+5
-6
5 additions, 6 deletions
src/main/java/de/tla2b/analysis/SymbolRenamer.java
src/test/java/de/tla2b/typechecking/standardmodules/TestModuleReals.java
+6
-7
6 additions, 7 deletions
...e/tla2b/typechecking/standardmodules/TestModuleReals.java
with
11 additions
and
13 deletions
src/main/java/de/tla2b/analysis/SymbolRenamer.java
+
5
−
6
View file @
9b3e6f0d
...
...
@@ -21,7 +21,7 @@ import tlc2.tool.BuiltInOPs;
public
class
SymbolRenamer
extends
BuiltInOPs
implements
TranslationGlobals
,
ASTConstants
{
private
final
static
Set
<
String
>
KEYWORDS
=
new
HashSet
<
String
>();
private
final
static
Set
<
String
>
KEYWORDS
=
new
HashSet
<>();
static
{
KEYWORDS
.
add
(
"seq"
);
KEYWORDS
.
add
(
"left"
);
...
...
@@ -71,12 +71,11 @@ public class SymbolRenamer extends BuiltInOPs implements TranslationGlobals,
KEYWORDS
.
add
(
"CONSTRAINTS"
);
KEYWORDS
.
add
(
"MODEL"
);
KEYWORDS
.
add
(
"SYSTEM"
);
KEYWORDS
.
add
(
"MACHINE"
);
KEYWORDS
.
add
(
"EVENTS"
);
KEYWORDS
.
add
(
"OPERATIONS"
);
}
private
final
static
Hashtable
<
String
,
String
>
INFIX_OPERATOR
=
new
Hashtable
<
String
,
String
>();
private
final
static
Hashtable
<
String
,
String
>
INFIX_OPERATOR
=
new
Hashtable
<>();
static
{
INFIX_OPERATOR
.
put
(
"!!"
,
"exclamationmark2"
);
INFIX_OPERATOR
.
put
(
"??"
,
"questionmark2"
);
...
...
@@ -98,7 +97,7 @@ public class SymbolRenamer extends BuiltInOPs implements TranslationGlobals,
INFIX_OPERATOR
.
put
(
"..."
,
"dot3"
);
}
private
final
static
Hashtable
<
String
,
String
>
BBUILTIN_OPERATOR
=
new
Hashtable
<
String
,
String
>();
private
final
static
Hashtable
<
String
,
String
>
BBUILTIN_OPERATOR
=
new
Hashtable
<>();
static
{
BBUILTIN_OPERATOR
.
put
(
"+"
,
"plus"
);
BBUILTIN_OPERATOR
.
put
(
"-"
,
"minus"
);
...
...
@@ -117,8 +116,8 @@ public class SymbolRenamer extends BuiltInOPs implements TranslationGlobals,
private
final
ModuleNode
moduleNode
;
private
final
Set
<
OpDefNode
>
usedDefinitions
;
private
final
Set
<
String
>
globalNames
=
new
HashSet
<
String
>();
private
final
Hashtable
<
OpDefNode
,
Set
<
String
>>
usedNamesTable
=
new
Hashtable
<
OpDefNode
,
Set
<
String
>
>();
private
final
Set
<
String
>
globalNames
=
new
HashSet
<>();
private
final
Hashtable
<
OpDefNode
,
Set
<
String
>>
usedNamesTable
=
new
Hashtable
<>();
public
SymbolRenamer
(
ModuleNode
moduleNode
,
SpecAnalyser
specAnalyser
)
{
this
.
moduleNode
=
moduleNode
;
...
...
This diff is collapsed.
Click to expand it.
src/test/java/de/tla2b/typechecking/standardmodules/TestModuleReals.java
+
6
−
7
View file @
9b3e6f0d
...
...
@@ -55,7 +55,7 @@ public class TestModuleReals {
+
"EXTENDS Reals \n"
+
"ASSUME -1 = -1.0 \n"
+
"================================="
;
TestTypeChecker
t
=
TestUtil
.
typeCheckString
(
module
);
TestUtil
.
typeCheckString
(
module
);
}
@Test
(
expected
=
TypeErrorException
.
class
)
...
...
@@ -100,7 +100,7 @@ public class TestModuleReals {
@Test
public
void
testArithmeticOperators
()
throws
TLA2BException
{
final
String
module
=
"-------------- MODULE Testing ----------------\n"
+
"EXTENDS
Natur
als \n"
+
"EXTENDS
Re
als \n"
+
"ASSUME 2.0 = 1.0 + 1.0 \n"
+
"================================="
;
TestUtil
.
typeCheckString
(
module
);
...
...
@@ -109,7 +109,7 @@ public class TestModuleReals {
@Test
(
expected
=
TypeErrorException
.
class
)
public
void
testArithmeticOperatorsException1
()
throws
TLA2BException
{
final
String
module
=
"-------------- MODULE Testing ----------------\n"
+
"EXTENDS
Natur
als \n"
+
"EXTENDS
Re
als \n"
+
"ASSUME TRUE = 1.0 + 1.0 \n"
+
"================================="
;
TestUtil
.
typeCheckString
(
module
);
...
...
@@ -118,7 +118,7 @@ public class TestModuleReals {
@Test
(
expected
=
TypeErrorException
.
class
)
public
void
testArithmeticOperatorsException2
()
throws
TLA2BException
{
final
String
module
=
"-------------- MODULE Testing ----------------\n"
+
"EXTENDS
Natur
als \n"
+
"EXTENDS
Re
als \n"
+
"ASSUME 2.0 = 1.0 + 1 \n"
+
"================================="
;
TestUtil
.
typeCheckString
(
module
);
...
...
@@ -127,7 +127,7 @@ public class TestModuleReals {
@Test
(
expected
=
TypeErrorException
.
class
)
public
void
testArithmeticOperatorsException3
()
throws
TLA2BException
{
final
String
module
=
"-------------- MODULE Testing ----------------\n"
+
"EXTENDS
Natur
als \n"
+
"EXTENDS
Re
als \n"
+
"ASSUME 2 = 1.0 + 1.0 \n"
+
"================================="
;
TestUtil
.
typeCheckString
(
module
);
...
...
@@ -147,11 +147,10 @@ public class TestModuleReals {
/*
* Interval operator: x .. y
*/
@Test
(
expected
=
TypeErrorException
.
class
)
public
void
testDotDotReal
()
throws
TLA2BException
{
final
String
module
=
"-------------- MODULE Testing ----------------\n"
+
"EXTENDS
Natur
als \n"
+
"EXTENDS
Re
als \n"
+
"CONSTANTS k \n"
+
"ASSUME k = 1.0 .. 3.0 \n"
+
"================================="
;
...
...
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