153 Views

Download Presentation
## Test II 精读

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Test II 精读**廖钧**Background**• Termination analysis • Determine whether a program will terminate • Correctness of an algorithm depends on termination • Test termination properties of programs • Can a test suite for a program be used profitably for constructing termination proofs?**Problem**• Generate a novel termination prover based on information derived from tests. (Called TpT) • What kind of program is TpT’s input? • How to define termination?**Preliminaries**• Define while programs • Input of TpT • Loop: L = while B do S over variables() • A program with loops**Preliminaries**• Define termination • Loop bound • () -> () • Linear expression = • If each loop has a loop bound, then termination**Preliminaries**• Generate log data from test inputs • Assume • Get two matrices • Machine learning Candidate loop bound Free invariant**Preliminaries**• Check loop bound • Add free_invariant and assert into program • Free_invariant can be ignored**Algorithm**• Input • While program • Test-Suite • Output • Loop bound**Algorithm**• Inner phase • Generate matrices A and C • “Off-the-self” quadratic programming to learn loop bounds • Fail: does not have integral coeffcients**Algorithm**• Validate phase • “Off-the-self checker” • Return counterexample(new tests) • Use new tests to next iteration**Algorithm**• Optimize • Round ??? • If a value between N-0.1 and N+0.1, round to N • Celling for positive and floor for negative • Can only make the bound looser？？？ • Example • [1.9,1,-1,0.95,0.24] -> [2,1,-1,1,1] • 2a + b – c + d + e • Partition • Loop does not have single bound • Different behavior for different inputs**Evaluation**• Micro-Benchmarks for termination • Oct: OCTANAL distribution • E.g. heapsort and bubblesort • Driver: Windows device drivers • Code fragments from them • Poly: POLYRANK distribution • http://www.eecs.qmul.ac.uk/~aziem/esop/polyrank/**Evaluation**• Windows Device Drivers • SDV-RP toolkit • Claim that other may have fail to prove termination**Evaluation**• They claim that • Prove 15% more benchmark • Inner phase of TpT is very efficient • Other technologies may have fail to prove termination**Summary**• Process • Prove more termination • Effeciency Prove termination while program and test suites Generate input for forming model Machine learning**My opinion**• All about algorithm • Many formulae • So many black box • Off-the-self, state-of-the-art????WTF