Completing model-checking automation script to process 2 different lists.
authorrtrimana <rtrimana@uci.edu>
Fri, 26 Jul 2019 23:30:39 +0000 (16:30 -0700)
committerrtrimana <rtrimana@uci.edu>
Fri, 26 Jul 2019 23:30:39 +0000 (16:30 -0700)
ModelCheck.py

index 82c6adf..6defff6 100644 (file)
@@ -30,6 +30,7 @@ extractAppList.close()
 
 # Try to create pairs
 appPairs = []
+useSecondList = False
 # Extract the second list if provided (this is for combinations between two lists)
 if (len(sys.argv) == 6):
        secondList = sys.argv[5]
@@ -38,15 +39,22 @@ if (len(sys.argv) == 6):
                if '#' not in app:
                        appList2.append(app.strip())
        extractAppList.close()
+       useSecondList = True
 # Just copy the first list to the second list
 else:
        appList2 = appList1
 
-# Generate the permutations of pairs
-for i in range(len(appList1)):
-       for j in range(i + 1, len(appList2)):
-               appPairs.append((appList1[i], appList2[j]))
-
+if useSecondList is False:
+       # Generate the permutations of pairs
+       for i in range(len(appList1)):
+               for j in range(i + 1, len(appList2)):
+                       appPairs.append((appList1[i], appList2[j]))
+else:
+       # Generate pairs from 2 lists
+       for i in range(len(appList1)):
+                       for j in range(len(appList2)):
+                               appPairs.append((appList1[i], appList2[j]))
+                       
 # PART 2: 
 print "PHASE 2: Running JPF ...\n"
 # List down all the log file names