3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

initial skeletons for nra solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-05-23 16:12:46 -07:00
parent 1f425824ff
commit f1ca1de408
3 changed files with 80 additions and 1 deletions

View file

@ -0,0 +1,31 @@
/*
Copyright (c) 2017 Microsoft Corporation
Author: Lev Nachmanson
*/
#pragma once
#include "util/lp/nra_solver.h"
namespace lp {
struct nra_solver::imp {
lean::lar_solver& s;
imp(lean::lar_solver& s): s(s) {}
lean::final_check_status check_feasible() {
return lean::final_check_status::GIVEUP;
}
};
nra_solver::nra_solver(lean::lar_solver& s) {
m_imp = alloc(imp, s);
}
nra_solver::~nra_solver() {
dealloc(m_imp);
}
lean::final_check_status nra_solver::check_feasible() {
return m_imp->check_feasible();
}
}

47
src/util/lp/nra_solver.h Normal file
View file

@ -0,0 +1,47 @@
/*
Copyright (c) 2017 Microsoft Corporation
Author: Lev Nachmanson
*/
#pragma once
#include "util/vector.h"
#include "util/lp/lp_settings.h"
#include "util/lp/lar_solver.h"
namespace lean {
class lar_solver;
}
namespace lp {
class nra_solver {
struct imp;
imp* m_imp;
public:
nra_solver(lean::lar_solver& s);
~nra_solver();
/*
\brief Add a definition v = vs[0]*vs[1]*...*vs[sz-1]
The variable v is equal to the product of variables vs.
*/
void add_monomial(lean::var_index v, unsigned sz, lean::var_index const* vs);
/*
\brief Check feasiblity of linear constraints augmented by polynomial definitions
that are added.
*/
lean::final_check_status check_feasible();
/*
\brief push and pop scope.
Monomial definitions are retraced when popping scope.
*/
void push();
void pop(unsigned n);
};
}