3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +00:00

looking for more farkas rules in interpolation

This commit is contained in:
Ken McMillan 2013-11-07 15:40:44 -08:00
parent d9c69f5294
commit cf176af48e
2 changed files with 13 additions and 0 deletions

View file

@ -489,11 +489,15 @@ void iz3mgr::get_farkas_coeffs(const ast &proof, std::vector<rational>& rats){
symb s = sym(proof);
int numps = s->get_num_parameters();
rats.resize(numps-2);
if(num_prems(proof) < numps-2){
std::cout << "bad farkas rule: " << num_prems(proof) << " premises should be " << numps-2 << "\n";
}
for(int i = 2; i < numps; i++){
rational r;
bool ok = s->get_parameter(i).is_rational(r);
if(!ok)
throw "Bad Farkas coefficient";
#if 0
{
ast con = conc(prem(proof,i-2));
ast temp = make_real(r); // for debugging
@ -501,6 +505,7 @@ void iz3mgr::get_farkas_coeffs(const ast &proof, std::vector<rational>& rats){
if(is_not(con) ? (o == Leq || o == Lt) : (o == Geq || o == Gt))
r = -r;
}
#endif
rats[i-2] = r;
}
#if 0

View file

@ -1253,6 +1253,10 @@ public:
case FarkasKind: {
std::vector<ast> farkas_coeffs, prem_cons;
get_farkas_coeffs(proof,farkas_coeffs);
if(farkas_coeffs.size() != nprems){
pfgoto(proof);
throw unsupported();
}
prem_cons.resize(nprems);
for(unsigned i = 0; i < nprems; i++)
prem_cons[i] = conc(prem(proof,i));
@ -1279,6 +1283,10 @@ public:
case GCDTestKind: {
std::vector<rational> farkas_coeffs;
get_farkas_coeffs(proof,farkas_coeffs);
if(farkas_coeffs.size() != nprems){
pfgoto(proof);
throw unsupported();
}
std::vector<Iproof::node> my_prems; my_prems.resize(2);
std::vector<ast> my_prem_cons; my_prem_cons.resize(2);
std::vector<ast> my_farkas_coeffs; my_farkas_coeffs.resize(2);