Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)
-
Upload
cuthbert-webb -
Category
Documents
-
view
228 -
download
0
Transcript of Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)
![Page 1: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/1.jpg)
Interpolants as ClassifiersRahul SharmaJoint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)
![Page 2: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/3.jpg)
Example
x
y
![Page 4: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/5.jpg)
Verification and ML
Interpolant: separates from
Classifier: separates positive examples from negative examples
Is there a connection?
![Page 6: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/6.jpg)
Yes!
Consider the common variables of and :
Interpolant if If :
separates ’s from ’s
![Page 7: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/9.jpg)
Support Vector Machine (SVM)
positive examples
negative examples
+
+
+
+
+
![Page 10: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/10.jpg)
Support Vector Machine (SVM)
Separators
Separators
Separators
Separators
All separators are good candidates for interpolants
+
++
+
+
![Page 11: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/11.jpg)
Support Vector Machine (SVM)
Optimal Margin Classifier+
+
+
+
![Page 12: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/13.jpg)
Interpolants by SVM
x
y
(0,0)+
+ (1,1)
![Page 14: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/15.jpg)
Two Problems
Data is not linearly separable
The candidate interpolant is not an interpolant
x
y
+
+
![Page 16: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/18.jpg)
Example
x
y
(0,0)+
+ (1,1)
Interpolant!
![Page 19: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/19.jpg)
Evaluation
1000 lines of C++ LIBSVM for SVM queries Z3 theorem prover
![Page 20: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/html5/thumbnails/20.jpg)
Experiments
![Page 21: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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: Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)](https://reader035.fdocuments.us/reader035/viewer/2022062217/56649ec65503460f94bd15fe/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.