Merge lp:~tapaal-contributor/tapaal/update-ltl-support into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1173
Merged at revision: 1173
Proposed branch: lp:~tapaal-contributor/tapaal/update-ltl-support
Merge into: lp:tapaal
Diff against target: 45 lines (+10/-10)
1 file modified
src/dk/aau/cs/io/queries/XMLQueryLoader.java (+10/-10)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/update-ltl-support
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+427756@code.launchpad.net

Commit message

LTL queries containing exists path are recognized as LTL when loading from XML

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/io/queries/XMLQueryLoader.java'
--- src/dk/aau/cs/io/queries/XMLQueryLoader.java 2021-08-20 06:53:42 +0000
+++ src/dk/aau/cs/io/queries/XMLQueryLoader.java 2022-08-03 09:24:57 +0000
@@ -182,31 +182,31 @@
182182
183 public static boolean canBeLTL(Node prop) {183 public static boolean canBeLTL(Node prop) {
184 NodeList children = prop.getChildNodes();184 NodeList children = prop.getChildNodes();
185 int allPathsCounter = 0;185 int counter = 0;
186186
187 for (int i = 0; i < children.getLength(); i++) {187 for (int i = 0; i < children.getLength(); i++) {
188 Node child = children.item(i);188 Node child = children.item(i);
189 if (child.getNodeName().equals("formula")) {189 if (child.getNodeName().equals("formula")) {
190 allPathsCounter += countAllPaths(child);190 counter += countSupportedPaths(child);
191 }191 }
192 }192 }
193 return allPathsCounter == 1;193 return counter == 1;
194 }194 }
195195
196 private static int countAllPaths(Node prop) {196 private static int countSupportedPaths(Node prop) {
197 NodeList children = prop.getChildNodes();197 NodeList children = prop.getChildNodes();
198 int allPathsCounter = 0;198 int counter = 0;
199199
200 for (int i = 0; i < children.getLength(); i++) {200 for (int i = 0; i < children.getLength(); i++) {
201 Node child = children.item(i);201 Node child = children.item(i);
202 if (child.getNodeName().equals("all-paths")) {202 if (child.getNodeName().equals("all-paths") || child.getNodeName().equals("exists-path")) {
203 allPathsCounter++;203 counter++;
204 } else if (child.getNodeName().equals("exists-path") || child.getNodeName().equals("deadlock")){204 } else if (child.getNodeName().equals("deadlock")){
205 return 100;205 return 100;
206 }206 }
207 allPathsCounter += countAllPaths(child);207 counter += countSupportedPaths(child);
208 }208 }
209 return allPathsCounter;209 return counter;
210 }210 }
211211
212 public static void importQueries(File file, TimedArcPetriNetNetwork network){212 public static void importQueries(File file, TimedArcPetriNetNetwork network){

Subscribers

People subscribed via source and target branches