42
42
import pipe.gui.widgets.InclusionPlaces.InclusionPlacesOption;
44
44
public class VerifyTAPNDiscreteVerification implements ModelChecker{
46
46
private static final String NEED_TO_LOCATE_VERIFYDTAPN_MSG = "TAPAAL needs to know the location of the file verifydtapn.\n\n"
47
47
+ "Verifydtapn is a part of the TAPAAL distribution and it is\n"
48
48
+ "normally located in the directory lib.";
50
protected static String verifydtapnpath = "";
52
private FileFinder fileFinder;
53
private Messenger messenger;
55
private ProcessRunner runner;
57
public VerifyTAPNDiscreteVerification(FileFinder fileFinder, Messenger messenger) {
58
this.fileFinder = fileFinder;
59
this.messenger = messenger;
62
public boolean supportsStats(){
50
protected static String verifydtapnpath = "";
52
private FileFinder fileFinder;
53
private Messenger messenger;
55
private ProcessRunner runner;
57
public VerifyTAPNDiscreteVerification(FileFinder fileFinder, Messenger messenger) {
58
this.fileFinder = fileFinder;
59
this.messenger = messenger;
62
public boolean supportsStats() {
66
public String getStatsExplanation() {
67
StringBuilder buffer = new StringBuilder("<html>");
68
buffer.append("<b>Discovered markings:</b> The number of found markings (each<br />");
69
buffer.append("time a successor is calculated, this number is incremented)<br/>");
70
buffer.append("<br/>");
71
buffer.append("<b>Explored markings:</b> The number of markings taken out<br/>");
72
buffer.append("of the waiting list during the search.<br />");
73
buffer.append("<br/>");
74
buffer.append("<b>Stored markings:</b> The number of markings found in the<br />");
75
buffer.append("passed/waiting list at the end of verification.<br />");
76
buffer.append("</html>");
77
return buffer.toString();
80
public String getPath() {
81
return verifydtapnpath;
84
public String getVersion() {
89
commands = new String[]{verifydtapnpath, "-v"};
91
InputStream stream = null;
93
Process child = Runtime.getRuntime().exec(commands);
94
stream = child.getInputStream();
96
result = readVersionNumberFrom(stream);
99
} catch (IOException | InterruptedException e) {
106
private String readVersionNumberFrom(InputStream stream) {
107
String result = null;
108
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(stream));
110
String versioninfo = null;
112
versioninfo = bufferedReader.readLine();
113
while (bufferedReader.readLine() != null) {
115
} catch (IOException e) {
119
Pattern pattern = Pattern.compile("^VerifyDTAPN (\\d+\\.\\d+\\.\\d+)$");
120
Matcher m = pattern.matcher(versioninfo);
126
public boolean isCorrectVersion() {
131
File file = new File(getPath());
132
if (!file.canExecute()) {
133
messenger.displayErrorMessage("The engine verifydtapn is not executable.\n"
134
+ "The verifydtapn path will be reset. Please try again, "
135
+ "to manually set the verifydtapn path.", "Verifydtapn Error");
140
if (getVersion() != null) {
142
String[] version = getVersion().split("\\.");
143
String[] targetversion = Pipe.verifydtapnMinRev.split("\\.");
145
for (int i = 0; i < targetversion.length; i++) {
146
if (version.length < i + 1) version[i] = "0";
147
int diff = Integer.parseInt(version[i]) - Integer.parseInt(targetversion[i]);
150
} else if (diff < 0) {
66
public String getStatsExplanation(){
67
StringBuffer buffer = new StringBuffer("<html>");
68
buffer.append("<b>Discovered markings:</b> The number of found markings (each<br />");
69
buffer.append("time a successor is calculated, this number is incremented)<br/>");
70
buffer.append("<br/>");
71
buffer.append("<b>Explored markings:</b> The number of markings taken out<br/>");
72
buffer.append("of the waiting list during the search.<br />");
73
buffer.append("<br/>");
74
buffer.append("<b>Stored markings:</b> The number of markings found in the<br />");
75
buffer.append("passed/waiting list at the end of verification.<br />");
76
buffer.append("</html>");
77
return buffer.toString();
80
public String getPath() {
81
return verifydtapnpath;
84
public String getVersion() {
89
commands = new String[] { verifydtapnpath, "-v" };
91
InputStream stream = null;
93
Process child = Runtime.getRuntime().exec(commands);
94
stream = child.getInputStream();
96
result = readVersionNumberFrom(stream);
99
} catch (IOException e) {
100
} catch (InterruptedException e) {
107
private String readVersionNumberFrom(InputStream stream) {
108
String result = null;
109
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(stream));
111
String versioninfo = null;
161
private void resetVerifytapn() {
162
verifydtapnpath = null;
163
Preferences.getInstance().setVerifydtapnLocation(null);
168
if (runner != null) {
173
public void setPath(String path) throws IllegalArgumentException {
174
ExecutabilityChecker.check(path);
175
String oldPath = verifydtapnpath;
176
verifydtapnpath = path;
177
Preferences.getInstance().setVerifydtapnLocation(path);
178
if (!isCorrectVersion()) {
179
messenger.displayErrorMessage("The specified version of the file verifydtapn is too old.", "Verifydtapn Error");
180
verifydtapnpath = oldPath;
181
Preferences.getInstance().setVerifydtapnLocation(oldPath);
185
public boolean setup() {
187
messenger.displayInfoMessage(NEED_TO_LOCATE_VERIFYDTAPN_MSG, "Locate verifydtapn");
113
versioninfo = bufferedReader.readLine();
114
while(bufferedReader.readLine() != null){} // Empty buffer
115
} catch (IOException e) {
119
Pattern pattern = Pattern.compile("^VerifyDTAPN (\\d+\\.\\d+\\.\\d+)$");
120
Matcher m = pattern.matcher(versioninfo);
126
public boolean isCorrectVersion() {
131
File file = new File(getPath());
132
if (!file.canExecute()) {
133
messenger.displayErrorMessage("The engine verifydtapn is not executable.\n"
134
+ "The verifydtapn path will be reset. Please try again, "
135
+ "to manually set the verifydtapn path.", "Verifydtapn Error");
140
if (getVersion() != null) {
142
String[] version = getVersion().split("\\.");
143
String[] targetversion = Pipe.verifydtapnMinRev.split("\\.");
145
for (int i = 0; i < targetversion.length; i++) {
146
if (version.length < i + 1) version[i] = "0";
147
int diff = Integer.parseInt(version[i]) - Integer.parseInt(targetversion[i]);
150
} else if (diff < 0) {
190
File file = fileFinder.ShowFileBrowserDialog("Verifydtapn", "", System.getProperty("user.home"));
192
if (file.getName().matches("^verifydtapn.*(?:\\.exe)?$")) {
193
setPath(file.getAbsolutePath());
195
messenger.displayErrorMessage("The selected executable does not seem to be verifydtapn.");
199
} catch (Exception e) {
200
messenger.displayErrorMessage("There were errors performing the requested action:\n" + e.getMessage(), "Error");
205
return !isNotSetup();
208
private boolean isNotSetup() {
209
return verifydtapnpath == null || verifydtapnpath.equals("") || !(new File(verifydtapnpath).exists());
212
public static boolean trySetup() {
216
//If env is set, it overwrites the value
217
verifydtapn = System.getenv("verifydtapn");
218
if (verifydtapn != null && !verifydtapn.isEmpty()) {
219
if (new File(verifydtapn).exists()) {
220
verifydtapnpath = verifydtapn;
221
VerifyTAPNDiscreteVerification v = new VerifyTAPNDiscreteVerification(new FileFinder(), new MessengerImpl());
222
if (v.isCorrectVersion()) {
225
verifydtapnpath = null;
231
verifydtapn = Preferences.getInstance().getVerifydtapnLocation();
232
if (verifydtapn != null && !verifydtapn.isEmpty()) {
233
verifydtapnpath = verifydtapn;
234
VerifyTAPNDiscreteVerification v = new VerifyTAPNDiscreteVerification(new FileFinder(), new MessengerImpl());
235
if (v.isCorrectVersion()) {
161
private void resetVerifytapn() {
162
verifydtapnpath = null;
163
Preferences.getInstance().setVerifydtapnLocation(null);
168
if (runner != null) {
173
public void setPath(String path) throws IllegalArgumentException{
174
ExecutabilityChecker.check(path);
175
String oldPath = verifydtapnpath;
176
verifydtapnpath = path;
177
Preferences.getInstance().setVerifydtapnLocation(path);
178
if(!isCorrectVersion()){
180
.displayErrorMessage(
181
"The specified version of the file verifydtapn is too old.", "Verifydtapn Error");
182
verifydtapnpath = oldPath;
183
Preferences.getInstance().setVerifydtapnLocation(oldPath);
187
public boolean setup() {
189
messenger.displayInfoMessage(NEED_TO_LOCATE_VERIFYDTAPN_MSG, "Locate verifydtapn");
192
File file = fileFinder.ShowFileBrowserDialog("Verifydtapn", "",System.getProperty("user.home"));
194
if(file.getName().matches("^verifydtapn.*(?:\\.exe)?$")){
195
setPath(file.getAbsolutePath());
197
messenger.displayErrorMessage("The selected executable does not seem to be verifydtapn.");
201
} catch (Exception e) {
202
messenger.displayErrorMessage("There were errors performing the requested action:\n" + e.getMessage(), "Error");
207
return !isNotSetup();
210
private boolean isNotSetup() {
211
return verifydtapnpath == null || verifydtapnpath.equals("") || !(new File(verifydtapnpath).exists());
214
public static boolean trySetup() {
216
String verifydtapn = null;
218
//If env is set, it overwrites the value
219
verifydtapn = System.getenv("verifydtapn");
220
if (verifydtapn != null && !verifydtapn.isEmpty()) {
221
if (new File(verifydtapn).exists()){
222
verifydtapnpath = verifydtapn;
223
VerifyTAPNDiscreteVerification v = new VerifyTAPNDiscreteVerification(new FileFinder(), new MessengerImpl());
224
if(v.isCorrectVersion()){
228
verifydtapnpath = null;
234
verifydtapn = Preferences.getInstance().getVerifydtapnLocation();
235
if (verifydtapn != null && !verifydtapn.isEmpty()) {
236
verifydtapnpath = verifydtapn;
237
VerifyTAPNDiscreteVerification v = new VerifyTAPNDiscreteVerification(new FileFinder(), new MessengerImpl());
238
if(v.isCorrectVersion()){
242
verifydtapnpath = null;
246
//Search the installdir for verifytapn
247
File installdir = TAPAAL.getInstallDir();
249
String[] paths = {"/bin/verifydtapn", "/bin/verifydtapn64", "/bin/verifydtapn.exe", "/bin/verifydtapn64.exe"};
250
for (String s : paths) {
251
File verifydtapnfile = new File(installdir + s);
253
if (verifydtapnfile.exists()){
255
verifydtapnpath = verifydtapnfile.getAbsolutePath();
256
VerifyTAPNDiscreteVerification v = new VerifyTAPNDiscreteVerification(new FileFinder(), new MessengerImpl());
257
if(v.isCorrectVersion()){
261
verifydtapnpath = null;
272
public VerificationResult<TimedArcPetriNetTrace> verify(VerificationOptions options, Tuple<TimedArcPetriNet, NameMapping> model, TAPNQuery query) throws Exception {
273
if(!supportsModel(model.value1(), options)){
274
throw new UnsupportedModelException("Verifydtapn does not support the given model.");
277
if(!supportsQuery(model.value1(), query, options)){
278
throw new UnsupportedQueryException("Verifydtapn does not support the given query-option combination. ");
280
//if(!supportsQuery(model.value1(), query, options))
281
//throw new UnsupportedQueryException("Verifydtapn does not support the given query.");
283
// if(((VerifyTAPNOptions)options).discreteInclusion() && !isQueryUpwardClosed(query))
284
// throw new UnsupportedQueryException("Discrete inclusion check only supports upward closed queries.");
286
if(((VerifyTAPNOptions)options).discreteInclusion()) mapDiscreteInclusionPlacesToNewNames(options, model);
288
VerifyTAPNExporter exporter = new VerifyTAPNExporter();
289
ExportedVerifyTAPNModel exportedModel = exporter.export(model.value1(), query);
291
if (exportedModel == null) {
292
messenger.displayErrorMessage("There was an error exporting the model");
295
return verify(options, model, exportedModel, query);
298
private void mapDiscreteInclusionPlacesToNewNames(VerificationOptions options, Tuple<TimedArcPetriNet, NameMapping> model) {
299
VerifyTAPNOptions verificationOptions = (VerifyTAPNOptions)options;
301
if(verificationOptions.inclusionPlaces().inclusionOption() == InclusionPlacesOption.AllPlaces)
304
List<TimedPlace> inclusionPlaces = new ArrayList<TimedPlace>();
305
for(TimedPlace p : verificationOptions.inclusionPlaces().inclusionPlaces()) {
306
if(p instanceof LocalTimedPlace) {
307
LocalTimedPlace local = (LocalTimedPlace)p;
308
if(local.model().isActive()){
309
inclusionPlaces.add(model.value1().getPlaceByName(model.value2().map(local.model().name(), local.name())));
313
inclusionPlaces.add(model.value1().getPlaceByName(model.value2().map("", p.name())));
316
((VerifyTAPNOptions)options).setInclusionPlaces(new InclusionPlaces(InclusionPlacesOption.UserSpecified, inclusionPlaces));
319
private VerificationResult<TimedArcPetriNetTrace> verify(VerificationOptions options, Tuple<TimedArcPetriNet, NameMapping> model, ExportedVerifyTAPNModel exportedModel, TAPNQuery query) {
320
((VerifyTAPNOptions)options).setTokensInModel(model.value1().marking().size()); // TODO: get rid of me
321
runner = new ProcessRunner(verifydtapnpath, createArgumentString(exportedModel.modelFile(), exportedModel.queryFile(), options));
324
if (runner.error()) {
238
verifydtapnpath = null;
242
//Search the installdir for verifytapn
243
File installdir = TAPAAL.getInstallDir();
245
String[] paths = {"/bin/verifydtapn", "/bin/verifydtapn64", "/bin/verifydtapn.exe", "/bin/verifydtapn64.exe"};
246
for (String s : paths) {
247
File verifydtapnfile = new File(installdir + s);
249
if (verifydtapnfile.exists()) {
251
verifydtapnpath = verifydtapnfile.getAbsolutePath();
252
VerifyTAPNDiscreteVerification v = new VerifyTAPNDiscreteVerification(new FileFinder(), new MessengerImpl());
253
if (v.isCorrectVersion()) {
256
verifydtapnpath = null;
267
public VerificationResult<TimedArcPetriNetTrace> verify(VerificationOptions options, Tuple<TimedArcPetriNet, NameMapping> model, TAPNQuery query) throws Exception {
268
if (!supportsModel(model.value1(), options)) {
269
throw new UnsupportedModelException("Verifydtapn does not support the given model.");
272
if (!supportsQuery(model.value1(), query, options)) {
273
throw new UnsupportedQueryException("Verifydtapn does not support the given query-option combination. ");
275
//if(!supportsQuery(model.value1(), query, options))
276
//throw new UnsupportedQueryException("Verifydtapn does not support the given query.");
278
//if(((VerifyTAPNOptions)options).discreteInclusion() && !isQueryUpwardClosed(query))
279
//throw new UnsupportedQueryException("Discrete inclusion check only supports upward closed queries.");
281
if (((VerifyTAPNOptions) options).discreteInclusion()) mapDiscreteInclusionPlacesToNewNames(options, model);
283
VerifyTAPNExporter exporter = new VerifyTAPNExporter();
284
ExportedVerifyTAPNModel exportedModel = exporter.export(model.value1(), query);
286
if (exportedModel == null) {
287
messenger.displayErrorMessage("There was an error exporting the model");
290
return verify(options, model, exportedModel, query);
293
private void mapDiscreteInclusionPlacesToNewNames(VerificationOptions options, Tuple<TimedArcPetriNet, NameMapping> model) {
294
VerifyTAPNOptions verificationOptions = (VerifyTAPNOptions) options;
296
if (verificationOptions.inclusionPlaces().inclusionOption() == InclusionPlacesOption.AllPlaces)
299
List<TimedPlace> inclusionPlaces = new ArrayList<TimedPlace>();
300
for (TimedPlace p : verificationOptions.inclusionPlaces().inclusionPlaces()) {
301
if (p instanceof LocalTimedPlace) {
302
LocalTimedPlace local = (LocalTimedPlace) p;
303
if (local.model().isActive()) {
304
inclusionPlaces.add(model.value1().getPlaceByName(model.value2().map(local.model().name(), local.name())));
306
} else { // shared place
307
inclusionPlaces.add(model.value1().getPlaceByName(model.value2().map("", p.name())));
311
((VerifyTAPNOptions) options).setInclusionPlaces(new InclusionPlaces(InclusionPlacesOption.UserSpecified, inclusionPlaces));
314
private VerificationResult<TimedArcPetriNetTrace> verify(VerificationOptions options, Tuple<TimedArcPetriNet, NameMapping> model, ExportedVerifyTAPNModel exportedModel, TAPNQuery query) {
315
((VerifyTAPNOptions) options).setTokensInModel(model.value1().marking().size()); // TODO: get rid of me
316
runner = new ProcessRunner(verifydtapnpath, createArgumentString(exportedModel.modelFile(), exportedModel.queryFile(), options));
319
if (runner.error()) {
322
String errorOutput = readOutput(runner.errorOutput());
323
String standardOutput = readOutput(runner.standardOutput());
325
Tuple<QueryResult, Stats> queryResult = parseQueryResult(standardOutput, model.value1().marking().size() + query.getExtraTokens(), query.getExtraTokens(), query, model.value1());
327
if (queryResult == null || queryResult.value1() == null) {
328
return new VerificationResult<TimedArcPetriNetTrace>(errorOutput + System.getProperty("line.separator") + standardOutput, runner.getRunningTime());
327
String errorOutput = readOutput(runner.errorOutput());
328
String standardOutput = readOutput(runner.standardOutput());
330
Tuple<QueryResult, Stats> queryResult = parseQueryResult(standardOutput, model.value1().marking().size() + query.getExtraTokens(), query.getExtraTokens(), query, model.value1());
332
if (queryResult == null || queryResult.value1() == null) {
333
return new VerificationResult<TimedArcPetriNetTrace>(errorOutput + System.getProperty("line.separator") + standardOutput, runner.getRunningTime());
331
// Parse covered trace
332
TimedArcPetriNetTrace secondaryTrace = null;
333
if (queryResult.value2().getCoveredMarking() != null) {
334
secondaryTrace = parseTrace((errorOutput.split("Trace:")[2]), options, model, exportedModel, query, queryResult.value1());
337
TimedArcPetriNetTrace tapnTrace = parseTrace(!errorOutput.contains("Trace:") ? errorOutput : (errorOutput.split("Trace:")[1]), options, model, exportedModel, query, queryResult.value1());
338
return new VerificationResult<TimedArcPetriNetTrace>(queryResult.value1(), tapnTrace, secondaryTrace, runner.getRunningTime(), queryResult.value2(), false);
343
private TimedArcPetriNetTrace parseTrace(String output, VerificationOptions options, Tuple<TimedArcPetriNet, NameMapping> model, ExportedVerifyTAPNModel exportedModel, TAPNQuery query, QueryResult queryResult) {
344
if (((VerifyTAPNOptions) options).trace() == TraceOption.NONE) return null;
346
VerifyTAPNTraceParser traceParser = new VerifyTAPNTraceParser(model.value1());
347
TimedArcPetriNetTrace trace = traceParser.parseTrace(new BufferedReader(new StringReader(output)));
350
if (((VerifyTAPNOptions) options).trace() != TraceOption.NONE) {
351
if ((query.getProperty() instanceof TCTLEFNode && !queryResult.isQuerySatisfied()) ||
352
(query.getProperty() instanceof TCTLAGNode && queryResult.isQuerySatisfied()) ||
353
(query.getProperty() instanceof TCTLEGNode && !queryResult.isQuerySatisfied()) ||
354
(query.getProperty() instanceof TCTLAFNode && queryResult.isQuerySatisfied())) {
336
// Parse covered trace
337
TimedArcPetriNetTrace secondaryTrace = null;
338
if(queryResult.value2().getCoveredMarking() != null){
339
secondaryTrace = parseTrace((errorOutput.split("Trace:")[2]), options, model, exportedModel, query, queryResult.value1());
342
TimedArcPetriNetTrace tapnTrace = parseTrace(!errorOutput.contains("Trace:")?errorOutput:(errorOutput.split("Trace:")[1]), options, model, exportedModel, query, queryResult.value1());
343
return new VerificationResult<TimedArcPetriNetTrace>(queryResult.value1(), tapnTrace, secondaryTrace, runner.getRunningTime(), queryResult.value2(), false);
357
messenger.displayErrorMessage("Verifydtapn cannot generate the requested trace for the model. Try another trace option.");
348
private TimedArcPetriNetTrace parseTrace(String output, VerificationOptions options, Tuple<TimedArcPetriNet, NameMapping> model, ExportedVerifyTAPNModel exportedModel, TAPNQuery query, QueryResult queryResult) {
349
if (((VerifyTAPNOptions) options).trace() == TraceOption.NONE) return null;
351
VerifyTAPNTraceParser traceParser = new VerifyTAPNTraceParser(model.value1());
352
TimedArcPetriNetTrace trace = traceParser.parseTrace(new BufferedReader(new StringReader(output)));
355
if (((VerifyTAPNOptions) options).trace() != TraceOption.NONE) {
356
if((query.getProperty() instanceof TCTLEFNode && !queryResult.isQuerySatisfied()) ||
357
(query.getProperty() instanceof TCTLAGNode && queryResult.isQuerySatisfied()) ||
358
(query.getProperty() instanceof TCTLEGNode && !queryResult.isQuerySatisfied()) ||
359
(query.getProperty() instanceof TCTLAFNode && queryResult.isQuerySatisfied())){
362
messenger.displayErrorMessage("Verifydtapn cannot generate the requested trace for the model. Try another trace option.");
369
private String createArgumentString(String modelFile, String queryFile, VerificationOptions options) {
370
StringBuffer buffer = new StringBuffer(options.toString());
364
private String createArgumentString(String modelFile, String queryFile, VerificationOptions options) {
365
StringBuilder buffer = new StringBuilder(options.toString());
367
buffer.append(modelFile);
368
VerifyDTAPNOptions opts = (VerifyDTAPNOptions) options;
369
if (opts.getWorkflowMode() == WorkflowMode.NOT_WORKFLOW || opts.getWorkflowMode() == null) {
371
370
buffer.append(' ');
372
buffer.append(modelFile);
373
VerifyDTAPNOptions opts = (VerifyDTAPNOptions)options;
374
if(opts.getWorkflowMode() == WorkflowMode.NOT_WORKFLOW || opts.getWorkflowMode() == null) {
376
buffer.append(queryFile);
379
return buffer.toString();
371
buffer.append(queryFile);
382
private String readOutput(BufferedReader reader) {
386
} catch (IOException e1) {
374
return buffer.toString();
377
private String readOutput(BufferedReader reader) {
389
StringBuffer buffer = new StringBuffer();
392
while ((line = reader.readLine()) != null) {
394
buffer.append(System.getProperty("line.separator"));
396
} catch (IOException e) {
399
return buffer.toString();
402
private Tuple<QueryResult, Stats> parseQueryResult(String output, int totalTokens, int extraTokens, TAPNQuery query, TimedArcPetriNet model) {
403
VerifyDTAPNOutputParser outputParser = new VerifyDTAPNOutputParser(totalTokens, extraTokens, query);
404
Tuple<QueryResult, Stats> result = outputParser.parseOutput(output);
409
public boolean supportsModel(TimedArcPetriNet model, VerificationOptions options) {
410
if(model.hasUrgentTransitions() && ((VerifyDTAPNOptions)options).timeDarts()){
414
return model.isNonStrict();
417
public boolean supportsQuery(TimedArcPetriNet model, TAPNQuery query, VerificationOptions options) {
418
// if liveness, has deadlock proposition and uses timedarts, it is not supported
419
if((query.getProperty() instanceof TCTLEGNode || query.getProperty() instanceof TCTLAFNode)
420
&& query.hasDeadlock()
421
&& ((VerifyDTAPNOptions)options).timeDarts()){
428
// JS: this is not used any more
429
//private boolean isQueryUpwardClosed(TAPNQuery query) {
430
// UpwardsClosedVisitor visitor = new UpwardsClosedVisitor();
431
// return visitor.isUpwardClosed(query.getProperty());
435
public static void reset() {
437
verifydtapnpath = "";
438
Preferences.getInstance().setVerifydtapnLocation(null);
444
public String toString() {
445
return "verifydtapn";
448
public boolean useDiscreteSemantics() {
381
} catch (IOException e1) {
384
StringBuilder buffer = new StringBuilder();
387
while ((line = reader.readLine()) != null) {
389
buffer.append(System.getProperty("line.separator"));
391
} catch (IOException e) {
394
return buffer.toString();
397
private Tuple<QueryResult, Stats> parseQueryResult(String output, int totalTokens, int extraTokens, TAPNQuery query, TimedArcPetriNet model) {
398
VerifyDTAPNOutputParser outputParser = new VerifyDTAPNOutputParser(totalTokens, extraTokens, query);
399
return outputParser.parseOutput(output);
403
public boolean supportsModel(TimedArcPetriNet model, VerificationOptions options) {
404
if (model.hasUrgentTransitions() && ((VerifyDTAPNOptions) options).timeDarts()) {
408
return model.isNonStrict();
411
public boolean supportsQuery(TimedArcPetriNet model, TAPNQuery query, VerificationOptions options) {
412
// if liveness, has deadlock proposition and uses timedarts, it is not supported
413
if ((query.getProperty() instanceof TCTLEGNode || query.getProperty() instanceof TCTLAFNode)
414
&& query.hasDeadlock()
415
&& ((VerifyDTAPNOptions) options).timeDarts()) {
422
public static void reset() {
424
verifydtapnpath = "";
425
Preferences.getInstance().setVerifydtapnLocation(null);
431
public String toString() {
432
return "verifydtapn";
435
public boolean useDiscreteSemantics() {