Commits

Anonymous committed 703c0d4 Merge

Merge branch 'working' of https://z3-1/gw/git/z3 into working

Comments (0)

Files changed (56)

 ## -lrt is for timer_create and timer_settime
 LDFLAGS=@LDFLAGS@ -lpthread -fopenmp
 LDFLAGS_EXTRA=
+PREFIX=@prefix@
+HAS_PYTHON=@HAS_PYTHON@
+PYTHON_PACKAGE_DIR=@PYTHON_PACKAGE_DIR@
+PYTHON=@PYTHON@
 #########################
 
 Z3=z3
 
 ################################
 #
-# Release
-# 
-# NOTE: In 64-bit systems it is not possible to build a dynamic library using static gmp.
-# So, EXTRA_LIBS="" in 64-bit systems.
-#     EXTRA_LIBS="$(BIN_DIR)/lib$(Z3)-gmp.so" in 32-bit systems.
-#
-# Remark: disable ocaml bindings in the release.
-# They will be re-enabled in the future. 
-# To re-enable them, I just have to include ocamlrelease in the list of dependencies.
-# I had to disable them because the stub generator uses non-portable scripts, and
-# were not included at z3.codeplex.com. Thus, this part is temporarily broken.  
-#
-# iZ3 is also temporarily removed from the release package. To re-enable it, we just have to include iz3release in the
-# list of dependencies.
-#
-# I also permanently removed test_user_theory example. Now, that the source code
-# is available, we don't need it anymore.
-#
-################################
-release: $(BIN_DIR)/$(Z3) $(BIN_DIR)/lib$(Z3).@SO_EXT@ @EXTRA_LIBS@ $(BIN_DIR)/lib$(Z3).a
-	@rm -f -r z3
-	@mkdir -p z3
-	@mkdir -p z3/bin
-	@mkdir -p z3/lib
-	@mkdir -p z3/include
-	@mkdir -p z3/examples
-	@mkdir -p z3/python
-	@mkdir -p z3/examples/c	
-	@mkdir -p z3/examples/c++	
-	@mkdir -p z3/examples/python
-	@mkdir -p z3/examples/maxsat	
-	@cp lib/z3.h z3/include
-	@cp lib/z3_v1.h z3/include
-	@cp lib/z3_api.h z3/include
-	@cp lib/z3_macros.h z3/include
-	@$(DOS2UNIX) z3/include/*
-	@cp $(BIN_DIR)/$(Z3) z3/bin
-	@cp $(BIN_DIR)/lib$(Z3).@SO_EXT@ z3/lib
-	@cp $(BIN_DIR)/lib$(Z3).a z3/lib
-	@cp test_capi/test_capi.c z3/examples/c
-	@$(DOS2UNIX) z3/examples/c/test_capi.c
-	@cp test_capi/README-$(PLATFORM).txt z3/examples/c/README
-	@$(DOS2UNIX) z3/examples/c/README
-	@cp test_capi/build-external-$(PLATFORM).sh z3/examples/c/build.sh
-	@cp test_capi/build-static-$(PLATFORM).sh z3/examples/c/build-static.sh
-	@$(DOS2UNIX) z3/examples/c/build.sh
-	@chmod +rwx z3/examples/c/build.sh
-	@$(DOS2UNIX) z3/examples/c/build-static.sh
-	@chmod +rwx z3/examples/c/build-static.sh
-	@cp test_capi/exec-external-$(PLATFORM).sh z3/examples/c/exec.sh
-	@$(DOS2UNIX) z3/examples/c/exec.sh
-	@chmod +rwx z3/examples/c/exec.sh
-	@cp maxsat/maxsat.c z3/examples/maxsat
-	@$(DOS2UNIX) z3/examples/maxsat/maxsat.c
-	@cp maxsat/README-$(PLATFORM).txt z3/examples/maxsat/README
-	@$(DOS2UNIX) z3/examples/maxsat/README
-	@cp maxsat/build-external-$(PLATFORM).sh z3/examples/maxsat/build.sh
-	@cp maxsat/build-static-$(PLATFORM).sh z3/examples/maxsat/build-static.sh
-	@$(DOS2UNIX) z3/examples/maxsat/build.sh
-	@chmod +rwx z3/examples/maxsat/build.sh
-	@$(DOS2UNIX) z3/examples/maxsat/build-static.sh
-	@chmod +rwx z3/examples/maxsat/build-static.sh
-	@cp maxsat/exec-external-$(PLATFORM).sh z3/examples/maxsat/exec.sh
-	@$(DOS2UNIX) z3/examples/maxsat/exec.sh
-	@chmod +rwx z3/examples/maxsat/exec.sh
-	@cp c++/z3++.h z3/include
-	@cp c++/example.cpp z3/examples/c++
-	@cp c++/build-external-$(PLATFORM).sh z3/examples/c++/build.sh
-	@$(DOS2UNIX) z3/examples/c++/build.sh
-	@chmod +rwx z3/examples/c++/build.sh
-	@cp c++/exec-external-$(PLATFORM).sh z3/examples/c++/exec.sh
-	@$(DOS2UNIX) z3/examples/c++/exec.sh
-	@chmod +rwx z3/examples/c++/exec.sh
-	@cp python/z3.py z3/python
-	@cp python/z3core.py z3/python
-	@cp python/z3types.py z3/python
-	@cp python/z3consts.py z3/python
-	@cp python/z3tactics.py z3/python
-	@cp python/z3printer.py z3/python
-	@cp python/README-$(PLATFORM).txt z3/examples/python/README
-	@cp python/exec-$(PLATFORM).sh z3/examples/python/exec.sh
-	@cp python/example.py z3/examples/python
-	@$(DOS2UNIX) z3/python/*.py
-	@$(DOS2UNIX) z3/examples/python/*.py
-	@$(DOS2UNIX) z3/examples/python/*.sh
-	@chmod +rwx z3/examples/python/*.sh
-	@tar -cvzf z3.tar.gz z3
-
-ocamlrelease:
-	@mkdir -p z3/ocaml
-	@mkdir -p z3/examples/ocaml
-	@cp ml/z3_stubs.c z3/ocaml
-	@cp ml/z3_theory_stubs.c z3/ocaml
-	@cp ml/z3.mli z3/ocaml
-	@cp ml/z3.ml z3/ocaml
-	@cp ml_release/build-lib.sh z3/ocaml
-	@$(DOS2UNIX) z3/ocaml/build-lib.sh
-	@chmod +rwx z3/ocaml/build-lib.sh
-	@cp ml_release/README_$(PLATFORM) z3/ocaml/README
-	@$(DOS2UNIX) z3/ocaml/README
-	@cp ml_release/build-test.sh z3/examples/ocaml
-	@$(DOS2UNIX) z3/examples/ocaml/build-test.sh
-	@chmod +rwx z3/examples/ocaml/build-test.sh
-	@cp ml_release/README_test_$(PLATFORM) z3/examples/ocaml/README
-	@$(DOS2UNIX) z3/examples/ocaml/README
-	@cp ml_release/exec-$(PLATFORM).sh z3/examples/ocaml/exec.sh
-	@$(DOS2UNIX) z3/examples/ocaml/exec.sh
-	@chmod +rwx z3/examples/ocaml/exec.sh
-	@cp ml/test_mlapi.ml z3/examples/ocaml
-	@$(DOS2UNIX) z3/examples/ocaml/test_mlapi.ml
-
-iz3release:
-	@$(DOS2UNIX) iZ3/pack-iz3-$(PLATFORM).sh
-	@chmod +rwx iZ3/pack-iz3-$(PLATFORM).sh
-	@iZ3/pack-iz3-$(PLATFORM).sh
-
-################################
-#
 # Support
 # 
 ################################
 	@ ./gmaketest --make=$(MAKE) || \
           (echo "Z3 needs GNU-Make to be built"; exit 1)
 
+################################
+#
+# installation/uninstallation
+#
+################################
+
+install: $(BIN_DIR)/$(Z3) $(BIN_DIR)/lib$(Z3).@SO_EXT@  $(BIN_DIR)/lib$(Z3).a
+	@mkdir -p $(PREFIX)/bin
+	@mkdir -p $(PREFIX)/lib
+	@mkdir -p $(PREFIX)/include
+	@cp $(BIN_DIR)/$(Z3) $(PREFIX)/bin
+	@cp $(BIN_DIR)/lib$(Z3).@SO_EXT@ $(PREFIX)/lib
+	@cp $(BIN_DIR)/lib$(Z3).a $(PREFIX)/lib
+	@cp lib/z3_api.h    $(PREFIX)/include
+	@cp lib/z3.h        $(PREFIX)/include
+	@cp lib/z3_v1.h     $(PREFIX)/include
+	@cp lib/z3_macros.h $(PREFIX)/include
+	@cp c++/z3++.h      $(PREFIX)/include
+
+uninstall:
+	@rm -f $(PREFIX)/bin/$(Z3)
+	@rm -f $(PREFIX)/lib/lib$(Z3).@SO_EXT@
+	@rm -f $(PREFIX)/lib/lib$(Z3).a
+	@rm -f $(PREFIX)/include/z3_api.h
+	@rm -f $(PREFIX)/include/z3.h
+	@rm -f $(PREFIX)/include/z3_v1.h
+	@rm -f $(PREFIX)/include/z3_macros.h
+	@rm -f $(PREFIX)/include/z3++.h
+
+install-python: $(BIN_DIR)/lib$(Z3).@SO_EXT@
+	@if test $(HAS_PYTHON) -eq 0; then echo "Python is not available in your system."; exit 1; fi
+	@echo "Installing Python bindings at $(PYTHON_PACKAGE_DIR)."
+	@$(PYTHON) python/example.py > /dev/null
+	@cp python/z3.pyc $(PYTHON_PACKAGE_DIR)
+	@cp python/z3core.pyc $(PYTHON_PACKAGE_DIR)
+	@cp python/z3types.pyc $(PYTHON_PACKAGE_DIR)
+	@cp python/z3consts.pyc $(PYTHON_PACKAGE_DIR)
+	@cp python/z3tactics.pyc $(PYTHON_PACKAGE_DIR)
+	@cp python/z3printer.pyc $(PYTHON_PACKAGE_DIR)
+	@cp $(BIN_DIR)/lib$(Z3).@SO_EXT@ $(PYTHON_PACKAGE_DIR)
+
+uninstall-python: 
+	@if test $(HAS_PYTHON) -eq 0; then echo "Python is not available in your system."; exit 1; fi
+	@echo "Uninstalling Python bindings from $(PYTHON_PACKAGE_DIR)."
+	@rm -f $(PYTHON_PACKAGE_DIR)/z3.pyc
+	@rm -f $(PYTHON_PACKAGE_DIR)/z3core.pyc
+	@rm -f $(PYTHON_PACKAGE_DIR)/z3types.pyc
+	@rm -f $(PYTHON_PACKAGE_DIR)/z3consts.pyc
+	@rm -f $(PYTHON_PACKAGE_DIR)/z3tactics.pyc
+	@rm -f $(PYTHON_PACKAGE_DIR)/z3printer.pyc
+	@rm -f $(PYTHON_PACKAGE_DIR)/$(BIN_DIR)/lib$(Z3).@SO_EXT@

Microsoft.Z3/Enumerations.cs

   Z3_OP_CONST_ARRAY = 770,
   Z3_OP_BSDIV = 1031,
   Z3_OP_OR = 262,
+  Z3_OP_PR_HYPER_RESOLVE = 1319,
   Z3_OP_AGNUM = 513,
   Z3_OP_PR_PUSH_QUANT = 1298,
   Z3_OP_BSMOD = 1035,
     msbuild z3-prover.sln 
   All components will be located at /debug
 
-1) Building Z3 using g++/make
+2) Building Z3 using g++/make
 Your machine must also have the following commands to be able to build Z3:
 autoconf, sed, awk, dos2unix commands
 
-
-- Open a shell
-- For building the z3 executable, execute
- 
   autoconf
   ./configure
   make
+  sudo make install
 
-The z3 executable will be located at bin/external/
+It will install z3 executable at /usr/local/bin, libraries at /usr/local/lib, and include files at /usr/local/include.
+Use the following commands to install in a different prefix (e.g., /usr).
 
-- If you want a static library for Z3
+  autoconf
+  ./configure --prefix=/usr
+  make
+  sudo make install
 
-  make a
+To uninstall Z3, use
 
-- If you also want the z3 shared library, execute
+  sudo make uninstall
 
-  make so
+To install Z3 Python bindings, use
 
-  for libz3.so (on Linux)
+  sudo make install-python
 
-  make dylib
+To uninstall Z3 Python bindings, use
 
-  for libz3.dylib (on OSX)
+  sudo make uninstall-python
+  
 
 Remark: the Z3 makefile imports the source file list from Visual Studio project files.
 To add new source files to the Z3 core, you must include them at: lib/lib.vcxproj
+RELEASE NOTES
+
+First source code release (October 2, 2012)
+===========================================
+
+- Fixed bug in Z3Py. The method that builds Z3 applications could crash if one of the arguments have to be "casted" into the correct sort (Thanks to Dennis Yurichev).
+
+- Fixed bug in datatype theory (Thanks to Ayrat).
+
+- Fixed bug in the definition of MkEmptySet and MkFullSet in the .Net API.
+
+- Display warning message and ignore option CASE_SPLIT=3,4 or 5 when auto configuration is enabled (AUTO_CONFIG=true) (Thanks Tobias from StackOverflow). 
+
+- Made the predicates <, <=, > and >= chainable as defined in the SMT 2.0 standard (Thanks to Matthias Weiler). 
+
+- Added missing Z3_decl_kind's for datatypes: Z3_OP_DT_CONSTRUCTOR, Z3_OP_DT_ACCESSOR, Z3_OP_DT_RECOGNISER.
+
+- Added support for numbers in scientific notation at Z3_ast Z3_mk_numeral(__in Z3_context c, __in Z3_string numeral, __in Z3_sort ty).
+
+- New builtin symbols in the arithmetic theory: pi, euler, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh. The first two are constants, and the others are unary functions. These symbols are not available if the a SMT 2.0 logic is specified (e.g., QF_LRA, QF_NRA, QF_LIA, etc) because these symbols are not defined in these logics. That is, the new symbols are only available if the logic is not specified.
+
+Version 4.1
+===========
+
+- New OCAML API (Many thanks to Josh Berdine)
+
+- CodeContracts in the .NET API (Many thanks to Francesco Logozzo).
+  Users can now check whether they are using the .NET API correctly
+  using <a href="http://msdn.microsoft.com/en-us/devlabs/dd491992">Clousot</a>.
+
+- Added option :error-behavior. The default value is
+  continued-execution. Now, users can force the Z3 SMT 2.0 frontend to
+  exit whenever an error is reported.  They just have to use the
+  command (set-option :error-behavior immediate-exit).
+
+- Fixed bug in term-if-then-else elimination (Thanks to Artur Niewiadomski).  
+
+- Fixed bug in difference logic detection code (Thanks to Dejan Jovanovic).
+      
+- Fixed bug in the pseudo-boolean preprocessor (Thanks to Adrien Champion).
+
+- Fixed bug in bvsmod preprocessing rules (Thanks to Dejan Jovanovic).
+
+- Fixed bug in Tactic tseitin-cnf (Thanks to Georg Hofferek).
+
+- Added missing simplification step in nlsat. 
+
+- Fixed bug in model construction for linear real arithmetic (Thanks to Marcello Bersani).
+
+- Fixed bug in preprocessor that eliminated rational powers (e.g., (^ x (/ 1.0 2.0))), the bug affected only problems where the denominator was even (Thanks to Johannes Eriksson).
+
+- Fixed bug in the k-th root operation in the algebraic number package. The result was correct, but the resulting polynomial could be incorrectly tagged as minimal and trigger nontermination on comparison operations. (Thanks to Johannes Eriksson).
+  
+- Fixed bug affecting problems containing patterns with n-ary arithmetic terms such as (p (+ x y 2)). This bug was introduced in Z3 4.0. (Thanks to Paul Jackson). 
+
+- Fixed crash when running out of memory.
+
+- Fixed crash reported by Alex Summers. The crash was happening on scripts that contain quantifiers, and use boolean formulas inside terms.
+
+- Fixed crash in the MBQI module (Thanks to Stephan Falke).     
+
+- Fixed bug in the E-matching engine. It was missing instances of multi-patterns (Thanks Alex Summers). 
+      
+- Fixed bug in Z3Py pretty printer.
+
+- The pattern inference module does not generate warning messages by default anymore. This module was responsible for producing messages such as: "WARNING: failed to find a pattern for quantifier (quantifier id: k!199)". The option PI_WARNINGS=true can be used to enable these warning messages.
+
+- Added missing return statements in z3++.h (Thanks to Daniel Neider).
+
+- Removed support for TPTP5 and Simplify input formats. 
+
+- Removed support for Z3 (low-level) input format. It is still available in the API.
+
+- Removed support for "SMT 1.5" input format (aka .smtc files). This was a hybrid input format that was implemented while the SMT 2.0 standard was being designed. Users should move to SMT 2.0 format. Note that SMT 1.0 format is still available.
+
+- Made tseitin-cnf tactic more "user friendly". It automatically applies required transformations needed to eliminate operators such as: and, distinct, etc.
+
+- Implemented new PSC (principal subresultant coefficient) algorithm. This was one of the bottlenecks in the new nlsat solver/tactic.
+
+Version 4.0
+===========
+
+Z3 4.0 is a major release. The main new features are:
+- New C API, and it is backwards compatible, but several methods are marked as deprecated.
+  In the new API, many solvers can be created in the same context. It also includes support
+  for user defined strategies using Tactics. It also exposes a new interface for browsing models.
+
+- A thin C++ layer around the C API that illustrates how to 
+  leverage reference counting of ast objects.
+  Several examples can be found in the directory 'examples/c++'.
+
+- New .NET API together with updated version of the legacy .NET API. 
+  The new .NET API supports the new features, Tactics, Solvers, Goals, 
+  and integration of  with reference counting. Terms and sorts life-times 
+  no longer requires a scoping discipline.
+
+- <a class="el" href="http://rise4fun.com/Z3Py/tutorial/guide">Z3Py: Python interface for Z3</a>. 
+  It covers all main features in the Z3 API.
+
+- <a class="el" href="http://research.microsoft.com/apps/pubs/default.aspx?id=159549">NLSAT solver</a> for nonlinear arithmetic.  
+       
+- The PDR algorithm in muZ. 
+   
+- iZ3: an interpolating theorem prover built on top of Z3 (\ref iz3documentation). iZ3 is only available for Windows and Linux. 
+
+- New logging infrastructure. Z3 logs are used to record every Z3 API call performed by your application.
+  If you find a bug, just the log need to be sent to the Z3 team.
+  The following APIs were removed: Z3_trace_to_file, Z3_trace_to_stderr, Z3_trace_to_stdout, Z3_trace_off. 
+  The APIs: Z3_open_log, Z3_append_log and Z3_close_log do not receive a Z3_context anymore.
+  When creating a log, you must invoke Z3_open_log before any other Z3 function call.
+  The new logs are much more precise. 
+  However, they still have two limitations. They are not useful for logging applications that use callbacks (e.g., theory plugins) 
+  because the log interpreter does not have access to these callbacks.
+  They are not precise for applications that are using multiple threads for processing multiple Z3 contexts.
+        
+- Z3 (for Linux and OSX) does not depend on GMP anymore.
+
+- Z3 1.x backwards compatibility macros are defined in z3_v1.h. If you still use them, you have to explicitly include this file.
+      
+- Fixed all bugs reported at Stackoverflow.
+
+Temporarily disabled features:
+
+- User theories cannot be used with the new Solver API yet. Users may still use them with the deprecated solver API.
+
+- Parallel Z3 is also disabled in this release. However, we have parallel combinators for creating stragegies (See <a href="http://rise4fun.com/Z3/tutorial/strategies"> tutorial</a>).
+      
+The two features above will return in future releases. 
+
+Here is a list of all <a class="el" href="deprecated.html">deprecated functions</a>.
+
+Version 3.2
+===========
+
+This is a bug-fix refresh that fixes reported problems with 3.1.
+        
+- Added support for chainable and right associative attributes. 
+
+- Fixed model generation for QBVF (aka UFBV) logic. Now, Z3 officially supports the logics BV and UFBV. 
+  These are essentially QF_BV and QF_UFBV with quantifiers.
+
+- Fixed bug in eval and get-value commands. Thanks to Levent Erkok.
+
+- Fixed performance bug that was affecting VCC and Slayer. Thanks to Michal Moskal.
+
+- Fixed time measurement on Linux. Thanks to Ayrat Khalimov.
+
+- Fixed bug in destructive equality resolution (DER=true).
+        
+- Fixed bug in map operator in the theory of arrays. Thanks to Shaz Quadeer.
+        
+- Improved OCaml build scripts for Windows. Thanks to Josh Berdine.
+        
+- Fixed crash in MBQI (when Real variables were used). 
+
+- Fixed bugs in quantifier elimination. Thanks to Josh Berdine.
+
+- Fixed crash when an invalid datatype declaration is used.
+        
+- Fixed bug in the SMT2 parser.        
+
+- Fixed crash in quick checker for quantified formulas. Thanks to Swen Jacobs.
+
+- Fixed bug in the bvsmod simplifier. Thanks to Trevor Hansen.
+
+- New APIs: \c Z3_substitute and \c Z3_substitute_vars.
+
+- Fixed crash in MBQI. Thanks to Dejan Jovanovic.
+
+Version 3.1
+===========
+
+This is a bug-fix refresh that fixes reported problems with 3.0.
+
+- Fixed a bug in model generation. Thanks to Arlen Cox and Gordon Fraser.
+        
+- Fixed a bug in Z3_check_assumptions that prevented it from being used between satisfiable instances. Thanks to Krystof Hoder.
+
+- Fixed two bugs in quantifier elimination. Thanks to Josh Berdine.        
+
+- Fixed bugs in the preprocessor.
+
+- Fixed performance bug in MBQI. Thanks to Kathryn Stolee.
+
+- Improved strategy for QBVF (aka UFBV) logic.
+
+- Added support for negative assumptions in the check-sat command.
+
+Version 3.0
+===========
+
+- Fully compliant SMT-LIB 2.0 (SMT2) front-end. The old front-end is still available (command line option -smtc).
+  The <a class="el" href="http://rise4fun.com/z3/tutorial/guide">Z3 Guide</a> describes the new front-end.
+
+- Parametric inductive datatypes, and parametric user defined types.
+
+- New SAT solver. Z3 can also read dimacs input formulas.
+
+- New Bitvector (QF_BV) solver. The new solver is only available when using the new SMT2 front-end.
+
+- Major performace improvements. 
+
+- New preprocessing stack.
+
+- Performance improvements for linear and nonlinear arithmetic. The improvements are only available when using the the SMT2 front-end.
+
+- Added API for parsing SMT2 files.
+
+- Fixed bug in AUTO_CONFIG=true. Thanks to Alberto Griggio.
+
+- Fixed bug in the Z3 simplifier cache. It was not being reset during backtracking. Thanks to Alberto Griggio.
+
+- Fixed many other bugs reported by users.
+
+- Improved model-based quantifier instantiation (MBQI).
+
+- New solver for Quantified Bitvector Logic (QBVF). 
+
+- Z3 checks the user specified logic.
+        
+- <a href="http://www.cs.miami.edu/~tptp/">TPTP</a> 5 front-end.
+
+Version 2.19
+============
+
+- In the SMT-LIB 1.0 frontend, Z3 will only display the model when requested by the user (MODEL=true).
+
+- Fixed bug in the variable elimination preprocessor. Thanks to Alberto Griggio.
+        
+- Fixed bug in the expression strong simplifier. Thanks to Marko.
+
+- Fixed bug in the Z3 auto configuration mode. Thanks to Vladimir Klebanov.
+
+- Fixed bug when model generation is used in the context of user-defined-theories. Thanks to Philippe Suter.
+
+- Fixed bug in quantifier elimination procedure. Thanks to Mikkel Larsen Pedersen.
+        
+- Improved speed of Z3 lexer for SMT-LIB frontend.
+
+- Added a sample under examples/fixedpoints to illustrate using
+	  the API for pluggable relations.
+
+- Added an API method \c Z3_get_param_value for retrieving a 
+  configuration value given a configuration parameter name.
+
+Version 2.18
+============
+
+- Z3 has a new mode for solving fixed-point queries.
+  It allows formulating Datalogish queries combined with constraints.
+  <a class="el" href="http://rise4fun.com/z3py/tutorial/fixedpoints">Try it online</a>.
+
+- Fixed bug that affects the array theory over the API using
+  RELEVANCY=0. Thanks to Josh Berdine.
+
+Version 2.17
+============
+      
+- Z3 has new model finding capabilities for Quantified SMT formulas.
+  The new features are enabled with <tt>MBQI=true</tt>.
+  (Model Based Quantifier Instantiation). MBQI implements a
+  counter-example based refinement loop, where candidate models are
+  built and checked. When the model checking step fails, it creates new
+  quantifier instantiations. The models are returned as simple
+  functional programs. The new feature is also a decision procedure for
+  many known decidable fragments such as: EPR (Effectively
+  Propositional), Bradley&Manna&Sipma's Array Property Fragment (VMCAI'06), Almost
+  Uninterpreted Fragment (Complete instantiation for quantified SMT formulas, CAV'09),
+  McPeak&Necula's list fragment (CAV'05), QBVF (Quantified Bit-Vector Formulas FMCAD'10), 
+  to cite a few. 
+  MBQI is useful for checking the consistency of background axiomatizations,
+  synthesizing functions, and building real counterexamples for
+  verification tools. Users can constrain the search space by
+  providing templates for function symbols, and constraints
+  on the size of the universe and range of functions.
+          
+- Fixed bug in the command <tt>(simplify [expr])</tt> SMT-LIB 2.0 frontend.
+        
+- New model pretty printer. The old style is still available (option <tt>MODEL_V2=true</tt>).
+  Z3 1.x style is also available (option <tt>MODEL_V1=true</tt>). 
+
+- Removed \c ARRAY_PROPERTY option. It is subsumed by <tt>MBQI=true</tt>.
+
+- Z3 uses the <tt>(set-logic [name])</tt> to configure itself.
+  
+- Assumptions can be provided to the \c check-sat command.
+  The command <tt>(check-sat [assumptions])</tt> checks the satisfiability of the logical context modulo
+  the given set of assumptions. The assumptions must be Boolean constants or
+  the negation of Boolean constants. When the logical context is
+  unsatisfiable modulo the given assumptions, Z3 will display a subset
+  of the \c assumptions that contributed to the conflict. Lemmas
+  learned during the execution of \c check-sat are preserved.
+
+- Added command <tt>(echo [string])</tt> to the SMT-LIB 2.0 frontend.
+
+- Z3 models explicitly include an interpretation for uninterpreted sorts.
+  The interpretation is presented using the \c define-sort primitive.
+  For example, 
+  \code
+      (define-sort S e_1 ... e_n)          
+  \endcode
+  states that the interpretation of the uninterpreted sort S is finite, and
+  its universe is composed by values \c e_1, ..., \c e_n.
+
+- Options \c WARNING and \c VERBOSE can be set in the SMT-LIB 2.0 frontend using
+  the commands <tt>(set-option WARNING <flag>)</tt> <tt>(set-option VERBOSE <flag>)</tt>.
+        
+- Fixed unintentional side-effects in the Z3 pretty printer. Thanks to Swen Jacobs.
+
+- Added interpreted constants of the form <tt>as-array[f]</tt>. The constants
+  are used in models produced by Z3 to encode the interpretation of arrays. 
+  The following axiom scheme axiomatizes the new constants:
+  \code
+     (forall (x1 S1) ... (xn Sn) (= (select as-array[f] x1 ... xn) (f x1 ... xn)))
+  \endcode
+        
+- Fixed bug in the option MACRO_FINDER=true.
+
+- Fixed bug in the <tt>(eval [expr])</tt> command in the SMT-LIB 2.0 frontend.
+
+- Soundness bug in solver for array property fragment. Thanks to Trevor Hansen.
+
+Version 2.16
+============
+
+The following bugs are fixed in this release:
+
+- Bugs in quantifier elimination. Thanks to Mikkel Larsen Pedersen.
+
+- Crash in non-linear arithmetic. Thanks to Trevor Hansen.
+
+- Unsoundness in mixed integer-linear version using to_real. Thanks to Hirai.
+
+- A crash and bugs in check_assumptions feature. Thanks to Akash Lal and Shaz Qadeer.
+
+Version 2.15
+============
+
+The following bugs are fixed in this release:
+
+- A bug in the quantifier elimination that affects nested
+  alternating quantifiers that cannot be fully eliminated.
+
+- A crash in proof generation. Thanks to Sascha Boehme.
+
+Version 2.14
+============
+
+The following bugs are fixed in this release:
+
+- A crash in arithmetic simplification. Thanks to Trevor Hansen.
+
+- An unsoundness bug in the quantifier elimination. 
+  It affects the equivalence of answers that are computed 
+  in some cases.
+
+- Incorrect printing of parameters and other values
+  in SMT-LIB2 mode.
+  Thanks to Tjark Weber.
+
+Version 2.13
+============
+
+The following bugs are fixed in this release:
+
+- Soundness bug in solver for array property fragment. Thanks to Trevor Hansen.
+
+- Soundness bug introduced in macro expansion utilities. Thanks to Wintersteiger.
+
+- Incorrect handling of QF_NRA. Thanks to Trevor Hansen.
+
+- Mixup between SMT2 and SMT1 pretty printing formats. Thanks to Alvin Cheung and Tjark Weber.	
+
+Version 2.12
+============
+
+News:
+	
+- Philippe Suter made a JNI binding available.
+  There is also an existing Python binding by Sascha Boehme.
+  See \ref contrib.
+
+The following features are added in this release:
+
+- Enable check_assumptions without enclosing push/pop.
+  This resolves the limitation described 
+  in \ref sub_release_limitations_2_0.
+
+- Expose coefficients used in arithmetical proofs.
+
+- Allow quantified theory axioms.
+
+The following bugs are fixed in this release:
+
+- Fixes to the SMT-LIB 2.0 pretty printing mode.
+
+- Detect miss-annotated SMT-LIB benchmarks to avoid crashes when 
+  using the wrong solvers. Thanks to Trevor Hansen.
+
+- A digression in the managed API from 2.10 
+  when passing null parameters.
+
+- Crash/incorrect handling of inequalities over the reals
+  during quantifier elimination.
+  Thanks to Mikkel Larsen Pedersen.
+
+- Bug in destructive equality resolution.
+  Thanks to Sascha Boehme.
+
+- Bug in initialization for x64_mt executable on SMT benchmarks.
+  Thanks to Alvin Cheung.
+	
+
+Version 2.11
+============
+
+The following features are added in this release:
+
+- SMT-LIB 2.0 parsing support for (! ..) in quantifiers and (_ ..).
+
+- Allow passing strings to function and sort declarations in the .NET Theory builders.
+
+- Add a parameter to the proof construct for theory lemmas to indicate which theory
+  provided the lemma.
+	
+- More detailed proof production in rewrite steps.
+  
+The following bugs are fixed in this release:
+
+- A bug in BV propagation. Thanks to Trevor Hansen.
+
+
+Version 2.10
+============
+
+The following bugs are fixed in this release:
+
+- Inconsistent printing of integer and real types from 
+  the low level and SMT-LIB pretty printers. 
+  Thanks to Sascha Boehme.
+
+- Missing relevancy propagation and memory smash in
+  user-theory plugins.
+  Thanks to Stan Rosenberg.
+
+Version 2.9
+===========
+
+The following bugs are fixed in this release:
+
+- Incorrect constant folding of extraction for large bit-vectors.
+  Thanks to Alvin.
+	
+- Z3 crashed when using patterns that are variables.
+  Thanks to Michael Emmi.
+
+- Unsound array property fragment handling of non-integer types.
+  Thanks to Juergen Christ.
+
+- The quantifier elimination procedure for data-types has
+  been replaced.
+  Thanks to Josh Berdine.
+
+- Refresh 2.9.1: Add missing AssumeEq to the .NET managed API. 
+  Thanks to Stan Rosenberg.
+
+Version 2.8
+===========
+
+The following features have been added:
+
+- User theories: The user can add theory solvers that
+  get invoked by Z3's core during search.
+  See also \ref theory_plugin_ex.
+
+- SMT2 features: parse smt2 let bindings.
+    
+The following bugs are fixed in this release:
+	
+- Incorrect semantics of constant folding for (bvsmod 0 x), where
+  x is positive, incorrect constant folding for bvsdiv, incorrect
+  simplification of bvnor, bvnand, incorrect compilation of
+  bvshl when using a shift amount that evaluates to the length
+  of the bit-vector. Thanks to Trevor Hansen and Robert Brummayer. 
+
+- Incorrect NNF conversion in linear quantifier elimniation routines.
+  Thanks to Josh Berdine.
+
+- Missing constant folding of extraction for large bit-vectors.
+  Thanks to Alvin.
+
+- Missing APIs for bvredand and bvredor. 
+
+Version 2.7
+===========
+
+The following features have been added:
+	
+- Partial support for SMT-LIB 2.0 format:
+  Added declare-fun, define-fun, declare-sort, define-sort, get-value
+
+- Added coercion function to_int and testing function is_int. 
+  To coerce from reals to integers and to test whether a real is an integer.
+  The function to_real was already supported.
+
+- Added Z3_repeat to create the repetition of bit-vectors.
+
+The following bugs are fixed in this release:
+	
+- Incorrect semantics of constant folding for bvsmod. 
+
+- Incorrect semantics of constant folding for div/mod.
+  Thanks to Sascha Boehme.	  
+
+- Non-termination problem associated with option LOOKAHEAD=true.
+  It gets set for QF_UF in auto-configuration mode.
+  Thanks to Pierre-Christophe Bu�.
+
+- Incorrect axioms created for injective functions.
+  Thanks to Sascha Boehme.
+
+- Stack overflow during simplification of large nested
+  bit-vector terms. Thanks to David Molnar.
+
+- Crash in unsat-core generation when enabling SOLVER=true.
+  Thanks to Lucas Cordeiro.
+
+- Unlimited cache growth while simplifying bit-vectors.
+  Thanks to Eric Landers.
+
+- Crash when solving array property formulas using non-standard
+  array operators. 
+  Thanks to Sascha Boehme.
+
+Version 2.6
+===========
+
+This release fixes a few bugs.
+Thanks to Marko K��ramees for reporting a bug in the strong context simplifier and
+to Josh Berdine. 
+
+This release also introduces some new preprocessing features:
+
+- More efficient destructive equality resolution DER=true.
+        
+- DISTRIBUTE_FORALL=true (distributes universal quatifiers over conjunctions, this transformation may affect pattern inference). 
+
+- Rewriter that uses universally quantified equations PRE_DEMODULATOR=true (yes, the option name is not good, we will change it in a future release).
+
+- REDUCE_ARGS=true (this transformation is essentially a partial ackermannization for functions where a particular argument is always an interpreted value).
+
+- Better support for macro detection (a macro is a universally quantified formula of the form Forall X. F(X) = T[X]). We also change the option name, now it is called MACRO_FINDER=true.
+
+- ELIM_QUANTIFIERS=true enables quantifier elimination methods. Previous variants called QUANT_ARITH are deprecated.
+
+Version 2.5
+===========
+
+This release introduces the following features:
+
+- STRONG_CONTEXT_SIMPLIFIER=true allows simplifying sub-formulas
+  to true/false depending on context-dependent information.
+  The approach that we use is described on
+  the <a href="http://community.research.microsoft.com/forums/p/4493/8140.aspx">
+  Microsoft Z3 forum</a>.
+
+- Some parameter values can be updated over the API. This functionality is called
+  <tt>Z3_update_param_value</tt> in the C API. This is particularly useful
+  for turning the strong context simplifier on and off.  
+ 
+It also fixes bugs reported by Enric Rodr�guez Carbonell, 
+Nuno Lopes, Josh Berdine, Ethan Jackson, Rob Quigley and 
+Lucas Cordeiro.
+
+Version 2.4
+===========
+        
+This release introduces the following features:
+
+- Labeled literals for the SMT-LIB format. 
+  The Simplify format has supported labeled formulas 
+  to simplify displaying counter-examples. 
+  Section \ref smtlib_labels explains how labels are now
+  supported in the SMT-LIB format.
+
+- Preliminary support for SMT-LIB2
+
+It fixes the following bugs:
+
+- Bug in non-linear arithmetic routines.
+
+- Crash observed a class of modular integer arithmetic formulas.
+
+- Incomplete saturation leading to incorrectly sat labeling.
+
+- Crash in the bit-vector procedure when using int2bv and bv2int.
+
+Thanks to Michal Moskal, Sascha Boehme and Ethan Jackson.
+
+Version 2.3
+===========
+
+This release introduces the following features:
+
+- F# Quotation utilities. The release contains a new directory 'utils'. 
+  It contains utilities built on top of Z3. The main one is support for
+  translating F# quoted expressions into Z3 formulas.
+
+- QUANT_ARITH configuration. 
+  Complete quantifier-elimination simplification for linear real and linear integer
+  arithmetic. QUANT_ARITH=1 uses Ferrante/Rackhoff for reals and Cooper's method for integers.
+  QUANT_ARITH=2 uses Fourier-Motzkin for reals and the Omega test for integers.
+
+It fixes the following bugs:
+
+- Incorrect simplification of map over store in the extendted array theory. Reported by Catalin Hritcu.
+
+- Incomplete handling of equality propagation with constant arrays. Reported by Catalin Hritcu.
+
+- Crash in bit-vector theory.
+ 
+- Incorrectness in proof reconstruction for quantifier manipulation.
+
+Thanks to Catalin Hritcu, Nikolai Tillmann and Sascha Boehme.
+
+Version 2.2
+===========
+
+This release fixes minor bugs. 
+It introduces some additional features in the SMT-LIB front-end 
+to make it easier to parse new operators in the theory of arrays.
+These are described in \ref smtlibext. 
+
+Version 2.1
+===========
+
+This is a bug fix release.
+Many thanks to Robert Brummayer, Carine Pascal, Fran�ois Remy, 
+Rajesh K Karmani, Roberto Lublinerman and numerous others for their 
+feedback and bug reports.
+
+Version 2.0
+===========
+
+- <a href="http://research.microsoft.com/en-us/um/people/leonardo/parallel_z3.pdf">Parallel Z3</a>. 
+  Thanks to Christoph Wintersteiger there is a binary 
+  supporting running multiple instances of Z3 from different threads,
+  but more interestingly, also making use of multiple cores for 
+  a single formula. 
+
+- Check Assumptions.
+  The binary API exposes a new call #Z3_check_assumptions, which
+  allows passing in additional assumptions while checking for 
+  consistency of the already asserted formulas.
+  The API function returns a subset of the assumptions that were
+  used in an unsatisfiable core. It also returns an optional
+  proof object.
+
+- Proof Objects.
+  The #Z3_check_assumptions retuns a proof object if 
+  the configuration flag PROOF_MODE is set to 1 or 2.
+
+- Partial support for non-linear arithmetic. 
+  The support uses support for computing Groebner bases.
+  It allows solving some, but far from all, formulas using 
+  polynomials over the reals. Uses should be aware that the 
+  support for non-linear arithmetic (over the reals) is not complete in Z3.
+       
+- Recursive data-types.
+  The theory of well-founded recursive data-types is supported
+  over the binary APIs. It supports ground satisfiability checking
+  for tuples, enumeration types (scalars), 
+  lists and mututally recursive data-types.
 
 2) Using gcc
 
-Use 'build.sh' to build the test application using g++. 
-The script 'exec.sh' adds the bin directory to the path. So, 
-example.exe can find z3.dll.
+You must install Z3 before running this example.
+To install Z3, execute the following command in the Z3 root directory.
 
-Remark: the scripts 'build.sh' and 'exec.sh' assumes you are in a
-Cygwin or Mingw shell.
+  sudo make install
+
+Use 'build.sh' to build the test application using g++. 
+It generates the executable 'example'.
 

c++/build-external-linux.sh

-g++ -fopenmp -o example -I ../../include example.cpp -L ../../lib -lz3 

c++/build-external-osx.sh

-g++ -fopenmp -o example -I ../../include example.cpp -L ../../lib -lz3 

c++/build-external.sh

-g++ -fopenmp -o example.exe -I ../../include ../../bin/z3.dll example.cpp

c++/exec-external-linux.sh

-export LD_LIBRARY_PATH=../../lib:$LD_LIBRARY_PATH
-./example

c++/exec-external-osx.sh

-export DYLD_LIBRARY_PATH=../../lib:$DYLD_LIBRARY_PATH
-./example

c++/exec-external.sh

-export PATH=../../bin:$PATH
-./example.exe
 ])
 AC_SUBST(EXTRA_LIB_SRCS)
 
+AC_ARG_WITH(python,
+[AS_HELP_STRING([--with-python=PYTHON_PATH],
+		[specify the location of the python 2.x executable.])])
+
+PYTHON="python"
+if test "x$with_python" != x; then
+  PYTHON="$with_python"
+fi
+
+AC_SUBST(PYTHON)
+
 AC_PATH_PROG([D2U], [dos2unix], [no], [~/bin$PATH_SEPARATOR$PATH])
 AS_IF([test "$D2U" = "no"], [AC_MSG_ERROR(dos2unix not found)])
 AC_SUBST(D2U)
 AC_SUBST(COMP_VERSIONS)
 AC_SUBST(STATIC_FLAGS)
 
+cat > tst_python.py <<EOF
+from sys import version
+if version >= "3":
+   exit(1)
+exit(0)
+EOF
+
+if $PYTHON tst_python.py; then
+  HAS_PYTHON="1"
+  HAS_PYTHON_MSG="yes"
+cat > get_py_dir.py << EOF
+import distutils.sysconfig
+print distutils.sysconfig.get_python_lib()
+EOF
+  if $PYTHON get_py_dir.py > dir.txt; then
+    PYTHON_PACKAGE_DIR=`cat dir.txt`
+  else
+    HAS_PYTHON="0"
+    HAS_PYTHON_MSG="no"
+  fi
+  rm -f dir.txt
+  rm -f get_py_dir.py
+else
+  HAS_PYTHON="0"
+  HAS_PYTHON_MSG="no"
+fi
+AC_SUBST(PYTHON_PACKAGE_DIR)
+AC_SUBST(HAS_PYTHON)
+rm -f tst_python.py
+
 cat > tst64.c <<EOF
     int main() {
     	return sizeof(unsigned) == sizeof(void*);
 cat <<EOF
 
 Z3 was configured with success.
-Host platform: $PLATFORM
-Arithmetic:    $ARITH
+Host platform:  $PLATFORM
+Arithmetic:     $ARITH
+Python Support: $HAS_PYTHON_MSG
+Pyyhon:         $PYTHON 
 
 Type 'make' to compile Z3.
+Type 'sudo make install' to install Z3.
+Type 'sudo make install-python' to install Z3 Python bindings.
 EOF
             case PR_CNF_STAR: return Z3_OP_PR_CNF_STAR; 
             case PR_MODUS_PONENS_OEQ: return Z3_OP_PR_MODUS_PONENS_OEQ; 
             case PR_TH_LEMMA: return Z3_OP_PR_TH_LEMMA; 
-
+            case PR_HYPER_RESOLVE: return Z3_OP_PR_HYPER_RESOLVE;
             default:
                 UNREACHABLE();
                 return Z3_OP_UNINTERPRETED;
     m_def_intro_decl(0),
     m_iff_oeq_decl(0),
     m_skolemize_decl(0),
-    m_mp_oeq_decl(0) {
+    m_mp_oeq_decl(0),
+    m_hyper_res_decl0(0) {
 }
 
 bool basic_decl_plugin::check_proof_sorts(basic_op_kind k, unsigned arity, sort * const * domain) const {
         SASSERT(num_parents == 0);
         return mk_proof_decl("quant-inst", k, num_parameters, params, num_parents);
     }
+    case PR_HYPER_RESOLVE: {
+        return mk_proof_decl("hyper-res", k, num_parameters, params, num_parents);
+    }
     default:
         UNREACHABLE();
         return 0;
     case PR_SKOLEMIZE:                    return mk_proof_decl("sk", k, 0, m_skolemize_decl);
     case PR_MODUS_PONENS_OEQ:             return mk_proof_decl("mp~", k, 2, m_mp_oeq_decl);
     case PR_TH_LEMMA:                     return mk_proof_decl("th-lemma", k, num_parents, m_th_lemma_decls);
+    case PR_HYPER_RESOLVE:                return mk_proof_decl("hyper-res", k, num_parents, m_hyper_res_decl0);
     default:
         UNREACHABLE();
         return 0;
     DEC_ARRAY_REF(m_cnf_star_decls);
 
     DEC_ARRAY_REF(m_th_lemma_decls);
+    DEC_REF(m_hyper_res_decl0);
 
 }
 
     return mk_app(m_basic_family_id, PR_TH_LEMMA, num_params+1, parameters.c_ptr(), args.size(), args.c_ptr());
 }
 
+proof* ast_manager::mk_hyper_resolve(unsigned num_premises, proof* const* premises, expr* concl,
+                                     svector<std::pair<unsigned, unsigned> > const& positions,
+                                     vector<expr_ref_vector> const& substs) {
+    ptr_vector<expr> fmls;
+    SASSERT(positions.size() + 1 == substs.size());
+    for (unsigned i = 0; i < num_premises; ++i) {
+        TRACE("dl", tout << mk_pp(premises[i], *this) << "\n";);
+        fmls.push_back(get_fact(premises[i]));
+    }
+    SASSERT(is_bool(concl));
+    vector<parameter> params;
+    for (unsigned i = 0; i < substs.size(); ++i) {
+        expr_ref_vector const& vec = substs[i];
+        for (unsigned j = 0; j < vec.size(); ++j) {
+            params.push_back(parameter(vec[j]));
+        }
+        if (i + 1 < substs.size()) {
+            params.push_back(parameter(positions[i].first));
+            params.push_back(parameter(positions[i].second));
+        }
+    }
+    ptr_vector<sort> sorts;
+    ptr_vector<expr> args;
+    for (unsigned i = 0; i < num_premises; ++i) {
+        sorts.push_back(mk_proof_sort());
+        args.push_back(premises[i]);
+    }
+    sorts.push_back(mk_bool_sort());
+    args.push_back(concl);
+    app* result = mk_app(m_basic_family_id, PR_HYPER_RESOLVE, params.size(), params.c_ptr(), args.size(), args.c_ptr());
+    SASSERT(result->get_family_id() == m_basic_family_id);
+    SASSERT(result->get_decl_kind() == PR_HYPER_RESOLVE);
+    return result;
+}
+
+bool ast_manager::is_hyper_resolve(
+    proof* p, 
+    proof_ref_vector& premises,
+    expr_ref& conclusion,
+    svector<std::pair<unsigned, unsigned> > & positions,
+    vector<expr_ref_vector> & substs) {
+    if (!is_hyper_resolve(p)) {
+        return false;
+    }
+    unsigned sz = p->get_num_args();
+    SASSERT(sz > 0);
+    for (unsigned i = 0; i + 1 < sz; ++i) {
+        premises.push_back(to_app(p->get_arg(i)));
+    }
+    conclusion = p->get_arg(sz-1);
+    func_decl* d = p->get_decl();
+    unsigned num_p = d->get_num_parameters();
+    parameter const* params = d->get_parameters();
+    
+    substs.push_back(expr_ref_vector(*this));
+    for (unsigned i = 0; i < num_p; ++i) {
+        if (params[i].is_int()) {
+            SASSERT(i + 1 < num_p);
+            SASSERT(params[i+1].is_int());
+            unsigned x = static_cast<unsigned>(params[i].get_int());
+            unsigned y = static_cast<unsigned>(params[i+1].get_int());
+            positions.push_back(std::make_pair(x, y));
+            substs.push_back(expr_ref_vector(*this));
+            ++i;
+        }
+        else {
+            SASSERT(params[i].is_ast());
+            ast* a = params[i].get_ast();
+            SASSERT(is_expr(a));
+            substs.back().push_back(to_expr(a));                
+        }
+    }
+    
+    return true;
+}
+
 
 // -----------------------------------
 //
     PR_HYPOTHESIS, PR_LEMMA, PR_UNIT_RESOLUTION, PR_IFF_TRUE, PR_IFF_FALSE, PR_COMMUTATIVITY, PR_DEF_AXIOM,
 
     PR_DEF_INTRO, PR_APPLY_DEF, PR_IFF_OEQ, PR_NNF_POS, PR_NNF_NEG, PR_NNF_STAR, PR_SKOLEMIZE, PR_CNF_STAR, 
-    PR_MODUS_PONENS_OEQ, PR_TH_LEMMA, LAST_BASIC_PR
+    PR_MODUS_PONENS_OEQ, PR_TH_LEMMA, PR_HYPER_RESOLVE, LAST_BASIC_PR
 };
 
 class basic_decl_plugin : public decl_plugin {
     ptr_vector<func_decl> m_cnf_star_decls;
 
     ptr_vector<func_decl> m_th_lemma_decls;
+    func_decl * m_hyper_res_decl0;
 
     static bool is_proof(decl_kind k) { return k > LAST_BASIC_OP; }
     bool check_proof_sorts(basic_op_kind k, unsigned arity, sort * const * domain) const;
 
     bool is_proof(expr const * n) const { return is_app(n) && to_app(n)->get_decl()->get_range() == m_proof_sort; }
 
+    proof* mk_hyper_resolve(unsigned num_premises, proof* const* premises, expr* concl,
+                            svector<std::pair<unsigned, unsigned> > const& positions,
+                            vector<ref_vector<expr, ast_manager> > const& substs);
+    
+
     bool is_undef_proof(expr const * e) const { return e == m_undef_proof; }
     bool is_asserted(expr const * e) const { return is_app_of(e, m_basic_family_id, PR_ASSERTED); }
     bool is_goal(expr const * e) const { return is_app_of(e, m_basic_family_id, PR_GOAL); }
     bool is_lemma(expr const * e) const { return is_app_of(e, m_basic_family_id, PR_LEMMA); }
     bool is_quant_inst(expr const* e, expr*& not_q_or_i, ptr_vector<expr>& binding) const;
     bool is_rewrite(expr const* e, expr*& r1, expr*& r2) const;
+    bool is_hyper_resolve(proof* p) const { return is_app_of(p, m_basic_family_id, PR_HYPER_RESOLVE); }
+    bool is_hyper_resolve(proof* p, 
+                          ref_vector<proof, ast_manager>& premises,
+                          obj_ref<expr, ast_manager>& conclusion,
+                          svector<std::pair<unsigned, unsigned> > & positions,
+                          vector<ref_vector<expr, ast_manager> >& substs);
 
     
     bool is_def_intro(expr const * e) const { return is_app_of(e, m_basic_family_id, PR_DEF_INTRO); }

lib/dl_bmc_engine.cpp

             return check_linear();
         }
         else {
+            check_nonlinear();
             IF_VERBOSE(1, verbose_stream() << "non-linear BMC is not supported\n";);
             return l_undef;
-            return check_nonlinear();
         }
     }
 
 
                  substs.push_back(sub1);
                  substs.push_back(sub);
-                 pr = util.mk_hyper_resolve(2, premises, concl, positions, substs);
+                 pr = m.mk_hyper_resolve(2, premises, concl, positions, substs);
                  r0 = r1;
              }
              else {
                  }
                  else {
                      substs.push_back(sub);
-                     pr = util.mk_hyper_resolve(1, &p, concl, positions, substs);
+                     pr = m.mk_hyper_resolve(1, &p, concl, positions, substs);
                  }
                  r0 = r2;
              }
                         path_arg = path_var.get();
                     }
                     else {
-                        path_arg = m.mk_app(succs[j-1], path_var.get());
+                        path_arg = m.mk_app(succs[j], path_var.get());
                     }
                     for (unsigned k = 0; k < q->get_arity(); ++k) {
                         expr* arg = r.get_tail(j)->get_arg(k);
                         path_arg = path_var.get();
                     }
                     else {
-                        path_arg = m.mk_app(succs[j-1], path_var.get());
+                        path_arg = m.mk_app(succs[j], path_var.get());
                     }
                     func_decl* q = r.get_decl(j);
                     for (unsigned k = 0; k < q->get_arity(); ++k) {
                     conjs.push_back(tmp);
                 }
                 bool_rewriter(m).mk_and(conjs.size(), conjs.c_ptr(), rule_body);
-                expr* rule_pred = m.mk_app(rule_pred_i, trace_arg.get(), path_var.get());
                 ptr_vector<sort> q_sorts;
                 vector<symbol> names;
                 for (unsigned i = 0; i < vars.size(); ++i) {
                 SASSERT(vars.size() == names.size());
                 symbol qid = r.name(), skid;
                 
-                patterns.reset();
-                patterns.push_back(m.mk_pattern(to_app(rule_pred)));
+                //patterns.reset();
+                //patterns.push_back(m.mk_pattern(to_app(rule_pred)));
+                //
+                //fml = m.mk_implies(rule_pred, rule_body);
+                //fml = m.mk_forall(vars.size(), q_sorts.c_ptr(), names.c_ptr(), fml, 1, qid, skid, 1, patterns.c_ptr());
+                //assert_expr(fml);
+
                 expr_ref fml(m);
-                fml = m.mk_implies(rule_pred, rule_body);
-                fml = m.mk_forall(vars.size(), q_sorts.c_ptr(), names.c_ptr(), fml, 1, qid, skid, 1, patterns.c_ptr());
-                std::cout << mk_pp(fml, m) << "\n";
+                tmp = m.mk_app(mk_predicate(p), trace_arg.get(), path_var.get());
+                patterns.reset();
+                patterns.push_back(m.mk_pattern(to_app(tmp)));
+                fml = m.mk_implies(tmp, rule_body);
+                fml = m.mk_forall(vars.size(), sorts.c_ptr(), names.c_ptr(), fml, 1, qid, skid, 1, patterns.c_ptr());
                 assert_expr(fml);
+                
             }
-            bool_rewriter(m).mk_or(rules.size(), rules.c_ptr(), tmp);
-            symbol names[2] = { symbol("Trace"), symbol("Path")  };
-            symbol qid = p->get_name(), skid;
-            patterns.reset();
-            patterns.push_back(m.mk_pattern(to_app(pred)));
-            expr_ref fml(m);
-            fml = m.mk_implies(pred, tmp);
-            fml = m.mk_forall(2, sorts, names, fml, 1, qid, skid, 1, patterns.c_ptr());
-            assert_expr(fml);
         }               
     }
 
     lbool bmc::check_query() {
         sort* trace_sort = m_pred2sort.find(m_query_pred);
         func_decl_ref q = mk_predicate(m_query_pred);
-        assert_expr(m.mk_app(q, m.mk_const(symbol("trace"), trace_sort), m.mk_const(symbol("path"),m_path_sort)));
+        expr_ref trace(m), path(m);
+        trace = m.mk_const(symbol("trace"), trace_sort);
+        path  = m.mk_const(symbol("path"),m_path_sort);
+        assert_expr(m.mk_app(q, trace, path));
         lbool is_sat = m_solver.check();
         if (is_sat == l_undef) {
             model_ref md;
             proof_ref pr(m);
             m_solver.get_model(md);
             IF_VERBOSE(2, model_smt2_pp(verbose_stream(), m, *md, 0););
-            
+            md->eval(trace, trace);
+            IF_VERBOSE(2, verbose_stream() << mk_pp(trace, m) << "\n";);
+            IF_VERBOSE(2, m_solver.display(verbose_stream()););
         }
         return is_sat;
     }

lib/dl_check_table.cpp

      table_base const* check_table_plugin::tocheck(table_base const* r) { return r?(get(*r).m_tocheck):0; }
 
     table_base * check_table_plugin::mk_empty(const table_signature & s) {
+        IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
         table_base* checker = m_checker.mk_empty(s);
         table_base* tocheck = m_tocheck.mk_empty(s);
         return alloc(check_table, *this, s, tocheck, checker);
         }
 
         virtual table_base* operator()(const table_base & t1, const table_base & t2) {
+            IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
             table_base* ttocheck = (*m_tocheck)(tocheck(t1), tocheck(t2));
             table_base* tchecker = (*m_checker)(checker(t1), checker(t2));
-            return alloc(check_table, get(t1).get_plugin(), ttocheck->get_signature(), ttocheck, tchecker);
+            check_table* result = alloc(check_table, get(t1).get_plugin(), ttocheck->get_signature(), ttocheck, tchecker);
+            return result;
         }
     };
 
         }
         
         virtual void operator()(table_base& tgt, const table_base& src, table_base* delta) {
+            IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
             (*m_tocheck)(tocheck(tgt), tocheck(src), tocheck(delta));
             (*m_checker)(checker(tgt), checker(src), checker(delta));
-            SASSERT(get(tgt).well_formed());
+            get(tgt).well_formed();
         }
     };
 
         }
 
         table_base* operator()(table_base const& src) {
+            IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
             table_base* tchecker = (*m_checker)(checker(src));
             table_base* ttocheck = (*m_tocheck)(tocheck(src));
-            return alloc(check_table, get(src).get_plugin(), tchecker->get_signature(), ttocheck, tchecker);
+            check_table* result = alloc(check_table, get(src).get_plugin(), tchecker->get_signature(), ttocheck, tchecker);
+            return result;
         }
     };
     
         }
 
         table_base* operator()(table_base const& src) {
+            IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
             table_base* tchecker = (*m_checker)(checker(src));
             table_base* ttocheck = (*m_tocheck)(tocheck(src));
-            return alloc(check_table, get(src).get_plugin(), ttocheck->get_signature(), ttocheck, tchecker);
+            check_table* result = alloc(check_table, get(src).get_plugin(), ttocheck->get_signature(), ttocheck, tchecker);
+            return result;
         }
     };
     
         void operator()(table_base & t) {
             (*m_checker)(checker(t));
             (*m_tocheck)(tocheck(t));
-            SASSERT(get(t).well_formed());
+            get(t).well_formed();
         }
     };
 
         virtual void operator()(table_base& src) {
             (*m_checker)(checker(src));
             (*m_tocheck)(tocheck(src));
-            SASSERT(get(src).well_formed());
+            get(src).well_formed();
         }
     };
 
         virtual void operator()(table_base& src) {
             (*m_checker)(checker(src));
             (*m_tocheck)(tocheck(src));
-            SASSERT(get(src).well_formed());
+            get(src).well_formed();
         }
     };
 
         }
 
         virtual void operator()(table_base& src, table_base const& negated_obj) {
+            IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
             (*m_checker)(checker(src), checker(negated_obj));
             (*m_tocheck)(tocheck(src), tocheck(negated_obj));
-            SASSERT(get(src).well_formed());
+            get(src).well_formed();
         }
         
     };
 
     check_table::check_table(check_table_plugin & p, const table_signature & sig):
         table_base(p, sig) {
-        SASSERT(well_formed());
+        (well_formed());
     }
 
     check_table::check_table(check_table_plugin & p, const table_signature & sig, table_base* tocheck, table_base* checker):
         table_base(p, sig),
         m_checker(checker),
         m_tocheck(tocheck) {            
-        SASSERT(well_formed());
+        well_formed();
     }
 
     check_table::~check_table() {
     }
 
     bool check_table::well_formed() const {
+        get_plugin().m_count++;
+        if (get_plugin().m_count == 497) {
+            std::cout << "here\n";
+        }
         iterator it = m_tocheck->begin(), end = m_tocheck->end();
         for (; it != end; ++it) {
             table_fact fact;
             if (!m_checker->contains_fact(fact)) {
                 m_tocheck->display(verbose_stream());
                 m_checker->display(verbose_stream());
+                verbose_stream() << get_plugin().m_count << "\n";
                 UNREACHABLE();
+                fatal_error(0);
                 return false;
             }
         }
             if (!m_tocheck->contains_fact(fact)) {
                 m_tocheck->display(verbose_stream());
                 m_checker->display(verbose_stream());
+                verbose_stream() << get_plugin().m_count << "\n";
                 UNREACHABLE();
+                fatal_error(0);
                 return false;
             }
         }
     }
 
     bool check_table::empty() const {
+        if (m_tocheck->empty() != m_checker->empty()) {
+            m_tocheck->display(verbose_stream());
+            m_checker->display(verbose_stream());
+            verbose_stream() << get_plugin().m_count << "\n";
+            fatal_error(0);
+        }
         return m_tocheck->empty();
     }
 
 
     void check_table::add_fact(const table_fact & f) {
+        IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
         m_tocheck->add_fact(f);
         m_checker->add_fact(f);
-        SASSERT(well_formed());        
+        well_formed();        
     }
 
     void check_table::remove_fact(const table_element*  f) {
+        IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
         m_tocheck->remove_fact(f);
         m_checker->remove_fact(f);
-        SASSERT(well_formed());        
+        well_formed();        
     }
 
     bool check_table::contains_fact(const table_fact & f) const {
     }
     
     table_base * check_table::clone() const {        
-        return alloc(check_table, get_plugin(), get_signature(), m_tocheck->clone(), m_checker->clone());
+        IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
+        check_table* result = alloc(check_table, get_plugin(), get_signature(), m_tocheck->clone(), m_checker->clone());
+        return result;
     }
 
     table_base * check_table::complement(func_decl* p) const {
-        return alloc(check_table, get_plugin(), get_signature(), m_tocheck->complement(p), m_checker->complement(p));
+        check_table* result = alloc(check_table, get_plugin(), get_signature(), m_tocheck->complement(p), m_checker->complement(p));
+        return result;
     }
 
 };

lib/dl_check_table.h

         friend class check_table;
         table_plugin& m_checker;
         table_plugin& m_tocheck;
+        unsigned m_count;
     protected:
         class join_fn;
         class union_fn;
         check_table_plugin(relation_manager & manager, symbol const& checker, symbol const& tocheck) 
             : table_plugin(symbol("check"), manager),
             m_checker(*manager.get_table_plugin(checker)),
-            m_tocheck(*manager.get_table_plugin(tocheck)) {}
+            m_tocheck(*manager.get_table_plugin(tocheck)), m_count(0) {}
 
         virtual table_base * mk_empty(const table_signature & s);
 

lib/dl_context.cpp

 #include"expr_functors.h"
 #include"dl_mk_partial_equiv.h"
 #include"dl_mk_bit_blast.h"
+#include"datatype_decl_plugin.h"
 
 namespace datalog {
 
     class context::engine_type_proc {
         ast_manager& m;
         arith_util   a;
+        datatype_util dt;
         DL_ENGINE    m_engine;
 
     public:
-        engine_type_proc(ast_manager& m): m(m), a(m), m_engine(DATALOG_ENGINE) {}
+        engine_type_proc(ast_manager& m): m(m), a(m), dt(m), m_engine(DATALOG_ENGINE) {}
 
         DL_ENGINE get_engine() const { return m_engine; }
         void operator()(expr* e) {
             else if (is_var(e) && m.is_bool(e)) {
                 m_engine = PDR_ENGINE;
             }
+            else if (dt.is_datatype(m.get_sort(e))) {
+                m_engine = PDR_ENGINE;
+            }
         }
     };
 
 
     lbool context::pdr_query(expr* query) {
         ensure_pdr();
-        lbool result  = m_pdr->query(query);
-        m_last_answer = m_pdr->get_answer();
-        return result;
+        m_last_answer = 0; 
+        return m_pdr->query(query);
     }
 
     void context::ensure_bmc() {
 
     lbool context::bmc_query(expr* query) {
         ensure_bmc();
-        lbool result = m_bmc->query(query);
-        m_last_answer = m_bmc->get_answer();
-        return result;
+        m_last_answer = 0;
+        return m_bmc->query(query);
     }
 
 #define BEGIN_QUERY()                           \
     }
     
     expr* context::get_answer_as_formula() {
+        if (m_last_answer) {
+            return m_last_answer.get();
+        }
+        switch(get_engine()) {
+        case PDR_ENGINE: 
+        case QPDR_ENGINE:
+            ensure_pdr();
+            m_last_answer = m_pdr->get_answer();
+            return m_last_answer.get();
+        case BMC_ENGINE:
+            ensure_bmc();
+            m_last_answer = m_bmc->get_answer();
+            return m_last_answer.get();
+        default:
+            UNREACHABLE();
+        }
+        m_last_answer = m.mk_false();
         return m_last_answer.get();
     }
 

lib/dl_decl_plugin.cpp

         return m_manager->mk_func_decl(m_clone_sym, 1, &s, s, info);
     }
 
-    func_decl * dl_decl_plugin::mk_hyper_res(unsigned num_params, parameter const* params, unsigned arity, sort *const* domain) {
-        ast_manager& m = *m_manager;
-        func_decl_info info(m_family_id, OP_DL_HYPER_RESOLVE, num_params, params);
-        return m_manager->mk_func_decl(m_hyper_resolve_sym, arity, domain, m_manager->mk_proof_sort(), info);
-    }
-
     func_decl * dl_decl_plugin::mk_func_decl(
         decl_kind k, unsigned num_parameters, parameter const * parameters, 
         unsigned arity, sort * const * domain, sort * range) {
                 result = mk_compare(OP_DL_LT, m_lt_sym, domain);
                 break;                
 
-            case OP_DL_HYPER_RESOLVE:
-                result = mk_hyper_res(num_parameters, parameters, arity, domain);
-                break;
-
             default:
                 m_manager->raise_exception("operator not recognized");
                 return 0;
         return m.mk_app(f, num_args, args);
     }
 
-    proof* dl_decl_util::mk_hyper_resolve(unsigned num_premises, proof* const* premises, expr* concl,
-                                          svector<std::pair<unsigned, unsigned> > const& positions,
-                                          vector<expr_ref_vector> const& substs) {
-        ptr_vector<expr> fmls;
-        SASSERT(positions.size() + 1 == substs.size());
-        for (unsigned i = 0; i < num_premises; ++i) {
-            TRACE("dl", tout << mk_pp(premises[i], m) << "\n";);
-            fmls.push_back(m.get_fact(premises[i]));
-        }
-        SASSERT(m.is_bool(concl));
-        vector<parameter> params;
-        for (unsigned i = 0; i < substs.size(); ++i) {
-            expr_ref_vector const& vec = substs[i];
-            for (unsigned j = 0; j < vec.size(); ++j) {
-                params.push_back(parameter(vec[j]));
-            }
-            if (i + 1 < substs.size()) {
-                params.push_back(parameter(positions[i].first));
-                params.push_back(parameter(positions[i].second));
-            }
-        }
-        ptr_vector<sort> sorts;
-        ptr_vector<expr> args;
-        for (unsigned i = 0; i < num_premises; ++i) {
-            sorts.push_back(m.mk_proof_sort());
-            args.push_back(premises[i]);
-        }
-        sorts.push_back(m.mk_bool_sort());
-        args.push_back(concl);
-        app* result = m.mk_app(m_fid, OP_DL_HYPER_RESOLVE, params.size(), params.c_ptr(), args.size(), args.c_ptr());
-        SASSERT(result->get_family_id() == m_fid);
-        SASSERT(result->get_decl_kind() == OP_DL_HYPER_RESOLVE);
-        return result;
-    }
-
-    bool dl_decl_util::is_hyper_resolve(
-        proof* p, 
-        proof_ref_vector& premises,
-        expr_ref& conclusion,
-        svector<std::pair<unsigned, unsigned> > & positions,
-        vector<expr_ref_vector> & substs) const {
-        if (!is_hyper_resolve(p)) {
-            return false;
-        }
-        unsigned sz = p->get_num_args();
-        SASSERT(sz > 0);
-        for (unsigned i = 0; i + 1 < sz; ++i) {
-            premises.push_back(to_app(p->get_arg(i)));
-        }
-        conclusion = p->get_arg(sz-1);
-        func_decl* d = p->get_decl();
-        unsigned num_p = d->get_num_parameters();
-        parameter const* params = d->get_parameters();
-        
-        substs.push_back(expr_ref_vector(m));
-        for (unsigned i = 0; i < num_p; ++i) {
-            if (params[i].is_int()) {
-                SASSERT(i + 1 < num_p);
-                SASSERT(params[i+1].is_int());
-                unsigned x = static_cast<unsigned>(params[i].get_int());
-                unsigned y = static_cast<unsigned>(params[i+1].get_int());
-                positions.push_back(std::make_pair(x, y));
-                substs.push_back(expr_ref_vector(m));
-                ++i;
-            }
-            else {
-                SASSERT(params[i].is_ast());
-                ast* a = params[i].get_ast();
-                SASSERT(is_expr(a));
-                substs.back().push_back(to_expr(a));                
-            }
-        }
-
-        return true;
-    }
-
 };

lib/dl_decl_plugin.h

         OP_RA_CLONE,
         OP_DL_CONSTANT,
         OP_DL_LT,
-        OP_DL_HYPER_RESOLVE,
         LAST_RA_OP
     };
     
 
         family_id get_family_id() const { return m_fid; }
 
-        /**
-           \brief Hyper-resolution rule that works for Horn clauses (implication)
-           
-           Somewhat related to unit resolution and resolution rule from SPC, but
-           a general sledgehammer rule. 
-           The clause/implication from the first premise is the main clause.
-           One of the literals in each of the other premises is resolved with the main clause.
-           
-           The facts in the premises are closed formulas. Substitutions required for unification
-           are passed in.
-
-           positions is a vector of pairs of positions in the main clause and the side clause.
-
-           For clauses that are disjunctions the positions are indexed from 0 starting with the first
-           literal.
-
-           We use the following (Prolog style) convention for Horn implications:
-           The head of a Horn implication is position 0,
-           the first conjunct in the body of an implication is position 1
-           the second conjunct in the body of an implication is position 2
-
-           For general implications where the head is a disjunction, the
-           first n positions correspond to the n disjuncts in the head.
-           The next m positions correspond to the m conjuncts in the body.
-        */
-        proof* mk_hyper_resolve(unsigned num_premises, proof* const* premises, expr* concl,
-                                svector<std::pair<unsigned, unsigned> > const& positions,
-                                vector<expr_ref_vector> const& substs);
-
-        bool is_hyper_resolve(proof* p) const { return is_app_of(p, m_fid, OP_DL_HYPER_RESOLVE); }
-
-
-        /**
-            \brief extract components of a hyper-resolution proof rule.
-
-        */
-        bool is_hyper_resolve(proof* p, 
-                              proof_ref_vector& premises,
-                              expr_ref& conclusion,
-                              svector<std::pair<unsigned, unsigned> > & positions,
-                              vector<expr_ref_vector>& substs) const;
-
     };
     
 };

lib/dl_mk_rule_inliner.cpp

         }
         m_subst.reset();
         m_subst.reserve_vars(max_var+1);
-        m_subst.reserve_offsets(std::max(m_tail_index.get_approx_num_regs(), m_head_index.get_approx_num_regs()));
+        m_subst.reserve_offsets(std::max(m_tail_index.get_approx_num_regs(), 2+m_head_index.get_approx_num_regs()));
 
         svector<bool> valid;
         valid.reset();

lib/dl_mk_slice.cpp

             proof_ref_vector premises0(m);
             vector<expr_ref_vector> substs, substs0;
 
-            if (!util.is_hyper_resolve(p, premises0, slice_concl, positions, substs0)) {
+            if (!m.is_hyper_resolve(p, premises0, slice_concl, positions, substs0)) {
                 return false;
             }
             unsigned num_args = p->get_num_args();
                 r1 = r3;
             }
             r1->to_formula(concl);
-            proof* new_p = util.mk_hyper_resolve(premises.size(), premises.c_ptr(), concl, positions, substs);
+            proof* new_p = m.mk_hyper_resolve(premises.size(), premises.c_ptr(), concl, positions, substs);
             m_pinned_exprs.push_back(new_p);
             m_pinned_rules.push_back(r1.get());
             m_sliceform2rule.insert(slice_concl, r1.get());

lib/dl_skip_table.cpp

                 col2 = m_cycle[0];
                 swap2(n, col1, col2);
             }
-            return alloc(skip_table, s.get_plugin(), get_result_signature(), n);
+            skip_table* res = alloc(skip_table, s.get_plugin(), get_result_signature(), n);
+            TRACE("skip",res->display(tout););
+            return res;
         }
     };
     
                     body.push_back(r.get_tail(i));
                 }
             }
+            TRACE("dl_dr", 
+                  tout << r.get_decl()->get_name() << "\n";
+                  for (unsigned i = 0; i < body.size(); ++i) {
+                      tout << mk_pp(body[i].get(), m) << "\n";
+                  });
+                      
             mc->insert(r.get_head(), body.size(), body.c_ptr());
         }
     }
               tout << premises[0]->get_id() << " " << mk_pp(premises[0].get(), m) << "\n";
               tout << premises[1]->get_id() << " " << mk_pp(premises[1].get(), m) << "\n";); 
 
-        pr = util.mk_hyper_resolve(2, premises.c_ptr(), fml3, positions, substs);
+        pr = m.mk_hyper_resolve(2, premises.c_ptr(), fml3, positions, substs);
         pc->insert(pr);
     }
 
     out << "\n  :precision " << prec() << " :depth " << depth() << ")" << std::endl;
 }
 
+void goal::display_with_dependencies(std::ostream & out) const {
+    ptr_vector<expr> deps;
+    out << "(goal";
+    unsigned sz = size();
+    for (unsigned i = 0; i < sz; i++) {
+        out << "\n  |-";
+        deps.reset();
+        m().linearize(dep(i), deps);
+        ptr_vector<expr>::iterator it  = deps.begin();
+        ptr_vector<expr>::iterator end = deps.end();
+        for (; it != end; ++it) {
+            expr * d = *it;
+            if (is_uninterp_const(d)) {
+                out << " " << mk_ismt2_pp(d, m());
+            }
+            else {
+                out << " #" << d->get_id();
+            }
+        }
+        out << "\n  " << mk_ismt2_pp(form(i), m(), 2);
+    }
+    out << "\n  :precision " << prec() << " :depth " << depth() << ")" << std::endl;
+}
+
 void goal::display(cmd_context & ctx) const {
     display(ctx, ctx.regular_stream());
 }
                     proof * prs[2] = { pr(get_idx(atom)), pr(i) };
                     p = m().mk_unit_resolution(2, prs);
                 }
-                expr_dependency * d = 0;
+                expr_dependency_ref d(m());
                 if (unsat_core_enabled())
                     d = m().mk_join(dep(get_idx(atom)), dep(i));
                 push_back(m().mk_false(), p, d);                    
                     proof * prs[2] = { pr(get_not_idx(f)), pr(i) };
                     p = m().mk_unit_resolution(2, prs);
                 }
-                expr_dependency * d = 0;
+                expr_dependency_ref d(m());
                 if (unsat_core_enabled())
                     d = m().mk_join(dep(get_not_idx(f)), dep(i));
                 push_back(m().mk_false(), p, d);
     void display_dimacs(std::ostream & out) const;
     void display_with_dependencies(cmd_context & ctx, std::ostream & out) const;
     void display_with_dependencies(cmd_context & ctx) const;
+    void display_with_dependencies(std::ostream & out) const;
 
     bool sat_preserved() const { 
         return prec() == PRECISE || prec() == UNDER; 

lib/horn_subsume_model_converter.cpp

 #include "ast_pp.h"
 #include "model_smt2_pp.h"
 #include "bool_rewriter.h"
+#include "th_rewriter.h"
 
 void horn_subsume_model_converter::insert(app* head, expr* body) {
     func_decl_ref pred(m);
     }
 }
 
+void horn_subsume_model_converter::add_default_proc::operator()(app* n) {
+    //
+    // predicates that have not been assigned values 
+    // in the Horn model are assumed false.
+    //
+    if (m.is_bool(n) && 
+        !m_md->has_interpretation(n->get_decl()) &&
+        (n->get_family_id() == null_family_id)) {
+        TRACE("dl_mc", tout << "adding: " << n->get_decl()->get_name() << "\n";);
+        if (n->get_decl()->get_arity() == 0) {
+            m_md->register_decl(n->get_decl(), m.mk_false());
+        }
+        else { 
+            func_interp* fi = alloc(func_interp, m, n->get_decl()->get_arity());
+            fi->set_else(m.mk_false());
+            m_md->register_decl(n->get_decl(), fi);            
+        }
+    }
+}
+
+void horn_subsume_model_converter::add_default_false_interpretation(expr* e, model_ref& md) {
+    add_default_proc proc(m, md);
+    for_each_expr(proc, e);
+}
+
 
 void horn_subsume_model_converter::operator()(model_ref& mr) {
+    TRACE("dl_mc", model_smt2_pp(tout, m, *mr, 0););
     for (unsigned i = m_funcs.size(); i > 0; ) {
         --i;
         func_decl* h = m_funcs[i].get();
         expr_ref body(m_bodies[i].get(), m);
         unsigned arity = h->get_arity();
-        
+        add_default_false_interpretation(body, mr);
+                
+        TRACE("dl_mc", tout << "eval: " << h->get_name() << "\n" << mk_pp(body, m) << "\n";);
         expr_ref tmp(body);
         mr->eval(tmp, body);
-        TRACE("dl", tout << "eval: " << mk_pp(tmp, m) << "\nto:\n" << mk_pp(body, m) << "\n";);
-        TRACE("dl", model_smt2_pp(tout, m, *mr, 0););
+        th_rewriter rw(m);
+        rw(body);
         
+        TRACE("dl_mc", tout << "to:\n" << mk_pp(body, m) << "\n";);
+                
         if (arity == 0) {
             expr* e = mr->get_const_interp(h);
             if (e) {

lib/horn_subsume_model_converter.h

     func_decl_ref_vector m_funcs;
     expr_ref_vector      m_bodies;
 
+    void add_default_false_interpretation(expr* e, model_ref& md);
+
+    struct add_default_proc {
+        ast_manager& m;
+        model_ref& m_md;
+        add_default_proc(ast_manager& m, model_ref& md): m(m), m_md(md) {}
+        void operator()(app* n);
+        void operator()(expr* n) {}
+    };
+
 public:
 
     horn_subsume_model_converter(ast_manager& m): m(m), m_funcs(m), m_bodies(m) {}
 
 void imdd_manager::deallocate_imdd(imdd * d) { 
     SASSERT(d->is_dead());
+    memset(d, 0, sizeof(*d));
     m_alloc.deallocate(sizeof(imdd), d); 
 }
 
 
                 if (head1 < head2) {
                     it1.move_to(head2);
-                    head1 = it1 != end1 ? it1->begin_key() : UINT_MAX;
+                    head1 = it1 != end1 ? (it1->begin_key() < head2?head2:it1->begin_key()): UINT_MAX;
                 }
                 else if (head1 > head2) {
                     copy_upto(head2, it2, end2, head1, to_insert);
 }
 
 void imdd_manager::merge_intervals(svector<interval>& dst, svector<interval> const& src) {
-    svector<interval> tmp;
+    svector<interval>& tmp = m_i_nodes_tmp;
+    tmp.reset();
     // invariant: intervals are sorted.
     for (unsigned i = 0, j = 0; i < src.size() || j < dst.size();) {
         SASSERT(!(i + 1 < src.size()) || src[i].m_hi < src[i+1].m_lo);
     // For each level up to 'v' create a list of nodes visited
     // insert to a map the set of intervals that visit the node.
     // 
-    filter_id_map nodes;
-    filter_id_map::obj_map_entry* e;
+    m_nodes.reset();
+    filter_id_map& nodes = m_nodes;
     imdd* d1, *d2, *d3;
     vector<ptr_vector<imdd> > levels;
     levels.push_back(ptr_vector<imdd>());
     imdd* curr_child;
     for (; it != end; ++it) {
         curr_child = it->val();
-        e = nodes.insert_if_not_there2(curr_child, svector<interval>());
-        if (e->get_data().m_value.empty()) {
+        svector<interval>& iv = nodes.init(curr_child);
+        if (iv.empty()) {
             levels.back().push_back(curr_child);
         }
-        e->get_data().m_value.push_back(interval(it->begin_key(), it->end_key()));        
+        iv.push_back(interval(it->begin_key(), it->end_key()));        
     }
 
     for (unsigned j = 0; j+1 < v; ++j) {
         levels.push_back(ptr_vector<imdd>());        
         for (unsigned i = 0; i < levels[j].size(); ++i) {
             d1 = levels[j][i];
-            svector<interval> i_nodes = nodes.find(d1);
+            svector<interval>& i_nodes = nodes.init(d1);
             it  = d1->begin_children();
             end = d1->end_children();
             for(; it != end; ++it) {
                 imdd* curr_child = it->val();
-                e = nodes.insert_if_not_there2(curr_child, svector<interval>());
-                svector<interval>& i_nodes2 = e->get_data().m_value;
+                svector<interval>& i_nodes2 = nodes.init(curr_child);
                 if (i_nodes2.empty()) {