interpolants as classifiers
DESCRIPTION
Interpolants as Classifiers. Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford). Interpolants. If then an interpolant satisfies: contains only the variables common to and An interpolant is a simple proof - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/1.jpg)
Interpolants as ClassifiersRahul SharmaJoint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)
![Page 2: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/2.jpg)
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.
![Page 3: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/3.jpg)
Example
x
y
![Page 4: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/4.jpg)
Binary Classification
Input: labeled examples Positive examples: Negative examples:
Find true,false For all positives, true For all negatives, false
![Page 5: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/5.jpg)
Verification and ML
Interpolant: separates from
Classifier: separates positive examples from negative examples
Is there a connection?
![Page 6: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/6.jpg)
Yes!
Consider the common variables of and :
Interpolant if If :
separates ’s from ’s
![Page 7: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/7.jpg)
Our Contributions
Main result: view interpolants as classifiers as positive example as negative example
Use state-of-the-art classification algorithms (SVMs) for computing interpolants
Encouraging empirical results
![Page 8: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/8.jpg)
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
![Page 9: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/9.jpg)
Support Vector Machine (SVM)
positive examples
negative examples
++
+
+
+
![Page 10: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/10.jpg)
Support Vector Machine (SVM)
Separators
Separators
Separators
Separators
All separators are good candidates for interpolants
+
++
+
+
![Page 11: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/11.jpg)
Support Vector Machine (SVM)
Optimal Margin Classifier+
+
+
+
![Page 12: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/12.jpg)
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);
![Page 13: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/13.jpg)
Interpolants by SVM
x
y
(0,0)+
+ (1,1)
![Page 14: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/14.jpg)
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
![Page 15: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/15.jpg)
Two Problems
Data is not linearly separable
The candidate interpolant is not an interpolant
x
y
+
+
![Page 16: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/16.jpg)
No separating inequality
For each SVM( )
return
Cannot generate linear separators with both and .
x
y
(0,0)+
+ (1,1)(0,1)
(1,0)
![Page 17: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/17.jpg)
Candidate is not an Interpolant
while(true) { Find candidate interpolant if ( ) Add to and continue;
if ( ) Add to and continue;
break; Exit if interpolant found } return ;
Theorem: terminates iff output is an interpolant between and
![Page 18: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/18.jpg)
Example
x
y
(0,0)+
+ (1,1)
Interpolant!
![Page 19: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/19.jpg)
Evaluation
1000 lines of C++ LIBSVM for SVM queries Z3 theorem prover
![Page 20: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/20.jpg)
Experiments
![Page 21: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/21.jpg)
Related Work
Interpolants used in tools BLAST, IMPACT …
Interpolants from proofs Krajícek[97], Pudlák[97], McMillan[05],
…
Interpolants from constraint solving ARMC, Rybalchenko et al. [07]
![Page 22: Interpolants as Classifiers](https://reader035.vdocuments.site/reader035/viewer/2022081502/568166fa550346895ddb5c88/html5/thumbnails/22.jpg)
Conclusion
Connect interpolants and classifiers
A sound interpolation procedure
Future work: non-linear interpolants
Integrate with a verification tool EUF, arrays, bit-vectors, etc.