mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 13:29:11 +00:00 
			
		
		
		
	Merge branch 'master' of https://github.com/z3prover/z3
This commit is contained in:
		
						commit
						8a93f34b4a
					
				
					 203 changed files with 1023 additions and 1587 deletions
				
			
		| 
						 | 
					@ -34,7 +34,7 @@ endif()
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
set(Z3_VERSION_MAJOR 4)
 | 
					set(Z3_VERSION_MAJOR 4)
 | 
				
			||||||
set(Z3_VERSION_MINOR 8)
 | 
					set(Z3_VERSION_MINOR 8)
 | 
				
			||||||
set(Z3_VERSION_PATCH 1)
 | 
					set(Z3_VERSION_PATCH 2)
 | 
				
			||||||
set(Z3_VERSION_TWEAK 0)
 | 
					set(Z3_VERSION_TWEAK 0)
 | 
				
			||||||
set(Z3_VERSION "${Z3_VERSION_MAJOR}.${Z3_VERSION_MINOR}.${Z3_VERSION_PATCH}.${Z3_VERSION_TWEAK}")
 | 
					set(Z3_VERSION "${Z3_VERSION_MAJOR}.${Z3_VERSION_MINOR}.${Z3_VERSION_PATCH}.${Z3_VERSION_TWEAK}")
 | 
				
			||||||
set(Z3_FULL_VERSION_STR "${Z3_VERSION}") # Note this might be modified
 | 
					set(Z3_FULL_VERSION_STR "${Z3_VERSION}") # Note this might be modified
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,13 +8,13 @@
 | 
				
			||||||
# FIXME: All the commented out defines should be removed once
 | 
					# FIXME: All the commented out defines should be removed once
 | 
				
			||||||
# we are confident it is correct to not set them.
 | 
					# we are confident it is correct to not set them.
 | 
				
			||||||
set(Z3_MSVC_LEGACY_DEFINES
 | 
					set(Z3_MSVC_LEGACY_DEFINES
 | 
				
			||||||
  # Don't set `_DEBUG`. The old build sytem sets this but this
 | 
					  # Don't set `_DEBUG`. The old build system sets this but this
 | 
				
			||||||
  # is wrong. MSVC will set this depending on which runtime is being used.
 | 
					  # is wrong. MSVC will set this depending on which runtime is being used.
 | 
				
			||||||
  # See https://msdn.microsoft.com/en-us/library/b0084kay.aspx
 | 
					  # See https://msdn.microsoft.com/en-us/library/b0084kay.aspx
 | 
				
			||||||
  # _DEBUG
 | 
					  # _DEBUG
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # The old build system only set `UNICODE` and `_UNICODE` for x86_64 release.
 | 
					  # The old build system only set `UNICODE` and `_UNICODE` for x86_64 release.
 | 
				
			||||||
  # That seems completly wrong so set it for all configurations.
 | 
					  # That seems completely wrong so set it for all configurations.
 | 
				
			||||||
  # According to https://blogs.msdn.microsoft.com/oldnewthing/20040212-00/?p=40643/
 | 
					  # According to https://blogs.msdn.microsoft.com/oldnewthing/20040212-00/?p=40643/
 | 
				
			||||||
  # `UNICODE` affects Windows headers and `_UNICODE` affects C runtime header files.
 | 
					  # `UNICODE` affects Windows headers and `_UNICODE` affects C runtime header files.
 | 
				
			||||||
  # There is some discussion of this define at https://msdn.microsoft.com/en-us/library/dybsewaf.aspx
 | 
					  # There is some discussion of this define at https://msdn.microsoft.com/en-us/library/dybsewaf.aspx
 | 
				
			||||||
| 
						 | 
					@ -116,7 +116,7 @@ z3_add_cxx_flag("/analyze-" REQUIRED)
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# By default CMake enables incremental linking for Debug and RelWithDebInfo
 | 
					# By default CMake enables incremental linking for Debug and RelWithDebInfo
 | 
				
			||||||
# builds. The old build sytem disables it for all builds so try to do the same
 | 
					# builds. The old build system disables it for all builds so try to do the same
 | 
				
			||||||
# by changing all configurations if necessary
 | 
					# by changing all configurations if necessary
 | 
				
			||||||
string(TOUPPER "${available_build_types}" _build_types_as_upper)
 | 
					string(TOUPPER "${available_build_types}" _build_types_as_upper)
 | 
				
			||||||
foreach (_build_type ${_build_types_as_upper})
 | 
					foreach (_build_type ${_build_types_as_upper})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ function(z3_expand_dependencies output_var)
 | 
				
			||||||
  if (ARGC LESS 2)
 | 
					  if (ARGC LESS 2)
 | 
				
			||||||
    message(FATAL_ERROR "Invalid number of arguments")
 | 
					    message(FATAL_ERROR "Invalid number of arguments")
 | 
				
			||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
  # Remaing args should be component names
 | 
					  # Remaining args should be component names
 | 
				
			||||||
  set(_expanded_deps ${ARGN})
 | 
					  set(_expanded_deps ${ARGN})
 | 
				
			||||||
  set(_old_number_of_deps 0)
 | 
					  set(_old_number_of_deps 0)
 | 
				
			||||||
  list(LENGTH _expanded_deps _number_of_deps)
 | 
					  list(LENGTH _expanded_deps _number_of_deps)
 | 
				
			||||||
| 
						 | 
					@ -33,7 +33,7 @@ function(z3_add_component_dependencies_to_target target_name)
 | 
				
			||||||
  if (NOT (TARGET ${target_name}))
 | 
					  if (NOT (TARGET ${target_name}))
 | 
				
			||||||
    message(FATAL_ERROR "Target \"${target_name}\" does not exist")
 | 
					    message(FATAL_ERROR "Target \"${target_name}\" does not exist")
 | 
				
			||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
  # Remaing args should be component names
 | 
					  # Remaining args should be component names
 | 
				
			||||||
  set(_expanded_deps ${ARGN})
 | 
					  set(_expanded_deps ${ARGN})
 | 
				
			||||||
  foreach (dependency ${_expanded_deps})
 | 
					  foreach (dependency ${_expanded_deps})
 | 
				
			||||||
    # Ensure this component's dependencies are built before this component.
 | 
					    # Ensure this component's dependencies are built before this component.
 | 
				
			||||||
| 
						 | 
					@ -219,7 +219,7 @@ macro(z3_add_component component_name)
 | 
				
			||||||
  # Record this component's dependencies
 | 
					  # Record this component's dependencies
 | 
				
			||||||
  foreach (dependency ${Z3_MOD_COMPONENT_DEPENDENCIES})
 | 
					  foreach (dependency ${Z3_MOD_COMPONENT_DEPENDENCIES})
 | 
				
			||||||
    if (NOT (TARGET ${dependency}))
 | 
					    if (NOT (TARGET ${dependency}))
 | 
				
			||||||
      message(FATAL_ERROR "Component \"${component_name}\" depends on a non existant component \"${dependency}\"")
 | 
					      message(FATAL_ERROR "Component \"${component_name}\" depends on a non existent component \"${dependency}\"")
 | 
				
			||||||
    endif()
 | 
					    endif()
 | 
				
			||||||
    set_property(GLOBAL APPEND PROPERTY Z3_${component_name}_DEPS "${dependency}")
 | 
					    set_property(GLOBAL APPEND PROPERTY Z3_${component_name}_DEPS "${dependency}")
 | 
				
			||||||
  endforeach()
 | 
					  endforeach()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
# Continous integration scripts
 | 
					# Continuous integration scripts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## TravisCI
 | 
					## TravisCI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@ the future.
 | 
				
			||||||
* `Z3_VERBOSE_BUILD_OUTPUT` - Show compile commands in CMake builds (`0` or `1`)
 | 
					* `Z3_VERBOSE_BUILD_OUTPUT` - Show compile commands in CMake builds (`0` or `1`)
 | 
				
			||||||
* `Z3_STATIC_BUILD` - Build Z3 binaries and libraries statically (`0` or `1`)
 | 
					* `Z3_STATIC_BUILD` - Build Z3 binaries and libraries statically (`0` or `1`)
 | 
				
			||||||
* `Z3_SYSTEM_TEST_GIT_REVISION` - Git revision of [z3test](https://github.com/Z3Prover/z3test). If empty lastest revision will be used.
 | 
					* `Z3_SYSTEM_TEST_GIT_REVISION` - Git revision of [z3test](https://github.com/Z3Prover/z3test). If empty lastest revision will be used.
 | 
				
			||||||
* `Z3_WARNINGS_AS_ERRORS` - Set the `WARNINGS_AS_ERRORS` CMake option pased to Z3 (`OFF`, `ON`, or `SERIOUS_ONLY`)
 | 
					* `Z3_WARNINGS_AS_ERRORS` - Set the `WARNINGS_AS_ERRORS` CMake option passed to Z3 (`OFF`, `ON`, or `SERIOUS_ONLY`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Linux
 | 
					### Linux
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -944,7 +944,7 @@ HTML_STYLESHEET        =
 | 
				
			||||||
# user-defined cascading style sheet that is included after the standard
 | 
					# user-defined cascading style sheet that is included after the standard
 | 
				
			||||||
# style sheets created by doxygen. Using this option one can overrule
 | 
					# style sheets created by doxygen. Using this option one can overrule
 | 
				
			||||||
# certain style aspects. This is preferred over using HTML_STYLESHEET
 | 
					# certain style aspects. This is preferred over using HTML_STYLESHEET
 | 
				
			||||||
# since it does not replace the standard style sheet and is therefor more
 | 
					# since it does not replace the standard style sheet and is therefore more
 | 
				
			||||||
# robust against future updates. Doxygen will copy the style sheet file to
 | 
					# robust against future updates. Doxygen will copy the style sheet file to
 | 
				
			||||||
# the output directory.
 | 
					# the output directory.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1711,7 +1711,7 @@ UML_LOOK               = NO
 | 
				
			||||||
# the class node. If there are many fields or methods and many nodes the
 | 
					# the class node. If there are many fields or methods and many nodes the
 | 
				
			||||||
# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
 | 
					# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
 | 
				
			||||||
# threshold limits the number of items for each type to make the size more
 | 
					# threshold limits the number of items for each type to make the size more
 | 
				
			||||||
# managable. Set this to 0 for no limit. Note that the threshold may be
 | 
					# manageable. Set this to 0 for no limit. Note that the threshold may be
 | 
				
			||||||
# exceeded by 50% before the limit is enforced.
 | 
					# exceeded by 50% before the limit is enforced.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
UML_LIMIT_NUM_FIELDS   = 10
 | 
					UML_LIMIT_NUM_FIELDS   = 10
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,8 +7,8 @@ find_package(Z3
 | 
				
			||||||
  REQUIRED
 | 
					  REQUIRED
 | 
				
			||||||
  CONFIG
 | 
					  CONFIG
 | 
				
			||||||
  # `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
 | 
					  # `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
 | 
				
			||||||
  # This should prevent us from accidently picking up an installed
 | 
					  # This should prevent us from accidentally picking up an installed
 | 
				
			||||||
  # copy of Z3. This is here to benefit Z3's build sytem when building
 | 
					  # copy of Z3. This is here to benefit Z3's build system when building
 | 
				
			||||||
  # this project. When making your own project you probably shouldn't
 | 
					  # this project. When making your own project you probably shouldn't
 | 
				
			||||||
  # use this option.
 | 
					  # use this option.
 | 
				
			||||||
  NO_DEFAULT_PATH
 | 
					  NO_DEFAULT_PATH
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -835,6 +835,17 @@ void tst_visit() {
 | 
				
			||||||
    visit(f);
 | 
					    visit(f);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void tst_numeral() {
 | 
				
			||||||
 | 
					    context c;
 | 
				
			||||||
 | 
					    expr x = c.real_val("1/3");
 | 
				
			||||||
 | 
					    double d = 0;
 | 
				
			||||||
 | 
					    if (!x.is_numeral(d)) {
 | 
				
			||||||
 | 
					        std::cout << x << " is not recognized as a numeral\n";
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    std::cout << x << " is " << d << "\n";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void incremental_example1() {
 | 
					void incremental_example1() {
 | 
				
			||||||
    std::cout << "incremental example1\n";
 | 
					    std::cout << "incremental example1\n";
 | 
				
			||||||
    context c;
 | 
					    context c;
 | 
				
			||||||
| 
						 | 
					@ -1212,6 +1223,7 @@ int main() {
 | 
				
			||||||
        tactic_example9(); std::cout << "\n";
 | 
					        tactic_example9(); std::cout << "\n";
 | 
				
			||||||
        tactic_qe(); std::cout << "\n";
 | 
					        tactic_qe(); std::cout << "\n";
 | 
				
			||||||
        tst_visit(); std::cout << "\n";
 | 
					        tst_visit(); std::cout << "\n";
 | 
				
			||||||
 | 
					        tst_numeral(); std::cout << "\n";
 | 
				
			||||||
        incremental_example1(); std::cout << "\n";
 | 
					        incremental_example1(); std::cout << "\n";
 | 
				
			||||||
        incremental_example2(); std::cout << "\n";
 | 
					        incremental_example2(); std::cout << "\n";
 | 
				
			||||||
        incremental_example3(); std::cout << "\n";
 | 
					        incremental_example3(); std::cout << "\n";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,8 +24,8 @@ find_package(Z3
 | 
				
			||||||
  REQUIRED
 | 
					  REQUIRED
 | 
				
			||||||
  CONFIG
 | 
					  CONFIG
 | 
				
			||||||
  # `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
 | 
					  # `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
 | 
				
			||||||
  # This should prevent us from accidently picking up an installed
 | 
					  # This should prevent us from accidentally picking up an installed
 | 
				
			||||||
  # copy of Z3. This is here to benefit Z3's build sytem when building
 | 
					  # copy of Z3. This is here to benefit Z3's build system when building
 | 
				
			||||||
  # this project. When making your own project you probably shouldn't
 | 
					  # this project. When making your own project you probably shouldn't
 | 
				
			||||||
  # use this option.
 | 
					  # use this option.
 | 
				
			||||||
  NO_DEFAULT_PATH
 | 
					  NO_DEFAULT_PATH
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -363,10 +363,10 @@ namespace test_mapi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Console.WriteLine("Model = " + s.Model);
 | 
					            Console.WriteLine("Model = " + s.Model);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Console.WriteLine("Interpretation of MyArray:\n" + s.Model.FuncInterp(aex.FuncDecl));
 | 
					            //Console.WriteLine("Interpretation of MyArray:\n" + s.Model.ConstInterp(aex.FuncDecl));
 | 
				
			||||||
            Console.WriteLine("Interpretation of x:\n" + s.Model.ConstInterp(xc));
 | 
					            Console.WriteLine("Interpretation of x:\n" + s.Model.ConstInterp(xc));
 | 
				
			||||||
            Console.WriteLine("Interpretation of f:\n" + s.Model.FuncInterp(fd));
 | 
					            Console.WriteLine("Interpretation of f:\n" + s.Model.FuncInterp(fd));
 | 
				
			||||||
            Console.WriteLine("Interpretation of MyArray as Term:\n" + s.Model.FuncInterp(aex.FuncDecl));
 | 
					            //Console.WriteLine("Interpretation of MyArray as Term:\n" + s.Model.ConstInterp(aex.FuncDecl));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,8 +11,8 @@ find_package(Z3
 | 
				
			||||||
  REQUIRED
 | 
					  REQUIRED
 | 
				
			||||||
  CONFIG
 | 
					  CONFIG
 | 
				
			||||||
  # `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
 | 
					  # `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
 | 
				
			||||||
  # This should prevent us from accidently picking up an installed
 | 
					  # This should prevent us from accidentally picking up an installed
 | 
				
			||||||
  # copy of Z3. This is here to benefit Z3's build sytem when building
 | 
					  # copy of Z3. This is here to benefit Z3's build system when building
 | 
				
			||||||
  # this project. When making your own project you probably shouldn't
 | 
					  # this project. When making your own project you probably shouldn't
 | 
				
			||||||
  # use this option.
 | 
					  # use this option.
 | 
				
			||||||
  NO_DEFAULT_PATH
 | 
					  NO_DEFAULT_PATH
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -226,7 +226,7 @@ namespace Microsoft.SolverFoundation.Plugin.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Adds a MSF variable with the coresponding assertion to the Z3 variables.
 | 
					        /// Adds a MSF variable with the corresponding assertion to the Z3 variables.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="vid">The MSF id of the variable</param>
 | 
					        /// <param name="vid">The MSF id of the variable</param>
 | 
				
			||||||
        internal void AddVariable(int vid)
 | 
					        internal void AddVariable(int vid)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,8 +7,8 @@ find_package(Z3
 | 
				
			||||||
  REQUIRED
 | 
					  REQUIRED
 | 
				
			||||||
  CONFIG
 | 
					  CONFIG
 | 
				
			||||||
  # `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
 | 
					  # `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
 | 
				
			||||||
  # This should prevent us from accidently picking up an installed
 | 
					  # This should prevent us from accidentally picking up an installed
 | 
				
			||||||
  # copy of Z3. This is here to benefit Z3's build sytem when building
 | 
					  # copy of Z3. This is here to benefit Z3's build system when building
 | 
				
			||||||
  # this project. When making your own project you probably shouldn't
 | 
					  # this project. When making your own project you probably shouldn't
 | 
				
			||||||
  # use this option.
 | 
					  # use this option.
 | 
				
			||||||
  NO_DEFAULT_PATH
 | 
					  NO_DEFAULT_PATH
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -233,7 +233,7 @@ class env {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void check_arity(unsigned num_args, unsigned arity) {
 | 
					    void check_arity(unsigned num_args, unsigned arity) {
 | 
				
			||||||
        if (num_args != arity) {
 | 
					        if (num_args != arity) {
 | 
				
			||||||
            throw failure_ex("arity missmatch");
 | 
					            throw failure_ex("arity mismatch");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@ from mk_util import *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Z3 Project definition
 | 
					# Z3 Project definition
 | 
				
			||||||
def init_project_def():
 | 
					def init_project_def():
 | 
				
			||||||
    set_version(4, 8, 1, 0)
 | 
					    set_version(4, 8, 2, 0)
 | 
				
			||||||
    add_lib('util', [], includes2install = ['z3_version.h'])
 | 
					    add_lib('util', [], includes2install = ['z3_version.h'])
 | 
				
			||||||
    add_lib('polynomial', ['util'], 'math/polynomial')
 | 
					    add_lib('polynomial', ['util'], 'math/polynomial')
 | 
				
			||||||
    add_lib('sat', ['util'])
 | 
					    add_lib('sat', ['util'])
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3494,7 +3494,7 @@ class MakeRuleCmd(object):
 | 
				
			||||||
        needed commands used in Makefile rules
 | 
					        needed commands used in Makefile rules
 | 
				
			||||||
        Note that several of the method are meant for use during ``make
 | 
					        Note that several of the method are meant for use during ``make
 | 
				
			||||||
        install`` and ``make uninstall``.  These methods correctly use
 | 
					        install`` and ``make uninstall``.  These methods correctly use
 | 
				
			||||||
        ``$(PREFIX)`` and ``$(DESTDIR)`` and therefore are preferrable
 | 
					        ``$(PREFIX)`` and ``$(DESTDIR)`` and therefore are preferable
 | 
				
			||||||
        to writing commands manually which can be error prone.
 | 
					        to writing commands manually which can be error prone.
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    @classmethod
 | 
					    @classmethod
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -276,7 +276,7 @@ struct lackr_model_constructor::imp {
 | 
				
			||||||
            SASSERT(a->get_num_args() == 0);
 | 
					            SASSERT(a->get_num_args() == 0);
 | 
				
			||||||
            func_decl * const fd = a->get_decl();
 | 
					            func_decl * const fd = a->get_decl();
 | 
				
			||||||
            expr * val = m_abstr_model->get_const_interp(fd);
 | 
					            expr * val = m_abstr_model->get_const_interp(fd);
 | 
				
			||||||
            if (val == nullptr) { // TODO: avoid model completetion?
 | 
					            if (val == nullptr) { // TODO: avoid model completion?
 | 
				
			||||||
                sort * s = fd->get_range();
 | 
					                sort * s = fd->get_range();
 | 
				
			||||||
                val = m_abstr_model->get_some_value(s);
 | 
					                val = m_abstr_model->get_some_value(s);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -219,7 +219,7 @@ namespace api {
 | 
				
			||||||
        if (m_user_ref_count) {
 | 
					        if (m_user_ref_count) {
 | 
				
			||||||
            // Corner case bug: n may be in m_last_result, and this is the only reference to n.
 | 
					            // Corner case bug: n may be in m_last_result, and this is the only reference to n.
 | 
				
			||||||
            // When, we execute reset() it is deleted
 | 
					            // When, we execute reset() it is deleted
 | 
				
			||||||
            // To avoid this bug, I bump the reference counter before reseting m_last_result
 | 
					            // To avoid this bug, I bump the reference counter before resetting m_last_result
 | 
				
			||||||
            ast_ref node(n, m());
 | 
					            ast_ref node(n, m());
 | 
				
			||||||
            m_last_result.reset();
 | 
					            m_last_result.reset();
 | 
				
			||||||
            m_last_result.push_back(std::move(node));
 | 
					            m_last_result.push_back(std::move(node));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -210,7 +210,7 @@ extern "C" {
 | 
				
			||||||
        if (!out) {
 | 
					        if (!out) {
 | 
				
			||||||
            return Z3_FALSE;
 | 
					            return Z3_FALSE;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // must start loggging here, since function uses Z3_get_sort_kind above
 | 
					        // must start logging here, since function uses Z3_get_sort_kind above
 | 
				
			||||||
        LOG_Z3_get_finite_domain_sort_size(c, s, out);
 | 
					        LOG_Z3_get_finite_domain_sort_size(c, s, out);
 | 
				
			||||||
        RESET_ERROR_CODE();  
 | 
					        RESET_ERROR_CODE();  
 | 
				
			||||||
        VERIFY(mk_c(c)->datalog_util().try_get_size(to_sort(s), *out));
 | 
					        VERIFY(mk_c(c)->datalog_util().try_get_size(to_sort(s), *out));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -227,6 +227,11 @@ extern "C" {
 | 
				
			||||||
        Z3_CATCH_RETURN("");
 | 
					        Z3_CATCH_RETURN("");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    double Z3_API Z3_get_numeral_double(Z3_context c, Z3_ast a) {
 | 
				
			||||||
 | 
					        Z3_string s = Z3_get_numeral_decimal_string(c, a, 12);
 | 
				
			||||||
 | 
					        return std::stod(std::string(s));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Z3_string Z3_API Z3_get_numeral_decimal_string(Z3_context c, Z3_ast a, unsigned precision) {
 | 
					    Z3_string Z3_API Z3_get_numeral_decimal_string(Z3_context c, Z3_ast a, unsigned precision) {
 | 
				
			||||||
        Z3_TRY;
 | 
					        Z3_TRY;
 | 
				
			||||||
        LOG_Z3_get_numeral_decimal_string(c, a, precision);
 | 
					        LOG_Z3_get_numeral_decimal_string(c, a, precision);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -709,6 +709,7 @@ namespace z3 {
 | 
				
			||||||
        bool is_numeral_u(unsigned& i) const { bool r = 0 != Z3_get_numeral_uint(ctx(), m_ast, &i); check_error(); return r;}
 | 
					        bool is_numeral_u(unsigned& i) const { bool r = 0 != Z3_get_numeral_uint(ctx(), m_ast, &i); check_error(); return r;}
 | 
				
			||||||
        bool is_numeral(std::string& s) const { if (!is_numeral()) return false; s = Z3_get_numeral_string(ctx(), m_ast); check_error(); return true; }
 | 
					        bool is_numeral(std::string& s) const { if (!is_numeral()) return false; s = Z3_get_numeral_string(ctx(), m_ast); check_error(); return true; }
 | 
				
			||||||
        bool is_numeral(std::string& s, unsigned precision) const { if (!is_numeral()) return false; s = Z3_get_numeral_decimal_string(ctx(), m_ast, precision); check_error(); return true; }
 | 
					        bool is_numeral(std::string& s, unsigned precision) const { if (!is_numeral()) return false; s = Z3_get_numeral_decimal_string(ctx(), m_ast, precision); check_error(); return true; }
 | 
				
			||||||
 | 
					        bool is_numeral(double& d) const { if (!is_numeral()) return false; d = Z3_get_numeral_double(ctx(), m_ast); check_error(); return true; }
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
           \brief Return true if this expression is an application.
 | 
					           \brief Return true if this expression is an application.
 | 
				
			||||||
        */
 | 
					        */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,17 +17,16 @@ Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections;
 | 
					using System.Collections;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// The abstract syntax tree (AST) class.
 | 
					    /// The abstract syntax tree (AST) class.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class AST : Z3Object, IComparable
 | 
					    public class AST : Z3Object, IComparable
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -114,8 +113,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>A copy of the AST which is associated with <paramref name="ctx"/></returns>
 | 
					        /// <returns>A copy of the AST which is associated with <paramref name="ctx"/></returns>
 | 
				
			||||||
        public AST Translate(Context ctx)
 | 
					        public AST Translate(Context ctx)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<AST>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (ReferenceEquals(Context, ctx))
 | 
					            if (ReferenceEquals(Context, ctx))
 | 
				
			||||||
                return this;
 | 
					                return this;
 | 
				
			||||||
| 
						 | 
					@ -202,14 +200,13 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public string SExpr()
 | 
					        public string SExpr()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return Native.Z3_ast_to_string(Context.nCtx, NativeObject);
 | 
					            return Native.Z3_ast_to_string(Context.nCtx, NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal AST(Context ctx) : base(ctx) { Contract.Requires(ctx != null); }
 | 
					        internal AST(Context ctx) : base(ctx) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        internal AST(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal AST(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					@ -246,8 +243,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal static AST Create(Context ctx, IntPtr obj)
 | 
					        internal static AST Create(Context ctx, IntPtr obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<AST>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            switch ((Z3_ast_kind)Native.Z3_get_ast_kind(ctx.nCtx, obj))
 | 
					            switch ((Z3_ast_kind)Native.Z3_get_ast_kind(ctx.nCtx, obj))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Map from AST to AST
 | 
					    /// Map from AST to AST
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    internal class ASTMap : Z3Object
 | 
					    internal class ASTMap : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -35,7 +34,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>True if <paramref name="k"/> is a key in the map, false otherwise.</returns>
 | 
					        /// <returns>True if <paramref name="k"/> is a key in the map, false otherwise.</returns>
 | 
				
			||||||
        public bool Contains(AST k)
 | 
					        public bool Contains(AST k)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(k != null);
 | 
					            Debug.Assert(k != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return 0 != Native.Z3_ast_map_contains(Context.nCtx, NativeObject, k.NativeObject);
 | 
					            return 0 != Native.Z3_ast_map_contains(Context.nCtx, NativeObject, k.NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -49,8 +48,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <param name="k">An AST</param>    
 | 
					        /// <param name="k">An AST</param>    
 | 
				
			||||||
        public AST Find(AST k)
 | 
					        public AST Find(AST k)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(k != null);
 | 
					            Debug.Assert(k != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<AST>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return new AST(Context, Native.Z3_ast_map_find(Context.nCtx, NativeObject, k.NativeObject));
 | 
					            return new AST(Context, Native.Z3_ast_map_find(Context.nCtx, NativeObject, k.NativeObject));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -62,8 +60,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <param name="v">The value AST</param>
 | 
					        /// <param name="v">The value AST</param>
 | 
				
			||||||
        public void Insert(AST k, AST v)
 | 
					        public void Insert(AST k, AST v)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(k != null);
 | 
					            Debug.Assert(k != null);
 | 
				
			||||||
            Contract.Requires(v != null);
 | 
					            Debug.Assert(v != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_ast_map_insert(Context.nCtx, NativeObject, k.NativeObject, v.NativeObject);
 | 
					            Native.Z3_ast_map_insert(Context.nCtx, NativeObject, k.NativeObject, v.NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -74,7 +72,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <param name="k">An AST</param>
 | 
					        /// <param name="k">An AST</param>
 | 
				
			||||||
        public void Erase(AST k)
 | 
					        public void Erase(AST k)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(k != null);
 | 
					            Debug.Assert(k != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_ast_map_erase(Context.nCtx, NativeObject, k.NativeObject);
 | 
					            Native.Z3_ast_map_erase(Context.nCtx, NativeObject, k.NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -119,12 +117,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ASTMap(Context ctx, IntPtr obj)
 | 
					        internal ASTMap(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal ASTMap(Context ctx)
 | 
					        internal ASTMap(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_ast_map(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_ast_map(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -45,13 +45,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<AST>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new AST(Context, Native.Z3_ast_vector_get(Context.nCtx, NativeObject, i));
 | 
					                return new AST(Context, Native.Z3_ast_vector_get(Context.nCtx, NativeObject, i));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            set
 | 
					            set
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Requires(value != null);
 | 
					                Debug.Assert(value != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                Native.Z3_ast_vector_set(Context.nCtx, NativeObject, i, value.NativeObject);
 | 
					                Native.Z3_ast_vector_set(Context.nCtx, NativeObject, i, value.NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -73,7 +72,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <param name="a">An AST</param>
 | 
					        /// <param name="a">An AST</param>
 | 
				
			||||||
        public void Push(AST a)
 | 
					        public void Push(AST a)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(a != null);
 | 
					            Debug.Assert(a != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_ast_vector_push(Context.nCtx, NativeObject, a.NativeObject);
 | 
					            Native.Z3_ast_vector_push(Context.nCtx, NativeObject, a.NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -85,8 +84,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>A new ASTVector</returns>
 | 
					        /// <returns>A new ASTVector</returns>
 | 
				
			||||||
        public ASTVector Translate(Context ctx)
 | 
					        public ASTVector Translate(Context ctx)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<ASTVector>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return new ASTVector(Context, Native.Z3_ast_vector_translate(Context.nCtx, NativeObject, ctx.nCtx));
 | 
					            return new ASTVector(Context, Native.Z3_ast_vector_translate(Context.nCtx, NativeObject, ctx.nCtx));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -232,8 +230,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal ASTVector(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal ASTVector(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        internal ASTVector(Context ctx) : base(ctx, Native.Z3_mk_ast_vector(ctx.nCtx)) { Contract.Requires(ctx != null); }
 | 
					        internal ASTVector(Context ctx) : base(ctx, Native.Z3_mk_ast_vector(ctx.nCtx)) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,8 +16,8 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !FRAMEWORK_LT_4
 | 
					#if !FRAMEWORK_LT_4
 | 
				
			||||||
using System.Numerics;
 | 
					using System.Numerics;
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Algebraic numbers
 | 
					    /// Algebraic numbers
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class AlgebraicNum : ArithExpr
 | 
					    public class AlgebraicNum : ArithExpr
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -40,7 +39,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>A numeral Expr of sort Real</returns>
 | 
					        /// <returns>A numeral Expr of sort Real</returns>
 | 
				
			||||||
        public RatNum ToUpper(uint precision)
 | 
					        public RatNum ToUpper(uint precision)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<RatNum>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return new RatNum(Context, Native.Z3_get_algebraic_number_upper(Context.nCtx, NativeObject, precision));
 | 
					            return new RatNum(Context, Native.Z3_get_algebraic_number_upper(Context.nCtx, NativeObject, precision));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -54,7 +52,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>A numeral Expr of sort Real</returns>
 | 
					        /// <returns>A numeral Expr of sort Real</returns>
 | 
				
			||||||
        public RatNum ToLower(uint precision)
 | 
					        public RatNum ToLower(uint precision)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<RatNum>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return new RatNum(Context, Native.Z3_get_algebraic_number_lower(Context.nCtx, NativeObject, precision));
 | 
					            return new RatNum(Context, Native.Z3_get_algebraic_number_lower(Context.nCtx, NativeObject, precision));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -65,7 +62,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <remarks>The result has at most <paramref name="precision"/> decimal places.</remarks>    
 | 
					        /// <remarks>The result has at most <paramref name="precision"/> decimal places.</remarks>    
 | 
				
			||||||
        public string ToDecimal(uint precision)
 | 
					        public string ToDecimal(uint precision)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return Native.Z3_get_numeral_decimal_string(Context.nCtx, NativeObject, precision);
 | 
					            return Native.Z3_get_numeral_decimal_string(Context.nCtx, NativeObject, precision);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -74,7 +70,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal AlgebraicNum(Context ctx, IntPtr obj)
 | 
					        internal AlgebraicNum(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// ApplyResult objects represent the result of an application of a 
 | 
					    /// ApplyResult objects represent the result of an application of a 
 | 
				
			||||||
    /// tactic to a goal. It contains the subgoals that were produced.
 | 
					    /// tactic to a goal. It contains the subgoals that were produced.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class ApplyResult : Z3Object
 | 
					    public class ApplyResult : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -44,8 +43,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Goal[]>() != null);
 | 
					 | 
				
			||||||
                Contract.Ensures(Contract.Result<Goal[]>().Length == this.NumSubgoals);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumSubgoals;
 | 
					                uint n = NumSubgoals;
 | 
				
			||||||
                Goal[] res = new Goal[n];
 | 
					                Goal[] res = new Goal[n];
 | 
				
			||||||
| 
						 | 
					@ -67,7 +64,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ApplyResult(Context ctx, IntPtr obj)
 | 
					        internal ApplyResult(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ArithExpr(Context ctx, IntPtr obj)
 | 
					        internal ArithExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private static ArithExpr MkNum(ArithExpr e, double d) { return (ArithExpr)e.Context.MkNumeral(d.ToString(), e.Context.MkRealSort()); }        
 | 
					        private static ArithExpr MkNum(ArithExpr e, double d) { return (ArithExpr)e.Context.MkNumeral(d.ToString(), e.Context.MkRealSort()); }        
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary> Operator overloading for arithmetical divsion operator (over reals) </summary>
 | 
					        /// <summary> Operator overloading for arithmetical division operator (over reals) </summary>
 | 
				
			||||||
        public static ArithExpr operator /(ArithExpr a, ArithExpr b) { return a.Context.MkDiv(a, b); }
 | 
					        public static ArithExpr operator /(ArithExpr a, ArithExpr b) { return a.Context.MkDiv(a, b); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary> Operator overloading for arithmetical operator </summary>
 | 
					        /// <summary> Operator overloading for arithmetical operator </summary>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
    public class ArithSort : Sort
 | 
					    public class ArithSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal ArithSort(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal ArithSort(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ArrayExpr(Context ctx, IntPtr obj)
 | 
					        internal ArrayExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion	
 | 
					        #endregion	
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Array sorts.
 | 
					    /// Array sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class ArraySort : Sort
 | 
					    public class ArraySort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -35,7 +34,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Sort.Create(Context, Native.Z3_get_array_sort_domain(Context.nCtx, NativeObject));
 | 
					                return Sort.Create(Context, Native.Z3_get_array_sort_domain(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -48,27 +46,26 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Sort.Create(Context, Native.Z3_get_array_sort_range(Context.nCtx, NativeObject));
 | 
					                return Sort.Create(Context, Native.Z3_get_array_sort_range(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal ArraySort(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal ArraySort(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        internal ArraySort(Context ctx, Sort domain, Sort range)
 | 
					        internal ArraySort(Context ctx, Sort domain, Sort range)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_array_sort(ctx.nCtx, domain.NativeObject, range.NativeObject))
 | 
					            : base(ctx, Native.Z3_mk_array_sort(ctx.nCtx, domain.NativeObject, range.NativeObject))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(domain != null);
 | 
					            Debug.Assert(domain != null);
 | 
				
			||||||
            Contract.Requires(range != null);
 | 
					            Debug.Assert(range != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal ArraySort(Context ctx, Sort[] domain, Sort range)
 | 
					        internal ArraySort(Context ctx, Sort[] domain, Sort range)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_array_sort_n(ctx.nCtx, (uint)domain.Length, AST.ArrayToNative(domain), range.NativeObject))
 | 
					            : base(ctx, Native.Z3_mk_array_sort_n(ctx.nCtx, (uint)domain.Length, AST.ArrayToNative(domain), range.NativeObject))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(domain != null);
 | 
					            Debug.Assert(domain != null);
 | 
				
			||||||
            Contract.Requires(range != null);
 | 
					            Debug.Assert(range != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -41,7 +41,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        /// <summary> Constructor for BitVecExpr </summary>
 | 
					        /// <summary> Constructor for BitVecExpr </summary>
 | 
				
			||||||
        internal BitVecExpr(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal BitVecExpr(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,8 +16,8 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !FRAMEWORK_LT_4
 | 
					#if !FRAMEWORK_LT_4
 | 
				
			||||||
using System.Numerics;
 | 
					using System.Numerics;
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Bit-vector numerals
 | 
					    /// Bit-vector numerals
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class BitVecNum : BitVecExpr
 | 
					    public class BitVecNum : BitVecExpr
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -109,7 +108,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal BitVecNum(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal BitVecNum(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal BitVecSort(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal BitVecSort(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        /// <summary> Constructor for BoolExpr </summary>
 | 
					        /// <summary> Constructor for BoolExpr </summary>
 | 
				
			||||||
        internal BoolExpr(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal BoolExpr(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Operators
 | 
					        #region Operators
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -28,8 +28,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
    public class BoolSort : Sort
 | 
					    public class BoolSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal BoolSort(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal BoolSort(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        internal BoolSort(Context ctx) : base(ctx, Native.Z3_mk_bool_sort(ctx.nCtx)) { Contract.Requires(ctx != null); }
 | 
					        internal BoolSort(Context ctx) : base(ctx, Native.Z3_mk_bool_sort(ctx.nCtx)) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Constructors are used for datatype sorts.
 | 
					    /// Constructors are used for datatype sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Constructor : Z3Object
 | 
					    public class Constructor : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -46,7 +45,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                IntPtr constructor = IntPtr.Zero;
 | 
					                IntPtr constructor = IntPtr.Zero;
 | 
				
			||||||
                IntPtr tester = IntPtr.Zero;
 | 
					                IntPtr tester = IntPtr.Zero;
 | 
				
			||||||
                IntPtr[] accessors = new IntPtr[n];
 | 
					                IntPtr[] accessors = new IntPtr[n];
 | 
				
			||||||
| 
						 | 
					@ -62,7 +60,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                IntPtr constructor = IntPtr.Zero;
 | 
					                IntPtr constructor = IntPtr.Zero;
 | 
				
			||||||
                IntPtr tester = IntPtr.Zero;
 | 
					                IntPtr tester = IntPtr.Zero;
 | 
				
			||||||
                IntPtr[] accessors = new IntPtr[n];
 | 
					                IntPtr[] accessors = new IntPtr[n];
 | 
				
			||||||
| 
						 | 
					@ -78,7 +75,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
                IntPtr constructor = IntPtr.Zero;
 | 
					                IntPtr constructor = IntPtr.Zero;
 | 
				
			||||||
                IntPtr tester = IntPtr.Zero;
 | 
					                IntPtr tester = IntPtr.Zero;
 | 
				
			||||||
                IntPtr[] accessors = new IntPtr[n];
 | 
					                IntPtr[] accessors = new IntPtr[n];
 | 
				
			||||||
| 
						 | 
					@ -105,9 +101,9 @@ namespace Microsoft.Z3
 | 
				
			||||||
                             Sort[] sorts, uint[] sortRefs)
 | 
					                             Sort[] sorts, uint[] sortRefs)
 | 
				
			||||||
            : base(ctx)
 | 
					            : base(ctx)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            Contract.Requires(recognizer != null);
 | 
					            Debug.Assert(recognizer != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            n = AST.ArrayLength(fieldNames);
 | 
					            n = AST.ArrayLength(fieldNames);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,12 +17,12 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -43,14 +43,14 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ConstructorList(Context ctx, IntPtr obj)
 | 
					        internal ConstructorList(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal ConstructorList(Context ctx, Constructor[] constructors)
 | 
					        internal ConstructorList(Context ctx, Constructor[] constructors)
 | 
				
			||||||
            : base(ctx)
 | 
					            : base(ctx)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(constructors != null);
 | 
					            Debug.Assert(constructors != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            NativeObject = Native.Z3_mk_constructor_list(Context.nCtx, (uint)constructors.Length, Constructor.ArrayToNative(constructors));
 | 
					            NativeObject = Native.Z3_mk_constructor_list(Context.nCtx, (uint)constructors.Length, Constructor.ArrayToNative(constructors));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal DatatypeExpr(Context ctx, IntPtr obj)
 | 
					        internal DatatypeExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Datatype sorts.
 | 
					    /// Datatype sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class DatatypeSort : Sort
 | 
					    public class DatatypeSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -43,7 +42,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumConstructors;
 | 
					                uint n = NumConstructors;
 | 
				
			||||||
                FuncDecl[] res = new FuncDecl[n];
 | 
					                FuncDecl[] res = new FuncDecl[n];
 | 
				
			||||||
| 
						 | 
					@ -60,7 +58,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumConstructors;
 | 
					                uint n = NumConstructors;
 | 
				
			||||||
                FuncDecl[] res = new FuncDecl[n];
 | 
					                FuncDecl[] res = new FuncDecl[n];
 | 
				
			||||||
| 
						 | 
					@ -77,7 +74,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[][]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumConstructors;
 | 
					                uint n = NumConstructors;
 | 
				
			||||||
                FuncDecl[][] res = new FuncDecl[n][];
 | 
					                FuncDecl[][] res = new FuncDecl[n][];
 | 
				
			||||||
| 
						 | 
					@ -95,14 +91,14 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal DatatypeSort(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal DatatypeSort(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal DatatypeSort(Context ctx, Symbol name, Constructor[] constructors)
 | 
					        internal DatatypeSort(Context ctx, Symbol name, Constructor[] constructors)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_datatype(ctx.nCtx, name.NativeObject, (uint)constructors.Length, ArrayToNative(constructors)))
 | 
					            : base(ctx, Native.Z3_mk_datatype(ctx.nCtx, name.NativeObject, (uint)constructors.Length, ArrayToNative(constructors)))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            Contract.Requires(constructors != null);
 | 
					            Debug.Assert(constructors != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,17 +17,16 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// The main interaction with Z3 happens via the Context.
 | 
					    /// The main interaction with Z3 happens via the Context.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Deprecated 
 | 
					    public class Deprecated 
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Enumeration sorts.
 | 
					    /// Enumeration sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class EnumSort : Sort
 | 
					    public class EnumSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -35,7 +34,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
                uint n = Native.Z3_get_datatype_sort_num_constructors(Context.nCtx, NativeObject);
 | 
					                uint n = Native.Z3_get_datatype_sort_num_constructors(Context.nCtx, NativeObject);
 | 
				
			||||||
                FuncDecl[] t = new FuncDecl[n];
 | 
					                FuncDecl[] t = new FuncDecl[n];
 | 
				
			||||||
                for (uint i = 0; i < n; i++)
 | 
					                for (uint i = 0; i < n; i++)
 | 
				
			||||||
| 
						 | 
					@ -61,7 +59,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Expr[]>() != null);
 | 
					 | 
				
			||||||
                FuncDecl[] cds = ConstDecls;
 | 
					                FuncDecl[] cds = ConstDecls;
 | 
				
			||||||
                Expr[] t = new Expr[cds.Length];
 | 
					                Expr[] t = new Expr[cds.Length];
 | 
				
			||||||
                for (uint i = 0; i < t.Length; i++)
 | 
					                for (uint i = 0; i < t.Length; i++)
 | 
				
			||||||
| 
						 | 
					@ -87,7 +84,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
                uint n = Native.Z3_get_datatype_sort_num_constructors(Context.nCtx, NativeObject);
 | 
					                uint n = Native.Z3_get_datatype_sort_num_constructors(Context.nCtx, NativeObject);
 | 
				
			||||||
                FuncDecl[] t = new FuncDecl[n];
 | 
					                FuncDecl[] t = new FuncDecl[n];
 | 
				
			||||||
                for (uint i = 0; i < n; i++)
 | 
					                for (uint i = 0; i < n; i++)
 | 
				
			||||||
| 
						 | 
					@ -110,9 +106,9 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal EnumSort(Context ctx, Symbol name, Symbol[] enumNames)
 | 
					        internal EnumSort(Context ctx, Symbol name, Symbol[] enumNames)
 | 
				
			||||||
            : base(ctx, IntPtr.Zero)
 | 
					            : base(ctx, IntPtr.Zero)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            Contract.Requires(enumNames != null);
 | 
					            Debug.Assert(enumNames != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            int n = enumNames.Length;
 | 
					            int n = enumNames.Length;
 | 
				
			||||||
            IntPtr[] n_constdecls = new IntPtr[n];
 | 
					            IntPtr[] n_constdecls = new IntPtr[n];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,16 @@ Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Expressions are terms.
 | 
					    /// Expressions are terms.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Expr : AST
 | 
					    public class Expr : AST
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -35,7 +36,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <seealso cref="Context.SimplifyHelp"/>
 | 
					        /// <seealso cref="Context.SimplifyHelp"/>
 | 
				
			||||||
        public Expr Simplify(Params p = null)
 | 
					        public Expr Simplify(Params p = null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (p == null)
 | 
					            if (p == null)
 | 
				
			||||||
                return Expr.Create(Context, Native.Z3_simplify(Context.nCtx, NativeObject));
 | 
					                return Expr.Create(Context, Native.Z3_simplify(Context.nCtx, NativeObject));
 | 
				
			||||||
| 
						 | 
					@ -50,7 +50,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                return new FuncDecl(Context, Native.Z3_get_app_decl(Context.nCtx, NativeObject));
 | 
					                return new FuncDecl(Context, Native.Z3_get_app_decl(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -79,7 +78,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Expr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumArgs;
 | 
					                uint n = NumArgs;
 | 
				
			||||||
                Expr[] res = new Expr[n];
 | 
					                Expr[] res = new Expr[n];
 | 
				
			||||||
| 
						 | 
					@ -94,7 +92,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Expr Arg(uint i)
 | 
					        public Expr Arg(uint i)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
            return Expr.Create(Context, Native.Z3_get_app_arg(Context.nCtx, NativeObject, i));
 | 
					            return Expr.Create(Context, Native.Z3_get_app_arg(Context.nCtx, NativeObject, i));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -104,8 +101,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public void Update(Expr[] args)
 | 
					        public void Update(Expr[] args)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(args != null);
 | 
					            Debug.Assert(args != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(args, a => a != null));
 | 
					            Debug.Assert(args.All(a => a != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<Expr>(args);
 | 
					            Context.CheckContextMatch<Expr>(args);
 | 
				
			||||||
            if (IsApp && args.Length != NumArgs)
 | 
					            if (IsApp && args.Length != NumArgs)
 | 
				
			||||||
| 
						 | 
					@ -123,11 +120,10 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </remarks>
 | 
					        /// </remarks>
 | 
				
			||||||
        public Expr Substitute(Expr[] from, Expr[] to)
 | 
					        public Expr Substitute(Expr[] from, Expr[] to)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(from != null);
 | 
					            Debug.Assert(from != null);
 | 
				
			||||||
            Contract.Requires(to != null);
 | 
					            Debug.Assert(to != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(from, f => f != null));
 | 
					            Debug.Assert(from.All(f => f != null));
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(to, t => t != null));
 | 
					            Debug.Assert(to.All(t => t != null));
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<Expr>(from);
 | 
					            Context.CheckContextMatch<Expr>(from);
 | 
				
			||||||
            Context.CheckContextMatch<Expr>(to);
 | 
					            Context.CheckContextMatch<Expr>(to);
 | 
				
			||||||
| 
						 | 
					@ -142,9 +138,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <seealso cref="Substitute(Expr[],Expr[])"/>
 | 
					        /// <seealso cref="Substitute(Expr[],Expr[])"/>
 | 
				
			||||||
        public Expr Substitute(Expr from, Expr to)
 | 
					        public Expr Substitute(Expr from, Expr to)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(from != null);
 | 
					            Debug.Assert(from != null);
 | 
				
			||||||
            Contract.Requires(to != null);
 | 
					            Debug.Assert(to != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return Substitute(new Expr[] { from }, new Expr[] { to });
 | 
					            return Substitute(new Expr[] { from }, new Expr[] { to });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -157,9 +152,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </remarks>
 | 
					        /// </remarks>
 | 
				
			||||||
        public Expr SubstituteVars(Expr[] to)
 | 
					        public Expr SubstituteVars(Expr[] to)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(to != null);
 | 
					            Debug.Assert(to != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(to, t => t != null));
 | 
					            Debug.Assert(to.All(t => t != null));
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<Expr>(to);
 | 
					            Context.CheckContextMatch<Expr>(to);
 | 
				
			||||||
            return Expr.Create(Context, Native.Z3_substitute_vars(Context.nCtx, NativeObject, (uint)to.Length, Expr.ArrayToNative(to)));
 | 
					            return Expr.Create(Context, Native.Z3_substitute_vars(Context.nCtx, NativeObject, (uint)to.Length, Expr.ArrayToNative(to)));
 | 
				
			||||||
| 
						 | 
					@ -207,7 +201,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort>() != null);
 | 
					 | 
				
			||||||
                return Sort.Create(Context, Native.Z3_get_sort(Context.nCtx, NativeObject));
 | 
					                return Sort.Create(Context, Native.Z3_get_sort(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -332,7 +325,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Retrieve bound of at-most
 | 
					        /// Retrieve bound of at-most
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public uint AtMostBound { get { Contract.Requires(IsAtMost); return (uint)FuncDecl.Parameters[0].Int; } }
 | 
					        public uint AtMostBound { get { Debug.Assert(IsAtMost); return (uint)FuncDecl.Parameters[0].Int; } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Indicates whether the term is at-least
 | 
					        /// Indicates whether the term is at-least
 | 
				
			||||||
| 
						 | 
					@ -342,7 +335,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Retrieve bound of at-least
 | 
					        /// Retrieve bound of at-least
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public uint AtLeastBound { get { Contract.Requires(IsAtLeast); return (uint)FuncDecl.Parameters[0].Int; } }
 | 
					        public uint AtLeastBound { get { Debug.Assert(IsAtLeast); return (uint)FuncDecl.Parameters[0].Int; } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Indicates whether the term is pbeq
 | 
					        /// Indicates whether the term is pbeq
 | 
				
			||||||
| 
						 | 
					@ -842,7 +835,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        public string String { get { return Native.Z3_get_string(Context.nCtx, NativeObject); } }
 | 
					        public string String { get { return Native.Z3_get_string(Context.nCtx, NativeObject); } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Check whether expression is a concatentation.
 | 
					        /// Check whether expression is a concatenation.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <returns>a Boolean</returns>
 | 
					        /// <returns>a Boolean</returns>
 | 
				
			||||||
        public bool IsConcat { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_CONCAT; } }
 | 
					        public bool IsConcat { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_CONCAT; } }
 | 
				
			||||||
| 
						 | 
					@ -1816,8 +1809,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
                if (!IsVar)
 | 
					                if (!IsVar)
 | 
				
			||||||
                    throw new Z3Exception("Term is not a bound variable.");
 | 
					                    throw new Z3Exception("Term is not a bound variable.");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                Contract.EndContractBlock();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                return Native.Z3_get_index_value(Context.nCtx, NativeObject);
 | 
					                return Native.Z3_get_index_value(Context.nCtx, NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -1827,10 +1818,9 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Constructor for Expr
 | 
					        /// Constructor for Expr
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        internal protected Expr(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal protected Expr(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if DEBUG
 | 
					#if DEBUG
 | 
				
			||||||
        [Pure]
 | 
					 | 
				
			||||||
        internal override void CheckNativeObject(IntPtr obj)
 | 
					        internal override void CheckNativeObject(IntPtr obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (Native.Z3_is_app(Context.nCtx, obj) == 0 &&
 | 
					            if (Native.Z3_is_app(Context.nCtx, obj) == 0 &&
 | 
				
			||||||
| 
						 | 
					@ -1841,12 +1831,10 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Pure]
 | 
					 | 
				
			||||||
        internal static Expr Create(Context ctx, FuncDecl f, params Expr[] arguments)
 | 
					        internal static Expr Create(Context ctx, FuncDecl f, params Expr[] arguments)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(f != null);
 | 
					            Debug.Assert(f != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            IntPtr obj = Native.Z3_mk_app(ctx.nCtx, f.NativeObject,
 | 
					            IntPtr obj = Native.Z3_mk_app(ctx.nCtx, f.NativeObject,
 | 
				
			||||||
                                          AST.ArrayLength(arguments),
 | 
					                                          AST.ArrayLength(arguments),
 | 
				
			||||||
| 
						 | 
					@ -1854,11 +1842,9 @@ namespace Microsoft.Z3
 | 
				
			||||||
            return Create(ctx, obj);
 | 
					            return Create(ctx, obj);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Pure]
 | 
					 | 
				
			||||||
        new internal static Expr Create(Context ctx, IntPtr obj)
 | 
					        new internal static Expr Create(Context ctx, IntPtr obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Z3_ast_kind k = (Z3_ast_kind)Native.Z3_get_ast_kind(ctx.nCtx, obj);
 | 
					            Z3_ast_kind k = (Z3_ast_kind)Native.Z3_get_ast_kind(ctx.nCtx, obj);
 | 
				
			||||||
            if (k == Z3_ast_kind.Z3_QUANTIFIER_AST)
 | 
					            if (k == Z3_ast_kind.Z3_QUANTIFIER_AST)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{    
 | 
					{    
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FPExpr(Context ctx, IntPtr obj)
 | 
					        internal FPExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,15 +16,14 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// FloatiungPoint Numerals
 | 
					    /// FloatiungPoint Numerals
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class FPNum : FPExpr
 | 
					    public class FPNum : FPExpr
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -175,7 +174,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FPNum(Context ctx, IntPtr obj)
 | 
					        internal FPNum(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FPRMExpr(Context ctx, IntPtr obj)
 | 
					        internal FPRMExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -93,7 +93,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FPRMNum(Context ctx, IntPtr obj)
 | 
					        internal FPRMNum(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -31,12 +31,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FPRMSort(Context ctx, IntPtr obj)
 | 
					        internal FPRMSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal FPRMSort(Context ctx)
 | 
					        internal FPRMSort(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_fpa_rounding_mode_sort(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_fpa_rounding_mode_sort(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,8 +16,8 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -40,12 +40,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FPSort(Context ctx, IntPtr obj)
 | 
					        internal FPSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal FPSort(Context ctx, uint ebits, uint sbits)
 | 
					        internal FPSort(Context ctx, uint ebits, uint sbits)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_fpa_sort(ctx.nCtx, ebits, sbits))
 | 
					            : base(ctx, Native.Z3_mk_fpa_sort(ctx.nCtx, ebits, sbits))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }    
 | 
					    }    
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,8 +16,8 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FiniteDomainExpr(Context ctx, IntPtr obj)
 | 
					        internal FiniteDomainExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,8 +16,8 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !FRAMEWORK_LT_4
 | 
					#if !FRAMEWORK_LT_4
 | 
				
			||||||
using System.Numerics;
 | 
					using System.Numerics;
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Finite-domain numerals
 | 
					    /// Finite-domain numerals
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class FiniteDomainNum : FiniteDomainExpr
 | 
					    public class FiniteDomainNum : FiniteDomainExpr
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -109,7 +108,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal FiniteDomainNum(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal FiniteDomainNum(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Finite domain sorts.
 | 
					    /// Finite domain sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class FiniteDomainSort : Sort
 | 
					    public class FiniteDomainSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -45,13 +44,13 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FiniteDomainSort(Context ctx, IntPtr obj)
 | 
					        internal FiniteDomainSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal FiniteDomainSort(Context ctx, Symbol name, ulong size)
 | 
					        internal FiniteDomainSort(Context ctx, Symbol name, ulong size)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_finite_domain_sort(ctx.nCtx, name.NativeObject, size))
 | 
					            : base(ctx, Native.Z3_mk_finite_domain_sort(ctx.nCtx, name.NativeObject, size))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,14 +18,14 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Object for managing fixedpoints
 | 
					    /// Object for managing fixedpoints
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Fixedpoint : Z3Object
 | 
					    public class Fixedpoint : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
                return Native.Z3_fixedpoint_get_help(Context.nCtx, NativeObject);
 | 
					                return Native.Z3_fixedpoint_get_help(Context.nCtx, NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -48,7 +47,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            set
 | 
					            set
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Requires(value != null);
 | 
					                Debug.Assert(value != null);
 | 
				
			||||||
                Context.CheckContextMatch(value);
 | 
					                Context.CheckContextMatch(value);
 | 
				
			||||||
                Native.Z3_fixedpoint_set_params(Context.nCtx, NativeObject, value.NativeObject);
 | 
					                Native.Z3_fixedpoint_set_params(Context.nCtx, NativeObject, value.NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -68,8 +67,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
        public void Assert(params BoolExpr[] constraints)
 | 
					        public void Assert(params BoolExpr[] constraints)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(constraints != null);
 | 
					            Debug.Assert(constraints != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(constraints, c => c != null));
 | 
					            Debug.Assert(constraints.All(c => c != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<BoolExpr>(constraints);
 | 
					            Context.CheckContextMatch<BoolExpr>(constraints);
 | 
				
			||||||
            foreach (BoolExpr a in constraints)
 | 
					            foreach (BoolExpr a in constraints)
 | 
				
			||||||
| 
						 | 
					@ -91,7 +90,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>       
 | 
					        /// </summary>       
 | 
				
			||||||
        public void RegisterRelation(FuncDecl f)
 | 
					        public void RegisterRelation(FuncDecl f)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(f != null);
 | 
					            Debug.Assert(f != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(f);
 | 
					            Context.CheckContextMatch(f);
 | 
				
			||||||
            Native.Z3_fixedpoint_register_relation(Context.nCtx, NativeObject, f.NativeObject);
 | 
					            Native.Z3_fixedpoint_register_relation(Context.nCtx, NativeObject, f.NativeObject);
 | 
				
			||||||
| 
						 | 
					@ -102,7 +101,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
        public void AddRule(BoolExpr rule, Symbol name = null)
 | 
					        public void AddRule(BoolExpr rule, Symbol name = null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(rule != null);
 | 
					            Debug.Assert(rule != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(rule);
 | 
					            Context.CheckContextMatch(rule);
 | 
				
			||||||
            Native.Z3_fixedpoint_add_rule(Context.nCtx, NativeObject, rule.NativeObject, AST.GetNativeObject(name));
 | 
					            Native.Z3_fixedpoint_add_rule(Context.nCtx, NativeObject, rule.NativeObject, AST.GetNativeObject(name));
 | 
				
			||||||
| 
						 | 
					@ -113,8 +112,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
        public void AddFact(FuncDecl pred, params uint[] args)
 | 
					        public void AddFact(FuncDecl pred, params uint[] args)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(pred != null);
 | 
					            Debug.Assert(pred != null);
 | 
				
			||||||
            Contract.Requires(args != null);
 | 
					            Debug.Assert(args != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(pred);
 | 
					            Context.CheckContextMatch(pred);
 | 
				
			||||||
            Native.Z3_fixedpoint_add_fact(Context.nCtx, NativeObject, pred.NativeObject, (uint)args.Length, args);
 | 
					            Native.Z3_fixedpoint_add_fact(Context.nCtx, NativeObject, pred.NativeObject, (uint)args.Length, args);
 | 
				
			||||||
| 
						 | 
					@ -128,7 +127,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
        public Status Query(BoolExpr query)
 | 
					        public Status Query(BoolExpr query)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(query != null);
 | 
					            Debug.Assert(query != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(query);
 | 
					            Context.CheckContextMatch(query);
 | 
				
			||||||
            Z3_lbool r = (Z3_lbool)Native.Z3_fixedpoint_query(Context.nCtx, NativeObject, query.NativeObject);
 | 
					            Z3_lbool r = (Z3_lbool)Native.Z3_fixedpoint_query(Context.nCtx, NativeObject, query.NativeObject);
 | 
				
			||||||
| 
						 | 
					@ -148,8 +147,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
        public Status Query(params FuncDecl[] relations)
 | 
					        public Status Query(params FuncDecl[] relations)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(relations != null);
 | 
					            Debug.Assert(relations != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(0, relations.Length, i => relations[i] != null));
 | 
					            Debug.Assert(relations.All(rel => rel != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<FuncDecl>(relations);
 | 
					            Context.CheckContextMatch<FuncDecl>(relations);
 | 
				
			||||||
            Z3_lbool r = (Z3_lbool)Native.Z3_fixedpoint_query_relations(Context.nCtx, NativeObject,
 | 
					            Z3_lbool r = (Z3_lbool)Native.Z3_fixedpoint_query_relations(Context.nCtx, NativeObject,
 | 
				
			||||||
| 
						 | 
					@ -187,7 +186,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
        public void UpdateRule(BoolExpr rule, Symbol name)
 | 
					        public void UpdateRule(BoolExpr rule, Symbol name)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(rule != null);
 | 
					            Debug.Assert(rule != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(rule);
 | 
					            Context.CheckContextMatch(rule);
 | 
				
			||||||
            Native.Z3_fixedpoint_update_rule(Context.nCtx, NativeObject, rule.NativeObject, AST.GetNativeObject(name));
 | 
					            Native.Z3_fixedpoint_update_rule(Context.nCtx, NativeObject, rule.NativeObject, AST.GetNativeObject(name));
 | 
				
			||||||
| 
						 | 
					@ -208,7 +207,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>                
 | 
					        /// </summary>                
 | 
				
			||||||
        public string GetReasonUnknown()
 | 
					        public string GetReasonUnknown()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return Native.Z3_fixedpoint_get_reason_unknown(Context.nCtx, NativeObject);
 | 
					            return Native.Z3_fixedpoint_get_reason_unknown(Context.nCtx, NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -252,7 +250,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>                
 | 
					        /// </summary>                
 | 
				
			||||||
        public void SetPredicateRepresentation(FuncDecl f, Symbol[] kinds)
 | 
					        public void SetPredicateRepresentation(FuncDecl f, Symbol[] kinds)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(f != null);
 | 
					            Debug.Assert(f != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_fixedpoint_set_predicate_representation(Context.nCtx, NativeObject,
 | 
					            Native.Z3_fixedpoint_set_predicate_representation(Context.nCtx, NativeObject,
 | 
				
			||||||
                               f.NativeObject, AST.ArrayLength(kinds), Symbol.ArrayToNative(kinds));
 | 
					                               f.NativeObject, AST.ArrayLength(kinds), Symbol.ArrayToNative(kinds));
 | 
				
			||||||
| 
						 | 
					@ -276,7 +274,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<BoolExpr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_get_rules(Context.nCtx, NativeObject));
 | 
					                ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_get_rules(Context.nCtx, NativeObject));
 | 
				
			||||||
                return av.ToBoolExprArray();
 | 
					                return av.ToBoolExprArray();
 | 
				
			||||||
| 
						 | 
					@ -290,7 +287,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<BoolExpr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_get_assertions(Context.nCtx, NativeObject));
 | 
					                ASTVector av = new ASTVector(Context, Native.Z3_fixedpoint_get_assertions(Context.nCtx, NativeObject));
 | 
				
			||||||
                return av.ToBoolExprArray();
 | 
					                return av.ToBoolExprArray();
 | 
				
			||||||
| 
						 | 
					@ -304,7 +300,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Statistics>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new Statistics(Context, Native.Z3_fixedpoint_get_statistics(Context.nCtx, NativeObject));
 | 
					                return new Statistics(Context, Native.Z3_fixedpoint_get_statistics(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -335,12 +330,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Fixedpoint(Context ctx, IntPtr obj)
 | 
					        internal Fixedpoint(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal Fixedpoint(Context ctx)
 | 
					        internal Fixedpoint(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_fixedpoint(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_fixedpoint(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,14 +18,15 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Function declarations.
 | 
					    /// Function declarations.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class FuncDecl : AST
 | 
					    public class FuncDecl : AST
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -108,7 +109,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = DomainSize;
 | 
					                uint n = DomainSize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -126,7 +126,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort>() != null);
 | 
					 | 
				
			||||||
                return Sort.Create(Context, Native.Z3_get_range(Context.nCtx, NativeObject));
 | 
					                return Sort.Create(Context, Native.Z3_get_range(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -146,7 +145,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Symbol>() != null);
 | 
					 | 
				
			||||||
                return Symbol.Create(Context, Native.Z3_get_decl_name(Context.nCtx, NativeObject));
 | 
					                return Symbol.Create(Context, Native.Z3_get_decl_name(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -166,7 +164,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Parameter[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint num = NumParameters;
 | 
					                uint num = NumParameters;
 | 
				
			||||||
                Parameter[] res = new Parameter[num];
 | 
					                Parameter[] res = new Parameter[num];
 | 
				
			||||||
| 
						 | 
					@ -287,22 +284,22 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FuncDecl(Context ctx, IntPtr obj)
 | 
					        internal FuncDecl(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal FuncDecl(Context ctx, Symbol name, Sort[] domain, Sort range)
 | 
					        internal FuncDecl(Context ctx, Symbol name, Sort[] domain, Sort range)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_func_decl(ctx.nCtx, name.NativeObject, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject))
 | 
					            : base(ctx, Native.Z3_mk_func_decl(ctx.nCtx, name.NativeObject, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            Contract.Requires(range != null);
 | 
					            Debug.Assert(range != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal FuncDecl(Context ctx, string prefix, Sort[] domain, Sort range)
 | 
					        internal FuncDecl(Context ctx, string prefix, Sort[] domain, Sort range)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_fresh_func_decl(ctx.nCtx, prefix, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject))
 | 
					            : base(ctx, Native.Z3_mk_fresh_func_decl(ctx.nCtx, prefix, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(range != null);
 | 
					            Debug.Assert(range != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if DEBUG
 | 
					#if DEBUG
 | 
				
			||||||
| 
						 | 
					@ -335,7 +332,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Requires(args == null || Contract.ForAll(args, a => a != null));
 | 
					                Debug.Assert(args == null || args.All(a => a != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Apply(args);
 | 
					                return Apply(args);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -348,7 +345,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public Expr Apply(params Expr[] args)
 | 
					        public Expr Apply(params Expr[] args)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(args == null || Contract.ForAll(args, a => a != null));
 | 
					            Debug.Assert(args == null || args.All(a => a != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<Expr>(args);
 | 
					            Context.CheckContextMatch<Expr>(args);
 | 
				
			||||||
            return Expr.Create(Context, this, args);
 | 
					            return Expr.Create(Context, this, args);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    ///  A function interpretation is represented as a finite map and an 'else' value.
 | 
					    ///  A function interpretation is represented as a finite map and an 'else' value.
 | 
				
			||||||
    ///  Each entry in the finite map represents the value of a function given a set of arguments.  
 | 
					    ///  Each entry in the finite map represents the value of a function given a set of arguments.  
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class FuncInterp : Z3Object
 | 
					    public class FuncInterp : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -42,7 +41,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                get
 | 
					                get
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
                    return Expr.Create(Context, Native.Z3_func_entry_get_value(Context.nCtx, NativeObject));
 | 
					                    return Expr.Create(Context, Native.Z3_func_entry_get_value(Context.nCtx, NativeObject));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -62,8 +60,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                get
 | 
					                get
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Contract.Ensures(Contract.Result<Expr[]>() != null);
 | 
					 | 
				
			||||||
                    Contract.Ensures(Contract.Result<Expr[]>().Length == this.NumArgs);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    uint n = NumArgs;
 | 
					                    uint n = NumArgs;
 | 
				
			||||||
                    Expr[] res = new Expr[n];
 | 
					                    Expr[] res = new Expr[n];
 | 
				
			||||||
| 
						 | 
					@ -87,7 +83,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            #region Internal
 | 
					            #region Internal
 | 
				
			||||||
            internal Entry(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					            internal Entry(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            internal class DecRefQueue : IDecRefQueue
 | 
					            internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -133,8 +129,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Entry[]>() != null);
 | 
					 | 
				
			||||||
                Contract.Ensures(Contract.ForAll(0, Contract.Result<Entry[]>().Length, j => Contract.Result<Entry[]>()[j] != null));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumEntries;
 | 
					                uint n = NumEntries;
 | 
				
			||||||
                Entry[] res = new Entry[n];
 | 
					                Entry[] res = new Entry[n];
 | 
				
			||||||
| 
						 | 
					@ -151,7 +145,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Expr.Create(Context, Native.Z3_func_interp_get_else(Context.nCtx, NativeObject));
 | 
					                return Expr.Create(Context, Native.Z3_func_interp_get_else(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -194,7 +187,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal FuncInterp(Context ctx, IntPtr obj)
 | 
					        internal FuncInterp(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,9 +17,9 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,8 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -27,7 +28,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// of formulas, that can be solved and/or transformed using
 | 
					    /// of formulas, that can be solved and/or transformed using
 | 
				
			||||||
    /// tactics and solvers.
 | 
					    /// tactics and solvers.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Goal : Z3Object
 | 
					    public class Goal : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -79,13 +79,13 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>   
 | 
					        /// </summary>   
 | 
				
			||||||
        public void Assert(params BoolExpr[] constraints)
 | 
					        public void Assert(params BoolExpr[] constraints)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(constraints != null);
 | 
					            Debug.Assert(constraints != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(constraints, c => c != null));
 | 
					            Debug.Assert(constraints.All(c => c != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<BoolExpr>(constraints);
 | 
					            Context.CheckContextMatch<BoolExpr>(constraints);
 | 
				
			||||||
            foreach (BoolExpr c in constraints)
 | 
					            foreach (BoolExpr c in constraints)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Assert(c != null); // It was an assume, now made an assert just to be sure we do not regress
 | 
					                Debug.Assert(c != null); // It was an assume, now made an assert just to be sure we do not regress
 | 
				
			||||||
                Native.Z3_goal_assert(Context.nCtx, NativeObject, c.NativeObject);
 | 
					                Native.Z3_goal_assert(Context.nCtx, NativeObject, c.NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -140,7 +140,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<BoolExpr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = Size;
 | 
					                uint n = Size;
 | 
				
			||||||
                BoolExpr[] res = new BoolExpr[n];
 | 
					                BoolExpr[] res = new BoolExpr[n];
 | 
				
			||||||
| 
						 | 
					@ -181,7 +180,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>A model for <c>g</c></returns>
 | 
					        /// <returns>A model for <c>g</c></returns>
 | 
				
			||||||
        public Model ConvertModel(Model m)
 | 
					        public Model ConvertModel(Model m)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Model>() != null);
 | 
					 | 
				
			||||||
            if (m != null)
 | 
					            if (m != null)
 | 
				
			||||||
               return new Model(Context, Native.Z3_goal_convert_model(Context.nCtx, NativeObject, m.NativeObject));
 | 
					               return new Model(Context, Native.Z3_goal_convert_model(Context.nCtx, NativeObject, m.NativeObject));
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
| 
						 | 
					@ -194,7 +192,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Goal Translate(Context ctx)
 | 
					        public Goal Translate(Context ctx)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return new Goal(ctx, Native.Z3_goal_translate(Context.nCtx, NativeObject, ctx.nCtx));
 | 
					            return new Goal(ctx, Native.Z3_goal_translate(Context.nCtx, NativeObject, ctx.nCtx));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -248,12 +246,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal Goal(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal Goal(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal Goal(Context ctx, bool models, bool unsatCores, bool proofs)
 | 
					        internal Goal(Context ctx, bool models, bool unsatCores, bool proofs)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_goal(ctx.nCtx, (byte)(models ? 1 : 0), (byte)(unsatCores ? 1 : 0), (byte)(proofs ? 1 : 0)))
 | 
					            : base(ctx, Native.Z3_mk_goal(ctx.nCtx, (byte)(models ? 1 : 0), (byte)(unsatCores ? 1 : 0), (byte)(proofs ? 1 : 0)))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,26 +17,24 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections;
 | 
					using System.Collections;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Threading;
 | 
					using System.Threading;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// DecRefQueue interface
 | 
					    /// DecRefQueue interface
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractClass(typeof(DecRefQueueContracts))]
 | 
					 | 
				
			||||||
    public abstract class IDecRefQueue
 | 
					    public abstract class IDecRefQueue
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        #region Object invariant
 | 
					        #region Object invariant
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [ContractInvariantMethod]
 | 
					 | 
				
			||||||
        private void ObjectInvariant()
 | 
					        private void ObjectInvariant()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Invariant(this.m_queue != null);
 | 
					            Debug.Assert(this.m_queue != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
| 
						 | 
					@ -61,7 +59,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal void IncAndClear(Context ctx, IntPtr o)
 | 
					        internal void IncAndClear(Context ctx, IntPtr o)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            IncRef(ctx, o);
 | 
					            IncRef(ctx, o);
 | 
				
			||||||
            if (m_queue.Count >= m_move_limit) Clear(ctx);
 | 
					            if (m_queue.Count >= m_move_limit) Clear(ctx);
 | 
				
			||||||
| 
						 | 
					@ -79,7 +77,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal void Clear(Context ctx)
 | 
					        internal void Clear(Context ctx)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            lock (m_lock)
 | 
					            lock (m_lock)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -90,17 +88,16 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [ContractClassFor(typeof(IDecRefQueue))]
 | 
					 | 
				
			||||||
    abstract class DecRefQueueContracts : IDecRefQueue
 | 
					    abstract class DecRefQueueContracts : IDecRefQueue
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        internal override void IncRef(Context ctx, IntPtr obj)
 | 
					        internal override void IncRef(Context ctx, IntPtr obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal override void DecRef(Context ctx, IntPtr obj)
 | 
					        internal override void DecRef(Context ctx, IntPtr obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal IntExpr(Context ctx, IntPtr obj)
 | 
					        internal IntExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,8 +16,8 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !FRAMEWORK_LT_4
 | 
					#if !FRAMEWORK_LT_4
 | 
				
			||||||
using System.Numerics;
 | 
					using System.Numerics;
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Integer Numerals
 | 
					    /// Integer Numerals
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class IntNum : IntExpr
 | 
					    public class IntNum : IntExpr
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal IntNum(Context ctx, IntPtr obj)
 | 
					        internal IntNum(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -31,12 +31,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal IntSort(Context ctx, IntPtr obj)
 | 
					        internal IntSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal IntSort(Context ctx)
 | 
					        internal IntSort(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_int_sort(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_int_sort(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,15 +18,14 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Numbered symbols
 | 
					    /// Numbered symbols
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class IntSymbol : Symbol
 | 
					    public class IntSymbol : Symbol
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -47,12 +46,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal IntSymbol(Context ctx, IntPtr obj)
 | 
					        internal IntSymbol(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal IntSymbol(Context ctx, int i)
 | 
					        internal IntSymbol(Context ctx, int i)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_int_symbol(ctx.nCtx, i))
 | 
					            : base(ctx, Native.Z3_mk_int_symbol(ctx.nCtx, i))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if DEBUG
 | 
					#if DEBUG
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,14 +18,14 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Lambda expressions.
 | 
					    /// Lambda expressions.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Lambda : ArrayExpr
 | 
					    public class Lambda : ArrayExpr
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Symbol[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumBound;
 | 
					                uint n = NumBound;
 | 
				
			||||||
                Symbol[] res = new Symbol[n];
 | 
					                Symbol[] res = new Symbol[n];
 | 
				
			||||||
| 
						 | 
					@ -60,7 +59,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumBound;
 | 
					                uint n = NumBound;
 | 
				
			||||||
                Sort[] res = new Sort[n];
 | 
					                Sort[] res = new Sort[n];
 | 
				
			||||||
| 
						 | 
					@ -77,7 +75,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<BoolExpr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new BoolExpr(Context, Native.Z3_get_quantifier_body(Context.nCtx, NativeObject));
 | 
					                return new BoolExpr(Context, Native.Z3_get_quantifier_body(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -94,17 +91,16 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        [ContractVerification(false)] // F: Clousot ForAll decompilation gets confused below. Setting verification off until I fixed the bug
 | 
					 | 
				
			||||||
        internal Lambda(Context ctx, Sort[] sorts, Symbol[] names, Expr body)
 | 
					        internal Lambda(Context ctx, Sort[] sorts, Symbol[] names, Expr body)
 | 
				
			||||||
            : base(ctx, IntPtr.Zero)
 | 
					            : base(ctx, IntPtr.Zero)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(sorts != null);
 | 
					            Debug.Assert(sorts != null);
 | 
				
			||||||
            Contract.Requires(names != null);
 | 
					            Debug.Assert(names != null);
 | 
				
			||||||
            Contract.Requires(body != null);
 | 
					            Debug.Assert(body != null);
 | 
				
			||||||
            Contract.Requires(sorts.Length == names.Length);
 | 
					            Debug.Assert(sorts.Length == names.Length);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(sorts, s => s != null));
 | 
					            Debug.Assert(sorts.All(s => s != null));
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(names, n => n != null));
 | 
					            Debug.Assert(names.All(n => n != null));
 | 
				
			||||||
            Context.CheckContextMatch<Sort>(sorts);
 | 
					            Context.CheckContextMatch<Sort>(sorts);
 | 
				
			||||||
            Context.CheckContextMatch<Symbol>(names);
 | 
					            Context.CheckContextMatch<Symbol>(names);
 | 
				
			||||||
            Context.CheckContextMatch(body);
 | 
					            Context.CheckContextMatch(body);
 | 
				
			||||||
| 
						 | 
					@ -119,14 +115,13 @@ namespace Microsoft.Z3
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [ContractVerification(false)] // F: Clousot ForAll decompilation gets confused below. Setting verification off until I fixed the bug
 | 
					 | 
				
			||||||
        internal Lambda(Context ctx, Expr[] bound, Expr body)
 | 
					        internal Lambda(Context ctx, Expr[] bound, Expr body)
 | 
				
			||||||
            : base(ctx, IntPtr.Zero)
 | 
					            : base(ctx, IntPtr.Zero)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(body != null);
 | 
					            Debug.Assert(body != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Contract.Requires(bound != null && bound.Length > 0 && Contract.ForAll(bound, n => n != null));
 | 
					            Debug.Assert(bound != null && bound.Length > 0 && bound.All(n => n != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<Expr>(bound);
 | 
					            Context.CheckContextMatch<Expr>(bound);
 | 
				
			||||||
            Context.CheckContextMatch(body);
 | 
					            Context.CheckContextMatch(body);
 | 
				
			||||||
| 
						 | 
					@ -137,7 +132,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal Lambda(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal Lambda(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if DEBUG
 | 
					#if DEBUG
 | 
				
			||||||
        internal override void CheckNativeObject(IntPtr obj)
 | 
					        internal override void CheckNativeObject(IntPtr obj)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// List sorts.
 | 
					    /// List sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class ListSort : Sort
 | 
					    public class ListSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -35,7 +34,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                return new FuncDecl(Context, Native.Z3_get_datatype_sort_constructor(Context.nCtx, NativeObject, 0));                                
 | 
					                return new FuncDecl(Context, Native.Z3_get_datatype_sort_constructor(Context.nCtx, NativeObject, 0));                                
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -47,7 +45,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
                return Context.MkApp(NilDecl);
 | 
					                return Context.MkApp(NilDecl);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -59,7 +56,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                return new FuncDecl(Context, Native.Z3_get_datatype_sort_recognizer(Context.nCtx, NativeObject, 0));
 | 
					                return new FuncDecl(Context, Native.Z3_get_datatype_sort_recognizer(Context.nCtx, NativeObject, 0));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -71,7 +67,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                return new FuncDecl(Context, Native.Z3_get_datatype_sort_constructor(Context.nCtx, NativeObject, 1));
 | 
					                return new FuncDecl(Context, Native.Z3_get_datatype_sort_constructor(Context.nCtx, NativeObject, 1));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -84,7 +79,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                return new FuncDecl(Context, Native.Z3_get_datatype_sort_recognizer(Context.nCtx, NativeObject, 1));
 | 
					                return new FuncDecl(Context, Native.Z3_get_datatype_sort_recognizer(Context.nCtx, NativeObject, 1));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -96,7 +90,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                return new FuncDecl(Context, Native.Z3_get_datatype_sort_constructor_accessor(Context.nCtx, NativeObject, 1, 0));
 | 
					                return new FuncDecl(Context, Native.Z3_get_datatype_sort_constructor_accessor(Context.nCtx, NativeObject, 1, 0));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -108,7 +101,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
                return new FuncDecl(Context, Native.Z3_get_datatype_sort_constructor_accessor(Context.nCtx, NativeObject, 1, 1));
 | 
					                return new FuncDecl(Context, Native.Z3_get_datatype_sort_constructor_accessor(Context.nCtx, NativeObject, 1, 1));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -117,9 +109,9 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ListSort(Context ctx, Symbol name, Sort elemSort)
 | 
					        internal ListSort(Context ctx, Symbol name, Sort elemSort)
 | 
				
			||||||
            : base(ctx, IntPtr.Zero)
 | 
					            : base(ctx, IntPtr.Zero)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            Contract.Requires(elemSort != null);
 | 
					            Debug.Assert(elemSort != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            IntPtr inil = IntPtr.Zero, iisnil = IntPtr.Zero, 
 | 
					            IntPtr inil = IntPtr.Zero, iisnil = IntPtr.Zero, 
 | 
				
			||||||
                   icons = IntPtr.Zero, iiscons = IntPtr.Zero,
 | 
					                   icons = IntPtr.Zero, iiscons = IntPtr.Zero,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// Note that this is a global, static log and if multiple Context 
 | 
					    /// Note that this is a global, static log and if multiple Context 
 | 
				
			||||||
    /// objects are created, it logs the interaction with all of them.
 | 
					    /// objects are created, it logs the interaction with all of them.
 | 
				
			||||||
    /// </remarks>
 | 
					    /// </remarks>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public static class Log
 | 
					    public static class Log
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private static bool m_is_open = false;
 | 
					        private static bool m_is_open = false;
 | 
				
			||||||
| 
						 | 
					@ -59,7 +58,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>    
 | 
					        /// </summary>    
 | 
				
			||||||
        public static void Append(string s)
 | 
					        public static void Append(string s)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(isOpen());
 | 
					            Debug.Assert(isOpen());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!m_is_open)
 | 
					            if (!m_is_open)
 | 
				
			||||||
                throw new Z3Exception("Log cannot be closed.");
 | 
					                throw new Z3Exception("Log cannot be closed.");
 | 
				
			||||||
| 
						 | 
					@ -70,7 +69,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// Checks whether the interaction log is opened.
 | 
					        /// Checks whether the interaction log is opened.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <returns>True if the interaction log is open, false otherwise.</returns>
 | 
					        /// <returns>True if the interaction log is open, false otherwise.</returns>
 | 
				
			||||||
        [Pure]
 | 
					 | 
				
			||||||
        public static bool isOpen()
 | 
					        public static bool isOpen()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return m_is_open;
 | 
					            return m_is_open;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -342,6 +342,7 @@
 | 
				
			||||||
    <Compile Include="ConstructorList.cs" />
 | 
					    <Compile Include="ConstructorList.cs" />
 | 
				
			||||||
    <Compile Include="DatatypeExpr.cs" />
 | 
					    <Compile Include="DatatypeExpr.cs" />
 | 
				
			||||||
    <Compile Include="DatatypeSort.cs" />
 | 
					    <Compile Include="DatatypeSort.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="Deprecated.cs" />
 | 
				
			||||||
    <Compile Include="FiniteDomainExpr.cs" />
 | 
					    <Compile Include="FiniteDomainExpr.cs" />
 | 
				
			||||||
    <Compile Include="FiniteDomainNum.cs" />
 | 
					    <Compile Include="FiniteDomainNum.cs" />
 | 
				
			||||||
    <Compile Include="FPExpr.cs" />
 | 
					    <Compile Include="FPExpr.cs" />
 | 
				
			||||||
| 
						 | 
					@ -364,6 +365,7 @@
 | 
				
			||||||
    <Compile Include="IntNum.cs" />
 | 
					    <Compile Include="IntNum.cs" />
 | 
				
			||||||
    <Compile Include="IntSort.cs" />
 | 
					    <Compile Include="IntSort.cs" />
 | 
				
			||||||
    <Compile Include="IntSymbol.cs" />
 | 
					    <Compile Include="IntSymbol.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="Lambda.cs" />
 | 
				
			||||||
    <Compile Include="ListSort.cs" />
 | 
					    <Compile Include="ListSort.cs" />
 | 
				
			||||||
    <Compile Include="Model.cs" />
 | 
					    <Compile Include="Model.cs" />
 | 
				
			||||||
    <Compile Include="Optimize.cs" />
 | 
					    <Compile Include="Optimize.cs" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// A Model contains interpretations (assignments) of constants and functions. 
 | 
					    /// A Model contains interpretations (assignments) of constants and functions. 
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Model : Z3Object
 | 
					    public class Model : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -36,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>An expression if the constant has an interpretation in the model, null otherwise.</returns>
 | 
					        /// <returns>An expression if the constant has an interpretation in the model, null otherwise.</returns>
 | 
				
			||||||
        public Expr ConstInterp(Expr a)
 | 
					        public Expr ConstInterp(Expr a)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(a != null);
 | 
					            Debug.Assert(a != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(a);
 | 
					            Context.CheckContextMatch(a);
 | 
				
			||||||
            return ConstInterp(a.FuncDecl);
 | 
					            return ConstInterp(a.FuncDecl);
 | 
				
			||||||
| 
						 | 
					@ -49,7 +48,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>An expression if the function has an interpretation in the model, null otherwise.</returns>    
 | 
					        /// <returns>An expression if the function has an interpretation in the model, null otherwise.</returns>    
 | 
				
			||||||
        public Expr ConstInterp(FuncDecl f)
 | 
					        public Expr ConstInterp(FuncDecl f)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(f != null);
 | 
					            Debug.Assert(f != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(f);
 | 
					            Context.CheckContextMatch(f);
 | 
				
			||||||
            if (f.Arity != 0 ||
 | 
					            if (f.Arity != 0 ||
 | 
				
			||||||
| 
						 | 
					@ -70,7 +69,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>A FunctionInterpretation if the function has an interpretation in the model, null otherwise.</returns> 
 | 
					        /// <returns>A FunctionInterpretation if the function has an interpretation in the model, null otherwise.</returns> 
 | 
				
			||||||
        public FuncInterp FuncInterp(FuncDecl f)
 | 
					        public FuncInterp FuncInterp(FuncDecl f)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(f != null);
 | 
					            Debug.Assert(f != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(f);
 | 
					            Context.CheckContextMatch(f);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -122,7 +121,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumConsts;
 | 
					                uint n = NumConsts;
 | 
				
			||||||
                FuncDecl[] res = new FuncDecl[n];
 | 
					                FuncDecl[] res = new FuncDecl[n];
 | 
				
			||||||
| 
						 | 
					@ -165,7 +163,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumFuncs;
 | 
					                uint n = NumFuncs;
 | 
				
			||||||
                FuncDecl[] res = new FuncDecl[n];
 | 
					                FuncDecl[] res = new FuncDecl[n];
 | 
				
			||||||
| 
						 | 
					@ -182,7 +179,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint nFuncs = NumFuncs;
 | 
					                uint nFuncs = NumFuncs;
 | 
				
			||||||
                uint nConsts = NumConsts;
 | 
					                uint nConsts = NumConsts;
 | 
				
			||||||
| 
						 | 
					@ -223,8 +219,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>The evaluation of <paramref name="t"/> in the model.</returns>        
 | 
					        /// <returns>The evaluation of <paramref name="t"/> in the model.</returns>        
 | 
				
			||||||
        public Expr Eval(Expr t, bool completion = false)
 | 
					        public Expr Eval(Expr t, bool completion = false)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(t != null);
 | 
					            Debug.Assert(t != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            IntPtr v = IntPtr.Zero;
 | 
					            IntPtr v = IntPtr.Zero;
 | 
				
			||||||
            if (Native.Z3_model_eval(Context.nCtx, NativeObject, t.NativeObject, (byte)(completion ? 1 : 0), ref v) == (byte)0)
 | 
					            if (Native.Z3_model_eval(Context.nCtx, NativeObject, t.NativeObject, (byte)(completion ? 1 : 0), ref v) == (byte)0)
 | 
				
			||||||
| 
						 | 
					@ -238,8 +233,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
        public Expr Evaluate(Expr t, bool completion = false)
 | 
					        public Expr Evaluate(Expr t, bool completion = false)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(t != null);
 | 
					            Debug.Assert(t != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return Eval(t, completion);
 | 
					            return Eval(t, completion);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -263,7 +257,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumSorts;
 | 
					                uint n = NumSorts;
 | 
				
			||||||
                Sort[] res = new Sort[n];
 | 
					                Sort[] res = new Sort[n];
 | 
				
			||||||
| 
						 | 
					@ -281,8 +274,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <returns>An array of expressions, where each is an element of the universe of <paramref name="s"/></returns>
 | 
					        /// <returns>An array of expressions, where each is an element of the universe of <paramref name="s"/></returns>
 | 
				
			||||||
        public Expr[] SortUniverse(Sort s)
 | 
					        public Expr[] SortUniverse(Sort s)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(s != null);
 | 
					            Debug.Assert(s != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Expr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            ASTVector av = new ASTVector(Context, Native.Z3_model_get_sort_universe(Context.nCtx, NativeObject, s.NativeObject));            
 | 
					            ASTVector av = new ASTVector(Context, Native.Z3_model_get_sort_universe(Context.nCtx, NativeObject, s.NativeObject));            
 | 
				
			||||||
            return av.ToExprArray();
 | 
					            return av.ToExprArray();
 | 
				
			||||||
| 
						 | 
					@ -301,7 +293,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Model(Context ctx, IntPtr obj)
 | 
					        internal Model(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,14 +19,14 @@ Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Object for managing optimizization context
 | 
					    /// Object for managing optimizization context
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Optimize : Z3Object
 | 
					    public class Optimize : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
                return Native.Z3_optimize_get_help(Context.nCtx, NativeObject);
 | 
					                return Native.Z3_optimize_get_help(Context.nCtx, NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -48,7 +47,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            set
 | 
					            set
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Requires(value != null);
 | 
					                Debug.Assert(value != null);
 | 
				
			||||||
                Context.CheckContextMatch(value);
 | 
					                Context.CheckContextMatch(value);
 | 
				
			||||||
                Native.Z3_optimize_set_params(Context.nCtx, NativeObject, value.NativeObject);
 | 
					                Native.Z3_optimize_set_params(Context.nCtx, NativeObject, value.NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -99,8 +98,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>   
 | 
					        /// </summary>   
 | 
				
			||||||
        private void AddConstraints(IEnumerable<BoolExpr> constraints)
 | 
					        private void AddConstraints(IEnumerable<BoolExpr> constraints)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(constraints != null);
 | 
					            Debug.Assert(constraints != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(constraints, c => c != null));
 | 
					            Debug.Assert(constraints.All(c => c != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(constraints);
 | 
					            Context.CheckContextMatch(constraints);
 | 
				
			||||||
            foreach (BoolExpr a in constraints)
 | 
					            foreach (BoolExpr a in constraints)
 | 
				
			||||||
| 
						 | 
					@ -248,7 +247,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Expr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ASTVector core = new ASTVector(Context, Native.Z3_optimize_get_unsat_core(Context.nCtx, NativeObject));                
 | 
					                ASTVector core = new ASTVector(Context, Native.Z3_optimize_get_unsat_core(Context.nCtx, NativeObject));                
 | 
				
			||||||
                return core.ToBoolExprArray();
 | 
					                return core.ToBoolExprArray();
 | 
				
			||||||
| 
						 | 
					@ -319,7 +317,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get 
 | 
					            get 
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
                return Native.Z3_optimize_get_reason_unknown(Context.nCtx, NativeObject);
 | 
					                return Native.Z3_optimize_get_reason_unknown(Context.nCtx, NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -357,7 +354,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<BoolExpr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ASTVector assertions = new ASTVector(Context, Native.Z3_optimize_get_assertions(Context.nCtx, NativeObject));
 | 
					                ASTVector assertions = new ASTVector(Context, Native.Z3_optimize_get_assertions(Context.nCtx, NativeObject));
 | 
				
			||||||
                return assertions.ToBoolExprArray();
 | 
					                return assertions.ToBoolExprArray();
 | 
				
			||||||
| 
						 | 
					@ -371,7 +367,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Expr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ASTVector objectives = new ASTVector(Context, Native.Z3_optimize_get_objectives(Context.nCtx, NativeObject));
 | 
					                ASTVector objectives = new ASTVector(Context, Native.Z3_optimize_get_objectives(Context.nCtx, NativeObject));
 | 
				
			||||||
                return objectives.ToExprArray();
 | 
					                return objectives.ToExprArray();
 | 
				
			||||||
| 
						 | 
					@ -386,7 +381,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Statistics>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new Statistics(Context, Native.Z3_optimize_get_statistics(Context.nCtx, NativeObject));
 | 
					                return new Statistics(Context, Native.Z3_optimize_get_statistics(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -397,12 +391,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Optimize(Context ctx, IntPtr obj)
 | 
					        internal Optimize(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal Optimize(Context ctx)
 | 
					        internal Optimize(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_optimize(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_optimize(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// A ParamDescrs describes a set of parameters.
 | 
					    /// A ParamDescrs describes a set of parameters.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class ParamDescrs : Z3Object
 | 
					    public class ParamDescrs : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -33,7 +32,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public void Validate(Params p)
 | 
					        public void Validate(Params p)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(p != null);
 | 
					            Debug.Assert(p != null);
 | 
				
			||||||
            Native.Z3_params_validate(Context.nCtx, p.NativeObject, NativeObject);
 | 
					            Native.Z3_params_validate(Context.nCtx, p.NativeObject, NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,7 +41,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Z3_param_kind GetKind(Symbol name)
 | 
					        public Z3_param_kind GetKind(Symbol name)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            return (Z3_param_kind)Native.Z3_param_descrs_get_kind(Context.nCtx, NativeObject, name.NativeObject);
 | 
					            return (Z3_param_kind)Native.Z3_param_descrs_get_kind(Context.nCtx, NativeObject, name.NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -51,7 +50,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public string GetDocumentation(Symbol name)
 | 
					        public string GetDocumentation(Symbol name)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            return Native.Z3_param_descrs_get_documentation(Context.nCtx, NativeObject, name.NativeObject);
 | 
					            return Native.Z3_param_descrs_get_documentation(Context.nCtx, NativeObject, name.NativeObject);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,7 +90,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ParamDescrs(Context ctx, IntPtr obj)
 | 
					        internal ParamDescrs(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// A Params objects represents a configuration in the form of Symbol/value pairs.
 | 
					    /// A Params objects represents a configuration in the form of Symbol/value pairs.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Params : Z3Object
 | 
					    public class Params : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -33,7 +32,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Params Add(Symbol name, bool value)
 | 
					        public Params Add(Symbol name, bool value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_params_set_bool(Context.nCtx, NativeObject, name.NativeObject, (byte)(value ? 1 : 0));
 | 
					            Native.Z3_params_set_bool(Context.nCtx, NativeObject, name.NativeObject, (byte)(value ? 1 : 0));
 | 
				
			||||||
            return this;
 | 
					            return this;
 | 
				
			||||||
| 
						 | 
					@ -44,7 +43,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Params Add(Symbol name, uint value)
 | 
					        public Params Add(Symbol name, uint value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_params_set_uint(Context.nCtx, NativeObject, name.NativeObject, value);
 | 
					            Native.Z3_params_set_uint(Context.nCtx, NativeObject, name.NativeObject, value);
 | 
				
			||||||
            return this;
 | 
					            return this;
 | 
				
			||||||
| 
						 | 
					@ -55,7 +54,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Params Add(Symbol name, double value)
 | 
					        public Params Add(Symbol name, double value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(name != null);            
 | 
					            Debug.Assert(name != null);            
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_params_set_double(Context.nCtx, NativeObject, name.NativeObject, value);
 | 
					            Native.Z3_params_set_double(Context.nCtx, NativeObject, name.NativeObject, value);
 | 
				
			||||||
            return this;
 | 
					            return this;
 | 
				
			||||||
| 
						 | 
					@ -66,7 +65,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Params Add(Symbol name, string value)
 | 
					        public Params Add(Symbol name, string value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(value != null);
 | 
					            Debug.Assert(value != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_params_set_symbol(Context.nCtx, NativeObject, name.NativeObject, Context.MkSymbol(value).NativeObject);
 | 
					            Native.Z3_params_set_symbol(Context.nCtx, NativeObject, name.NativeObject, Context.MkSymbol(value).NativeObject);
 | 
				
			||||||
            return this;
 | 
					            return this;
 | 
				
			||||||
| 
						 | 
					@ -77,8 +76,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Params Add(Symbol name, Symbol value)
 | 
					        public Params Add(Symbol name, Symbol value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            Contract.Requires(value != null);
 | 
					            Debug.Assert(value != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_params_set_symbol(Context.nCtx, NativeObject, name.NativeObject, value.NativeObject);
 | 
					            Native.Z3_params_set_symbol(Context.nCtx, NativeObject, name.NativeObject, value.NativeObject);
 | 
				
			||||||
            return this;
 | 
					            return this;
 | 
				
			||||||
| 
						 | 
					@ -117,7 +116,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Params Add(string name, Symbol value)
 | 
					        public Params Add(string name, Symbol value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(value != null);
 | 
					            Debug.Assert(value != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_params_set_symbol(Context.nCtx, NativeObject, Context.MkSymbol(name).NativeObject, value.NativeObject);
 | 
					            Native.Z3_params_set_symbol(Context.nCtx, NativeObject, Context.MkSymbol(name).NativeObject, value.NativeObject);
 | 
				
			||||||
            return this;
 | 
					            return this;
 | 
				
			||||||
| 
						 | 
					@ -128,8 +127,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Params Add(string name, string value)
 | 
					        public Params Add(string name, string value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
            Contract.Requires(value != null);
 | 
					            Debug.Assert(value != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Native.Z3_params_set_symbol(Context.nCtx, NativeObject, Context.MkSymbol(name).NativeObject, Context.MkSymbol(value).NativeObject);
 | 
					            Native.Z3_params_set_symbol(Context.nCtx, NativeObject, Context.MkSymbol(name).NativeObject, Context.MkSymbol(value).NativeObject);
 | 
				
			||||||
            return this;
 | 
					            return this;
 | 
				
			||||||
| 
						 | 
					@ -147,7 +146,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Params(Context ctx)
 | 
					        internal Params(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_params(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_params(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,9 +17,9 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// non-empty.  If the list comprises of more than one term, it is
 | 
					    /// non-empty.  If the list comprises of more than one term, it is
 | 
				
			||||||
    /// also called a multi-pattern.
 | 
					    /// also called a multi-pattern.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Pattern : AST
 | 
					    public class Pattern : AST
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -46,7 +45,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Expr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumTerms;
 | 
					                uint n = NumTerms;
 | 
				
			||||||
                Expr[] res = new Expr[n];
 | 
					                Expr[] res = new Expr[n];
 | 
				
			||||||
| 
						 | 
					@ -68,7 +66,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Pattern(Context ctx, IntPtr obj)
 | 
					        internal Pattern(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,9 +17,9 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// and <c>Context.ProbeNames</c>.
 | 
					    /// and <c>Context.ProbeNames</c>.
 | 
				
			||||||
    /// It may also be obtained using the command <c>(help-tactic)</c> in the SMT 2.0 front-end.
 | 
					    /// It may also be obtained using the command <c>(help-tactic)</c> in the SMT 2.0 front-end.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Probe : Z3Object
 | 
					    public class Probe : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -40,7 +39,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// "Boolean" probes return 0.0 for false, and a value different from 0.0 for true.</returns>
 | 
					        /// "Boolean" probes return 0.0 for false, and a value different from 0.0 for true.</returns>
 | 
				
			||||||
        public double Apply(Goal g)
 | 
					        public double Apply(Goal g)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(g != null);
 | 
					            Debug.Assert(g != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(g);
 | 
					            Context.CheckContextMatch(g);
 | 
				
			||||||
            return Native.Z3_probe_apply(Context.nCtx, NativeObject, g.NativeObject);
 | 
					            return Native.Z3_probe_apply(Context.nCtx, NativeObject, g.NativeObject);
 | 
				
			||||||
| 
						 | 
					@ -53,7 +52,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Requires(g != null);
 | 
					                Debug.Assert(g != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Apply(g);
 | 
					                return Apply(g);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -63,12 +62,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Probe(Context ctx, IntPtr obj)
 | 
					        internal Probe(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal Probe(Context ctx, string name)
 | 
					        internal Probe(Context ctx, string name)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_probe(ctx.nCtx, name))
 | 
					            : base(ctx, Native.Z3_mk_probe(ctx.nCtx, name))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,14 +18,14 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Quantifier expressions.
 | 
					    /// Quantifier expressions.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Quantifier : BoolExpr
 | 
					    public class Quantifier : BoolExpr
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -67,7 +67,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Pattern[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumPatterns;
 | 
					                uint n = NumPatterns;
 | 
				
			||||||
                Pattern[] res = new Pattern[n];
 | 
					                Pattern[] res = new Pattern[n];
 | 
				
			||||||
| 
						 | 
					@ -92,7 +91,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Pattern[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumNoPatterns;
 | 
					                uint n = NumNoPatterns;
 | 
				
			||||||
                Pattern[] res = new Pattern[n];
 | 
					                Pattern[] res = new Pattern[n];
 | 
				
			||||||
| 
						 | 
					@ -117,7 +115,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Symbol[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumBound;
 | 
					                uint n = NumBound;
 | 
				
			||||||
                Symbol[] res = new Symbol[n];
 | 
					                Symbol[] res = new Symbol[n];
 | 
				
			||||||
| 
						 | 
					@ -134,7 +131,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumBound;
 | 
					                uint n = NumBound;
 | 
				
			||||||
                Sort[] res = new Sort[n];
 | 
					                Sort[] res = new Sort[n];
 | 
				
			||||||
| 
						 | 
					@ -151,7 +147,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<BoolExpr>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new BoolExpr(Context, Native.Z3_get_quantifier_body(Context.nCtx, NativeObject));
 | 
					                return new BoolExpr(Context, Native.Z3_get_quantifier_body(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -168,19 +163,18 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        [ContractVerification(false)] // F: Clousot ForAll decompilation gets confused below. Setting verification off until I fixed the bug
 | 
					 | 
				
			||||||
        internal Quantifier(Context ctx, bool isForall, Sort[] sorts, Symbol[] names, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
 | 
					        internal Quantifier(Context ctx, bool isForall, Sort[] sorts, Symbol[] names, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
 | 
				
			||||||
            : base(ctx, IntPtr.Zero)
 | 
					            : base(ctx, IntPtr.Zero)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(sorts != null);
 | 
					            Debug.Assert(sorts != null);
 | 
				
			||||||
            Contract.Requires(names != null);
 | 
					            Debug.Assert(names != null);
 | 
				
			||||||
            Contract.Requires(body != null);
 | 
					            Debug.Assert(body != null);
 | 
				
			||||||
            Contract.Requires(sorts.Length == names.Length);
 | 
					            Debug.Assert(sorts.Length == names.Length);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(sorts, s => s != null));
 | 
					            Debug.Assert(sorts.All(s => s != null));
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(names, n => n != null));
 | 
					            Debug.Assert(names.All(n => n != null));
 | 
				
			||||||
            Contract.Requires(patterns == null || Contract.ForAll(patterns, p => p != null));
 | 
					            Debug.Assert(patterns == null || patterns.All(p => p != null));
 | 
				
			||||||
            Contract.Requires(noPatterns == null || Contract.ForAll(noPatterns, np => np != null));
 | 
					            Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<Pattern>(patterns);
 | 
					            Context.CheckContextMatch<Pattern>(patterns);
 | 
				
			||||||
            Context.CheckContextMatch<Expr>(noPatterns);
 | 
					            Context.CheckContextMatch<Expr>(noPatterns);
 | 
				
			||||||
| 
						 | 
					@ -211,16 +205,15 @@ namespace Microsoft.Z3
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [ContractVerification(false)] // F: Clousot ForAll decompilation gets confused below. Setting verification off until I fixed the bug
 | 
					 | 
				
			||||||
        internal Quantifier(Context ctx, bool isForall, Expr[] bound, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
 | 
					        internal Quantifier(Context ctx, bool isForall, Expr[] bound, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
 | 
				
			||||||
            : base(ctx, IntPtr.Zero)
 | 
					            : base(ctx, IntPtr.Zero)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(body != null);
 | 
					            Debug.Assert(body != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Contract.Requires(patterns == null || Contract.ForAll(patterns, p => p != null));
 | 
					            Debug.Assert(patterns == null || patterns.All(p => p != null));
 | 
				
			||||||
            Contract.Requires(noPatterns == null || Contract.ForAll(noPatterns, np => np != null));
 | 
					            Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
 | 
				
			||||||
            Contract.Requires(bound == null || Contract.ForAll(bound, n => n != null));
 | 
					            Debug.Assert(bound == null || bound.All(n => n != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<Expr>(noPatterns);
 | 
					            Context.CheckContextMatch<Expr>(noPatterns);
 | 
				
			||||||
            Context.CheckContextMatch<Pattern>(patterns);
 | 
					            Context.CheckContextMatch<Pattern>(patterns);
 | 
				
			||||||
| 
						 | 
					@ -246,7 +239,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal Quantifier(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal Quantifier(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if DEBUG
 | 
					#if DEBUG
 | 
				
			||||||
        internal override void CheckNativeObject(IntPtr obj)
 | 
					        internal override void CheckNativeObject(IntPtr obj)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,8 +16,8 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !FRAMEWORK_LT_4
 | 
					#if !FRAMEWORK_LT_4
 | 
				
			||||||
using System.Numerics;
 | 
					using System.Numerics;
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Rational Numerals
 | 
					    /// Rational Numerals
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class RatNum : RealExpr
 | 
					    public class RatNum : RealExpr
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -38,7 +37,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<IntNum>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new IntNum(Context, Native.Z3_get_numerator(Context.nCtx, NativeObject));
 | 
					                return new IntNum(Context, Native.Z3_get_numerator(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -51,7 +49,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<IntNum>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new IntNum(Context, Native.Z3_get_denominator(Context.nCtx, NativeObject));
 | 
					                return new IntNum(Context, Native.Z3_get_denominator(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -92,6 +89,14 @@ namespace Microsoft.Z3
 | 
				
			||||||
            return Native.Z3_get_numeral_decimal_string(Context.nCtx, NativeObject, precision);
 | 
					            return Native.Z3_get_numeral_decimal_string(Context.nCtx, NativeObject, precision);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// Returns a double representing the value.
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public double Double
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return Native.Z3_get_numeral_double(Context.nCtx, NativeObject); }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Returns a string representation of the numeral.
 | 
					        /// Returns a string representation of the numeral.
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
| 
						 | 
					@ -104,7 +109,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal RatNum(Context ctx, IntPtr obj)
 | 
					        internal RatNum(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ReExpr(Context ctx, IntPtr obj)
 | 
					        internal ReExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -31,12 +31,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal ReSort(Context ctx, IntPtr obj)
 | 
					        internal ReSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal ReSort(Context ctx)
 | 
					        internal ReSort(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_int_sort(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_int_sort(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal RealExpr(Context ctx, IntPtr obj)
 | 
					        internal RealExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -31,12 +31,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal RealSort(Context ctx, IntPtr obj)
 | 
					        internal RealSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal RealSort(Context ctx)
 | 
					        internal RealSort(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_real_sort(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_real_sort(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Relation sorts.
 | 
					    /// Relation sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class RelationSort : Sort
 | 
					    public class RelationSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -43,7 +42,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Sort[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (m_columnSorts != null)
 | 
					                if (m_columnSorts != null)
 | 
				
			||||||
                    return m_columnSorts;
 | 
					                    return m_columnSorts;
 | 
				
			||||||
| 
						 | 
					@ -62,7 +60,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal RelationSort(Context ctx, IntPtr obj)
 | 
					        internal RelationSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,12 +16,12 @@ Author:
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal SeqExpr(Context ctx, IntPtr obj)
 | 
					        internal SeqExpr(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -31,12 +31,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal SeqSort(Context ctx, IntPtr obj)
 | 
					        internal SeqSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal SeqSort(Context ctx)
 | 
					        internal SeqSort(Context ctx)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_int_sort(ctx.nCtx))
 | 
					            : base(ctx, Native.Z3_mk_int_sort(ctx.nCtx))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,28 +17,27 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Set sorts.
 | 
					    /// Set sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class SetSort : Sort
 | 
					    public class SetSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        #region Internal
 | 
					        #region Internal
 | 
				
			||||||
        internal SetSort(Context ctx, IntPtr obj)
 | 
					        internal SetSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal SetSort(Context ctx, Sort ty)
 | 
					        internal SetSort(Context ctx, Sort ty)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_set_sort(ctx.nCtx, ty.NativeObject))
 | 
					            : base(ctx, Native.Z3_mk_set_sort(ctx.nCtx, ty.NativeObject))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(ty != null);
 | 
					            Debug.Assert(ty != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,16 +18,15 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Solvers.
 | 
					    /// Solvers.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Solver : Z3Object
 | 
					    public class Solver : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -37,7 +36,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Native.Z3_solver_get_help(Context.nCtx, NativeObject);
 | 
					                return Native.Z3_solver_get_help(Context.nCtx, NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -50,7 +48,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            set
 | 
					            set
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Requires(value != null);
 | 
					                Debug.Assert(value != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                Context.CheckContextMatch(value);
 | 
					                Context.CheckContextMatch(value);
 | 
				
			||||||
                Native.Z3_solver_set_params(Context.nCtx, NativeObject, value.NativeObject);
 | 
					                Native.Z3_solver_set_params(Context.nCtx, NativeObject, value.NativeObject);
 | 
				
			||||||
| 
						 | 
					@ -152,8 +150,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>        
 | 
					        /// </summary>        
 | 
				
			||||||
        public void Assert(params BoolExpr[] constraints)
 | 
					        public void Assert(params BoolExpr[] constraints)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(constraints != null);
 | 
					            Debug.Assert(constraints != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(constraints, c => c != null));
 | 
					            Debug.Assert(constraints.All(c => c != null));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch<BoolExpr>(constraints);
 | 
					            Context.CheckContextMatch<BoolExpr>(constraints);
 | 
				
			||||||
            foreach (BoolExpr a in constraints)
 | 
					            foreach (BoolExpr a in constraints)
 | 
				
			||||||
| 
						 | 
					@ -191,9 +189,9 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </remarks>        
 | 
					        /// </remarks>        
 | 
				
			||||||
        public void AssertAndTrack(BoolExpr[] constraints, BoolExpr[] ps)
 | 
					        public void AssertAndTrack(BoolExpr[] constraints, BoolExpr[] ps)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(constraints != null);
 | 
					            Debug.Assert(constraints != null);
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(constraints, c => c != null));
 | 
					            Debug.Assert(constraints.All(c => c != null));
 | 
				
			||||||
            Contract.Requires(Contract.ForAll(ps, c => c != null));
 | 
					            Debug.Assert(ps.All(c => c != null));
 | 
				
			||||||
            Context.CheckContextMatch<BoolExpr>(constraints);
 | 
					            Context.CheckContextMatch<BoolExpr>(constraints);
 | 
				
			||||||
            Context.CheckContextMatch<BoolExpr>(ps);
 | 
					            Context.CheckContextMatch<BoolExpr>(ps);
 | 
				
			||||||
            if (constraints.Length != ps.Length)
 | 
					            if (constraints.Length != ps.Length)
 | 
				
			||||||
| 
						 | 
					@ -216,8 +214,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </remarks>        
 | 
					        /// </remarks>        
 | 
				
			||||||
        public void AssertAndTrack(BoolExpr constraint, BoolExpr p)
 | 
					        public void AssertAndTrack(BoolExpr constraint, BoolExpr p)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(constraint != null);
 | 
					            Debug.Assert(constraint != null);
 | 
				
			||||||
            Contract.Requires(p != null);
 | 
					            Debug.Assert(p != null);
 | 
				
			||||||
            Context.CheckContextMatch(constraint);
 | 
					            Context.CheckContextMatch(constraint);
 | 
				
			||||||
            Context.CheckContextMatch(p);
 | 
					            Context.CheckContextMatch(p);
 | 
				
			||||||
                        
 | 
					                        
 | 
				
			||||||
| 
						 | 
					@ -259,7 +257,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<BoolExpr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ASTVector assertions = new ASTVector(Context, Native.Z3_solver_get_assertions(Context.nCtx, NativeObject));
 | 
					                ASTVector assertions = new ASTVector(Context, Native.Z3_solver_get_assertions(Context.nCtx, NativeObject));
 | 
				
			||||||
                return assertions.ToBoolExprArray();
 | 
					                return assertions.ToBoolExprArray();
 | 
				
			||||||
| 
						 | 
					@ -273,7 +270,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<BoolExpr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ASTVector assertions = new ASTVector(Context, Native.Z3_solver_get_units(Context.nCtx, NativeObject));
 | 
					                ASTVector assertions = new ASTVector(Context, Native.Z3_solver_get_units(Context.nCtx, NativeObject));
 | 
				
			||||||
                return assertions.ToBoolExprArray();
 | 
					                return assertions.ToBoolExprArray();
 | 
				
			||||||
| 
						 | 
					@ -394,7 +390,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Expr[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ASTVector core = new ASTVector(Context, Native.Z3_solver_get_unsat_core(Context.nCtx, NativeObject));                
 | 
					                ASTVector core = new ASTVector(Context, Native.Z3_solver_get_unsat_core(Context.nCtx, NativeObject));                
 | 
				
			||||||
                return core.ToBoolExprArray();
 | 
					                return core.ToBoolExprArray();
 | 
				
			||||||
| 
						 | 
					@ -408,7 +403,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Native.Z3_solver_get_reason_unknown(Context.nCtx, NativeObject);
 | 
					                return Native.Z3_solver_get_reason_unknown(Context.nCtx, NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -455,8 +449,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public Solver Translate(Context ctx) 
 | 
					        public Solver Translate(Context ctx) 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
             Contract.Requires(ctx != null);
 | 
					             Debug.Assert(ctx != null);
 | 
				
			||||||
             Contract.Ensures(Contract.Result<Solver>() != null);
 | 
					 | 
				
			||||||
             return new Solver(ctx, Native.Z3_solver_translate(Context.nCtx, NativeObject, ctx.nCtx));
 | 
					             return new Solver(ctx, Native.Z3_solver_translate(Context.nCtx, NativeObject, ctx.nCtx));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -475,7 +468,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Statistics>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new Statistics(Context, Native.Z3_solver_get_statistics(Context.nCtx, NativeObject));
 | 
					                return new Statistics(Context, Native.Z3_solver_get_statistics(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -493,7 +485,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Solver(Context ctx, IntPtr obj)
 | 
					        internal Solver(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            this.BacktrackLevel = uint.MaxValue;
 | 
					            this.BacktrackLevel = uint.MaxValue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,15 +17,14 @@ Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// The Sort class implements type information for ASTs.
 | 
					    /// The Sort class implements type information for ASTs.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Sort : AST
 | 
					    public class Sort : AST
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -100,7 +99,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Symbol>() != null);
 | 
					 | 
				
			||||||
                return Symbol.Create(Context, Native.Z3_get_sort_name(Context.nCtx, NativeObject));
 | 
					                return Symbol.Create(Context, Native.Z3_get_sort_name(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -127,7 +125,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Sort constructor
 | 
					        /// Sort constructor
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        internal Sort(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
 | 
					        internal Sort(Context ctx, IntPtr obj) : base(ctx, obj) { Debug.Assert(ctx != null); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if DEBUG
 | 
					#if DEBUG
 | 
				
			||||||
        internal override void CheckNativeObject(IntPtr obj)
 | 
					        internal override void CheckNativeObject(IntPtr obj)
 | 
				
			||||||
| 
						 | 
					@ -138,11 +136,9 @@ namespace Microsoft.Z3
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [ContractVerification(true)]
 | 
					 | 
				
			||||||
        new internal static Sort Create(Context ctx, IntPtr obj)
 | 
					        new internal static Sort Create(Context ctx, IntPtr obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Sort>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            switch ((Z3_sort_kind)Native.Z3_get_sort_kind(ctx.nCtx, obj))
 | 
					            switch ((Z3_sort_kind)Native.Z3_get_sort_kind(ctx.nCtx, obj))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,14 +18,14 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Objects of this class track statistical information about solvers. 
 | 
					    /// Objects of this class track statistical information about solvers. 
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Statistics : Z3Object
 | 
					    public class Statistics : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -62,7 +62,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                get
 | 
					                get
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (IsUInt)
 | 
					                    if (IsUInt)
 | 
				
			||||||
                        return m_uint.ToString();
 | 
					                        return m_uint.ToString();
 | 
				
			||||||
| 
						 | 
					@ -124,9 +123,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Entry[]>() != null);
 | 
					 | 
				
			||||||
                Contract.Ensures(Contract.Result<Entry[]>().Length == this.Size);
 | 
					 | 
				
			||||||
                Contract.Ensures(Contract.ForAll(0, Contract.Result<Entry[]>().Length, j => Contract.Result<Entry[]>()[j] != null));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = Size;
 | 
					                uint n = Size;
 | 
				
			||||||
                Entry[] res = new Entry[n];
 | 
					                Entry[] res = new Entry[n];
 | 
				
			||||||
| 
						 | 
					@ -153,7 +149,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<string[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = Size;
 | 
					                uint n = Size;
 | 
				
			||||||
                string[] res = new string[n];
 | 
					                string[] res = new string[n];
 | 
				
			||||||
| 
						 | 
					@ -184,7 +179,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Statistics(Context ctx, IntPtr obj)
 | 
					        internal Statistics(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal class DecRefQueue : IDecRefQueue
 | 
					        internal class DecRefQueue : IDecRefQueue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,6 +17,7 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,8 +18,8 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Named symbols
 | 
					    /// Named symbols
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class StringSymbol : Symbol
 | 
					    public class StringSymbol : Symbol
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -38,7 +37,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (!IsStringSymbol())
 | 
					                if (!IsStringSymbol())
 | 
				
			||||||
                    throw new Z3Exception("String requested from non-String symbol");
 | 
					                    throw new Z3Exception("String requested from non-String symbol");
 | 
				
			||||||
| 
						 | 
					@ -50,13 +48,13 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal StringSymbol(Context ctx, IntPtr obj)
 | 
					        internal StringSymbol(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal StringSymbol(Context ctx, string s)
 | 
					        internal StringSymbol(Context ctx, string s)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_string_symbol(ctx.nCtx, s))
 | 
					            : base(ctx, Native.Z3_mk_string_symbol(ctx.nCtx, s))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if DEBUG
 | 
					#if DEBUG
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,15 +18,14 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Symbols are used to name several term and type constructors.
 | 
					    /// Symbols are used to name several term and type constructors.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Symbol : Z3Object
 | 
					    public class Symbol : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -84,7 +83,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public static bool operator !=(Symbol s1, Symbol s2)
 | 
					        public static bool operator !=(Symbol s1, Symbol s2)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return !(s1.NativeObject == s2.NativeObject);
 | 
					            return !(s1 == s2);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -113,13 +112,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        internal protected Symbol(Context ctx, IntPtr obj) : base(ctx, obj) 
 | 
					        internal protected Symbol(Context ctx, IntPtr obj) : base(ctx, obj) 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal static Symbol Create(Context ctx, IntPtr obj)
 | 
					        internal static Symbol Create(Context ctx, IntPtr obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<Symbol>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            switch ((Z3_symbol_kind)Native.Z3_get_symbol_kind(ctx.nCtx, obj))
 | 
					            switch ((Z3_symbol_kind)Native.Z3_get_symbol_kind(ctx.nCtx, obj))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// and <c>Context.TacticNames</c>.
 | 
					    /// and <c>Context.TacticNames</c>.
 | 
				
			||||||
    /// It may also be obtained using the command <c>(help-tactic)</c> in the SMT 2.0 front-end.
 | 
					    /// It may also be obtained using the command <c>(help-tactic)</c> in the SMT 2.0 front-end.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Tactic : Z3Object
 | 
					    public class Tactic : Z3Object
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -38,7 +37,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Native.Z3_tactic_get_help(Context.nCtx, NativeObject);
 | 
					                return Native.Z3_tactic_get_help(Context.nCtx, NativeObject);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -59,8 +57,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public ApplyResult Apply(Goal g, Params p = null)
 | 
					        public ApplyResult Apply(Goal g, Params p = null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(g != null);
 | 
					            Debug.Assert(g != null);
 | 
				
			||||||
            Contract.Ensures(Contract.Result<ApplyResult>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Context.CheckContextMatch(g);
 | 
					            Context.CheckContextMatch(g);
 | 
				
			||||||
            if (p == null)
 | 
					            if (p == null)
 | 
				
			||||||
| 
						 | 
					@ -79,8 +76,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Requires(g != null);
 | 
					                Debug.Assert(g != null);
 | 
				
			||||||
                Contract.Ensures(Contract.Result<ApplyResult>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Apply(g);
 | 
					                return Apply(g);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -94,7 +90,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Solver>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Context.MkSolver(this);
 | 
					                return Context.MkSolver(this);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -104,12 +99,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal Tactic(Context ctx, IntPtr obj)
 | 
					        internal Tactic(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal Tactic(Context ctx, string name)
 | 
					        internal Tactic(Context ctx, string name)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_tactic(ctx.nCtx, name))
 | 
					            : base(ctx, Native.Z3_mk_tactic(ctx.nCtx, name))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,14 +18,13 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Tuple sorts.
 | 
					    /// Tuple sorts.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class TupleSort : Sort
 | 
					    public class TupleSort : Sort
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -35,7 +34,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return new FuncDecl(Context, Native.Z3_get_tuple_sort_mk_decl(Context.nCtx, NativeObject));
 | 
					                return new FuncDecl(Context, Native.Z3_get_tuple_sort_mk_decl(Context.nCtx, NativeObject));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -56,7 +54,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<FuncDecl[]>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                uint n = NumFields;
 | 
					                uint n = NumFields;
 | 
				
			||||||
                FuncDecl[] res = new FuncDecl[n];
 | 
					                FuncDecl[] res = new FuncDecl[n];
 | 
				
			||||||
| 
						 | 
					@ -70,8 +67,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal TupleSort(Context ctx, Symbol name, uint numFields, Symbol[] fieldNames, Sort[] fieldSorts)
 | 
					        internal TupleSort(Context ctx, Symbol name, uint numFields, Symbol[] fieldNames, Sort[] fieldSorts)
 | 
				
			||||||
            : base(ctx, IntPtr.Zero)
 | 
					            : base(ctx, IntPtr.Zero)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(name != null);
 | 
					            Debug.Assert(name != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            IntPtr t = IntPtr.Zero;
 | 
					            IntPtr t = IntPtr.Zero;
 | 
				
			||||||
            IntPtr[] f = new IntPtr[numFields];
 | 
					            IntPtr[] f = new IntPtr[numFields];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@ Notes:
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -31,13 +31,13 @@ namespace Microsoft.Z3
 | 
				
			||||||
        internal UninterpretedSort(Context ctx, IntPtr obj)
 | 
					        internal UninterpretedSort(Context ctx, IntPtr obj)
 | 
				
			||||||
            : base(ctx, obj)
 | 
					            : base(ctx, obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        internal UninterpretedSort(Context ctx, Symbol s)
 | 
					        internal UninterpretedSort(Context ctx, Symbol s)
 | 
				
			||||||
            : base(ctx, Native.Z3_mk_uninterpreted_sort(ctx.nCtx, s.NativeObject))
 | 
					            : base(ctx, Native.Z3_mk_uninterpreted_sort(ctx.nCtx, s.NativeObject))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
            Contract.Requires(s != null);
 | 
					            Debug.Assert(s != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// Version information.
 | 
					    /// Version information.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    /// <remarks>Note that this class is static.</remarks>
 | 
					    /// <remarks>Note that this class is static.</remarks>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public static class Version
 | 
					    public static class Version
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        static Version() { }
 | 
					        static Version() { }
 | 
				
			||||||
| 
						 | 
					@ -99,7 +98,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        new public static string ToString()
 | 
					        new public static string ToString()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(Contract.Result<string>() != null);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            uint major = 0, minor = 0, build = 0, revision = 0;
 | 
					            uint major = 0, minor = 0, build = 0, revision = 0;
 | 
				
			||||||
            Native.Z3_get_version(ref major, ref minor, ref build, ref revision);
 | 
					            Native.Z3_get_version(ref major, ref minor, ref build, ref revision);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,6 +17,7 @@ Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Microsoft.Z3
 | 
					namespace Microsoft.Z3
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,8 @@ Notes:
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
--*/
 | 
					--*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Diagnostics.Contracts;
 | 
					 | 
				
			||||||
using System.Threading;
 | 
					using System.Threading;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
    /// Internal base class for interfacing with native Z3 objects.
 | 
					    /// Internal base class for interfacing with native Z3 objects.
 | 
				
			||||||
    /// Should not be used externally.
 | 
					    /// Should not be used externally.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    [ContractVerification(true)]
 | 
					 | 
				
			||||||
    public class Z3Object : IDisposable
 | 
					    public class Z3Object : IDisposable
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -63,10 +62,9 @@ namespace Microsoft.Z3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Object Invariant
 | 
					        #region Object Invariant
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        [ContractInvariantMethod]
 | 
					 | 
				
			||||||
        private void ObjectInvariant()
 | 
					        private void ObjectInvariant()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Invariant(this.m_ctx != null);
 | 
					            Debug.Assert(this.m_ctx != null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
| 
						 | 
					@ -77,7 +75,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal Z3Object(Context ctx)
 | 
					        internal Z3Object(Context ctx)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Interlocked.Increment(ref ctx.refCount);
 | 
					            Interlocked.Increment(ref ctx.refCount);
 | 
				
			||||||
            m_ctx = ctx;
 | 
					            m_ctx = ctx;
 | 
				
			||||||
| 
						 | 
					@ -85,7 +83,7 @@ namespace Microsoft.Z3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        internal Z3Object(Context ctx, IntPtr obj)
 | 
					        internal Z3Object(Context ctx, IntPtr obj)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Requires(ctx != null);
 | 
					            Debug.Assert(ctx != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Interlocked.Increment(ref ctx.refCount);
 | 
					            Interlocked.Increment(ref ctx.refCount);
 | 
				
			||||||
            m_ctx = ctx;
 | 
					            m_ctx = ctx;
 | 
				
			||||||
| 
						 | 
					@ -119,16 +117,12 @@ namespace Microsoft.Z3
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get 
 | 
					            get 
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Contract.Ensures(Contract.Result<Context>() != null);
 | 
					 | 
				
			||||||
                return m_ctx; 
 | 
					                return m_ctx; 
 | 
				
			||||||
            }            
 | 
					            }            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Pure]
 | 
					 | 
				
			||||||
        internal static IntPtr[] ArrayToNative(Z3Object[] a)
 | 
					        internal static IntPtr[] ArrayToNative(Z3Object[] a)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(a == null || Contract.Result<IntPtr[]>() != null);
 | 
					 | 
				
			||||||
            Contract.Ensures(a == null || Contract.Result<IntPtr[]>().Length == a.Length);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (a == null) return null;
 | 
					            if (a == null) return null;
 | 
				
			||||||
            IntPtr[] an = new IntPtr[a.Length];
 | 
					            IntPtr[] an = new IntPtr[a.Length];
 | 
				
			||||||
| 
						 | 
					@ -137,11 +131,8 @@ namespace Microsoft.Z3
 | 
				
			||||||
            return an;
 | 
					            return an;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Pure]
 | 
					 | 
				
			||||||
        internal static IntPtr[] EnumToNative<T>(IEnumerable<T> a) where T : Z3Object
 | 
					        internal static IntPtr[] EnumToNative<T>(IEnumerable<T> a) where T : Z3Object
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Contract.Ensures(a == null || Contract.Result<IntPtr[]>() != null);
 | 
					 | 
				
			||||||
            Contract.Ensures(a == null || Contract.Result<IntPtr[]>().Length == a.Count());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (a == null) return null;
 | 
					            if (a == null) return null;
 | 
				
			||||||
            IntPtr[] an = new IntPtr[a.Count()];
 | 
					            IntPtr[] an = new IntPtr[a.Count()];
 | 
				
			||||||
| 
						 | 
					@ -154,7 +145,6 @@ namespace Microsoft.Z3
 | 
				
			||||||
            return an;
 | 
					            return an;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [Pure]
 | 
					 | 
				
			||||||
        internal static uint ArrayLength(Z3Object[] a)
 | 
					        internal static uint ArrayLength(Z3Object[] a)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return (a == null)?0:(uint)a.Length;
 | 
					            return (a == null)?0:(uint)a.Length;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,65 +0,0 @@
 | 
				
			||||||
/*++
 | 
					 | 
				
			||||||
Copyright (<c>) 2016 Microsoft Corporation
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Module Name:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Contracts.cs
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Abstract:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Z3 Managed API: Dummy Code Contracts class for .NET
 | 
					 | 
				
			||||||
    frameworks that don't support them (e.g., CoreCLR).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Author:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    Christoph Wintersteiger (cwinter) 2016-10-06
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Notes:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
--*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace System.Diagnostics.Contracts
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public class ContractClass : Attribute
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        public ContractClass(Type t) { }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public class ContractClassFor : Attribute
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        public ContractClassFor(Type t) { }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public class ContractInvariantMethod : Attribute
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        public ContractInvariantMethod() { }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public class ContractVerification : Attribute
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        public ContractVerification(bool b) { }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public class Pure : Attribute { }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static class Contract
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        [Conditional("false")]
 | 
					 | 
				
			||||||
        public static void Ensures(bool b) { }
 | 
					 | 
				
			||||||
        [Conditional("false")]
 | 
					 | 
				
			||||||
        public static void Requires(bool b) { }
 | 
					 | 
				
			||||||
        [Conditional("false")]
 | 
					 | 
				
			||||||
        public static void Assume(bool b, string msg) { }
 | 
					 | 
				
			||||||
        [Conditional("false")]
 | 
					 | 
				
			||||||
        public static void Assert(bool b) { }
 | 
					 | 
				
			||||||
        public static bool ForAll(bool b) { return true; }
 | 
					 | 
				
			||||||
        public static bool ForAll(Object c, Func<Object, bool> p) { return true; }
 | 
					 | 
				
			||||||
        public static bool ForAll(int from, int to, Predicate<int> p) { return true; }
 | 
					 | 
				
			||||||
        [Conditional("false")]
 | 
					 | 
				
			||||||
        public static void Invariant(bool b) { }
 | 
					 | 
				
			||||||
        public static T[] Result<T>() { return new T[1]; }
 | 
					 | 
				
			||||||
        [Conditional("false")]
 | 
					 | 
				
			||||||
        public static void EndContractBlock() { }
 | 
					 | 
				
			||||||
        public static T ValueAtReturn<T>(out T v) { T[] t = new T[1]; v = t[0]; return v; }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -6,4 +6,10 @@ functions, so that the API will compile, but not perform any contract
 | 
				
			||||||
checking. To build this using .NET core, run (in this directory):
 | 
					checking. To build this using .NET core, run (in this directory):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dotnet restore
 | 
					dotnet restore
 | 
				
			||||||
dotnet build project.json
 | 
					dotnet build core.csproj -c Release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If you are building with the cmake system, you should first
 | 
				
			||||||
 | 
					copy over files that are produced by the compiler into
 | 
				
			||||||
 | 
					this directory. You need to copy over Native.cs and Enumeration.cs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- good luck!
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										18
									
								
								src/api/dotnet/core/core.csproj
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/api/dotnet/core/core.csproj
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,18 @@
 | 
				
			||||||
 | 
					<Project Sdk="Microsoft.NET.Sdk">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <PropertyGroup>
 | 
				
			||||||
 | 
					    <TargetFramework>netcoreapp1.0</TargetFramework>
 | 
				
			||||||
 | 
					    <DefineConstants>$(DefineConstants);DOTNET_CORE</DefineConstants>
 | 
				
			||||||
 | 
					    <DebugType>portable</DebugType>
 | 
				
			||||||
 | 
					    <AssemblyName>Microsoft.Z3</AssemblyName>
 | 
				
			||||||
 | 
					    <OutputType>Library</OutputType>
 | 
				
			||||||
 | 
					    <PackageId>core</PackageId>
 | 
				
			||||||
 | 
					    <PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
 | 
				
			||||||
 | 
					    <RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <Compile Include="..\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</Project>
 | 
				
			||||||
| 
						 | 
					@ -199,7 +199,7 @@ def prove(claim,assume=None,verbose=0):
 | 
				
			||||||
    >>> r,m = prove(True,assume=And(x,Not(x)),verbose=0)
 | 
					    >>> r,m = prove(True,assume=And(x,Not(x)),verbose=0)
 | 
				
			||||||
    Traceback (most recent call last):
 | 
					    Traceback (most recent call last):
 | 
				
			||||||
    ...
 | 
					    ...
 | 
				
			||||||
    AssertionError: Assumption is alway False!
 | 
					    AssertionError: Assumption is always False!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    >>> r,m = prove(Implies(x,x),assume=y,verbose=2); r,model_str(m,as_str=False)
 | 
					    >>> r,m = prove(Implies(x,x),assume=y,verbose=2); r,model_str(m,as_str=False)
 | 
				
			||||||
    assume: 
 | 
					    assume: 
 | 
				
			||||||
| 
						 | 
					@ -238,7 +238,7 @@ def prove(claim,assume=None,verbose=0):
 | 
				
			||||||
            is_proved,_ = prove(Not(assume))
 | 
					            is_proved,_ = prove(Not(assume))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            def _f():
 | 
					            def _f():
 | 
				
			||||||
                emsg = "Assumption is alway False!"
 | 
					                emsg = "Assumption is always False!"
 | 
				
			||||||
                if verbose >= 2:
 | 
					                if verbose >= 2:
 | 
				
			||||||
                    emsg = "{}\n{}".format(assume,emsg)
 | 
					                    emsg = "{}\n{}".format(assume,emsg)
 | 
				
			||||||
                return emsg
 | 
					                return emsg
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3772,7 +3772,7 @@ extern "C" {
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
       \brief Create a lambda expression. It taks an expression \c body that contains bound variables 
 | 
					       \brief Create a lambda expression. It takes an expression \c body that contains bound variables
 | 
				
			||||||
       of the same sorts as the sorts listed in the array \c sorts. The bound variables are de-Bruijn indices created
 | 
					       of the same sorts as the sorts listed in the array \c sorts. The bound variables are de-Bruijn indices created
 | 
				
			||||||
       using #Z3_mk_bound. The array \c decl_names contains the names that the quantified formula uses for the
 | 
					       using #Z3_mk_bound. The array \c decl_names contains the names that the quantified formula uses for the
 | 
				
			||||||
       bound variables. Z3 applies the convention that the last element in the \c decl_names and \c sorts array
 | 
					       bound variables. Z3 applies the convention that the last element in the \c decl_names and \c sorts array
 | 
				
			||||||
| 
						 | 
					@ -4438,6 +4438,15 @@ extern "C" {
 | 
				
			||||||
    */
 | 
					    */
 | 
				
			||||||
    Z3_string Z3_API Z3_get_numeral_decimal_string(Z3_context c, Z3_ast a, unsigned precision);
 | 
					    Z3_string Z3_API Z3_get_numeral_decimal_string(Z3_context c, Z3_ast a, unsigned precision);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					       \brief Return numeral as a double.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					       \pre Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST || Z3_is_algebraic_number(c, a)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					       def_API('Z3_get_numeral_double', DOUBLE, (_in(CONTEXT), _in(AST)))
 | 
				
			||||||
 | 
					    */
 | 
				
			||||||
 | 
					    double Z3_API Z3_get_numeral_double(Z3_context c, Z3_ast a);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
       \brief Return the numerator (as a numeral AST) of a numeral AST of sort Real.
 | 
					       \brief Return the numerator (as a numeral AST) of a numeral AST of sort Real.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4600,7 +4609,7 @@ extern "C" {
 | 
				
			||||||
    Z3_bool Z3_API Z3_is_quantifier_exists(Z3_context c, Z3_ast a);
 | 
					    Z3_bool Z3_API Z3_is_quantifier_exists(Z3_context c, Z3_ast a);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
       \brief Determine if ast is a lambda expresion.
 | 
					       \brief Determine if ast is a lambda expression.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       \pre Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
 | 
					       \pre Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5987,7 +5996,7 @@ extern "C" {
 | 
				
			||||||
    Z3_solver Z3_API Z3_solver_translate(Z3_context source, Z3_solver s, Z3_context target);
 | 
					    Z3_solver Z3_API Z3_solver_translate(Z3_context source, Z3_solver s, Z3_context target);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
       \brief Ad-hoc method for importing model convertion from solver.
 | 
					       \brief Ad-hoc method for importing model conversion from solver.
 | 
				
			||||||
       
 | 
					       
 | 
				
			||||||
       def_API('Z3_solver_import_model_converter', VOID, (_in(CONTEXT), _in(SOLVER), _in(SOLVER)))
 | 
					       def_API('Z3_solver_import_model_converter', VOID, (_in(CONTEXT), _in(SOLVER), _in(SOLVER)))
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
| 
						 | 
					@ -6206,7 +6215,7 @@ extern "C" {
 | 
				
			||||||
       The third argument is a vector of variables that may be used for cubing.
 | 
					       The third argument is a vector of variables that may be used for cubing.
 | 
				
			||||||
       The contents of the vector is only used in the first call. The initial list of variables
 | 
					       The contents of the vector is only used in the first call. The initial list of variables
 | 
				
			||||||
       is used in subsequent calls until it returns the unsatisfiable cube. 
 | 
					       is used in subsequent calls until it returns the unsatisfiable cube. 
 | 
				
			||||||
       The vector is modified to contain a set of Autarky variables that occor in clauses that
 | 
					       The vector is modified to contain a set of Autarky variables that occur in clauses that
 | 
				
			||||||
       are affected by the (last literal in the) cube. These variables could be used by a different
 | 
					       are affected by the (last literal in the) cube. These variables could be used by a different
 | 
				
			||||||
       cuber (on a different solver object) for further recursive cubing. 
 | 
					       cuber (on a different solver object) for further recursive cubing. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -123,7 +123,7 @@ inline expr_ref mk_or(expr_ref_vector const& args) { return expr_ref(mk_or(args.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
   Return a          if arg = (not a)
 | 
					   Return a          if arg = (not a)
 | 
				
			||||||
   Retur (not arg)   otherwise
 | 
					   Return (not arg)  otherwise
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
expr * mk_not(ast_manager & m, expr * arg);
 | 
					expr * mk_not(ast_manager & m, expr * arg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,7 @@ fpa2bv_rewriter_cfg::fpa2bv_rewriter_cfg(ast_manager & m, fpa2bv_converter & c,
 | 
				
			||||||
    m_bindings(m)
 | 
					    m_bindings(m)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    updt_params(p);
 | 
					    updt_params(p);
 | 
				
			||||||
    // We need to make sure that the mananger has the BV plugin loaded.
 | 
					    // We need to make sure that the manager has the BV plugin loaded.
 | 
				
			||||||
    symbol s_bv("bv");
 | 
					    symbol s_bv("bv");
 | 
				
			||||||
    if (!m_manager.has_plugin(s_bv))
 | 
					    if (!m_manager.has_plugin(s_bv))
 | 
				
			||||||
        m_manager.register_plugin(s_bv, alloc(bv_decl_plugin));
 | 
					        m_manager.register_plugin(s_bv, alloc(bv_decl_plugin));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue