 Download Download Presentation Interpolants as Classifiers

Interpolants as Classifiers

Download Presentation Interpolants as Classifiers

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

1. Interpolants as Classifiers Rahul Sharma Joint work with AdityaNori (MSR India) and Alex Aiken (Stanford)

2. Interpolants • If then an interpolant satisfies: • contains only the variables common to and • An interpolant is a simple proof • Quantifier free formulas in linear arithmetic have quantifier free interpolants.

3. Example y x

4. Binary Classification • Input: labeled examples • Positive examples: • Negative examples: • Find true,false • For all positives, true • For all negatives, false

5. Verification and ML • Interpolant: separates from • Classifier: separates positive examples from negative examples Is there a connection?

6. Yes! • Consider the common variables of and : • Interpolant • if • If : • separates ’s from ’s

7. Our Contributions • Main result: view interpolants as classifiers • as positive example • asnegativeexample • Use state-of-the-art classification algorithms (SVMs) for computing interpolants • Encouraging empirical results

8. Parallels b/w Verification and ML • Unroll the loops • Find interpolants • Get general proofs (loop invariants) • Get positive and negative examples • Find a classifier • Get a predicate which generalizes

9. Support Vector Machine (SVM) positive examples + + + negative examples + +

10. Support Vector Machine (SVM) Separators Separators Separators Separators + + + + + All separators are good candidates for interpolants

11. Support Vector Machine (SVM) Optimal Margin Classifier + + + +

12. Example x = y = 0; while(*) x++; y++; while(x != 0) x--; y--; assert (y == 0); x = y = 0; if(*) x++; y++; p: if(x != 0) x--; y--; if(x == 0) assert (y == 0);

13. Interpolants by SVM y + (1,1) + x (0,0)

14. Basic Algorithm • Let be the common variables of and • Generate from satisfying assignments of • Generate from satisfying assignments of • Call SVM with and • Return predicate containing

15. Two Problems • Data is not linearly separable • The candidate interpolant is not an interpolant y + + x

16. No separating inequality • For each SVM( ) return • Cannot generate linear separators with both and . y (0,1) + (1,1) + x (1,0) (0,0)

17. Candidate is not an Interpolant Theorem: terminates iff output is an interpolant between and while(true) { Find candidate interpolant if ( ) Add to and continue; if ( ) Add to and continue; break; Exit if interpolant found } return ;

18. Example y + (1,1) + x (0,0) Interpolant!

19. Evaluation • 1000 lines of C++ • LIBSVM for SVM queries • Z3 theorem prover

20. Experiments

21. Related Work • Interpolants used in tools • BLAST, IMPACT … • Interpolants from proofs • Krajícek, Pudlák,McMillan, … • Interpolants from constraint solving • ARMC, Rybalchenko et al. 

22. Conclusion • Connect interpolants and classifiers • A sound interpolation procedure • Future work: non-linear interpolants • Integrate with a verification tool • EUF, arrays, bit-vectors, etc.