Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
d642201d
Commit
d642201d
authored
5 years ago
by
Ludovic Apvrille
Browse files
Options
Downloads
Patches
Plain Diff
Adding saving of TMAP after Z3 explo
parent
68b616ff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/cli/TML.java
+52
-0
52 additions, 0 deletions
src/main/java/cli/TML.java
with
52 additions
and
0 deletions
src/main/java/cli/TML.java
+
52
−
0
View file @
d642201d
...
...
@@ -40,6 +40,7 @@
package
cli
;
import
common.ConfigurationTTool
;
import
common.SpecConfigTTool
;
import
launcher.RTLLauncher
;
import
myutil.FileUtils
;
import
myutil.PluginManager
;
...
...
@@ -170,6 +171,18 @@ public class TML extends Command {
};
subcommands
.
add
(
saveResult
);
Command
saveResultMapping
=
new
Command
()
{
public
String
getCommand
()
{
return
"save-result-tml-mapping"
;
}
public
String
getShortCommand
()
{
return
"srtm"
;
}
public
String
getDescription
()
{
return
"srtm <file>: save the produced results of a mapping exploration"
;
}
public
String
executeCommand
(
String
command
,
Interpreter
interpreter
)
{
//interpreter.print("Command=" + command);
return
saveResultTMLMapping
(
command
);
}
};
subcommands
.
add
(
saveResultMapping
);
}
...
...
@@ -394,5 +407,44 @@ public class TML extends Command {
return
null
;
}
@SuppressWarnings
(
"unchecked"
)
private
String
saveResultTMLMapping
(
String
command
)
{
if
(
result
==
null
)
{
return
"No mapping to save"
;
}
if
(
command
.
length
()
==
0
)
{
return
"Must give a file as argument"
;
}
if
(
result
.
hasError
())
{
return
"No mapping to save since the mapping exploration encountered errors"
;
}
if
(
result
.
resultingMapping
==
null
)
{
return
"Empty mapping: cannot generate TML file"
;
}
File
fileResult
=
new
File
(
command
);
try
{
boolean
b
=
FileUtils
.
checkFileForSave
(
fileResult
);
if
(!
b
)
{
return
"Results cannot be written to "
+
command
+
": access denied"
;
}
TMLMappingTextSpecification
spec
=
new
TMLMappingTextSpecification
(
"fromZ3"
);
spec
.
toTextFormat
(
result
.
resultingMapping
);
spec
.
saveFile
(
fileResult
.
getAbsolutePath
(),
""
);
}
catch
(
Exception
e
)
{
return
"Exception when writing resulting mapping to file: "
+
e
.
getMessage
();
}
return
null
;
}
}
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