12.07.2015 Views

Full Theoretical Runtime Analysis of Alternating ... - IEEE Xplore

Full Theoretical Runtime Analysis of Alternating ... - IEEE Xplore

Full Theoretical Runtime Analysis of Alternating ... - IEEE Xplore

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

point the input variable representing b will instead representa. Otherwise, it sufficient to increase c up to the valuea + b ≤ n/2+n/2 =n, that can be done in O(log n) steps<strong>of</strong> a pattern search.With a probability that is lower bounded by a constant,in a random starting point each input variable is higher thann/4. In that case, a+b >c, because (n/4)+1+(n/4)+1 >(n/2). By Lemma 1, we need only Θ(1) restarts.Theorem 4. The expected time for AVM to find an optimalsolution to the coverage <strong>of</strong> branch ID 8 is O((log n) 2 ).Pro<strong>of</strong>. This theorem has been proved in our previous work[1].Lemma 2. For search algorithms that use the fitness functiononly for direct comparisons <strong>of</strong> candidate solutions, theexpected time for covering a branch ID w is not higherthan the expected time to cover any <strong>of</strong> its nested branchesID z.Pro<strong>of</strong>. Before a target nested branch ID z is executed, its“parent” branch ID w needs to be executed. Until ID w isnot executed, the fitness function fzw (i.e., search for ID zand ID w is not covered) will be based on the predicate<strong>of</strong> the branch ID w. Hence, that fitness function would beequivalent to the one f w used for a direct search for ID w.In particular, fz w (I) =ζ + f w (I), that because the approximationlevel would be different. However, because the constantζ > 0 would be the same to all the search points,the behaviour <strong>of</strong> a search algorithm, that uses the fitnessfunction only for direct comparisons <strong>of</strong> candidate solutions,would be same on these two fitness functions (and AVMsatisfies this constraint).Because the time to solve (i.e., finding an input that minimises)fzw is not higher than the time needed for f z andbecause fzw is equivalent to f w , then solving f w cannot takein average more time than solving f z .Theorem 5. The expected time for AVM to find an optimalsolution to the coverage <strong>of</strong> branch ID 7 is O((log n) 2 ).Pro<strong>of</strong>. The branch ID 8 is nested to branch ID 7, henceby Lemma 2 and Theorem 4 the expected time isO((log n) 2 ).Theorem 6. The expected time for AVM to find an optimalsolution to the coverage <strong>of</strong> branch ID 9 is O((log n) 2 ).Pro<strong>of</strong>. By Theorem 5, the branch ID 7 can be coveredin O((log n) 2 ) steps. The branch ID 9 (that is nested toID 7), will be covered if ¬(a = b ∧ b = c). If that predicateis not true, a single exploratory search <strong>of</strong> AVM makes ittrue because it is just sufficient to either increase or deceaseany input variable by 1. The only case in which this is notpossible is for I =(1, 1, 1), because it is the only solutionthat satisfies a = b ∧ b = c ∧ a − 1+b ≤ c ∧ a + b ≤c +1∧ a + b>c. In that case, a restart is done.Theorem 7. The expected time for AVM to find an optimalsolution to the coverage <strong>of</strong> branch ID 10 is O((log n) 2 ).Pro<strong>of</strong>. By Theorem 6, the branch ID 9 can be covered inO((log n) 2 ) steps. The branch ID 10 (that is nested toID 9), will be covered if only two input variables are equal(and not all three equal to each other at the same time).If when the branch ID 7 (branch ID 9 is nested to it) isexecuted all the three input variables are equal (in that casebranch ID 8 is executed), then a single exploratory searchis sufficient to execute branch ID 10, because we just needto change the value <strong>of</strong> a single variable.The other case in which all the three variables are differentis quite complex to analyse. Instead <strong>of</strong> analysing itdirectly, we prove the runtime by a comparison with the behaviour<strong>of</strong> AVM on the branch ID 8 (that is more complexand we already proved it in our previous work [1]).Once branch ID 9 is executed, the fitness functionf10 9 for covering branch ID 10 is based on min(δ(a =b),δ(b = c)), whitδ the branch distance function for thepredicates. For simplicity, let consider δ(a = b) b(witha ′ the latest accepted point for a that will become the newb in the next exploratory search). During that search, thevalue <strong>of</strong> δ(b = c) does not change, so it can be consideredas a constant. Because AVM uses the fitness function onlyon direct comparisons, the presence <strong>of</strong> a constant does notinfluence its behaviour. Therefore, in this particular context(i.e., δ(a = b) < δ(b = c), branch ID 7 executed and119

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!