mirror of
https://github.com/Z3Prover/z3
synced 2025-04-13 04:28:17 +00:00
Merge branch 'unstable' of https://git01.codeplex.com/z3 into unstable
This commit is contained in:
commit
1dfea1324e
|
@ -26,6 +26,10 @@ Version 4.3.2
|
|||
|
||||
- Fixed crash reported at http://z3.codeplex.com/workitem/10
|
||||
|
||||
- Removed auxiliary constants created by the nnf tactic from Z3 models.
|
||||
|
||||
- Fixed problem in the pretty printer. It was not introducing quotes for attribute names such as |foo:10|.
|
||||
|
||||
Version 4.3.1
|
||||
=============
|
||||
|
||||
|
|
|
@ -75,6 +75,8 @@ VER_BUILD=None
|
|||
VER_REVISION=None
|
||||
PREFIX='/usr'
|
||||
GMP=False
|
||||
VS_PAR=False
|
||||
VS_PAR_NUM=8
|
||||
|
||||
def is_windows():
|
||||
return IS_WINDOWS
|
||||
|
@ -362,6 +364,8 @@ def display_help(exit_code):
|
|||
if not IS_WINDOWS:
|
||||
print " -p <dir>, --prefix=<dir> installation prefix (default: %s)." % PREFIX
|
||||
print " -y <dir>, --pydir=<dir> installation prefix for Z3 python bindings (default: %s)." % PYTHON_PACKAGE_DIR
|
||||
else:
|
||||
print " --parallel=num use cl option /MP with 'num' parallel processes"
|
||||
print " -b <sudir>, --build=<subdir> subdirectory where Z3 will be built (default: build)."
|
||||
print " -d, --debug compile Z3 in debug mode."
|
||||
print " -t, --trace enable tracing in release mode."
|
||||
|
@ -391,13 +395,13 @@ def display_help(exit_code):
|
|||
|
||||
# Parse configuration option for mk_make script
|
||||
def parse_options():
|
||||
global VERBOSE, DEBUG_MODE, IS_WINDOWS, VS_X64, ONLY_MAKEFILES, SHOW_CPPS, VS_PROJ, TRACE
|
||||
global VERBOSE, DEBUG_MODE, IS_WINDOWS, VS_X64, ONLY_MAKEFILES, SHOW_CPPS, VS_PROJ, TRACE, VS_PAR, VS_PAR_NUM
|
||||
global DOTNET_ENABLED, JAVA_ENABLED, STATIC_LIB, PREFIX, GMP, PYTHON_PACKAGE_DIR
|
||||
try:
|
||||
options, remainder = getopt.gnu_getopt(sys.argv[1:],
|
||||
'b:dsxhmcvtnp:gjy:',
|
||||
['build=', 'debug', 'silent', 'x64', 'help', 'makefiles', 'showcpp', 'vsproj',
|
||||
'trace', 'nodotnet', 'staticlib', 'prefix=', 'gmp', 'java', 'pydir='])
|
||||
'trace', 'nodotnet', 'staticlib', 'prefix=', 'gmp', 'java', 'pydir=', 'parallel='])
|
||||
except:
|
||||
print "ERROR: Invalid command line option"
|
||||
display_help(1)
|
||||
|
@ -429,8 +433,11 @@ def parse_options():
|
|||
DOTNET_ENABLED = False
|
||||
elif opt in ('--staticlib'):
|
||||
STATIC_LIB = True
|
||||
elif opt in ('-p', '--prefix'):
|
||||
elif not IS_WINDOWS and opt in ('-p', '--prefix'):
|
||||
PREFIX = arg
|
||||
elif IS_WINDOWS and opt == '--parallel':
|
||||
VS_PAR = True
|
||||
VS_PAR_NUM = int(arg)
|
||||
elif opt in ('-y', '--pydir'):
|
||||
PYTHON_PACKAGE_DIR = arg
|
||||
mk_dir(PYTHON_PACKAGE_DIR)
|
||||
|
@ -656,8 +663,32 @@ class Component:
|
|||
out.write(' -I%s' % get_component(dep).to_src_dir)
|
||||
out.write('\n')
|
||||
mk_dir(os.path.join(BUILD_DIR, self.build_dir))
|
||||
for cppfile in get_cpp_files(self.src_dir):
|
||||
self.add_cpp_rules(out, include_defs, cppfile)
|
||||
if VS_PAR and IS_WINDOWS:
|
||||
cppfiles = get_cpp_files(self.src_dir)
|
||||
dependencies = set()
|
||||
for cppfile in cppfiles:
|
||||
dependencies.add(os.path.join(self.to_src_dir, cppfile))
|
||||
self.add_rule_for_each_include(out, cppfile)
|
||||
includes = extract_c_includes(os.path.join(self.src_dir, cppfile))
|
||||
for include in includes:
|
||||
owner = self.find_file(include, cppfile)
|
||||
dependencies.add('%s.node' % os.path.join(owner.build_dir, include))
|
||||
for cppfile in cppfiles:
|
||||
out.write('%s$(OBJ_EXT) ' % os.path.join(self.build_dir, os.path.splitext(cppfile)[0]))
|
||||
out.write(': ')
|
||||
for dep in dependencies:
|
||||
out.write(dep)
|
||||
out.write(' ')
|
||||
out.write('\n')
|
||||
out.write('\t@$(CXX) $(CXXFLAGS) /MP%s $(%s)' % (VS_PAR_NUM, include_defs))
|
||||
for cppfile in cppfiles:
|
||||
out.write(' ')
|
||||
out.write(os.path.join(self.to_src_dir, cppfile))
|
||||
out.write('\n')
|
||||
out.write('\tmove *.obj %s\n' % self.build_dir)
|
||||
else:
|
||||
for cppfile in get_cpp_files(self.src_dir):
|
||||
self.add_cpp_rules(out, include_defs, cppfile)
|
||||
|
||||
# Return true if the component should be included in the all: rule
|
||||
def main_component(self):
|
||||
|
@ -933,10 +964,8 @@ class DLLComponent(Component):
|
|||
mk_dir(os.path.join(dist_path, 'bin'))
|
||||
shutil.copy('%s.dll' % os.path.join(build_path, self.dll_name),
|
||||
'%s.dll' % os.path.join(dist_path, 'bin', self.dll_name))
|
||||
if self.static:
|
||||
mk_dir(os.path.join(dist_path, 'bin'))
|
||||
shutil.copy('%s.lib' % os.path.join(build_path, self.dll_name),
|
||||
'%s.lib' % os.path.join(dist_path, 'bin', self.dll_name))
|
||||
shutil.copy('%s.lib' % os.path.join(build_path, self.dll_name),
|
||||
'%s.lib' % os.path.join(dist_path, 'bin', self.dll_name))
|
||||
|
||||
class DotNetDLLComponent(Component):
|
||||
def __init__(self, name, dll_name, path, deps, assembly_info_dir):
|
||||
|
@ -1042,6 +1071,11 @@ class JavaDLLComponent(Component):
|
|||
def main_component(self):
|
||||
return is_java_enabled()
|
||||
|
||||
def mk_win_dist(self, build_path, dist_path):
|
||||
if JAVA_ENABLED:
|
||||
mk_dir(os.path.join(dist_path, 'bin'))
|
||||
shutil.copy('%s.jar' % os.path.join(build_path, self.package_name),
|
||||
'%s.jar' % os.path.join(dist_path, 'bin', self.package_name))
|
||||
|
||||
class ExampleComponent(Component):
|
||||
def __init__(self, name, path):
|
||||
|
@ -1250,12 +1284,12 @@ def mk_config():
|
|||
'SLINK_FLAGS=/nologo /LDd\n')
|
||||
if not VS_X64:
|
||||
config.write(
|
||||
'CXXFLAGS=/c /Zi /nologo /openmp /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D Z3DEBUG /D _CONSOLE /D _TRACE /D _WINDOWS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /analyze- /arch:SSE2\n'
|
||||
'CXXFLAGS=/c /Zi /nologo /openmp /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D Z3DEBUG /D _CONSOLE /D _TRACE /D _WINDOWS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /analyze- /arch:SSE2\n'
|
||||
'LINK_EXTRA_FLAGS=/link /DEBUG /MACHINE:X86 /SUBSYSTEM:CONSOLE /INCREMENTAL:NO /STACK:8388608 /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT\n'
|
||||
'SLINK_EXTRA_FLAGS=/link /DEBUG /MACHINE:X86 /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /STACK:8388608 /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE:NO\n')
|
||||
else:
|
||||
config.write(
|
||||
'CXXFLAGS=/c /Zi /nologo /openmp /W3 /WX- /Od /Oy- /D WIN32 /D _AMD64_ /D _DEBUG /D Z3DEBUG /D _CONSOLE /D _TRACE /D _WINDOWS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /analyze-\n'
|
||||
'CXXFLAGS=/c /Zi /nologo /openmp /W3 /WX- /Od /Oy- /D WIN32 /D _AMD64_ /D _DEBUG /D Z3DEBUG /D _CONSOLE /D _TRACE /D _WINDOWS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /analyze-\n'
|
||||
'LINK_EXTRA_FLAGS=/link /DEBUG /MACHINE:X64 /SUBSYSTEM:CONSOLE /INCREMENTAL:NO /STACK:8388608 /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT\n'
|
||||
'SLINK_EXTRA_FLAGS=/link /DEBUG /MACHINE:X64 /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /STACK:8388608 /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE:NO\n')
|
||||
else:
|
||||
|
|
|
@ -16,13 +16,15 @@ import subprocess
|
|||
import zipfile
|
||||
from mk_exception import *
|
||||
from mk_project import *
|
||||
import mk_util
|
||||
|
||||
BUILD_DIR='build-dist'
|
||||
BUILD_X64_DIR='build-dist/x64'
|
||||
BUILD_X86_DIR='build-dist/x86'
|
||||
BUILD_X64_DIR=os.path.join('build-dist', 'x64')
|
||||
BUILD_X86_DIR=os.path.join('build-dist', 'x86')
|
||||
VERBOSE=True
|
||||
DIST_DIR='dist'
|
||||
FORCE_MK=False
|
||||
JAVA_ENABLED=True
|
||||
|
||||
def set_verbose(flag):
|
||||
global VERBOSE
|
||||
|
@ -38,8 +40,8 @@ def mk_dir(d):
|
|||
def set_build_dir(path):
|
||||
global BUILD_DIR
|
||||
BUILD_DIR = path
|
||||
BUILD_X86_DIR = '%s/x86' % path
|
||||
BUILD_X64_DIR = '%s/x64' % path
|
||||
BUILD_X86_DIR = os.path.join(path, 'x86')
|
||||
BUILD_X64_DIR = os.path.join(path, 'x64')
|
||||
mk_dir(BUILD_X86_DIR)
|
||||
mk_dir(BUILD_X64_DIR)
|
||||
|
||||
|
@ -52,16 +54,18 @@ def display_help():
|
|||
print " -s, --silent do not print verbose messages."
|
||||
print " -b <sudir>, --build=<subdir> subdirectory where x86 and x64 Z3 versions will be built (default: build-dist)."
|
||||
print " -f, --force force script to regenerate Makefiles."
|
||||
print " --nojava do not include Java bindings in the binary distribution files."
|
||||
exit(0)
|
||||
|
||||
# Parse configuration option for mk_make script
|
||||
def parse_options():
|
||||
global FORCE_MK
|
||||
global FORCE_MK, JAVA_ENABLED
|
||||
path = BUILD_DIR
|
||||
options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:hsf', ['build=',
|
||||
'help',
|
||||
'silent',
|
||||
'force'
|
||||
'force',
|
||||
'nojava'
|
||||
])
|
||||
for opt, arg in options:
|
||||
if opt in ('-b', '--build'):
|
||||
|
@ -74,18 +78,22 @@ def parse_options():
|
|||
display_help()
|
||||
elif opt in ('-f', '--force'):
|
||||
FORCE_MK = True
|
||||
elif opt == '--nojava':
|
||||
JAVA_ENABLED = False
|
||||
else:
|
||||
raise MKException("Invalid command line option '%s'" % opt)
|
||||
set_build_dir(path)
|
||||
|
||||
# Check whether build directory already exists or not
|
||||
def check_build_dir(path):
|
||||
return os.path.exists(path) and os.path.exists('%s/Makefile' % path)
|
||||
return os.path.exists(path) and os.path.exists(os.path.join(path, 'Makefile'))
|
||||
|
||||
# Create a build directory using mk_make.py
|
||||
def mk_build_dir(path, x64):
|
||||
if not check_build_dir(path) or FORCE_MK:
|
||||
opts = ["python", "scripts/mk_make.py", "-b", path]
|
||||
opts = ["python", os.path.join('scripts', 'mk_make.py'), "-b", path]
|
||||
if JAVA_ENABLED:
|
||||
opts.append('--java')
|
||||
if x64:
|
||||
opts.append('-x')
|
||||
if subprocess.call(opts) != 0:
|
||||
|
@ -147,8 +155,12 @@ def mk_dist_dir_core(x64):
|
|||
else:
|
||||
platform = "x86"
|
||||
build_path = BUILD_X86_DIR
|
||||
dist_path = '%s/z3-%s.%s.%s-%s' % (DIST_DIR, major, minor, build, platform)
|
||||
dist_path = os.path.join(DIST_DIR, 'z3-%s.%s.%s-%s' % (major, minor, build, platform))
|
||||
mk_dir(dist_path)
|
||||
if JAVA_ENABLED:
|
||||
# HACK: Propagate JAVA_ENABLED flag to mk_util
|
||||
# TODO: fix this hack
|
||||
mk_util.JAVA_ENABLED = JAVA_ENABLED
|
||||
mk_win_dist(build_path, dist_path)
|
||||
if is_verbose():
|
||||
print "Generated %s distribution folder at '%s'" % (platform, dist_path)
|
||||
|
@ -225,7 +237,7 @@ def cp_vs_runtime_core(x64):
|
|||
path = '%sredist\\%s' % (vcdir, platform)
|
||||
VS_RUNTIME_FILES = []
|
||||
os.path.walk(path, cp_vs_runtime_visitor, '*.dll')
|
||||
bin_dist_path = '%s/%s/bin' % (DIST_DIR, get_dist_path(x64))
|
||||
bin_dist_path = os.path.join(DIST_DIR, get_dist_path(x64), 'bin')
|
||||
for f in VS_RUNTIME_FILES:
|
||||
shutil.copy(f, bin_dist_path)
|
||||
if is_verbose():
|
||||
|
@ -236,8 +248,8 @@ def cp_vs_runtime():
|
|||
cp_vs_runtime_core(False)
|
||||
|
||||
def cp_license():
|
||||
shutil.copy("LICENSE.txt", "%s/%s" % (DIST_DIR, get_dist_path(True)))
|
||||
shutil.copy("LICENSE.txt", "%s/%s" % (DIST_DIR, get_dist_path(False)))
|
||||
shutil.copy("LICENSE.txt", os.path.join(DIST_DIR, get_dist_path(True)))
|
||||
shutil.copy("LICENSE.txt", os.path.join(DIST_DIR, get_dist_path(False)))
|
||||
|
||||
# Entry point
|
||||
def main():
|
||||
|
|
9
scripts/trackall.sh
Executable file
9
scripts/trackall.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script for "cloning" (and tracking) all branches at codeplex.
|
||||
# On Windows, this script must be executed in the "git Bash" console.
|
||||
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
|
||||
git branch --track ${branch##*/} $branch
|
||||
done
|
||||
git fetch --all
|
||||
git pull --all
|
|
@ -501,7 +501,12 @@ class smt2_printer {
|
|||
}
|
||||
|
||||
format * pp_simple_attribute(char const * attr, symbol const & s) {
|
||||
return mk_compose(m(), mk_string(m(), attr), mk_string(m(), s.str().c_str()));
|
||||
std::string str;
|
||||
if (is_smt2_quoted_symbol(s))
|
||||
str = mk_smt2_quoted_symbol(s);
|
||||
else
|
||||
str = s.str();
|
||||
return mk_compose(m(), mk_string(m(), attr), mk_string(m(), str.c_str()));
|
||||
}
|
||||
|
||||
format * pp_labels(bool is_pos, buffer<symbol> const & names, format * f) {
|
||||
|
@ -851,7 +856,7 @@ class smt2_printer {
|
|||
buf.push_back(pp_simple_attribute(":weight ", q->get_weight()));
|
||||
}
|
||||
if (q->get_skid() != symbol::null) {
|
||||
buf.push_back(pp_simple_attribute(":skid ", q->get_skid()));
|
||||
buf.push_back(pp_simple_attribute(":skolemid ", q->get_skid()));
|
||||
}
|
||||
if (q->get_qid() != symbol::null) {
|
||||
#if 0
|
||||
|
|
|
@ -17,11 +17,67 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include"defined_names.h"
|
||||
#include"obj_hashtable.h"
|
||||
#include"used_vars.h"
|
||||
#include"var_subst.h"
|
||||
#include"ast_smt2_pp.h"
|
||||
#include"ast_pp.h"
|
||||
|
||||
struct defined_names::impl {
|
||||
typedef obj_map<expr, app *> expr2name;
|
||||
typedef obj_map<expr, proof *> expr2proof;
|
||||
ast_manager & m_manager;
|
||||
symbol m_z3name;
|
||||
|
||||
/**
|
||||
\brief Mapping from expressions to their names. A name is an application.
|
||||
If the expression does not have free variables, then the name is just a constant.
|
||||
*/
|
||||
expr2name m_expr2name;
|
||||
/**
|
||||
\brief Mapping from expressions to the apply-def proof.
|
||||
That is, for each expression e, m_expr2proof[e] is the
|
||||
proof e and m_expr2name[2] are observ. equivalent.
|
||||
|
||||
This mapping is not used if proof production is disabled.
|
||||
*/
|
||||
expr2proof m_expr2proof;
|
||||
|
||||
/**
|
||||
\brief Domain of m_expr2name. It is used to keep the expressions
|
||||
alive and for backtracking
|
||||
*/
|
||||
expr_ref_vector m_exprs;
|
||||
expr_ref_vector m_names; //!< Range of m_expr2name. It is used to keep the names alive.
|
||||
proof_ref_vector m_apply_proofs; //!< Range of m_expr2proof. It is used to keep the def-intro proofs alive.
|
||||
|
||||
|
||||
unsigned_vector m_lims; //!< Backtracking support.
|
||||
|
||||
impl(ast_manager & m, char const * prefix);
|
||||
virtual ~impl();
|
||||
|
||||
app * gen_name(expr * e, sort_ref_buffer & var_sorts, buffer<symbol> & var_names);
|
||||
void cache_new_name(expr * e, app * name);
|
||||
void cache_new_name_intro_proof(expr * e, proof * pr);
|
||||
void bound_vars(sort_ref_buffer const & sorts, buffer<symbol> const & names, expr * def_conjunct, app * name, expr_ref & result);
|
||||
void bound_vars(sort_ref_buffer const & sorts, buffer<symbol> const & names, expr * def_conjunct, app * name, expr_ref_buffer & result);
|
||||
virtual void mk_definition(expr * e, app * n, sort_ref_buffer & var_sorts, buffer<symbol> const & var_names, expr_ref & new_def);
|
||||
bool mk_name(expr * e, expr_ref & new_def, proof_ref & new_def_pr, app_ref & n, proof_ref & pr);
|
||||
void push_scope();
|
||||
void pop_scope(unsigned num_scopes);
|
||||
void reset();
|
||||
|
||||
unsigned get_num_names() const { return m_names.size(); }
|
||||
func_decl * get_name_decl(unsigned i) const { return to_app(m_names.get(i))->get_decl(); }
|
||||
};
|
||||
|
||||
struct defined_names::pos_impl : public defined_names::impl {
|
||||
pos_impl(ast_manager & m, char const * fresh_prefix):impl(m, fresh_prefix) {}
|
||||
virtual void mk_definition(expr * e, app * n, sort_ref_buffer & var_sorts, buffer<symbol> const & var_names, expr_ref & new_def);
|
||||
};
|
||||
|
||||
|
||||
defined_names::impl::impl(ast_manager & m, char const * prefix):
|
||||
m_manager(m),
|
||||
m_exprs(m),
|
||||
|
@ -222,5 +278,50 @@ void defined_names::impl::reset() {
|
|||
m_lims.reset();
|
||||
}
|
||||
|
||||
defined_names::defined_names(ast_manager & m, char const * fresh_prefix) {
|
||||
m_impl = alloc(impl, m, fresh_prefix);
|
||||
m_pos_impl = alloc(pos_impl, m, fresh_prefix);
|
||||
}
|
||||
|
||||
defined_names::~defined_names() {
|
||||
dealloc(m_impl);
|
||||
dealloc(m_pos_impl);
|
||||
}
|
||||
|
||||
bool defined_names::mk_name(expr * e, expr_ref & new_def, proof_ref & new_def_pr, app_ref & n, proof_ref & pr) {
|
||||
return m_impl->mk_name(e, new_def, new_def_pr, n, pr);
|
||||
}
|
||||
|
||||
bool defined_names::mk_pos_name(expr * e, expr_ref & new_def, proof_ref & new_def_pr, app_ref & n, proof_ref & pr) {
|
||||
return m_pos_impl->mk_name(e, new_def, new_def_pr, n, pr);
|
||||
}
|
||||
|
||||
void defined_names::push() {
|
||||
m_impl->push_scope();
|
||||
m_pos_impl->push_scope();
|
||||
}
|
||||
|
||||
void defined_names::pop(unsigned num_scopes) {
|
||||
m_impl->pop_scope(num_scopes);
|
||||
m_pos_impl->pop_scope(num_scopes);
|
||||
}
|
||||
|
||||
void defined_names::reset() {
|
||||
m_impl->reset();
|
||||
m_pos_impl->reset();
|
||||
}
|
||||
|
||||
unsigned defined_names::get_num_names() const {
|
||||
return m_impl->get_num_names() + m_pos_impl->get_num_names();
|
||||
}
|
||||
|
||||
func_decl * defined_names::get_name_decl(unsigned i) const {
|
||||
SASSERT(i < get_num_names());
|
||||
unsigned n1 = m_impl->get_num_names();
|
||||
return i < n1 ? m_impl->get_name_decl(i) : m_pos_impl->get_name_decl(i - n1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ Revision History:
|
|||
#define _DEFINED_NAMES_H_
|
||||
|
||||
#include"ast.h"
|
||||
#include"obj_hashtable.h"
|
||||
|
||||
/**
|
||||
\brief Mapping from expressions to skolem functions that are used to name them.
|
||||
|
@ -29,62 +28,13 @@ Revision History:
|
|||
The mapping supports backtracking using the methods #push_scope and #pop_scope.
|
||||
*/
|
||||
class defined_names {
|
||||
|
||||
struct impl {
|
||||
typedef obj_map<expr, app *> expr2name;
|
||||
typedef obj_map<expr, proof *> expr2proof;
|
||||
ast_manager & m_manager;
|
||||
symbol m_z3name;
|
||||
|
||||
/**
|
||||
\brief Mapping from expressions to their names. A name is an application.
|
||||
If the expression does not have free variables, then the name is just a constant.
|
||||
*/
|
||||
expr2name m_expr2name;
|
||||
/**
|
||||
\brief Mapping from expressions to the apply-def proof.
|
||||
That is, for each expression e, m_expr2proof[e] is the
|
||||
proof e and m_expr2name[2] are observ. equivalent.
|
||||
|
||||
This mapping is not used if proof production is disabled.
|
||||
*/
|
||||
expr2proof m_expr2proof;
|
||||
|
||||
/**
|
||||
\brief Domain of m_expr2name. It is used to keep the expressions
|
||||
alive and for backtracking
|
||||
*/
|
||||
expr_ref_vector m_exprs;
|
||||
expr_ref_vector m_names; //!< Range of m_expr2name. It is used to keep the names alive.
|
||||
proof_ref_vector m_apply_proofs; //!< Range of m_expr2proof. It is used to keep the def-intro proofs alive.
|
||||
|
||||
|
||||
unsigned_vector m_lims; //!< Backtracking support.
|
||||
|
||||
impl(ast_manager & m, char const * prefix);
|
||||
virtual ~impl();
|
||||
|
||||
app * gen_name(expr * e, sort_ref_buffer & var_sorts, buffer<symbol> & var_names);
|
||||
void cache_new_name(expr * e, app * name);
|
||||
void cache_new_name_intro_proof(expr * e, proof * pr);
|
||||
void bound_vars(sort_ref_buffer const & sorts, buffer<symbol> const & names, expr * def_conjunct, app * name, expr_ref & result);
|
||||
void bound_vars(sort_ref_buffer const & sorts, buffer<symbol> const & names, expr * def_conjunct, app * name, expr_ref_buffer & result);
|
||||
virtual void mk_definition(expr * e, app * n, sort_ref_buffer & var_sorts, buffer<symbol> const & var_names, expr_ref & new_def);
|
||||
bool mk_name(expr * e, expr_ref & new_def, proof_ref & new_def_pr, app_ref & n, proof_ref & pr);
|
||||
void push_scope();
|
||||
void pop_scope(unsigned num_scopes);
|
||||
void reset();
|
||||
};
|
||||
|
||||
struct pos_impl : public impl {
|
||||
pos_impl(ast_manager & m, char const * fresh_prefix):impl(m, fresh_prefix) {}
|
||||
virtual void mk_definition(expr * e, app * n, sort_ref_buffer & var_sorts, buffer<symbol> const & var_names, expr_ref & new_def);
|
||||
};
|
||||
|
||||
impl m_impl;
|
||||
pos_impl m_pos_impl;
|
||||
struct impl;
|
||||
struct pos_impl;
|
||||
impl * m_impl;
|
||||
pos_impl * m_pos_impl;
|
||||
public:
|
||||
defined_names(ast_manager & m, char const * fresh_prefix = "z3name"):m_impl(m, fresh_prefix), m_pos_impl(m, fresh_prefix) {}
|
||||
defined_names(ast_manager & m, char const * fresh_prefix = "z3name");
|
||||
~defined_names();
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
@ -113,9 +63,7 @@ public:
|
|||
|
||||
Remark: the definitions are closed with an universal quantifier if e contains free variables.
|
||||
*/
|
||||
bool mk_name(expr * e, expr_ref & new_def, proof_ref & new_def_pr, app_ref & n, proof_ref & pr) {
|
||||
return m_impl.mk_name(e, new_def, new_def_pr, n, pr);
|
||||
}
|
||||
bool mk_name(expr * e, expr_ref & new_def, proof_ref & new_def_pr, app_ref & n, proof_ref & pr);
|
||||
|
||||
/**
|
||||
\brief Create a name for a positive occurrence of the expression \c e.
|
||||
|
@ -127,24 +75,14 @@ public:
|
|||
|
||||
Remark: the definitions are closed with an universal quantifier if e contains free variables.
|
||||
*/
|
||||
bool mk_pos_name(expr * e, expr_ref & new_def, proof_ref & new_def_pr, app_ref & n, proof_ref & pr) {
|
||||
return m_pos_impl.mk_name(e, new_def, new_def_pr, n, pr);
|
||||
}
|
||||
bool mk_pos_name(expr * e, expr_ref & new_def, proof_ref & new_def_pr, app_ref & n, proof_ref & pr);
|
||||
|
||||
void push_scope() {
|
||||
m_impl.push_scope();
|
||||
m_pos_impl.push_scope();
|
||||
}
|
||||
void push();
|
||||
void pop(unsigned num_scopes);
|
||||
void reset();
|
||||
|
||||
void pop_scope(unsigned num_scopes) {
|
||||
m_impl.pop_scope(num_scopes);
|
||||
m_pos_impl.pop_scope(num_scopes);
|
||||
}
|
||||
|
||||
void reset() {
|
||||
m_impl.reset();
|
||||
m_pos_impl.reset();
|
||||
}
|
||||
unsigned get_num_names() const;
|
||||
func_decl * get_name_decl(unsigned i) const;
|
||||
};
|
||||
|
||||
#endif /* _DEFINED_NAMES_H_ */
|
||||
|
|
|
@ -333,7 +333,7 @@ namespace datalog {
|
|||
smt::quantifier_manager* qm = ctx.get_quantifier_manager();
|
||||
qm->get_plugin()->set_instance_plugin(alloc(instance_plugin, *this));
|
||||
#endif
|
||||
lbool res = solver.check();
|
||||
solver.check();
|
||||
|
||||
for (unsigned i = 0; i < m_bindings.size(); ++i) {
|
||||
expr_ref_vector& binding = m_bindings[i];
|
||||
|
|
|
@ -981,6 +981,14 @@ namespace nlsat {
|
|||
bool atom_val = a->get_kind() == atom::EQ;
|
||||
bool lit_val = l.sign() ? !atom_val : atom_val;
|
||||
new_lit = lit_val ? true_literal : false_literal;
|
||||
if (!info.m_lc_const) {
|
||||
// We have essentially shown the current factor must be zero If the leading coefficient is not zero.
|
||||
// Note that, if the current factor is zero, then the whole polynomial is zero.
|
||||
// The atom is true if it is an equality, and false otherwise.
|
||||
// The sign of the leading coefficient (info.m_lc) of info.m_eq doesn't matter.
|
||||
// However, we have to store the fact it is not zero.
|
||||
info.add_lc_diseq();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (s == -1 && !is_even) {
|
||||
|
@ -1341,3 +1349,32 @@ namespace nlsat {
|
|||
}
|
||||
|
||||
};
|
||||
|
||||
#ifdef Z3DEBUG
|
||||
void pp(nlsat::explain::imp & ex, unsigned num, nlsat::literal const * ls) {
|
||||
ex.display(std::cout, num, ls);
|
||||
}
|
||||
void pp(nlsat::explain::imp & ex, nlsat::scoped_literal_vector & ls) {
|
||||
ex.display(std::cout, ls);
|
||||
}
|
||||
void pp(nlsat::explain::imp & ex, polynomial_ref const & p) {
|
||||
ex.display(std::cout, p);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
void pp(nlsat::explain::imp & ex, polynomial::polynomial * p) {
|
||||
polynomial_ref _p(p, ex.m_pm);
|
||||
ex.display(std::cout, _p);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
void pp(nlsat::explain::imp & ex, polynomial_ref_vector const & ps) {
|
||||
ex.display(std::cout, ps);
|
||||
}
|
||||
void pp_var(nlsat::explain::imp & ex, nlsat::var x) {
|
||||
ex.display(std::cout, x);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
void pp_lit(nlsat::explain::imp & ex, nlsat::literal l) {
|
||||
ex.display(std::cout, l);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,9 @@ namespace nlsat {
|
|||
class evaluator;
|
||||
|
||||
class explain {
|
||||
public:
|
||||
struct imp;
|
||||
private:
|
||||
imp * m_imp;
|
||||
public:
|
||||
explain(solver & s, assignment const & x2v, polynomial::cache & u, atom_vector const & atoms, atom_vector const & x2eq,
|
||||
|
|
|
@ -189,7 +189,7 @@ void asserted_formulas::push_scope() {
|
|||
s.m_asserted_formulas_lim = m_asserted_formulas.size();
|
||||
SASSERT(inconsistent() || s.m_asserted_formulas_lim == m_asserted_qhead);
|
||||
s.m_inconsistent_old = m_inconsistent;
|
||||
m_defined_names.push_scope();
|
||||
m_defined_names.push();
|
||||
m_bv_sharing.push_scope();
|
||||
commit();
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ void asserted_formulas::pop_scope(unsigned num_scopes) {
|
|||
unsigned new_lvl = m_scopes.size() - num_scopes;
|
||||
scope & s = m_scopes[new_lvl];
|
||||
m_inconsistent = s.m_inconsistent_old;
|
||||
m_defined_names.pop_scope(num_scopes);
|
||||
m_defined_names.pop(num_scopes);
|
||||
m_asserted_formulas.shrink(s.m_asserted_formulas_lim);
|
||||
if (m_manager.proofs_enabled())
|
||||
m_asserted_formula_prs.shrink(s.m_asserted_formulas_lim);
|
||||
|
|
|
@ -52,8 +52,6 @@ struct qi_params {
|
|||
bool m_mbqi_trace;
|
||||
unsigned m_mbqi_force_template;
|
||||
|
||||
bool m_instgen;
|
||||
|
||||
qi_params(params_ref const & p = params_ref()):
|
||||
/*
|
||||
The "weight 0" performance bug
|
||||
|
@ -99,8 +97,7 @@ struct qi_params {
|
|||
m_mbqi_max_cexs_incr(1),
|
||||
m_mbqi_max_iterations(1000),
|
||||
m_mbqi_trace(false),
|
||||
m_mbqi_force_template(10),
|
||||
m_instgen(false) {
|
||||
m_mbqi_force_template(10) {
|
||||
updt_params(p);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ Revision History:
|
|||
--*/
|
||||
#include"smt_params.h"
|
||||
#include"smt_params_helper.hpp"
|
||||
#include"model_params.hpp"
|
||||
|
||||
void smt_params::updt_local_params(params_ref const & _p) {
|
||||
smt_params_helper p(_p);
|
||||
|
@ -33,6 +34,8 @@ void smt_params::updt_local_params(params_ref const & _p) {
|
|||
m_delay_units_threshold = p.delay_units_threshold();
|
||||
m_preprocess = _p.get_bool("preprocess", true); // hidden parameter
|
||||
m_soft_timeout = p.soft_timeout();
|
||||
model_params mp(_p);
|
||||
m_model_compact = mp.compact();
|
||||
if (_p.get_bool("arith.greatest_error_pivot", false))
|
||||
m_arith_pivot_strategy = ARITH_PIVOT_GREATEST_ERROR;
|
||||
else if (_p.get_bool("arith.least_error_pivot", false))
|
||||
|
@ -50,5 +53,4 @@ void smt_params::updt_params(params_ref const & p) {
|
|||
void smt_params::updt_params(context_params const & p) {
|
||||
m_auto_config = p.m_auto_config;
|
||||
m_model = p.m_model;
|
||||
m_model_validate = p.m_model_validate;
|
||||
}
|
||||
|
|
|
@ -177,7 +177,6 @@ struct smt_params : public preprocessor_params,
|
|||
// -----------------------------------
|
||||
bool m_model;
|
||||
bool m_model_compact;
|
||||
bool m_model_validate;
|
||||
bool m_model_on_timeout;
|
||||
bool m_model_on_final_check;
|
||||
|
||||
|
@ -264,7 +263,6 @@ struct smt_params : public preprocessor_params,
|
|||
m_abort_after_preproc(false),
|
||||
m_model(true),
|
||||
m_model_compact(false),
|
||||
m_model_validate(false),
|
||||
m_model_on_timeout(false),
|
||||
m_model_on_final_check(false),
|
||||
m_progress_sampling_freq(0),
|
||||
|
|
|
@ -23,7 +23,6 @@ Revision History:
|
|||
#include"ast_smt2_pp.h"
|
||||
#include"smt_model_finder.h"
|
||||
#include"for_each_expr.h"
|
||||
#include"theory_instgen.h"
|
||||
|
||||
namespace smt {
|
||||
|
||||
|
@ -530,11 +529,6 @@ namespace smt {
|
|||
SASSERT(!b_internalized(q));
|
||||
SASSERT(q->is_forall());
|
||||
SASSERT(check_patterns(q));
|
||||
if (m_fparams.m_instgen) {
|
||||
theory* th = m_theories.get_plugin(m_manager.get_family_id("inst_gen"));
|
||||
static_cast<theory_instgen*>(th)->internalize_quantifier(q);
|
||||
return;
|
||||
}
|
||||
bool_var v = mk_bool_var(q);
|
||||
unsigned generation = m_generation;
|
||||
unsigned _generation;
|
||||
|
|
|
@ -28,7 +28,6 @@ Revision History:
|
|||
#include"theory_datatype.h"
|
||||
#include"theory_dummy.h"
|
||||
#include"theory_dl.h"
|
||||
#include"theory_instgen.h"
|
||||
#include"theory_seq_empty.h"
|
||||
|
||||
namespace smt {
|
||||
|
@ -772,11 +771,6 @@ namespace smt {
|
|||
void setup::setup_seq() {
|
||||
m_context.register_plugin(alloc(theory_seq_empty, m_manager));
|
||||
}
|
||||
void setup::setup_instgen() {
|
||||
if (m_params.m_instgen) {
|
||||
m_context.register_plugin(mk_theory_instgen(m_manager, m_params));
|
||||
}
|
||||
}
|
||||
|
||||
void setup::setup_unknown() {
|
||||
setup_arith();
|
||||
|
@ -784,7 +778,6 @@ namespace smt {
|
|||
setup_bv();
|
||||
setup_datatypes();
|
||||
setup_dl();
|
||||
setup_instgen();
|
||||
setup_seq();
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,45 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2011 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
theory_instgen.h
|
||||
|
||||
Abstract:
|
||||
|
||||
InstGen (iProver) style theory solver.
|
||||
It provides an instantiation based engine
|
||||
based on InstGen methods together with
|
||||
unit propagation.
|
||||
|
||||
|
||||
Author:
|
||||
|
||||
Krystof Hoder (t-khoder)
|
||||
Nikolaj Bjorner (nbjorner) 2011-10-6
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#ifndef _THEORY_INST_GEN_H_
|
||||
#define _THEORY_INST_GEN_H_
|
||||
|
||||
#include "smt_theory.h"
|
||||
#include "smt_params.h"
|
||||
|
||||
namespace smt {
|
||||
|
||||
class theory_instgen : public theory {
|
||||
public:
|
||||
theory_instgen(family_id fid) : theory(fid) {}
|
||||
virtual ~theory_instgen() {}
|
||||
virtual void internalize_quantifier(quantifier* q) = 0;
|
||||
virtual char const * get_name() const { return "instgen"; }
|
||||
};
|
||||
|
||||
theory_instgen* mk_theory_instgen(ast_manager& m, smt_params& p);
|
||||
|
||||
};
|
||||
|
||||
#endif /* _THEORY_INST_GEN_H_ */
|
||||
|
|
@ -18,7 +18,7 @@ Notes:
|
|||
--*/
|
||||
#include"ctx_simplify_tactic.h"
|
||||
#include"mk_simplified_app.h"
|
||||
#include"num_occurs_goal.h"
|
||||
#include"goal_num_occurs.h"
|
||||
#include"cooperate.h"
|
||||
#include"ast_ll_pp.h"
|
||||
#include"ast_smt2_pp.h"
|
||||
|
@ -51,7 +51,7 @@ struct ctx_simplify_tactic::imp {
|
|||
unsigned m_scope_lvl;
|
||||
unsigned m_depth;
|
||||
unsigned m_num_steps;
|
||||
num_occurs_goal m_occs;
|
||||
goal_num_occurs m_occs;
|
||||
mk_simplified_app m_mk_app;
|
||||
unsigned long long m_max_memory;
|
||||
unsigned m_max_depth;
|
||||
|
|
|
@ -18,6 +18,7 @@ Revision History:
|
|||
--*/
|
||||
#include"nnf.h"
|
||||
#include"tactical.h"
|
||||
#include"filter_model_converter.h"
|
||||
|
||||
class nnf_tactic : public tactic {
|
||||
params_ref m_params;
|
||||
|
@ -100,6 +101,13 @@ public:
|
|||
}
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
unsigned num_extra_names = dnames.get_num_names();
|
||||
if (num_extra_names > 0) {
|
||||
filter_model_converter * fmc = alloc(filter_model_converter, m);
|
||||
mc = fmc;
|
||||
for (unsigned i = 0; i < num_extra_names; i++)
|
||||
fmc->insert(dnames.get_name_decl(i));
|
||||
}
|
||||
TRACE("nnf", g->display(tout););
|
||||
SASSERT(g->is_well_sorted());
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ Copyright (c) 2012 Microsoft Corporation
|
|||
|
||||
Module Name:
|
||||
|
||||
num_occurs_goal.cpp
|
||||
goal_num_occurs.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
|
@ -15,10 +15,10 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"num_occurs_goal.h"
|
||||
#include"goal_num_occurs.h"
|
||||
#include"goal.h"
|
||||
|
||||
void num_occurs_goal::operator()(goal const & g) {
|
||||
void goal_num_occurs::operator()(goal const & g) {
|
||||
expr_fast_mark1 visited;
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
|
@ -3,7 +3,7 @@ Copyright (c) 2012 Microsoft Corporation
|
|||
|
||||
Module Name:
|
||||
|
||||
num_occurs_goal.h
|
||||
goal_num_occurs.h
|
||||
|
||||
Abstract:
|
||||
|
||||
|
@ -15,16 +15,16 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#ifndef _NUM_OCCURS_GOAL_H_
|
||||
#define _NUM_OCCURS_GOAL_H_
|
||||
#ifndef _GOAL_NUM_OCCURS_H_
|
||||
#define _GOAL_NUM_OCCURS_H_
|
||||
|
||||
#include"num_occurs.h"
|
||||
|
||||
class goal;
|
||||
|
||||
class num_occurs_goal : public num_occurs {
|
||||
class goal_num_occurs : public num_occurs {
|
||||
public:
|
||||
num_occurs_goal(bool ignore_ref_count1 = false, bool ignore_quantifiers = false):
|
||||
goal_num_occurs(bool ignore_ref_count1 = false, bool ignore_quantifiers = false):
|
||||
num_occurs(ignore_ref_count1, ignore_quantifiers) {
|
||||
}
|
||||
|
Loading…
Reference in a new issue