-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoly_ex10.cpp
42 lines (34 loc) · 997 Bytes
/
poly_ex10.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "iif.h"
#include <iostream>
using namespace std;
using namespace iif;
int loopFunction(int _reserved_input_[]) {
int a = _reserved_input_[0];
int b = _reserved_input_[1];
int x = _reserved_input_[2];
int y = _reserved_input_[3];
int u = _reserved_input_[4];
int v = _reserved_input_[5];
iif_assume((x==a) && (y==b) && (u==b) && (v==0));
while(x!=y) {
recordi(a, b, x, y, u, v);
while (x>y) {
x = x - y;
v = u + v;
}
while (x<y) {
y = y - x;
u = u + v;
}
}
recordi(a, b, x, y, u, v);
iif_assert(x*y + y*v - a*b = 0);
return 0;
}
int main(int argc, char** argv) {
iifround = atoi(argv[1]);
initseed = atoi(argv[2]);
iifContext context("/home/lijiaying/Research/GitHub/zilu/tmp/poly_ex10.var", loopFunction, "loopFunction", "/home/lijiaying/Research/GitHub/zilu/tmp/poly_ex10.ds");
context.addLearner("poly");
return context.learn("/home/lijiaying/Research/GitHub/zilu/tmp/poly_ex10.cnt", "/home/lijiaying/Research/GitHub/zilu/tmp/poly_ex10");
}