Merge lp:~tapaal-contributor/tapaal/add-tar-option into lp:tapaal
- add-tar-option
- Merge into trunk
Proposed by
Lena Ernstsen
Status: | Merged |
---|---|
Approved by: | Jiri Srba |
Approved revision: | 1118 |
Merged at revision: | 1119 |
Proposed branch: | lp:~tapaal-contributor/tapaal/add-tar-option |
Merge into: | lp:tapaal |
Diff against target: |
312 lines (+66/-15) 8 files modified
src/dk/aau/cs/verification/VerifyTAPN/VerifyPNOptions.java (+9/-4) src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNOptions.java (+7/-1) src/pipe/dataLayer/TAPNQuery.java (+10/-0) src/pipe/gui/KBoundAnalyzer.java (+1/-1) src/pipe/gui/RunVerificationBase.java (+4/-2) src/pipe/gui/Verifier.java (+4/-4) src/pipe/gui/widgets/QueryDialog.java (+30/-2) src/resources/Example nets/train-level-crossing.tapn (+1/-1) |
To merge this branch: | bzr merge lp:~tapaal-contributor/tapaal/add-tar-option |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jiri Srba | Approve | ||
Kenneth Yrke Jørgensen | code | Approve | |
Review via email: mp+397624@code.launchpad.net |
Commit message
Added -tar option to the query dialog
Description of the change
To post a comment you must log in.
- 1116. By Lena Ernstsen
-
Merged lp:tapaal
Revision history for this message
Kenneth Yrke Jørgensen (yrke) : | # |
review:
Approve
(code)
- 1117. By Lena Ernstsen
-
Only possible to use tar when either 'AG' or 'EF' is chosen
Revision history for this message
Jiri Srba (srba) wrote : | # |
I just made a simple untimed net and a query:
A (TAPN1.P0 = 1 U (EF TAPN1.P0 = 1))
and it still offers to use the tar option in the query dialog.
review:
Needs Fixing
- 1118. By Lena Ernstsen
-
Fixed tar only possible with AG and EF
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
1 | === modified file 'src/dk/aau/cs/verification/VerifyTAPN/VerifyPNOptions.java' | |||
2 | --- src/dk/aau/cs/verification/VerifyTAPN/VerifyPNOptions.java 2020-10-15 15:44:06 +0000 | |||
3 | +++ src/dk/aau/cs/verification/VerifyTAPN/VerifyPNOptions.java 2021-02-22 22:26:13 +0000 | |||
4 | @@ -19,26 +19,28 @@ | |||
5 | 19 | private boolean useSiphontrap = false; | 19 | private boolean useSiphontrap = false; |
6 | 20 | private QueryReductionTime queryReductionTime; | 20 | private QueryReductionTime queryReductionTime; |
7 | 21 | private boolean useStubbornReduction = true; | 21 | private boolean useStubbornReduction = true; |
8 | 22 | private boolean useTarOption; | ||
9 | 22 | private String pathToReducedNet; | 23 | private String pathToReducedNet; |
10 | 23 | 24 | ||
11 | 24 | public VerifyPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean useOverApproximation, ModelReduction modelReduction, | 25 | public VerifyPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean useOverApproximation, ModelReduction modelReduction, |
12 | 25 | boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator, QueryCategory queryCategory, AlgorithmOption algorithmOption, | 26 | boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator, QueryCategory queryCategory, AlgorithmOption algorithmOption, |
15 | 26 | boolean siphontrap, QueryReductionTime queryReduction, boolean stubbornReduction, String pathToReducedNet) { | 27 | boolean siphontrap, QueryReductionTime queryReduction, boolean stubbornReduction, String pathToReducedNet, boolean useTarOption) { |
16 | 27 | super(extraTokens, traceOption, search, true, useOverApproximation, false, new InclusionPlaces(), enableOverApproximation, enableUnderApproximation, approximationDenominator); | 28 | super(extraTokens, traceOption, search, true, useOverApproximation, false, new InclusionPlaces(), enableOverApproximation, enableUnderApproximation, approximationDenominator, useTarOption); |
17 | 28 | this.modelReduction = modelReduction; | 29 | this.modelReduction = modelReduction; |
18 | 29 | this.queryCategory = queryCategory; | 30 | this.queryCategory = queryCategory; |
19 | 30 | this.algorithmOption = algorithmOption; | 31 | this.algorithmOption = algorithmOption; |
20 | 31 | this.useSiphontrap = siphontrap; | 32 | this.useSiphontrap = siphontrap; |
21 | 32 | this.queryReductionTime = queryReduction; | 33 | this.queryReductionTime = queryReduction; |
22 | 33 | this.useStubbornReduction = stubbornReduction; | 34 | this.useStubbornReduction = stubbornReduction; |
23 | 35 | this.useTarOption = useTarOption; | ||
24 | 34 | this.pathToReducedNet = pathToReducedNet; | 36 | this.pathToReducedNet = pathToReducedNet; |
25 | 35 | } | 37 | } |
27 | 36 | 38 | ||
28 | 37 | public VerifyPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean useOverApproximation, boolean useModelReduction, | 39 | public VerifyPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean useOverApproximation, boolean useModelReduction, |
29 | 38 | boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator, QueryCategory queryCategory, AlgorithmOption algorithmOption, | 40 | boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator, QueryCategory queryCategory, AlgorithmOption algorithmOption, |
30 | 39 | boolean siphontrap, QueryReductionTime queryReduction, boolean stubbornReduction) { | 41 | boolean siphontrap, QueryReductionTime queryReduction, boolean stubbornReduction) { |
31 | 40 | this(extraTokens, traceOption, search, useOverApproximation, useModelReduction? ModelReduction.AGGRESSIVE:ModelReduction.NO_REDUCTION, enableOverApproximation, | 42 | this(extraTokens, traceOption, search, useOverApproximation, useModelReduction? ModelReduction.AGGRESSIVE:ModelReduction.NO_REDUCTION, enableOverApproximation, |
33 | 41 | enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, null); | 43 | enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, null, false); |
34 | 42 | } | 44 | } |
35 | 43 | 45 | ||
36 | 44 | @Override | 46 | @Override |
37 | @@ -83,6 +85,9 @@ | |||
38 | 83 | if (!this.useStubbornReduction) { | 85 | if (!this.useStubbornReduction) { |
39 | 84 | result.append(" -p "); | 86 | result.append(" -p "); |
40 | 85 | } | 87 | } |
41 | 88 | if (this.useTarOption) { | ||
42 | 89 | result.append(" -tar "); | ||
43 | 90 | } | ||
44 | 86 | return result.toString(); | 91 | return result.toString(); |
45 | 87 | } | 92 | } |
46 | 88 | 93 | ||
47 | 89 | 94 | ||
48 | === modified file 'src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNOptions.java' | |||
49 | --- src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNOptions.java 2020-07-13 13:58:47 +0000 | |||
50 | +++ src/dk/aau/cs/verification/VerifyTAPN/VerifyTAPNOptions.java 2021-02-22 22:26:13 +0000 | |||
51 | @@ -16,6 +16,7 @@ | |||
52 | 16 | protected int tokensInModel; | 16 | protected int tokensInModel; |
53 | 17 | private final boolean symmetry; | 17 | private final boolean symmetry; |
54 | 18 | private final boolean discreteInclusion; | 18 | private final boolean discreteInclusion; |
55 | 19 | private final boolean tarOption; | ||
56 | 19 | private InclusionPlaces inclusionPlaces; | 20 | private InclusionPlaces inclusionPlaces; |
57 | 20 | 21 | ||
58 | 21 | //only used for boundedness analysis | 22 | //only used for boundedness analysis |
59 | @@ -27,8 +28,12 @@ | |||
60 | 27 | public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean symmetry, boolean useStateequationCheck, boolean discreteInclusion, boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator) { | 28 | public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean symmetry, boolean useStateequationCheck, boolean discreteInclusion, boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator) { |
61 | 28 | this(extraTokens,traceOption, search, symmetry, useStateequationCheck, discreteInclusion, new InclusionPlaces(), enableOverApproximation, enableUnderApproximation, approximationDenominator); | 29 | this(extraTokens,traceOption, search, symmetry, useStateequationCheck, discreteInclusion, new InclusionPlaces(), enableOverApproximation, enableUnderApproximation, approximationDenominator); |
62 | 29 | } | 30 | } |
63 | 31 | |||
64 | 32 | public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean symmetry, boolean useStateequationCheck, boolean discreteInclusion, InclusionPlaces inclusionPlaces, boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator) { | ||
65 | 33 | this(extraTokens,traceOption, search, symmetry, useStateequationCheck, discreteInclusion, new InclusionPlaces(), enableOverApproximation, enableUnderApproximation, approximationDenominator, false); | ||
66 | 34 | } | ||
67 | 30 | 35 | ||
69 | 31 | public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean symmetry, boolean useStateEquationCheck, boolean discreteInclusion, InclusionPlaces inclusionPlaces, boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator) { | 36 | public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean symmetry, boolean useStateEquationCheck, boolean discreteInclusion, InclusionPlaces inclusionPlaces, boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator, boolean tarOption) { |
70 | 32 | this.extraTokens = extraTokens; | 37 | this.extraTokens = extraTokens; |
71 | 33 | this.traceOption = traceOption; | 38 | this.traceOption = traceOption; |
72 | 34 | searchOption = search; | 39 | searchOption = search; |
73 | @@ -39,6 +44,7 @@ | |||
74 | 39 | this.enabledOverApproximation = enableOverApproximation; | 44 | this.enabledOverApproximation = enableOverApproximation; |
75 | 40 | this.enabledUnderApproximation = enableUnderApproximation; | 45 | this.enabledUnderApproximation = enableUnderApproximation; |
76 | 41 | this.approximationDenominator = approximationDenominator; | 46 | this.approximationDenominator = approximationDenominator; |
77 | 47 | this.tarOption = tarOption; | ||
78 | 42 | } | 48 | } |
79 | 43 | 49 | ||
80 | 44 | public TraceOption trace() { | 50 | public TraceOption trace() { |
81 | 45 | 51 | ||
82 | === modified file 'src/pipe/dataLayer/TAPNQuery.java' | |||
83 | --- src/pipe/dataLayer/TAPNQuery.java 2020-11-06 19:41:50 +0000 | |||
84 | +++ src/pipe/dataLayer/TAPNQuery.java 2021-02-22 22:26:13 +0000 | |||
85 | @@ -72,6 +72,7 @@ | |||
86 | 72 | private boolean useSiphontrap = false; | 72 | private boolean useSiphontrap = false; |
87 | 73 | private boolean useQueryReduction = true; | 73 | private boolean useQueryReduction = true; |
88 | 74 | private boolean useStubbornReduction = true; | 74 | private boolean useStubbornReduction = true; |
89 | 75 | private boolean useTarOption = false; | ||
90 | 75 | 76 | ||
91 | 76 | /** | 77 | /** |
92 | 77 | * @param name | 78 | * @param name |
93 | @@ -108,6 +109,14 @@ | |||
94 | 108 | return this.useStubbornReduction; | 109 | return this.useStubbornReduction; |
95 | 109 | } | 110 | } |
96 | 110 | 111 | ||
97 | 112 | public boolean isTarOptionEnabled() { | ||
98 | 113 | return this.useTarOption; | ||
99 | 114 | } | ||
100 | 115 | |||
101 | 116 | public void setUseTarOption(boolean useTarOption) { | ||
102 | 117 | this.useTarOption = useTarOption; | ||
103 | 118 | } | ||
104 | 119 | |||
105 | 111 | public int approximationDenominator() { | 120 | public int approximationDenominator() { |
106 | 112 | return this.denominator; | 121 | return this.denominator; |
107 | 113 | } | 122 | } |
108 | @@ -361,6 +370,7 @@ | |||
109 | 361 | useSiphontrap = newQuery.isSiphontrapEnabled(); | 370 | useSiphontrap = newQuery.isSiphontrapEnabled(); |
110 | 362 | useQueryReduction = newQuery.isQueryReductionEnabled(); | 371 | useQueryReduction = newQuery.isQueryReductionEnabled(); |
111 | 363 | useStubbornReduction = newQuery.isStubbornReductionEnabled(); | 372 | useStubbornReduction = newQuery.isStubbornReductionEnabled(); |
112 | 373 | useTarOption = newQuery.isTarOptionEnabled(); | ||
113 | 364 | } | 374 | } |
114 | 365 | 375 | ||
115 | 366 | public InclusionPlaces inclusionPlaces() { | 376 | public InclusionPlaces inclusionPlaces() { |
116 | 367 | 377 | ||
117 | === modified file 'src/pipe/gui/KBoundAnalyzer.java' | |||
118 | --- src/pipe/gui/KBoundAnalyzer.java 2020-10-15 15:44:06 +0000 | |||
119 | +++ src/pipe/gui/KBoundAnalyzer.java 2021-02-22 22:26:13 +0000 | |||
120 | @@ -52,7 +52,7 @@ | |||
121 | 52 | 52 | ||
122 | 53 | protected VerifyTAPNOptions verificationOptions() { | 53 | protected VerifyTAPNOptions verificationOptions() { |
123 | 54 | if(modelChecker instanceof VerifyPN){ | 54 | if(modelChecker instanceof VerifyPN){ |
125 | 55 | return new VerifyPNOptions(k, TraceOption.NONE, SearchOption.BFS, false, ModelReduction.BOUNDPRESERVING, false, false, 1, QueryCategory.Default, AlgorithmOption.CERTAIN_ZERO, false, pipe.dataLayer.TAPNQuery.QueryReductionTime.UnlimitedTime, false, null); | 55 | return new VerifyPNOptions(k, TraceOption.NONE, SearchOption.BFS, false, ModelReduction.BOUNDPRESERVING, false, false, 1, QueryCategory.Default, AlgorithmOption.CERTAIN_ZERO, false, pipe.dataLayer.TAPNQuery.QueryReductionTime.UnlimitedTime, false, null, false); |
126 | 56 | } else if(modelChecker instanceof VerifyTAPN){ | 56 | } else if(modelChecker instanceof VerifyTAPN){ |
127 | 57 | return new VerifyTAPNOptions(k, TraceOption.NONE, SearchOption.BFS, true, false, true, false, false, 1); | 57 | return new VerifyTAPNOptions(k, TraceOption.NONE, SearchOption.BFS, true, false, true, false, false, 1); |
128 | 58 | } else if(modelChecker instanceof VerifyTAPNDiscreteVerification){ | 58 | } else if(modelChecker instanceof VerifyTAPNDiscreteVerification){ |
129 | 59 | 59 | ||
130 | === modified file 'src/pipe/gui/RunVerificationBase.java' | |||
131 | --- src/pipe/gui/RunVerificationBase.java 2020-11-11 07:55:24 +0000 | |||
132 | +++ src/pipe/gui/RunVerificationBase.java 2021-02-22 22:26:13 +0000 | |||
133 | @@ -122,7 +122,8 @@ | |||
134 | 122 | dataLayerQuery.isSiphontrapEnabled(), | 122 | dataLayerQuery.isSiphontrapEnabled(), |
135 | 123 | dataLayerQuery.isQueryReductionEnabled()? pipe.dataLayer.TAPNQuery.QueryReductionTime.UnlimitedTime: pipe.dataLayer.TAPNQuery.QueryReductionTime.NoTime, | 123 | dataLayerQuery.isQueryReductionEnabled()? pipe.dataLayer.TAPNQuery.QueryReductionTime.UnlimitedTime: pipe.dataLayer.TAPNQuery.QueryReductionTime.NoTime, |
136 | 124 | dataLayerQuery.isStubbornReductionEnabled(), | 124 | dataLayerQuery.isStubbornReductionEnabled(), |
138 | 125 | reducedNetFilePath | 125 | reducedNetFilePath, |
139 | 126 | dataLayerQuery.isTarOptionEnabled() | ||
140 | 126 | ), | 127 | ), |
141 | 127 | transformedModel, | 128 | transformedModel, |
142 | 128 | clonedQuery | 129 | clonedQuery |
143 | @@ -143,7 +144,8 @@ | |||
144 | 143 | false, | 144 | false, |
145 | 144 | pipe.dataLayer.TAPNQuery.QueryReductionTime.UnlimitedTime, | 145 | pipe.dataLayer.TAPNQuery.QueryReductionTime.UnlimitedTime, |
146 | 145 | false, | 146 | false, |
148 | 146 | reducedNetFilePath | 147 | reducedNetFilePath, |
149 | 148 | false | ||
150 | 147 | ), | 149 | ), |
151 | 148 | transformedModel, | 150 | transformedModel, |
152 | 149 | clonedQuery | 151 | clonedQuery |
153 | 150 | 152 | ||
154 | === modified file 'src/pipe/gui/Verifier.java' | |||
155 | --- src/pipe/gui/Verifier.java 2020-11-13 10:08:54 +0000 | |||
156 | +++ src/pipe/gui/Verifier.java 2021-02-22 22:26:13 +0000 | |||
157 | @@ -176,7 +176,6 @@ | |||
158 | 176 | query.isStubbornReductionEnabled() | 176 | query.isStubbornReductionEnabled() |
159 | 177 | ); | 177 | ); |
160 | 178 | } else if(query.getReductionOption() == ReductionOption.VerifyPN){ | 178 | } else if(query.getReductionOption() == ReductionOption.VerifyPN){ |
161 | 179 | |||
162 | 180 | try { | 179 | try { |
163 | 181 | reducedNetTempFile = File.createTempFile("reduced-", ".pnml"); | 180 | reducedNetTempFile = File.createTempFile("reduced-", ".pnml"); |
164 | 182 | } catch (IOException e) { | 181 | } catch (IOException e) { |
165 | @@ -202,7 +201,8 @@ | |||
166 | 202 | query.isSiphontrapEnabled(), | 201 | query.isSiphontrapEnabled(), |
167 | 203 | TAPNQuery.QueryReductionTime.NoTime, | 202 | TAPNQuery.QueryReductionTime.NoTime, |
168 | 204 | query.isStubbornReductionEnabled(), | 203 | query.isStubbornReductionEnabled(), |
170 | 205 | reducedNetTempFile.getAbsolutePath() | 204 | reducedNetTempFile.getAbsolutePath(), |
171 | 205 | query.isTarOptionEnabled() | ||
172 | 206 | ); | 206 | ); |
173 | 207 | } else { | 207 | } else { |
174 | 208 | verifytapnOptions = new VerifyPNOptions( | 208 | verifytapnOptions = new VerifyPNOptions( |
175 | @@ -219,10 +219,10 @@ | |||
176 | 219 | query.isSiphontrapEnabled(), | 219 | query.isSiphontrapEnabled(), |
177 | 220 | query.isQueryReductionEnabled()? TAPNQuery.QueryReductionTime.UnlimitedTime: TAPNQuery.QueryReductionTime.NoTime, | 220 | query.isQueryReductionEnabled()? TAPNQuery.QueryReductionTime.UnlimitedTime: TAPNQuery.QueryReductionTime.NoTime, |
178 | 221 | query.isStubbornReductionEnabled(), | 221 | query.isStubbornReductionEnabled(), |
180 | 222 | reducedNetTempFile.getAbsolutePath() | 222 | reducedNetTempFile.getAbsolutePath(), |
181 | 223 | query.isTarOptionEnabled() | ||
182 | 223 | ); | 224 | ); |
183 | 224 | } | 225 | } |
184 | 225 | |||
185 | 226 | } else { | 226 | } else { |
186 | 227 | verifytapnOptions = new VerifyTAPNOptions( | 227 | verifytapnOptions = new VerifyTAPNOptions( |
187 | 228 | bound, | 228 | bound, |
188 | 229 | 229 | ||
189 | === modified file 'src/pipe/gui/widgets/QueryDialog.java' | |||
190 | --- src/pipe/gui/widgets/QueryDialog.java 2020-12-17 21:03:12 +0000 | |||
191 | +++ src/pipe/gui/widgets/QueryDialog.java 2021-02-22 22:26:13 +0000 | |||
192 | @@ -165,6 +165,7 @@ | |||
193 | 165 | private JCheckBox useQueryReduction; | 165 | private JCheckBox useQueryReduction; |
194 | 166 | private JCheckBox useReduction; | 166 | private JCheckBox useReduction; |
195 | 167 | private JCheckBox useStubbornReduction; | 167 | private JCheckBox useStubbornReduction; |
196 | 168 | private JCheckBox useTraceRefinement; | ||
197 | 168 | 169 | ||
198 | 169 | // Approximation options panel | 170 | // Approximation options panel |
199 | 170 | private JPanel overApproximationOptionsPanel; | 171 | private JPanel overApproximationOptionsPanel; |
200 | @@ -293,6 +294,7 @@ | |||
201 | 293 | private final static String TOOL_TIP_USE_STRUCTURALREDUCTION = "Apply structural reductions to reduce the size of the net."; | 294 | private final static String TOOL_TIP_USE_STRUCTURALREDUCTION = "Apply structural reductions to reduce the size of the net."; |
202 | 294 | private final static String TOOL_TIP_USE_SIPHONTRAP = "For a deadlock query, attempt to prove deadlock-freedom by using siphon-trap analysis via linear programming."; | 295 | private final static String TOOL_TIP_USE_SIPHONTRAP = "For a deadlock query, attempt to prove deadlock-freedom by using siphon-trap analysis via linear programming."; |
203 | 295 | private final static String TOOL_TIP_USE_QUERY_REDUCTION = "Use query rewriting rules and linear programming (state equations) to reduce the size of the query."; | 296 | private final static String TOOL_TIP_USE_QUERY_REDUCTION = "Use query rewriting rules and linear programming (state equations) to reduce the size of the query."; |
204 | 297 | private final static String TOOL_TIP_USE_TRACE_REFINEMENT = "Enables Trace Abstraction Refinement for reachability properties"; | ||
205 | 296 | 298 | ||
206 | 297 | //Tool tips for search options panel | 299 | //Tool tips for search options panel |
207 | 298 | private final static String TOOL_TIP_HEURISTIC_SEARCH = "<html>Uses a heuristic method in state space exploration.<br />" + | 300 | private final static String TOOL_TIP_HEURISTIC_SEARCH = "<html>Uses a heuristic method in state space exploration.<br />" + |
208 | @@ -322,8 +324,7 @@ | |||
209 | 322 | private final static String TOOL_TIP_APPROXIMATION_METHOD_UNDER = "Approximate by dividing all intervals with the approximation constant and shrinking the intervals."; | 324 | private final static String TOOL_TIP_APPROXIMATION_METHOD_UNDER = "Approximate by dividing all intervals with the approximation constant and shrinking the intervals."; |
210 | 323 | private final static String TOOL_TIP_APPROXIMATION_CONSTANT = "Choose approximation constant"; | 325 | private final static String TOOL_TIP_APPROXIMATION_CONSTANT = "Choose approximation constant"; |
211 | 324 | 326 | ||
214 | 325 | public QueryDialog(EscapableDialog me, QueryDialogueOption option, | 327 | public QueryDialog(EscapableDialog me, QueryDialogueOption option, TAPNQuery queryToCreateFrom, TimedArcPetriNetNetwork tapnNetwork, HashMap<TimedArcPetriNet, DataLayer> guiModels, TabContent.TAPNLens lens) { |
213 | 326 | TAPNQuery queryToCreateFrom, TimedArcPetriNetNetwork tapnNetwork, HashMap<TimedArcPetriNet, DataLayer> guiModels, TabContent.TAPNLens lens) { | ||
215 | 327 | this.tapnNetwork = tapnNetwork; | 328 | this.tapnNetwork = tapnNetwork; |
216 | 328 | this.guiModels = guiModels; | 329 | this.guiModels = guiModels; |
217 | 329 | this.lens = lens; | 330 | this.lens = lens; |
218 | @@ -442,6 +443,7 @@ | |||
219 | 442 | query.setUseSiphontrap(useSiphonTrap.isSelected()); | 443 | query.setUseSiphontrap(useSiphonTrap.isSelected()); |
220 | 443 | query.setUseQueryReduction(useQueryReduction.isSelected()); | 444 | query.setUseQueryReduction(useQueryReduction.isSelected()); |
221 | 444 | query.setUseStubbornReduction(useStubbornReduction.isSelected()); | 445 | query.setUseStubbornReduction(useStubbornReduction.isSelected()); |
222 | 446 | query.setUseTarOption(useTraceRefinement.isSelected()); | ||
223 | 445 | return query; | 447 | return query; |
224 | 446 | } | 448 | } |
225 | 447 | 449 | ||
226 | @@ -1210,8 +1212,15 @@ | |||
227 | 1210 | setupSearchOptionsFromQuery(queryToCreateFrom); | 1212 | setupSearchOptionsFromQuery(queryToCreateFrom); |
228 | 1211 | setupReductionOptionsFromQuery(queryToCreateFrom); | 1213 | setupReductionOptionsFromQuery(queryToCreateFrom); |
229 | 1212 | setupTraceOptionsFromQuery(queryToCreateFrom); | 1214 | setupTraceOptionsFromQuery(queryToCreateFrom); |
230 | 1215 | setupTarOptionsFromQuery(queryToCreateFrom); | ||
231 | 1213 | } | 1216 | } |
232 | 1214 | 1217 | ||
233 | 1218 | private void setupTarOptionsFromQuery(TAPNQuery queryToCreateFrom) { | ||
234 | 1219 | if (queryToCreateFrom.isTarOptionEnabled()) { | ||
235 | 1220 | useTraceRefinement.setSelected(true); | ||
236 | 1221 | } | ||
237 | 1222 | } | ||
238 | 1223 | |||
239 | 1215 | private void setupApproximationOptionsFromQuery(TAPNQuery queryToCreateFrom) { | 1224 | private void setupApproximationOptionsFromQuery(TAPNQuery queryToCreateFrom) { |
240 | 1216 | if (queryToCreateFrom.isOverApproximationEnabled()) | 1225 | if (queryToCreateFrom.isOverApproximationEnabled()) |
241 | 1217 | overApproximationEnable.setSelected(true); | 1226 | overApproximationEnable.setSelected(true); |
242 | @@ -2656,6 +2665,7 @@ | |||
243 | 2656 | useGCD = new JCheckBox("Use GCD"); | 2665 | useGCD = new JCheckBox("Use GCD"); |
244 | 2657 | usePTrie = new JCheckBox("Use PTrie"); | 2666 | usePTrie = new JCheckBox("Use PTrie"); |
245 | 2658 | useOverApproximation = new JCheckBox("Use untimed state-equations check"); | 2667 | useOverApproximation = new JCheckBox("Use untimed state-equations check"); |
246 | 2668 | useTraceRefinement = new JCheckBox("Use trace abstraction refinement"); | ||
247 | 2659 | 2669 | ||
248 | 2660 | useReduction.setSelected(true); | 2670 | useReduction.setSelected(true); |
249 | 2661 | useSiphonTrap.setSelected(false); | 2671 | useSiphonTrap.setSelected(false); |
250 | @@ -2668,6 +2678,7 @@ | |||
251 | 2668 | useGCD.setSelected(true); | 2678 | useGCD.setSelected(true); |
252 | 2669 | usePTrie.setSelected(true); | 2679 | usePTrie.setSelected(true); |
253 | 2670 | useOverApproximation.setSelected(true); | 2680 | useOverApproximation.setSelected(true); |
254 | 2681 | useTraceRefinement.setSelected(false); | ||
255 | 2671 | 2682 | ||
256 | 2672 | useReduction.setToolTipText(TOOL_TIP_USE_STRUCTURALREDUCTION); | 2683 | useReduction.setToolTipText(TOOL_TIP_USE_STRUCTURALREDUCTION); |
257 | 2673 | useSiphonTrap.setToolTipText(TOOL_TIP_USE_SIPHONTRAP); | 2684 | useSiphonTrap.setToolTipText(TOOL_TIP_USE_SIPHONTRAP); |
258 | @@ -2680,6 +2691,7 @@ | |||
259 | 2680 | useGCD.setToolTipText(TOOL_TIP_GCD); | 2691 | useGCD.setToolTipText(TOOL_TIP_GCD); |
260 | 2681 | usePTrie.setToolTipText(TOOL_TIP_PTRIE); | 2692 | usePTrie.setToolTipText(TOOL_TIP_PTRIE); |
261 | 2682 | useOverApproximation.setToolTipText(TOOL_TIP_OVERAPPROX); | 2693 | useOverApproximation.setToolTipText(TOOL_TIP_OVERAPPROX); |
262 | 2694 | useTraceRefinement.setToolTipText(TOOL_TIP_USE_TRACE_REFINEMENT); | ||
263 | 2683 | 2695 | ||
264 | 2684 | if (lens.isTimed() || lens.isGame()) { | 2696 | if (lens.isTimed() || lens.isGame()) { |
265 | 2685 | initTimedReductionOptions(); | 2697 | initTimedReductionOptions(); |
266 | @@ -2765,6 +2777,9 @@ | |||
267 | 2765 | gbc.gridx = 2; | 2777 | gbc.gridx = 2; |
268 | 2766 | gbc.gridy = 3; | 2778 | gbc.gridy = 3; |
269 | 2767 | reductionOptionsPanel.add(useStubbornReduction, gbc); | 2779 | reductionOptionsPanel.add(useStubbornReduction, gbc); |
270 | 2780 | gbc.gridx = 3; | ||
271 | 2781 | gbc.gridy = 0; | ||
272 | 2782 | reductionOptionsPanel.add(useTraceRefinement, gbc); | ||
273 | 2768 | } | 2783 | } |
274 | 2769 | 2784 | ||
275 | 2770 | protected void setEnabledOptionsAccordingToCurrentReduction() { | 2785 | protected void setEnabledOptionsAccordingToCurrentReduction() { |
276 | @@ -2776,11 +2791,24 @@ | |||
277 | 2776 | refreshDiscreteOptions(); | 2791 | refreshDiscreteOptions(); |
278 | 2777 | refreshDiscreteInclusion(); | 2792 | refreshDiscreteInclusion(); |
279 | 2778 | refreshOverApproximationOption(); | 2793 | refreshOverApproximationOption(); |
280 | 2794 | } else if (!lens.isTimed()) { | ||
281 | 2795 | refreshTraceRefinement(); | ||
282 | 2779 | } | 2796 | } |
283 | 2780 | updateSearchStrategies(); | 2797 | updateSearchStrategies(); |
284 | 2781 | refreshExportButtonText(); | 2798 | refreshExportButtonText(); |
285 | 2782 | } | 2799 | } |
286 | 2783 | 2800 | ||
287 | 2801 | private void refreshTraceRefinement() { | ||
288 | 2802 | ReductionOption reduction = getReductionOption(); | ||
289 | 2803 | useTraceRefinement.setEnabled(false); | ||
290 | 2804 | |||
291 | 2805 | if (reduction != null && reduction.equals(ReductionOption.VerifyPN) && !hasInhibitorArcs && | ||
292 | 2806 | (newProperty.toString().startsWith("AG") || newProperty.toString().startsWith("EF")) && | ||
293 | 2807 | !newProperty.hasNestedPathQuantifiers()) { | ||
294 | 2808 | useTraceRefinement.setEnabled(true); | ||
295 | 2809 | } | ||
296 | 2810 | } | ||
297 | 2811 | |||
298 | 2784 | private void refreshDiscreteInclusion() { | 2812 | private void refreshDiscreteInclusion() { |
299 | 2785 | ReductionOption reduction = getReductionOption(); | 2813 | ReductionOption reduction = getReductionOption(); |
300 | 2786 | if(reduction == null){ | 2814 | if(reduction == null){ |
301 | 2787 | 2815 | ||
302 | === modified file 'src/resources/Example nets/train-level-crossing.tapn' | |||
303 | --- src/resources/Example nets/train-level-crossing.tapn 2018-07-13 18:16:32 +0000 | |||
304 | +++ src/resources/Example nets/train-level-crossing.tapn 2021-02-22 22:26:13 +0000 | |||
305 | @@ -112,6 +112,6 @@ | |||
306 | 112 | <arcpath arcPointType="false" id="1" xCoord="117" yCoord="147"/> | 112 | <arcpath arcPointType="false" id="1" xCoord="117" yCoord="147"/> |
307 | 113 | </arc> | 113 | </arc> |
308 | 114 | </net> | 114 | </net> |
310 | 115 | <query active="true" approximationDenominator="2" capacity="5" discreteInclusion="false" enableOverApproximation="false" enableUnderApproximation="false" extrapolationOption="null" gcd="true" hashTableSize="null" inclusionPlaces="*NONE*" name="Crossing is Save" overApproximation="true" pTrie="true" query="AG (!(Train.DangerZone > 0) or TraficLight.Red = 1)" reduction="true" reductionOption="VerifyTAPN" searchOption="HEURISTIC" symmetry="true" timeDarts="true" traceOption="NONE"/> | 115 | <query active="true" approximationDenominator="2" capacity="5" discreteInclusion="false" enableOverApproximation="false" enableUnderApproximation="false" extrapolationOption="null" gcd="true" hashTableSize="null" inclusionPlaces="*NONE*" name="Crossing is Safe" overApproximation="true" pTrie="true" query="AG (!(Train.DangerZone > 0) or TraficLight.Red = 1)" reduction="true" reductionOption="VerifyTAPN" searchOption="HEURISTIC" symmetry="true" timeDarts="true" traceOption="NONE"/> |
311 | 116 | <k-bound bound="3"/> | 116 | <k-bound bound="3"/> |
312 | 117 | </pnml> | 117 | </pnml> |
The detection if a query is a reachability query must be improved - tar can only be offered for EF or AG queries that do not contain any other temporal operators.
E.g. for the query
E ((AG true) U false)
the TAR option is offered as well, which should not be the case.