From: rtrimana Date: Fri, 26 Jul 2019 23:30:39 +0000 (-0700) Subject: Completing model-checking automation script to process 2 different lists. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=commitdiff_plain;h=ba967f3b5a8c1749ba27555620b879930e8bbe92 Completing model-checking automation script to process 2 different lists. --- diff --git a/ModelCheck.py b/ModelCheck.py index 82c6adf..6defff6 100644 --- a/ModelCheck.py +++ b/ModelCheck.py @@ -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