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
a5e8c82a
Commit
a5e8c82a
authored
2 years ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Use Utils.isProBSpecialDefinitionName instead of hardcoding the names
parent
ecb506e1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#112042
passed
2 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/tla2b/translation/BDefinitionsFinder.java
+9
-12
9 additions, 12 deletions
src/main/java/de/tla2b/translation/BDefinitionsFinder.java
src/main/java/de/tla2b/translation/UsedDefinitionsFinder.java
+9
-13
9 additions, 13 deletions
...main/java/de/tla2b/translation/UsedDefinitionsFinder.java
with
18 additions
and
25 deletions
src/main/java/de/tla2b/translation/BDefinitionsFinder.java
+
9
−
12
View file @
a5e8c82a
...
...
@@ -4,17 +4,20 @@ import java.util.ArrayList;
import
java.util.HashSet
;
import
java.util.Set
;
import
de.be4.classicalb.core.parser.util.Utils
;
import
de.tla2b.analysis.AbstractASTVisitor
;
import
de.tla2b.analysis.BOperation
;
import
de.tla2b.analysis.SpecAnalyser
;
import
de.tla2b.global.TranslationGlobals
;
import
tla2sany.semantic.ASTConstants
;
import
tla2sany.semantic.AssumeNode
;
import
tla2sany.semantic.ExprNode
;
import
tla2sany.semantic.ExprOrOpArgNode
;
import
tla2sany.semantic.OpApplNode
;
import
tla2sany.semantic.OpDefNode
;
import
tlc2.tool.ToolGlobals
;
import
de.tla2b.analysis.AbstractASTVisitor
;
import
de.tla2b.analysis.BOperation
;
import
de.tla2b.analysis.SpecAnalyser
;
import
de.tla2b.global.TranslationGlobals
;
public
class
BDefinitionsFinder
extends
AbstractASTVisitor
implements
ASTConstants
,
ToolGlobals
,
TranslationGlobals
{
private
final
HashSet
<
OpDefNode
>
bDefinitionsSet
=
new
HashSet
<>();
...
...
@@ -52,14 +55,8 @@ public class BDefinitionsFinder extends AbstractASTVisitor implements ASTConstan
for
(
OpDefNode
opDef
:
specAnalyser
.
getModuleNode
().
getOpDefs
())
{
String
defName
=
opDef
.
getName
().
toString
();
// GOAL, ANIMATION_FUNCTION, ANIMATION_IMGxx, SET_PREF_xxx,
if
(
defName
.
equals
(
"GOAL"
)
||
defName
.
startsWith
(
"ANIMATION_"
)
||
defName
.
startsWith
(
"CUSTOM_GRAPH_"
)
||
defName
.
startsWith
(
"ASSERT_CTL"
)
||
defName
.
startsWith
(
"ASSERT_LTL"
)
||
defName
.
startsWith
(
"SET_PREF_"
)
||
defName
.
startsWith
(
"HEURISTIC_FUNCTION"
)
||
defName
.
startsWith
(
"VISB_SVG_"
)
// VISB_SVG_OBJECTS, VISB_SVG_UPDATES, VISB_SVG_HOVERS
||
defName
.
equals
(
"VISB_JSON_FILE"
)
||
defName
.
startsWith
(
"GAME_"
)
// GAME_OVER, GAME_PLAYER, GAME_MCTS_RUNS
||
defName
.
startsWith
(
"SCOPE"
)
||
defName
.
startsWith
(
"scope_"
))
{
// GOAL, ANIMATION_FUNCTION, ANIMATION_IMGxx, SET_PREF_xxx, etc.
if
(
Utils
.
isProBSpecialDefinitionName
(
defName
))
{
bDefinitionsSet
.
add
(
opDef
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/tla2b/translation/UsedDefinitionsFinder.java
+
9
−
13
View file @
a5e8c82a
...
...
@@ -3,15 +3,18 @@ package de.tla2b.translation;
import
java.util.Collection
;
import
java.util.HashSet
;
import
de.be4.classicalb.core.parser.util.Utils
;
import
de.tla2b.analysis.AbstractASTVisitor
;
import
de.tla2b.analysis.SpecAnalyser
;
import
de.tla2b.global.BBuiltInOPs
;
import
de.tla2b.global.TranslationGlobals
;
import
tla2sany.semantic.ASTConstants
;
import
tla2sany.semantic.ModuleNode
;
import
tla2sany.semantic.OpApplNode
;
import
tla2sany.semantic.OpDefNode
;
import
tlc2.tool.ToolGlobals
;
import
de.tla2b.analysis.AbstractASTVisitor
;
import
de.tla2b.analysis.SpecAnalyser
;
import
de.tla2b.global.BBuiltInOPs
;
import
de.tla2b.global.TranslationGlobals
;
public
class
UsedDefinitionsFinder
extends
AbstractASTVisitor
implements
ASTConstants
,
ToolGlobals
,
TranslationGlobals
{
...
...
@@ -58,15 +61,8 @@ public class UsedDefinitionsFinder extends AbstractASTVisitor implements ASTCons
for
(
OpDefNode
opDef
:
specAnalyser
.
getModuleNode
().
getOpDefs
())
{
String
defName
=
opDef
.
getName
().
toString
();
// GOAL, ANIMATION_FUNCTION, ANIMATION_IMGxx, SET_PREF_xxx,
if
(
defName
.
equals
(
"GOAL"
)
||
defName
.
startsWith
(
"ANIMATION_FUNCTION"
)
||
defName
.
startsWith
(
"ANIMATION_IMG"
)
||
defName
.
startsWith
(
"ASSERT_LTL"
)
||
defName
.
startsWith
(
"ASSERT_CTL"
)
||
defName
.
startsWith
(
"VISB_SVG_"
)
// VISB_SVG_OBJECTS, VISB_SVG_UPDATES, VISB_SVG_HOVERS
||
defName
.
equals
(
"VISB_JSON_FILE"
)
||
defName
.
startsWith
(
"GAME_"
)
// GAME_OVER, GAME_PLAYER, GAME_MCTS_RUNS
||
defName
.
startsWith
(
"SET_PREF_"
)
||
defName
.
startsWith
(
"HEURISTIC_FUNCTION"
)
||
defName
.
startsWith
(
"SCOPE"
)
||
defName
.
startsWith
(
"scope_"
))
{
// GOAL, ANIMATION_FUNCTION, ANIMATION_IMGxx, SET_PREF_xxx, etc.
if
(
Utils
.
isProBSpecialDefinitionName
(
defName
))
{
usedDefinitions
.
add
(
opDef
);
}
}
...
...
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