mirror of
https://github.com/Z3Prover/z3
synced 2025-07-19 10:52:02 +00:00
Merge branch 'master' of https://github.com/Z3Prover/z3
This commit is contained in:
commit
f2c0a82726
16 changed files with 227 additions and 187 deletions
|
@ -294,7 +294,7 @@ void error_example() {
|
||||||
|
|
||||||
// Error using the C API can be detected using Z3_get_error_code.
|
// Error using the C API can be detected using Z3_get_error_code.
|
||||||
// The next call fails because x is a constant.
|
// The next call fails because x is a constant.
|
||||||
Z3_ast arg = Z3_get_app_arg(c, x, 0);
|
//Z3_ast arg = Z3_get_app_arg(c, x, 0);
|
||||||
if (Z3_get_error_code(c) != Z3_OK) {
|
if (Z3_get_error_code(c) != Z3_OK) {
|
||||||
std::cout << "last call failed.\n";
|
std::cout << "last call failed.\n";
|
||||||
}
|
}
|
||||||
|
@ -999,7 +999,6 @@ void opt_example() {
|
||||||
opt.add(x + y <= 11);
|
opt.add(x + y <= 11);
|
||||||
optimize::handle h1 = opt.maximize(x);
|
optimize::handle h1 = opt.maximize(x);
|
||||||
optimize::handle h2 = opt.maximize(y);
|
optimize::handle h2 = opt.maximize(y);
|
||||||
check_result r = sat;
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (sat == opt.check()) {
|
if (sat == opt.check()) {
|
||||||
std::cout << x << ": " << opt.lower(h1) << " " << y << ": " << opt.lower(h2) << "\n";
|
std::cout << x << ": " << opt.lower(h1) << " " << y << ": " << opt.lower(h2) << "\n";
|
||||||
|
|
|
@ -2610,7 +2610,7 @@ void fpa_example() {
|
||||||
Z3_context ctx;
|
Z3_context ctx;
|
||||||
Z3_sort double_sort, rm_sort;
|
Z3_sort double_sort, rm_sort;
|
||||||
Z3_symbol s_rm, s_x, s_y, s_x_plus_y;
|
Z3_symbol s_rm, s_x, s_y, s_x_plus_y;
|
||||||
Z3_ast rm, x, y, n, x_plus_y, c1, c2, c3, c4, c5, c6;
|
Z3_ast rm, x, y, n, x_plus_y, c1, c2, c3, c4, c5;
|
||||||
Z3_ast args[2], args2[2], and_args[3], args3[3];
|
Z3_ast args[2], args2[2], and_args[3], args3[3];
|
||||||
|
|
||||||
printf("\nFPA-example\n");
|
printf("\nFPA-example\n");
|
||||||
|
|
|
@ -42,7 +42,7 @@ int main(int argc, const char **argv) {
|
||||||
|
|
||||||
Z3_config cfg = Z3_mk_config();
|
Z3_config cfg = Z3_mk_config();
|
||||||
// Z3_interpolation_options options = Z3_mk_interpolation_options();
|
// Z3_interpolation_options options = Z3_mk_interpolation_options();
|
||||||
Z3_params options = 0;
|
// Z3_params options = 0;
|
||||||
|
|
||||||
/* Parse the command line */
|
/* Parse the command line */
|
||||||
int argn = 1;
|
int argn = 1;
|
||||||
|
@ -104,7 +104,7 @@ int main(int argc, const char **argv) {
|
||||||
unsigned num_theory;
|
unsigned num_theory;
|
||||||
Z3_ast *theory;
|
Z3_ast *theory;
|
||||||
|
|
||||||
ok = Z3_read_interpolation_problem(ctx, &num, &constraints, tree_mode ? &parents : 0, filename, &error, &num_theory, &theory);
|
ok = Z3_read_interpolation_problem(ctx, &num, &constraints, tree_mode ? &parents : 0, filename, &error, &num_theory, &theory) != 0;
|
||||||
|
|
||||||
/* If parse failed, print the error message */
|
/* If parse failed, print the error message */
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ int main(int argc, const char **argv) {
|
||||||
std::cout << "Splitting formula into " << nconjs << " conjuncts...\n";
|
std::cout << "Splitting formula into " << nconjs << " conjuncts...\n";
|
||||||
num = nconjs;
|
num = nconjs;
|
||||||
constraints = new Z3_ast[num];
|
constraints = new Z3_ast[num];
|
||||||
for(int k = 0; k < num; k++)
|
for(unsigned k = 0; k < num; k++)
|
||||||
constraints[k] = Z3_get_app_arg(ctx,app,k);
|
constraints[k] = Z3_get_app_arg(ctx,app,k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -163,12 +163,12 @@ int main(int argc, const char **argv) {
|
||||||
std::vector<Z3_ast> asserted(num);
|
std::vector<Z3_ast> asserted(num);
|
||||||
|
|
||||||
/* We start with nothing asserted. */
|
/* We start with nothing asserted. */
|
||||||
for(int i = 0; i < num; i++)
|
for(unsigned i = 0; i < num; i++)
|
||||||
asserted[i] = Z3_mk_true(ctx);
|
asserted[i] = Z3_mk_true(ctx);
|
||||||
|
|
||||||
/* Now we assert the constrints one at a time until UNSAT. */
|
/* Now we assert the constrints one at a time until UNSAT. */
|
||||||
|
|
||||||
for(int i = 0; i < num; i++){
|
for(unsigned i = 0; i < num; i++){
|
||||||
asserted[i] = constraints[i];
|
asserted[i] = constraints[i];
|
||||||
Z3_assert_cnstr(ctx,constraints[i]); // assert one constraint
|
Z3_assert_cnstr(ctx,constraints[i]); // assert one constraint
|
||||||
result = Z3_L_UNDEF; // FIXME: Z3_interpolate(ctx, num, &asserted[0], parents, options, interpolants, &model, 0, true, 0, 0);
|
result = Z3_L_UNDEF; // FIXME: Z3_interpolate(ctx, num, &asserted[0], parents, options, interpolants, &model, 0, true, 0, 0);
|
||||||
|
@ -190,7 +190,7 @@ int main(int argc, const char **argv) {
|
||||||
printf("unsat\n");
|
printf("unsat\n");
|
||||||
if(output_file.empty()){
|
if(output_file.empty()){
|
||||||
printf("interpolant:\n");
|
printf("interpolant:\n");
|
||||||
for(int i = 0; i < num-1; i++)
|
for(unsigned i = 0; i < num-1; i++)
|
||||||
printf("%s\n", Z3_ast_to_string(ctx, interpolants[i]));
|
printf("%s\n", Z3_ast_to_string(ctx, interpolants[i]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -203,7 +203,7 @@ int main(int argc, const char **argv) {
|
||||||
if(check_mode){
|
if(check_mode){
|
||||||
std::cout << "Checking interpolant...\n";
|
std::cout << "Checking interpolant...\n";
|
||||||
bool chk;
|
bool chk;
|
||||||
chk = Z3_check_interpolant(ctx,num,constraints,parents,interpolants,&error,num_theory,theory);
|
chk = Z3_check_interpolant(ctx,num,constraints,parents,interpolants,&error,num_theory,theory) != 0;
|
||||||
if(chk)
|
if(chk)
|
||||||
std::cout << "Interpolant is correct\n";
|
std::cout << "Interpolant is correct\n";
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -598,7 +598,7 @@ int smtlib_maxsat(char * file_name, int approach)
|
||||||
Z3_context ctx;
|
Z3_context ctx;
|
||||||
unsigned num_hard_cnstrs, num_soft_cnstrs;
|
unsigned num_hard_cnstrs, num_soft_cnstrs;
|
||||||
Z3_ast * hard_cnstrs, * soft_cnstrs;
|
Z3_ast * hard_cnstrs, * soft_cnstrs;
|
||||||
unsigned result;
|
unsigned result = 0;
|
||||||
ctx = mk_context();
|
ctx = mk_context();
|
||||||
Z3_parse_smtlib_file(ctx, file_name, 0, 0, 0, 0, 0, 0);
|
Z3_parse_smtlib_file(ctx, file_name, 0, 0, 0, 0, 0, 0);
|
||||||
hard_cnstrs = get_hard_constraints(ctx, &num_hard_cnstrs);
|
hard_cnstrs = get_hard_constraints(ctx, &num_hard_cnstrs);
|
||||||
|
|
|
@ -261,7 +261,7 @@ class env {
|
||||||
parse(inc_name.c_str(), fmls);
|
parse(inc_name.c_str(), fmls);
|
||||||
while (name_list) {
|
while (name_list) {
|
||||||
return mk_error(name_list, "name list (not handled)");
|
return mk_error(name_list, "name list (not handled)");
|
||||||
char const* name = name_list->child(0)->symbol();
|
//char const* name = name_list->child(0)->symbol();
|
||||||
name_list = name_list->child(2);
|
name_list = name_list->child(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -614,7 +614,7 @@ class env {
|
||||||
|
|
||||||
void mk_mapping_sort(TreeNode* t, z3::sort_vector& domain, z3::sort& s) {
|
void mk_mapping_sort(TreeNode* t, z3::sort_vector& domain, z3::sort& s) {
|
||||||
char const* name = t->symbol();
|
char const* name = t->symbol();
|
||||||
char const* id = 0;
|
//char const* id = 0;
|
||||||
if (!strcmp(name,"tff_top_level_type")) {
|
if (!strcmp(name,"tff_top_level_type")) {
|
||||||
mk_mapping_sort(t->child(0), domain, s);
|
mk_mapping_sort(t->child(0), domain, s);
|
||||||
}
|
}
|
||||||
|
@ -1832,7 +1832,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
z3::expr get_proof_formula(z3::expr proof) {
|
z3::expr get_proof_formula(z3::expr proof) {
|
||||||
unsigned na = proof.num_args();
|
// unsigned na = proof.num_args();
|
||||||
z3::expr result = proof.arg(proof.num_args()-1);
|
z3::expr result = proof.arg(proof.num_args()-1);
|
||||||
std::vector<z3::sort> vars;
|
std::vector<z3::sort> vars;
|
||||||
get_free_vars(result, vars);
|
get_free_vars(result, vars);
|
||||||
|
@ -2119,7 +2119,7 @@ void parse_cmd_line_args(int argc, char ** argv) {
|
||||||
int i = 1;
|
int i = 1;
|
||||||
while (i < argc) {
|
while (i < argc) {
|
||||||
char* arg = argv[i];
|
char* arg = argv[i];
|
||||||
char * eq = 0;
|
//char * eq = 0;
|
||||||
char * opt_arg = 0;
|
char * opt_arg = 0;
|
||||||
if (arg[0] == '-' || arg[0] == '/') {
|
if (arg[0] == '-' || arg[0] == '/') {
|
||||||
++arg;
|
++arg;
|
||||||
|
@ -2467,7 +2467,7 @@ static void prove_tptp() {
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
||||||
std::ostream* out = &std::cout;
|
//std::ostream* out = &std::cout;
|
||||||
g_start_time = static_cast<double>(clock());
|
g_start_time = static_cast<double>(clock());
|
||||||
signal(SIGINT, on_ctrl_c);
|
signal(SIGINT, on_ctrl_c);
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ pTree pToken(char* token, int symbolIndex) {
|
||||||
|
|
||||||
//char pTokenBuf[8240];
|
//char pTokenBuf[8240];
|
||||||
pTree ss;
|
pTree ss;
|
||||||
char* symbol = tptp_lval[symbolIndex];
|
//char* symbol = tptp_lval[symbolIndex];
|
||||||
char* safeSym = 0;
|
char* safeSym = 0;
|
||||||
|
|
||||||
//strncpy(pTokenBuf, token, 39);
|
//strncpy(pTokenBuf, token, 39);
|
||||||
|
|
|
@ -191,7 +191,7 @@ def mk_zip():
|
||||||
os.chdir(DIST_DIR)
|
os.chdir(DIST_DIR)
|
||||||
zfname = '%s.zip' % dist_path
|
zfname = '%s.zip' % dist_path
|
||||||
ZIPOUT = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED)
|
ZIPOUT = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED)
|
||||||
os.path.walk(dist_path, mk_zip_visitor, '*')
|
os.walk(dist_path, mk_zip_visitor, '*')
|
||||||
if is_verbose():
|
if is_verbose():
|
||||||
print("Generated '%s'" % zfname)
|
print("Generated '%s'" % zfname)
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -90,7 +90,7 @@ FPMATH="Default"
|
||||||
FPMATH_FLAGS="-mfpmath=sse -msse -msse2"
|
FPMATH_FLAGS="-mfpmath=sse -msse -msse2"
|
||||||
|
|
||||||
def check_output(cmd):
|
def check_output(cmd):
|
||||||
return str(subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]).rstrip('\r\n')
|
return (subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]).decode("utf-8").rstrip('\r\n')
|
||||||
|
|
||||||
def git_hash():
|
def git_hash():
|
||||||
try:
|
try:
|
||||||
|
@ -512,7 +512,7 @@ def dos2unix_tree_core(pattern, dir, files):
|
||||||
dos2unix(fname)
|
dos2unix(fname)
|
||||||
|
|
||||||
def dos2unix_tree():
|
def dos2unix_tree():
|
||||||
os.path.walk('src', dos2unix_tree_core, '*')
|
os.walk('src', dos2unix_tree_core, '*')
|
||||||
|
|
||||||
def check_eol():
|
def check_eol():
|
||||||
if not IS_WINDOWS:
|
if not IS_WINDOWS:
|
||||||
|
@ -1578,20 +1578,22 @@ class CppExampleComponent(ExampleComponent):
|
||||||
def mk_makefile(self, out):
|
def mk_makefile(self, out):
|
||||||
dll_name = get_component(Z3_DLL_COMPONENT).dll_name
|
dll_name = get_component(Z3_DLL_COMPONENT).dll_name
|
||||||
dll = '%s$(SO_EXT)' % dll_name
|
dll = '%s$(SO_EXT)' % dll_name
|
||||||
exefile = '%s$(EXE_EXT)' % self.name
|
|
||||||
out.write('%s: %s' % (exefile, dll))
|
objfiles = ''
|
||||||
for cppfile in self.src_files():
|
for cppfile in self.src_files():
|
||||||
out.write(' ')
|
objfile = '%s$(OBJ_EXT)' % (cppfile[:cppfile.rfind('.')])
|
||||||
out.write(os.path.join(self.to_ex_dir, cppfile))
|
objfiles = objfiles + ('%s ' % objfile)
|
||||||
out.write('\n')
|
out.write('%s: %s\n' % (objfile, os.path.join(self.to_ex_dir, cppfile)));
|
||||||
out.write('\t%s $(OS_DEFINES) $(EXAMP_DEBUG_FLAG) $(LINK_OUT_FLAG)%s $(LINK_FLAGS)' % (self.compiler(), exefile))
|
out.write('\t%s $(CXXFLAGS) $(OS_DEFINES) $(EXAMP_DEBUG_FLAG) $(CXX_OUT_FLAG)%s $(LINK_FLAGS)' % (self.compiler(), objfile))
|
||||||
# Add include dir components
|
# Add include dir components
|
||||||
out.write(' -I%s' % get_component(API_COMPONENT).to_src_dir)
|
out.write(' -I%s' % get_component(API_COMPONENT).to_src_dir)
|
||||||
out.write(' -I%s' % get_component(CPP_COMPONENT).to_src_dir)
|
out.write(' -I%s' % get_component(CPP_COMPONENT).to_src_dir)
|
||||||
for cppfile in self.src_files():
|
out.write(' %s' % os.path.join(self.to_ex_dir, cppfile))
|
||||||
out.write(' ')
|
out.write('\n')
|
||||||
out.write(os.path.join(self.to_ex_dir, cppfile))
|
|
||||||
out.write(' ')
|
exefile = '%s$(EXE_EXT)' % self.name
|
||||||
|
out.write('%s: %s %s\n' % (exefile, dll, objfiles))
|
||||||
|
out.write('\t$(LINK) $(LINK_OUT_FLAG)%s $(LINK_FLAGS) %s ' % (exefile, objfiles))
|
||||||
if IS_WINDOWS:
|
if IS_WINDOWS:
|
||||||
out.write('%s.lib' % dll_name)
|
out.write('%s.lib' % dll_name)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -206,7 +206,7 @@ def mk_zip_core(x64):
|
||||||
os.chdir(DIST_DIR)
|
os.chdir(DIST_DIR)
|
||||||
zfname = '%s.zip' % dist_path
|
zfname = '%s.zip' % dist_path
|
||||||
ZIPOUT = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED)
|
ZIPOUT = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED)
|
||||||
os.path.walk(dist_path, mk_zip_visitor, '*')
|
os.walk(dist_path, mk_zip_visitor, '*')
|
||||||
if is_verbose():
|
if is_verbose():
|
||||||
print("Generated '%s'" % zfname)
|
print("Generated '%s'" % zfname)
|
||||||
except:
|
except:
|
||||||
|
@ -245,10 +245,10 @@ def cp_vs_runtime_core(x64):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platform = "x86"
|
platform = "x86"
|
||||||
vcdir = subprocess.check_output(['echo', '%VCINSTALLDIR%'], shell=True).rstrip('\r\n')
|
vcdir = os.environ['VCINSTALLDIR']
|
||||||
path = '%sredist\\%s' % (vcdir, platform)
|
path = '%sredist\\%s' % (vcdir, platform)
|
||||||
VS_RUNTIME_FILES = []
|
VS_RUNTIME_FILES = []
|
||||||
os.path.walk(path, cp_vs_runtime_visitor, '*.dll')
|
os.walk(path, cp_vs_runtime_visitor, '*.dll')
|
||||||
bin_dist_path = os.path.join(DIST_DIR, get_dist_path(x64), 'bin')
|
bin_dist_path = os.path.join(DIST_DIR, get_dist_path(x64), 'bin')
|
||||||
for f in VS_RUNTIME_FILES:
|
for f in VS_RUNTIME_FILES:
|
||||||
shutil.copy(f, bin_dist_path)
|
shutil.copy(f, bin_dist_path)
|
||||||
|
|
|
@ -255,6 +255,14 @@ extern "C" {
|
||||||
scoped_ptr<solver> m_solver((*sf)(mk_c(c)->m(), _p, true, true, true, ::symbol::null));
|
scoped_ptr<solver> m_solver((*sf)(mk_c(c)->m(), _p, true, true, true, ::symbol::null));
|
||||||
m_solver.get()->updt_params(_p); // why do we have to do this?
|
m_solver.get()->updt_params(_p); // why do we have to do this?
|
||||||
|
|
||||||
|
|
||||||
|
// some boilerplate stolen from Z3_solver_check
|
||||||
|
unsigned timeout = to_params(p)->m_params.get_uint("timeout", mk_c(c)->get_timeout());
|
||||||
|
unsigned rlimit = to_params(p)->m_params.get_uint("rlimit", mk_c(c)->get_rlimit());
|
||||||
|
bool use_ctrl_c = to_params(p)->m_params.get_bool("ctrl_c", false);
|
||||||
|
cancel_eh<solver> eh(*m_solver.get());
|
||||||
|
api::context::set_interruptable si(*(mk_c(c)), eh);
|
||||||
|
|
||||||
ast *_pat = to_ast(pat);
|
ast *_pat = to_ast(pat);
|
||||||
|
|
||||||
ptr_vector<ast> interp;
|
ptr_vector<ast> interp;
|
||||||
|
@ -263,7 +271,14 @@ extern "C" {
|
||||||
ast_manager &_m = mk_c(c)->m();
|
ast_manager &_m = mk_c(c)->m();
|
||||||
|
|
||||||
model_ref m;
|
model_ref m;
|
||||||
lbool _status = iz3interpolate(_m,
|
lbool _status;
|
||||||
|
|
||||||
|
{
|
||||||
|
scoped_ctrl_c ctrlc(eh, false, use_ctrl_c);
|
||||||
|
scoped_timer timer(timeout, &eh);
|
||||||
|
scoped_rlimit _rlimit(mk_c(c)->m().limit(), rlimit);
|
||||||
|
try {
|
||||||
|
_status = iz3interpolate(_m,
|
||||||
*(m_solver.get()),
|
*(m_solver.get()),
|
||||||
_pat,
|
_pat,
|
||||||
cnsts,
|
cnsts,
|
||||||
|
@ -271,6 +286,12 @@ extern "C" {
|
||||||
m,
|
m,
|
||||||
0 // ignore params for now
|
0 // ignore params for now
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
catch (z3_exception & ex) {
|
||||||
|
mk_c(c)->handle_exception(ex);
|
||||||
|
return Z3_L_UNDEF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < cnsts.size(); i++)
|
for (unsigned i = 0; i < cnsts.size(); i++)
|
||||||
_m.dec_ref(cnsts[i]);
|
_m.dec_ref(cnsts[i]);
|
||||||
|
@ -292,11 +313,13 @@ extern "C" {
|
||||||
else {
|
else {
|
||||||
model_ref mr;
|
model_ref mr;
|
||||||
m_solver.get()->get_model(mr);
|
m_solver.get()->get_model(mr);
|
||||||
|
if(mr.get()){
|
||||||
Z3_model_ref *tmp_val = alloc(Z3_model_ref);
|
Z3_model_ref *tmp_val = alloc(Z3_model_ref);
|
||||||
tmp_val->m_model = mr.get();
|
tmp_val->m_model = mr.get();
|
||||||
mk_c(c)->save_object(tmp_val);
|
mk_c(c)->save_object(tmp_val);
|
||||||
*model = of_model(tmp_val);
|
*model = of_model(tmp_val);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*out_interp = of_ast_vector(v);
|
*out_interp = of_ast_vector(v);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
|
@ -7598,6 +7598,10 @@ def tree_interpolant(pat,p=None,ctx=None):
|
||||||
If pat is satisfiable, raises an object of class ModelRef
|
If pat is satisfiable, raises an object of class ModelRef
|
||||||
that represents a model of pat.
|
that represents a model of pat.
|
||||||
|
|
||||||
|
If neither a proof of unsatisfiability nor a model is obtained
|
||||||
|
(for example, because of a timeout, or because models are disabled)
|
||||||
|
then None is returned.
|
||||||
|
|
||||||
If parameters p are supplied, these are used in creating the
|
If parameters p are supplied, these are used in creating the
|
||||||
solver that determines satisfiability.
|
solver that determines satisfiability.
|
||||||
|
|
||||||
|
@ -7623,7 +7627,9 @@ def tree_interpolant(pat,p=None,ctx=None):
|
||||||
res = Z3_compute_interpolant(ctx.ref(),f.as_ast(),p.params,ptr,mptr)
|
res = Z3_compute_interpolant(ctx.ref(),f.as_ast(),p.params,ptr,mptr)
|
||||||
if res == Z3_L_FALSE:
|
if res == Z3_L_FALSE:
|
||||||
return AstVector(ptr[0],ctx)
|
return AstVector(ptr[0],ctx)
|
||||||
|
if mptr[0]:
|
||||||
raise ModelRef(mptr[0], ctx)
|
raise ModelRef(mptr[0], ctx)
|
||||||
|
return None
|
||||||
|
|
||||||
def binary_interpolant(a,b,p=None,ctx=None):
|
def binary_interpolant(a,b,p=None,ctx=None):
|
||||||
"""Compute an interpolant for a binary conjunction.
|
"""Compute an interpolant for a binary conjunction.
|
||||||
|
@ -7638,6 +7644,10 @@ def binary_interpolant(a,b,p=None,ctx=None):
|
||||||
If a & b is satisfiable, raises an object of class ModelRef
|
If a & b is satisfiable, raises an object of class ModelRef
|
||||||
that represents a model of a &b.
|
that represents a model of a &b.
|
||||||
|
|
||||||
|
If neither a proof of unsatisfiability nor a model is obtained
|
||||||
|
(for example, because of a timeout, or because models are disabled)
|
||||||
|
then None is returned.
|
||||||
|
|
||||||
If parameters p are supplied, these are used in creating the
|
If parameters p are supplied, these are used in creating the
|
||||||
solver that determines satisfiability.
|
solver that determines satisfiability.
|
||||||
|
|
||||||
|
@ -7646,7 +7656,8 @@ def binary_interpolant(a,b,p=None,ctx=None):
|
||||||
Not(x >= 0)
|
Not(x >= 0)
|
||||||
"""
|
"""
|
||||||
f = And(Interpolant(a),b)
|
f = And(Interpolant(a),b)
|
||||||
return tree_interpolant(f,p,ctx)[0]
|
ti = tree_interpolant(f,p,ctx)
|
||||||
|
return ti[0] if ti != None else None
|
||||||
|
|
||||||
def sequence_interpolant(v,p=None,ctx=None):
|
def sequence_interpolant(v,p=None,ctx=None):
|
||||||
"""Compute interpolant for a sequence of formulas.
|
"""Compute interpolant for a sequence of formulas.
|
||||||
|
@ -7664,6 +7675,10 @@ def sequence_interpolant(v,p=None,ctx=None):
|
||||||
If a & b is satisfiable, raises an object of class ModelRef
|
If a & b is satisfiable, raises an object of class ModelRef
|
||||||
that represents a model of a & b.
|
that represents a model of a & b.
|
||||||
|
|
||||||
|
If neither a proof of unsatisfiability nor a model is obtained
|
||||||
|
(for example, because of a timeout, or because models are disabled)
|
||||||
|
then None is returned.
|
||||||
|
|
||||||
If parameters p are supplied, these are used in creating the
|
If parameters p are supplied, these are used in creating the
|
||||||
solver that determines satisfiability.
|
solver that determines satisfiability.
|
||||||
|
|
||||||
|
|
|
@ -543,6 +543,7 @@ br_status fpa_rewriter::mk_round_to_integral(expr * arg1, expr * arg2, expr_ref
|
||||||
// This the floating point theory ==
|
// This the floating point theory ==
|
||||||
br_status fpa_rewriter::mk_float_eq(expr * arg1, expr * arg2, expr_ref & result) {
|
br_status fpa_rewriter::mk_float_eq(expr * arg1, expr * arg2, expr_ref & result) {
|
||||||
scoped_mpf v1(m_fm), v2(m_fm);
|
scoped_mpf v1(m_fm), v2(m_fm);
|
||||||
|
|
||||||
if (m_util.is_numeral(arg1, v1) && m_util.is_numeral(arg2, v2)) {
|
if (m_util.is_numeral(arg1, v1) && m_util.is_numeral(arg2, v2)) {
|
||||||
result = (m_fm.eq(v1, v2)) ? m().mk_true() : m().mk_false();
|
result = (m_fm.eq(v1, v2)) ? m().mk_true() : m().mk_false();
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue