Merge lp:~tapaal-contributor/tapaal/save-tar-option into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1121
Merged at revision: 1120
Proposed branch: lp:~tapaal-contributor/tapaal/save-tar-option
Merge into: lp:tapaal
Diff against target: 150 lines (+35/-3)
7 files modified
src/dk/aau/cs/gui/BatchProcessingDialog.java (+4/-0)
src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java (+3/-1)
src/dk/aau/cs/io/queries/TAPNQueryLoader.java (+15/-0)
src/dk/aau/cs/verification/VerifyTAPN/VerifyPNOptions.java (+7/-0)
src/dk/aau/cs/verification/batchProcessing/BatchProcessingWorker.java (+4/-2)
src/pipe/dataLayer/TAPNQuery.java (+1/-0)
src/pipe/gui/widgets/QueryDialog.java (+1/-0)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/save-tar-option
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+399026@code.launchpad.net

Commit message

The trace refinement option is saved in the .tapn file

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/dk/aau/cs/gui/BatchProcessingDialog.java'
--- src/dk/aau/cs/gui/BatchProcessingDialog.java 2020-07-20 07:55:49 +0000
+++ src/dk/aau/cs/gui/BatchProcessingDialog.java 2021-03-02 20:12:24 +0000
@@ -1577,6 +1577,10 @@
1577 s.append("Stubborn Reduction: ");1577 s.append("Stubborn Reduction: ");
1578 s.append(query.isStubbornReductionEnabled() ? "Yes\n\n" : "No\n\n");1578 s.append(query.isStubbornReductionEnabled() ? "Yes\n\n" : "No\n\n");
15791579
1580 s.append("\n\n");
1581 s.append("Trace Abstract Refinement: ");
1582 s.append(query.isTarOptionEnabled() ? "Yes\n\n" : "No\n\n");
1583
1580 s.append("Query Property:\n");1584 s.append("Query Property:\n");
1581 s.append(query.getProperty().toString());1585 s.append(query.getProperty().toString());
1582 1586
15831587
=== modified file 'src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java'
--- src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java 2020-08-11 13:25:25 +0000
+++ src/dk/aau/cs/io/TimedArcPetriNetNetworkWriter.java 2021-03-02 20:12:24 +0000
@@ -320,7 +320,8 @@
320 queryElement.setAttribute("enableOverApproximation", "" + query.isOverApproximationEnabled());320 queryElement.setAttribute("enableOverApproximation", "" + query.isOverApproximationEnabled());
321 queryElement.setAttribute("enableUnderApproximation", "" + query.isUnderApproximationEnabled());321 queryElement.setAttribute("enableUnderApproximation", "" + query.isUnderApproximationEnabled());
322 queryElement.setAttribute("approximationDenominator", "" + query.approximationDenominator());322 queryElement.setAttribute("approximationDenominator", "" + query.approximationDenominator());
323 queryElement.setAttribute("useStubbornReduction", "" + query.isStubbornReductionEnabled());323 queryElement.setAttribute("useStubbornReduction", "" + query.isStubbornReductionEnabled());
324 queryElement.setAttribute("useTarOption", "" + query.isTarOptionEnabled());
324325
325 return queryElement;326 return queryElement;
326 }327 }
@@ -358,6 +359,7 @@
358 queryElement.setAttribute("useSiphonTrapAnalysis", "" + query.isSiphontrapEnabled());359 queryElement.setAttribute("useSiphonTrapAnalysis", "" + query.isSiphontrapEnabled());
359 queryElement.setAttribute("useQueryReduction", "" + query.isQueryReductionEnabled());360 queryElement.setAttribute("useQueryReduction", "" + query.isQueryReductionEnabled());
360 queryElement.setAttribute("useStubbornReduction", "" + query.isStubbornReductionEnabled());361 queryElement.setAttribute("useStubbornReduction", "" + query.isStubbornReductionEnabled());
362 queryElement.setAttribute("useTarOption", "" + query.isTarOptionEnabled());
361 363
362 return queryElement;364 return queryElement;
363 }365 }
364366
=== modified file 'src/dk/aau/cs/io/queries/TAPNQueryLoader.java'
--- src/dk/aau/cs/io/queries/TAPNQueryLoader.java 2020-10-31 17:27:18 +0000
+++ src/dk/aau/cs/io/queries/TAPNQueryLoader.java 2021-03-02 20:12:24 +0000
@@ -91,6 +91,7 @@
91 boolean siphontrap = getReductionOption(queryElement, "useSiphonTrapAnalysis", false);91 boolean siphontrap = getReductionOption(queryElement, "useSiphonTrapAnalysis", false);
92 boolean queryReduction = getReductionOption(queryElement, "useQueryReduction", true);92 boolean queryReduction = getReductionOption(queryElement, "useQueryReduction", true);
93 boolean stubborn = getReductionOption(queryElement, "useStubbornReduction", true);93 boolean stubborn = getReductionOption(queryElement, "useStubbornReduction", true);
94 boolean useTar = getTarOption(queryElement, "useTarOption", false);
9495
95 TCTLAbstractProperty query;96 TCTLAbstractProperty query;
96 if (queryElement.getElementsByTagName("formula").item(0) != null){97 if (queryElement.getElementsByTagName("formula").item(0) != null){
@@ -107,6 +108,7 @@
107 parsedQuery.setUseSiphontrap(siphontrap);108 parsedQuery.setUseSiphontrap(siphontrap);
108 parsedQuery.setUseQueryReduction(queryReduction);109 parsedQuery.setUseQueryReduction(queryReduction);
109 parsedQuery.setUseStubbornReduction(stubborn);110 parsedQuery.setUseStubbornReduction(stubborn);
111 parsedQuery.setUseTarOption(useTar);
110 if (parsedQuery.getCategory() == QueryCategory.CTL && algorithmOption != null){112 if (parsedQuery.getCategory() == QueryCategory.CTL && algorithmOption != null){
111 parsedQuery.setAlgorithmOption(AlgorithmOption.valueOf(algorithmOption));113 parsedQuery.setAlgorithmOption(AlgorithmOption.valueOf(algorithmOption));
112// RenameTemplateVisitor rt = new RenameTemplateVisitor("", 114// RenameTemplateVisitor rt = new RenameTemplateVisitor("",
@@ -229,6 +231,19 @@
229 }231 }
230 return result; 232 return result;
231 }233 }
234
235 private boolean getTarOption(Element queryElement, String attributeName, boolean defaultValue) {
236 if(!queryElement.hasAttribute(attributeName)){
237 return defaultValue;
238 }
239 boolean result;
240 try {
241 result = queryElement.getAttribute(attributeName).equals("true");
242 } catch(Exception e) {
243 result = defaultValue;
244 }
245 return result;
246 }
232 247
233 private int getApproximationValue(Element queryElement, String attributeName, int defaultValue)248 private int getApproximationValue(Element queryElement, String attributeName, int defaultValue)
234 {249 {
235250
=== modified file 'src/dk/aau/cs/verification/VerifyTAPN/VerifyPNOptions.java'
--- src/dk/aau/cs/verification/VerifyTAPN/VerifyPNOptions.java 2021-02-07 11:09:51 +0000
+++ src/dk/aau/cs/verification/VerifyTAPN/VerifyPNOptions.java 2021-03-02 20:12:24 +0000
@@ -43,6 +43,13 @@
43 enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, null, false);43 enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, null, false);
44 }44 }
4545
46 public VerifyPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean useOverApproximation, boolean useModelReduction,
47 boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator, QueryCategory queryCategory, AlgorithmOption algorithmOption,
48 boolean siphontrap, QueryReductionTime queryReduction, boolean stubbornReduction, boolean useTarOption) {
49 this(extraTokens, traceOption, search, useOverApproximation, useModelReduction? ModelReduction.AGGRESSIVE:ModelReduction.NO_REDUCTION, enableOverApproximation,
50 enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, null, useTarOption);
51 }
52
46 @Override53 @Override
47 public String toString() {54 public String toString() {
48 StringBuilder result = new StringBuilder();55 StringBuilder result = new StringBuilder();
4956
=== modified file 'src/dk/aau/cs/verification/batchProcessing/BatchProcessingWorker.java'
--- src/dk/aau/cs/verification/batchProcessing/BatchProcessingWorker.java 2020-10-15 15:44:06 +0000
+++ src/dk/aau/cs/verification/batchProcessing/BatchProcessingWorker.java 2021-03-02 20:12:24 +0000
@@ -356,6 +356,7 @@
356 boolean stubbornReduction = batchProcessingVerificationOptions.stubbornReductionOption() == StubbornReductionOption.KeepQueryOption ? query.isStubbornReductionEnabled() : getStubbornReductionFromBatchProcessingOptions();356 boolean stubbornReduction = batchProcessingVerificationOptions.stubbornReductionOption() == StubbornReductionOption.KeepQueryOption ? query.isStubbornReductionEnabled() : getStubbornReductionFromBatchProcessingOptions();
357 boolean overApproximation = query.isOverApproximationEnabled();357 boolean overApproximation = query.isOverApproximationEnabled();
358 boolean underApproximation = query.isUnderApproximationEnabled();358 boolean underApproximation = query.isUnderApproximationEnabled();
359 boolean useTar = query.isTarOptionEnabled();
359 int approximationDenominator = query.approximationDenominator();360 int approximationDenominator = query.approximationDenominator();
360 if (batchProcessingVerificationOptions.approximationMethodOption() == ApproximationMethodOption.None) {361 if (batchProcessingVerificationOptions.approximationMethodOption() == ApproximationMethodOption.None) {
361 overApproximation = false;362 overApproximation = false;
@@ -381,6 +382,7 @@
381 changedQuery.setUseSiphontrap(query.isSiphontrapEnabled());382 changedQuery.setUseSiphontrap(query.isSiphontrapEnabled());
382 changedQuery.setUseQueryReduction(query.isQueryReductionEnabled());383 changedQuery.setUseQueryReduction(query.isQueryReductionEnabled());
383 changedQuery.setUseStubbornReduction(stubbornReduction);384 changedQuery.setUseStubbornReduction(stubbornReduction);
385 changedQuery.setUseTarOption(useTar);
384 return changedQuery;386 return changedQuery;
385 } else if (batchProcessingVerificationOptions.queryPropertyOption() == QueryPropertyOption.Soundness) {387 } else if (batchProcessingVerificationOptions.queryPropertyOption() == QueryPropertyOption.Soundness) {
386 isSoundnessCheck = true;388 isSoundnessCheck = true;
@@ -623,9 +625,9 @@
623 return new VerifyDTAPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useSymmetry(), query.useGCD(), query.useTimeDarts(), query.usePTrie(), false, query.discreteInclusion(), query.inclusionPlaces(), query.getWorkflowMode(), 0, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.isStubbornReductionEnabled());625 return new VerifyDTAPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useSymmetry(), query.useGCD(), query.useTimeDarts(), query.usePTrie(), false, query.discreteInclusion(), query.inclusionPlaces(), query.getWorkflowMode(), 0, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.isStubbornReductionEnabled());
624 else if(query.getReductionOption() == ReductionOption.VerifyPN || query.getReductionOption() == ReductionOption.VerifyPNApprox || query.getReductionOption() == ReductionOption.VerifyPNReduce)626 else if(query.getReductionOption() == ReductionOption.VerifyPN || query.getReductionOption() == ReductionOption.VerifyPNApprox || query.getReductionOption() == ReductionOption.VerifyPNReduce)
625 if (batchProcessingVerificationOptions.queryPropertyOption() == QueryPropertyOption.SearchWholeStateSpace){627 if (batchProcessingVerificationOptions.queryPropertyOption() == QueryPropertyOption.SearchWholeStateSpace){
626 return new VerifyPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), false, false, false, false, query.approximationDenominator(), QueryCategory.Default, query.getAlgorithmOption(), false, QueryReductionTime.UnlimitedTime, false);628 return new VerifyPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), false, false, false, false, query.approximationDenominator(), QueryCategory.Default, query.getAlgorithmOption(), false, QueryReductionTime.UnlimitedTime, false, query.isTarOptionEnabled());
627 } else {629 } else {
628 return new VerifyPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useOverApproximation(), query.useReduction(), query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.getCategory(), query.getAlgorithmOption(), query.isSiphontrapEnabled(), query.isQueryReductionEnabled()? QueryReductionTime.UnlimitedTime: QueryReductionTime.NoTime, query.isStubbornReductionEnabled());630 return new VerifyPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useOverApproximation(), query.useReduction(), query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.getCategory(), query.getAlgorithmOption(), query.isSiphontrapEnabled(), query.isQueryReductionEnabled()? QueryReductionTime.UnlimitedTime: QueryReductionTime.NoTime, query.isStubbornReductionEnabled(), query.isTarOptionEnabled());
629 }631 }
630 else632 else
631 return new VerifytaOptions(TraceOption.NONE, query.getSearchOption(), false, query.getReductionOption(), query.useSymmetry(), false, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator());633 return new VerifytaOptions(TraceOption.NONE, query.getSearchOption(), false, query.getReductionOption(), query.useSymmetry(), false, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator());
632634
=== modified file 'src/pipe/dataLayer/TAPNQuery.java'
--- src/pipe/dataLayer/TAPNQuery.java 2021-02-07 11:09:51 +0000
+++ src/pipe/dataLayer/TAPNQuery.java 2021-03-02 20:12:24 +0000
@@ -393,6 +393,7 @@
393 copy.setUseSiphontrap(this.isQueryReductionEnabled());393 copy.setUseSiphontrap(this.isQueryReductionEnabled());
394 copy.setUseQueryReduction(this.isQueryReductionEnabled());394 copy.setUseQueryReduction(this.isQueryReductionEnabled());
395 copy.setUseStubbornReduction(this.isStubbornReductionEnabled());395 copy.setUseStubbornReduction(this.isStubbornReductionEnabled());
396 copy.setUseTarOption(this.isTarOptionEnabled());
396 397
397 return copy;398 return copy;
398 }399 }
399400
=== modified file 'src/pipe/gui/widgets/QueryDialog.java'
--- src/pipe/gui/widgets/QueryDialog.java 2021-02-22 22:26:01 +0000
+++ src/pipe/gui/widgets/QueryDialog.java 2021-03-02 20:12:24 +0000
@@ -1292,6 +1292,7 @@
1292 useQueryReduction.setSelected(queryToCreateFrom.isQueryReductionEnabled());1292 useQueryReduction.setSelected(queryToCreateFrom.isQueryReductionEnabled());
1293 useStubbornReduction.setSelected(queryToCreateFrom.isStubbornReductionEnabled());1293 useStubbornReduction.setSelected(queryToCreateFrom.isStubbornReductionEnabled());
1294 useReduction.setSelected(queryToCreateFrom.useReduction());1294 useReduction.setSelected(queryToCreateFrom.useReduction());
1295 useTraceRefinement.setSelected(queryToCreateFrom.isTarOptionEnabled());
1295 }1296 }
12961297
1297 private void setupTraceOptionsFromQuery(TAPNQuery queryToCreateFrom) {1298 private void setupTraceOptionsFromQuery(TAPNQuery queryToCreateFrom) {

Subscribers

People subscribed via source and target branches