3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00

add files

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2018-08-14 11:16:44 +08:00
parent 92b5a9b134
commit 9958f42d5c
2 changed files with 52 additions and 0 deletions

27
src/util/lp/mon_eq.cpp Normal file
View file

@ -0,0 +1,27 @@
/*
Copyright (c) 2017 Microsoft Corporation
Author: Nikolaj Bjorner
*/
#include "util/lp/lar_solver.h"
#include "util/lp/mon_eq.h"
namespace nra {
bool check_assignment(mon_eq const& m, variable_map_type & vars) {
rational r1 = vars[m.m_v];
rational r2(1);
for (auto w : m.m_vs) {
r2 *= vars[w];
}
return r1 == r2;
}
bool check_assignments(const vector<mon_eq> & monomials,
const lp::lar_solver& s,
variable_map_type & vars) {
s.get_model(vars);
for (auto const& m : monomials) {
if (!check_assignment(m, vars)) return false;
}
return true;
}
}