mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
merge with master branch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
651587ce01
1602 changed files with 40496 additions and 27837 deletions
|
@ -1,5 +1,4 @@
|
|||
add_subdirectory(fuzzing)
|
||||
add_subdirectory(lp)
|
||||
################################################################################
|
||||
# z3-test executable
|
||||
################################################################################
|
||||
|
@ -21,7 +20,6 @@ add_executable(test-z3
|
|||
bits.cpp
|
||||
bit_vector.cpp
|
||||
buffer.cpp
|
||||
bv_simplifier_plugin.cpp
|
||||
chashtable.cpp
|
||||
check_assumptions.cpp
|
||||
cnf_backbones.cpp
|
||||
|
@ -120,7 +118,6 @@ add_executable(test-z3
|
|||
upolynomial.cpp
|
||||
var_subst.cpp
|
||||
vector.cpp
|
||||
lp/lp.cpp
|
||||
${z3_test_extra_object_files}
|
||||
)
|
||||
z3_add_install_tactic_rule(${z3_test_deps})
|
||||
|
|
|
@ -16,10 +16,10 @@ Author:
|
|||
Notes:
|
||||
|
||||
--*/
|
||||
#include"algebraic_numbers.h"
|
||||
#include"polynomial_var2value.h"
|
||||
#include"mpbq.h"
|
||||
#include"rlimit.h"
|
||||
#include "math/polynomial/algebraic_numbers.h"
|
||||
#include "math/polynomial/polynomial_var2value.h"
|
||||
#include "util/mpbq.h"
|
||||
#include "util/rlimit.h"
|
||||
|
||||
static void display_anums(std::ostream & out, scoped_anum_vector const & rs) {
|
||||
out << "numbers in decimal:\n";
|
||||
|
|
|
@ -5,13 +5,13 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "z3.h"
|
||||
#include "z3_private.h"
|
||||
#include "api/z3.h"
|
||||
#include "api/z3_private.h"
|
||||
#include <iostream>
|
||||
#include "util.h"
|
||||
#include "trace.h"
|
||||
#include "util/util.h"
|
||||
#include "util/trace.h"
|
||||
#include <map>
|
||||
#include "trace.h"
|
||||
#include "util/trace.h"
|
||||
|
||||
void test_apps() {
|
||||
Z3_config cfg = Z3_mk_config();
|
||||
|
|
|
@ -5,7 +5,7 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
#include<stdio.h>
|
||||
#include"z3.h"
|
||||
#include "api/z3.h"
|
||||
|
||||
void tst_api_bug() {
|
||||
unsigned vmajor, vminor, vbuild, vrevision;
|
||||
|
|
|
@ -4,14 +4,14 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "arith_rewriter.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "th_rewriter.h"
|
||||
#include "model.h"
|
||||
#include "pdr_util.h"
|
||||
#include "smt2parser.h"
|
||||
#include "ast/rewriter/arith_rewriter.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "model/model.h"
|
||||
#include "muz/pdr/pdr_util.h"
|
||||
#include "parsers/smt2/smt2parser.h"
|
||||
|
||||
|
||||
static expr_ref parse_fml(ast_manager& m, char const* str) {
|
||||
|
|
|
@ -4,8 +4,8 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "arith_eq_solver.h"
|
||||
#include "smt_params.h"
|
||||
#include "smt/arith_eq_solver.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
|
||||
typedef rational numeral;
|
||||
typedef vector<numeral> row;
|
||||
|
|
|
@ -16,7 +16,7 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include "ast.h"
|
||||
#include "ast/ast.h"
|
||||
|
||||
static void tst1() {
|
||||
ast_manager m;
|
||||
|
|
|
@ -17,9 +17,9 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include"bit_blaster.h"
|
||||
#include"ast_pp.h"
|
||||
#include"ast_ll_pp.h"
|
||||
#include "ast/rewriter/bit_blaster/bit_blaster.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/ast_ll_pp.h"
|
||||
|
||||
void mk_bits(ast_manager & m, char const * prefix, unsigned sz, expr_ref_vector & r) {
|
||||
sort_ref b(m);
|
||||
|
|
|
@ -18,8 +18,8 @@ Revision History:
|
|||
--*/
|
||||
#include<cstdlib>
|
||||
#include<iostream>
|
||||
#include"bit_vector.h"
|
||||
#include"vector.h"
|
||||
#include "util/bit_vector.h"
|
||||
#include "util/vector.h"
|
||||
|
||||
static void tst1() {
|
||||
bit_vector v1;
|
||||
|
|
|
@ -5,11 +5,11 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
// Test some bit hacks
|
||||
#include"util.h"
|
||||
#include"debug.h"
|
||||
#include"vector.h"
|
||||
#include"mpz.h"
|
||||
#include"bit_util.h"
|
||||
#include "util/util.h"
|
||||
#include "util/debug.h"
|
||||
#include "util/vector.h"
|
||||
#include "util/mpz.h"
|
||||
#include "util/bit_util.h"
|
||||
|
||||
static void tst_shl(unsigned src_sz, unsigned const * src, unsigned k,
|
||||
unsigned dst_sz, unsigned const * dst, bool trace = true) {
|
||||
|
|
|
@ -16,7 +16,7 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"ptr_scoped_buffer.h"
|
||||
#include "util/ptr_scoped_buffer.h"
|
||||
|
||||
typedef std::pair<int, int> point;
|
||||
|
||||
|
|
|
@ -1,326 +0,0 @@
|
|||
|
||||
/*++
|
||||
Copyright (c) 2015 Microsoft Corporation
|
||||
|
||||
--*/
|
||||
|
||||
#include "bv_simplifier_plugin.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
|
||||
class tst_bv_simplifier_plugin_cls {
|
||||
class mgr {
|
||||
public:
|
||||
mgr(ast_manager& m) {
|
||||
reg_decl_plugins(m);
|
||||
}
|
||||
};
|
||||
ast_manager m_manager;
|
||||
mgr m_mgr;
|
||||
bv_simplifier_params m_bv_params;
|
||||
basic_simplifier_plugin m_bsimp;
|
||||
arith_util m_arith;
|
||||
bv_simplifier_plugin m_simp;
|
||||
bv_util m_bv_util;
|
||||
family_id m_fid;
|
||||
|
||||
void get_num(expr* e, unsigned bv_size, rational& r) {
|
||||
unsigned bv_size0;
|
||||
if (!m_bv_util.is_numeral(e, r, bv_size0)) {
|
||||
UNREACHABLE();
|
||||
}
|
||||
ENSURE(bv_size == bv_size0);
|
||||
}
|
||||
|
||||
unsigned u32(expr* e) {
|
||||
rational r;
|
||||
std::cout << mk_pp(e,m_manager) << "\n";
|
||||
get_num(e, 32, r);
|
||||
return r.get_unsigned();
|
||||
}
|
||||
|
||||
unsigned char u8(expr* e) {
|
||||
rational r;
|
||||
get_num(e, 8, r);
|
||||
return static_cast<unsigned char>(r.get_unsigned());
|
||||
}
|
||||
int i32(expr* e) {
|
||||
return static_cast<int>(u32(e));
|
||||
}
|
||||
|
||||
uint64 u64(expr* e) {
|
||||
rational r;
|
||||
get_num(e, 64, r);
|
||||
return r.get_uint64();
|
||||
}
|
||||
|
||||
int64 i64(expr* e) {
|
||||
rational r;
|
||||
get_num(e, 64, r);
|
||||
if (r >= power(rational(2), 63)) {
|
||||
r -= power(rational(2), 64);
|
||||
}
|
||||
return r.get_int64();
|
||||
}
|
||||
|
||||
bool ast2bool(expr* e) {
|
||||
if (m_manager.is_true(e)) {
|
||||
return true;
|
||||
}
|
||||
if (m_manager.is_false(e)) {
|
||||
return false;
|
||||
}
|
||||
UNREACHABLE();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool bit2bool(expr* e) {
|
||||
rational r;
|
||||
get_num(e, 1, r);
|
||||
return 0 != r.get_unsigned();
|
||||
}
|
||||
|
||||
expr* mk_int(unsigned i) {
|
||||
return m_arith.mk_numeral(rational(i), true);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
tst_bv_simplifier_plugin_cls() :
|
||||
m_mgr(m_manager),
|
||||
m_bsimp(m_manager),
|
||||
m_arith(m_manager),
|
||||
m_simp(m_manager, m_bsimp, m_bv_params),
|
||||
m_bv_util(m_manager),
|
||||
m_fid(0) {
|
||||
m_fid = m_manager.mk_family_id("bv");
|
||||
}
|
||||
|
||||
~tst_bv_simplifier_plugin_cls() {}
|
||||
|
||||
void test_num(unsigned a) {
|
||||
expr_ref e(m_manager), e1(m_manager);
|
||||
app_ref ar(m_manager);
|
||||
uint64 a64 = static_cast<uint64>(a);
|
||||
|
||||
e1 = m_bv_util.mk_numeral(rational(a), 32);
|
||||
expr* const es[1] = { e1.get() };
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BNEG, e1.get());
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE((0-a) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BNOT, e1.get());
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE((~a) == u32(e.get()));
|
||||
|
||||
parameter params[2] = { parameter(32), parameter(32) };
|
||||
ar = m_manager.mk_app(m_fid, OP_SIGN_EXT, 1, params, 1, es);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE(((int64)(int)a) == i64(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_ZERO_EXT, 1, params, 1, es);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE(((uint64)a) == u64(e.get()));
|
||||
|
||||
params[0] = parameter(7);
|
||||
params[1] = parameter(0);
|
||||
ar = m_manager.mk_app(m_fid, OP_EXTRACT, 2, params, 1, es);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE(((unsigned char)a) == u8(e.get()));
|
||||
|
||||
params[0] = parameter(2);
|
||||
ar = m_manager.mk_app(m_fid, OP_REPEAT, 1, params, 1, es);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY(((a64 << 32) | a64) == u64(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BREDOR, e1.get());
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE((a != 0) == bit2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BREDAND, e1.get());
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE((a == 0xFFFFFFFF) == bit2bool(e.get()));
|
||||
|
||||
params[0] = parameter(8);
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_ROTATE_LEFT, 1, params, 1, es);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE(((a << 8) | (a >> 24)) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_ROTATE_RIGHT, 1, params, 1, es);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE(((a >> 8) | (a << 24)) == u32(e.get()));
|
||||
|
||||
params[0] = parameter(m_manager.mk_sort(m_manager.mk_family_id("arith"), INT_SORT));
|
||||
ar = m_manager.mk_app(m_fid, OP_BV2INT, 1, params, 1, es);
|
||||
expr* es2[1] = { ar.get() };
|
||||
params[0] = parameter(32);
|
||||
ar = m_manager.mk_app(m_fid, OP_INT2BV, 1, params, 1, es2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
ENSURE(a == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BIT0);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY(!bit2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BIT1);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY(bit2bool(e.get()));
|
||||
|
||||
}
|
||||
|
||||
void test_pair(unsigned a, unsigned b) {
|
||||
|
||||
expr_ref e(m_manager), e1(m_manager), e2(m_manager);
|
||||
app_ref ar(m_manager);
|
||||
int sa = static_cast<int>(a);
|
||||
int sb = static_cast<int>(b);
|
||||
uint64 a64 = static_cast<uint64>(a);
|
||||
uint64 b64 = static_cast<uint64>(b);
|
||||
|
||||
e1 = m_bv_util.mk_numeral(rational(a), 32);
|
||||
e2 = m_bv_util.mk_numeral(rational(b), 32);
|
||||
expr* const e1e2[] = { e1.get(), e2.get() };
|
||||
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BADD, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a + b) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BSUB, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a - b) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BMUL, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a * b) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BAND, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a & b) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BOR, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a | b) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BNOR, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY(~(a | b) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BXOR, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a ^ b) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BXNOR, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((~(a ^ b)) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BNAND, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((~(a & b)) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_ULEQ, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a <= b) == ast2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_UGEQ, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a >= b) == ast2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_ULT, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a < b) == ast2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_UGT, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a > b) == ast2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_SLEQ, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((sa <= sb) == ast2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_SGEQ, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((sa >= sb) == ast2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_SLT, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((sa < sb) == ast2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_SGT, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((sa > sb) == ast2bool(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BSHL, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY(((b>=32)?0:(a << b)) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BLSHR, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY(((b>=32)?0:(a >> b)) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BASHR, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
|
||||
std::cout << "compare: " << sa << " >> " << b << " = " << (sa >> b) << " with " << i32(e.get()) << "\n";
|
||||
VERIFY(b >= 32 || ((sa >> b) == i32(e.get())));
|
||||
|
||||
if (b != 0) {
|
||||
ar = m_manager.mk_app(m_fid, OP_BSDIV, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((sa / sb) == i32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BUDIV, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a / b) == u32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BSREM, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
//VERIFY((sa % sb) == i32(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BUREM, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a % b) == u32(e.get()));
|
||||
|
||||
// TBD: BSMOD.
|
||||
}
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_CONCAT, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY(((a64 << 32) | b64) == u64(e.get()));
|
||||
|
||||
ar = m_manager.mk_app(m_fid, OP_BCOMP, 2, e1e2);
|
||||
m_simp.reduce(ar->get_decl(), ar->get_num_args(), ar->get_args(), e);
|
||||
VERIFY((a == b) == bit2bool(e.get()));
|
||||
}
|
||||
|
||||
void test() {
|
||||
unsigned_vector nums;
|
||||
nums.push_back(0);
|
||||
nums.push_back(1);
|
||||
nums.push_back(-1);
|
||||
nums.push_back(2);
|
||||
nums.push_back(31);
|
||||
nums.push_back(32);
|
||||
nums.push_back(33);
|
||||
nums.push_back(435562);
|
||||
nums.push_back(-43556211);
|
||||
// TBD add some random numbers.
|
||||
|
||||
|
||||
for (unsigned i = 0; i < nums.size(); ++i) {
|
||||
test_num(nums[i]);
|
||||
for (unsigned j = 0; j < nums.size(); ++j) {
|
||||
test_pair(nums[i], nums[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void tst_bv_simplifier_plugin() {
|
||||
tst_bv_simplifier_plugin_cls tst_cls;
|
||||
tst_cls.test();
|
||||
}
|
|
@ -16,10 +16,10 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"chashtable.h"
|
||||
#include"hashtable.h"
|
||||
#include"hash.h"
|
||||
#include"util.h"
|
||||
#include "util/chashtable.h"
|
||||
#include "util/hashtable.h"
|
||||
#include "util/hash.h"
|
||||
#include "util/util.h"
|
||||
|
||||
typedef chashtable<int, int_hash, default_eq<int> > int_table;
|
||||
typedef cmap<int, int, int_hash, default_eq<int> > int_map;
|
||||
|
|
|
@ -4,13 +4,13 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "memory_manager.h"
|
||||
#include "smt_params.h"
|
||||
#include "ast.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "smt_context.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "util/memory_manager.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "ast/ast.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "smt/smt_context.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
void tst_check_assumptions()
|
||||
{
|
||||
|
|
|
@ -5,11 +5,11 @@ Copyright (c) 2017 Microsoft Corporation
|
|||
#include<iostream>
|
||||
#include<time.h>
|
||||
#include<signal.h>
|
||||
#include"timeout.h"
|
||||
#include"rlimit.h"
|
||||
#include"dimacs.h"
|
||||
#include"sat_solver.h"
|
||||
#include"gparams.h"
|
||||
#include "util/timeout.h"
|
||||
#include "util/rlimit.h"
|
||||
#include "sat/dimacs.h"
|
||||
#include "sat/sat_solver.h"
|
||||
#include "util/gparams.h"
|
||||
|
||||
static sat::solver * g_solver = 0;
|
||||
static clock_t g_start_time;
|
||||
|
|
|
@ -4,13 +4,13 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "datalog_parser.h"
|
||||
#include "ast_pp.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "dl_context.h"
|
||||
#include "dl_register_engine.h"
|
||||
#include "smt_params.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "muz/fp/datalog_parser.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "muz/fp/dl_register_engine.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
using namespace datalog;
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "ddnf.h"
|
||||
#include "tbv.h"
|
||||
#include "muz/ddnf/ddnf.h"
|
||||
#include "muz/rel/tbv.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <list>
|
||||
|
|
|
@ -17,11 +17,11 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#ifdef _WINDOWS
|
||||
#include"rational.h"
|
||||
#include"diff_logic.h"
|
||||
#include"smt_literal.h"
|
||||
#include"util.h"
|
||||
#include"debug.h"
|
||||
#include "util/rational.h"
|
||||
#include "smt/diff_logic.h"
|
||||
#include "smt/smt_literal.h"
|
||||
#include "util/util.h"
|
||||
#include "util/debug.h"
|
||||
|
||||
struct diff_logic_ext {
|
||||
typedef rational numeral;
|
||||
|
|
|
@ -4,12 +4,12 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "datalog_parser.h"
|
||||
#include "ast_pp.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "dl_context.h"
|
||||
#include "smt_params.h"
|
||||
#include "dl_register_engine.h"
|
||||
#include "muz/fp/datalog_parser.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "muz/fp/dl_register_engine.h"
|
||||
|
||||
using namespace datalog;
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "dl_context.h"
|
||||
#include "dl_register_engine.h"
|
||||
#include "dl_finite_product_relation.h"
|
||||
#include "dl_sparse_table.h"
|
||||
#include "rel_context.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "muz/fp/dl_register_engine.h"
|
||||
#include "muz/rel/dl_finite_product_relation.h"
|
||||
#include "muz/rel/dl_sparse_table.h"
|
||||
#include "muz/rel/rel_context.h"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
|
|
@ -4,15 +4,15 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "datalog_parser.h"
|
||||
#include "ast_pp.h"
|
||||
#include "dl_table_relation.h"
|
||||
#include "dl_context.h"
|
||||
#include "dl_register_engine.h"
|
||||
#include "smt_params.h"
|
||||
#include "stopwatch.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "dl_relation_manager.h"
|
||||
#include "muz/fp/datalog_parser.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "muz/rel/dl_table_relation.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "muz/fp/dl_register_engine.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "util/stopwatch.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "muz/rel/dl_relation_manager.h"
|
||||
|
||||
using namespace datalog;
|
||||
|
||||
|
|
|
@ -5,13 +5,13 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "dl_context.h"
|
||||
#include "dl_register_engine.h"
|
||||
#include "dl_relation_manager.h"
|
||||
#include "dl_interval_relation.h"
|
||||
#include "dl_bound_relation.h"
|
||||
#include "dl_product_relation.h"
|
||||
#include "util.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "muz/fp/dl_register_engine.h"
|
||||
#include "muz/rel/dl_relation_manager.h"
|
||||
#include "muz/rel/dl_interval_relation.h"
|
||||
#include "muz/rel/dl_bound_relation.h"
|
||||
#include "muz/rel/dl_product_relation.h"
|
||||
#include "util/util.h"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
#if defined(_WINDOWS) || defined(_CYGWIN)
|
||||
|
||||
#include "dl_context.h"
|
||||
#include "dl_table.h"
|
||||
#include "dl_register_engine.h"
|
||||
#include "dl_relation_manager.h"
|
||||
#include "muz/base/dl_context.h"
|
||||
#include "muz/rel/dl_table.h"
|
||||
#include "muz/fp/dl_register_engine.h"
|
||||
#include "muz/rel/dl_relation_manager.h"
|
||||
|
||||
typedef datalog::table_base* (*mk_table_fn)(datalog::relation_manager& m, datalog::table_signature& sig);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "dl_util.h"
|
||||
#include "muz/base/dl_util.h"
|
||||
|
||||
using namespace datalog;
|
||||
|
||||
|
|
|
@ -4,19 +4,19 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "doc.h"
|
||||
#include "trace.h"
|
||||
#include "vector.h"
|
||||
#include "ast.h"
|
||||
#include "ast_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "sorting_network.h"
|
||||
#include "smt_kernel.h"
|
||||
#include "model_smt2_pp.h"
|
||||
#include "smt_params.h"
|
||||
#include "ast_util.h"
|
||||
#include "expr_safe_replace.h"
|
||||
#include "th_rewriter.h"
|
||||
#include "muz/rel/doc.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/vector.h"
|
||||
#include "ast/ast.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "util/sorting_network.h"
|
||||
#include "smt/smt_kernel.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "ast/ast_util.h"
|
||||
#include "ast/rewriter/expr_safe_replace.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
|
||||
|
||||
static void tst_doc1(unsigned n) {
|
||||
|
|
|
@ -16,7 +16,7 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"util.h"
|
||||
#include "util/util.h"
|
||||
|
||||
void tst_escaped() {
|
||||
std::cout << "[" << escaped("\"hello\"\"world\"\n\n") << "]\n";
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include<iostream>
|
||||
#include"z3_exception.h"
|
||||
#include "util/z3_exception.h"
|
||||
|
||||
class ex {
|
||||
public:
|
||||
|
|
|
@ -4,15 +4,15 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "expr_rand.h"
|
||||
#include "ast_pp.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "array_decl_plugin.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "ast_smt_pp.h"
|
||||
#include "test/fuzzing/expr_rand.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/array_decl_plugin.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/ast_smt_pp.h"
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
static unsigned rand_seed = 1;
|
||||
|
||||
|
|
|
@ -4,15 +4,15 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "expr_substitution.h"
|
||||
#include "smt_params.h"
|
||||
#include "substitution.h"
|
||||
#include "unifier.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "th_rewriter.h"
|
||||
#include "ast/expr_substitution.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "ast/substitution/substitution.h"
|
||||
#include "ast/substitution/unifier.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
|
||||
expr* mk_bv_xor(bv_util& bv, expr* a, expr* b) {
|
||||
expr* args[2];
|
||||
|
|
|
@ -17,8 +17,8 @@ Notes:
|
|||
|
||||
--*/
|
||||
#include<sstream>
|
||||
#include"mpq.h"
|
||||
#include"ext_numeral.h"
|
||||
#include "util/mpq.h"
|
||||
#include "util/ext_numeral.h"
|
||||
|
||||
#define MK_TST_UNARY(NAME) \
|
||||
static void tst_ ## NAME(int a, ext_numeral_kind ak, int expected_c, ext_numeral_kind expected_ck) { \
|
||||
|
@ -43,13 +43,13 @@ static void FUN_NAME(int a, ext_numeral_kind ak, int b, ext_numeral_kind bk, int
|
|||
scoped_mpq _a(m), _b(m), _c(m); \
|
||||
m.set(_a, a); \
|
||||
m.set(_b, b); \
|
||||
ext_numeral_kind ck; \
|
||||
ext_numeral_kind ck(EN_NUMERAL); \
|
||||
OP_NAME(m, _a, ak, _b, bk, _c, ck); \
|
||||
ENSURE(ck == expected_ck); \
|
||||
ENSURE(ck == expected_ck); \
|
||||
if (expected_ck == EN_NUMERAL) { \
|
||||
scoped_mpq _expected_c(m); \
|
||||
m.set(_expected_c, expected_c); \
|
||||
ENSURE(m.eq(_c, _expected_c)); \
|
||||
ENSURE(m.eq(_c, _expected_c)); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
|
@ -15,9 +15,9 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"f2n.h"
|
||||
#include"hwf.h"
|
||||
#include"mpf.h"
|
||||
#include "util/f2n.h"
|
||||
#include "util/hwf.h"
|
||||
#include "util/mpf.h"
|
||||
|
||||
static void tst1() {
|
||||
hwf_manager hm;
|
||||
|
|
|
@ -4,10 +4,10 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "factor_rewriter.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "ast/rewriter/factor_rewriter.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
void tst_factor_rewriter() {
|
||||
ast_manager m;
|
||||
|
|
|
@ -20,8 +20,8 @@ Revision History:
|
|||
--*/
|
||||
#include<cstdlib>
|
||||
#include<iostream>
|
||||
#include"fixed_bit_vector.h"
|
||||
#include"vector.h"
|
||||
#include "util/fixed_bit_vector.h"
|
||||
#include "util/vector.h"
|
||||
|
||||
|
||||
static void tst1() {
|
||||
|
|
|
@ -21,7 +21,7 @@ Revision History:
|
|||
#include <string>
|
||||
#include <windows.h>
|
||||
#include <strsafe.h>
|
||||
#include "for_each_file.h"
|
||||
#include "test/for_each_file.h"
|
||||
|
||||
bool for_each_file(for_each_file_proc& proc, const char* base, const char* suffix)
|
||||
{
|
||||
|
|
|
@ -4,8 +4,8 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "expr_delta.h"
|
||||
#include "ast_pp.h"
|
||||
#include "test/fuzzing/expr_delta.h"
|
||||
#include "ast/ast_pp.h"
|
||||
|
||||
expr_delta::expr_delta(ast_manager& m) : m_manager(m), m_exprs(m) {}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ Revision History:
|
|||
#ifndef EXPR_DELTA_H_
|
||||
#define EXPR_DELTA_H_
|
||||
|
||||
#include "ast.h"
|
||||
#include "ast/ast.h"
|
||||
|
||||
class expr_delta {
|
||||
ast_manager& m_manager;
|
||||
|
|
|
@ -4,11 +4,11 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "expr_rand.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "array_decl_plugin.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "test/fuzzing/expr_rand.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/array_decl_plugin.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/ast_pp.h"
|
||||
|
||||
|
||||
expr_rand::expr_rand(ast_manager& m):
|
||||
|
|
|
@ -19,8 +19,8 @@ Revision History:
|
|||
#ifndef EXPR_RAND_H_
|
||||
#define EXPR_RAND_H_
|
||||
|
||||
#include"ast.h"
|
||||
#include"obj_hashtable.h"
|
||||
#include "ast/ast.h"
|
||||
#include "util/obj_hashtable.h"
|
||||
|
||||
class expr_rand {
|
||||
ast_manager& m_manager;
|
||||
|
|
|
@ -3,15 +3,15 @@ Copyright (c) 2016 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "inc_sat_solver.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "datatype_decl_plugin.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "ast_pp.h"
|
||||
#include "dt2bv_tactic.h"
|
||||
#include "tactic.h"
|
||||
#include "model_smt2_pp.h"
|
||||
#include "fd_solver.h"
|
||||
#include "sat/sat_solver/inc_sat_solver.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/datatype_decl_plugin.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "tactic/bv/dt2bv_tactic.h"
|
||||
#include "tactic/tactic.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "tactic/portfolio/fd_solver.h"
|
||||
|
||||
static expr_ref mk_const(ast_manager& m, char const* name, sort* s) {
|
||||
return expr_ref(m.mk_const(symbol(name), s), m);
|
||||
|
@ -65,9 +65,8 @@ void test2() {
|
|||
constructor_decl* G = mk_constructor_decl(symbol("G"), symbol("is-G"), 0, 0);
|
||||
constructor_decl* B = mk_constructor_decl(symbol("B"), symbol("is-B"), 0, 0);
|
||||
constructor_decl* constrs[3] = { R, G, B };
|
||||
datatype_decl * enum_sort = mk_datatype_decl(symbol("RGB"), 3, constrs);
|
||||
VERIFY(dt.mk_datatypes(1, &enum_sort, 0, 0, new_sorts));
|
||||
del_constructor_decls(3, constrs);
|
||||
datatype_decl * enum_sort = mk_datatype_decl(dtutil, symbol("RGB"), 0, nullptr, 3, constrs);
|
||||
VERIFY(dt.mk_datatypes(1, &enum_sort, 0, nullptr, new_sorts));
|
||||
sort* rgb = new_sorts[0].get();
|
||||
|
||||
expr_ref x = mk_const(m, "x", rgb), y = mk_const(m, "y", rgb), z = mk_const(m, "z", rgb);
|
||||
|
|
|
@ -4,9 +4,9 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "z3.h"
|
||||
#include "trace.h"
|
||||
#include "debug.h"
|
||||
#include "api/z3.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/debug.h"
|
||||
|
||||
static Z3_ast mk_var(Z3_context ctx, char const* name, Z3_sort s) {
|
||||
return Z3_mk_const(ctx, Z3_mk_string_symbol(ctx, name), s);
|
||||
|
|
|
@ -21,7 +21,7 @@ Revision History:
|
|||
#include<unordered_set>
|
||||
#include<stdlib.h>
|
||||
|
||||
#include"hashtable.h"
|
||||
#include "util/hashtable.h"
|
||||
|
||||
|
||||
struct int_hash_proc { unsigned operator()(int x) const { return x * 3; } };
|
||||
|
|
|
@ -17,9 +17,10 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include<iostream>
|
||||
#include"heap.h"
|
||||
#include"hashtable.h"
|
||||
#include"trace.h"
|
||||
#include "util/util.h"
|
||||
#include "util/heap.h"
|
||||
#include "util/hashtable.h"
|
||||
#include "util/trace.h"
|
||||
|
||||
struct lt_proc { bool operator()(int v1, int v2) const { return v1 < v2; } };
|
||||
typedef heap<lt_proc> int_heap;
|
||||
|
@ -27,11 +28,13 @@ struct int_hash_proc { unsigned operator()(int v) const { return v * 17; }};
|
|||
typedef int_hashtable<int_hash_proc, default_eq<int> > int_set;
|
||||
#define N 10000
|
||||
|
||||
static random_gen heap_rand(1);
|
||||
|
||||
static void tst1() {
|
||||
int_heap h(N);
|
||||
int_set t;
|
||||
for (int i = 0; i < N * 3; i++) {
|
||||
int val = rand() % N;
|
||||
int val = heap_rand() % N;
|
||||
if (!h.contains(val)) {
|
||||
ENSURE(!t.contains(val));
|
||||
h.insert(val);
|
||||
|
@ -64,9 +67,10 @@ typedef heap<lt_proc2> int_heap2;
|
|||
|
||||
static void init_values() {
|
||||
for (unsigned i = 0; i < N; i++)
|
||||
g_value[i] = rand();
|
||||
g_value[i] = heap_rand();
|
||||
}
|
||||
|
||||
#ifdef _TRACE
|
||||
static void dump_heap(const int_heap2 & h, std::ostream & out) {
|
||||
// int_heap2::const_iterator it = h.begin();
|
||||
// int_heap2::const_iterator end = h.end();
|
||||
|
@ -75,16 +79,16 @@ static void dump_heap(const int_heap2 & h, std::ostream & out) {
|
|||
// }
|
||||
// out << "\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
static void tst2() {
|
||||
(void)dump_heap;
|
||||
int_heap2 h(N);
|
||||
for (int i = 0; i < N * 10; i++) {
|
||||
if (i % 1000 == 0) std::cout << "i: " << i << std::endl;
|
||||
int cmd = rand() % 10;
|
||||
int cmd = heap_rand() % 10;
|
||||
if (cmd <= 3) {
|
||||
// insert
|
||||
int val = rand() % N;
|
||||
int val = heap_rand() % N;
|
||||
if (!h.contains(val)) {
|
||||
TRACE("heap", tout << "inserting: " << val << "\n";);
|
||||
h.insert(val);
|
||||
|
@ -93,7 +97,7 @@ static void tst2() {
|
|||
}
|
||||
}
|
||||
else if (cmd <= 6) {
|
||||
int val = rand() % N;
|
||||
int val = heap_rand() % N;
|
||||
if (h.contains(val)) {
|
||||
TRACE("heap", tout << "removing: " << val << "\n";);
|
||||
h.erase(val);
|
||||
|
@ -103,9 +107,9 @@ static void tst2() {
|
|||
}
|
||||
else if (cmd <= 8) {
|
||||
// increased & decreased
|
||||
int val = rand() % N;
|
||||
int val = heap_rand() % N;
|
||||
int old_v = g_value[val];
|
||||
int new_v = rand();
|
||||
int new_v = heap_rand();
|
||||
if (h.contains(val)) {
|
||||
g_value[val] = new_v;
|
||||
if (old_v < new_v) {
|
||||
|
@ -128,8 +132,12 @@ static void tst2() {
|
|||
void tst_heap() {
|
||||
// enable_debug("heap");
|
||||
enable_trace("heap");
|
||||
tst1();
|
||||
init_values();
|
||||
tst2();
|
||||
unsigned i = 0;
|
||||
while (i < 3) {
|
||||
heap_rand.set_seed(i++);
|
||||
tst1();
|
||||
init_values();
|
||||
tst2();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "heap_trie.h"
|
||||
#include "math/hilbert/heap_trie.h"
|
||||
|
||||
struct unsigned_le {
|
||||
static bool le(unsigned i, unsigned j) { return i <= j; }
|
||||
|
|
|
@ -4,15 +4,15 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "hilbert_basis.h"
|
||||
#include "ast_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "quant_tactics.h"
|
||||
#include "tactic.h"
|
||||
#include "tactic2solver.h"
|
||||
#include "solver.h"
|
||||
#include "rlimit.h"
|
||||
#include "math/hilbert/hilbert_basis.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "tactic/smtlogics/quant_tactics.h"
|
||||
#include "tactic/tactic.h"
|
||||
#include "solver/tactic2solver.h"
|
||||
#include "solver/solver.h"
|
||||
#include "util/rlimit.h"
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <sstream>
|
||||
|
|
|
@ -5,10 +5,10 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
|
||||
#include "horn_subsume_model_converter.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "model_smt2_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "tactic/horn_subsume_model_converter.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
void tst_horn_subsume_model_converter() {
|
||||
ast_manager m;
|
||||
|
|
|
@ -16,9 +16,9 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"hwf.h"
|
||||
#include"f2n.h"
|
||||
#include"rational.h"
|
||||
#include "util/hwf.h"
|
||||
#include "util/f2n.h"
|
||||
#include "util/rational.h"
|
||||
|
||||
static void bug_set_double() {
|
||||
hwf_manager m;
|
||||
|
|
|
@ -19,9 +19,9 @@ Revision History:
|
|||
#ifndef IM_FLOAT_CONFIG_H_
|
||||
#define IM_FLOAT_CONFIG_H_
|
||||
|
||||
#include"f2n.h"
|
||||
#include"mpf.h"
|
||||
#include"hwf.h"
|
||||
#include "util/f2n.h"
|
||||
#include "util/mpf.h"
|
||||
#include "util/hwf.h"
|
||||
|
||||
template<typename f_manager>
|
||||
class im_float_config {
|
||||
|
|
|
@ -18,7 +18,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include"inf_rational.h"
|
||||
#include "util/inf_rational.h"
|
||||
|
||||
static void tst0() {
|
||||
inf_rational n(rational(0), false);
|
||||
|
|
|
@ -17,12 +17,12 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include<cstdlib>
|
||||
#include"interval_def.h"
|
||||
#include"dependency.h"
|
||||
#include"mpq.h"
|
||||
#include"ast.h"
|
||||
#include"debug.h"
|
||||
#include"rlimit.h"
|
||||
#include "math/interval/interval_def.h"
|
||||
#include "util/dependency.h"
|
||||
#include "util/mpq.h"
|
||||
#include "ast/ast.h"
|
||||
#include "util/debug.h"
|
||||
#include "util/rlimit.h"
|
||||
|
||||
template class interval_manager<im_default_config>;
|
||||
typedef im_default_config::interval interval;
|
||||
|
@ -390,7 +390,7 @@ static void tst_div(unsigned N, unsigned magnitude) {
|
|||
del_interval(imc, a); del_interval(imc, b); del_interval(imc, r);
|
||||
}
|
||||
|
||||
#include"im_float_config.h"
|
||||
#include "test/im_float_config.h"
|
||||
|
||||
#if 0
|
||||
static void tst_float() {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
Copyright (c) 2015 Microsoft Corporation
|
||||
|
||||
--*/
|
||||
#include"rlimit.h"
|
||||
#include "hilbert_basis.h"
|
||||
#include "util/rlimit.h"
|
||||
#include "math/hilbert/hilbert_basis.h"
|
||||
|
||||
/*
|
||||
Test generation of linear congruences a la Karr.
|
||||
|
|
|
@ -16,10 +16,10 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"trace.h"
|
||||
#include"util.h"
|
||||
#include"region.h"
|
||||
#include"list.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/util.h"
|
||||
#include "util/region.h"
|
||||
#include "util/list.h"
|
||||
|
||||
static void tst1() {
|
||||
region r;
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
add_executable(lp_tst lp_main.cpp lp.cpp $<TARGET_OBJECTS:util> $<TARGET_OBJECTS:polynomial> $<TARGET_OBJECTS:nlsat> $<TARGET_OBJECTS:lp> )
|
||||
target_compile_definitions(lp_tst PRIVATE ${Z3_COMPONENT_CXX_DEFINES})
|
||||
target_compile_options(lp_tst PRIVATE ${Z3_COMPONENT_CXX_FLAGS})
|
||||
target_include_directories(lp_tst PRIVATE ${Z3_COMPONENT_EXTRA_INCLUDE_DIRS})
|
||||
target_link_libraries(lp_tst PRIVATE ${Z3_DEPENDENT_LIBS})
|
||||
z3_append_linker_flag_list_to_target(lp_tst ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS})
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
|
||||
Author: Lev Nachmanson
|
||||
*/
|
||||
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
|
||||
namespace lp {
|
||||
class argument_parser {
|
||||
std::unordered_map<std::string, std::string> m_options;
|
||||
std::unordered_map<std::string, std::string> m_options_with_after_string;
|
||||
std::set<std::string> m_used_options;
|
||||
std::unordered_map<std::string, std::string> m_used_options_with_after_string;
|
||||
std::vector<std::string> m_free_args;
|
||||
std::vector<std::string> m_args;
|
||||
|
||||
public:
|
||||
std::string m_error_message;
|
||||
argument_parser(unsigned argn, char * const* args) {
|
||||
for (unsigned i = 0; i < argn; i++) {
|
||||
m_args.push_back(std::string(args[i]));
|
||||
}
|
||||
}
|
||||
|
||||
void add_option(std::string s) {
|
||||
add_option_with_help_string(s, "");
|
||||
}
|
||||
|
||||
void add_option_with_help_string(std::string s, std::string help_string) {
|
||||
m_options[s]=help_string;
|
||||
}
|
||||
|
||||
void add_option_with_after_string(std::string s) {
|
||||
add_option_with_after_string_with_help(s, "");
|
||||
}
|
||||
|
||||
void add_option_with_after_string_with_help(std::string s, std::string help_string) {
|
||||
m_options_with_after_string[s]=help_string;
|
||||
}
|
||||
|
||||
|
||||
bool parse() {
|
||||
bool status_is_ok = true;
|
||||
for (unsigned i = 0; i < m_args.size(); i++) {
|
||||
std::string ar = m_args[i];
|
||||
if (m_options.find(ar) != m_options.end() )
|
||||
m_used_options.insert(ar);
|
||||
else if (m_options_with_after_string.find(ar) != m_options_with_after_string.end()) {
|
||||
if (i == m_args.size() - 1) {
|
||||
m_error_message = "Argument is missing after "+ar;
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
m_used_options_with_after_string[ar] = m_args[i];
|
||||
} else {
|
||||
if (starts_with(ar, "-") || starts_with(ar, "//"))
|
||||
status_is_ok = false;
|
||||
|
||||
m_free_args.push_back(ar);
|
||||
}
|
||||
}
|
||||
return status_is_ok;
|
||||
}
|
||||
|
||||
bool contains(std::unordered_map<std::string, std::string> & m, std::string s) {
|
||||
return m.find(s) != m.end();
|
||||
}
|
||||
|
||||
bool contains(std::set<std::string> & m, std::string s) {
|
||||
return m.find(s) != m.end();
|
||||
}
|
||||
|
||||
bool option_is_used(std::string option) {
|
||||
return contains(m_used_options, option) || contains(m_used_options_with_after_string, option);
|
||||
}
|
||||
|
||||
std::string get_option_value(std::string option) {
|
||||
auto t = m_used_options_with_after_string.find(option);
|
||||
if (t != m_used_options_with_after_string.end()){
|
||||
return t->second;
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
bool starts_with(std::string s, char const * prefix) {
|
||||
return starts_with(s, std::string(prefix));
|
||||
}
|
||||
|
||||
bool starts_with(std::string s, std::string prefix) {
|
||||
return s.substr(0, prefix.size()) == prefix;
|
||||
}
|
||||
|
||||
std::string usage_string() {
|
||||
std::string ret = "";
|
||||
std::vector<std::string> unknown_options;
|
||||
for (auto t : m_free_args) {
|
||||
if (starts_with(t, "-") || starts_with(t, "\\")) {
|
||||
unknown_options.push_back(t);
|
||||
}
|
||||
}
|
||||
if (unknown_options.size()) {
|
||||
ret = "Unknown options:";
|
||||
}
|
||||
for (auto unknownOption : unknown_options) {
|
||||
ret += unknownOption;
|
||||
ret += ",";
|
||||
}
|
||||
ret += "\n";
|
||||
ret += "Usage:\n";
|
||||
for (auto allowed_option : m_options)
|
||||
ret += allowed_option.first + " " + (allowed_option.second.size() == 0 ? std::string("") : std::string("/") + allowed_option.second) + std::string("\n");
|
||||
for (auto s : m_options_with_after_string) {
|
||||
ret += s.first + " " + (s.second.size() == 0? " \"option value\"":("\""+ s.second+"\"")) + "\n";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void print() {
|
||||
if (m_used_options.size() == 0 && m_used_options_with_after_string.size() == 0 && m_free_args.size() == 0) {
|
||||
std::cout << "no options are given" << std::endl;
|
||||
return;
|
||||
}
|
||||
std::cout << "options are: " << std::endl;
|
||||
for (std::string s : m_used_options) {
|
||||
std::cout << s << std::endl;
|
||||
}
|
||||
for (auto & t : m_used_options_with_after_string) {
|
||||
std::cout << t.first << " " << t.second << std::endl;
|
||||
}
|
||||
if (m_free_args.size() > 0) {
|
||||
std::cout << "free arguments are: " << std::endl;
|
||||
for (auto & t : m_free_args) {
|
||||
std::cout << t << " " << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
3247
src/test/lp/lp.cpp
3247
src/test/lp/lp.cpp
File diff suppressed because it is too large
Load diff
|
@ -1,14 +0,0 @@
|
|||
void gparams_register_modules(){}
|
||||
void mem_initialize() {}
|
||||
void mem_finalize() {}
|
||||
#include "util/rational.h"
|
||||
namespace lp {
|
||||
void test_lp_local(int argc, char**argv);
|
||||
}
|
||||
int main(int argn, char**argv){
|
||||
rational::initialize();
|
||||
lp::test_lp_local(argn, argv);
|
||||
rational::finalize();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,396 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
|
||||
Author: Lev Nachmanson
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// reads an MPS file reperesenting a Mixed Integer Program
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include "util/lp/lp_primal_simplex.h"
|
||||
#include "util/lp/lp_dual_simplex.h"
|
||||
#include "util/lp/lar_solver.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <functional>
|
||||
#include <algorithm>
|
||||
#include "util/lp/mps_reader.h"
|
||||
#include "util/lp/ul_pair.h"
|
||||
#include "util/lp/lar_constraints.h"
|
||||
#include <sstream>
|
||||
#include <cstdlib>
|
||||
namespace lp {
|
||||
|
||||
template<typename T>
|
||||
T from_string(const std::string& str) {
|
||||
std::istringstream ss(str);
|
||||
T ret;
|
||||
ss >> ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
class smt_reader {
|
||||
public:
|
||||
struct lisp_elem {
|
||||
std::string m_head;
|
||||
std::vector<lisp_elem> m_elems;
|
||||
void print() {
|
||||
if (m_elems.size()) {
|
||||
std::cout << '(';
|
||||
std::cout << m_head << ' ';
|
||||
for (auto & el : m_elems)
|
||||
el.print();
|
||||
|
||||
std::cout << ')';
|
||||
} else {
|
||||
std::cout << " " << m_head;
|
||||
}
|
||||
}
|
||||
unsigned size() const { return static_cast<unsigned>(m_elems.size()); }
|
||||
bool is_simple() const { return size() == 0; }
|
||||
};
|
||||
struct formula_constraint {
|
||||
lconstraint_kind m_kind;
|
||||
std::vector<std::pair<mpq, std::string>> m_coeffs;
|
||||
mpq m_right_side;
|
||||
void add_pair(mpq c, std::string name) {
|
||||
m_coeffs.push_back(make_pair(c, name));
|
||||
}
|
||||
formula_constraint() : m_right_side(numeric_traits<mpq>::zero()) {}
|
||||
};
|
||||
|
||||
lisp_elem m_formula_lisp_elem;
|
||||
|
||||
std::unordered_map<std::string, unsigned> m_name_to_var_index;
|
||||
std::vector<formula_constraint> m_constraints;
|
||||
bool m_is_OK;
|
||||
unsigned m_line_number;
|
||||
std::string m_file_name;
|
||||
std::ifstream m_file_stream;
|
||||
std::string m_line;
|
||||
smt_reader(std::string file_name):
|
||||
m_is_OK(true),
|
||||
m_line_number(0),
|
||||
m_file_name(file_name),
|
||||
m_file_stream(file_name) {
|
||||
}
|
||||
|
||||
void set_error() {
|
||||
std::cout << "setting error" << std::endl;
|
||||
m_is_OK = false;
|
||||
}
|
||||
|
||||
bool is_ok() {
|
||||
return m_is_OK;
|
||||
}
|
||||
|
||||
bool prefix(const char * pr) {
|
||||
return m_line.find(pr) == 0;
|
||||
}
|
||||
|
||||
int first_separator() {
|
||||
unsigned blank_pos = static_cast<unsigned>(m_line.find(' '));
|
||||
unsigned br_pos = static_cast<unsigned>(m_line.find('('));
|
||||
unsigned reverse_br_pos = static_cast<unsigned>(m_line.find(')'));
|
||||
return std::min(blank_pos, std::min(br_pos, reverse_br_pos));
|
||||
}
|
||||
|
||||
void fill_lisp_elem(lisp_elem & lm) {
|
||||
if (m_line[0] == '(')
|
||||
fill_nested_elem(lm);
|
||||
else
|
||||
fill_simple_elem(lm);
|
||||
}
|
||||
|
||||
void fill_simple_elem(lisp_elem & lm) {
|
||||
int separator = first_separator();
|
||||
lp_assert(-1 != separator && separator != 0);
|
||||
lm.m_head = m_line.substr(0, separator);
|
||||
m_line = m_line.substr(separator);
|
||||
}
|
||||
|
||||
void fill_nested_elem(lisp_elem & lm) {
|
||||
lp_assert(m_line[0] == '(');
|
||||
m_line = m_line.substr(1);
|
||||
int separator = first_separator();
|
||||
lm.m_head = m_line.substr(0, separator);
|
||||
m_line = m_line.substr(lm.m_head.size());
|
||||
eat_blanks();
|
||||
while (m_line.size()) {
|
||||
if (m_line[0] == '(') {
|
||||
lisp_elem el;
|
||||
fill_nested_elem(el);
|
||||
lm.m_elems.push_back(el);
|
||||
} else {
|
||||
if (m_line[0] == ')') {
|
||||
m_line = m_line.substr(1);
|
||||
break;
|
||||
}
|
||||
lisp_elem el;
|
||||
fill_simple_elem(el);
|
||||
lm.m_elems.push_back(el);
|
||||
}
|
||||
eat_blanks();
|
||||
}
|
||||
}
|
||||
|
||||
void eat_blanks() {
|
||||
while (m_line.size()) {
|
||||
if (m_line[0] == ' ')
|
||||
m_line = m_line.substr(1);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void fill_formula_elem() {
|
||||
fill_lisp_elem(m_formula_lisp_elem);
|
||||
}
|
||||
|
||||
void parse_line() {
|
||||
if (m_line.find(":formula") == 0) {
|
||||
int first_br = static_cast<int>(m_line.find('('));
|
||||
if (first_br == -1) {
|
||||
std::cout << "empty formula" << std::endl;
|
||||
return;
|
||||
}
|
||||
m_line = m_line.substr(first_br);
|
||||
fill_formula_elem();
|
||||
}
|
||||
}
|
||||
|
||||
void set_constraint_kind(formula_constraint & c, lisp_elem & el) {
|
||||
if (el.m_head == "=") {
|
||||
c.m_kind = EQ;
|
||||
} else if (el.m_head == ">=") {
|
||||
c.m_kind = GE;
|
||||
} else if (el.m_head == "<=") {
|
||||
c.m_kind = LE;
|
||||
} else if (el.m_head == ">") {
|
||||
c.m_kind = GT;
|
||||
} else if (el.m_head == "<") {
|
||||
c.m_kind = LT;
|
||||
} else {
|
||||
std::cout << "kind " << el.m_head << " is not supported " << std::endl;
|
||||
set_error();
|
||||
}
|
||||
}
|
||||
|
||||
void adjust_rigth_side(formula_constraint & /* c*/, lisp_elem & /*el*/) {
|
||||
// lp_assert(el.m_head == "0"); // do nothing for the time being
|
||||
}
|
||||
|
||||
void set_constraint_coeffs(formula_constraint & c, lisp_elem & el) {
|
||||
lp_assert(el.m_elems.size() == 2);
|
||||
set_constraint_coeffs_on_coeff_element(c, el.m_elems[0]);
|
||||
adjust_rigth_side(c, el.m_elems[1]);
|
||||
}
|
||||
|
||||
|
||||
bool is_integer(std::string & s) {
|
||||
if (s.size() == 0) return false;
|
||||
return atoi(s.c_str()) != 0 || isdigit(s.c_str()[0]);
|
||||
}
|
||||
|
||||
void add_complex_sum_elem(formula_constraint & c, lisp_elem & el) {
|
||||
if (el.m_head == "*") {
|
||||
add_mult_elem(c, el.m_elems);
|
||||
} else if (el.m_head == "~") {
|
||||
lisp_elem & minel = el.m_elems[0];
|
||||
lp_assert(minel.is_simple());
|
||||
c.m_right_side += mpq(str_to_int(minel.m_head));
|
||||
} else {
|
||||
std::cout << "unexpected input " << el.m_head << std::endl;
|
||||
set_error();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string get_name(lisp_elem & name) {
|
||||
lp_assert(name.is_simple());
|
||||
lp_assert(!is_integer(name.m_head));
|
||||
return name.m_head;
|
||||
}
|
||||
|
||||
|
||||
void add_mult_elem(formula_constraint & c, std::vector<lisp_elem> & els) {
|
||||
lp_assert(els.size() == 2);
|
||||
mpq coeff = get_coeff(els[0]);
|
||||
std::string col_name = get_name(els[1]);
|
||||
c.add_pair(coeff, col_name);
|
||||
}
|
||||
|
||||
mpq get_coeff(lisp_elem & le) {
|
||||
if (le.is_simple()) {
|
||||
return mpq(str_to_int(le.m_head));
|
||||
} else {
|
||||
lp_assert(le.m_head == "~");
|
||||
lp_assert(le.size() == 1);
|
||||
lisp_elem & el = le.m_elems[0];
|
||||
lp_assert(el.is_simple());
|
||||
return -mpq(str_to_int(el.m_head));
|
||||
}
|
||||
}
|
||||
|
||||
int str_to_int(std::string & s) {
|
||||
lp_assert(is_integer(s));
|
||||
return atoi(s.c_str());
|
||||
}
|
||||
|
||||
void add_sum_elem(formula_constraint & c, lisp_elem & el) {
|
||||
if (el.size()) {
|
||||
add_complex_sum_elem(c, el);
|
||||
} else {
|
||||
lp_assert(is_integer(el.m_head));
|
||||
int v = atoi(el.m_head.c_str());
|
||||
mpq vr(v);
|
||||
c.m_right_side -= vr;
|
||||
}
|
||||
}
|
||||
|
||||
void add_sum(formula_constraint & c, std::vector<lisp_elem> & sum_els) {
|
||||
for (auto & el : sum_els)
|
||||
add_sum_elem(c, el);
|
||||
}
|
||||
|
||||
void set_constraint_coeffs_on_coeff_element(formula_constraint & c, lisp_elem & el) {
|
||||
if (el.m_head == "*") {
|
||||
add_mult_elem(c, el.m_elems);
|
||||
} else if (el.m_head == "+") {
|
||||
add_sum(c, el.m_elems);
|
||||
} else {
|
||||
lp_assert(false); // unexpected input
|
||||
}
|
||||
}
|
||||
|
||||
void create_constraint(lisp_elem & el) {
|
||||
formula_constraint c;
|
||||
set_constraint_kind(c, el);
|
||||
set_constraint_coeffs(c, el);
|
||||
m_constraints.push_back(c);
|
||||
}
|
||||
|
||||
void fill_constraints() {
|
||||
if (m_formula_lisp_elem.m_head != "and") {
|
||||
std::cout << "unexpected top element " << m_formula_lisp_elem.m_head << std::endl;
|
||||
set_error();
|
||||
return;
|
||||
}
|
||||
for (auto & el : m_formula_lisp_elem.m_elems)
|
||||
create_constraint(el);
|
||||
}
|
||||
|
||||
void read() {
|
||||
if (!m_file_stream.is_open()){
|
||||
std::cout << "cannot open file " << m_file_name << std::endl;
|
||||
set_error();
|
||||
return;
|
||||
}
|
||||
while (m_is_OK && getline(m_file_stream, m_line)) {
|
||||
parse_line();
|
||||
m_line_number++;
|
||||
}
|
||||
|
||||
m_file_stream.close();
|
||||
fill_constraints();
|
||||
}
|
||||
|
||||
/*
|
||||
void fill_lar_solver_on_row(row * row, lar_solver *solver) {
|
||||
if (row->m_name != m_cost_row_name) {
|
||||
lar_constraint c(get_lar_relation_from_row(row->m_type), row->m_right_side);
|
||||
for (auto s : row->m_row_columns) {
|
||||
var_index i = solver->add_var(s.first);
|
||||
c.add_variable_to_constraint(i, s.second);
|
||||
}
|
||||
solver->add_constraint(&c);
|
||||
} else {
|
||||
// ignore the cost row
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fill_lar_solver_on_rows(lar_solver * solver) {
|
||||
for (auto row_it : m_rows) {
|
||||
fill_lar_solver_on_row(row_it.second, solver);
|
||||
}
|
||||
}
|
||||
|
||||
void create_low_constraint_for_var(column* col, bound * b, lar_solver *solver) {
|
||||
lar_constraint c(GE, b->m_low);
|
||||
var_index i = solver->add_var(col->m_name);
|
||||
c.add_variable_to_constraint(i, numeric_traits<T>::one());
|
||||
solver->add_constraint(&c);
|
||||
}
|
||||
|
||||
void create_upper_constraint_for_var(column* col, bound * b, lar_solver *solver) {
|
||||
lar_constraint c(LE, b->m_upper);
|
||||
var_index i = solver->add_var(col->m_name);
|
||||
c.add_variable_to_constraint(i, numeric_traits<T>::one());
|
||||
solver->add_constraint(&c);
|
||||
}
|
||||
|
||||
void create_equality_contraint_for_var(column* col, bound * b, lar_solver *solver) {
|
||||
lar_constraint c(EQ, b->m_fixed_value);
|
||||
var_index i = solver->add_var(col->m_name);
|
||||
c.add_variable_to_constraint(i, numeric_traits<T>::one());
|
||||
solver->add_constraint(&c);
|
||||
}
|
||||
|
||||
void fill_lar_solver_on_columns(lar_solver * solver) {
|
||||
for (auto s : m_columns) {
|
||||
mps_reader::column * col = s.second;
|
||||
solver->add_var(col->m_name);
|
||||
auto b = col->m_bound;
|
||||
if (b == nullptr) return;
|
||||
|
||||
if (b->m_free) continue;
|
||||
|
||||
if (b->m_low_is_set) {
|
||||
create_low_constraint_for_var(col, b, solver);
|
||||
}
|
||||
if (b->m_upper_is_set) {
|
||||
create_upper_constraint_for_var(col, b, solver);
|
||||
}
|
||||
if (b->m_value_is_fixed) {
|
||||
create_equality_contraint_for_var(col, b, solver);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
unsigned register_name(std::string s) {
|
||||
auto it = m_name_to_var_index.find(s);
|
||||
if (it!= m_name_to_var_index.end())
|
||||
return it->second;
|
||||
|
||||
unsigned ret = static_cast<unsigned>(m_name_to_var_index.size());
|
||||
m_name_to_var_index[s] = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void add_constraint_to_solver(lar_solver * solver, formula_constraint & fc) {
|
||||
vector<std::pair<mpq, var_index>> ls;
|
||||
for (auto & it : fc.m_coeffs) {
|
||||
ls.push_back(std::make_pair(it.first, solver->add_var(register_name(it.second), false)));
|
||||
}
|
||||
solver->add_constraint(ls, fc.m_kind, fc.m_right_side);
|
||||
}
|
||||
|
||||
void fill_lar_solver(lar_solver * solver) {
|
||||
for (formula_constraint & fc : m_constraints)
|
||||
add_constraint_to_solver(solver, fc);
|
||||
}
|
||||
|
||||
|
||||
lar_solver * create_lar_solver() {
|
||||
lar_solver * ls = new lar_solver();
|
||||
fill_lar_solver(ls);
|
||||
return ls;
|
||||
}
|
||||
};
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
|
||||
Author: Lev Nachmanson
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// reads a text file
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "util/lp/lp_utils.h"
|
||||
#include "util/lp/lp_solver.h"
|
||||
|
||||
namespace lp {
|
||||
|
||||
template <typename T>
|
||||
struct test_result {
|
||||
lp_status m_status;
|
||||
T m_cost;
|
||||
std::unordered_map<std::string, T> column_values;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class test_file_reader {
|
||||
struct raw_blob {
|
||||
std::vector<std::string> m_unparsed_strings;
|
||||
std::vector<raw_blob> m_blobs;
|
||||
};
|
||||
|
||||
struct test_file_blob {
|
||||
std::string m_name;
|
||||
std::string m_content;
|
||||
std::unordered_map<std::string, std::string> m_table;
|
||||
std::unordered_map<std::string, test_file_blob> m_blobs;
|
||||
|
||||
test_result<T> * get_test_result() {
|
||||
test_result<T> * tr = new test_result<T>();
|
||||
throw "not impl";
|
||||
return tr;
|
||||
}
|
||||
};
|
||||
std::ifstream m_file_stream;
|
||||
public:
|
||||
// constructor
|
||||
test_file_reader(std::string file_name) : m_file_stream(file_name) {
|
||||
if (!m_file_stream.is_open()) {
|
||||
std::cout << "cannot open file " << "\'" << file_name << "\'" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
raw_blob scan_to_row_blob() {
|
||||
}
|
||||
|
||||
test_file_blob scan_row_blob_to_test_file_blob(raw_blob /* rblob */) {
|
||||
}
|
||||
|
||||
test_result<T> * get_test_result() {
|
||||
if (!m_file_stream.is_open()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
raw_blob rblob = scan_to_row_blob();
|
||||
|
||||
test_file_blob tblob = scan_row_blob_to_test_file_blob(rblob);
|
||||
|
||||
return tblob.get_test_result();
|
||||
}
|
||||
};
|
||||
}
|
|
@ -2,13 +2,13 @@
|
|||
#include<time.h>
|
||||
#include<string>
|
||||
#include<cstring>
|
||||
#include"util.h"
|
||||
#include"trace.h"
|
||||
#include"debug.h"
|
||||
#include"timeit.h"
|
||||
#include"warning.h"
|
||||
#include"memory_manager.h"
|
||||
#include"gparams.h"
|
||||
#include "util/util.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/debug.h"
|
||||
#include "util/timeit.h"
|
||||
#include "util/warning.h"
|
||||
#include "util/memory_manager.h"
|
||||
#include "util/gparams.h"
|
||||
|
||||
//
|
||||
// Unit tests fail by asserting.
|
||||
|
@ -167,7 +167,6 @@ int main(int argc, char ** argv) {
|
|||
TST(timeout);
|
||||
TST(proof_checker);
|
||||
TST(simplifier);
|
||||
TST(bv_simplifier_plugin);
|
||||
TST(bit_blaster);
|
||||
TST(var_subst);
|
||||
TST(simple_parser);
|
||||
|
|
|
@ -16,8 +16,8 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"map.h"
|
||||
#include"str_hashtable.h"
|
||||
#include "util/map.h"
|
||||
#include "util/str_hashtable.h"
|
||||
|
||||
static void tst1() {
|
||||
map<char const *, int, str_hash_proc, str_eq_proc> str2int;
|
||||
|
|
|
@ -17,9 +17,9 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#ifdef _WINDOWS
|
||||
#include"matcher.h"
|
||||
#include"ast_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "ast/substitution/matcher.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
|
||||
void tst_match(ast_manager & m, app * t, app * i) {
|
||||
|
|
|
@ -5,11 +5,11 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "z3.h"
|
||||
#include "z3_private.h"
|
||||
#include "api/z3.h"
|
||||
#include "api/z3_private.h"
|
||||
#include <iostream>
|
||||
#include "util.h"
|
||||
#include "trace.h"
|
||||
#include "util/util.h"
|
||||
#include "util/trace.h"
|
||||
|
||||
static bool oom = false;
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "model2expr.h"
|
||||
#include "ast_pp.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "model_smt2_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "model/model2expr.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
void tst_model2expr() {
|
||||
ast_manager m;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "model_based_opt.h"
|
||||
#include "util.h"
|
||||
#include "uint_set.h"
|
||||
#include "math/simplex/model_based_opt.h"
|
||||
#include "util/util.h"
|
||||
#include "util/uint_set.h"
|
||||
|
||||
typedef opt::model_based_opt::var var;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "model.h"
|
||||
#include "model_evaluator.h"
|
||||
#include "model_pp.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "ast_pp.h"
|
||||
#include "model/model.h"
|
||||
#include "model/model_evaluator.h"
|
||||
#include "model/model_pp.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/ast_pp.h"
|
||||
|
||||
|
||||
void tst_model_evaluator() {
|
||||
|
|
|
@ -5,14 +5,14 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
|
||||
#include "ast.h"
|
||||
#include "smt_params.h"
|
||||
#include "smt_context.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "array_decl_plugin.h"
|
||||
#include "model_v2_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "ast/ast.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "smt/smt_context.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/array_decl_plugin.h"
|
||||
#include "model/model_v2_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
void tst_model_retrieval()
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include "mpbq.h"
|
||||
#include "util/mpbq.h"
|
||||
|
||||
static void tst1() {
|
||||
unsynch_mpz_manager zm;
|
||||
|
|
|
@ -16,8 +16,8 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"mpf.h"
|
||||
#include"f2n.h"
|
||||
#include "util/mpf.h"
|
||||
#include "util/f2n.h"
|
||||
|
||||
static void bug_set_int() {
|
||||
mpf_manager fm;
|
||||
|
|
|
@ -17,9 +17,9 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include<sstream>
|
||||
#include"mpff.h"
|
||||
#include"mpz.h"
|
||||
#include"mpq.h"
|
||||
#include "util/mpff.h"
|
||||
#include "util/mpz.h"
|
||||
#include "util/mpq.h"
|
||||
|
||||
static void tst1() {
|
||||
try {
|
||||
|
|
|
@ -16,7 +16,7 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"mpfx.h"
|
||||
#include "util/mpfx.h"
|
||||
|
||||
static void tst1() {
|
||||
mpfx_manager m;
|
||||
|
|
|
@ -17,9 +17,9 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include"mpq.h"
|
||||
#include"rational.h"
|
||||
#include"timeit.h"
|
||||
#include "util/mpq.h"
|
||||
#include "util/rational.h"
|
||||
#include "util/timeit.h"
|
||||
|
||||
static void tst0() {
|
||||
synch_mpq_manager m;
|
||||
|
|
|
@ -17,10 +17,10 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include"mpz.h"
|
||||
#include"rational.h"
|
||||
#include"timeit.h"
|
||||
#include"scoped_numeral.h"
|
||||
#include "util/mpz.h"
|
||||
#include "util/rational.h"
|
||||
#include "util/timeit.h"
|
||||
#include "util/scoped_numeral.h"
|
||||
|
||||
static void tst1() {
|
||||
synch_mpz_manager m;
|
||||
|
|
|
@ -4,10 +4,10 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "nlarith_util.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "qe/nlarith_util.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
void tst_nlarith_util() {
|
||||
ast_manager M;
|
||||
|
|
|
@ -16,14 +16,14 @@ Author:
|
|||
Notes:
|
||||
|
||||
--*/
|
||||
#include"nlsat_assignment.h"
|
||||
#include"nlsat_interval_set.h"
|
||||
#include"nlsat_evaluator.h"
|
||||
#include"nlsat_solver.h"
|
||||
#include"util.h"
|
||||
#include"nlsat_explain.h"
|
||||
#include"polynomial_cache.h"
|
||||
#include"rlimit.h"
|
||||
#include "nlsat/nlsat_assignment.h"
|
||||
#include "nlsat/nlsat_interval_set.h"
|
||||
#include "nlsat/nlsat_evaluator.h"
|
||||
#include "nlsat/nlsat_solver.h"
|
||||
#include "util/util.h"
|
||||
#include "nlsat/nlsat_explain.h"
|
||||
#include "math/polynomial/polynomial_cache.h"
|
||||
#include "util/rlimit.h"
|
||||
|
||||
nlsat::interval_set_ref tst_interval(nlsat::interval_set_ref const & s1,
|
||||
nlsat::interval_set_ref const & s2,
|
||||
|
|
|
@ -18,9 +18,9 @@ Revision History:
|
|||
--*/
|
||||
#ifdef _WINDOWS
|
||||
|
||||
#include "z3.h"
|
||||
#include "trace.h"
|
||||
#include "rational.h"
|
||||
#include "api/z3.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/rational.h"
|
||||
|
||||
#define TEST(TEST_NAME, TEST_OUTCOME, NEG_TEST_OUTCOME) \
|
||||
do { \
|
||||
|
|
|
@ -17,8 +17,8 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include"rational.h"
|
||||
#include"object_allocator.h"
|
||||
#include "util/rational.h"
|
||||
#include "util/object_allocator.h"
|
||||
|
||||
struct cell {
|
||||
rational m_coeff;
|
||||
|
|
|
@ -16,7 +16,7 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"old_interval.h"
|
||||
#include "smt/old_interval.h"
|
||||
|
||||
static void tst1() {
|
||||
ext_numeral inf(true);
|
||||
|
@ -166,9 +166,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
#include"basic_interval.h"
|
||||
#include"mpz.h"
|
||||
#include"scoped_numeral.h"
|
||||
#include "util/basic_interval.h"
|
||||
#include "util/mpz.h"
|
||||
#include "util/scoped_numeral.h"
|
||||
|
||||
static void tst2() {
|
||||
typedef basic_interval_manager<unsynch_mpz_manager, false> mpzi_manager;
|
||||
|
|
|
@ -16,9 +16,10 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"trace.h"
|
||||
#include"debug.h"
|
||||
#include"optional.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/debug.h"
|
||||
#include "util/memory_manager.h"
|
||||
#include "util/optional.h"
|
||||
|
||||
static void tst1() {
|
||||
optional<int> v;
|
||||
|
|
|
@ -16,9 +16,9 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"parray.h"
|
||||
#include"small_object_allocator.h"
|
||||
#include"ast.h"
|
||||
#include "util/parray.h"
|
||||
#include "util/small_object_allocator.h"
|
||||
#include "ast/ast.h"
|
||||
|
||||
template<bool PRESERVE_ROOTS>
|
||||
struct int_parray_config {
|
||||
|
|
|
@ -3,21 +3,21 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "trace.h"
|
||||
#include "vector.h"
|
||||
#include "ast.h"
|
||||
#include "ast_pp.h"
|
||||
#include "statistics.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "pb2bv_rewriter.h"
|
||||
#include "smt_kernel.h"
|
||||
#include "model_smt2_pp.h"
|
||||
#include "smt_params.h"
|
||||
#include "ast_util.h"
|
||||
#include "pb_decl_plugin.h"
|
||||
#include "th_rewriter.h"
|
||||
#include "fd_solver.h"
|
||||
#include "solver.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/vector.h"
|
||||
#include "ast/ast.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "util/statistics.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/rewriter/pb2bv_rewriter.h"
|
||||
#include "smt/smt_kernel.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "ast/ast_util.h"
|
||||
#include "ast/pb_decl_plugin.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "tactic/portfolio/fd_solver.h"
|
||||
#include "solver/solver.h"
|
||||
|
||||
static void test1() {
|
||||
ast_manager m;
|
||||
|
|
|
@ -4,8 +4,8 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "pdr_context.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "muz/pdr/pdr_context.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
|
||||
using namespace pdr;
|
||||
|
|
|
@ -16,9 +16,9 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"permutation.h"
|
||||
#include"util.h"
|
||||
#include"vector.h"
|
||||
#include "util/permutation.h"
|
||||
#include "util/util.h"
|
||||
#include "util/vector.h"
|
||||
|
||||
void apply_permutation_copy(unsigned sz, unsigned const * src, unsigned const * p, unsigned * target) {
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
|
|
|
@ -17,11 +17,11 @@ Notes:
|
|||
|
||||
--*/
|
||||
#if !defined(__clang__)
|
||||
#include"polynomial.h"
|
||||
#include"polynomial_var2value.h"
|
||||
#include"polynomial_cache.h"
|
||||
#include"linear_eq_solver.h"
|
||||
#include"rlimit.h"
|
||||
#include "math/polynomial/polynomial.h"
|
||||
#include "math/polynomial/polynomial_var2value.h"
|
||||
#include "math/polynomial/polynomial_cache.h"
|
||||
#include "math/polynomial/linear_eq_solver.h"
|
||||
#include "util/rlimit.h"
|
||||
|
||||
static void tst1() {
|
||||
std::cout << "\n----- Basic testing -------\n";
|
||||
|
|
|
@ -4,12 +4,12 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "th_rewriter.h"
|
||||
#include "smt2parser.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "arith_rewriter.h"
|
||||
#include "ast_pp.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "parsers/smt2/smt2parser.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/rewriter/arith_rewriter.h"
|
||||
#include "ast/ast_pp.h"
|
||||
|
||||
|
||||
static expr_ref parse_fml(ast_manager& m, char const* str) {
|
||||
|
|
|
@ -16,8 +16,8 @@ Author:
|
|||
Notes:
|
||||
|
||||
--*/
|
||||
#include"mpz.h"
|
||||
#include"prime_generator.h"
|
||||
#include "util/mpz.h"
|
||||
#include "util/prime_generator.h"
|
||||
|
||||
void tst_prime_generator() {
|
||||
unsynch_mpz_manager m;
|
||||
|
|
|
@ -4,8 +4,8 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "proof_checker.h"
|
||||
#include "ast_ll_pp.h"
|
||||
#include "ast/proof_checker/proof_checker.h"
|
||||
#include "ast/ast_ll_pp.h"
|
||||
|
||||
void tst_checker1() {
|
||||
ast_manager m(PGM_FINE);
|
||||
|
|
|
@ -4,17 +4,17 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "qe_arith.h"
|
||||
#include "qe.h"
|
||||
#include "th_rewriter.h"
|
||||
#include "smt2parser.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "arith_rewriter.h"
|
||||
#include "ast_pp.h"
|
||||
#include "smt_context.h"
|
||||
#include "expr_abstract.h"
|
||||
#include "expr_safe_replace.h"
|
||||
#include "qe/qe_arith.h"
|
||||
#include "qe/qe.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "parsers/smt2/smt2parser.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/rewriter/arith_rewriter.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "smt/smt_context.h"
|
||||
#include "ast/expr_abstract.h"
|
||||
#include "ast/rewriter/expr_safe_replace.h"
|
||||
|
||||
static expr_ref parse_fml(ast_manager& m, char const* str) {
|
||||
expr_ref result(m);
|
||||
|
|
|
@ -4,20 +4,15 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "ast.h"
|
||||
#include "smt_params.h"
|
||||
#include "simplifier.h"
|
||||
#include "qe.h"
|
||||
#include "basic_simplifier_plugin.h"
|
||||
#include "arith_simplifier_plugin.h"
|
||||
#include "array_simplifier_plugin.h"
|
||||
#include "bv_simplifier_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "smtlib.h"
|
||||
#include "smtparser.h"
|
||||
#include "lbool.h"
|
||||
#include "ast/ast.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "qe/qe.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "parsers/smt/smtlib.h"
|
||||
#include "parsers/smt/smtparser.h"
|
||||
#include "util/lbool.h"
|
||||
#include <sstream>
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
|
||||
static void test_qe(ast_manager& m, lbool expected_outcome, expr* fml, char const* option) {
|
||||
|
@ -38,7 +33,6 @@ static void test_qe(ast_manager& m, lbool expected_outcome, expr* fml, char cons
|
|||
// enable_trace("after_search");
|
||||
// enable_trace("bv_bit_prop");
|
||||
|
||||
simplifier simp(m);
|
||||
smt_params params;
|
||||
// params.m_quant_elim = true;
|
||||
|
||||
|
|
|
@ -4,20 +4,20 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "ast.h"
|
||||
#include "smt_params.h"
|
||||
#include "qe.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "lbool.h"
|
||||
#include "ast/ast.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "qe/qe.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "util/lbool.h"
|
||||
#include <sstream>
|
||||
#include "expr_replacer.h"
|
||||
#include "smt_kernel.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "expr_abstract.h"
|
||||
#include "model_smt2_pp.h"
|
||||
#include "smt2parser.h"
|
||||
#include "var_subst.h"
|
||||
#include "ast/rewriter/expr_replacer.h"
|
||||
#include "smt/smt_kernel.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "ast/expr_abstract.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "parsers/smt2/smt2parser.h"
|
||||
#include "ast/rewriter/var_subst.h"
|
||||
|
||||
static void validate_quant_solution(ast_manager& m, expr* fml, expr* guard, qe::def_vector const& defs) {
|
||||
// verify:
|
||||
|
|
|
@ -17,8 +17,8 @@ Revision History:
|
|||
|
||||
--*/
|
||||
|
||||
#include"util.h"
|
||||
#include"trace.h"
|
||||
#include "util/util.h"
|
||||
#include "util/trace.h"
|
||||
|
||||
static void tst1() {
|
||||
random_gen r(0);
|
||||
|
|
|
@ -17,11 +17,11 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include<iostream>
|
||||
#include"vector.h"
|
||||
#include"rational.h"
|
||||
#include"trace.h"
|
||||
#include"ext_gcd.h"
|
||||
#include"timeit.h"
|
||||
#include "util/vector.h"
|
||||
#include "util/rational.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/ext_gcd.h"
|
||||
#include "util/timeit.h"
|
||||
|
||||
static void tst1() {
|
||||
rational r1(1);
|
||||
|
|
|
@ -16,9 +16,9 @@ Author:
|
|||
Notes:
|
||||
|
||||
--*/
|
||||
#include"realclosure.h"
|
||||
#include"mpz_matrix.h"
|
||||
#include"rlimit.h"
|
||||
#include "math/realclosure/realclosure.h"
|
||||
#include "math/realclosure/mpz_matrix.h"
|
||||
#include "util/rlimit.h"
|
||||
|
||||
static void tst1() {
|
||||
unsynch_mpq_manager qm;
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include<stdlib.h>
|
||||
#include"region.h"
|
||||
#include "util/region.h"
|
||||
|
||||
static void tst1() {
|
||||
// TODO
|
||||
|
|
|
@ -4,8 +4,8 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "sat_solver.h"
|
||||
#include "util.h"
|
||||
#include "sat/sat_solver.h"
|
||||
#include "util/util.h"
|
||||
|
||||
typedef sat::literal_vector clause_t;
|
||||
typedef vector<clause_t> clauses_t;
|
||||
|
|
|
@ -16,13 +16,13 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"cost_parser.h"
|
||||
#include"cost_evaluator.h"
|
||||
#include"arith_decl_plugin.h"
|
||||
#include"ast_pp.h"
|
||||
#include"well_sorted.h"
|
||||
#include"warning.h"
|
||||
#include"reg_decl_plugins.h"
|
||||
#include "parsers/util/cost_parser.h"
|
||||
#include "smt/cost_evaluator.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/well_sorted.h"
|
||||
#include "util/warning.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
void tst_simple_parser() {
|
||||
ast_manager m;
|
||||
|
|
|
@ -4,14 +4,14 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "sparse_matrix.h"
|
||||
#include "sparse_matrix_def.h"
|
||||
#include "simplex.h"
|
||||
#include "simplex_def.h"
|
||||
#include "mpq_inf.h"
|
||||
#include "vector.h"
|
||||
#include "rational.h"
|
||||
#include "rlimit.h"
|
||||
#include "util/lp/sparse_matrix.h"
|
||||
#include "math/simplex/sparse_matrix_def.h"
|
||||
#include "math/simplex/simplex.h"
|
||||
#include "math/simplex/simplex_def.h"
|
||||
#include "util/mpq_inf.h"
|
||||
#include "util/vector.h"
|
||||
#include "util/rational.h"
|
||||
#include "util/rlimit.h"
|
||||
|
||||
#define R rational
|
||||
typedef simplex::simplex<simplex::mpz_ext> Simplex;
|
||||
|
|
|
@ -5,11 +5,11 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "z3.h"
|
||||
#include "z3_private.h"
|
||||
#include "api/z3.h"
|
||||
#include "api/z3_private.h"
|
||||
#include <iostream>
|
||||
#include "util.h"
|
||||
#include "trace.h"
|
||||
#include "util/util.h"
|
||||
#include "util/trace.h"
|
||||
|
||||
|
||||
static void ev_const(Z3_context ctx, Z3_ast e) {
|
||||
|
|
|
@ -5,9 +5,9 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
--*/
|
||||
|
||||
#include<iostream>
|
||||
#include"util.h"
|
||||
#include"trace.h"
|
||||
#include"small_object_allocator.h"
|
||||
#include "util/util.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/small_object_allocator.h"
|
||||
|
||||
void tst_small_object_allocator() {
|
||||
small_object_allocator soa;
|
||||
|
|
|
@ -7,7 +7,7 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
// This is to test the print-parse facilities over the API
|
||||
// for SMT-LIB2.
|
||||
|
||||
#include "z3.h"
|
||||
#include "api/z3.h"
|
||||
#include <iostream>
|
||||
|
||||
void test_print(Z3_context ctx, Z3_ast_vector av) {
|
||||
|
|
|
@ -4,8 +4,8 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "smt_context.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "smt/smt_context.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
|
||||
void tst_smt_context()
|
||||
{
|
||||
|
|
|
@ -4,16 +4,16 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
|
||||
--*/
|
||||
|
||||
#include "trace.h"
|
||||
#include "vector.h"
|
||||
#include "ast.h"
|
||||
#include "ast_pp.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
#include "sorting_network.h"
|
||||
#include "smt_kernel.h"
|
||||
#include "model_smt2_pp.h"
|
||||
#include "smt_params.h"
|
||||
#include "ast_util.h"
|
||||
#include "util/trace.h"
|
||||
#include "util/vector.h"
|
||||
#include "ast/ast.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "util/sorting_network.h"
|
||||
#include "smt/smt_kernel.h"
|
||||
#include "model/model_smt2_pp.h"
|
||||
#include "smt/params/smt_params.h"
|
||||
#include "ast/ast_util.h"
|
||||
|
||||
|
||||
|
||||
|
@ -220,7 +220,7 @@ static void test_sorting_eq(unsigned n, unsigned k) {
|
|||
TRACE("pb",
|
||||
unsigned sz = solver.size();
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
tout << mk_pp(solver.get_formulas()[i], m) << "\n";
|
||||
tout << mk_pp(solver.get_formula(i), m) << "\n";
|
||||
});
|
||||
model_ref model;
|
||||
solver.get_model(model);
|
||||
|
@ -266,7 +266,7 @@ static void test_sorting_le(unsigned n, unsigned k) {
|
|||
TRACE("pb",
|
||||
unsigned sz = solver.size();
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
tout << mk_pp(solver.get_formulas()[i], m) << "\n";
|
||||
tout << mk_pp(solver.get_formula(i), m) << "\n";
|
||||
});
|
||||
model_ref model;
|
||||
solver.get_model(model);
|
||||
|
@ -314,7 +314,7 @@ void test_sorting_ge(unsigned n, unsigned k) {
|
|||
TRACE("pb",
|
||||
unsigned sz = solver.size();
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
tout << mk_pp(solver.get_formulas()[i], m) << "\n";
|
||||
tout << mk_pp(solver.get_formula(i), m) << "\n";
|
||||
});
|
||||
model_ref model;
|
||||
solver.get_model(model);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue