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
1=== modified file 'src/dk/aau/cs/io/queries/XMLQueryLoader.java'
2--- src/dk/aau/cs/io/queries/XMLQueryLoader.java 2021-08-20 06:53:42 +0000
3+++ src/dk/aau/cs/io/queries/XMLQueryLoader.java 2022-08-03 09:24:57 +0000
4@@ -182,31 +182,31 @@
5
6 public static boolean canBeLTL(Node prop) {
7 NodeList children = prop.getChildNodes();
8- int allPathsCounter = 0;
9+ int counter = 0;
10
11 for (int i = 0; i < children.getLength(); i++) {
12 Node child = children.item(i);
13 if (child.getNodeName().equals("formula")) {
14- allPathsCounter += countAllPaths(child);
15+ counter += countSupportedPaths(child);
16 }
17 }
18- return allPathsCounter == 1;
19+ return counter == 1;
20 }
21
22- private static int countAllPaths(Node prop) {
23+ private static int countSupportedPaths(Node prop) {
24 NodeList children = prop.getChildNodes();
25- int allPathsCounter = 0;
26+ int counter = 0;
27
28 for (int i = 0; i < children.getLength(); i++) {
29 Node child = children.item(i);
30- if (child.getNodeName().equals("all-paths")) {
31- allPathsCounter++;
32- } else if (child.getNodeName().equals("exists-path") || child.getNodeName().equals("deadlock")){
33+ if (child.getNodeName().equals("all-paths") || child.getNodeName().equals("exists-path")) {
34+ counter++;
35+ } else if (child.getNodeName().equals("deadlock")){
36 return 100;
37 }
38- allPathsCounter += countAllPaths(child);
39+ counter += countSupportedPaths(child);
40 }
41- return allPathsCounter;
42+ return counter;
43 }
44
45 public static void importQueries(File file, TimedArcPetriNetNetwork network){

Subscribers

People subscribed via source and target branches