From f87f038c5f0821d0fefb01cea00bfdec6004da91 Mon Sep 17 00:00:00 2001 From: Aina Niemetz Date: Fri, 9 Apr 2021 17:22:07 -0700 Subject: [PATCH] Rename CVC4_ macros to CVC5_. (#6327) --- CMakeLists.txt | 94 +- cmake/CVC4Config.cmake.in | 10 +- cmake/ConfigCompetition.cmake | 2 +- cmake/ConfigDebug.cmake | 2 +- cmake/ConfigureCVC4.cmake | 22 +- cmake/Toolchain-mingw64.cmake | 2 +- cvc4autoconfig.h.in | 28 +- examples/CMakeLists.txt | 10 +- examples/api/CMakeLists.txt | 4 +- examples/api/java/CMakeLists.txt | 6 +- examples/api/python/CMakeLists.txt | 2 +- examples/nra-translate/CMakeLists.txt | 4 +- src/CMakeLists.txt | 2 +- src/api/cpp/cvc5.cpp | 2056 ++++++++--------- src/api/cpp/cvc5.h | 16 +- src/api/cpp/cvc5_checks.h | 268 +-- src/api/python/CMakeLists.txt | 10 +- src/api/python/setup.py.in | 2 +- src/base/check.cpp | 8 +- src/base/check.h | 64 +- src/base/configuration.cpp | 72 +- src/base/configuration.h | 2 +- src/base/configuration_private.h | 110 +- src/base/exception.cpp | 8 +- src/base/exception.h | 15 +- src/base/output.h | 53 +- src/context/cdlist_forward.h | 2 +- src/context/context_mm.cpp | 36 +- src/context/context_mm.h | 10 +- src/decision/justification_heuristic.cpp | 4 +- src/expr/attribute.h | 4 +- src/expr/attribute_internals.h | 4 +- src/expr/metakind_template.cpp | 26 +- src/expr/node.cpp | 4 +- src/expr/node.h | 4 +- src/expr/node_builder.cpp | 40 +- src/expr/node_builder.h | 6 +- src/expr/node_manager.cpp | 6 +- src/expr/node_value.h | 4 +- src/expr/type_node.h | 4 +- src/include/cvc4_private.h | 6 +- src/include/cvc4_private_library.h | 6 +- src/include/cvc4_public.h | 28 +- src/lib/replacements.h | 3 +- src/main/driver_unified.cpp | 26 +- src/main/interactive_shell.cpp | 2 +- src/main/main.cpp | 4 +- src/main/main.h | 2 +- src/main/signal_handlers.cpp | 22 +- src/options/mkoptions.py | 2 +- src/options/options_handler.cpp | 12 +- src/options/options_handler.h | 4 +- src/options/options_template.cpp | 20 +- src/parser/CMakeLists.txt | 4 +- src/parser/antlr_input.cpp | 20 +- src/parser/antlr_line_buffered_input.cpp | 38 +- src/parser/antlr_tracing.h | 6 +- src/parser/cvc/Cvc.g | 4 +- src/parser/memory_mapped_input_buffer.cpp | 6 +- src/parser/smt2/Smt2.g | 4 +- src/parser/smt2/smt2.cpp | 6 +- src/parser/tptp/tptp.cpp | 6 +- src/preprocessing/passes/bv_gauss.cpp | 8 +- src/preprocessing/passes/bv_to_int.cpp | 4 +- src/preprocessing/passes/miplib_trick.cpp | 4 +- src/preprocessing/passes/non_clausal_simp.cpp | 6 +- .../passes/unconstrained_simplifier.cpp | 4 +- src/preprocessing/util/ite_utilities.cpp | 2 +- src/printer/smt2/smt2_printer.cpp | 6 +- src/prop/bvminisat/simp/SimpSolver.cc | 2 +- src/prop/cadical.cpp | 4 +- src/prop/cadical.h | 4 +- src/prop/cnf_stream.cpp | 2 +- src/prop/cryptominisat.cpp | 2 +- src/prop/cryptominisat.h | 4 +- src/prop/kissat.cpp | 4 +- src/prop/kissat.h | 4 +- src/prop/minisat/simp/SimpSolver.cc | 9 +- src/prop/proof_cnf_stream.cpp | 2 +- src/prop/sat_proof_manager.cpp | 4 +- src/prop/sat_solver_factory.cpp | 6 +- src/prop/theory_proxy.h | 2 +- src/smt/dump.cpp | 4 +- src/smt/dump.h | 4 +- src/smt/listeners.cpp | 2 +- src/smt/managed_ostreams.cpp | 6 +- src/smt/set_defaults.cpp | 4 +- src/smt/smt_engine_state.cpp | 2 +- src/smt_util/boolean_simplification.h | 6 +- src/theory/arith/approx_simplex.cpp | 18 +- src/theory/arith/arith_static_learner.cpp | 4 +- src/theory/arith/dio_solver.cpp | 4 +- src/theory/arith/dual_simplex.cpp | 4 +- src/theory/arith/error_set.h | 4 +- src/theory/arith/nl/cad/cdcac.cpp | 2 +- src/theory/arith/nl/cad/cdcac.h | 2 +- src/theory/arith/nl/cad/cdcac_utils.cpp | 2 +- src/theory/arith/nl/cad/cdcac_utils.h | 2 +- src/theory/arith/nl/cad/constraints.cpp | 2 +- src/theory/arith/nl/cad/constraints.h | 2 +- src/theory/arith/nl/cad/projections.cpp | 2 +- src/theory/arith/nl/cad/projections.h | 2 +- src/theory/arith/nl/cad/proof_generator.cpp | 2 +- src/theory/arith/nl/cad/proof_generator.h | 2 +- src/theory/arith/nl/cad/variable_ordering.cpp | 2 +- src/theory/arith/nl/cad/variable_ordering.h | 2 +- src/theory/arith/nl/cad_solver.cpp | 12 +- src/theory/arith/nl/cad_solver.h | 2 +- src/theory/arith/nl/icp/candidate.cpp | 2 +- src/theory/arith/nl/icp/candidate.h | 2 +- src/theory/arith/nl/icp/icp_solver.cpp | 6 +- src/theory/arith/nl/icp/icp_solver.h | 10 +- src/theory/arith/nl/icp/intersection.cpp | 2 +- src/theory/arith/nl/icp/intersection.h | 2 +- src/theory/arith/nl/icp/interval.h | 2 +- src/theory/arith/nl/poly_conversion.cpp | 6 +- src/theory/arith/nl/poly_conversion.h | 2 +- src/theory/arith/partial_model.cpp | 2 +- src/theory/arith/theory_arith_private.cpp | 14 +- src/theory/arrays/theory_arrays.cpp | 14 +- src/theory/booleans/circuit_propagator.h | 2 +- src/theory/bv/bitblast/aig_bitblaster.cpp | 6 +- src/theory/bv/bitblast/aig_bitblaster.h | 6 +- src/theory/bv/bv_eager_solver.cpp | 6 +- .../theory_bv_rewrite_rules_simplification.h | 2 +- src/theory/fp/fp_converter.cpp | 44 +- src/theory/fp/fp_converter.h | 16 +- src/theory/fp/theory_fp_rewriter.cpp | 10 +- src/theory/fp/theory_fp_type_rules.cpp | 6 +- src/theory/model_manager_distributed.cpp | 2 +- .../quantifiers/candidate_rewrite_filter.cpp | 2 +- .../cegqi/ceg_bv_instantiator_utils.cpp | 2 +- src/theory/quantifiers/fun_def_evaluator.cpp | 2 +- src/theory/quantifiers/instantiate.cpp | 2 +- .../quantifiers/sygus/sygus_unif_io.cpp | 2 +- .../quantifiers/term_tuple_enumerator.cpp | 2 +- src/theory/rewriter.cpp | 10 +- src/theory/rewriter.h | 4 +- src/theory/strings/arith_entail.cpp | 2 +- src/theory/strings/core_solver.cpp | 2 +- src/theory/theory.h | 15 +- src/theory/theory_engine.cpp | 127 +- src/theory/theory_model.cpp | 4 +- src/theory/theory_model_builder.cpp | 16 +- src/theory/type_enumerator.h | 10 +- src/theory/uf/equality_engine.cpp | 6 +- src/theory/uf/symmetry_breaker.cpp | 4 +- src/theory/valuation.h | 2 +- src/util/CMakeLists.txt | 6 +- src/util/floatingpoint.cpp | 2 +- src/util/floatingpoint_literal_symfpu.cpp | 90 +- src/util/floatingpoint_literal_symfpu.h.in | 12 +- .../floatingpoint_literal_symfpu_traits.cpp | 2 +- .../floatingpoint_literal_symfpu_traits.h.in | 2 +- src/util/hash.h | 4 +- src/util/integer.h.in | 24 +- src/util/integer_cln_imp.cpp | 6 +- src/util/integer_cln_imp.h | 4 +- src/util/integer_gmp_imp.cpp | 4 +- src/util/integer_gmp_imp.h | 4 +- src/util/poly_util.cpp | 18 +- src/util/poly_util.h | 2 +- src/util/rational.h.in | 24 +- src/util/rational_cln_imp.cpp | 6 +- src/util/rational_cln_imp.h | 8 +- src/util/rational_gmp_imp.cpp | 6 +- src/util/rational_gmp_imp.h | 8 +- src/util/real_algebraic_number.h.in | 10 +- src/util/real_algebraic_number_poly_imp.cpp | 8 +- src/util/roundingmode.h | 2 +- src/util/sampler.cpp | 12 +- src/util/statistics.cpp | 8 +- src/util/statistics_registry.cpp | 26 +- src/util/statistics_registry.h | 38 +- src/util/stats_base.cpp | 14 +- src/util/stats_base.h | 10 +- src/util/stats_histogram.h | 2 +- src/util/stats_timer.cpp | 8 +- src/util/string.cpp | 4 +- src/util/utility.cpp | 2 +- test/api/CMakeLists.txt | 6 +- test/api/issue4889.cpp | 2 +- test/regress/run_regression.py | 4 +- test/unit/CMakeLists.txt | 4 +- test/unit/context/cdlist_black.cpp | 2 +- test/unit/context/context_black.cpp | 4 +- test/unit/context/context_mm_black.cpp | 2 +- test/unit/memory.h | 22 +- test/unit/node/kind_map_black.cpp | 2 +- test/unit/node/node_black.cpp | 10 +- test/unit/node/node_builder_black.cpp | 38 +- test/unit/node/node_manager_black.cpp | 4 +- test/unit/node/node_manager_white.cpp | 8 +- test/unit/parser/parser_black.cpp | 8 +- test/unit/util/CMakeLists.txt | 4 +- test/unit/util/assert_white.cpp | 4 +- test/unit/util/binary_heap_black.cpp | 6 +- .../util/boolean_simplification_black.cpp | 8 +- test/unit/util/check_white.cpp | 6 +- test/unit/util/configuration_black.cpp | 36 +- test/unit/util/output_black.cpp | 42 +- .../unit/util/real_algebraic_number_black.cpp | 4 +- test/unit/util/stats_black.cpp | 2 +- 203 files changed, 2222 insertions(+), 2200 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b2928961..99079ffc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,22 +17,22 @@ project(cvc4) include(GNUInstallDirs) -set(CVC4_MAJOR 1) # Major component of the version of CVC4. -set(CVC4_MINOR 9) # Minor component of the version of CVC4. -set(CVC4_RELEASE 0) # Release component of the version of CVC4. +set(CVC5_MAJOR 1) # Major component of the version of CVC4. +set(CVC5_MINOR 9) # Minor component of the version of CVC4. +set(CVC5_RELEASE 0) # Release component of the version of CVC4. # Extraversion component of the version of CVC4. -set(CVC4_EXTRAVERSION "-prerelease") +set(CVC5_EXTRAVERSION "-prerelease") # Shared library versioning. Increment SOVERSION for every new CVC4 release. -set(CVC4_SOVERSION 7) +set(CVC5_SOVERSION 7) # Full release string for CVC4. -if(CVC4_RELEASE) - set(CVC4_RELEASE_STRING - "${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}${CVC4_EXTRAVERSION}") +if(CVC5_RELEASE) + set(CVC5_RELEASE_STRING + "${CVC5_MAJOR}.${CVC5_MINOR}.${CVC5_RELEASE}${CVC5_EXTRAVERSION}") else() - set(CVC4_RELEASE_STRING "${CVC4_MAJOR}.${CVC4_MINOR}${CVC4_EXTRAVERSION}") + set(CVC5_RELEASE_STRING "${CVC5_MAJOR}.${CVC5_MINOR}${CVC5_EXTRAVERSION}") endif() set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) @@ -334,7 +334,7 @@ endif() if(ENABLE_UBSAN) add_required_c_cxx_flag("-fsanitize=undefined") - add_definitions(-DCVC4_USE_UBSAN) + add_definitions(-DCVC5_USE_UBSAN) endif() if(ENABLE_TSAN) @@ -346,7 +346,7 @@ if(ENABLE_TSAN) endif() if(ENABLE_ASSERTIONS) - add_definitions(-DCVC4_ASSERTIONS) + add_definitions(-DCVC5_ASSERTIONS) else() add_definitions(-DNDEBUG) endif() @@ -354,7 +354,7 @@ endif() if(ENABLE_COVERAGE) include(CodeCoverage) APPEND_COVERAGE_COMPILER_FLAGS() - add_definitions(-DCVC4_COVERAGE) + add_definitions(-DCVC5_COVERAGE) # Note: The ctest command returns a non-zero exit code if tests fail or run # into a timeout. As a consequence, the coverage report is not generated. To # prevent this we always return with exit code 0 after the ctest command has @@ -369,7 +369,7 @@ if(ENABLE_COVERAGE) endif() if(ENABLE_DEBUG_CONTEXT_MM) - add_definitions(-DCVC4_DEBUG_CONTEXT_MEMORY_MANAGER) + add_definitions(-DCVC5_DEBUG_CONTEXT_MEMORY_MANAGER) endif() if(ENABLE_DEBUG_SYMBOLS) @@ -377,53 +377,53 @@ if(ENABLE_DEBUG_SYMBOLS) endif() if(ENABLE_COMP_INC_TRACK) - add_definitions(-DCVC4_SMTCOMP_APPLICATION_TRACK) + add_definitions(-DCVC5_SMTCOMP_APPLICATION_TRACK) endif() if(ENABLE_MUZZLE) - add_definitions(-DCVC4_MUZZLE) + add_definitions(-DCVC5_MUZZLE) endif() if(ENABLE_DUMPING) - add_definitions(-DCVC4_DUMPING) + add_definitions(-DCVC5_DUMPING) endif() if(ENABLE_PROFILING) - add_definitions(-DCVC4_PROFILING) + add_definitions(-DCVC5_PROFILING) add_check_c_cxx_flag("-pg") endif() if(ENABLE_TRACING) - add_definitions(-DCVC4_TRACING) + add_definitions(-DCVC5_TRACING) endif() if(ENABLE_STATISTICS) - add_definitions(-DCVC4_STATISTICS_ON) + add_definitions(-DCVC5_STATISTICS_ON) endif() if(ENABLE_VALGRIND) find_package(Valgrind REQUIRED) - add_definitions(-DCVC4_VALGRIND) + add_definitions(-DCVC5_VALGRIND) endif() if(USE_ABC) find_package(ABC REQUIRED) - add_definitions(-DCVC4_USE_ABC ${ABC_ARCH_FLAGS}) + add_definitions(-DCVC5_USE_ABC ${ABC_ARCH_FLAGS}) endif() if(USE_CADICAL) find_package(CaDiCaL REQUIRED) - add_definitions(-DCVC4_USE_CADICAL) + add_definitions(-DCVC5_USE_CADICAL) endif() if(USE_CLN) set(GPL_LIBS "${GPL_LIBS} cln") find_package(CLN 1.2.2 REQUIRED) - set(CVC4_USE_CLN_IMP 1) - set(CVC4_USE_GMP_IMP 0) + set(CVC5_USE_CLN_IMP 1) + set(CVC5_USE_GMP_IMP 0) else() - set(CVC4_USE_CLN_IMP 0) - set(CVC4_USE_GMP_IMP 1) + set(CVC5_USE_CLN_IMP 0) + set(CVC5_USE_GMP_IMP 1) endif() if(USE_CRYPTOMINISAT) @@ -434,26 +434,26 @@ if(USE_CRYPTOMINISAT) add_c_cxx_flag(-pthread) endif() find_package(CryptoMiniSat REQUIRED) - add_definitions(-DCVC4_USE_CRYPTOMINISAT) + add_definitions(-DCVC5_USE_CRYPTOMINISAT) endif() if(USE_GLPK) set(GPL_LIBS "${GPL_LIBS} glpk") find_package(GLPK REQUIRED) - add_definitions(-DCVC4_USE_GLPK) + add_definitions(-DCVC5_USE_GLPK) endif() if(USE_KISSAT) find_package(Kissat REQUIRED) - add_definitions(-DCVC4_USE_KISSAT) + add_definitions(-DCVC5_USE_KISSAT) endif() if(USE_POLY) find_package(Poly REQUIRED) - add_definitions(-DCVC4_USE_POLY) - set(CVC4_USE_POLY_IMP 1) + add_definitions(-DCVC5_USE_POLY) + set(CVC5_USE_POLY_IMP 1) else() - set(CVC4_USE_POLY_IMP 0) + set(CVC5_USE_POLY_IMP 0) endif() if(USE_EDITLINE) @@ -466,10 +466,10 @@ endif() if(USE_SYMFPU) find_package(SymFPU REQUIRED) - add_definitions(-DCVC4_USE_SYMFPU) - set(CVC4_USE_SYMFPU 1) + add_definitions(-DCVC5_USE_SYMFPU) + set(CVC5_USE_SYMFPU 1) else() - set(CVC4_USE_SYMFPU 0) + set(CVC5_USE_SYMFPU 0) endif() if(GPL_LIBS) @@ -478,7 +478,7 @@ if(GPL_LIBS) "Bad configuration detected: BSD-licensed code only, but also requested " "GPLed libraries: ${GPL_LIBS}") endif() - set(CVC4_GPL_DEPS 1) + set(CVC5_GPL_DEPS 1) endif() #-----------------------------------------------------------------------------# @@ -491,10 +491,10 @@ include(IWYU) include(ConfigureCVC4) if(NOT ENABLE_SHARED) - set(CVC4_STATIC_BUILD ON) + set(CVC5_STATIC_BUILD ON) endif() configure_file(cvc4autoconfig.h.in cvc4autoconfig.h) -unset(CVC4_STATIC_BUILD) +unset(CVC5_STATIC_BUILD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) #-----------------------------------------------------------------------------# @@ -585,7 +585,7 @@ configure_package_config_file( write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/CVC4ConfigVersion.cmake - VERSION ${CVC4_RELEASE_STRING} + VERSION ${CVC5_RELEASE_STRING} COMPATIBILITY ExactVersion ) @@ -608,19 +608,19 @@ if(NOT WIN32) endif() # Convert build type to lower case. -string(TOLOWER ${CMAKE_BUILD_TYPE} CVC4_BUILD_PROFILE_STRING) +string(TOLOWER ${CMAKE_BUILD_TYPE} CVC5_BUILD_PROFILE_STRING) # Get all definitions added via add_definitions. -get_directory_property(CVC4_DEFINITIONS COMPILE_DEFINITIONS) -string(REPLACE ";" " " CVC4_DEFINITIONS "${CVC4_DEFINITIONS}") +get_directory_property(CVC5_DEFINITIONS COMPILE_DEFINITIONS) +string(REPLACE ";" " " CVC5_DEFINITIONS "${CVC5_DEFINITIONS}") message("") -print_info("CVC4 ${CVC4_RELEASE_STRING}") +print_info("CVC4 ${CVC5_RELEASE_STRING}") message("") if(ENABLE_COMP_INC_TRACK) - print_config("Build profile " "${CVC4_BUILD_PROFILE_STRING} (incremental)") + print_config("Build profile " "${CVC5_BUILD_PROFILE_STRING} (incremental)") else() - print_config("Build profile " "${CVC4_BUILD_PROFILE_STRING}") + print_config("Build profile " "${CVC5_BUILD_PROFILE_STRING}") endif() message("") print_config("GPL " ${ENABLE_GPL}) @@ -658,7 +658,7 @@ print_config("LibPoly " ${USE_POLY}) message("") print_config("Build libcvc4 only " ${BUILD_LIB_ONLY}) -if(CVC4_USE_CLN_IMP) +if(CVC5_USE_CLN_IMP) print_config("MP library " "cln") else() print_config("MP library " "gmp") @@ -675,7 +675,7 @@ if(GLPK_DIR) print_config("GLPK dir " ${GLPK_DIR}) endif() message("") -print_config("CPPLAGS (-D...)" "${CVC4_DEFINITIONS}") +print_config("CPPLAGS (-D...)" "${CVC5_DEFINITIONS}") print_config("CXXFLAGS " "${CMAKE_CXX_FLAGS}") print_config("CFLAGS " "${CMAKE_C_FLAGS}") print_config("Linker flags " "${CMAKE_EXE_LINKER_FLAGS}") diff --git a/cmake/CVC4Config.cmake.in b/cmake/CVC4Config.cmake.in index ac6bccb20..20ffeb71e 100644 --- a/cmake/CVC4Config.cmake.in +++ b/cmake/CVC4Config.cmake.in @@ -10,17 +10,17 @@ ## @PACKAGE_INIT@ -set(CVC4_BINDINGS_JAVA @BUILD_BINDINGS_JAVA@) -set(CVC4_BINDINGS_PYTHON @BUILD_BINDINGS_PYTHON@) -set(CVC4_BINDINGS_PYTHON_VERSION @BUILD_BINDINGS_PYTHON_VERSION@) +set(CVC5_BINDINGS_JAVA @BUILD_BINDINGS_JAVA@) +set(CVC5_BINDINGS_PYTHON @BUILD_BINDINGS_PYTHON@) +set(CVC5_BINDINGS_PYTHON_VERSION @BUILD_BINDINGS_PYTHON_VERSION@) if(NOT TARGET CVC4::cvc4) include(${CMAKE_CURRENT_LIST_DIR}/CVC4Targets.cmake) endif() # TODO(project wishue #83): enable these lines -# if(CVC4_BINDINGS_JAVA AND NOT TARGET CVC4::cvc4jar) -# set_and_check(CVC4_JNI_PATH "@PACKAGE_LIBRARY_INSTALL_DIR@") +# if(CVC5_BINDINGS_JAVA AND NOT TARGET CVC4::cvc4jar) +# set_and_check(CVC5_JNI_PATH "@PACKAGE_LIBRARY_INSTALL_DIR@") # include(${CMAKE_CURRENT_LIST_DIR}/CVC4JavaTargets.cmake) # endif() diff --git a/cmake/ConfigCompetition.cmake b/cmake/ConfigCompetition.cmake index 297fc785a..6e87902e1 100644 --- a/cmake/ConfigCompetition.cmake +++ b/cmake/ConfigCompetition.cmake @@ -8,7 +8,7 @@ ## All rights reserved. See the file COPYING in the top-level source ## directory for licensing information. ## -add_definitions(-DCVC4_COMPETITION_MODE) +add_definitions(-DCVC5_COMPETITION_MODE) add_check_c_cxx_flag("-funroll-all-loops") add_check_c_cxx_flag("-fexpensive-optimizations") add_check_c_cxx_flag("-fno-enforce-eh-specs") diff --git a/cmake/ConfigDebug.cmake b/cmake/ConfigDebug.cmake index 50907a561..1493d1fb2 100644 --- a/cmake/ConfigDebug.cmake +++ b/cmake/ConfigDebug.cmake @@ -8,7 +8,7 @@ ## All rights reserved. See the file COPYING in the top-level source ## directory for licensing information. ## -add_definitions(-DCVC4_DEBUG) +add_definitions(-DCVC5_DEBUG) add_check_c_cxx_flag("-fno-inline") set(OPTIMIZATION_LEVEL "g") # enable_debug_symbols=yes diff --git a/cmake/ConfigureCVC4.cmake b/cmake/ConfigureCVC4.cmake index af726ae8d..677712d92 100644 --- a/cmake/ConfigureCVC4.cmake +++ b/cmake/ConfigureCVC4.cmake @@ -29,10 +29,10 @@ check_cxx_source_compiles( void foo(int64_t) {} int main() { return 0; } " - CVC4_NEED_INT64_T_OVERLOADS + CVC5_NEED_INT64_T_OVERLOADS ) -if(NOT CVC4_NEED_INT64_T_OVERLOADS) - set(CVC4_NEED_INT64_T_OVERLOADS 0) +if(NOT CVC5_NEED_INT64_T_OVERLOADS) + set(CVC5_NEED_INT64_T_OVERLOADS 0) endif() # Check to see if this version/architecture of GNU C++ explicitly @@ -45,10 +45,10 @@ check_cxx_source_compiles( namespace std { template<> struct hash {}; } int main() { return 0; } " - CVC4_NEED_HASH_UINT64_T_OVERLOAD + CVC5_NEED_HASH_UINT64_T_OVERLOAD ) -if(CVC4_NEED_HASH_UINT64_T_OVERLOAD) - add_definitions(-DCVC4_NEED_HASH_UINT64_T) +if(CVC5_NEED_HASH_UINT64_T_OVERLOAD) + add_definitions(-DCVC5_NEED_HASH_UINT64_T) endif() check_include_file(unistd.h HAVE_UNISTD_H) @@ -56,7 +56,7 @@ check_include_file_cxx(ext/stdio_filebuf.h HAVE_EXT_STDIO_FILEBUF_H) # For Windows builds check if clock_gettime is available via -lpthread # (pthread_time.h). -if(CVC4_WINDOWS_BUILD) +if(CVC5_WINDOWS_BUILD) set(CMAKE_REQUIRED_FLAGS -pthread) check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) unset(CMAKE_REQUIRED_FLAGS) @@ -99,10 +99,10 @@ check_c_source_compiles( ) # Defined if using the CLN multi-precision arithmetic library. -set(CVC4_CLN_IMP ${CVC4_USE_CLN_IMP}) +set(CVC5_CLN_IMP ${CVC5_USE_CLN_IMP}) # Defined if using the GMP multi-precision arithmetic library. -set(CVC4_GMP_IMP ${CVC4_USE_GMP_IMP}) +set(CVC5_GMP_IMP ${CVC5_USE_GMP_IMP}) # Defined if using the libpoly polynomial library. -set(CVC4_POLY_IMP ${CVC4_USE_POLY_IMP}) +set(CVC5_POLY_IMP ${CVC5_USE_POLY_IMP}) # Define the full name of this package. -set(CVC4_PACKAGE_NAME "${PROJECT_NAME}") +set(CVC5_PACKAGE_NAME "${PROJECT_NAME}") diff --git a/cmake/Toolchain-mingw64.cmake b/cmake/Toolchain-mingw64.cmake index 1e4bb1a12..64318b59c 100644 --- a/cmake/Toolchain-mingw64.cmake +++ b/cmake/Toolchain-mingw64.cmake @@ -30,4 +30,4 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) -set(CVC4_WINDOWS_BUILD TRUE) +set(CVC5_WINDOWS_BUILD TRUE) diff --git a/cvc4autoconfig.h.in b/cvc4autoconfig.h.in index 8af8a5b47..711a9f641 100644 --- a/cvc4autoconfig.h.in +++ b/cvc4autoconfig.h.in @@ -1,35 +1,35 @@ -#ifndef __CVC4__CVC4AUTOCONFIG_H -#define __CVC4__CVC4AUTOCONFIG_H +#ifndef __CVC5__CVC4AUTOCONFIG_H +#define __CVC5__CVC4AUTOCONFIG_H /* Major component of the version of CVC4. */ -#define CVC4_MAJOR @CVC4_MAJOR@ +#define CVC5_MAJOR @CVC5_MAJOR@ /* Minor component of the version of CVC4. */ -#define CVC4_MINOR @CVC4_MINOR@ +#define CVC5_MINOR @CVC5_MINOR@ /* Release component of the version of CVC4. */ -#define CVC4_RELEASE @CVC4_RELEASE@ +#define CVC5_RELEASE @CVC5_RELEASE@ /* Extraversion component of the version of CVC4. */ -#define CVC4_EXTRAVERSION "@CVC4_EXTRAVERSION@" +#define CVC5_EXTRAVERSION "@CVC5_EXTRAVERSION@" /* Full release string for CVC4. */ -#define CVC4_RELEASE_STRING "@CVC4_RELEASE_STRING@" +#define CVC5_RELEASE_STRING "@CVC5_RELEASE_STRING@" /* Full name of this package. */ -#define CVC4_PACKAGE_NAME "@CVC4_PACKAGE_NAME@" +#define CVC5_PACKAGE_NAME "@CVC5_PACKAGE_NAME@" /* Define to 1 if CVC4 is built with (optional) GPLed library dependencies. */ -#cmakedefine01 CVC4_GPL_DEPS +#cmakedefine01 CVC5_GPL_DEPS /* Define to use the CLN multi-precision arithmetic library. */ -#cmakedefine CVC4_CLN_IMP +#cmakedefine CVC5_CLN_IMP /* Define to use the GMP multi-precision arithmetic library. */ -#cmakedefine CVC4_GMP_IMP +#cmakedefine CVC5_GMP_IMP /* Define to use the libpoly polynomial library. */ -#cmakedefine CVC4_POLY_IMP +#cmakedefine CVC5_POLY_IMP /* Define to 1 if Boost threading library has support for thread attributes. */ #cmakedefine01 BOOST_HAS_THREAD_ATTR @@ -70,6 +70,6 @@ /* Define to 1 if `strerror_r' returns (char *). */ #cmakedefine01 STRERROR_R_CHAR_P -#cmakedefine01 CVC4_STATIC_BUILD +#cmakedefine01 CVC5_STATIC_BUILD -#endif /* __CVC4__CVC4AUTOCONFIG_H */ +#endif /* __CVC5__CVC4AUTOCONFIG_H */ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 03cbe1b2c..4b0e547dc 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -83,23 +83,23 @@ if(TARGET CVC4::cvc4jar) include(UseJava) ## disabled until bindings for the new API are in place (issue #2284) - # get_target_property(CVC4_JAR CVC4::cvc4jar JAR_FILE) + # get_target_property(CVC5_JAR CVC4::cvc4jar JAR_FILE) # - # add_jar(SimpleVC SimpleVC.java INCLUDE_JARS "${CVC4_JAR}") + # add_jar(SimpleVC SimpleVC.java INCLUDE_JARS "${CVC5_JAR}") # # add_test( # NAME java/SimpleVC # COMMAND # ${Java_JAVA_EXECUTABLE} - # -cp "${CVC4_JAR}:${CMAKE_BINARY_DIR}/SimpleVC.jar" - # -Djava.library.path=${CVC4_JNI_PATH} + # -cp "${CVC5_JAR}:${CMAKE_BINARY_DIR}/SimpleVC.jar" + # -Djava.library.path=${CVC5_JNI_PATH} # SimpleVC # ) # TODO(project wishue #83): enable java examples # add_subdirectory(api/java) endif() -if(CVC4_BINDINGS_PYTHON) +if(CVC5_BINDINGS_PYTHON) # If legacy Python API has been built add_subdirectory(api/python) endif() diff --git a/examples/api/CMakeLists.txt b/examples/api/CMakeLists.txt index a19349669..5612b10f7 100644 --- a/examples/api/CMakeLists.txt +++ b/examples/api/CMakeLists.txt @@ -8,7 +8,7 @@ ## All rights reserved. See the file COPYING in the top-level source ## directory for licensing information. ## -set(CVC4_EXAMPLES_API +set(CVC5_EXAMPLES_API bitvectors bitvectors_and_arrays combination @@ -24,6 +24,6 @@ set(CVC4_EXAMPLES_API sygus-inv ) -foreach(example ${CVC4_EXAMPLES_API}) +foreach(example ${CVC5_EXAMPLES_API}) cvc4_add_example(${example} "" "api") endforeach() diff --git a/examples/api/java/CMakeLists.txt b/examples/api/java/CMakeLists.txt index ca4f467ab..338cf193e 100644 --- a/examples/api/java/CMakeLists.txt +++ b/examples/api/java/CMakeLists.txt @@ -28,7 +28,7 @@ set(EXAMPLES_API_JAVA foreach(example ${EXAMPLES_API_JAVA}) add_jar(${example} ${example}.java - INCLUDE_JARS "${CVC4_JAR}" + INCLUDE_JARS "${CVC5_JAR}" OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin/api/java") set(EXAMPLE_TEST_NAME api/java/${example}) @@ -37,8 +37,8 @@ foreach(example ${EXAMPLES_API_JAVA}) NAME ${EXAMPLE_TEST_NAME} COMMAND ${Java_JAVA_EXECUTABLE} - -cp "${CVC4_JAR}:${CMAKE_BINARY_DIR}/bin/api/java/${example}.jar" - -Djava.library.path=${CVC4_JNI_PATH} + -cp "${CVC5_JAR}:${CMAKE_BINARY_DIR}/bin/api/java/${example}.jar" + -Djava.library.path=${CVC5_JNI_PATH} ${example} ) set_tests_properties(${EXAMPLE_TEST_NAME} PROPERTIES SKIP_RETURN_CODE 77) diff --git a/examples/api/python/CMakeLists.txt b/examples/api/python/CMakeLists.txt index 0a8b8cefd..f460c8841 100644 --- a/examples/api/python/CMakeLists.txt +++ b/examples/api/python/CMakeLists.txt @@ -26,7 +26,7 @@ set(EXAMPLES_API_PYTHON sygus-inv ) -find_package(PythonInterp ${CVC4_BINDINGS_PYTHON_VERSION} REQUIRED) +find_package(PythonInterp ${CVC5_BINDINGS_PYTHON_VERSION} REQUIRED) # Find Python bindings in the corresponding python-*/site-packages directory. # Lookup Python module directory and store path in PYTHON_MODULE_PATH. diff --git a/examples/nra-translate/CMakeLists.txt b/examples/nra-translate/CMakeLists.txt index 373560748..2a4ef4799 100644 --- a/examples/nra-translate/CMakeLists.txt +++ b/examples/nra-translate/CMakeLists.txt @@ -10,7 +10,7 @@ ## set(EXAMPLES_NRA_TRANSLATE_BIN_DIR ${EXAMPLES_BIN_DIR}/nra-translate) -set(CVC4_EXAMPLES_NRA_TRANSLATE +set(CVC5_EXAMPLES_NRA_TRANSLATE normalize smt2info smt2todreal @@ -20,7 +20,7 @@ set(CVC4_EXAMPLES_NRA_TRANSLATE smt2toredlog ) -foreach(example ${CVC4_EXAMPLES_NRA_TRANSLATE}) +foreach(example ${CVC5_EXAMPLES_NRA_TRANSLATE}) cvc4_add_example(${example} "" "nra-translate" # arguments to binary (for testing) # input file is required by all tests diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 918c5a45a..34ca07edc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1122,7 +1122,7 @@ install(TARGETS cvc4 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -set_target_properties(cvc4 PROPERTIES SOVERSION ${CVC4_SOVERSION}) +set_target_properties(cvc4 PROPERTIES SOVERSION ${CVC5_SOVERSION}) target_compile_definitions(cvc4 PRIVATE -D__BUILDING_CVC4LIB diff --git a/src/api/cpp/cvc5.cpp b/src/api/cpp/cvc5.cpp index 232c32b43..29093235d 100644 --- a/src/api/cpp/cvc5.cpp +++ b/src/api/cpp/cvc5.cpp @@ -716,7 +716,7 @@ bool isApplyKind(cvc5::Kind k) || k == cvc5::Kind::APPLY_SELECTOR || k == cvc5::Kind::APPLY_TESTER); } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS /** Return true if given kind is a defined internal kind. */ bool isDefinedIntKind(cvc5::Kind k) { @@ -826,10 +826,10 @@ class CVC4ApiRecoverableExceptionStream std::stringstream d_stream; }; -#define CVC4_API_TRY_CATCH_BEGIN \ +#define CVC5_API_TRY_CATCH_BEGIN \ try \ { -#define CVC4_API_TRY_CATCH_END \ +#define CVC5_API_TRY_CATCH_END \ } \ catch (const UnrecognizedOptionException& e) \ { \ @@ -1005,333 +1005,333 @@ std::vector Sort::typeNodeVectorToSorts( bool Sort::operator==(const Sort& s) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_type == *s.d_type; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::operator!=(const Sort& s) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_type != *s.d_type; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::operator<(const Sort& s) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_type < *s.d_type; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::operator>(const Sort& s) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_type > *s.d_type; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::operator<=(const Sort& s) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_type <= *s.d_type; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::operator>=(const Sort& s) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_type >= *s.d_type; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isNull() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return isNullHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isBoolean() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isBoolean(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isInteger() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isInteger(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isReal() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line // notice that we do not expose internal subtyping to the user return d_type->isReal() && !d_type->isInteger(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isString() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isString(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isRegExp() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isRegExp(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isRoundingMode() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isRoundingMode(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isBitVector() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isBitVector(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isFloatingPoint() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isFloatingPoint(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isDatatype() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isDatatype(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isParametricDatatype() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line if (!d_type->isDatatype()) return false; return d_type->isParametricDatatype(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isConstructor() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isConstructor(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isSelector() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isSelector(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isTester() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isTester(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isFunction() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isFunction(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isPredicate() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isPredicate(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isTuple() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isTuple(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isRecord() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isRecord(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isArray() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isArray(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isSet() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isSet(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isBag() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isBag(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isSequence() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isSequence(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isUninterpretedSort() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isSort(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isSortConstructor() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isSortConstructor(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isFirstClass() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isFirstClass(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isFunctionLike() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_type->isFunctionLike(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isSubsortOf(const Sort& s) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_SOLVER("sort", s); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_SOLVER("sort", s); //////// all checks before this line return d_type->isSubtypeOf(*s.d_type); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isComparableTo(const Sort& s) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_SOLVER("sort", s); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_SOLVER("sort", s); //////// all checks before this line return d_type->isComparableTo(*s.d_type); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Datatype Sort::getDatatype() const { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isDatatype()) << "Expected datatype sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isDatatype()) << "Expected datatype sort."; //////// all checks before this line return Datatype(d_solver, d_type->getDType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Sort::instantiate(const std::vector& params) const { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_SORTS(params); - CVC4_API_CHECK(isParametricDatatype() || isSortConstructor()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_SORTS(params); + CVC5_API_CHECK(isParametricDatatype() || isSortConstructor()) << "Expected parametric datatype or sort constructor sort."; //////// all checks before this line std::vector tparams = sortVectorToTypeNodes(params); @@ -1342,32 +1342,32 @@ Sort Sort::instantiate(const std::vector& params) const Assert(d_type->isSortConstructor()); return Sort(d_solver, d_solver->getNodeManager()->mkSort(*d_type, tparams)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Sort::substitute(const Sort& sort, const Sort& replacement) const { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_SORT(sort); - CVC4_API_CHECK_SORT(replacement); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_SORT(sort); + CVC5_API_CHECK_SORT(replacement); //////// all checks before this line return Sort( d_solver, d_type->substitute(sort.getTypeNode(), replacement.getTypeNode())); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Sort::substitute(const std::vector& sorts, const std::vector& replacements) const { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_SORTS(sorts); - CVC4_API_CHECK_SORTS(replacements); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_SORTS(sorts); + CVC5_API_CHECK_SORTS(replacements); //////// all checks before this line std::vector tSorts = sortVectorToTypeNodes(sorts), @@ -1379,12 +1379,12 @@ Sort Sort::substitute(const std::vector& sorts, tReplacements.begin(), tReplacements.end())); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string Sort::toString() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line if (d_solver != nullptr) { @@ -1393,7 +1393,7 @@ std::string Sort::toString() const } return d_type->toString(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } const cvc5::TypeNode& Sort::getTypeNode(void) const { return *d_type; } @@ -1402,215 +1402,215 @@ const cvc5::TypeNode& Sort::getTypeNode(void) const { return *d_type; } size_t Sort::getConstructorArity() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isConstructor()) << "Not a constructor sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isConstructor()) << "Not a constructor sort: " << (*this); //////// all checks before this line return d_type->getNumChildren() - 1; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Sort::getConstructorDomainSorts() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isConstructor()) << "Not a constructor sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isConstructor()) << "Not a constructor sort: " << (*this); //////// all checks before this line return typeNodeVectorToSorts(d_solver, d_type->getArgTypes()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Sort::getConstructorCodomainSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isConstructor()) << "Not a constructor sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isConstructor()) << "Not a constructor sort: " << (*this); //////// all checks before this line return Sort(d_solver, d_type->getConstructorRangeType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Selector sort ------------------------------------------------------- */ Sort Sort::getSelectorDomainSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isSelector()) << "Not a selector sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isSelector()) << "Not a selector sort: " << (*this); //////// all checks before this line return Sort(d_solver, d_type->getSelectorDomainType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Sort::getSelectorCodomainSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isSelector()) << "Not a selector sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isSelector()) << "Not a selector sort: " << (*this); //////// all checks before this line return Sort(d_solver, d_type->getSelectorRangeType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Tester sort ------------------------------------------------------- */ Sort Sort::getTesterDomainSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isTester()) << "Not a tester sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isTester()) << "Not a tester sort: " << (*this); //////// all checks before this line return Sort(d_solver, d_type->getTesterDomainType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Sort::getTesterCodomainSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isTester()) << "Not a tester sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isTester()) << "Not a tester sort: " << (*this); //////// all checks before this line return d_solver->getBooleanSort(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Function sort ------------------------------------------------------- */ size_t Sort::getFunctionArity() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isFunction()) << "Not a function sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isFunction()) << "Not a function sort: " << (*this); //////// all checks before this line return d_type->getNumChildren() - 1; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Sort::getFunctionDomainSorts() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isFunction()) << "Not a function sort: " << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isFunction()) << "Not a function sort: " << (*this); //////// all checks before this line return typeNodeVectorToSorts(d_solver, d_type->getArgTypes()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Sort::getFunctionCodomainSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isFunction()) << "Not a function sort" << (*this); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isFunction()) << "Not a function sort" << (*this); //////// all checks before this line return Sort(d_solver, d_type->getRangeType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Array sort ---------------------------------------------------------- */ Sort Sort::getArrayIndexSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isArray()) << "Not an array sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isArray()) << "Not an array sort."; //////// all checks before this line return Sort(d_solver, d_type->getArrayIndexType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Sort::getArrayElementSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isArray()) << "Not an array sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isArray()) << "Not an array sort."; //////// all checks before this line return Sort(d_solver, d_type->getArrayConstituentType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Set sort ------------------------------------------------------------ */ Sort Sort::getSetElementSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isSet()) << "Not a set sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isSet()) << "Not a set sort."; //////// all checks before this line return Sort(d_solver, d_type->getSetElementType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Bag sort ------------------------------------------------------------ */ Sort Sort::getBagElementSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isBag()) << "Not a bag sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isBag()) << "Not a bag sort."; //////// all checks before this line return Sort(d_solver, d_type->getBagElementType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Sequence sort ------------------------------------------------------- */ Sort Sort::getSequenceElementSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isSequence()) << "Not a sequence sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isSequence()) << "Not a sequence sort."; //////// all checks before this line return Sort(d_solver, d_type->getSequenceElementType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Uninterpreted sort -------------------------------------------------- */ std::string Sort::getUninterpretedSortName() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isUninterpretedSort()) << "Not an uninterpreted sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isUninterpretedSort()) << "Not an uninterpreted sort."; //////// all checks before this line return d_type->getName(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Sort::isUninterpretedSortParameterized() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isUninterpretedSort()) << "Not an uninterpreted sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isUninterpretedSort()) << "Not an uninterpreted sort."; //////// all checks before this line /* This method is not implemented in the NodeManager, since whether a * uninterpreted sort is parameterized is irrelevant for solving. */ return d_type->getNumChildren() > 0; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Sort::getUninterpretedSortParamSorts() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isUninterpretedSort()) << "Not an uninterpreted sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isUninterpretedSort()) << "Not an uninterpreted sort."; //////// all checks before this line /* This method is not implemented in the NodeManager, since whether a @@ -1622,116 +1622,116 @@ std::vector Sort::getUninterpretedSortParamSorts() const } return typeNodeVectorToSorts(d_solver, params); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Sort constructor sort ----------------------------------------------- */ std::string Sort::getSortConstructorName() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isSortConstructor()) << "Not a sort constructor sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isSortConstructor()) << "Not a sort constructor sort."; //////// all checks before this line return d_type->getName(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } size_t Sort::getSortConstructorArity() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isSortConstructor()) << "Not a sort constructor sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isSortConstructor()) << "Not a sort constructor sort."; //////// all checks before this line return d_type->getSortConstructorArity(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Bit-vector sort ----------------------------------------------------- */ uint32_t Sort::getBVSize() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isBitVector()) << "Not a bit-vector sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isBitVector()) << "Not a bit-vector sort."; //////// all checks before this line return d_type->getBitVectorSize(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Floating-point sort ------------------------------------------------- */ uint32_t Sort::getFPExponentSize() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isFloatingPoint()) << "Not a floating-point sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isFloatingPoint()) << "Not a floating-point sort."; //////// all checks before this line return d_type->getFloatingPointExponentSize(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } uint32_t Sort::getFPSignificandSize() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isFloatingPoint()) << "Not a floating-point sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isFloatingPoint()) << "Not a floating-point sort."; //////// all checks before this line return d_type->getFloatingPointSignificandSize(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Datatype sort ------------------------------------------------------- */ std::vector Sort::getDatatypeParamSorts() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isParametricDatatype()) << "Not a parametric datatype sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isParametricDatatype()) << "Not a parametric datatype sort."; //////// all checks before this line return typeNodeVectorToSorts(d_solver, d_type->getParamTypes()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } size_t Sort::getDatatypeArity() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isDatatype()) << "Not a datatype sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isDatatype()) << "Not a datatype sort."; //////// all checks before this line return d_type->getNumChildren() - 1; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Tuple sort ---------------------------------------------------------- */ size_t Sort::getTupleLength() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isTuple()) << "Not a tuple sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isTuple()) << "Not a tuple sort."; //////// all checks before this line return d_type->getTupleLength(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Sort::getTupleSorts() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(isTuple()) << "Not a tuple sort."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(isTuple()) << "Not a tuple sort."; //////// all checks before this line return typeNodeVectorToSorts(d_solver, d_type->getTupleTypes()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* --------------------------------------------------------------------- */ @@ -1785,7 +1785,7 @@ Op::~Op() /* Public methods */ bool Op::operator==(const Op& t) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line if (d_node->isNull() && t.d_node->isNull()) { @@ -1797,67 +1797,67 @@ bool Op::operator==(const Op& t) const } return (d_kind == t.d_kind) && (*d_node == *t.d_node); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Op::operator!=(const Op& t) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return !(*this == t); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Kind Op::getKind() const { - CVC4_API_CHECK(d_kind != NULL_EXPR) << "Expecting a non-null Kind"; + CVC5_API_CHECK(d_kind != NULL_EXPR) << "Expecting a non-null Kind"; //////// all checks before this line return d_kind; } bool Op::isNull() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return isNullHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Op::isIndexed() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return isIndexedHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } template <> std::string Op::getIndices() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(!d_node->isNull()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(!d_node->isNull()) << "Expecting a non-null internal expression. This Op is not indexed."; Kind k = intToExtKind(d_node->getKind()); - CVC4_API_CHECK(k == DIVISIBLE || k == RECORD_UPDATE) + CVC5_API_CHECK(k == DIVISIBLE || k == RECORD_UPDATE) << "Can't get string index from" << " kind " << kindToString(k); //////// all checks before this line return k == DIVISIBLE ? d_node->getConst().k.toString() : d_node->getConst().getField(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } template <> uint32_t Op::getIndices() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(!d_node->isNull()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(!d_node->isNull()) << "Expecting a non-null internal expression. This Op is not indexed."; //////// all checks before this line @@ -1893,20 +1893,20 @@ uint32_t Op::getIndices() const i = d_node->getConst().d_repeatAmount; break; default: - CVC4_API_CHECK(false) << "Can't get uint32_t index from" + CVC5_API_CHECK(false) << "Can't get uint32_t index from" << " kind " << kindToString(k); } return i; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } template <> std::pair Op::getIndices() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(!d_node->isNull()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(!d_node->isNull()) << "Expecting a non-null internal expression. This Op is not indexed."; //////// all checks before this line @@ -1967,17 +1967,17 @@ std::pair Op::getIndices() const } else { - CVC4_API_CHECK(false) << "Can't get pair indices from" + CVC5_API_CHECK(false) << "Can't get pair indices from" << " kind " << kindToString(k); } return indices; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string Op::toString() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line if (d_node->isNull()) { @@ -1985,7 +1985,7 @@ std::string Op::toString() const } else { - CVC4_API_CHECK(!d_node->isNull()) + CVC5_API_CHECK(!d_node->isNull()) << "Expecting a non-null internal expression"; if (d_solver != nullptr) { @@ -1995,7 +1995,7 @@ std::string Op::toString() const return d_node->toString(); } //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::ostream& operator<<(std::ostream& out, const Op& t) @@ -2055,62 +2055,62 @@ Term::~Term() bool Term::operator==(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_node == *t.d_node; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::operator!=(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_node != *t.d_node; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::operator<(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_node < *t.d_node; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::operator>(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_node > *t.d_node; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::operator<=(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_node <= *t.d_node; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::operator>=(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return *d_node >= *t.d_node; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } size_t Term::getNumChildren() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line // special case for apply kinds @@ -2124,15 +2124,15 @@ size_t Term::getNumChildren() const } return d_node->getNumChildren(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::operator[](size_t index) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(index < getNumChildren()) << "index out of bound"; - CVC4_API_CHECK(!isApplyKind(d_node->getKind()) || d_node->hasOperator()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(index < getNumChildren()) << "index out of bound"; + CVC5_API_CHECK(!isApplyKind(d_node->getKind()) || d_node->hasOperator()) << "Expected apply kind to have operator when accessing child of Term"; //////// all checks before this line @@ -2152,64 +2152,64 @@ Term Term::operator[](size_t index) const // otherwise we are looking up child at (index-1) return Term(d_solver, (*d_node)[index]); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } uint64_t Term::getId() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_node->getId(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Kind Term::getKind() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return getKindHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Term::getSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; NodeManagerScope scope(d_solver->getNodeManager()); //////// all checks before this line return Sort(d_solver, d_node->getType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::substitute(const Term& term, const Term& replacement) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_TERM(term); - CVC4_API_CHECK_TERM(replacement); - CVC4_API_CHECK(term.getSort().isComparableTo(replacement.getSort())) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_TERM(term); + CVC5_API_CHECK_TERM(replacement); + CVC5_API_CHECK(term.getSort().isComparableTo(replacement.getSort())) << "Expecting terms of comparable sort in substitute"; //////// all checks before this line return Term( d_solver, d_node->substitute(TNode(*term.d_node), TNode(*replacement.d_node))); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::substitute(const std::vector& terms, const std::vector& replacements) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(terms.size() == replacements.size()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(terms.size() == replacements.size()) << "Expecting vectors of the same arity in substitute"; - CVC4_API_TERM_CHECK_TERMS_WITH_TERMS_COMPARABLE_TO(terms, replacements); + CVC5_API_TERM_CHECK_TERMS_WITH_TERMS_COMPARABLE_TO(terms, replacements); //////// all checks before this line std::vector nodes = Term::termVectorToNodes(terms); std::vector nodeReplacements = Term::termVectorToNodes(replacements); @@ -2219,24 +2219,24 @@ Term Term::substitute(const std::vector& terms, nodeReplacements.begin(), nodeReplacements.end())); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::hasOp() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_node->hasOperator(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Op Term::getOp() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(d_node->hasOperator()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(d_node->hasOperator()) << "Expecting Term to have an Op when calling getOp()"; //////// all checks before this line @@ -2260,37 +2260,37 @@ Op Term::getOp() const // cases above do not have special cases for intToExtKind. return Op(d_solver, getKindHelper()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::isNull() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return isNullHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::getConstArrayBase() const { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; // CONST_ARRAY kind maps to STORE_ALL internal kind - CVC4_API_CHECK(d_node->getKind() == cvc5::Kind::STORE_ALL) + CVC5_API_CHECK(d_node->getKind() == cvc5::Kind::STORE_ALL) << "Expecting a CONST_ARRAY Term when calling getConstArrayBase()"; //////// all checks before this line return Term(d_solver, d_node->getConst().getValue()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Term::getConstSequenceElements() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(d_node->getKind() == cvc5::Kind::CONST_SEQUENCE) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(d_node->getKind() == cvc5::Kind::CONST_SEQUENCE) << "Expecting a CONST_SEQUENCE Term when calling " "getConstSequenceElements()"; //////// all checks before this line @@ -2302,103 +2302,103 @@ std::vector Term::getConstSequenceElements() const } return terms; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::notTerm() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line Node res = d_node->notNode(); (void)res.getType(true); /* kick off type checking */ return Term(d_solver, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::andTerm(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_TERM(t); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_TERM(t); //////// all checks before this line Node res = d_node->andNode(*t.d_node); (void)res.getType(true); /* kick off type checking */ return Term(d_solver, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::orTerm(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_TERM(t); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_TERM(t); //////// all checks before this line Node res = d_node->orNode(*t.d_node); (void)res.getType(true); /* kick off type checking */ return Term(d_solver, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::xorTerm(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_TERM(t); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_TERM(t); //////// all checks before this line Node res = d_node->xorNode(*t.d_node); (void)res.getType(true); /* kick off type checking */ return Term(d_solver, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::eqTerm(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_TERM(t); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_TERM(t); //////// all checks before this line Node res = d_node->eqNode(*t.d_node); (void)res.getType(true); /* kick off type checking */ return Term(d_solver, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::impTerm(const Term& t) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_TERM(t); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_TERM(t); //////// all checks before this line Node res = d_node->impNode(*t.d_node); (void)res.getType(true); /* kick off type checking */ return Term(d_solver, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Term::iteTerm(const Term& then_t, const Term& else_t) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_TERM(then_t); - CVC4_API_CHECK_TERM(else_t); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_TERM(then_t); + CVC5_API_CHECK_TERM(else_t); //////// all checks before this line Node res = d_node->iteNode(*then_t.d_node, *else_t.d_node); (void)res.getType(true); /* kick off type checking */ return Term(d_solver, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string Term::toString() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line if (d_solver != nullptr) { @@ -2407,7 +2407,7 @@ std::string Term::toString() const } return d_node->toString(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term::const_iterator::const_iterator() @@ -2570,107 +2570,107 @@ bool isUInt64(const Node& node) bool Term::isInt32() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return detail::isInt32(*d_node); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::int32_t Term::getInt32() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(detail::isInt32(*d_node)) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(detail::isInt32(*d_node)) << "Term should be a Int32 when calling getInt32()"; //////// all checks before this line return detail::getInteger(*d_node).getSignedInt(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::isUInt32() const { return detail::isUInt32(*d_node); } std::uint32_t Term::getUInt32() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(detail::isUInt32(*d_node)) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(detail::isUInt32(*d_node)) << "Term should be a UInt32 when calling getUInt32()"; //////// all checks before this line return detail::getInteger(*d_node).getUnsignedInt(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::isInt64() const { return detail::isInt64(*d_node); } std::int64_t Term::getInt64() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(detail::isInt64(*d_node)) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(detail::isInt64(*d_node)) << "Term should be a Int64 when calling getInt64()"; //////// all checks before this line return detail::getInteger(*d_node).getLong(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::isUInt64() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return detail::isUInt64(*d_node); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::uint64_t Term::getUInt64() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(detail::isUInt64(*d_node)) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(detail::isUInt64(*d_node)) << "Term should be a UInt64 when calling getUInt64()"; //////// all checks before this line return detail::getInteger(*d_node).getUnsignedLong(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::isInteger() const { return detail::isInteger(*d_node); } std::string Term::getInteger() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(detail::isInteger(*d_node)) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(detail::isInteger(*d_node)) << "Term should be an Int when calling getIntString()"; //////// all checks before this line return detail::getInteger(*d_node).toString(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Term::isString() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_node->getKind() == cvc5::Kind::CONST_STRING; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::wstring Term::getString() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(d_node->getKind() == cvc5::Kind::CONST_STRING) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(d_node->getKind() == cvc5::Kind::CONST_STRING) << "Term should be a String when calling getString()"; //////// all checks before this line return d_node->getConst().toWString(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Term::termVectorToNodes(const std::vector& terms) @@ -2817,46 +2817,46 @@ void DatatypeConstructorDecl::addSelector(const std::string& name, const Sort& sort) { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK_SORT(sort); - CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK_SORT(sort); + CVC5_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null range sort for selector"; //////// all checks before this line d_ctor->addArg(name, *sort.d_type); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void DatatypeConstructorDecl::addSelectorSelf(const std::string& name) { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line d_ctor->addArgSelf(name); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool DatatypeConstructorDecl::isNull() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return isNullHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string DatatypeConstructorDecl::toString() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line std::stringstream ss; ss << *d_ctor; return ss.str(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::ostream& operator<<(std::ostream& out, @@ -2922,65 +2922,65 @@ DatatypeDecl::~DatatypeDecl() void DatatypeDecl::addConstructor(const DatatypeConstructorDecl& ctor) { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_ARG_CHECK_NOT_NULL(ctor); - CVC4_API_ARG_CHECK_SOLVER("datatype constructor declaration", ctor); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_ARG_CHECK_NOT_NULL(ctor); + CVC5_API_ARG_CHECK_SOLVER("datatype constructor declaration", ctor); //////// all checks before this line d_dtype->addConstructor(ctor.d_ctor); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } size_t DatatypeDecl::getNumConstructors() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->getNumConstructors(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool DatatypeDecl::isParametric() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->isParametric(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string DatatypeDecl::toString() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line std::stringstream ss; ss << *d_dtype; return ss.str(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string DatatypeDecl::getName() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->getName(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool DatatypeDecl::isNull() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return isNullHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::ostream& operator<<(std::ostream& out, const DatatypeDecl& dtdecl) @@ -2999,7 +2999,7 @@ DatatypeSelector::DatatypeSelector(const Solver* slv, const cvc5::DTypeSelector& stor) : d_solver(slv), d_stor(new cvc5::DTypeSelector(stor)) { - CVC4_API_CHECK(d_stor->isResolved()) << "Expected resolved datatype selector"; + CVC5_API_CHECK(d_stor->isResolved()) << "Expected resolved datatype selector"; } DatatypeSelector::~DatatypeSelector() @@ -3014,52 +3014,52 @@ DatatypeSelector::~DatatypeSelector() std::string DatatypeSelector::getName() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_stor->getName(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term DatatypeSelector::getSelectorTerm() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return Term(d_solver, d_stor->getSelector()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort DatatypeSelector::getRangeSort() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return Sort(d_solver, d_stor->getRangeType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool DatatypeSelector::isNull() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return isNullHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string DatatypeSelector::toString() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line std::stringstream ss; ss << *d_stor; return ss.str(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::ostream& operator<<(std::ostream& out, const DatatypeSelector& stor) @@ -3080,7 +3080,7 @@ DatatypeConstructor::DatatypeConstructor(const Solver* slv, const cvc5::DTypeConstructor& ctor) : d_solver(slv), d_ctor(new cvc5::DTypeConstructor(ctor)) { - CVC4_API_CHECK(d_ctor->isResolved()) + CVC5_API_CHECK(d_ctor->isResolved()) << "Expected resolved datatype constructor"; } @@ -3096,33 +3096,33 @@ DatatypeConstructor::~DatatypeConstructor() std::string DatatypeConstructor::getName() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_ctor->getName(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term DatatypeConstructor::getConstructorTerm() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return Term(d_solver, d_ctor->getConstructor()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term DatatypeConstructor::getSpecializedConstructorTerm( const Sort& retSort) const { NodeManagerScope scope(d_solver->getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(d_ctor->isResolved()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(d_ctor->isResolved()) << "Expected resolved datatype constructor"; - CVC4_API_CHECK(retSort.isDatatype()) + CVC5_API_CHECK(retSort.isDatatype()) << "Cannot get specialized constructor type for non-datatype type " << retSort; //////// all checks before this line @@ -3138,67 +3138,67 @@ Term DatatypeConstructor::getSpecializedConstructorTerm( Term sctor = api::Term(d_solver, ret); return sctor; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term DatatypeConstructor::getTesterTerm() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return Term(d_solver, d_ctor->getTester()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } size_t DatatypeConstructor::getNumSelectors() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_ctor->getNumArgs(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } DatatypeSelector DatatypeConstructor::operator[](size_t index) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return DatatypeSelector(d_solver, (*d_ctor)[index]); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } DatatypeSelector DatatypeConstructor::operator[](const std::string& name) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return getSelectorForName(name); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } DatatypeSelector DatatypeConstructor::getSelector(const std::string& name) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return getSelectorForName(name); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term DatatypeConstructor::getSelectorTerm(const std::string& name) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return getSelector(name).getSelectorTerm(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } DatatypeConstructor::const_iterator DatatypeConstructor::begin() const @@ -3282,22 +3282,22 @@ bool DatatypeConstructor::const_iterator::operator!=( bool DatatypeConstructor::isNull() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return isNullHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string DatatypeConstructor::toString() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line std::stringstream ss; ss << *d_ctor; return ss.str(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool DatatypeConstructor::isNullHelper() const { return d_ctor == nullptr; } @@ -3325,7 +3325,7 @@ DatatypeSelector DatatypeConstructor::getSelectorForName( snames << (*d_ctor)[i].getName() << " "; } snames << "} "; - CVC4_API_CHECK(foundSel) << "No selector " << name << " for constructor " + CVC5_API_CHECK(foundSel) << "No selector " << name << " for constructor " << getName() << " exists among " << snames.str(); } return DatatypeSelector(d_solver, (*d_ctor)[index]); @@ -3342,7 +3342,7 @@ std::ostream& operator<<(std::ostream& out, const DatatypeConstructor& ctor) Datatype::Datatype(const Solver* slv, const cvc5::DType& dtype) : d_solver(slv), d_dtype(new cvc5::DType(dtype)) { - CVC4_API_CHECK(d_dtype->isResolved()) << "Expected resolved datatype"; + CVC5_API_CHECK(d_dtype->isResolved()) << "Expected resolved datatype"; } Datatype::Datatype() : d_solver(nullptr), d_dtype(nullptr) {} @@ -3359,152 +3359,152 @@ Datatype::~Datatype() DatatypeConstructor Datatype::operator[](size_t idx) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; - CVC4_API_CHECK(idx < getNumConstructors()) << "Index out of bounds."; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; + CVC5_API_CHECK(idx < getNumConstructors()) << "Index out of bounds."; //////// all checks before this line return DatatypeConstructor(d_solver, (*d_dtype)[idx]); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } DatatypeConstructor Datatype::operator[](const std::string& name) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return getConstructorForName(name); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } DatatypeConstructor Datatype::getConstructor(const std::string& name) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return getConstructorForName(name); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Datatype::getConstructorTerm(const std::string& name) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return getConstructor(name).getConstructorTerm(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string Datatype::getName() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->getName(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } size_t Datatype::getNumConstructors() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->getNumConstructors(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Datatype::isParametric() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->isParametric(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Datatype::isCodatatype() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->isCodatatype(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Datatype::isTuple() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->isTuple(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Datatype::isRecord() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->isRecord(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Datatype::isFinite() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->isFinite(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Datatype::isWellFounded() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->isWellFounded(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Datatype::hasNestedRecursion() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->hasNestedRecursion(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Datatype::isNull() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return isNullHelper(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string Datatype::toString() const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_NOT_NULL; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_NOT_NULL; //////// all checks before this line return d_dtype->getName(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Datatype::const_iterator Datatype::begin() const @@ -3540,7 +3540,7 @@ DatatypeConstructor Datatype::getConstructorForName( snames << (*d_dtype)[i].getName() << " "; } snames << "}"; - CVC4_API_CHECK(foundCons) << "No constructor " << name << " for datatype " + CVC5_API_CHECK(foundCons) << "No constructor " << name << " for datatype " << getName() << " exists, among " << snames.str(); } return DatatypeConstructor(d_solver, (*d_dtype)[index]); @@ -3647,40 +3647,40 @@ Grammar::Grammar(const Solver* slv, void Grammar::addRule(const Term& ntSymbol, const Term& rule) { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(!d_isResolved) << "Grammar cannot be modified after passing " + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(!d_isResolved) << "Grammar cannot be modified after passing " "it as an argument to synthFun/synthInv"; - CVC4_API_CHECK_TERM(ntSymbol); - CVC4_API_CHECK_TERM(rule); - CVC4_API_ARG_CHECK_EXPECTED( + CVC5_API_CHECK_TERM(ntSymbol); + CVC5_API_CHECK_TERM(rule); + CVC5_API_ARG_CHECK_EXPECTED( d_ntsToTerms.find(ntSymbol) != d_ntsToTerms.cend(), ntSymbol) << "ntSymbol to be one of the non-terminal symbols given in the " "predeclaration"; - CVC4_API_CHECK(ntSymbol.d_node->getType() == rule.d_node->getType()) + CVC5_API_CHECK(ntSymbol.d_node->getType() == rule.d_node->getType()) << "Expected ntSymbol and rule to have the same sort"; - CVC4_API_ARG_CHECK_EXPECTED(!containsFreeVariables(rule), rule) + CVC5_API_ARG_CHECK_EXPECTED(!containsFreeVariables(rule), rule) << "a term whose free variables are limited to synthFun/synthInv " "parameters and non-terminal symbols of the grammar"; //////// all checks before this line d_ntsToTerms[ntSymbol].push_back(rule); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Grammar::addRules(const Term& ntSymbol, const std::vector& rules) { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(!d_isResolved) << "Grammar cannot be modified after passing " + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(!d_isResolved) << "Grammar cannot be modified after passing " "it as an argument to synthFun/synthInv"; - CVC4_API_CHECK_TERM(ntSymbol); - CVC4_API_CHECK_TERMS_WITH_SORT(rules, ntSymbol.getSort()); - CVC4_API_ARG_CHECK_EXPECTED( + CVC5_API_CHECK_TERM(ntSymbol); + CVC5_API_CHECK_TERMS_WITH_SORT(rules, ntSymbol.getSort()); + CVC5_API_ARG_CHECK_EXPECTED( d_ntsToTerms.find(ntSymbol) != d_ntsToTerms.cend(), ntSymbol) << "ntSymbol to be one of the non-terminal symbols given in the " "predeclaration"; for (size_t i = 0, n = rules.size(); i < n; ++i) { - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( !containsFreeVariables(rules[i]), rules[i], rules, i) << "a term whose free variables are limited to synthFun/synthInv " "parameters and non-terminal symbols of the grammar"; @@ -3689,39 +3689,39 @@ void Grammar::addRules(const Term& ntSymbol, const std::vector& rules) d_ntsToTerms[ntSymbol].insert( d_ntsToTerms[ntSymbol].cend(), rules.cbegin(), rules.cend()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Grammar::addAnyConstant(const Term& ntSymbol) { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(!d_isResolved) << "Grammar cannot be modified after passing " + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(!d_isResolved) << "Grammar cannot be modified after passing " "it as an argument to synthFun/synthInv"; - CVC4_API_CHECK_TERM(ntSymbol); - CVC4_API_ARG_CHECK_EXPECTED( + CVC5_API_CHECK_TERM(ntSymbol); + CVC5_API_ARG_CHECK_EXPECTED( d_ntsToTerms.find(ntSymbol) != d_ntsToTerms.cend(), ntSymbol) << "ntSymbol to be one of the non-terminal symbols given in the " "predeclaration"; //////// all checks before this line d_allowConst.insert(ntSymbol); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Grammar::addAnyVariable(const Term& ntSymbol) { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(!d_isResolved) << "Grammar cannot be modified after passing " + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(!d_isResolved) << "Grammar cannot be modified after passing " "it as an argument to synthFun/synthInv"; - CVC4_API_CHECK_TERM(ntSymbol); - CVC4_API_ARG_CHECK_EXPECTED( + CVC5_API_CHECK_TERM(ntSymbol); + CVC5_API_ARG_CHECK_EXPECTED( d_ntsToTerms.find(ntSymbol) != d_ntsToTerms.cend(), ntSymbol) << "ntSymbol to be one of the non-terminal symbols given in the " "predeclaration"; //////// all checks before this line d_allowVars.insert(ntSymbol); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /** @@ -3756,7 +3756,7 @@ std::string join(Iterator first, Iterator last, Function f, std::string sep) std::string Grammar::toString() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line std::stringstream ss; ss << " (" // pre-declaration @@ -3797,12 +3797,12 @@ std::string Grammar::toString() const return ss.str(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Grammar::resolve() { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line d_isResolved = true; @@ -3855,7 +3855,7 @@ Sort Grammar::resolve() // We can be in a case where the only rule specified was (Variable T) // and there are no variables of type T, in which case this is a bogus // grammar. This results in the error below. - CVC4_API_CHECK(dtDecl.d_dtype->getNumConstructors() != 0) + CVC5_API_CHECK(dtDecl.d_dtype->getNumConstructors() != 0) << "Grouped rule listing for " << *dtDecl.d_dtype << " produced an empty rule list"; @@ -3870,7 +3870,7 @@ Sort Grammar::resolve() // return is the first datatype return Sort(d_solver, datatypeTypes[0]); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Grammar::addSygusConstructorTerm( @@ -3878,10 +3878,10 @@ void Grammar::addSygusConstructorTerm( const Term& term, const std::unordered_map& ntsToUnres) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_DTDECL(dt); - CVC4_API_CHECK_TERM(term); - CVC4_API_CHECK_TERMS_MAP(ntsToUnres); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_DTDECL(dt); + CVC5_API_CHECK_TERM(term); + CVC5_API_CHECK_TERMS_MAP(ntsToUnres); //////// all checks before this line // At this point, we should know that dt is well founded, and that its @@ -3911,7 +3911,7 @@ void Grammar::addSygusConstructorTerm( std::vector cargst = Sort::sortVectorToTypeNodes(cargs); dt.d_dtype->addSygusConstructor(*op.d_node, ssCName.str(), cargst); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Grammar::purifySygusGTerm( @@ -3920,11 +3920,11 @@ Term Grammar::purifySygusGTerm( std::vector& cargs, const std::unordered_map& ntsToUnres) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_TERM(term); - CVC4_API_CHECK_TERMS(args); - CVC4_API_CHECK_SORTS(cargs); - CVC4_API_CHECK_TERMS_MAP(ntsToUnres); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_TERM(term); + CVC5_API_CHECK_TERMS(args); + CVC5_API_CHECK_SORTS(cargs); + CVC5_API_CHECK_TERMS_MAP(ntsToUnres); //////// all checks before this line std::unordered_map::const_iterator itn = @@ -3970,15 +3970,15 @@ Term Grammar::purifySygusGTerm( return Term(d_solver, nret); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Grammar::addSygusConstructorVariables(DatatypeDecl& dt, const Sort& sort) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK_DTDECL(dt); - CVC4_API_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK_DTDECL(dt); + CVC5_API_CHECK_SORT(sort); //////// all checks before this line // each variable of appropriate type becomes a sygus constructor in dt. @@ -3994,7 +3994,7 @@ void Grammar::addSygusConstructorVariables(DatatypeDecl& dt, } } //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Grammar::containsFreeVariables(const Term& rule) const @@ -4069,7 +4069,7 @@ Solver::Solver(Options* opts) d_smtEngine.reset(new SmtEngine(d_nodeMgr.get(), d_originalOptions.get())); d_smtEngine->setSolver(this); d_rng.reset(new Random(d_smtEngine->getOptions()[options::seed])); -#if CVC4_STATISTICS_ON +#if CVC5_STATISTICS_ON d_stats.reset(new Statistics()); d_smtEngine->getStatisticsRegistry().registerStat(&d_stats->d_consts); d_smtEngine->getStatisticsRegistry().registerStat(&d_stats->d_vars); @@ -4086,14 +4086,14 @@ NodeManager* Solver::getNodeManager(void) const { return d_nodeMgr.get(); } void Solver::increment_term_stats(Kind kind) const { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON d_stats->d_terms << kind; #endif } void Solver::increment_vars_consts_stats(const Sort& sort, bool is_var) const { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON const TypeNode tn = sort.getTypeNode(); TypeConstant tc = tn.getKind() == cvc5::kind::TYPE_CONSTANT ? tn.getConst() @@ -4134,7 +4134,7 @@ Term Solver::mkRealFromStrHelper(const std::string& s) const catch (const std::invalid_argument& e) { /* Catch to throw with a more meaningful error message. To be caught in - * enclosing CVC4_API_TRY_CATCH_* block to throw CVC4ApiException. */ + * enclosing CVC5_API_TRY_CATCH_* block to throw CVC4ApiException. */ std::stringstream message; message << "Cannot construct Real or Int from string argument '" << s << "'" << std::endl; @@ -4144,15 +4144,15 @@ Term Solver::mkRealFromStrHelper(const std::string& s) const Term Solver::mkBVFromIntHelper(uint32_t size, uint64_t val) const { - CVC4_API_ARG_CHECK_EXPECTED(size > 0, size) << "a bit-width > 0"; + CVC5_API_ARG_CHECK_EXPECTED(size > 0, size) << "a bit-width > 0"; //////// all checks before this line return mkValHelper(cvc5::BitVector(size, val)); } Term Solver::mkBVFromStrHelper(const std::string& s, uint32_t base) const { - CVC4_API_ARG_CHECK_EXPECTED(!s.empty(), s) << "a non-empty string"; - CVC4_API_ARG_CHECK_EXPECTED(base == 2 || base == 10 || base == 16, base) + CVC5_API_ARG_CHECK_EXPECTED(!s.empty(), s) << "a non-empty string"; + CVC5_API_ARG_CHECK_EXPECTED(base == 2 || base == 10 || base == 16, base) << "base 2, 10, or 16"; //////// all checks before this line return mkValHelper(cvc5::BitVector(s, base)); @@ -4162,8 +4162,8 @@ Term Solver::mkBVFromStrHelper(uint32_t size, const std::string& s, uint32_t base) const { - CVC4_API_ARG_CHECK_EXPECTED(!s.empty(), s) << "a non-empty string"; - CVC4_API_ARG_CHECK_EXPECTED(base == 2 || base == 10 || base == 16, base) + CVC5_API_ARG_CHECK_EXPECTED(!s.empty(), s) << "a non-empty string"; + CVC5_API_ARG_CHECK_EXPECTED(base == 2 || base == 10 || base == 16, base) << "base 2, 10, or 16"; //////// all checks before this line @@ -4171,13 +4171,13 @@ Term Solver::mkBVFromStrHelper(uint32_t size, if (val.strictlyNegative()) { - CVC4_API_CHECK(val >= -Integer("2", 10).pow(size - 1)) + CVC5_API_CHECK(val >= -Integer("2", 10).pow(size - 1)) << "Overflow in bitvector construction (specified bitvector size " << size << " too small to hold value " << s << ")"; } else { - CVC4_API_CHECK(val.modByPow2(size) == val) + CVC5_API_CHECK(val.modByPow2(size) == val) << "Overflow in bitvector construction (specified bitvector size " << size << " too small to hold value " << s << ")"; } @@ -4187,12 +4187,12 @@ Term Solver::mkBVFromStrHelper(uint32_t size, Term Solver::mkCharFromStrHelper(const std::string& s) const { - CVC4_API_CHECK(s.find_first_not_of("0123456789abcdefABCDEF", 0) + CVC5_API_CHECK(s.find_first_not_of("0123456789abcdefABCDEF", 0) == std::string::npos && s.size() <= 5 && s.size() > 0) << "Unexpected string for hexadecimal character " << s; uint32_t val = static_cast(std::stoul(s, 0, 16)); - CVC4_API_CHECK(val < String::num_codes()) + CVC5_API_CHECK(val < String::num_codes()) << "Not a valid code point for hexadecimal character " << s; //////// all checks before this line std::vector cpts; @@ -4225,7 +4225,7 @@ Sort Solver::mkTupleSortHelper(const std::vector& sorts) const Term Solver::mkTermFromKind(Kind kind) const { - CVC4_API_KIND_CHECK_EXPECTED( + CVC5_API_KIND_CHECK_EXPECTED( kind == PI || kind == REGEXP_EMPTY || kind == REGEXP_SIGMA, kind) << "PI or REGEXP_EMPTY or REGEXP_SIGMA"; //////// all checks before this line @@ -4388,7 +4388,7 @@ Term Solver::synthFunHelper(const std::string& symbol, { if (grammar) { - CVC4_API_CHECK(grammar->d_ntSyms[0].d_node->getType() == *sort.d_type) + CVC5_API_CHECK(grammar->d_ntSyms[0].d_node->getType() == *sort.d_type) << "Invalid Start symbol for grammar, Expected Start's sort to be " << *sort.d_type << " but found " << grammar->d_ntSyms[0].d_node->getType(); @@ -4418,7 +4418,7 @@ Term Solver::synthFunHelper(const std::string& symbol, Term Solver::ensureTermSort(const Term& term, const Sort& sort) const { // Note: Term and sort are checked in the caller to avoid double checks - CVC4_API_CHECK(term.getSort() == sort + CVC5_API_CHECK(term.getSort() == sort || (term.getSort().isInteger() && sort.isReal())) << "Expected conversion from Int to Real"; //////// all checks before this line @@ -4450,7 +4450,7 @@ Term Solver::ensureTermSort(const Term& term, const Sort& sort) const Term Solver::ensureRealSort(const Term& t) const { Assert(this == t.d_solver); - CVC4_API_ARG_CHECK_EXPECTED( + CVC5_API_ARG_CHECK_EXPECTED( t.getSort() == getIntegerSort() || t.getSort() == getRealSort(), " an integer or real term"); // Note: Term is checked in the caller to avoid double checks @@ -4507,17 +4507,17 @@ bool Solver::isValidInteger(const std::string& s) const void Solver::checkMkTerm(Kind kind, uint32_t nchildren) const { - CVC4_API_KIND_CHECK(kind); + CVC5_API_KIND_CHECK(kind); Assert(isDefinedIntKind(extToIntKind(kind))); const cvc5::kind::MetaKind mk = kind::metaKindOf(extToIntKind(kind)); - CVC4_API_KIND_CHECK_EXPECTED( + CVC5_API_KIND_CHECK_EXPECTED( mk == kind::metakind::PARAMETERIZED || mk == kind::metakind::OPERATOR, kind) << "Only operator-style terms are created with mkTerm(), " "to create variables, constants and values see mkVar(), mkConst() " "and the respective theory-specific functions to create values, " "e.g., mkBitVector()."; - CVC4_API_KIND_CHECK_EXPECTED( + CVC5_API_KIND_CHECK_EXPECTED( nchildren >= minArity(kind) && nchildren <= maxArity(kind), kind) << "Terms with kind " << kindToString(kind) << " must have at least " << minArity(kind) << " children and at most " << maxArity(kind) @@ -4529,11 +4529,11 @@ void Solver::checkMkTerm(Kind kind, uint32_t nchildren) const bool Solver::supportsFloatingPoint() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Configuration::isBuiltWithSymFPU(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Sorts Handling */ @@ -4542,73 +4542,73 @@ bool Solver::supportsFloatingPoint() const Sort Solver::getNullSort(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Sort(this, TypeNode()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::getBooleanSort(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Sort(this, getNodeManager()->booleanType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::getIntegerSort(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Sort(this, getNodeManager()->integerType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::getRealSort(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Sort(this, getNodeManager()->realType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::getRegExpSort(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Sort(this, getNodeManager()->regExpType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::getStringSort(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Sort(this, getNodeManager()->stringType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::getRoundingModeSort(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; //////// all checks before this line return Sort(this, getNodeManager()->roundingModeType()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Create sorts ------------------------------------------------------- */ @@ -4616,62 +4616,62 @@ Sort Solver::getRoundingModeSort(void) const Sort Solver::mkArraySort(const Sort& indexSort, const Sort& elemSort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(indexSort); - CVC4_API_SOLVER_CHECK_SORT(elemSort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(indexSort); + CVC5_API_SOLVER_CHECK_SORT(elemSort); //////// all checks before this line return Sort( this, getNodeManager()->mkArrayType(*indexSort.d_type, *elemSort.d_type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkBitVectorSort(uint32_t size) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_EXPECTED(size > 0, size) << "size > 0"; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_EXPECTED(size > 0, size) << "size > 0"; //////// all checks before this line return Sort(this, getNodeManager()->mkBitVectorType(size)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkFloatingPointSort(uint32_t exp, uint32_t sig) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; - CVC4_API_ARG_CHECK_EXPECTED(exp > 0, exp) << "exponent size > 0"; - CVC4_API_ARG_CHECK_EXPECTED(sig > 0, sig) << "significand size > 0"; + CVC5_API_ARG_CHECK_EXPECTED(exp > 0, exp) << "exponent size > 0"; + CVC5_API_ARG_CHECK_EXPECTED(sig > 0, sig) << "significand size > 0"; //////// all checks before this line return Sort(this, getNodeManager()->mkFloatingPointType(exp, sig)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkDatatypeSort(const DatatypeDecl& dtypedecl) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_DTDECL(dtypedecl); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_DTDECL(dtypedecl); //////// all checks before this line return Sort(this, getNodeManager()->mkDatatypeType(*dtypedecl.d_dtype)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Solver::mkDatatypeSorts( const std::vector& dtypedecls) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_SOLVER_CHECK_DTDECLS(dtypedecls); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_DTDECLS(dtypedecls); + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return mkDatatypeSortsInternal(dtypedecls, {}); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Solver::mkDatatypeSorts( @@ -4679,84 +4679,84 @@ std::vector Solver::mkDatatypeSorts( const std::set& unresolvedSorts) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_DTDECLS(dtypedecls); - CVC4_API_SOLVER_CHECK_SORTS(unresolvedSorts); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_DTDECLS(dtypedecls); + CVC5_API_SOLVER_CHECK_SORTS(unresolvedSorts); //////// all checks before this line return mkDatatypeSortsInternal(dtypedecls, unresolvedSorts); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkFunctionSort(const Sort& domain, const Sort& codomain) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_DOMAIN_SORT(domain); - CVC4_API_SOLVER_CHECK_CODOMAIN_SORT(codomain); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_DOMAIN_SORT(domain); + CVC5_API_SOLVER_CHECK_CODOMAIN_SORT(codomain); //////// all checks before this line return Sort( this, getNodeManager()->mkFunctionType(*domain.d_type, *codomain.d_type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkFunctionSort(const std::vector& sorts, const Sort& codomain) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_SIZE_CHECK_EXPECTED(sorts.size() >= 1, sorts) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_SIZE_CHECK_EXPECTED(sorts.size() >= 1, sorts) << "at least one parameter sort for function sort"; - CVC4_API_SOLVER_CHECK_DOMAIN_SORTS(sorts); - CVC4_API_SOLVER_CHECK_CODOMAIN_SORT(codomain); + CVC5_API_SOLVER_CHECK_DOMAIN_SORTS(sorts); + CVC5_API_SOLVER_CHECK_CODOMAIN_SORT(codomain); //////// all checks before this line std::vector argTypes = Sort::sortVectorToTypeNodes(sorts); return Sort(this, getNodeManager()->mkFunctionType(argTypes, *codomain.d_type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkParamSort(const std::string& symbol) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Sort( this, getNodeManager()->mkSort(symbol, NodeManager::SORT_FLAG_PLACEHOLDER)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkPredicateSort(const std::vector& sorts) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_SIZE_CHECK_EXPECTED(sorts.size() >= 1, sorts) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_SIZE_CHECK_EXPECTED(sorts.size() >= 1, sorts) << "at least one parameter sort for predicate sort"; - CVC4_API_SOLVER_CHECK_DOMAIN_SORTS(sorts); + CVC5_API_SOLVER_CHECK_DOMAIN_SORTS(sorts); //////// all checks before this line return Sort( this, getNodeManager()->mkPredicateType(Sort::sortVectorToTypeNodes(sorts))); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkRecordSort( const std::vector>& fields) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; std::vector> f; for (size_t i = 0, size = fields.size(); i < size; ++i) { const auto& p = fields[i]; - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED(!p.second.isNull(), "sort", fields, i) + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED(!p.second.isNull(), "sort", fields, i) << "non-null sort"; - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( this == p.second.d_solver, "sort", fields, i) << "sort associated with this solver object"; f.emplace_back(p.first, *p.second.d_type); @@ -4764,73 +4764,73 @@ Sort Solver::mkRecordSort( //////// all checks before this line return Sort(this, getNodeManager()->mkRecordType(f)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkSetSort(const Sort& elemSort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(elemSort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(elemSort); //////// all checks before this line return Sort(this, getNodeManager()->mkSetType(*elemSort.d_type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkBagSort(const Sort& elemSort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(elemSort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(elemSort); //////// all checks before this line return Sort(this, getNodeManager()->mkBagType(*elemSort.d_type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkSequenceSort(const Sort& elemSort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(elemSort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(elemSort); //////// all checks before this line return Sort(this, getNodeManager()->mkSequenceType(*elemSort.d_type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkUninterpretedSort(const std::string& symbol) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Sort(this, getNodeManager()->mkSort(symbol)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkSortConstructorSort(const std::string& symbol, size_t arity) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_EXPECTED(arity > 0, arity) << "an arity > 0"; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_EXPECTED(arity > 0, arity) << "an arity > 0"; //////// all checks before this line return Sort(this, getNodeManager()->mkSortConstructor(symbol, arity)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::mkTupleSort(const std::vector& sorts) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORTS_NOT_FUNCTION_LIKE(sorts); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORTS_NOT_FUNCTION_LIKE(sorts); //////// all checks before this line return mkTupleSortHelper(sorts); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Create consts */ @@ -4839,236 +4839,236 @@ Sort Solver::mkTupleSort(const std::vector& sorts) const Term Solver::mkTrue(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Term(this, d_nodeMgr->mkConst(true)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkFalse(void) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Term(this, d_nodeMgr->mkConst(false)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkBoolean(bool val) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return Term(this, d_nodeMgr->mkConst(val)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkPi() const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line Node res = d_nodeMgr->mkNullaryOperator(d_nodeMgr->realType(), cvc5::kind::PI); (void)res.getType(true); /* kick off type checking */ return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkInteger(const std::string& s) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_EXPECTED(isValidInteger(s), s) << " an integer "; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_EXPECTED(isValidInteger(s), s) << " an integer "; Term integer = mkRealFromStrHelper(s); - CVC4_API_ARG_CHECK_EXPECTED(integer.getSort() == getIntegerSort(), s) + CVC5_API_ARG_CHECK_EXPECTED(integer.getSort() == getIntegerSort(), s) << " a string representing an integer"; //////// all checks before this line return integer; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkInteger(int64_t val) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line Term integer = mkValHelper(cvc5::Rational(val)); Assert(integer.getSort() == getIntegerSort()); return integer; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkReal(const std::string& s) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; /* CLN and GMP handle this case differently, CLN interprets it as 0, GMP * throws an std::invalid_argument exception. For consistency, we treat it * as invalid. */ - CVC4_API_ARG_CHECK_EXPECTED(s != ".", s) + CVC5_API_ARG_CHECK_EXPECTED(s != ".", s) << "a string representing a real or rational value."; //////// all checks before this line Term rational = mkRealFromStrHelper(s); return ensureRealSort(rational); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkReal(int64_t val) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line Term rational = mkValHelper(cvc5::Rational(val)); return ensureRealSort(rational); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkReal(int64_t num, int64_t den) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line Term rational = mkValHelper(cvc5::Rational(num, den)); return ensureRealSort(rational); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkRegexpEmpty() const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line Node res = d_nodeMgr->mkNode(cvc5::kind::REGEXP_EMPTY, std::vector()); (void)res.getType(true); /* kick off type checking */ return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkRegexpSigma() const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line Node res = d_nodeMgr->mkNode(cvc5::kind::REGEXP_SIGMA, std::vector()); (void)res.getType(true); /* kick off type checking */ return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkEmptySet(const Sort& sort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_EXPECTED(sort.isNull() || sort.isSet(), sort) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_EXPECTED(sort.isNull() || sort.isSet(), sort) << "null sort or set sort"; - CVC4_API_ARG_CHECK_EXPECTED(sort.isNull() || this == sort.d_solver, sort) + CVC5_API_ARG_CHECK_EXPECTED(sort.isNull() || this == sort.d_solver, sort) << "set sort associated with this solver object"; //////// all checks before this line return mkValHelper(cvc5::EmptySet(*sort.d_type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkEmptyBag(const Sort& sort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_EXPECTED(sort.isNull() || sort.isBag(), sort) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_EXPECTED(sort.isNull() || sort.isBag(), sort) << "null sort or bag sort"; - CVC4_API_ARG_CHECK_EXPECTED(sort.isNull() || this == sort.d_solver, sort) + CVC5_API_ARG_CHECK_EXPECTED(sort.isNull() || this == sort.d_solver, sort) << "bag sort associated with this solver object"; //////// all checks before this line return mkValHelper(cvc5::EmptyBag(*sort.d_type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkSepNil(const Sort& sort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line Node res = getNodeManager()->mkNullaryOperator(*sort.d_type, cvc5::kind::SEP_NIL); (void)res.getType(true); /* kick off type checking */ return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkString(const std::string& s, bool useEscSequences) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return mkValHelper(cvc5::String(s, useEscSequences)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkString(const unsigned char c) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return mkValHelper(cvc5::String(std::string(1, c))); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkString(const std::vector& s) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return mkValHelper(cvc5::String(s)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkChar(const std::string& s) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return mkCharFromStrHelper(s); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkEmptySequence(const Sort& sort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line std::vector seq; Node res = d_nodeMgr->mkConst(Sequence(*sort.d_type, seq)); return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkUniverseSet(const Sort& sort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line Node res = getNodeManager()->mkNullaryOperator(*sort.d_type, @@ -5077,27 +5077,27 @@ Term Solver::mkUniverseSet(const Sort& sort) const // (void)res->getType(true); /* kick off type checking */ return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkBitVector(uint32_t size, uint64_t val) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return mkBVFromIntHelper(size, val); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkBitVector(const std::string& s, uint32_t base) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return mkBVFromStrHelper(s, base); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkBitVector(uint32_t size, @@ -5105,21 +5105,21 @@ Term Solver::mkBitVector(uint32_t size, uint32_t base) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return mkBVFromStrHelper(size, s, base); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkConstArray(const Sort& sort, const Term& val) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); - CVC4_API_SOLVER_CHECK_TERM(val); - CVC4_API_ARG_CHECK_EXPECTED(sort.isArray(), sort) << "an array sort"; - CVC4_API_CHECK(val.getSort().isSubsortOf(sort.getArrayElementSort())) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); + CVC5_API_SOLVER_CHECK_TERM(val); + CVC5_API_ARG_CHECK_EXPECTED(sort.isArray(), sort) << "an array sort"; + CVC5_API_CHECK(val.getSort().isSubsortOf(sort.getArrayElementSort())) << "Value does not match element sort"; //////// all checks before this line @@ -5134,149 +5134,149 @@ Term Solver::mkConstArray(const Sort& sort, const Term& val) const mkValHelper(cvc5::ArrayStoreAll(*sort.d_type, n)); return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkPosInf(uint32_t exp, uint32_t sig) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; //////// all checks before this line return mkValHelper( FloatingPoint::makeInf(FloatingPointSize(exp, sig), false)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkNegInf(uint32_t exp, uint32_t sig) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; //////// all checks before this line return mkValHelper( FloatingPoint::makeInf(FloatingPointSize(exp, sig), true)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkNaN(uint32_t exp, uint32_t sig) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; //////// all checks before this line return mkValHelper( FloatingPoint::makeNaN(FloatingPointSize(exp, sig))); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkPosZero(uint32_t exp, uint32_t sig) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; //////// all checks before this line return mkValHelper( FloatingPoint::makeZero(FloatingPointSize(exp, sig), false)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkNegZero(uint32_t exp, uint32_t sig) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; //////// all checks before this line return mkValHelper( FloatingPoint::makeZero(FloatingPointSize(exp, sig), true)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkRoundingMode(RoundingMode rm) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; //////// all checks before this line return mkValHelper(s_rmodes.at(rm)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkUninterpretedConst(const Sort& sort, int32_t index) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line return mkValHelper( cvc5::UninterpretedConstant(*sort.d_type, index)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkAbstractValue(const std::string& index) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_EXPECTED(!index.empty(), index) << "a non-empty string"; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_EXPECTED(!index.empty(), index) << "a non-empty string"; cvc5::Integer idx(index, 10); - CVC4_API_ARG_CHECK_EXPECTED(idx > 0, index) + CVC5_API_ARG_CHECK_EXPECTED(idx > 0, index) << "a string representing an integer > 0"; //////// all checks before this line return Term(this, getNodeManager()->mkConst(cvc5::AbstractValue(idx))); // do not call getType(), for abstract values, type can not be computed // until it is substituted away //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkAbstractValue(uint64_t index) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_EXPECTED(index > 0, index) << "an integer > 0"; + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_EXPECTED(index > 0, index) << "an integer > 0"; //////// all checks before this line return Term(this, getNodeManager()->mkConst(cvc5::AbstractValue(Integer(index)))); // do not call getType(), for abstract values, type can not be computed // until it is substituted away //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkFloatingPoint(uint32_t exp, uint32_t sig, Term val) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; - CVC4_API_SOLVER_CHECK_TERM(val); - CVC4_API_ARG_CHECK_EXPECTED(exp > 0, exp) << "a value > 0"; - CVC4_API_ARG_CHECK_EXPECTED(sig > 0, sig) << "a value > 0"; + CVC5_API_SOLVER_CHECK_TERM(val); + CVC5_API_ARG_CHECK_EXPECTED(exp > 0, exp) << "a value > 0"; + CVC5_API_ARG_CHECK_EXPECTED(sig > 0, sig) << "a value > 0"; uint32_t bw = exp + sig; - CVC4_API_ARG_CHECK_EXPECTED(bw == val.getSort().getBVSize(), val) + CVC5_API_ARG_CHECK_EXPECTED(bw == val.getSort().getBVSize(), val) << "a bit-vector constant with bit-width '" << bw << "'"; - CVC4_API_ARG_CHECK_EXPECTED( + CVC5_API_ARG_CHECK_EXPECTED( val.getSort().isBitVector() && val.d_node->isConst(), val) << "bit-vector constant"; //////// all checks before this line return mkValHelper( cvc5::FloatingPoint(exp, sig, val.d_node->getConst())); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Create constants */ @@ -5285,29 +5285,29 @@ Term Solver::mkFloatingPoint(uint32_t exp, uint32_t sig, Term val) const Term Solver::mkConst(const Sort& sort, const std::string& symbol) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line Node res = d_nodeMgr->mkVar(symbol, *sort.d_type); (void)res.getType(true); /* kick off type checking */ increment_vars_consts_stats(sort, false); return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkConst(const Sort& sort) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line Node res = d_nodeMgr->mkVar(*sort.d_type); (void)res.getType(true); /* kick off type checking */ increment_vars_consts_stats(sort, false); return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Create variables */ @@ -5316,8 +5316,8 @@ Term Solver::mkConst(const Sort& sort) const Term Solver::mkVar(const Sort& sort, const std::string& symbol) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line Node res = symbol.empty() ? d_nodeMgr->mkBoundVar(*sort.d_type) : d_nodeMgr->mkBoundVar(symbol, *sort.d_type); @@ -5325,7 +5325,7 @@ Term Solver::mkVar(const Sort& sort, const std::string& symbol) const increment_vars_consts_stats(sort, true); return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Create datatype constructor declarations */ @@ -5335,11 +5335,11 @@ DatatypeConstructorDecl Solver::mkDatatypeConstructorDecl( const std::string& name) { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return DatatypeConstructorDecl(this, name); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Create datatype declarations */ @@ -5348,11 +5348,11 @@ DatatypeConstructorDecl Solver::mkDatatypeConstructorDecl( DatatypeDecl Solver::mkDatatypeDecl(const std::string& name, bool isCoDatatype) { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return DatatypeDecl(this, name, isCoDatatype); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } DatatypeDecl Solver::mkDatatypeDecl(const std::string& name, @@ -5360,12 +5360,12 @@ DatatypeDecl Solver::mkDatatypeDecl(const std::string& name, bool isCoDatatype) { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(param); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(param); //////// all checks before this line return DatatypeDecl(this, name, param, isCoDatatype); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } DatatypeDecl Solver::mkDatatypeDecl(const std::string& name, @@ -5373,12 +5373,12 @@ DatatypeDecl Solver::mkDatatypeDecl(const std::string& name, bool isCoDatatype) { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORTS(params); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORTS(params); //////// all checks before this line return DatatypeDecl(this, name, params, isCoDatatype); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Create terms */ @@ -5387,37 +5387,37 @@ DatatypeDecl Solver::mkDatatypeDecl(const std::string& name, Term Solver::mkTerm(Kind kind) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); //////// all checks before this line return mkTermFromKind(kind); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(Kind kind, const Term& child) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); - CVC4_API_SOLVER_CHECK_TERM(child); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); + CVC5_API_SOLVER_CHECK_TERM(child); //////// all checks before this line return mkTermHelper(kind, std::vector{child}); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); - CVC4_API_SOLVER_CHECK_TERM(child1); - CVC4_API_SOLVER_CHECK_TERM(child2); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); + CVC5_API_SOLVER_CHECK_TERM(child1); + CVC5_API_SOLVER_CHECK_TERM(child2); //////// all checks before this line return mkTermHelper(kind, std::vector{child1, child2}); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(Kind kind, @@ -5426,35 +5426,35 @@ Term Solver::mkTerm(Kind kind, const Term& child3) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); - CVC4_API_SOLVER_CHECK_TERM(child1); - CVC4_API_SOLVER_CHECK_TERM(child2); - CVC4_API_SOLVER_CHECK_TERM(child3); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); + CVC5_API_SOLVER_CHECK_TERM(child1); + CVC5_API_SOLVER_CHECK_TERM(child2); + CVC5_API_SOLVER_CHECK_TERM(child3); //////// all checks before this line // need to use internal term call to check e.g. associative construction return mkTermHelper(kind, std::vector{child1, child2, child3}); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(Kind kind, const std::vector& children) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); - CVC4_API_SOLVER_CHECK_TERMS(children); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); + CVC5_API_SOLVER_CHECK_TERMS(children); //////// all checks before this line return mkTermHelper(kind, children); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(const Op& op) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_OP(op); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_OP(op); checkMkTerm(op.d_kind, 0); //////// all checks before this line @@ -5469,32 +5469,32 @@ Term Solver::mkTerm(const Op& op) const (void)res.d_node->getType(true); /* kick off type checking */ return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(const Op& op, const Term& child) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_OP(op); - CVC4_API_SOLVER_CHECK_TERM(child); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_OP(op); + CVC5_API_SOLVER_CHECK_TERM(child); //////// all checks before this line return mkTermHelper(op, std::vector{child}); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(const Op& op, const Term& child1, const Term& child2) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_OP(op); - CVC4_API_SOLVER_CHECK_TERM(child1); - CVC4_API_SOLVER_CHECK_TERM(child2); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_OP(op); + CVC5_API_SOLVER_CHECK_TERM(child1); + CVC5_API_SOLVER_CHECK_TERM(child2); //////// all checks before this line return mkTermHelper(op, std::vector{child1, child2}); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(const Op& op, @@ -5503,38 +5503,38 @@ Term Solver::mkTerm(const Op& op, const Term& child3) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_OP(op); - CVC4_API_SOLVER_CHECK_TERM(child1); - CVC4_API_SOLVER_CHECK_TERM(child2); - CVC4_API_SOLVER_CHECK_TERM(child3); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_OP(op); + CVC5_API_SOLVER_CHECK_TERM(child1); + CVC5_API_SOLVER_CHECK_TERM(child2); + CVC5_API_SOLVER_CHECK_TERM(child3); //////// all checks before this line return mkTermHelper(op, std::vector{child1, child2, child3}); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTerm(const Op& op, const std::vector& children) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_OP(op); - CVC4_API_SOLVER_CHECK_TERMS(children); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_OP(op); + CVC5_API_SOLVER_CHECK_TERMS(children); //////// all checks before this line return mkTermHelper(op, children); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkTuple(const std::vector& sorts, const std::vector& terms) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(sorts.size() == terms.size()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(sorts.size() == terms.size()) << "Expected the same number of sorts and elements"; - CVC4_API_SOLVER_CHECK_SORTS(sorts); - CVC4_API_SOLVER_CHECK_TERMS(terms); + CVC5_API_SOLVER_CHECK_SORTS(sorts); + CVC5_API_SOLVER_CHECK_TERMS(terms); //////// all checks before this line std::vector args; for (size_t i = 0, size = sorts.size(); i < size; i++) @@ -5551,7 +5551,7 @@ Term Solver::mkTuple(const std::vector& sorts, (void)res.getType(true); /* kick off type checking */ return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Create operators */ @@ -5559,21 +5559,21 @@ Term Solver::mkTuple(const std::vector& sorts, Op Solver::mkOp(Kind kind) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); - CVC4_API_CHECK(s_indexed_kinds.find(kind) == s_indexed_kinds.end()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); + CVC5_API_CHECK(s_indexed_kinds.find(kind) == s_indexed_kinds.end()) << "Expected a kind for a non-indexed operator."; //////// all checks before this line return Op(this, kind); //////// - CVC4_API_TRY_CATCH_END + CVC5_API_TRY_CATCH_END } Op Solver::mkOp(Kind kind, const std::string& arg) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); - CVC4_API_KIND_CHECK_EXPECTED((kind == RECORD_UPDATE) || (kind == DIVISIBLE), + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); + CVC5_API_KIND_CHECK_EXPECTED((kind == RECORD_UPDATE) || (kind == DIVISIBLE), kind) << "RECORD_UPDATE or DIVISIBLE"; //////// all checks before this line @@ -5589,7 +5589,7 @@ Op Solver::mkOp(Kind kind, const std::string& arg) const /* CLN and GMP handle this case differently, CLN interprets it as 0, GMP * throws an std::invalid_argument exception. For consistency, we treat it * as invalid. */ - CVC4_API_ARG_CHECK_EXPECTED(arg != ".", arg) + CVC5_API_ARG_CHECK_EXPECTED(arg != ".", arg) << "a string representing an integer, real or rational value."; res = Op(this, kind, @@ -5598,13 +5598,13 @@ Op Solver::mkOp(Kind kind, const std::string& arg) const } return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Op Solver::mkOp(Kind kind, uint32_t arg) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); //////// all checks before this line Op res; switch (kind) @@ -5684,19 +5684,19 @@ Op Solver::mkOp(Kind kind, uint32_t arg) const *mkValHelper(cvc5::RegExpRepeat(arg)).d_node); break; default: - CVC4_API_KIND_CHECK_EXPECTED(false, kind) + CVC5_API_KIND_CHECK_EXPECTED(false, kind) << "operator kind with uint32_t argument"; } Assert(!res.isNull()); return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Op Solver::mkOp(Kind kind, uint32_t arg1, uint32_t arg2) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); //////// all checks before this line Op res; @@ -5758,19 +5758,19 @@ Op Solver::mkOp(Kind kind, uint32_t arg1, uint32_t arg2) const *mkValHelper(cvc5::RegExpLoop(arg1, arg2)).d_node); break; default: - CVC4_API_KIND_CHECK_EXPECTED(false, kind) + CVC5_API_KIND_CHECK_EXPECTED(false, kind) << "operator kind with two uint32_t arguments"; } Assert(!res.isNull()); return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Op Solver::mkOp(Kind kind, const std::vector& args) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_KIND_CHECK(kind); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_KIND_CHECK(kind); //////// all checks before this line Op res; @@ -5788,13 +5788,13 @@ Op Solver::mkOp(Kind kind, const std::vector& args) const { std::string message = "operator kind with " + std::to_string(args.size()) + " uint32_t arguments"; - CVC4_API_KIND_CHECK_EXPECTED(false, kind) << message; + CVC5_API_KIND_CHECK_EXPECTED(false, kind) << message; } } Assert(!res.isNull()); return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* Non-SMT-LIB commands */ @@ -5803,43 +5803,43 @@ Op Solver::mkOp(Kind kind, const std::vector& args) const Term Solver::simplify(const Term& term) { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(term); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(term); //////// all checks before this line return Term(this, d_smtEngine->simplify(*term.d_node)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Result Solver::checkEntailed(const Term& term) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(!d_smtEngine->isQueryMade() + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(!d_smtEngine->isQueryMade() || d_smtEngine->getOptions()[options::incrementalSolving]) << "Cannot make multiple queries unless incremental solving is enabled " "(try --incremental)"; - CVC4_API_SOLVER_CHECK_TERM(term); + CVC5_API_SOLVER_CHECK_TERM(term); //////// all checks before this line cvc5::Result r = d_smtEngine->checkEntailed(*term.d_node); return Result(r); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Result Solver::checkEntailed(const std::vector& terms) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; NodeManagerScope scope(getNodeManager()); - CVC4_API_CHECK(!d_smtEngine->isQueryMade() + CVC5_API_CHECK(!d_smtEngine->isQueryMade() || d_smtEngine->getOptions()[options::incrementalSolving]) << "Cannot make multiple queries unless incremental solving is enabled " "(try --incremental)"; - CVC4_API_SOLVER_CHECK_TERMS(terms); + CVC5_API_SOLVER_CHECK_TERMS(terms); //////// all checks before this line return d_smtEngine->checkEntailed(Term::termVectorToNodes(terms)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* SMT-LIB commands */ @@ -5847,20 +5847,20 @@ Result Solver::checkEntailed(const std::vector& terms) const void Solver::assertFormula(const Term& term) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(term); - CVC4_API_SOLVER_CHECK_TERM_WITH_SORT(term, getBooleanSort()); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(term); + CVC5_API_SOLVER_CHECK_TERM_WITH_SORT(term, getBooleanSort()); //////// all checks before this line d_smtEngine->assertFormula(*term.d_node); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Result Solver::checkSat(void) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; NodeManagerScope scope(getNodeManager()); - CVC4_API_CHECK(!d_smtEngine->isQueryMade() + CVC5_API_CHECK(!d_smtEngine->isQueryMade() || d_smtEngine->getOptions()[options::incrementalSolving]) << "Cannot make multiple queries unless incremental solving is enabled " "(try --incremental)"; @@ -5868,54 +5868,54 @@ Result Solver::checkSat(void) const cvc5::Result r = d_smtEngine->checkSat(); return Result(r); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Result Solver::checkSatAssuming(const Term& assumption) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; NodeManagerScope scope(getNodeManager()); - CVC4_API_CHECK(!d_smtEngine->isQueryMade() + CVC5_API_CHECK(!d_smtEngine->isQueryMade() || d_smtEngine->getOptions()[options::incrementalSolving]) << "Cannot make multiple queries unless incremental solving is enabled " "(try --incremental)"; - CVC4_API_SOLVER_CHECK_TERM_WITH_SORT(assumption, getBooleanSort()); + CVC5_API_SOLVER_CHECK_TERM_WITH_SORT(assumption, getBooleanSort()); //////// all checks before this line cvc5::Result r = d_smtEngine->checkSat(*assumption.d_node); return Result(r); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Result Solver::checkSatAssuming(const std::vector& assumptions) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; NodeManagerScope scope(getNodeManager()); - CVC4_API_CHECK(!d_smtEngine->isQueryMade() || assumptions.size() == 0 + CVC5_API_CHECK(!d_smtEngine->isQueryMade() || assumptions.size() == 0 || d_smtEngine->getOptions()[options::incrementalSolving]) << "Cannot make multiple queries unless incremental solving is enabled " "(try --incremental)"; - CVC4_API_SOLVER_CHECK_TERMS_WITH_SORT(assumptions, getBooleanSort()); + CVC5_API_SOLVER_CHECK_TERMS_WITH_SORT(assumptions, getBooleanSort()); //////// all checks before this line for (const Term& term : assumptions) { - CVC4_API_SOLVER_CHECK_TERM(term); + CVC5_API_SOLVER_CHECK_TERM(term); } std::vector eassumptions = Term::termVectorToNodes(assumptions); cvc5::Result r = d_smtEngine->checkSat(eassumptions); return Result(r); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::declareDatatype( const std::string& symbol, const std::vector& ctors) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_CHECK_EXPECTED(ctors.size() > 0, ctors) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_CHECK_EXPECTED(ctors.size() > 0, ctors) << "a datatype declaration with at least one constructor"; - CVC4_API_SOLVER_CHECK_DTCTORDECLS(ctors); + CVC5_API_SOLVER_CHECK_DTCTORDECLS(ctors); //////// all checks before this line DatatypeDecl dtdecl(this, symbol); for (size_t i = 0, size = ctors.size(); i < size; i++) @@ -5924,16 +5924,16 @@ Sort Solver::declareDatatype( } return Sort(this, getNodeManager()->mkDatatypeType(*dtdecl.d_dtype)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::declareFun(const std::string& symbol, const std::vector& sorts, const Sort& sort) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_DOMAIN_SORTS(sorts); - CVC4_API_SOLVER_CHECK_CODOMAIN_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_DOMAIN_SORTS(sorts); + CVC5_API_SOLVER_CHECK_CODOMAIN_SORT(sort); //////// all checks before this line TypeNode type = *sort.d_type; @@ -5944,12 +5944,12 @@ Term Solver::declareFun(const std::string& symbol, } return Term(this, d_nodeMgr->mkVar(symbol, type)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Sort Solver::declareSort(const std::string& symbol, uint32_t arity) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line if (arity == 0) { @@ -5957,7 +5957,7 @@ Sort Solver::declareSort(const std::string& symbol, uint32_t arity) const } return Sort(this, getNodeManager()->mkSortConstructor(symbol, arity)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::defineFun(const std::string& symbol, @@ -5966,10 +5966,10 @@ Term Solver::defineFun(const std::string& symbol, const Term& term, bool global) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_CODOMAIN_SORT(sort); - CVC4_API_SOLVER_CHECK_TERM(term); - CVC4_API_CHECK(sort == term.getSort()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_CODOMAIN_SORT(sort); + CVC5_API_SOLVER_CHECK_TERM(term); + CVC5_API_CHECK(sort == term.getSort()) << "Invalid sort of function body '" << term << "', expected '" << sort << "'"; @@ -5986,14 +5986,14 @@ Term Solver::defineFun(const std::string& symbol, Sort::sortVectorToTypeNodes(domain_sorts), *sort.d_type)); Term fun = mkConst(fun_sort, symbol); - CVC4_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bound_vars, domain_sorts); + CVC5_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bound_vars, domain_sorts); //////// all checks before this line d_smtEngine->defineFunction( *fun.d_node, Term::termVectorToNodes(bound_vars), *term.d_node, global); return fun; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::defineFun(const Term& fun, @@ -6001,22 +6001,22 @@ Term Solver::defineFun(const Term& fun, const Term& term, bool global) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(fun); - CVC4_API_SOLVER_CHECK_TERM(term); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(fun); + CVC5_API_SOLVER_CHECK_TERM(term); if (fun.getSort().isFunction()) { std::vector domain_sorts = fun.getSort().getFunctionDomainSorts(); - CVC4_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bound_vars, domain_sorts); + CVC5_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bound_vars, domain_sorts); Sort codomain = fun.getSort().getFunctionCodomainSort(); - CVC4_API_CHECK(codomain == term.getSort()) + CVC5_API_CHECK(codomain == term.getSort()) << "Invalid sort of function body '" << term << "', expected '" << codomain << "'"; } else { - CVC4_API_SOLVER_CHECK_BOUND_VARS(bound_vars); - CVC4_API_ARG_CHECK_EXPECTED(bound_vars.size() == 0, fun) + CVC5_API_SOLVER_CHECK_BOUND_VARS(bound_vars); + CVC5_API_ARG_CHECK_EXPECTED(bound_vars.size() == 0, fun) << "function or nullary symbol"; } //////// all checks before this line @@ -6024,7 +6024,7 @@ Term Solver::defineFun(const Term& fun, d_smtEngine->defineFunction(*fun.d_node, ebound_vars, *term.d_node, global); return fun; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::defineFunRec(const std::string& symbol, @@ -6034,18 +6034,18 @@ Term Solver::defineFunRec(const std::string& symbol, bool global) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified()) + CVC5_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified()) << "recursive function definitions require a logic with quantifiers"; - CVC4_API_CHECK( + CVC5_API_CHECK( d_smtEngine->getUserLogicInfo().isTheoryEnabled(theory::THEORY_UF)) << "recursive function definitions require a logic with uninterpreted " "functions"; - CVC4_API_SOLVER_CHECK_TERM(term); - CVC4_API_SOLVER_CHECK_CODOMAIN_SORT(sort); - CVC4_API_CHECK(sort == term.getSort()) + CVC5_API_SOLVER_CHECK_TERM(term); + CVC5_API_SOLVER_CHECK_CODOMAIN_SORT(sort); + CVC5_API_CHECK(sort == term.getSort()) << "Invalid sort of function body '" << term << "', expected '" << sort << "'"; @@ -6062,7 +6062,7 @@ Term Solver::defineFunRec(const std::string& symbol, Sort::sortVectorToTypeNodes(domain_sorts), *sort.d_type)); Term fun = mkConst(fun_sort, symbol); - CVC4_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bound_vars, domain_sorts); + CVC5_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bound_vars, domain_sorts); //////// all checks before this line d_smtEngine->defineFunctionRec( @@ -6070,7 +6070,7 @@ Term Solver::defineFunRec(const std::string& symbol, return fun; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::defineFunRec(const Term& fun, @@ -6079,30 +6079,30 @@ Term Solver::defineFunRec(const Term& fun, bool global) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified()) + CVC5_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified()) << "recursive function definitions require a logic with quantifiers"; - CVC4_API_CHECK( + CVC5_API_CHECK( d_smtEngine->getUserLogicInfo().isTheoryEnabled(theory::THEORY_UF)) << "recursive function definitions require a logic with uninterpreted " "functions"; - CVC4_API_SOLVER_CHECK_TERM(fun); - CVC4_API_SOLVER_CHECK_TERM(term); + CVC5_API_SOLVER_CHECK_TERM(fun); + CVC5_API_SOLVER_CHECK_TERM(term); if (fun.getSort().isFunction()) { std::vector domain_sorts = fun.getSort().getFunctionDomainSorts(); - CVC4_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bound_vars, domain_sorts); + CVC5_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bound_vars, domain_sorts); Sort codomain = fun.getSort().getFunctionCodomainSort(); - CVC4_API_CHECK(codomain == term.getSort()) + CVC5_API_CHECK(codomain == term.getSort()) << "Invalid sort of function body '" << term << "', expected '" << codomain << "'"; } else { - CVC4_API_SOLVER_CHECK_BOUND_VARS(bound_vars); - CVC4_API_ARG_CHECK_EXPECTED(bound_vars.size() == 0, fun) + CVC5_API_SOLVER_CHECK_BOUND_VARS(bound_vars); + CVC5_API_ARG_CHECK_EXPECTED(bound_vars.size() == 0, fun) << "function or nullary symbol"; } //////// all checks before this line @@ -6112,7 +6112,7 @@ Term Solver::defineFunRec(const Term& fun, *fun.d_node, ebound_vars, *term.d_node, global); return fun; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::defineFunsRec(const std::vector& funs, @@ -6121,21 +6121,21 @@ void Solver::defineFunsRec(const std::vector& funs, bool global) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified()) + CVC5_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified()) << "recursive function definitions require a logic with quantifiers"; - CVC4_API_CHECK( + CVC5_API_CHECK( d_smtEngine->getUserLogicInfo().isTheoryEnabled(theory::THEORY_UF)) << "recursive function definitions require a logic with uninterpreted " "functions"; - CVC4_API_SOLVER_CHECK_TERMS(funs); - CVC4_API_SOLVER_CHECK_TERMS(terms); + CVC5_API_SOLVER_CHECK_TERMS(funs); + CVC5_API_SOLVER_CHECK_TERMS(terms); size_t funs_size = funs.size(); - CVC4_API_ARG_SIZE_CHECK_EXPECTED(funs_size == bound_vars.size(), bound_vars) + CVC5_API_ARG_SIZE_CHECK_EXPECTED(funs_size == bound_vars.size(), bound_vars) << "'" << funs_size << "'"; - CVC4_API_ARG_SIZE_CHECK_EXPECTED(funs_size == terms.size(), terms) + CVC5_API_ARG_SIZE_CHECK_EXPECTED(funs_size == terms.size(), terms) << "'" << funs_size << "'"; for (size_t j = 0; j < funs_size; ++j) @@ -6144,26 +6144,26 @@ void Solver::defineFunsRec(const std::vector& funs, const std::vector& bvars = bound_vars[j]; const Term& term = terms[j]; - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( this == fun.d_solver, "function", funs, j) << "function associated with this solver object"; - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( this == term.d_solver, "term", terms, j) << "term associated with this solver object"; if (fun.getSort().isFunction()) { std::vector domain_sorts = fun.getSort().getFunctionDomainSorts(); - CVC4_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bvars, domain_sorts); + CVC5_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN(fun, bvars, domain_sorts); Sort codomain = fun.getSort().getFunctionCodomainSort(); - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( codomain == term.getSort(), "sort of function body", terms, j) << "'" << codomain << "'"; } else { - CVC4_API_SOLVER_CHECK_BOUND_VARS(bvars); - CVC4_API_ARG_CHECK_EXPECTED(bvars.size() == 0, fun) + CVC5_API_SOLVER_CHECK_BOUND_VARS(bvars); + CVC5_API_ARG_CHECK_EXPECTED(bvars.size() == 0, fun) << "function or nullary symbol"; } } @@ -6177,7 +6177,7 @@ void Solver::defineFunsRec(const std::vector& funs, std::vector nodes = Term::termVectorToNodes(terms); d_smtEngine->defineFunctionsRec(efuns, ebound_vars, nodes, global); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::echo(std::ostream& out, const std::string& str) const @@ -6187,7 +6187,7 @@ void Solver::echo(std::ostream& out, const std::string& str) const std::vector Solver::getAssertions(void) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line std::vector assertions = d_smtEngine->getAssertions(); /* Can not use @@ -6200,41 +6200,41 @@ std::vector Solver::getAssertions(void) const } return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string Solver::getInfo(const std::string& flag) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_RECOVERABLE_CHECK(d_smtEngine->isValidGetInfoFlag(flag)) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isValidGetInfoFlag(flag)) << "Unrecognized flag for getInfo."; //////// all checks before this line return d_smtEngine->getInfo(flag).toString(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::string Solver::getOption(const std::string& option) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line Node res = d_smtEngine->getOption(option); return res.toString(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Solver::getUnsatAssumptions(void) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; NodeManagerScope scope(getNodeManager()); - CVC4_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving]) + CVC5_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving]) << "Cannot get unsat assumptions unless incremental solving is enabled " "(try --incremental)"; - CVC4_API_CHECK(d_smtEngine->getOptions()[options::unsatAssumptions]) + CVC5_API_CHECK(d_smtEngine->getOptions()[options::unsatAssumptions]) << "Cannot get unsat assumptions unless explicitly enabled " "(try --produce-unsat-assumptions)"; - CVC4_API_CHECK(d_smtEngine->getSmtMode() == SmtMode::UNSAT) + CVC5_API_CHECK(d_smtEngine->getSmtMode() == SmtMode::UNSAT) << "Cannot get unsat assumptions unless in unsat mode."; //////// all checks before this line @@ -6249,17 +6249,17 @@ std::vector Solver::getUnsatAssumptions(void) const } return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Solver::getUnsatCore(void) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; NodeManagerScope scope(getNodeManager()); - CVC4_API_CHECK(d_smtEngine->getOptions()[options::unsatCores]) + CVC5_API_CHECK(d_smtEngine->getOptions()[options::unsatCores]) << "Cannot get unsat core unless explicitly enabled " "(try --produce-unsat-cores)"; - CVC4_API_RECOVERABLE_CHECK(d_smtEngine->getSmtMode() == SmtMode::UNSAT) + CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getSmtMode() == SmtMode::UNSAT) << "Cannot get unsat core unless in unsat mode."; //////// all checks before this line UnsatCore core = d_smtEngine->getUnsatCore(); @@ -6273,29 +6273,29 @@ std::vector Solver::getUnsatCore(void) const } return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::getValue(const Term& term) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(term); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(term); //////// all checks before this line return getValueHelper(term); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Solver::getValue(const std::vector& terms) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; NodeManagerScope scope(getNodeManager()); - CVC4_API_RECOVERABLE_CHECK(d_smtEngine->getOptions()[options::produceModels]) + CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getOptions()[options::produceModels]) << "Cannot get value unless model generation is enabled " "(try --produce-models)"; - CVC4_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) + CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) << "Cannot get value unless after a SAT or unknown response."; - CVC4_API_SOLVER_CHECK_TERMS(terms); + CVC5_API_SOLVER_CHECK_TERMS(terms); //////// all checks before this line std::vector res; @@ -6306,94 +6306,94 @@ std::vector Solver::getValue(const std::vector& terms) const } return res; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::getQuantifierElimination(const Term& q) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(q); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(q); //////// all checks before this line return Term(this, d_smtEngine->getQuantifierElimination(q.getNode(), true, true)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::getQuantifierEliminationDisjunct(const Term& q) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(q); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(q); //////// all checks before this line return Term(this, d_smtEngine->getQuantifierElimination(q.getNode(), false, true)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::declareSeparationHeap(const Sort& locSort, const Sort& dataSort) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(locSort); - CVC4_API_SOLVER_CHECK_SORT(dataSort); - CVC4_API_CHECK( + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(locSort); + CVC5_API_SOLVER_CHECK_SORT(dataSort); + CVC5_API_CHECK( d_smtEngine->getLogicInfo().isTheoryEnabled(theory::THEORY_SEP)) << "Cannot obtain separation logic expressions if not using the " "separation logic theory."; //////// all checks before this line d_smtEngine->declareSepHeap(locSort.getTypeNode(), dataSort.getTypeNode()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::getSeparationHeap() const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK( + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK( d_smtEngine->getLogicInfo().isTheoryEnabled(theory::THEORY_SEP)) << "Cannot obtain separation logic expressions if not using the " "separation logic theory."; - CVC4_API_CHECK(d_smtEngine->getOptions()[options::produceModels]) + CVC5_API_CHECK(d_smtEngine->getOptions()[options::produceModels]) << "Cannot get separation heap term unless model generation is enabled " "(try --produce-models)"; - CVC4_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) + CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) << "Can only get separtion heap term after sat or unknown response."; //////// all checks before this line return Term(this, d_smtEngine->getSepHeapExpr()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::getSeparationNilTerm() const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK( + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK( d_smtEngine->getLogicInfo().isTheoryEnabled(theory::THEORY_SEP)) << "Cannot obtain separation logic expressions if not using the " "separation logic theory."; - CVC4_API_CHECK(d_smtEngine->getOptions()[options::produceModels]) + CVC5_API_CHECK(d_smtEngine->getOptions()[options::produceModels]) << "Cannot get separation nil term unless model generation is enabled " "(try --produce-models)"; - CVC4_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) + CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) << "Can only get separtion nil term after sat or unknown response."; //////// all checks before this line return Term(this, d_smtEngine->getSepNilExpr()); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::pop(uint32_t nscopes) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving]) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving]) << "Cannot pop when not solving incrementally (use --incremental)"; - CVC4_API_CHECK(nscopes <= d_smtEngine->getNumUserLevels()) + CVC5_API_CHECK(nscopes <= d_smtEngine->getNumUserLevels()) << "Cannot pop beyond first pushed context"; //////// all checks before this line for (uint32_t n = 0; n < nscopes; ++n) @@ -6401,14 +6401,14 @@ void Solver::pop(uint32_t nscopes) const d_smtEngine->pop(); } //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Solver::getInterpolant(const Term& conj, Term& output) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(conj); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(conj); //////// all checks before this line Node result; bool success = d_smtEngine->getInterpol(*conj.d_node, result); @@ -6418,7 +6418,7 @@ bool Solver::getInterpolant(const Term& conj, Term& output) const } return success; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Solver::getInterpolant(const Term& conj, @@ -6426,8 +6426,8 @@ bool Solver::getInterpolant(const Term& conj, Term& output) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(conj); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(conj); //////// all checks before this line Node result; bool success = @@ -6438,14 +6438,14 @@ bool Solver::getInterpolant(const Term& conj, } return success; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Solver::getAbduct(const Term& conj, Term& output) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(conj); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(conj); //////// all checks before this line Node result; bool success = d_smtEngine->getAbduct(*conj.d_node, result); @@ -6455,14 +6455,14 @@ bool Solver::getAbduct(const Term& conj, Term& output) const } return success; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } bool Solver::getAbduct(const Term& conj, Grammar& grammar, Term& output) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(conj); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(conj); //////// all checks before this line Node result; bool success = @@ -6473,57 +6473,57 @@ bool Solver::getAbduct(const Term& conj, Grammar& grammar, Term& output) const } return success; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::blockModel() const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(d_smtEngine->getOptions()[options::produceModels]) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(d_smtEngine->getOptions()[options::produceModels]) << "Cannot get value unless model generation is enabled " "(try --produce-models)"; - CVC4_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) + CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) << "Can only block model after sat or unknown response."; //////// all checks before this line d_smtEngine->blockModel(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::blockModelValues(const std::vector& terms) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(d_smtEngine->getOptions()[options::produceModels]) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(d_smtEngine->getOptions()[options::produceModels]) << "Cannot get value unless model generation is enabled " "(try --produce-models)"; - CVC4_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) + CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat()) << "Can only block model values after sat or unknown response."; - CVC4_API_ARG_SIZE_CHECK_EXPECTED(!terms.empty(), terms) + CVC5_API_ARG_SIZE_CHECK_EXPECTED(!terms.empty(), terms) << "a non-empty set of terms"; - CVC4_API_SOLVER_CHECK_TERMS(terms); + CVC5_API_SOLVER_CHECK_TERMS(terms); //////// all checks before this line d_smtEngine->blockModelValues(Term::termVectorToNodes(terms)); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::printInstantiations(std::ostream& out) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line d_smtEngine->printInstantiations(out); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::push(uint32_t nscopes) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving]) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving]) << "Cannot push when not solving incrementally (use --incremental)"; //////// all checks before this line for (uint32_t n = 0; n < nscopes; ++n) @@ -6531,22 +6531,22 @@ void Solver::push(uint32_t nscopes) const d_smtEngine->push(); } //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::resetAssertions(void) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line d_smtEngine->resetAssertions(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::setInfo(const std::string& keyword, const std::string& value) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_RECOVERABLE_ARG_CHECK_EXPECTED( + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_RECOVERABLE_ARG_CHECK_EXPECTED( keyword == "source" || keyword == "category" || keyword == "difficulty" || keyword == "filename" || keyword == "license" || keyword == "name" || keyword == "notes" || keyword == "smt-lib-version" @@ -6554,49 +6554,49 @@ void Solver::setInfo(const std::string& keyword, const std::string& value) const keyword) << "'source', 'category', 'difficulty', 'filename', 'license', 'name', " "'notes', 'smt-lib-version' or 'status'"; - CVC4_API_RECOVERABLE_ARG_CHECK_EXPECTED( + CVC5_API_RECOVERABLE_ARG_CHECK_EXPECTED( keyword != "smt-lib-version" || value == "2" || value == "2.0" || value == "2.5" || value == "2.6", value) << "'2.0', '2.5', '2.6'"; - CVC4_API_ARG_CHECK_EXPECTED(keyword != "status" || value == "sat" + CVC5_API_ARG_CHECK_EXPECTED(keyword != "status" || value == "sat" || value == "unsat" || value == "unknown", value) << "'sat', 'unsat' or 'unknown'"; //////// all checks before this line d_smtEngine->setInfo(keyword, value); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::setLogic(const std::string& logic) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(!d_smtEngine->isFullyInited()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(!d_smtEngine->isFullyInited()) << "Invalid call to 'setLogic', solver is already fully initialized"; cvc5::LogicInfo logic_info(logic); //////// all checks before this line d_smtEngine->setLogic(logic_info); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::setOption(const std::string& option, const std::string& value) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_CHECK(!d_smtEngine->isFullyInited()) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_CHECK(!d_smtEngine->isFullyInited()) << "Invalid call to 'setOption', solver is already fully initialized"; //////// all checks before this line d_smtEngine->setOption(option, value); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::mkSygusVar(const Sort& sort, const std::string& symbol) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line Node res = getNodeManager()->mkBoundVar(symbol, *sort.d_type); (void)res.getType(true); /* kick off type checking */ @@ -6605,34 +6605,34 @@ Term Solver::mkSygusVar(const Sort& sort, const std::string& symbol) const return Term(this, res); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Grammar Solver::mkSygusGrammar(const std::vector& boundVars, const std::vector& ntSymbols) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_SIZE_CHECK_EXPECTED(!ntSymbols.empty(), ntSymbols) + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_SIZE_CHECK_EXPECTED(!ntSymbols.empty(), ntSymbols) << "a non-empty vector"; - CVC4_API_SOLVER_CHECK_BOUND_VARS(boundVars); - CVC4_API_SOLVER_CHECK_BOUND_VARS(ntSymbols); + CVC5_API_SOLVER_CHECK_BOUND_VARS(boundVars); + CVC5_API_SOLVER_CHECK_BOUND_VARS(ntSymbols); //////// all checks before this line return Grammar(this, boundVars, ntSymbols); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::synthFun(const std::string& symbol, const std::vector& boundVars, const Sort& sort) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_BOUND_VARS(boundVars); - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_BOUND_VARS(boundVars); + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line return synthFunHelper(symbol, boundVars, sort); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::synthFun(const std::string& symbol, @@ -6640,33 +6640,33 @@ Term Solver::synthFun(const std::string& symbol, Sort sort, Grammar& grammar) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_BOUND_VARS(boundVars); - CVC4_API_SOLVER_CHECK_SORT(sort); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_BOUND_VARS(boundVars); + CVC5_API_SOLVER_CHECK_SORT(sort); //////// all checks before this line return synthFunHelper(symbol, boundVars, sort, false, &grammar); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::synthInv(const std::string& symbol, const std::vector& boundVars) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_BOUND_VARS(boundVars); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_BOUND_VARS(boundVars); //////// all checks before this line return synthFunHelper( symbol, boundVars, Sort(this, getNodeManager()->booleanType()), true); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::synthInv(const std::string& symbol, const std::vector& boundVars, Grammar& grammar) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_BOUND_VARS(boundVars); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_BOUND_VARS(boundVars); //////// all checks before this line return synthFunHelper(symbol, boundVars, @@ -6674,21 +6674,21 @@ Term Solver::synthInv(const std::string& symbol, true, &grammar); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::addSygusConstraint(const Term& term) const { NodeManagerScope scope(getNodeManager()); - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(term); - CVC4_API_ARG_CHECK_EXPECTED( + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(term); + CVC5_API_ARG_CHECK_EXPECTED( term.d_node->getType() == getNodeManager()->booleanType(), term) << "boolean term"; //////// all checks before this line d_smtEngine->assertSygusConstraint(*term.d_node); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::addSygusInvConstraint(Term inv, @@ -6696,24 +6696,24 @@ void Solver::addSygusInvConstraint(Term inv, Term trans, Term post) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(inv); - CVC4_API_SOLVER_CHECK_TERM(pre); - CVC4_API_SOLVER_CHECK_TERM(trans); - CVC4_API_SOLVER_CHECK_TERM(post); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(inv); + CVC5_API_SOLVER_CHECK_TERM(pre); + CVC5_API_SOLVER_CHECK_TERM(trans); + CVC5_API_SOLVER_CHECK_TERM(post); - CVC4_API_ARG_CHECK_EXPECTED(inv.d_node->getType().isFunction(), inv) + CVC5_API_ARG_CHECK_EXPECTED(inv.d_node->getType().isFunction(), inv) << "a function"; TypeNode invType = inv.d_node->getType(); - CVC4_API_ARG_CHECK_EXPECTED(invType.getRangeType().isBoolean(), inv) + CVC5_API_ARG_CHECK_EXPECTED(invType.getRangeType().isBoolean(), inv) << "boolean range"; - CVC4_API_CHECK(pre.d_node->getType() == invType) + CVC5_API_CHECK(pre.d_node->getType() == invType) << "Expected inv and pre to have the same sort"; - CVC4_API_CHECK(post.d_node->getType() == invType) + CVC5_API_CHECK(post.d_node->getType() == invType) << "Expected inv and post to have the same sort"; //////// all checks before this line @@ -6731,52 +6731,52 @@ void Solver::addSygusInvConstraint(Term inv, expectedTypes.push_back(invType.getRangeType()); TypeNode expectedTransType = getNodeManager()->mkFunctionType(expectedTypes); - CVC4_API_CHECK(trans.d_node->getType() == expectedTransType) + CVC5_API_CHECK(trans.d_node->getType() == expectedTransType) << "Expected trans's sort to be " << invType; d_smtEngine->assertSygusInvConstraint( *inv.d_node, *pre.d_node, *trans.d_node, *post.d_node); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Result Solver::checkSynth() const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line return d_smtEngine->checkSynth(); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } Term Solver::getSynthSolution(Term term) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_SOLVER_CHECK_TERM(term); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_SOLVER_CHECK_TERM(term); std::map map; - CVC4_API_CHECK(d_smtEngine->getSynthSolutions(map)) + CVC5_API_CHECK(d_smtEngine->getSynthSolutions(map)) << "The solver is not in a state immediately preceded by a " "successful call to checkSynth"; std::map::const_iterator it = map.find(*term.d_node); - CVC4_API_CHECK(it != map.cend()) << "Synth solution not found for given term"; + CVC5_API_CHECK(it != map.cend()) << "Synth solution not found for given term"; //////// all checks before this line return Term(this, it->second); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } std::vector Solver::getSynthSolutions( const std::vector& terms) const { - CVC4_API_TRY_CATCH_BEGIN; - CVC4_API_ARG_SIZE_CHECK_EXPECTED(!terms.empty(), terms) << "non-empty vector"; - CVC4_API_SOLVER_CHECK_TERMS(terms); + CVC5_API_TRY_CATCH_BEGIN; + CVC5_API_ARG_SIZE_CHECK_EXPECTED(!terms.empty(), terms) << "non-empty vector"; + CVC5_API_SOLVER_CHECK_TERMS(terms); std::map map; - CVC4_API_CHECK(d_smtEngine->getSynthSolutions(map)) + CVC5_API_CHECK(d_smtEngine->getSynthSolutions(map)) << "The solver is not in a state immediately preceded by a " "successful call to checkSynth"; //////// all checks before this line @@ -6789,7 +6789,7 @@ std::vector Solver::getSynthSolutions( std::map::const_iterator it = map.find(*terms[i].d_node); - CVC4_API_CHECK(it != map.cend()) + CVC5_API_CHECK(it != map.cend()) << "Synth solution not found for term at index " << i; synthSolution.push_back(Term(this, it->second)); @@ -6797,16 +6797,16 @@ std::vector Solver::getSynthSolutions( return synthSolution; //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } void Solver::printSynthSolution(std::ostream& out) const { - CVC4_API_TRY_CATCH_BEGIN; + CVC5_API_TRY_CATCH_BEGIN; //////// all checks before this line d_smtEngine->printSynthSolution(out); //////// - CVC4_API_TRY_CATCH_END; + CVC5_API_TRY_CATCH_END; } /* diff --git a/src/api/cpp/cvc5.h b/src/api/cpp/cvc5.h index d334da109..56b23bf89 100644 --- a/src/api/cpp/cvc5.h +++ b/src/api/cpp/cvc5.h @@ -689,7 +689,7 @@ class CVC4_EXPORT Sort /** * Helper for isNull checks. This prevents calling an API function with - * CVC4_API_CHECK_NOT_NULL + * CVC5_API_CHECK_NOT_NULL */ bool isNullHelper() const; @@ -819,7 +819,7 @@ class CVC4_EXPORT Op /** * Helper for isNull checks. This prevents calling an API function with - * CVC4_API_CHECK_NOT_NULL + * CVC5_API_CHECK_NOT_NULL */ bool isNullHelper() const; @@ -1216,7 +1216,7 @@ class CVC4_EXPORT Term /** * Helper for isNull checks. This prevents calling an API function with - * CVC4_API_CHECK_NOT_NULL + * CVC5_API_CHECK_NOT_NULL */ bool isNullHelper() const; @@ -1382,7 +1382,7 @@ class CVC4_EXPORT DatatypeConstructorDecl /** * Helper for isNull checks. This prevents calling an API function with - * CVC4_API_CHECK_NOT_NULL + * CVC5_API_CHECK_NOT_NULL */ bool isNullHelper() const; @@ -1488,7 +1488,7 @@ class CVC4_EXPORT DatatypeDecl /** * Helper for isNull checks. This prevents calling an API function with - * CVC4_API_CHECK_NOT_NULL + * CVC5_API_CHECK_NOT_NULL */ bool isNullHelper() const; @@ -1558,7 +1558,7 @@ class CVC4_EXPORT DatatypeSelector /** * Helper for isNull checks. This prevents calling an API function with - * CVC4_API_CHECK_NOT_NULL + * CVC5_API_CHECK_NOT_NULL */ bool isNullHelper() const; @@ -1785,7 +1785,7 @@ class CVC4_EXPORT DatatypeConstructor /** * Helper for isNull checks. This prevents calling an API function with - * CVC4_API_CHECK_NOT_NULL + * CVC5_API_CHECK_NOT_NULL */ bool isNullHelper() const; @@ -2007,7 +2007,7 @@ class CVC4_EXPORT Datatype /** * Helper for isNull checks. This prevents calling an API function with - * CVC4_API_CHECK_NOT_NULL + * CVC5_API_CHECK_NOT_NULL */ bool isNullHelper() const; diff --git a/src/api/cpp/cvc5_checks.h b/src/api/cpp/cvc5_checks.h index 02ab7d39f..f210dddf6 100644 --- a/src/api/cpp/cvc5_checks.h +++ b/src/api/cpp/cvc5_checks.h @@ -30,16 +30,16 @@ namespace api { * The base check macro. * Throws a CVC4ApiException if 'cond' is false. */ -#define CVC4_API_CHECK(cond) \ - CVC4_PREDICT_TRUE(cond) \ +#define CVC5_API_CHECK(cond) \ + CVC5_PREDICT_TRUE(cond) \ ? (void)0 : OstreamVoider() & CVC4ApiExceptionStream().ostream() /** * The base check macro for throwing recoverable exceptions. * Throws a CVC4RecoverableApiException if 'cond' is false. */ -#define CVC4_API_RECOVERABLE_CHECK(cond) \ - CVC4_PREDICT_TRUE(cond) \ +#define CVC5_API_RECOVERABLE_CHECK(cond) \ + CVC5_PREDICT_TRUE(cond) \ ? (void)0 : OstreamVoider() & CVC4ApiRecoverableExceptionStream().ostream() /* -------------------------------------------------------------------------- */ @@ -47,25 +47,25 @@ namespace api { /* -------------------------------------------------------------------------- */ /** Check it 'this' is not a null object. */ -#define CVC4_API_CHECK_NOT_NULL \ - CVC4_API_CHECK(!isNullHelper()) \ +#define CVC5_API_CHECK_NOT_NULL \ + CVC5_API_CHECK(!isNullHelper()) \ << "Invalid call to '" << __PRETTY_FUNCTION__ \ << "', expected non-null object"; /** Check if given argument is not a null object. */ -#define CVC4_API_ARG_CHECK_NOT_NULL(arg) \ - CVC4_API_CHECK(!arg.isNull()) << "Invalid null argument for '" << #arg << "'"; +#define CVC5_API_ARG_CHECK_NOT_NULL(arg) \ + CVC5_API_CHECK(!arg.isNull()) << "Invalid null argument for '" << #arg << "'"; /** Check if given argument is not a null pointer. */ -#define CVC4_API_ARG_CHECK_NOT_NULLPTR(arg) \ - CVC4_API_CHECK(arg != nullptr) \ +#define CVC5_API_ARG_CHECK_NOT_NULLPTR(arg) \ + CVC5_API_CHECK(arg != nullptr) \ << "Invalid null argument for '" << #arg << "'"; /** * Check if given argument at given index in container 'args' is not a null * object. */ -#define CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL(what, arg, args, idx) \ - CVC4_API_CHECK(!arg.isNull()) << "Invalid null " << (what) << " in '" \ +#define CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL(what, arg, args, idx) \ + CVC5_API_CHECK(!arg.isNull()) << "Invalid null " << (what) << " in '" \ << #args << "' at index " << (idx); /* -------------------------------------------------------------------------- */ @@ -73,8 +73,8 @@ namespace api { /* -------------------------------------------------------------------------- */ /** Check if given kind is a valid kind. */ -#define CVC4_API_KIND_CHECK(kind) \ - CVC4_API_CHECK(isDefinedKind(kind)) \ +#define CVC5_API_KIND_CHECK(kind) \ + CVC5_API_CHECK(isDefinedKind(kind)) \ << "Invalid kind '" << kindToString(kind) << "'"; /** @@ -82,8 +82,8 @@ namespace api { * Creates a stream to provide a message that identifies what kind was expected * if given kind is invalid. */ -#define CVC4_API_KIND_CHECK_EXPECTED(cond, kind) \ - CVC4_PREDICT_TRUE(cond) \ +#define CVC5_API_KIND_CHECK_EXPECTED(cond, kind) \ + CVC5_PREDICT_TRUE(cond) \ ? (void)0 \ : OstreamVoider() \ & CVC4ApiExceptionStream().ostream() \ @@ -98,8 +98,8 @@ namespace api { * Creates a stream to provide a message that identifies what was expected to * hold if condition is false and throws a non-recoverable exception. */ -#define CVC4_API_ARG_CHECK_EXPECTED(cond, arg) \ - CVC4_PREDICT_TRUE(cond) \ +#define CVC5_API_ARG_CHECK_EXPECTED(cond, arg) \ + CVC5_PREDICT_TRUE(cond) \ ? (void)0 \ : OstreamVoider() \ & CVC4ApiExceptionStream().ostream() \ @@ -111,8 +111,8 @@ namespace api { * Creates a stream to provide a message that identifies what was expected to * hold if condition is false and throws a recoverable exception. */ -#define CVC4_API_RECOVERABLE_ARG_CHECK_EXPECTED(cond, arg) \ - CVC4_PREDICT_TRUE(cond) \ +#define CVC5_API_RECOVERABLE_ARG_CHECK_EXPECTED(cond, arg) \ + CVC5_PREDICT_TRUE(cond) \ ? (void)0 \ : OstreamVoider() \ & CVC4ApiRecoverableExceptionStream().ostream() \ @@ -121,13 +121,13 @@ namespace api { /** * Check condition 'cond' for given argument 'arg'. - * Provides a more specific error message than CVC4_API_ARG_CHECK_EXPECTED, + * Provides a more specific error message than CVC5_API_ARG_CHECK_EXPECTED, * it identifies that this check is a size check. * Creates a stream to provide a message that identifies what was expected to * hold if condition is false and throws a recoverable exception. */ -#define CVC4_API_ARG_SIZE_CHECK_EXPECTED(cond, arg) \ - CVC4_PREDICT_TRUE(cond) \ +#define CVC5_API_ARG_SIZE_CHECK_EXPECTED(cond, arg) \ + CVC5_PREDICT_TRUE(cond) \ ? (void)0 \ : OstreamVoider() \ & CVC4ApiExceptionStream().ostream() \ @@ -139,11 +139,11 @@ namespace api { * Creates a stream to provide a message that identifies what was expected to * hold if condition is false. * Usage: - * CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( + * CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( * , "what", , ) << "message"; */ -#define CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED(cond, what, args, idx) \ - CVC4_PREDICT_TRUE(cond) \ +#define CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED(cond, what, args, idx) \ + CVC5_PREDICT_TRUE(cond) \ ? (void)0 \ : OstreamVoider() \ & CVC4ApiExceptionStream().ostream() \ @@ -159,8 +159,8 @@ namespace api { * Check if given solver matches the solver object this object is associated * with. */ -#define CVC4_API_ARG_CHECK_SOLVER(what, arg) \ - CVC4_API_CHECK(this->d_solver == arg.d_solver) \ +#define CVC5_API_ARG_CHECK_SOLVER(what, arg) \ + CVC5_API_CHECK(this->d_solver == arg.d_solver) \ << "Given " << (what) << " is not associated with the solver this " \ << "object is associated with"; @@ -173,11 +173,11 @@ namespace api { * Check if given sort is not null and associated with the solver object this * object is associated with. */ -#define CVC4_API_CHECK_SORT(sort) \ +#define CVC5_API_CHECK_SORT(sort) \ do \ { \ - CVC4_API_ARG_CHECK_NOT_NULL(sort); \ - CVC4_API_ARG_CHECK_SOLVER("sort", sort); \ + CVC5_API_ARG_CHECK_NOT_NULL(sort); \ + CVC5_API_ARG_CHECK_SOLVER("sort", sort); \ } while (0) /** @@ -185,14 +185,14 @@ namespace api { * Check if each sort in the given container of sorts is not null and * associated with the solver object this object is associated with. */ -#define CVC4_API_CHECK_SORTS(sorts) \ +#define CVC5_API_CHECK_SORTS(sorts) \ do \ { \ size_t i = 0; \ for (const auto& s : sorts) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("sort", s, sorts, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("sort", s, sorts, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this->d_solver == s.d_solver, "sort", sorts, i) \ << "a sort associated with the solver this object is associated " \ "with"; \ @@ -209,11 +209,11 @@ namespace api { * Check if given term is not null and associated with the solver object this * object is associated with. */ -#define CVC4_API_CHECK_TERM(term) \ +#define CVC5_API_CHECK_TERM(term) \ do \ { \ - CVC4_API_ARG_CHECK_NOT_NULL(term); \ - CVC4_API_ARG_CHECK_SOLVER("term", term); \ + CVC5_API_ARG_CHECK_NOT_NULL(term); \ + CVC5_API_ARG_CHECK_SOLVER("term", term); \ } while (0) /** @@ -221,14 +221,14 @@ namespace api { * Check if each term in the given container of terms is not null and * associated with the solver object this object is associated with. */ -#define CVC4_API_CHECK_TERMS(terms) \ +#define CVC5_API_CHECK_TERMS(terms) \ do \ { \ size_t i = 0; \ for (const auto& s : terms) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", s, terms, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", s, terms, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this->d_solver == s.d_solver, "term", terms, i) \ << "a term associated with the solver this object is associated " \ "with"; \ @@ -242,19 +242,19 @@ namespace api { * not null and associated with the solver object this object is associated * with. */ -#define CVC4_API_CHECK_TERMS_MAP(map) \ +#define CVC5_API_CHECK_TERMS_MAP(map) \ do \ { \ size_t i = 0; \ for (const auto& p : map) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", p.first, map, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", p.first, map, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this->d_solver == p.first.d_solver, "term", map, i) \ << "a term associated with the solver this object is associated " \ "with"; \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("sort", p.second, map, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("sort", p.second, map, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this->d_solver == p.second.d_solver, "sort", map, i) \ << "a sort associated with the solver this object is associated " \ "with"; \ @@ -267,18 +267,18 @@ namespace api { * Check if each term in the given container is not null, associated with the * solver object this object is associated with, and of the given sort. */ -#define CVC4_API_CHECK_TERMS_WITH_SORT(terms, sort) \ +#define CVC5_API_CHECK_TERMS_WITH_SORT(terms, sort) \ do \ { \ size_t i = 0; \ for (const auto& t : terms) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", t, terms, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", t, terms, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this->d_solver == t.d_solver, "term", terms, i) \ << "a term associated with the solver this object is associated " \ "with"; \ - CVC4_API_CHECK(t.getSort() == sort) \ + CVC5_API_CHECK(t.getSort() == sort) \ << "Expected term with sort " << sort << " at index " << i << " in " \ << #terms; \ i += 1; \ @@ -291,24 +291,24 @@ namespace api { * the solver object this object is associated with, and their sorts are * pairwise comparable to. */ -#define CVC4_API_TERM_CHECK_TERMS_WITH_TERMS_COMPARABLE_TO(terms1, terms2) \ +#define CVC5_API_TERM_CHECK_TERMS_WITH_TERMS_COMPARABLE_TO(terms1, terms2) \ do \ { \ size_t i = 0; \ for (const auto& t1 : terms1) \ { \ const auto& t2 = terms2[i]; \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", t1, terms1, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", t1, terms1, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this->d_solver == t1.d_solver, "term", terms1, i) \ << "a term associated with the solver this object is associated " \ "with"; \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", t2, terms2, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", t2, terms2, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this->d_solver == t2.d_solver, "term", terms2, i) \ << "a term associated with the solver this object is associated " \ "with"; \ - CVC4_API_CHECK(t1.getSort().isComparableTo(t2.getSort())) \ + CVC5_API_CHECK(t1.getSort().isComparableTo(t2.getSort())) \ << "Expecting terms of comparable sort at index " << i; \ i += 1; \ } \ @@ -323,11 +323,11 @@ namespace api { * Check if given datatype declaration is not null and associated with the * solver object this DatatypeDecl object is associated with. */ -#define CVC4_API_CHECK_DTDECL(decl) \ +#define CVC5_API_CHECK_DTDECL(decl) \ do \ { \ - CVC4_API_ARG_CHECK_NOT_NULL(decl); \ - CVC4_API_ARG_CHECK_SOLVER("datatype declaration", decl); \ + CVC5_API_ARG_CHECK_NOT_NULL(decl); \ + CVC5_API_ARG_CHECK_SOLVER("datatype declaration", decl); \ } while (0) /* -------------------------------------------------------------------------- */ @@ -340,11 +340,11 @@ namespace api { * Sort checks for member functions of class Solver. * Check if given sort is not null and associated with this solver. */ -#define CVC4_API_SOLVER_CHECK_SORT(sort) \ +#define CVC5_API_SOLVER_CHECK_SORT(sort) \ do \ { \ - CVC4_API_ARG_CHECK_NOT_NULL(sort); \ - CVC4_API_CHECK(this == sort.d_solver) \ + CVC5_API_ARG_CHECK_NOT_NULL(sort); \ + CVC5_API_CHECK(this == sort.d_solver) \ << "Given sort is not associated with this solver"; \ } while (0) @@ -353,14 +353,14 @@ namespace api { * Check if each sort in the given container of sorts is not null and * associated with this solver. */ -#define CVC4_API_SOLVER_CHECK_SORTS(sorts) \ +#define CVC5_API_SOLVER_CHECK_SORTS(sorts) \ do \ { \ size_t i = 0; \ for (const auto& s : sorts) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("sorts", s, sorts, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("sorts", s, sorts, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this == s.d_solver, "sort", sorts, i) \ << "a sort associated with this solver"; \ i += 1; \ @@ -372,17 +372,17 @@ namespace api { * Check if each sort in the given container of sorts is not null, associated * with this solver, and not function-like. */ -#define CVC4_API_SOLVER_CHECK_SORTS_NOT_FUNCTION_LIKE(sorts) \ +#define CVC5_API_SOLVER_CHECK_SORTS_NOT_FUNCTION_LIKE(sorts) \ do \ { \ size_t i = 0; \ for (const auto& s : sorts) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("sorts", s, sorts, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("sorts", s, sorts, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this == s.d_solver, "sort", sorts, i) \ << "a sorts associated with this solver"; \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ !s.isFunctionLike(), "sort", sorts, i) \ << "non-function-like sort"; \ i += 1; \ @@ -394,14 +394,14 @@ namespace api { * Check if domain sort is not null, associated with this solver, and a * first-class sort. */ -#define CVC4_API_SOLVER_CHECK_DOMAIN_SORT(sort) \ - do \ - { \ - CVC4_API_ARG_CHECK_NOT_NULL(sort); \ - CVC4_API_CHECK(this == sort.d_solver) \ - << "Given sort is not associated with this solver"; \ - CVC4_API_ARG_CHECK_EXPECTED(sort.isFirstClass(), sort) \ - << "first-class sort as domain sort"; \ +#define CVC5_API_SOLVER_CHECK_DOMAIN_SORT(sort) \ + do \ + { \ + CVC5_API_ARG_CHECK_NOT_NULL(sort); \ + CVC5_API_CHECK(this == sort.d_solver) \ + << "Given sort is not associated with this solver"; \ + CVC5_API_ARG_CHECK_EXPECTED(sort.isFirstClass(), sort) \ + << "first-class sort as domain sort"; \ } while (0) /** @@ -409,21 +409,21 @@ namespace api { * Check if each domain sort in the given container of sorts is not null, * associated with this solver, and a first-class sort. */ -#define CVC4_API_SOLVER_CHECK_DOMAIN_SORTS(sorts) \ - do \ - { \ - size_t i = 0; \ - for (const auto& s : sorts) \ - { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("domain sort", s, sorts, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ - this == s.d_solver, "domain sort", sorts, i) \ - << "a sort associated with this solver object"; \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ - s.isFirstClass(), "domain sort", sorts, i) \ - << "first-class sort as domain sort"; \ - i += 1; \ - } \ +#define CVC5_API_SOLVER_CHECK_DOMAIN_SORTS(sorts) \ + do \ + { \ + size_t i = 0; \ + for (const auto& s : sorts) \ + { \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("domain sort", s, sorts, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + this == s.d_solver, "domain sort", sorts, i) \ + << "a sort associated with this solver object"; \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + s.isFirstClass(), "domain sort", sorts, i) \ + << "first-class sort as domain sort"; \ + i += 1; \ + } \ } while (0) /** @@ -431,15 +431,15 @@ namespace api { * Check if codomain sort is not null, associated with this solver, and a * first-class, non-function sort. */ -#define CVC4_API_SOLVER_CHECK_CODOMAIN_SORT(sort) \ +#define CVC5_API_SOLVER_CHECK_CODOMAIN_SORT(sort) \ do \ { \ - CVC4_API_ARG_CHECK_NOT_NULL(sort); \ - CVC4_API_CHECK(this == sort.d_solver) \ + CVC5_API_ARG_CHECK_NOT_NULL(sort); \ + CVC5_API_CHECK(this == sort.d_solver) \ << "Given sort is not associated with this solver"; \ - CVC4_API_ARG_CHECK_EXPECTED(sort.isFirstClass(), sort) \ + CVC5_API_ARG_CHECK_EXPECTED(sort.isFirstClass(), sort) \ << "first-class sort as codomain sort"; \ - CVC4_API_ARG_CHECK_EXPECTED(!sort.isFunction(), sort) \ + CVC5_API_ARG_CHECK_EXPECTED(!sort.isFunction(), sort) \ << "function sort as codomain sort"; \ } while (0) @@ -449,11 +449,11 @@ namespace api { * Term checks for member functions of class Solver. * Check if given term is not null and associated with this solver. */ -#define CVC4_API_SOLVER_CHECK_TERM(term) \ +#define CVC5_API_SOLVER_CHECK_TERM(term) \ do \ { \ - CVC4_API_ARG_CHECK_NOT_NULL(term); \ - CVC4_API_CHECK(this == term.d_solver) \ + CVC5_API_ARG_CHECK_NOT_NULL(term); \ + CVC5_API_CHECK(this == term.d_solver) \ << "Given term is not associated with this solver"; \ } while (0) @@ -462,14 +462,14 @@ namespace api { * Check if each term in the given container of terms is not null and * associated with this solver. */ -#define CVC4_API_SOLVER_CHECK_TERMS(terms) \ +#define CVC5_API_SOLVER_CHECK_TERMS(terms) \ do \ { \ size_t i = 0; \ for (const auto& t : terms) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("terms", t, terms, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("terms", t, terms, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this == t.d_solver, "term", terms, i) \ << "a term associated with this solver"; \ i += 1; \ @@ -481,11 +481,11 @@ namespace api { * Check if given term is not null, associated with this solver, and of given * sort. */ -#define CVC4_API_SOLVER_CHECK_TERM_WITH_SORT(term, sort) \ +#define CVC5_API_SOLVER_CHECK_TERM_WITH_SORT(term, sort) \ do \ { \ - CVC4_API_SOLVER_CHECK_TERM(term); \ - CVC4_API_CHECK(term.getSort() == sort) \ + CVC5_API_SOLVER_CHECK_TERM(term); \ + CVC5_API_CHECK(term.getSort() == sort) \ << "Expected term with sort " << sort; \ } while (0) @@ -494,17 +494,17 @@ namespace api { * Check if each term in the given container is not null, associated with this * solver, and of the given sort. */ -#define CVC4_API_SOLVER_CHECK_TERMS_WITH_SORT(terms, sort) \ +#define CVC5_API_SOLVER_CHECK_TERMS_WITH_SORT(terms, sort) \ do \ { \ size_t i = 0; \ for (const auto& t : terms) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", t, terms, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL("term", t, terms, i); \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this == t.d_solver, "term", terms, i) \ << "a term associated with this solver"; \ - CVC4_API_CHECK(t.getSort() == sort) \ + CVC5_API_CHECK(t.getSort() == sort) \ << "Expected term with sort " << sort << " at index " << i << " in " \ << #terms; \ i += 1; \ @@ -516,18 +516,18 @@ namespace api { * Check if each term in the given container is not null, associated with this * solver, and a bound variable. */ -#define CVC4_API_SOLVER_CHECK_BOUND_VARS(bound_vars) \ +#define CVC5_API_SOLVER_CHECK_BOUND_VARS(bound_vars) \ do \ { \ size_t i = 0; \ for (const auto& bv : bound_vars) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL( \ "bound variable", bv, bound_vars, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this == bv.d_solver, "bound variable", bound_vars, i) \ << "a term associated with this solver object"; \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ bv.d_node->getKind() == cvc5::Kind::BOUND_VARIABLE, \ "bound variable", \ bound_vars, \ @@ -544,33 +544,33 @@ namespace api { * solver, a bound variable, matches theh corresponding sort in 'domain_sorts', * and is a first-class term. */ -#define CVC4_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN( \ +#define CVC5_API_SOLVER_CHECK_BOUND_VARS_DEF_FUN( \ fun, bound_vars, domain_sorts) \ do \ { \ size_t size = bound_vars.size(); \ - CVC4_API_ARG_SIZE_CHECK_EXPECTED(size == domain_sorts.size(), bound_vars) \ + CVC5_API_ARG_SIZE_CHECK_EXPECTED(size == domain_sorts.size(), bound_vars) \ << "'" << domain_sorts.size() << "'"; \ size_t i = 0; \ for (const auto& bv : bound_vars) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL( \ "bound variable", bv, bound_vars, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this == bv.d_solver, "bound variable", bound_vars, i) \ << "a term associated with this solver object"; \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ bv.d_node->getKind() == cvc5::Kind::BOUND_VARIABLE, \ "bound variable", \ bound_vars, \ i) \ << "a bound variable"; \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ domain_sorts[i] == bound_vars[i].getSort(), \ "sort of parameter", \ bound_vars, \ i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ domain_sorts[i].isFirstClass(), "domain sort", domain_sorts, i) \ << "first-class sort of parameter of defined function"; \ i += 1; \ @@ -583,11 +583,11 @@ namespace api { * Op checks for member functions of class Solver. * Check if given operator is not null and associated with this solver. */ -#define CVC4_API_SOLVER_CHECK_OP(op) \ +#define CVC5_API_SOLVER_CHECK_OP(op) \ do \ { \ - CVC4_API_ARG_CHECK_NOT_NULL(op); \ - CVC4_API_CHECK(this == op.d_solver) \ + CVC5_API_ARG_CHECK_NOT_NULL(op); \ + CVC5_API_CHECK(this == op.d_solver) \ << "Given operator is not associated with this solver"; \ } while (0) @@ -598,13 +598,13 @@ namespace api { * Check if given datatype declaration is not null and associated with this * solver. */ -#define CVC4_API_SOLVER_CHECK_DTDECL(decl) \ +#define CVC5_API_SOLVER_CHECK_DTDECL(decl) \ do \ { \ - CVC4_API_ARG_CHECK_NOT_NULL(decl); \ - CVC4_API_CHECK(this == decl.d_solver) \ + CVC5_API_ARG_CHECK_NOT_NULL(decl); \ + CVC5_API_CHECK(this == decl.d_solver) \ << "Given datatype declaration is not associated with this solver"; \ - CVC4_API_ARG_CHECK_EXPECTED(dtypedecl.getNumConstructors() > 0, dtypedecl) \ + CVC5_API_ARG_CHECK_EXPECTED(dtypedecl.getNumConstructors() > 0, dtypedecl) \ << "a datatype declaration with at least one constructor"; \ } while (0) @@ -613,18 +613,18 @@ namespace api { * Check if each datatype declaration in the given container of declarations is * not null and associated with this solver. */ -#define CVC4_API_SOLVER_CHECK_DTDECLS(decls) \ +#define CVC5_API_SOLVER_CHECK_DTDECLS(decls) \ do \ { \ size_t i = 0; \ for (const auto& d : decls) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL( \ "datatype declaration", d, decls, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this == d.d_solver, "datatype declaration", decls, i) \ << "a datatype declaration associated with this solver"; \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ d.getNumConstructors() > 0, "datatype declaration", decls, i) \ << "a datatype declaration with at least one constructor"; \ i += 1; \ @@ -636,15 +636,15 @@ namespace api { * Check if each datatype constructor declaration in the given container of * declarations is not null and associated with this solver. */ -#define CVC4_API_SOLVER_CHECK_DTCTORDECLS(decls) \ +#define CVC5_API_SOLVER_CHECK_DTCTORDECLS(decls) \ do \ { \ size_t i = 0; \ for (const auto& d : decls) \ { \ - CVC4_API_ARG_AT_INDEX_CHECK_NOT_NULL( \ + CVC5_API_ARG_AT_INDEX_CHECK_NOT_NULL( \ "datatype constructor declaration", d, decls, i); \ - CVC4_API_ARG_AT_INDEX_CHECK_EXPECTED( \ + CVC5_API_ARG_AT_INDEX_CHECK_EXPECTED( \ this == d.d_solver, "datatype constructor declaration", decls, i) \ << "a datatype constructor declaration associated with this solver " \ "object"; \ diff --git a/src/api/python/CMakeLists.txt b/src/api/python/CMakeLists.txt index da28fc328..c68cdc95d 100644 --- a/src/api/python/CMakeLists.txt +++ b/src/api/python/CMakeLists.txt @@ -73,17 +73,17 @@ python_extension_module(pycvc4) # Installation based on https://bloerg.net/2012/11/10/cmake-and-distutils.html # Create a wrapper python directory and generate a distutils setup.py file configure_file(setup.py.in setup.py) -set(PYCVC4_MODULE "${CMAKE_CURRENT_BINARY_DIR}/pycvc4") -file(MAKE_DIRECTORY "${PYCVC4_MODULE}") -file(WRITE ${PYCVC4_MODULE}/__init__.py +set(PYCVC5_MODULE "${CMAKE_CURRENT_BINARY_DIR}/pycvc4") +file(MAKE_DIRECTORY "${PYCVC5_MODULE}") +file(WRITE ${PYCVC5_MODULE}/__init__.py "import sys from .pycvc4 import * # fake a submodule for dotted imports, e.g. from pycvc4.kinds import * sys.modules['%s.%s'%(__name__, kinds.__name__)] = kinds") -set(PYCVC4_LOC "${PYCVC4_MODULE}/$") +set(PYCVC5_LOC "${PYCVC5_MODULE}/$") add_custom_command(TARGET pycvc4 POST_BUILD - COMMAND ${CMAKE_COMMAND} -E rename $ ${PYCVC4_LOC} + COMMAND ${CMAKE_COMMAND} -E rename $ ${PYCVC5_LOC} ) # figure out if we're in a virtualenv diff --git a/src/api/python/setup.py.in b/src/api/python/setup.py.in index 157196ebf..45d96dfd7 100644 --- a/src/api/python/setup.py.in +++ b/src/api/python/setup.py.in @@ -34,7 +34,7 @@ class PyCVC4Install(install): c.run() setup(name='pycvc4', - version='${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}', + version='${CVC5_MAJOR}.${CVC5_MINOR}.${CVC4_RELEASE}', packages=['pycvc4'], package_dir={'pycvc4': '${CMAKE_CURRENT_BINARY_DIR}/pycvc4'}, package_data={'pycvc4': ['pycvc4.so']}, diff --git a/src/base/check.cpp b/src/base/check.cpp index 3ecdb0287..4bbe8df57 100644 --- a/src/base/check.cpp +++ b/src/base/check.cpp @@ -98,7 +98,7 @@ void AssertArgumentException::construct(const char* header, setMessage(std::string(buf)); -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG LastExceptionBuffer* buffer = LastExceptionBuffer::getCurrent(); if (buffer != NULL) { @@ -107,7 +107,7 @@ void AssertArgumentException::construct(const char* header, buffer->setContents(buf); } } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ delete[] buf; } @@ -157,7 +157,7 @@ void AssertArgumentException::construct(const char* header, setMessage(std::string(buf)); -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG LastExceptionBuffer* buffer = LastExceptionBuffer::getCurrent(); if (buffer != NULL) { @@ -166,7 +166,7 @@ void AssertArgumentException::construct(const char* header, buffer->setContents(buf); } } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ delete[] buf; } diff --git a/src/base/check.h b/src/base/check.h index 91184336b..19329f14f 100644 --- a/src/base/check.h +++ b/src/base/check.h @@ -22,7 +22,7 @@ ** Assert is a AlwaysAssert that is only enabled in debug builds. ** Assert(pointer != nullptr); ** - ** CVC4_FATAL() can be used to indicate unreachable code. + ** CVC5_FATAL() can be used to indicate unreachable code. ** ** The AlwaysAssert and Assert macros are not safe for use in ** signal-handling code. In future, a a signal-handling safe version of @@ -40,39 +40,39 @@ #include "base/exception.h" #include "cvc4_export.h" -// Define CVC4_NO_RETURN macro replacement for [[noreturn]]. +// Define CVC5_NO_RETURN macro replacement for [[noreturn]]. #if defined(SWIG) -#define CVC4_NO_RETURN +#define CVC5_NO_RETURN // SWIG does not yet support [[noreturn]] so emit nothing instead. #else -#define CVC4_NO_RETURN [[noreturn]] +#define CVC5_NO_RETURN [[noreturn]] // Not checking for whether the compiler supports [[noreturn]] using // __has_cpp_attribute as GCC 4.8 is too widespread and does not support this. // We instead assume this is C++11 (or later) and [[noreturn]] is available. #endif // defined(SWIG) -// Define CVC4_PREDICT_FALSE(x) that helps the compiler predict that x will be +// Define CVC5_PREDICT_FALSE(x) that helps the compiler predict that x will be // false (if there is compiler support). #ifdef __has_builtin #if __has_builtin(__builtin_expect) -#define CVC4_PREDICT_FALSE(x) (__builtin_expect(x, false)) -#define CVC4_PREDICT_TRUE(x) (__builtin_expect(x, true)) +#define CVC5_PREDICT_FALSE(x) (__builtin_expect(x, false)) +#define CVC5_PREDICT_TRUE(x) (__builtin_expect(x, true)) #else -#define CVC4_PREDICT_FALSE(x) x -#define CVC4_PREDICT_TRUE(x) x +#define CVC5_PREDICT_FALSE(x) x +#define CVC5_PREDICT_TRUE(x) x #endif #else -#define CVC4_PREDICT_FALSE(x) x -#define CVC4_PREDICT_TRUE(x) x +#define CVC5_PREDICT_FALSE(x) x +#define CVC5_PREDICT_TRUE(x) x #endif #ifdef __has_cpp_attribute #if __has_cpp_attribute(fallthrough) -#define CVC4_FALLTHROUGH [[fallthrough]] +#define CVC5_FALLTHROUGH [[fallthrough]] #endif // __has_cpp_attribute(fallthrough) #endif // __has_cpp_attribute -#ifndef CVC4_FALLTHROUGH -#define CVC4_FALLTHROUGH +#ifndef CVC5_FALLTHROUGH +#define CVC5_FALLTHROUGH #endif namespace cvc5 { @@ -96,7 +96,7 @@ class CVC4_EXPORT FatalStream { public: FatalStream(const char* function, const char* file, int line); - CVC4_NO_RETURN ~FatalStream(); + CVC5_NO_RETURN ~FatalStream(); std::ostream& stream(); @@ -114,7 +114,7 @@ class OstreamVoider void operator&(std::ostream&) {} }; -// CVC4_FATAL() always aborts a function and provides a convenient way of +// CVC5_FATAL() always aborts a function and provides a convenient way of // formatting error messages. This can be used instead of a return type. // // Example function that returns a type Foo: @@ -122,13 +122,13 @@ class OstreamVoider // switch(t.type()) { // ... // default: -// CVC4_FATAL() << "Unknown T type " << t.enum(); +// CVC5_FATAL() << "Unknown T type " << t.enum(); // } // } -#define CVC4_FATAL() \ +#define CVC5_FATAL() \ FatalStream(__PRETTY_FUNCTION__, __FILE__, __LINE__).stream() -/* GCC <= 9.2 ignores CVC4_NO_RETURN of ~FatalStream() if +/* GCC <= 9.2 ignores CVC5_NO_RETURN of ~FatalStream() if * used in template classes (e.g., CDHashMap::save()). As a workaround we * explicitly call abort() to let the compiler know that the * corresponding function call will not return. */ @@ -137,8 +137,8 @@ class OstreamVoider // If `cond` is true, log an error message and abort the process. // Otherwise, does nothing. This leaves a hanging std::ostream& that can be // inserted into. -#define CVC4_FATAL_IF(cond, function, file, line) \ - CVC4_PREDICT_FALSE(!(cond)) \ +#define CVC5_FATAL_IF(cond, function, file, line) \ + CVC5_PREDICT_FALSE(!(cond)) \ ? (void)0 : OstreamVoider() & FatalStream(function, file, line).stream() // If `cond` is false, log an error message and abort()'s the process. @@ -149,16 +149,16 @@ class OstreamVoider // AlwaysAssert(x >= 0) << "expected a positive value. Got " << x << " // instead"; #define AlwaysAssert(cond) \ - CVC4_FATAL_IF(!(cond), __PRETTY_FUNCTION__, __FILE__, __LINE__) \ + CVC5_FATAL_IF(!(cond), __PRETTY_FUNCTION__, __FILE__, __LINE__) \ << "Check failure\n\n " << #cond << "\n" // Assert is a variant of AlwaysAssert() that is only checked when -// CVC4_ASSERTIONS is defined. We rely on the optimizer to remove the deadcode. -#ifdef CVC4_ASSERTIONS +// CVC5_ASSERTIONS is defined. We rely on the optimizer to remove the deadcode. +#ifdef CVC5_ASSERTIONS #define Assert(cond) AlwaysAssert(cond) #else #define Assert(cond) \ - CVC4_FATAL_IF(false, __PRETTY_FUNCTION__, __FILE__, __LINE__) + CVC5_FATAL_IF(false, __PRETTY_FUNCTION__, __FILE__, __LINE__) #endif class AssertArgumentException : public Exception @@ -197,13 +197,13 @@ class AssertArgumentException : public Exception }; /* class AssertArgumentException */ -#define Unreachable() CVC4_FATAL() << "Unreachable code reached" +#define Unreachable() CVC5_FATAL() << "Unreachable code reached" -#define Unhandled() CVC4_FATAL() << "Unhandled case encountered" +#define Unhandled() CVC5_FATAL() << "Unhandled case encountered" -#define Unimplemented() CVC4_FATAL() << "Unimplemented code encountered" +#define Unimplemented() CVC5_FATAL() << "Unimplemented code encountered" -#define InternalError() CVC4_FATAL() << "Internal error detected" +#define InternalError() CVC5_FATAL() << "Internal error detected" #define IllegalArgument(arg, msg...) \ throw ::cvc5::IllegalArgumentException( \ @@ -235,15 +235,15 @@ class AssertArgumentException : public Exception } \ } while (0) -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS #define AssertArgument(cond, arg, msg...) AlwaysAssertArgument(cond, arg, ##msg) #define DebugCheckArgument(cond, arg, msg...) CheckArgument(cond, arg, ##msg) -#else /* ! CVC4_ASSERTIONS */ +#else /* ! CVC5_ASSERTIONS */ #define AssertArgument(cond, arg, msg...) /*__builtin_expect( ( cond ), true \ )*/ #define DebugCheckArgument( \ cond, arg, msg...) /*__builtin_expect( ( cond ), true )*/ -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ } // namespace cvc5 diff --git a/src/base/configuration.cpp b/src/base/configuration.cpp index 561500a16..74bcdc57f 100644 --- a/src/base/configuration.cpp +++ b/src/base/configuration.cpp @@ -26,21 +26,19 @@ #include "cvc4autoconfig.h" #include "base/configuration_private.h" -#if defined(CVC4_DEBUG) && defined(CVC4_TRACING) +#if defined(CVC5_DEBUG) && defined(CVC5_TRACING) # include "base/Debug_tags.h" -#endif /* CVC4_DEBUG && CVC4_TRACING */ +#endif /* CVC5_DEBUG && CVC5_TRACING */ -#ifdef CVC4_TRACING +#ifdef CVC5_TRACING # include "base/Trace_tags.h" -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ using namespace std; namespace cvc5 { -string Configuration::getName() { - return CVC4_PACKAGE_NAME; -} +string Configuration::getName() { return CVC5_PACKAGE_NAME; } bool Configuration::isDebugBuild() { return IS_DEBUG_BUILD; @@ -82,36 +80,24 @@ bool Configuration::isCompetitionBuild() { bool Configuration::isStaticBuild() { -#if defined(CVC4_STATIC_BUILD) +#if defined(CVC5_STATIC_BUILD) return true; #else return false; #endif } -string Configuration::getPackageName() { - return CVC4_PACKAGE_NAME; -} +string Configuration::getPackageName() { return CVC5_PACKAGE_NAME; } -string Configuration::getVersionString() { - return CVC4_RELEASE_STRING; -} +string Configuration::getVersionString() { return CVC5_RELEASE_STRING; } -unsigned Configuration::getVersionMajor() { - return CVC4_MAJOR; -} +unsigned Configuration::getVersionMajor() { return CVC5_MAJOR; } -unsigned Configuration::getVersionMinor() { - return CVC4_MINOR; -} +unsigned Configuration::getVersionMinor() { return CVC5_MINOR; } -unsigned Configuration::getVersionRelease() { - return CVC4_RELEASE; -} +unsigned Configuration::getVersionRelease() { return CVC5_RELEASE; } -std::string Configuration::getVersionExtra() { - return CVC4_EXTRAVERSION; -} +std::string Configuration::getVersionExtra() { return CVC5_EXTRAVERSION; } std::string Configuration::copyright() { std::stringstream ss; @@ -230,7 +216,7 @@ std::string Configuration::copyright() { std::string Configuration::about() { std::stringstream ss; - ss << "This is CVC4 version " << CVC4_RELEASE_STRING; + ss << "This is CVC4 version " << CVC5_RELEASE_STRING; if (Configuration::isGitBuild()) { ss << " [" << Configuration::getGitId() << "]"; } @@ -278,21 +264,21 @@ bool Configuration::isBuiltWithPoly() bool Configuration::isBuiltWithSymFPU() { return IS_SYMFPU_BUILD; } unsigned Configuration::getNumDebugTags() { -#if defined(CVC4_DEBUG) && defined(CVC4_TRACING) +#if defined(CVC5_DEBUG) && defined(CVC5_TRACING) /* -1 because a NULL pointer is inserted as the last value */ return (sizeof(Debug_tags) / sizeof(Debug_tags[0])) - 1; -#else /* CVC4_DEBUG && CVC4_TRACING */ +#else /* CVC5_DEBUG && CVC5_TRACING */ return 0; -#endif /* CVC4_DEBUG && CVC4_TRACING */ +#endif /* CVC5_DEBUG && CVC5_TRACING */ } char const* const* Configuration::getDebugTags() { -#if defined(CVC4_DEBUG) && defined(CVC4_TRACING) +#if defined(CVC5_DEBUG) && defined(CVC5_TRACING) return Debug_tags; -#else /* CVC4_DEBUG && CVC4_TRACING */ +#else /* CVC5_DEBUG && CVC5_TRACING */ static char const* no_tags[] = { NULL }; return no_tags; -#endif /* CVC4_DEBUG && CVC4_TRACING */ +#endif /* CVC5_DEBUG && CVC5_TRACING */ } int strcmpptr(const char **s1, const char **s2){ @@ -300,7 +286,7 @@ int strcmpptr(const char **s1, const char **s2){ } bool Configuration::isDebugTag(char const *tag){ -#if defined(CVC4_DEBUG) && defined(CVC4_TRACING) +#if defined(CVC5_DEBUG) && defined(CVC5_TRACING) unsigned ntags = getNumDebugTags(); char const* const* tags = getDebugTags(); for (unsigned i = 0; i < ntags; ++ i) { @@ -308,30 +294,30 @@ bool Configuration::isDebugTag(char const *tag){ return true; } } -#endif /* CVC4_DEBUG && CVC4_TRACING */ +#endif /* CVC5_DEBUG && CVC5_TRACING */ return false; } unsigned Configuration::getNumTraceTags() { -#if CVC4_TRACING +#if CVC5_TRACING /* -1 because a NULL pointer is inserted as the last value */ return sizeof(Trace_tags) / sizeof(Trace_tags[0]) - 1; -#else /* CVC4_TRACING */ +#else /* CVC5_TRACING */ return 0; -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ } char const* const* Configuration::getTraceTags() { -#if CVC4_TRACING +#if CVC5_TRACING return Trace_tags; -#else /* CVC4_TRACING */ +#else /* CVC5_TRACING */ static char const* no_tags[] = { NULL }; return no_tags; -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ } bool Configuration::isTraceTag(char const * tag){ -#if CVC4_TRACING +#if CVC5_TRACING unsigned ntags = getNumTraceTags(); char const* const* tags = getTraceTags(); for (unsigned i = 0; i < ntags; ++ i) { @@ -339,7 +325,7 @@ bool Configuration::isTraceTag(char const * tag){ return true; } } -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ return false; } diff --git a/src/base/configuration.h b/src/base/configuration.h index 6754923ed..3d30682fd 100644 --- a/src/base/configuration.h +++ b/src/base/configuration.h @@ -50,7 +50,7 @@ public: static constexpr bool isStatisticsBuild() { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON return true; #else return false; diff --git a/src/base/configuration_private.h b/src/base/configuration_private.h index 754c8002f..ce6397682 100644 --- a/src/base/configuration_private.h +++ b/src/base/configuration_private.h @@ -24,101 +24,101 @@ namespace cvc5 { -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG # define IS_DEBUG_BUILD true -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ # define IS_DEBUG_BUILD false -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ -#ifdef CVC4_TRACING +#ifdef CVC5_TRACING # define IS_TRACING_BUILD true -#else /* CVC4_TRACING */ +#else /* CVC5_TRACING */ # define IS_TRACING_BUILD false -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ -#ifdef CVC4_DUMPING +#ifdef CVC5_DUMPING # define IS_DUMPING_BUILD true -#else /* CVC4_DUMPING */ +#else /* CVC5_DUMPING */ # define IS_DUMPING_BUILD false -#endif /* CVC4_DUMPING */ +#endif /* CVC5_DUMPING */ -#ifdef CVC4_MUZZLE +#ifdef CVC5_MUZZLE # define IS_MUZZLED_BUILD true -#else /* CVC4_MUZZLE */ +#else /* CVC5_MUZZLE */ # define IS_MUZZLED_BUILD false -#endif /* CVC4_MUZZLE */ +#endif /* CVC5_MUZZLE */ -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS # define IS_ASSERTIONS_BUILD true -#else /* CVC4_ASSERTIONS */ +#else /* CVC5_ASSERTIONS */ # define IS_ASSERTIONS_BUILD false -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ -#ifdef CVC4_COVERAGE +#ifdef CVC5_COVERAGE # define IS_COVERAGE_BUILD true -#else /* CVC4_COVERAGE */ +#else /* CVC5_COVERAGE */ # define IS_COVERAGE_BUILD false -#endif /* CVC4_COVERAGE */ +#endif /* CVC5_COVERAGE */ -#ifdef CVC4_PROFILING +#ifdef CVC5_PROFILING # define IS_PROFILING_BUILD true -#else /* CVC4_PROFILING */ +#else /* CVC5_PROFILING */ # define IS_PROFILING_BUILD false -#endif /* CVC4_PROFILING */ +#endif /* CVC5_PROFILING */ -#ifdef CVC4_COMPETITION_MODE +#ifdef CVC5_COMPETITION_MODE # define IS_COMPETITION_BUILD true -#else /* CVC4_COMPETITION_MODE */ +#else /* CVC5_COMPETITION_MODE */ # define IS_COMPETITION_BUILD false -#endif /* CVC4_COMPETITION_MODE */ +#endif /* CVC5_COMPETITION_MODE */ -#ifdef CVC4_GMP_IMP +#ifdef CVC5_GMP_IMP # define IS_GMP_BUILD true -#else /* CVC4_GMP_IMP */ +#else /* CVC5_GMP_IMP */ # define IS_GMP_BUILD false -#endif /* CVC4_GMP_IMP */ +#endif /* CVC5_GMP_IMP */ -#ifdef CVC4_CLN_IMP +#ifdef CVC5_CLN_IMP # define IS_CLN_BUILD true -#else /* CVC4_CLN_IMP */ +#else /* CVC5_CLN_IMP */ # define IS_CLN_BUILD false -#endif /* CVC4_CLN_IMP */ +#endif /* CVC5_CLN_IMP */ -#if CVC4_USE_GLPK +#if CVC5_USE_GLPK # define IS_GLPK_BUILD true -#else /* CVC4_USE_GLPK */ +#else /* CVC5_USE_GLPK */ # define IS_GLPK_BUILD false -#endif /* CVC4_USE_GLPK */ +#endif /* CVC5_USE_GLPK */ -#if CVC4_USE_ABC +#if CVC5_USE_ABC # define IS_ABC_BUILD true -#else /* CVC4_USE_ABC */ +#else /* CVC5_USE_ABC */ # define IS_ABC_BUILD false -#endif /* CVC4_USE_ABC */ +#endif /* CVC5_USE_ABC */ -#if CVC4_USE_CADICAL +#if CVC5_USE_CADICAL #define IS_CADICAL_BUILD true -#else /* CVC4_USE_CADICAL */ +#else /* CVC5_USE_CADICAL */ #define IS_CADICAL_BUILD false -#endif /* CVC4_USE_CADICAL */ +#endif /* CVC5_USE_CADICAL */ -#if CVC4_USE_CRYPTOMINISAT +#if CVC5_USE_CRYPTOMINISAT # define IS_CRYPTOMINISAT_BUILD true -#else /* CVC4_USE_CRYPTOMINISAT */ +#else /* CVC5_USE_CRYPTOMINISAT */ # define IS_CRYPTOMINISAT_BUILD false -#endif /* CVC4_USE_CRYPTOMINISAT */ +#endif /* CVC5_USE_CRYPTOMINISAT */ -#if CVC4_USE_KISSAT +#if CVC5_USE_KISSAT #define IS_KISSAT_BUILD true -#else /* CVC4_USE_KISSAT */ +#else /* CVC5_USE_KISSAT */ #define IS_KISSAT_BUILD false -#endif /* CVC4_USE_KISSAT */ +#endif /* CVC5_USE_KISSAT */ -#if CVC4_USE_POLY +#if CVC5_USE_POLY #define IS_POLY_BUILD true -#else /* CVC4_USE_POLY */ +#else /* CVC5_USE_POLY */ #define IS_POLY_BUILD false -#endif /* CVC4_USE_POLY */ +#endif /* CVC5_USE_POLY */ #if HAVE_LIBEDITLINE #define IS_EDITLINE_BUILD true @@ -126,17 +126,17 @@ namespace cvc5 { #define IS_EDITLINE_BUILD false #endif /* HAVE_LIBEDITLINE */ -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU #define IS_SYMFPU_BUILD true #else /* HAVE_SYMFPU_HEADERS */ #define IS_SYMFPU_BUILD false #endif /* HAVE_SYMFPU_HEADERS */ -#if CVC4_GPL_DEPS +#if CVC5_GPL_DEPS # define IS_GPL_BUILD true -#else /* CVC4_GPL_DEPS */ +#else /* CVC5_GPL_DEPS */ # define IS_GPL_BUILD false -#endif /* CVC4_GPL_DEPS */ +#endif /* CVC5_GPL_DEPS */ #define IS_ASAN_BUILD false @@ -154,11 +154,11 @@ namespace cvc5 { # endif /* __has_feature(address_sanitizer) */ #endif /* defined(__has_feature) */ -#ifdef CVC4_USE_UBSAN +#ifdef CVC5_USE_UBSAN #define IS_UBSAN_BUILD true -#else /* CVC4_USE_UBSAN */ +#else /* CVC5_USE_UBSAN */ #define IS_UBSAN_BUILD false -#endif /* CVC4_USE_UBSAN */ +#endif /* CVC5_USE_UBSAN */ #define IS_TSAN_BUILD false diff --git a/src/base/exception.cpp b/src/base/exception.cpp index 3c5c21b46..c6fb03834 100644 --- a/src/base/exception.cpp +++ b/src/base/exception.cpp @@ -135,14 +135,14 @@ void IllegalArgumentException::construct(const char* header, const char* extra, setMessage(string(buf)); -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG LastExceptionBuffer* buffer = LastExceptionBuffer::getCurrent(); if(buffer != nullptr){ if(buffer->getContents() == nullptr) { buffer->setContents(buf); } } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ delete [] buf; } @@ -176,14 +176,14 @@ void IllegalArgumentException::construct(const char* header, const char* extra, setMessage(string(buf)); -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG LastExceptionBuffer* buffer = LastExceptionBuffer::getCurrent(); if(buffer != nullptr){ if(buffer->getContents() == nullptr) { buffer->setContents(buf); } } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ delete [] buf; } diff --git a/src/base/exception.h b/src/base/exception.h index f3a5326fc..579a8cdad 100644 --- a/src/base/exception.h +++ b/src/base/exception.h @@ -119,18 +119,23 @@ inline std::ostream& operator<<(std::ostream& os, const Exception& e) template inline void CheckArgument(bool cond, const T& arg, const char* tail); -template inline void CheckArgument(bool cond, const T& arg CVC4_UNUSED, - const char* tail CVC4_UNUSED) { +template +inline void CheckArgument(bool cond, + const T& arg CVC5_UNUSED, + const char* tail CVC5_UNUSED) +{ if(__builtin_expect( ( !cond ), false )) { throw ::cvc5::IllegalArgumentException("", "", tail); - } \ + } } template inline void CheckArgument(bool cond, const T& arg); -template inline void CheckArgument(bool cond, const T& arg CVC4_UNUSED) { +template +inline void CheckArgument(bool cond, const T& arg CVC5_UNUSED) +{ if(__builtin_expect( ( !cond ), false )) { throw ::cvc5::IllegalArgumentException("", "", ""); - } \ + } } class CVC4_EXPORT LastExceptionBuffer diff --git a/src/base/output.h b/src/base/output.h index 856b81333..acad7e40b 100644 --- a/src/base/output.h +++ b/src/base/output.h @@ -410,7 +410,7 @@ extern TraceC TraceChannel CVC4_EXPORT; /** The dump output singleton */ extern DumpOutC DumpOutChannel CVC4_EXPORT; -#ifdef CVC4_MUZZLE +#ifdef CVC5_MUZZLE #define Debug \ ::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::DebugChannel @@ -429,14 +429,14 @@ extern DumpOutC DumpOutChannel CVC4_EXPORT; #define DumpOut \ ::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::DumpOutChannel -#else /* CVC4_MUZZLE */ +#else /* CVC5_MUZZLE */ -# if defined(CVC4_DEBUG) && defined(CVC4_TRACING) +#if defined(CVC5_DEBUG) && defined(CVC5_TRACING) #define Debug ::cvc5::DebugChannel -# else /* CVC4_DEBUG && CVC4_TRACING */ +#else /* CVC5_DEBUG && CVC5_TRACING */ #define Debug \ ::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::DebugChannel -# endif /* CVC4_DEBUG && CVC4_TRACING */ +#endif /* CVC5_DEBUG && CVC5_TRACING */ #define Warning \ (!::cvc5::WarningChannel.isOn()) ? ::cvc5::nullCvc4Stream \ : ::cvc5::WarningChannel @@ -453,35 +453,36 @@ extern DumpOutC DumpOutChannel CVC4_EXPORT; : ::cvc5::NoticeChannel #define Chat \ (!::cvc5::ChatChannel.isOn()) ? ::cvc5::nullCvc4Stream : ::cvc5::ChatChannel -# ifdef CVC4_TRACING +#ifdef CVC5_TRACING #define Trace ::cvc5::TraceChannel -# else /* CVC4_TRACING */ +#else /* CVC5_TRACING */ #define Trace \ ::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::TraceChannel -# endif /* CVC4_TRACING */ -# ifdef CVC4_DUMPING +#endif /* CVC5_TRACING */ +#ifdef CVC5_DUMPING #define DumpOut ::cvc5::DumpOutChannel -# else /* CVC4_DUMPING */ +#else /* CVC5_DUMPING */ #define DumpOut \ ::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::DumpOutChannel -# endif /* CVC4_DUMPING */ +#endif /* CVC5_DUMPING */ -#endif /* CVC4_MUZZLE */ +#endif /* CVC5_MUZZLE */ // Disallow e.g. !Debug("foo").isOn() forms // because the ! will apply before the ? . // If a compiler error has directed you here, // just parenthesize it e.g. !(Debug("foo").isOn()) class __cvc4_true { - void operator!() CVC4_UNUSED; - void operator~() CVC4_UNUSED; - void operator-() CVC4_UNUSED; - void operator+() CVC4_UNUSED; -public: + void operator!() CVC5_UNUSED; + void operator~() CVC5_UNUSED; + void operator-() CVC5_UNUSED; + void operator+() CVC5_UNUSED; + + public: inline operator bool() { return true; } };/* __cvc4_true */ -#if defined(CVC4_DEBUG) && defined(CVC4_TRACING) +#if defined(CVC5_DEBUG) && defined(CVC5_TRACING) class ScopedDebug { @@ -509,7 +510,7 @@ public: } }; /* class ScopedDebug */ -#else /* CVC4_DEBUG && CVC4_TRACING */ +#else /* CVC5_DEBUG && CVC5_TRACING */ class ScopedDebug { @@ -517,9 +518,9 @@ class ScopedDebug ScopedDebug(std::string tag, bool newSetting = true) {} }; /* class ScopedDebug */ -#endif /* CVC4_DEBUG && CVC4_TRACING */ +#endif /* CVC5_DEBUG && CVC5_TRACING */ -#ifdef CVC4_TRACING +#ifdef CVC5_TRACING class ScopedTrace { @@ -547,7 +548,7 @@ public: } }; /* class ScopedTrace */ -#else /* CVC4_TRACING */ +#else /* CVC5_TRACING */ class ScopedTrace { @@ -555,7 +556,7 @@ class ScopedTrace ScopedTrace(std::string tag, bool newSetting = true) {} }; /* class ScopedTrace */ -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ /** * Pushes an indentation level on construction, pop on destruction. @@ -571,13 +572,13 @@ public: inline ~IndentedScope(); }; /* class IndentedScope */ -#if defined(CVC4_DEBUG) && defined(CVC4_TRACING) +#if defined(CVC5_DEBUG) && defined(CVC5_TRACING) inline IndentedScope::IndentedScope(CVC4ostream out) : d_out(out) { d_out << push; } inline IndentedScope::~IndentedScope() { d_out << pop; } -#else /* CVC4_DEBUG && CVC4_TRACING */ +#else /* CVC5_DEBUG && CVC5_TRACING */ inline IndentedScope::IndentedScope(CVC4ostream out) {} inline IndentedScope::~IndentedScope() {} -#endif /* CVC4_DEBUG && CVC4_TRACING */ +#endif /* CVC5_DEBUG && CVC5_TRACING */ } // namespace cvc5 diff --git a/src/context/cdlist_forward.h b/src/context/cdlist_forward.h index 9575881e0..cf912a93a 100644 --- a/src/context/cdlist_forward.h +++ b/src/context/cdlist_forward.h @@ -42,7 +42,7 @@ namespace context { template class DefaultCleanUp { public: - inline void operator()(T* t CVC4_UNUSED) const{} + inline void operator()(T* t CVC5_UNUSED) const {} }; template , class Allocator = std::allocator > diff --git a/src/context/context_mm.cpp b/src/context/context_mm.cpp index 2e5f0aba4..30306d254 100644 --- a/src/context/context_mm.cpp +++ b/src/context/context_mm.cpp @@ -21,9 +21,9 @@ #include #include -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND #include -#endif /* CVC4_VALGRIND */ +#endif /* CVC5_VALGRIND */ #include "base/check.h" #include "base/output.h" @@ -32,7 +32,7 @@ namespace cvc5 { namespace context { -#ifndef CVC4_DEBUG_CONTEXT_MEMORY_MANAGER +#ifndef CVC5_DEBUG_CONTEXT_MEMORY_MANAGER void ContextMemoryManager::newChunk() { @@ -48,9 +48,9 @@ void ContextMemoryManager::newChunk() { throw std::bad_alloc(); } -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND VALGRIND_MAKE_MEM_NOACCESS(d_chunkList.back(), chunkSizeBytes); -#endif /* CVC4_VALGRIND */ +#endif /* CVC5_VALGRIND */ } // If there is a free chunk, use that else { @@ -72,18 +72,18 @@ ContextMemoryManager::ContextMemoryManager() : d_indexChunkList(0) { } d_endChunk = d_nextFree + chunkSizeBytes; -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND VALGRIND_CREATE_MEMPOOL(this, 0, false); VALGRIND_MAKE_MEM_NOACCESS(d_nextFree, chunkSizeBytes); d_allocations.push_back(std::vector()); -#endif /* CVC4_VALGRIND */ +#endif /* CVC5_VALGRIND */ } ContextMemoryManager::~ContextMemoryManager() { -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND VALGRIND_DESTROY_MEMPOOL(this); -#endif /* CVC4_VALGRIND */ +#endif /* CVC5_VALGRIND */ // Delete all chunks while(!d_chunkList.empty()) { @@ -113,19 +113,19 @@ void* ContextMemoryManager::newData(size_t size) { << ") returning " << res << " at level " << d_chunkList.size() << std::endl; -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND VALGRIND_MEMPOOL_ALLOC(this, static_cast(res), size); d_allocations.back().push_back(static_cast(res)); -#endif /* CVC4_VALGRIND */ +#endif /* CVC5_VALGRIND */ return res; } void ContextMemoryManager::push() { -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND d_allocations.push_back(std::vector()); -#endif /* CVC4_VALGRIND */ +#endif /* CVC5_VALGRIND */ // Store current state on the stack d_nextFreeStack.push_back(d_nextFree); @@ -135,13 +135,13 @@ void ContextMemoryManager::push() { void ContextMemoryManager::pop() { -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND for (auto allocation : d_allocations.back()) { VALGRIND_MEMPOOL_FREE(this, allocation); } d_allocations.pop_back(); -#endif /* CVC4_VALGRIND */ +#endif /* CVC5_VALGRIND */ Assert(d_nextFreeStack.size() > 0 && d_endChunkStack.size() > 0); @@ -154,9 +154,9 @@ void ContextMemoryManager::pop() { // Free all the new chunks since the last push while(d_indexChunkList > d_indexChunkListStack.back()) { d_freeChunks.push_back(d_chunkList.back()); -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND VALGRIND_MAKE_MEM_NOACCESS(d_chunkList.back(), chunkSizeBytes); -#endif /* CVC4_VALGRIND */ +#endif /* CVC5_VALGRIND */ d_chunkList.pop_back(); --d_indexChunkList; } @@ -175,7 +175,7 @@ unsigned ContextMemoryManager::getMaxAllocationSize() return std::numeric_limits::max(); } -#endif /* CVC4_DEBUG_CONTEXT_MEMORY_MANAGER */ +#endif /* CVC5_DEBUG_CONTEXT_MEMORY_MANAGER */ } // namespace context } // namespace cvc5 diff --git a/src/context/context_mm.h b/src/context/context_mm.h index 22852b9a6..75b3a2fbf 100644 --- a/src/context/context_mm.h +++ b/src/context/context_mm.h @@ -20,7 +20,7 @@ #ifndef CVC5__CONTEXT__CONTEXT_MM_H #define CVC5__CONTEXT__CONTEXT_MM_H -#ifndef CVC4_DEBUG_CONTEXT_MEMORY_MANAGER +#ifndef CVC5_DEBUG_CONTEXT_MEMORY_MANAGER #include #endif #include @@ -28,7 +28,7 @@ namespace cvc5 { namespace context { -#ifndef CVC4_DEBUG_CONTEXT_MEMORY_MANAGER +#ifndef CVC5_DEBUG_CONTEXT_MEMORY_MANAGER /** * Region-based memory manager for contexts. Calls to newData provide memory @@ -105,7 +105,7 @@ class ContextMemoryManager { */ void newChunk(); -#ifdef CVC4_VALGRIND +#ifdef CVC5_VALGRIND /** * Vector of allocations for each level. Used for accurately marking * allocations as free'd in Valgrind. @@ -149,7 +149,7 @@ class ContextMemoryManager { };/* class ContextMemoryManager */ -#else /* CVC4_DEBUG_CONTEXT_MEMORY_MANAGER */ +#else /* CVC5_DEBUG_CONTEXT_MEMORY_MANAGER */ #warning \ "Using the debug version of ContextMemoryManager, expect performance degradation" @@ -198,7 +198,7 @@ class ContextMemoryManager std::vector> d_allocations; }; /* ContextMemoryManager */ -#endif /* CVC4_DEBUG_CONTEXT_MEMORY_MANAGER */ +#endif /* CVC5_DEBUG_CONTEXT_MEMORY_MANAGER */ /** * An STL-like allocator class for allocating from context memory. diff --git a/src/decision/justification_heuristic.cpp b/src/decision/justification_heuristic.cpp index abe7a47a7..02773d307 100644 --- a/src/decision/justification_heuristic.cpp +++ b/src/decision/justification_heuristic.cpp @@ -126,7 +126,7 @@ cvc5::prop::SatLiteral JustificationHeuristic::getNextThresh( Trace("decision") << "jh: Nothing to split on " << std::endl; -#if defined CVC4_DEBUG +#if defined CVC5_DEBUG bool alljustified = true; for(unsigned i = 0 ; i < d_assertions.size() && alljustified ; ++i) { TNode curass = d_assertions[i]; @@ -442,7 +442,7 @@ JustificationHeuristic::findSplitterRec(TNode node, SatValue desiredVal) return DONT_KNOW; } -#if defined CVC4_ASSERTIONS || defined CVC4_DEBUG +#if defined CVC5_ASSERTIONS || defined CVC5_DEBUG // We don't always have a sat literal, so remember that. Will need // it for some assertions we make. bool litPresent = d_decisionEngine->hasSatLiteral(node); diff --git a/src/expr/attribute.h b/src/expr/attribute.h index 9f2301d7e..df621d860 100644 --- a/src/expr/attribute.h +++ b/src/expr/attribute.h @@ -28,9 +28,9 @@ #include "expr/attribute_unique_id.h" // include supporting templates -#define CVC4_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H +#define CVC5_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H #include "expr/attribute_internals.h" -#undef CVC4_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H +#undef CVC5_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H namespace cvc5 { namespace expr { diff --git a/src/expr/attribute_internals.h b/src/expr/attribute_internals.h index 2293e4b5a..a0ef6ea02 100644 --- a/src/expr/attribute_internals.h +++ b/src/expr/attribute_internals.h @@ -16,9 +16,9 @@ #include "cvc4_private.h" -#ifndef CVC4_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H +#ifndef CVC5_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H # error expr/attribute_internals.h should only be included by expr/attribute.h -#endif /* CVC4_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H */ +#endif /* CVC5_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H */ #ifndef CVC5__EXPR__ATTRIBUTE_INTERNALS_H #define CVC5__EXPR__ATTRIBUTE_INTERNALS_H diff --git a/src/expr/metakind_template.cpp b/src/expr/metakind_template.cpp index 52502cbcd..451464d17 100644 --- a/src/expr/metakind_template.cpp +++ b/src/expr/metakind_template.cpp @@ -29,7 +29,9 @@ MetaKind metaKindOf(Kind k) { static const MetaKind metaKinds[] = { metakind::INVALID, /* UNDEFINED_KIND */ metakind::INVALID, /* NULL_EXPR */ +// clang-format off ${metakind_kinds} +// clang-format on metakind::INVALID /* LAST_KIND */ };/* metaKinds[] */ @@ -45,7 +47,9 @@ ${metakind_kinds} namespace expr { +// clang-format off ${metakind_constantMaps} +// clang-format on } // namespace expr @@ -58,7 +62,9 @@ size_t NodeValueCompare::constHash(const ::cvc5::expr::NodeValue* nv) switch (nv->d_kind) { +// clang-format off ${metakind_constHashes} +// clang-format on default: Unhandled() << ::cvc5::expr::NodeValue::dKindToKind(nv->d_kind); } } @@ -75,7 +81,9 @@ bool NodeValueCompare::compare(const ::cvc5::expr::NodeValue* nv1, { switch (nv1->d_kind) { +// clang-format off ${metakind_compares} +// clang-format on default: Unhandled() << ::cvc5::expr::NodeValue::dKindToKind(nv1->d_kind); } } @@ -111,7 +119,9 @@ void NodeValueConstPrinter::toStream(std::ostream& out, switch (nv->d_kind) { +// clang-format off ${metakind_constPrinters} +// clang-format on default: Unhandled() << ::cvc5::expr::NodeValue::dKindToKind(nv->d_kind); } } @@ -142,7 +152,9 @@ void deleteNodeValueConstant(::cvc5::expr::NodeValue* nv) switch (nv->d_kind) { +// clang-format off ${metakind_constDeleters} +// clang-format on default: Unhandled() << ::cvc5::expr::NodeValue::dKindToKind(nv->d_kind); } } @@ -154,7 +166,9 @@ uint32_t getMinArityForKind(::cvc5::Kind k) { static const unsigned lbs[] = { 0, /* NULL_EXPR */ +// clang-format off ${metakind_lbchildren} +// clang-format on 0 /* LAST_KIND */ }; @@ -166,7 +180,9 @@ uint32_t getMaxArityForKind(::cvc5::Kind k) { static const unsigned ubs[] = { 0, /* NULL_EXPR */ +// clang-format off ${metakind_ubchildren} +// clang-format on 0, /* LAST_KIND */ }; @@ -188,11 +204,13 @@ Kind operatorToKind(::cvc5::expr::NodeValue* nv) return kind::APPLY_UF; } - switch(Kind k CVC4_UNUSED = nv->getKind()) { -${metakind_operatorKinds} + switch (Kind k CVC5_UNUSED = nv->getKind()) + { +// clang-format off + ${metakind_operatorKinds} +// clang-format on - default: - return kind::UNDEFINED_KIND; /* LAST_KIND */ + default: return kind::UNDEFINED_KIND; /* LAST_KIND */ }; } diff --git a/src/expr/node.cpp b/src/expr/node.cpp index 90d29f1eb..ec6b7c6fb 100644 --- a/src/expr/node.cpp +++ b/src/expr/node.cpp @@ -32,7 +32,7 @@ TypeCheckingExceptionPrivate::TypeCheckingExceptionPrivate(TNode node, std::string message) : Exception(message), d_node(new Node(node)) { -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG std::stringstream ss; LastExceptionBuffer* current = LastExceptionBuffer::getCurrent(); if(current != NULL){ @@ -48,7 +48,7 @@ TypeCheckingExceptionPrivate::TypeCheckingExceptionPrivate(TNode node, string ssstring = ss.str(); current->setContents(ssstring.c_str()); } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ } TypeCheckingExceptionPrivate::~TypeCheckingExceptionPrivate() { delete d_node; } diff --git a/src/expr/node.h b/src/expr/node.h index b8e44a4cb..4554c1ee8 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -1435,7 +1435,7 @@ NodeTemplate::substitute(Iterator substitutionsBegin, } } -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG /** * Pretty printer for use within gdb. This is not intended to be used * outside of gdb. This writes to the Warning() stream and immediately @@ -1488,7 +1488,7 @@ static void __attribute__((used)) debugPrintRawTNode(const NodeTemplate& n.printAst(Warning(), 0); Warning().flush(); } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ } // namespace cvc5 diff --git a/src/expr/node_builder.cpp b/src/expr/node_builder.cpp index 8c3e8d077..307c3aaf8 100644 --- a/src/expr/node_builder.cpp +++ b/src/expr/node_builder.cpp @@ -77,11 +77,11 @@ NodeBuilder::NodeBuilder(const NodeBuilder& nb) NodeBuilder::~NodeBuilder() { - if (CVC4_PREDICT_FALSE(nvIsAllocated())) + if (CVC5_PREDICT_FALSE(nvIsAllocated())) { dealloc(); } - else if (CVC4_PREDICT_FALSE(!isUsed())) + else if (CVC5_PREDICT_FALSE(!isUsed())) { decrRefCounts(); } @@ -146,11 +146,11 @@ void NodeBuilder::clear(Kind k) { Assert(k != kind::NULL_EXPR) << "illegal Node-building clear kind"; - if (CVC4_PREDICT_FALSE(nvIsAllocated())) + if (CVC5_PREDICT_FALSE(nvIsAllocated())) { dealloc(); } - else if (CVC4_PREDICT_FALSE(!isUsed())) + else if (CVC5_PREDICT_FALSE(!isUsed())) { decrRefCounts(); } @@ -187,7 +187,7 @@ NodeBuilder& NodeBuilder::operator<<(const Kind& k) // NodeBuilder construction or at the last clear()), but we do // now. That means we appended a Kind with operator<<(Kind), // which now (lazily) we'll collapse. - if (CVC4_PREDICT_FALSE(d_nv->d_id == 0 && getKind() != kind::UNDEFINED_KIND)) + if (CVC5_PREDICT_FALSE(d_nv->d_id == 0 && getKind() != kind::UNDEFINED_KIND)) { Node n2 = operator Node(); clear(); @@ -209,7 +209,7 @@ NodeBuilder& NodeBuilder::operator<<(TNode n) // NodeBuilder construction or at the last clear()), but we do // now. That means we appended a Kind with operator<<(Kind), // which now (lazily) we'll collapse. - if (CVC4_PREDICT_FALSE(d_nv->d_id == 0 && getKind() != kind::UNDEFINED_KIND)) + if (CVC5_PREDICT_FALSE(d_nv->d_id == 0 && getKind() != kind::UNDEFINED_KIND)) { Node n2 = operator Node(); clear(); @@ -226,7 +226,7 @@ NodeBuilder& NodeBuilder::operator<<(TypeNode n) // NodeBuilder construction or at the last clear()), but we do // now. That means we appended a Kind with operator<<(Kind), // which now (lazily) we'll collapse. - if (CVC4_PREDICT_FALSE(d_nv->d_id == 0 && getKind() != kind::UNDEFINED_KIND)) + if (CVC5_PREDICT_FALSE(d_nv->d_id == 0 && getKind() != kind::UNDEFINED_KIND)) { Node n2 = operator Node(); clear(); @@ -280,7 +280,7 @@ void NodeBuilder::realloc(size_t toSize) << "attempt to realloc() a NodeBuilder to size " << toSize << " (beyond hard limit of " << expr::NodeValue::MAX_CHILDREN << ")"; - if (CVC4_PREDICT_FALSE(nvIsAllocated())) + if (CVC5_PREDICT_FALSE(nvIsAllocated())) { // Ensure d_nv is not modified on allocation failure expr::NodeValue* newBlock = (expr::NodeValue*)std::realloc( @@ -447,7 +447,7 @@ expr::NodeValue* NodeBuilder::constructNV() // NodeManager pool of Nodes. See implementation notes at the top // of this file. - if (CVC4_PREDICT_TRUE(!nvIsAllocated())) + if (CVC5_PREDICT_TRUE(!nvIsAllocated())) { /** Case 1. d_nv points to d_inlineNv: it is the backing store ** allocated "inline" in this NodeBuilder. **/ @@ -578,7 +578,7 @@ void NodeBuilder::internalCopy(const NodeBuilder& nb) return; } - bool realloced CVC4_UNUSED = false; + bool realloced CVC5_UNUSED = false; if (nb.d_nvMaxChildren > d_nvMaxChildren) { realloced = true; @@ -603,7 +603,7 @@ void NodeBuilder::internalCopy(const NodeBuilder& nb) } } -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG inline void NodeBuilder::maybeCheckType(const TNode n) const { /* force an immediate type check, if early type checking is @@ -615,9 +615,9 @@ inline void NodeBuilder::maybeCheckType(const TNode n) const d_nm->getType(n, true); } } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ -bool NodeBuilder::isUsed() const { return CVC4_PREDICT_FALSE(d_nv == nullptr); } +bool NodeBuilder::isUsed() const { return CVC5_PREDICT_FALSE(d_nv == nullptr); } void NodeBuilder::setUsed() { @@ -639,25 +639,25 @@ void NodeBuilder::setUnused() bool NodeBuilder::nvIsAllocated() const { - return CVC4_PREDICT_FALSE(d_nv != &d_inlineNv) - && CVC4_PREDICT_TRUE(d_nv != nullptr); + return CVC5_PREDICT_FALSE(d_nv != &d_inlineNv) + && CVC5_PREDICT_TRUE(d_nv != nullptr); } bool NodeBuilder::nvNeedsToBeAllocated() const { - return CVC4_PREDICT_FALSE(d_nv->d_nchildren == d_nvMaxChildren); + return CVC5_PREDICT_FALSE(d_nv->d_nchildren == d_nvMaxChildren); } void NodeBuilder::realloc() { size_t newSize = 2 * size_t(d_nvMaxChildren); size_t hardLimit = expr::NodeValue::MAX_CHILDREN; - realloc(CVC4_PREDICT_FALSE(newSize > hardLimit) ? hardLimit : newSize); + realloc(CVC5_PREDICT_FALSE(newSize > hardLimit) ? hardLimit : newSize); } void NodeBuilder::allocateNvIfNecessaryForAppend() { - if (CVC4_PREDICT_FALSE(nvNeedsToBeAllocated())) + if (CVC5_PREDICT_FALSE(nvNeedsToBeAllocated())) { realloc(); } @@ -665,8 +665,8 @@ void NodeBuilder::allocateNvIfNecessaryForAppend() void NodeBuilder::crop() { - if (CVC4_PREDICT_FALSE(nvIsAllocated()) - && CVC4_PREDICT_TRUE(d_nvMaxChildren > d_nv->d_nchildren)) + if (CVC5_PREDICT_FALSE(nvIsAllocated()) + && CVC5_PREDICT_TRUE(d_nvMaxChildren > d_nv->d_nchildren)) { // Ensure d_nv is not modified on allocation failure expr::NodeValue* newBlock = (expr::NodeValue*)std::realloc( diff --git a/src/expr/node_builder.h b/src/expr/node_builder.h index 271a217dc..95e91bb52 100644 --- a/src/expr/node_builder.h +++ b/src/expr/node_builder.h @@ -363,13 +363,13 @@ class NodeBuilder { /** Construct the node value out of the node builder */ expr::NodeValue* constructNV(); -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG // Throws a TypeCheckingExceptionPrivate on a failure. void maybeCheckType(const TNode n) const; -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ // Do nothing if not in debug mode. inline void maybeCheckType(const TNode n) const {} -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ // used by convenience node builders NodeBuilder& collapseTo(Kind k); diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp index dd372a81d..072685e09 100644 --- a/src/expr/node_manager.cpp +++ b/src/expr/node_manager.cpp @@ -448,7 +448,7 @@ TypeNode NodeManager::getType(TNode n, bool check) Debug("getType") << this << " getting type for " << &n << " " << n << ", check=" << check << ", needsCheck = " << needsCheck << ", hasType = " << hasType << endl; -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG // already did type check eagerly upon creation in node builder bool doTypeCheck = false; #else @@ -664,10 +664,10 @@ std::vector NodeManager::mkMutualDatatypeTypes( for (size_t i = 0, ncons = dt.getNumConstructors(); i < ncons; i++) { const DTypeConstructor& c = dt[i]; - TypeNode testerType CVC4_UNUSED = c.getTester().getType(); + TypeNode testerType CVC5_UNUSED = c.getTester().getType(); Assert(c.isResolved() && testerType.isTester() && testerType[0] == ut) << "malformed tester in datatype post-resolution"; - TypeNode ctorType CVC4_UNUSED = c.getConstructor().getType(); + TypeNode ctorType CVC5_UNUSED = c.getConstructor().getType(); Assert(ctorType.isConstructor() && ctorType.getNumChildren() == c.getNumArgs() + 1 && ctorType.getRangeType() == ut) diff --git a/src/expr/node_value.h b/src/expr/node_value.h index 3e1ccd67e..57eef062b 100644 --- a/src/expr/node_value.h +++ b/src/expr/node_value.h @@ -518,7 +518,7 @@ inline std::ostream& operator<<(std::ostream& out, const NodeValue& nv) { } // namespace expr -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG /** * Pretty printer for use within gdb. This is not intended to be used * outside of gdb. This writes to the Warning() stream and immediately @@ -542,7 +542,7 @@ static void __attribute__((used)) debugPrintRawNodeValue(const expr::NodeValue* nv->printAst(Warning(), 0); Warning().flush(); } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ } // namespace cvc5 diff --git a/src/expr/type_node.h b/src/expr/type_node.h index 41f9afe6f..a1c4fa92b 100644 --- a/src/expr/type_node.h +++ b/src/expr/type_node.h @@ -1032,7 +1032,7 @@ inline unsigned TypeNode::getBitVectorSize() const { return getConst(); } -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG /** * Pretty printer for use within gdb. This is not intended to be used * outside of gdb. This writes to the Warning() stream and immediately @@ -1066,7 +1066,7 @@ static void __attribute__((used)) debugPrintRawTypeNode(const TypeNode& n) { n.printAst(Warning(), 0); Warning().flush(); } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ } // namespace cvc5 diff --git a/src/include/cvc4_private.h b/src/include/cvc4_private.h index a14c46bee..3fde5f54b 100644 --- a/src/include/cvc4_private.h +++ b/src/include/cvc4_private.h @@ -16,8 +16,8 @@ ** warning when the file is included improperly. **/ -#ifndef CVC4_PRIVATE_H -#define CVC4_PRIVATE_H +#ifndef CVC5_PRIVATE_H +#define CVC5_PRIVATE_H #if ! (defined(__BUILDING_CVC4LIB) || defined(__BUILDING_CVC4LIB_UNIT_TEST)) # error A private CVC4 header was included when not building the library or private unit test code. @@ -27,4 +27,4 @@ #include "cvc4_public.h" #include "cvc4autoconfig.h" -#endif /* CVC4_PRIVATE_H */ +#endif /* CVC5_PRIVATE_H */ diff --git a/src/include/cvc4_private_library.h b/src/include/cvc4_private_library.h index 9f5f18ab6..b80086809 100644 --- a/src/include/cvc4_private_library.h +++ b/src/include/cvc4_private_library.h @@ -16,8 +16,8 @@ ** warning when the file is included improperly. **/ -#ifndef CVC4_PRIVATE_LIBRARY_H -#define CVC4_PRIVATE_LIBRARY_H +#ifndef CVC5_PRIVATE_LIBRARY_H +#define CVC5_PRIVATE_LIBRARY_H #if !(defined(__BUILDING_CVC4LIB) || defined(__BUILDING_CVC4LIB_UNIT_TEST) \ || defined(__BUILDING_CVC4PARSERLIB) \ @@ -29,4 +29,4 @@ #include "cvc4_public.h" #include "cvc4autoconfig.h" -#endif /* CVC4_PRIVATE_LIBRARY_H */ +#endif /* CVC5_PRIVATE_LIBRARY_H */ diff --git a/src/include/cvc4_public.h b/src/include/cvc4_public.h index 8dd164120..6e50120fd 100644 --- a/src/include/cvc4_public.h +++ b/src/include/cvc4_public.h @@ -16,29 +16,29 @@ ** the libraries and driver binary, and also exported to the user. **/ -#ifndef CVC4_PUBLIC_H -#define CVC4_PUBLIC_H +#ifndef CVC5_PUBLIC_H +#define CVC5_PUBLIC_H #include #include -// CVC4_UNUSED is to mark something (e.g. local variable, function) +// CVC5_UNUSED is to mark something (e.g. local variable, function) // as being _possibly_ unused, so that the compiler generates no // warning about it. This might be the case for e.g. a variable // only used in DEBUG builds. #ifdef __GNUC__ -# define CVC4_UNUSED __attribute__((__unused__)) -# define CVC4_NORETURN __attribute__ ((__noreturn__)) -# define CVC4_CONST_FUNCTION __attribute__ ((__const__)) -# define CVC4_PURE_FUNCTION __attribute__ ((__pure__)) -# define CVC4_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) +#define CVC5_UNUSED __attribute__((__unused__)) +#define CVC5_NORETURN __attribute__((__noreturn__)) +#define CVC5_CONST_FUNCTION __attribute__((__const__)) +#define CVC5_PURE_FUNCTION __attribute__((__pure__)) +#define CVC5_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) #else /* ! __GNUC__ */ -# define CVC4_UNUSED -# define CVC4_NORETURN -# define CVC4_CONST_FUNCTION -# define CVC4_PURE_FUNCTION -# define CVC4_WARN_UNUSED_RESULT +#define CVC5_UNUSED +#define CVC5_NORETURN +#define CVC5_CONST_FUNCTION +#define CVC5_PURE_FUNCTION +#define CVC5_WARN_UNUSED_RESULT #endif /* __GNUC__ */ -#endif /* CVC4_PUBLIC_H */ +#endif /* CVC5_PUBLIC_H */ diff --git a/src/lib/replacements.h b/src/lib/replacements.h index 8a6527f15..da5274190 100644 --- a/src/lib/replacements.h +++ b/src/lib/replacements.h @@ -23,7 +23,8 @@ # if defined(__BUILDING_CVC4PARSERLIB) || defined(__BUILDING_CVC4PARSERLIB_UNIT_TEST) # include "cvc4parser_private.h" # else -# if defined(__BUILDING_CVC4DRIVER) || defined(__BUILDING_CVC4_SYSTEM_TEST) || defined(__BUILDING_STATISTICS_FOR_EXPORT) +#if defined(__BUILDING_CVC4DRIVER) || defined(__BUILDING_CVC5_SYSTEM_TEST) \ + || defined(__BUILDING_STATISTICS_FOR_EXPORT) # include "cvc4autoconfig.h" # else # error Must be building libcvc4 or libcvc4parser to use replacement functions. This is because replacement function headers should never be publicly-depended upon, as they should not be installed on user machines with 'make install'. diff --git a/src/main/driver_unified.cpp b/src/main/driver_unified.cpp index ec141d13a..9488b5c6d 100644 --- a/src/main/driver_unified.cpp +++ b/src/main/driver_unified.cpp @@ -121,9 +121,9 @@ int runCvc4(int argc, char* argv[], Options& opts) { segvSpin = opts.getSegvSpin(); // If in competition mode, set output stream option to flush immediately -#ifdef CVC4_COMPETITION_MODE +#ifdef CVC5_COMPETITION_MODE *(opts.getOut()) << unitbuf; -#endif /* CVC4_COMPETITION_MODE */ +#endif /* CVC5_COMPETITION_MODE */ // We only accept one input file if(filenames.size() > 1) { @@ -260,11 +260,11 @@ int runCvc4(int argc, char* argv[], Options& opts) { opts); if( inputFromStdin ) { -#if defined(CVC4_COMPETITION_MODE) && !defined(CVC4_SMTCOMP_APPLICATION_TRACK) +#if defined(CVC5_COMPETITION_MODE) && !defined(CVC5_SMTCOMP_APPLICATION_TRACK) parserBuilder.withStreamInput(cin); -#else /* CVC4_COMPETITION_MODE && !CVC4_SMTCOMP_APPLICATION_TRACK */ +#else /* CVC5_COMPETITION_MODE && !CVC5_SMTCOMP_APPLICATION_TRACK */ parserBuilder.withLineBufferedStreamInput(cin); -#endif /* CVC4_COMPETITION_MODE && !CVC4_SMTCOMP_APPLICATION_TRACK */ +#endif /* CVC5_COMPETITION_MODE && !CVC5_SMTCOMP_APPLICATION_TRACK */ } vector< vector > allCommands; @@ -416,11 +416,11 @@ int runCvc4(int argc, char* argv[], Options& opts) { opts); if( inputFromStdin ) { -#if defined(CVC4_COMPETITION_MODE) && !defined(CVC4_SMTCOMP_APPLICATION_TRACK) +#if defined(CVC5_COMPETITION_MODE) && !defined(CVC5_SMTCOMP_APPLICATION_TRACK) parserBuilder.withStreamInput(cin); -#else /* CVC4_COMPETITION_MODE && !CVC4_SMTCOMP_APPLICATION_TRACK */ +#else /* CVC5_COMPETITION_MODE && !CVC5_SMTCOMP_APPLICATION_TRACK */ parserBuilder.withLineBufferedStreamInput(cin); -#endif /* CVC4_COMPETITION_MODE && !CVC4_SMTCOMP_APPLICATION_TRACK */ +#endif /* CVC5_COMPETITION_MODE && !CVC5_SMTCOMP_APPLICATION_TRACK */ } std::unique_ptr parser(parserBuilder.build()); @@ -461,26 +461,26 @@ int runCvc4(int argc, char* argv[], Options& opts) { returnValue = 1; } -#ifdef CVC4_COMPETITION_MODE +#ifdef CVC5_COMPETITION_MODE opts.flushOut(); // exit, don't return (don't want destructors to run) // _exit() from unistd.h doesn't run global destructors // or other on_exit/atexit stuff. _exit(returnValue); -#endif /* CVC4_COMPETITION_MODE */ +#endif /* CVC5_COMPETITION_MODE */ totalTime.reset(); pExecutor->flushOutputStreams(); -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG if(opts.getEarlyExit() && opts.wasSetByUserEarlyExit()) { _exit(returnValue); } -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ if(opts.getEarlyExit()) { _exit(returnValue); } -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ } pExecutor.reset(); diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index 0ddd8707a..e6ae7ad5d 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -261,7 +261,7 @@ restart: if (!d_usingEditline) { /* Extract the newline delimiter from the stream too */ - int c CVC4_UNUSED = d_in.get(); + int c CVC5_UNUSED = d_in.get(); Assert(c == '\n'); Debug("interactive") << "Next char is '" << (char)c << "'" << endl << flush; diff --git a/src/main/main.cpp b/src/main/main.cpp index 2a8bc7ab2..37c122732 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -50,14 +50,14 @@ int main(int argc, char* argv[]) { try { return runCvc4(argc, argv, opts); } catch(OptionException& e) { -#ifdef CVC4_COMPETITION_MODE +#ifdef CVC5_COMPETITION_MODE *opts.getOut() << "unknown" << endl; #endif cerr << "(error \"" << e << "\")" << endl << endl << "Please use --help to get help on command-line options." << endl; } catch(Exception& e) { -#ifdef CVC4_COMPETITION_MODE +#ifdef CVC5_COMPETITION_MODE *opts.getOut() << "unknown" << endl; #endif if (language::isOutputLang_smt2(opts.getOutputLanguage())) diff --git a/src/main/main.h b/src/main/main.h index 3f35a9ad4..c263e9d7a 100644 --- a/src/main/main.h +++ b/src/main/main.h @@ -54,7 +54,7 @@ class TotalTimer extern std::unique_ptr totalTime; /** - * If true, will not spin on segfault even when CVC4_DEBUG is on. + * If true, will not spin on segfault even when CVC5_DEBUG is on. * Useful for nightly regressions, noninteractive performance runs * etc. See util.cpp. */ diff --git a/src/main/signal_handlers.cpp b/src/main/signal_handlers.cpp index 02544c7e3..a29872c95 100644 --- a/src/main/signal_handlers.cpp +++ b/src/main/signal_handlers.cpp @@ -47,7 +47,7 @@ namespace cvc5 { namespace main { /** - * If true, will not spin on segfault even when CVC4_DEBUG is on. + * If true, will not spin on segfault even when CVC5_DEBUG is on. * Useful for nightly regressions, noninteractive performance runs * etc. */ @@ -103,7 +103,7 @@ void segv_handler(int sig, siginfo_t* info, void* c) { uintptr_t extent = reinterpret_cast(cvc4StackBase) - cvc4StackSize; uintptr_t addr = reinterpret_cast(info->si_addr); -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG safe_print(STDERR_FILENO, "CVC4 suffered a segfault in DEBUG mode.\n"); safe_print(STDERR_FILENO, "Offending address is "); safe_print(STDERR_FILENO, info->si_addr); @@ -148,7 +148,7 @@ void segv_handler(int sig, siginfo_t* info, void* c) sleep(60); } } -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ safe_print(STDERR_FILENO, "CVC4 suffered a segfault.\n"); safe_print(STDERR_FILENO, "Offending address is "); safe_print(STDERR_FILENO, info->si_addr); @@ -167,14 +167,14 @@ void segv_handler(int sig, siginfo_t* info, void* c) } print_statistics(); abort(); -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ } #endif /* HAVE_SIGALTSTACK */ /** Handler for SIGILL (illegal instruction). */ void ill_handler(int sig, siginfo_t* info, void*) { -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG safe_print(STDERR_FILENO, "CVC4 executed an illegal instruction in DEBUG mode.\n"); if (!segvSpin) @@ -201,11 +201,11 @@ void ill_handler(int sig, siginfo_t* info, void*) sleep(60); } } -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ safe_print(STDERR_FILENO, "CVC4 executed an illegal instruction.\n"); print_statistics(); abort(); -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ } #endif /* __WIN32__ */ @@ -215,7 +215,7 @@ static terminate_handler default_terminator; void cvc4terminate() { set_terminate(default_terminator); -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG LastExceptionBuffer* current = LastExceptionBuffer::getCurrent(); LastExceptionBuffer::setCurrent(NULL); delete current; @@ -227,18 +227,18 @@ void cvc4terminate() "(Don't do that.)\n"); print_statistics(); default_terminator(); -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ safe_print(STDERR_FILENO, "CVC4 was terminated by the C++ runtime.\n" "Perhaps an exception was thrown during stack unwinding.\n"); print_statistics(); default_terminator(); -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ } void install() { -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG LastExceptionBuffer::setCurrent(new LastExceptionBuffer()); #endif diff --git a/src/options/mkoptions.py b/src/options/mkoptions.py index 4dc8880b1..9fbcf7158 100644 --- a/src/options/mkoptions.py +++ b/src/options/mkoptions.py @@ -92,7 +92,7 @@ g_getopt_long_start = 256 ### Source code templates -TPL_HOLDER_MACRO_NAME = 'CVC4_OPTIONS__{id}__FOR_OPTION_HOLDER' +TPL_HOLDER_MACRO_NAME = 'CVC5_OPTIONS__{id}__FOR_OPTION_HOLDER' TPL_RUN_HANDLER = \ """template <> options::{name}__option_t::type runHandlerAndPredicates( diff --git a/src/options/options_handler.cpp b/src/options/options_handler.cpp index ccffd17ec..2dcf26a95 100644 --- a/src/options/options_handler.cpp +++ b/src/options/options_handler.cpp @@ -95,24 +95,24 @@ void OptionsHandler::checkInstWhenMode(std::string option, InstWhenMode mode) // theory/bv/options_handlers.h void OptionsHandler::abcEnabledBuild(std::string option, bool value) { -#ifndef CVC4_USE_ABC +#ifndef CVC5_USE_ABC if(value) { std::stringstream ss; ss << "option `" << option << "' requires an abc-enabled build of CVC4; this binary was not built with abc support"; throw OptionException(ss.str()); } -#endif /* CVC4_USE_ABC */ +#endif /* CVC5_USE_ABC */ } void OptionsHandler::abcEnabledBuild(std::string option, std::string value) { -#ifndef CVC4_USE_ABC +#ifndef CVC5_USE_ABC if(!value.empty()) { std::stringstream ss; ss << "option `" << option << "' requires an abc-enabled build of CVC4; this binary was not built with abc support"; throw OptionException(ss.str()); } -#endif /* CVC4_USE_ABC */ +#endif /* CVC5_USE_ABC */ } void OptionsHandler::checkBvSatSolver(std::string option, SatSolverMode m) @@ -255,13 +255,13 @@ void OptionsHandler::setProduceAssertions(std::string option, bool value) void OptionsHandler::statsEnabledBuild(std::string option, bool value) { -#ifndef CVC4_STATISTICS_ON +#ifndef CVC5_STATISTICS_ON if(value) { std::stringstream ss; ss << "option `" << option << "' requires a statistics-enabled build of CVC4; this binary was not built with statistics support"; throw OptionException(ss.str()); } -#endif /* CVC4_STATISTICS_ON */ +#endif /* CVC5_STATISTICS_ON */ } void OptionsHandler::threadN(std::string option) { diff --git a/src/options/options_handler.h b/src/options/options_handler.h index 7d1b1802a..9b1271c8b 100644 --- a/src/options/options_handler.h +++ b/src/options/options_handler.h @@ -124,8 +124,8 @@ public: template void OptionsHandler::checkSatSolverEnabled(std::string option, T m) { -#if !defined(CVC4_USE_CRYPTOMINISAT) && !defined(CVC4_USE_CADICAL) \ - && !defined(CVC4_USE_KISSAT) +#if !defined(CVC5_USE_CRYPTOMINISAT) && !defined(CVC5_USE_CADICAL) \ + && !defined(CVC5_USE_KISSAT) std::stringstream ss; ss << "option `" << option << "' requires CVC4 to be built with CryptoMiniSat or CaDiCaL or Kissat"; diff --git a/src/options/options_template.cpp b/src/options/options_template.cpp index f158f29e6..520cc491c 100644 --- a/src/options/options_template.cpp +++ b/src/options/options_template.cpp @@ -16,11 +16,11 @@ #if !defined(_BSD_SOURCE) && defined(__MINGW32__) && !defined(__MINGW64__) // force use of optreset; mingw32 croaks on argv-switching otherwise -# include "cvc4autoconfig.h" -# define _BSD_SOURCE -# undef HAVE_DECL_OPTRESET -# define HAVE_DECL_OPTRESET 1 -# define CVC4_IS_NOT_REALLY_BSD +#include "cvc4autoconfig.h" +#define _BSD_SOURCE +#undef HAVE_DECL_OPTRESET +#define HAVE_DECL_OPTRESET 1 +#define CVC5_IS_NOT_REALLY_BSD #endif /* !_BSD_SOURCE && __MINGW32__ && !__MINGW64__ */ #ifdef __MINGW64__ @@ -30,9 +30,9 @@ extern int optreset; #include // clean up -#ifdef CVC4_IS_NOT_REALLY_BSD +#ifdef CVC5_IS_NOT_REALLY_BSD # undef _BSD_SOURCE -#endif /* CVC4_IS_NOT_REALLY_BSD */ +#endif /* CVC5_IS_NOT_REALLY_BSD */ #include #include @@ -252,11 +252,11 @@ void Options::setListener(OptionsListener* ol) { d_olisten = ol; } ${custom_handlers}$ -#if defined(CVC4_MUZZLED) || defined(CVC4_COMPETITION_MODE) +#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) # define DO_SEMANTIC_CHECKS_BY_DEFAULT false -#else /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */ +#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ # define DO_SEMANTIC_CHECKS_BY_DEFAULT true -#endif /* CVC4_MUZZLED || CVC4_COMPETITION_MODE */ +#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ options::OptionsHolder::OptionsHolder() : ${module_defaults}$ diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt index d131fa7b3..08dafe65c 100644 --- a/src/parser/CMakeLists.txt +++ b/src/parser/CMakeLists.txt @@ -99,7 +99,7 @@ endforeach() # libcvc4parser configuration add_library(cvc4parser ${libcvc4parser_src_files}) -set_target_properties(cvc4parser PROPERTIES SOVERSION ${CVC4_SOVERSION}) +set_target_properties(cvc4parser PROPERTIES SOVERSION ${CVC5_SOVERSION}) target_compile_definitions(cvc4parser PRIVATE -D__BUILDING_CVC4PARSERLIB) target_link_libraries(cvc4parser PUBLIC cvc4) target_link_libraries(cvc4parser PRIVATE ANTLR3) @@ -119,7 +119,7 @@ install(TARGETS cvc4parser # unresolved symbols when linking against libcvc4parser. # -Wl,--export-all-symbols makes sure that all symbols are exported when # building a DLL. -if(CVC4_WINDOWS_BUILD) +if(CVC5_WINDOWS_BUILD) set_target_properties(cvc4parser PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols") endif() diff --git a/src/parser/antlr_input.cpp b/src/parser/antlr_input.cpp index a818f4148..8a96fec11 100644 --- a/src/parser/antlr_input.cpp +++ b/src/parser/antlr_input.cpp @@ -42,7 +42,7 @@ namespace cvc5 { namespace parser { // These functions exactly wrap the antlr3 source inconsistencies. -// These are the only location CVC4_ANTLR3_OLD_INPUT_STREAM ifdefs appear. +// These are the only location CVC5_ANTLR3_OLD_INPUT_STREAM ifdefs appear. // No other sanity checking happens; pANTLR3_INPUT_STREAM newAntlr3BufferedStream(std::istream& input, const std::string& name, @@ -58,13 +58,13 @@ pANTLR3_INPUT_STREAM newAntlr3BufferedStream(std::istream& input, pANTLR3_INPUT_STREAM inputStream = NULL; pANTLR3_UINT8 name_duplicate = (pANTLR3_UINT8) strdup(name.c_str()); -#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM +#ifdef CVC5_ANTLR3_OLD_INPUT_STREAM inputStream = antlr3LineBufferedStreamNew(input, 0, name_duplicate, line_buffer); -#else /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#else /* CVC5_ANTLR3_OLD_INPUT_STREAM */ inputStream = antlr3LineBufferedStreamNew(input, ANTLR3_ENC_8BIT, name_duplicate, line_buffer); -#endif /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ free(name_duplicate); return inputStream; @@ -75,11 +75,11 @@ pANTLR3_INPUT_STREAM newAntlr3FileStream(const std::string& name){ pANTLR3_UINT8 name_duplicate = (pANTLR3_UINT8) strdup(name.c_str()); // libantlr3c v3.2 isn't source-compatible with v3.4 -#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM +#ifdef CVC5_ANTLR3_OLD_INPUT_STREAM input = antlr3AsciiFileStreamNew(name_duplicate); -#else /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#else /* CVC5_ANTLR3_OLD_INPUT_STREAM */ input = antlr3FileStreamNew(name_duplicate, ANTLR3_ENC_8BIT); -#endif /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ free(name_duplicate); return input; @@ -92,14 +92,14 @@ pANTLR3_INPUT_STREAM newAntrl3InPlaceStream(pANTLR3_UINT8 basep, pANTLR3_UINT8 name_duplicate = (pANTLR3_UINT8) strdup(name.c_str()); pANTLR3_INPUT_STREAM inputStream = NULL; /* Create an ANTLR input backed by the buffer. */ -#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM +#ifdef CVC5_ANTLR3_OLD_INPUT_STREAM inputStream = antlr3NewAsciiStringInPlaceStream(basep, size, name_duplicate); -#else /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#else /* CVC5_ANTLR3_OLD_INPUT_STREAM */ inputStream = antlr3StringStreamNew(basep, ANTLR3_ENC_8BIT, size, name_duplicate); -#endif /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ free(name_duplicate); return inputStream; } diff --git a/src/parser/antlr_line_buffered_input.cpp b/src/parser/antlr_line_buffered_input.cpp index 1dd7c953c..bd4c910f9 100644 --- a/src/parser/antlr_line_buffered_input.cpp +++ b/src/parser/antlr_line_buffered_input.cpp @@ -341,25 +341,25 @@ pANTLR3_INPUT_STREAM antlr3LineBufferedStreamNew(std::istream& in, input->SetNewLineChar = bufferedInputSetNewLineChar; input->setUcaseLA = bufferedInputSetUcaseLA; -#ifndef CVC4_ANTLR3_OLD_INPUT_STREAM - // We have the data in memory now so we can deal with it according to - // the encoding scheme we were given by the user. - // - input->encoding = encoding; -#endif /* ! CVC4_ANTLR3_OLD_INPUT_STREAM */ +#ifndef CVC5_ANTLR3_OLD_INPUT_STREAM + // We have the data in memory now so we can deal with it according to + // the encoding scheme we were given by the user. + // + input->encoding = encoding; +#endif /* ! CVC5_ANTLR3_OLD_INPUT_STREAM */ - // Now we need to work out the endian type and install any - // API functions that differ from 8Bit - // - setupInputStream(input); + // Now we need to work out the endian type and install any + // API functions that differ from 8Bit + // + setupInputStream(input); - // Now we can set up the file name - // - input->istream->streamName = - input->strFactory->newStr8(input->strFactory, name); - input->fileName = input->istream->streamName; + // Now we can set up the file name + // + input->istream->streamName = + input->strFactory->newStr8(input->strFactory, name); + input->fileName = input->istream->streamName; - return input; + return input; } static pANTLR3_INPUT_STREAM antlr3CreateLineBufferedStream( @@ -391,16 +391,16 @@ static pANTLR3_INPUT_STREAM antlr3CreateLineBufferedStream( // Call the common 8 bit input stream handler // initialization. // -#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM +#ifdef CVC5_ANTLR3_OLD_INPUT_STREAM antlr3AsciiSetupStream(input, ANTLR3_CHARSTREAM); -#else /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#else /* CVC5_ANTLR3_OLD_INPUT_STREAM */ antlr38BitSetupStream(input); // In some libantlr3c 3.4-beta versions, this call is not included in the // above. // This is probably an erroneously-deleted line in the libantlr3c source since // 3.2. antlr3GenericSetupStream(input); -#endif /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ input->sizeBuf = 0; input->newlineChar = LineBuffer::NewLineChar; diff --git a/src/parser/antlr_tracing.h b/src/parser/antlr_tracing.h index 317b6ea98..e001512e6 100644 --- a/src/parser/antlr_tracing.h +++ b/src/parser/antlr_tracing.h @@ -18,8 +18,8 @@ #ifndef CVC5__PARSER__ANTLR_TRACING_H #define CVC5__PARSER__ANTLR_TRACING_H -// only enable the hack with -DCVC4_TRACE_ANTLR -#ifdef CVC4_TRACE_ANTLR +// only enable the hack with -DCVC5_TRACE_ANTLR +#ifdef CVC5_TRACE_ANTLR #include #include @@ -81,6 +81,6 @@ static struct __Cvc4System { #undef ANTLR3_PRINTF #define ANTLR3_PRINTF(args...) {int failed=0;printf(args);} -#endif /* CVC4_TRACE_ANTLR */ +#endif /* CVC5_TRACE_ANTLR */ #endif /* CVC5__PARSER__ANTLR_TRACING_H */ diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g index 0b27b45fa..7b036fff4 100644 --- a/src/parser/cvc/Cvc.g +++ b/src/parser/cvc/Cvc.g @@ -525,7 +525,7 @@ api::Term addNots(api::Solver* s, size_t n, api::Term e) { * the lexer headers for two grammars AND (b) uses the token symbol definitions. */ #pragma GCC system_header -#if defined(CVC4_COMPETITION_MODE) && !defined(CVC4_SMTCOMP_APPLICATION_TRACK) +#if defined(CVC5_COMPETITION_MODE) && !defined(CVC5_SMTCOMP_APPLICATION_TRACK) /* This improves performance by ~10 percent on big inputs. * This option is only valid if we know the input is ASCII (or some 8-bit encoding). * If we know the input is UTF-16, we can use ANTLR3_INLINE_INPUT_UTF16. @@ -533,7 +533,7 @@ api::Term addNots(api::Solver* s, size_t n, api::Term e) { */ # define ANTLR3_INLINE_INPUT_ASCII # define ANTLR3_INLINE_INPUT_8BIT -#endif /* CVC4_COMPETITION_MODE && !CVC4_SMTCOMP_APPLICATION_TRACK */ +#endif /* CVC5_COMPETITION_MODE && !CVC5_SMTCOMP_APPLICATION_TRACK */ #include "parser/antlr_input.h" #include "parser/antlr_tracing.h" diff --git a/src/parser/memory_mapped_input_buffer.cpp b/src/parser/memory_mapped_input_buffer.cpp index 4259e328f..b1f1b8924 100644 --- a/src/parser/memory_mapped_input_buffer.cpp +++ b/src/parser/memory_mapped_input_buffer.cpp @@ -70,11 +70,11 @@ pANTLR3_INPUT_STREAM MemoryMappedInputBufferNew(const std::string& filename) { // Call the common 8 bit ASCII input stream handler // Initializer type thingy doobry function. // -#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM +#ifdef CVC5_ANTLR3_OLD_INPUT_STREAM antlr3AsciiSetupStream(input, ANTLR3_CHARSTREAM); -#else /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#else /* CVC5_ANTLR3_OLD_INPUT_STREAM */ antlr38BitSetupStream(input); -#endif /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ // Now we can set up the file name // diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 00cf8e75a..66800ff53 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -48,7 +48,7 @@ options { */ #pragma GCC system_header -#if defined(CVC4_COMPETITION_MODE) && !defined(CVC4_SMTCOMP_APPLICATION_TRACK) +#if defined(CVC5_COMPETITION_MODE) && !defined(CVC5_SMTCOMP_APPLICATION_TRACK) /* This improves performance by ~10 percent on big inputs. * This option is only valid if we know the input is ASCII (or some 8-bit encoding). * If we know the input is UTF-16, we can use ANTLR3_INLINE_INPUT_UTF16. @@ -56,7 +56,7 @@ options { */ # define ANTLR3_INLINE_INPUT_ASCII # define ANTLR3_INLINE_INPUT_8BIT -#endif /* CVC4_COMPETITION_MODE && !CVC4_SMTCOMP_APPLICATION_TRACK */ +#endif /* CVC5_COMPETITION_MODE && !CVC5_SMTCOMP_APPLICATION_TRACK */ #include "parser/antlr_tracing.h" diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp index a1659dcc2..c35582550 100644 --- a/src/parser/smt2/smt2.cpp +++ b/src/parser/smt2/smt2.cpp @@ -778,11 +778,11 @@ static bool newInputStream(const std::string& filename, pANTLR3_LEXER lexer) { // in C target runtime. // pANTLR3_INPUT_STREAM in; -#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM +#ifdef CVC5_ANTLR3_OLD_INPUT_STREAM in = antlr3AsciiFileStreamNew((pANTLR3_UINT8) filename.c_str()); -#else /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#else /* CVC5_ANTLR3_OLD_INPUT_STREAM */ in = antlr3FileStreamNew((pANTLR3_UINT8) filename.c_str(), ANTLR3_ENC_8BIT); -#endif /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ if( in == NULL ) { Debug("parser") << "Can't open " << filename << std::endl; return false; diff --git a/src/parser/tptp/tptp.cpp b/src/parser/tptp/tptp.cpp index 2f770a58d..0283554bc 100644 --- a/src/parser/tptp/tptp.cpp +++ b/src/parser/tptp/tptp.cpp @@ -114,11 +114,11 @@ bool newInputStream(std::string fileName, pANTLR3_LEXER lexer, std::vector< pANT // in C target runtime. // pANTLR3_INPUT_STREAM in; -#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM +#ifdef CVC5_ANTLR3_OLD_INPUT_STREAM in = antlr3AsciiFileStreamNew((pANTLR3_UINT8) fileName.c_str()); -#else /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#else /* CVC5_ANTLR3_OLD_INPUT_STREAM */ in = antlr3FileStreamNew((pANTLR3_UINT8) fileName.c_str(), ANTLR3_ENC_8BIT); -#endif /* CVC4_ANTLR3_OLD_INPUT_STREAM */ +#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ if(in == NULL) { Debug("parser") << "Can't open " << fileName << std::endl; return false; diff --git a/src/preprocessing/passes/bv_gauss.cpp b/src/preprocessing/passes/bv_gauss.cpp index 6b8b7af2f..ebdc9aba2 100644 --- a/src/preprocessing/passes/bv_gauss.cpp +++ b/src/preprocessing/passes/bv_gauss.cpp @@ -263,7 +263,7 @@ BVGauss::Result BVGauss::gaussElim(Integer prime, size_t nrows = lhs.size(); size_t ncols = lhs[0].size(); - #ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (size_t i = 1; i < nrows; ++i) Assert(lhs[i].size() == ncols); #endif /* (1) if element in pivot column is non-zero and != 1, divide row elements @@ -284,7 +284,7 @@ BVGauss::Result BVGauss::gaussElim(Integer prime, /* lhs[j][pcol]: element in pivot column */ for (size_t j = prow; j < nrows; ++j) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (size_t k = 0; k < pcol; ++k) { Assert(lhs[j][k] == 0); @@ -577,7 +577,7 @@ BVGauss::Result BVGauss::gaussElimRewriteForUrem( return BVGauss::Result::INVALID; } size_t nrows = vars.begin()->second.size(); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (const auto& p : vars) { Assert(p.second.size() == nrows); @@ -597,7 +597,7 @@ BVGauss::Result BVGauss::gaussElimRewriteForUrem( } } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (const auto& row : lhs) { Assert(row.size() == nvars); diff --git a/src/preprocessing/passes/bv_to_int.cpp b/src/preprocessing/passes/bv_to_int.cpp index 28dcc1949..9809adf63 100644 --- a/src/preprocessing/passes/bv_to_int.cpp +++ b/src/preprocessing/passes/bv_to_int.cpp @@ -155,7 +155,7 @@ Node BVToInt::eliminationPass(Node n) current = toVisit.back(); // assert that the node is binarized // The following variable is only used in assertions - CVC4_UNUSED kind::Kind_t k = current.getKind(); + CVC5_UNUSED kind::Kind_t k = current.getKind(); uint64_t numChildren = current.getNumChildren(); Assert((numChildren == 2) || !(k == kind::BITVECTOR_PLUS || k == kind::BITVECTOR_MULT @@ -342,7 +342,7 @@ Node BVToInt::translateWithChildren(Node original, Assert(oldKind != kind::BITVECTOR_ULTBV); Assert(oldKind != kind::BITVECTOR_SLTBV); // The following variable will only be used in assertions. - CVC4_UNUSED uint64_t originalNumChildren = original.getNumChildren(); + CVC5_UNUSED uint64_t originalNumChildren = original.getNumChildren(); Node returnNode; switch (oldKind) { diff --git a/src/preprocessing/passes/miplib_trick.cpp b/src/preprocessing/passes/miplib_trick.cpp index 9ca58c334..687cb3a96 100644 --- a/src/preprocessing/passes/miplib_trick.cpp +++ b/src/preprocessing/passes/miplib_trick.cpp @@ -537,8 +537,8 @@ PreprocessingPassResult MipLibTrick::applyInternal( Node n = Rewriter::rewrite(geq.andNode(leq)); assertionsToPreprocess->push_back(n); TrustSubstitutionMap tnullMap(&fakeContext, nullptr); - CVC4_UNUSED SubstitutionMap& nullMap = tnullMap.get(); - Theory::PPAssertStatus status CVC4_UNUSED; // just for assertions + CVC5_UNUSED SubstitutionMap& nullMap = tnullMap.get(); + Theory::PPAssertStatus status CVC5_UNUSED; // just for assertions status = te->solve(tgeq, tnullMap); Assert(status == Theory::PP_ASSERT_STATUS_UNSOLVED) << "unexpected solution from arith's ppAssert()"; diff --git a/src/preprocessing/passes/non_clausal_simp.cpp b/src/preprocessing/passes/non_clausal_simp.cpp index e5b0cd39b..8992dad5e 100644 --- a/src/preprocessing/passes/non_clausal_simp.cpp +++ b/src/preprocessing/passes/non_clausal_simp.cpp @@ -131,7 +131,7 @@ PreprocessingPassResult NonClausalSimp::applyInternal( // No conflict, go through the literals and solve them context::Context* u = d_preprocContext->getUserContext(); TrustSubstitutionMap& ttls = d_preprocContext->getTopLevelSubstitutions(); - CVC4_UNUSED SubstitutionMap& top_level_substs = ttls.get(); + CVC5_UNUSED SubstitutionMap& top_level_substs = ttls.get(); // constant propagations std::shared_ptr constantPropagations = std::make_shared( @@ -261,7 +261,7 @@ PreprocessingPassResult NonClausalSimp::applyInternal( } } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS // NOTE: When debugging this code, consider moving this check inside of the // loop over propagator->getLearnedLiterals(). This check has been moved // outside because it is costly for certain inputs (see bug 508). @@ -288,7 +288,7 @@ PreprocessingPassResult NonClausalSimp::applyInternal( Assert(Rewriter::rewrite((*pos).first) == (*pos).first); Assert(cps.apply((*pos).second) == (*pos).second); } -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ // Resize the learnt Trace("non-clausal-simplify") diff --git a/src/preprocessing/passes/unconstrained_simplifier.cpp b/src/preprocessing/passes/unconstrained_simplifier.cpp index 2c01bd6d2..69ca1fa84 100644 --- a/src/preprocessing/passes/unconstrained_simplifier.cpp +++ b/src/preprocessing/passes/unconstrained_simplifier.cpp @@ -280,7 +280,7 @@ void UnconstrainedSimplifier::processUnconstrained() checkParent = true; break; } - CVC4_FALLTHROUGH; + CVC5_FALLTHROUGH; case kind::BITVECTOR_COMP: case kind::LT: case kind::LEQ: @@ -454,7 +454,7 @@ void UnconstrainedSimplifier::processUnconstrained() { break; } - CVC4_FALLTHROUGH; + CVC5_FALLTHROUGH; case kind::XOR: case kind::BITVECTOR_XOR: case kind::BITVECTOR_XNOR: diff --git a/src/preprocessing/util/ite_utilities.cpp b/src/preprocessing/util/ite_utilities.cpp index 5433368fa..093f4a573 100644 --- a/src/preprocessing/util/ite_utilities.cpp +++ b/src/preprocessing/util/ite_utilities.cpp @@ -1476,7 +1476,7 @@ uint32_t countReachable(TNode x, Kind k) Node ITESimplifier::simpITEAtom(TNode atom) { - static int CVC4_UNUSED instance = 0; + static int CVC5_UNUSED instance = 0; Debug("ite::atom") << "still simplifying " << (++instance) << endl; Node attempt = transformAtom(atom); Debug("ite::atom") << " finished " << instance << endl; diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index b0019d272..4a64c220a 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -2098,14 +2098,14 @@ static void toStream(std::ostream& out, const CommandInterrupted* s, Variant v) static void toStream(std::ostream& out, const CommandUnsupported* s, Variant v) { -#ifdef CVC4_COMPETITION_MODE +#ifdef CVC5_COMPETITION_MODE // if in competition mode, lie and say we're ok // (we have nothing to lose by saying success, and everything to lose // if we say "unsupported") out << "success" << endl; -#else /* CVC4_COMPETITION_MODE */ +#else /* CVC5_COMPETITION_MODE */ out << "unsupported" << endl; -#endif /* CVC4_COMPETITION_MODE */ +#endif /* CVC5_COMPETITION_MODE */ } static void errorToStream(std::ostream& out, std::string message, Variant v) { diff --git a/src/prop/bvminisat/simp/SimpSolver.cc b/src/prop/bvminisat/simp/SimpSolver.cc index 96ab5b526..e399fac4c 100644 --- a/src/prop/bvminisat/simp/SimpSolver.cc +++ b/src/prop/bvminisat/simp/SimpSolver.cc @@ -166,7 +166,7 @@ lbool SimpSolver::solve_(bool do_simp, bool turn_off_simp) bool SimpSolver::addClause_(vec& ps, ClauseId& id) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (int i = 0; i < ps.size(); i++) Assert(!isEliminated(var(ps[i]))); #endif diff --git a/src/prop/cadical.cpp b/src/prop/cadical.cpp index cac015904..5abdada71 100644 --- a/src/prop/cadical.cpp +++ b/src/prop/cadical.cpp @@ -16,7 +16,7 @@ #include "prop/cadical.h" -#ifdef CVC4_USE_CADICAL +#ifdef CVC5_USE_CADICAL #include "base/check.h" @@ -202,4 +202,4 @@ CadicalSolver::Statistics::~Statistics() { } // namespace prop } // namespace cvc5 -#endif // CVC4_USE_CADICAL +#endif // CVC5_USE_CADICAL diff --git a/src/prop/cadical.h b/src/prop/cadical.h index ed4c166d4..e8a36d0a0 100644 --- a/src/prop/cadical.h +++ b/src/prop/cadical.h @@ -19,7 +19,7 @@ #ifndef CVC5__PROP__CADICAL_H #define CVC5__PROP__CADICAL_H -#ifdef CVC4_USE_CADICAL +#ifdef CVC5_USE_CADICAL #include "prop/sat_solver.h" #include "util/stats_timer.h" @@ -105,5 +105,5 @@ class CadicalSolver : public SatSolver } // namespace prop } // namespace cvc5 -#endif // CVC4_USE_CADICAL +#endif // CVC5_USE_CADICAL #endif // CVC5__PROP__CADICAL_H diff --git a/src/prop/cnf_stream.cpp b/src/prop/cnf_stream.cpp index 10c84f582..111c6c2df 100644 --- a/src/prop/cnf_stream.cpp +++ b/src/prop/cnf_stream.cpp @@ -772,7 +772,7 @@ void CnfStream::convertAndAssert(TNode node, bool negated) convertAndAssertIff(node, negated); break; } - CVC4_FALLTHROUGH; + CVC5_FALLTHROUGH; default: { Node nnode = node; diff --git a/src/prop/cryptominisat.cpp b/src/prop/cryptominisat.cpp index ce5e4e2b0..5e0b056dc 100644 --- a/src/prop/cryptominisat.cpp +++ b/src/prop/cryptominisat.cpp @@ -14,7 +14,7 @@ ** Implementation of the cryptominisat for cvc4 (bitvectors). **/ -#ifdef CVC4_USE_CRYPTOMINISAT +#ifdef CVC5_USE_CRYPTOMINISAT #include "prop/cryptominisat.h" diff --git a/src/prop/cryptominisat.h b/src/prop/cryptominisat.h index ceed47d79..b217cee9c 100644 --- a/src/prop/cryptominisat.h +++ b/src/prop/cryptominisat.h @@ -19,7 +19,7 @@ #ifndef CVC5__PROP__CRYPTOMINISAT_H #define CVC5__PROP__CRYPTOMINISAT_H -#ifdef CVC4_USE_CRYPTOMINISAT +#ifdef CVC5_USE_CRYPTOMINISAT #include "prop/sat_solver.h" #include "util/stats_timer.h" @@ -108,5 +108,5 @@ class CryptoMinisatSolver : public SatSolver } // namespace prop } // namespace cvc5 -#endif // CVC4_USE_CRYPTOMINISAT +#endif // CVC5_USE_CRYPTOMINISAT #endif // CVC5__PROP__CRYPTOMINISAT_H diff --git a/src/prop/kissat.cpp b/src/prop/kissat.cpp index 10b7b07de..949af2901 100644 --- a/src/prop/kissat.cpp +++ b/src/prop/kissat.cpp @@ -16,7 +16,7 @@ #include "prop/kissat.h" -#ifdef CVC4_USE_KISSAT +#ifdef CVC5_USE_KISSAT #include "base/check.h" @@ -175,4 +175,4 @@ KissatSolver::Statistics::~Statistics() } // namespace prop } // namespace cvc5 -#endif // CVC4_USE_KISSAT +#endif // CVC5_USE_KISSAT diff --git a/src/prop/kissat.h b/src/prop/kissat.h index 2ab38dbab..b2bc8e074 100644 --- a/src/prop/kissat.h +++ b/src/prop/kissat.h @@ -19,7 +19,7 @@ #ifndef CVC5__PROP__KISSAT_H #define CVC5__PROP__KISSAT_H -#ifdef CVC4_USE_KISSAT +#ifdef CVC5_USE_KISSAT #include "prop/sat_solver.h" #include "util/stats_timer.h" @@ -99,5 +99,5 @@ class KissatSolver : public SatSolver } // namespace prop } // namespace cvc5 -#endif // CVC4_USE_KISSAT +#endif // CVC5_USE_KISSAT #endif // CVC5__PROP__KISSAT_H diff --git a/src/prop/minisat/simp/SimpSolver.cc b/src/prop/minisat/simp/SimpSolver.cc index e29c1032a..e8179c5fe 100644 --- a/src/prop/minisat/simp/SimpSolver.cc +++ b/src/prop/minisat/simp/SimpSolver.cc @@ -172,10 +172,11 @@ lbool SimpSolver::solve_(bool do_simp, bool turn_off_simp) bool SimpSolver::addClause_(vec& ps, bool removable, ClauseId& id) { -#ifdef CVC4_ASSERTIONS - if (use_simplification) { - for (int i = 0; i < ps.size(); i++) Assert(!isEliminated(var(ps[i]))); - } +#ifdef CVC5_ASSERTIONS + if (use_simplification) + { + for (int i = 0; i < ps.size(); i++) Assert(!isEliminated(var(ps[i]))); + } #endif int nclauses = clauses_persistent.size(); diff --git a/src/prop/proof_cnf_stream.cpp b/src/prop/proof_cnf_stream.cpp index 76421db9b..8527950ce 100644 --- a/src/prop/proof_cnf_stream.cpp +++ b/src/prop/proof_cnf_stream.cpp @@ -127,7 +127,7 @@ void ProofCnfStream::convertAndAssert(TNode node, bool negated) convertAndAssertIff(node, negated); break; } - CVC4_FALLTHROUGH; + CVC5_FALLTHROUGH; default: { // negate diff --git a/src/prop/sat_proof_manager.cpp b/src/prop/sat_proof_manager.cpp index 0d075de45..ec29d6bd5 100644 --- a/src/prop/sat_proof_manager.cpp +++ b/src/prop/sat_proof_manager.cpp @@ -352,7 +352,7 @@ void SatProofManager::explainLit( printClause(reason); Trace("sat-proof") << "\n"; } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS // pedantically check that the negation of the literal to explain *does not* // occur in the reason, otherwise we will loop forever for (unsigned i = 0; i < size; ++i) @@ -372,7 +372,7 @@ void SatProofManager::explainLit( Trace("sat-proof") << push; for (unsigned i = 0; i < size; ++i) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS // pedantically make sure that the reason stays the same const Minisat::Clause& reloadedReason = d_solver->ca[reasonRef]; AlwaysAssert(size == static_cast(reloadedReason.size())); diff --git a/src/prop/sat_solver_factory.cpp b/src/prop/sat_solver_factory.cpp index 117210431..90eec9153 100644 --- a/src/prop/sat_solver_factory.cpp +++ b/src/prop/sat_solver_factory.cpp @@ -42,7 +42,7 @@ MinisatSatSolver* SatSolverFactory::createCDCLTMinisat( SatSolver* SatSolverFactory::createCryptoMinisat(StatisticsRegistry* registry, const std::string& name) { -#ifdef CVC4_USE_CRYPTOMINISAT +#ifdef CVC5_USE_CRYPTOMINISAT CryptoMinisatSolver* res = new CryptoMinisatSolver(registry, name); res->init(); return res; @@ -54,7 +54,7 @@ SatSolver* SatSolverFactory::createCryptoMinisat(StatisticsRegistry* registry, SatSolver* SatSolverFactory::createCadical(StatisticsRegistry* registry, const std::string& name) { -#ifdef CVC4_USE_CADICAL +#ifdef CVC5_USE_CADICAL CadicalSolver* res = new CadicalSolver(registry, name); res->init(); return res; @@ -66,7 +66,7 @@ SatSolver* SatSolverFactory::createCadical(StatisticsRegistry* registry, SatSolver* SatSolverFactory::createKissat(StatisticsRegistry* registry, const std::string& name) { -#ifdef CVC4_USE_KISSAT +#ifdef CVC5_USE_KISSAT KissatSolver* res = new KissatSolver(registry, name); res->init(); return res; diff --git a/src/prop/theory_proxy.h b/src/prop/theory_proxy.h index 503b37ed7..e4924ded4 100644 --- a/src/prop/theory_proxy.h +++ b/src/prop/theory_proxy.h @@ -21,7 +21,7 @@ // Just defining this for now, since there's no other SAT solver bindings. // Optional blocks below will be unconditionally included -#define CVC4_USE_MINISAT +#define CVC5_USE_MINISAT #include diff --git a/src/smt/dump.cpp b/src/smt/dump.cpp index c1daf9879..73f26dc92 100644 --- a/src/smt/dump.cpp +++ b/src/smt/dump.cpp @@ -26,7 +26,7 @@ namespace cvc5 { -#if defined(CVC4_DUMPING) && !defined(CVC4_MUZZLE) +#if defined(CVC5_DUMPING) && !defined(CVC5_MUZZLE) CVC4dumpstream& CVC4dumpstream::operator<<(const Command& c) { @@ -54,7 +54,7 @@ CVC4dumpstream& CVC4dumpstream::operator<<(const NodeCommand& nc) return *this; } -#endif /* CVC4_DUMPING && !CVC4_MUZZLE */ +#endif /* CVC5_DUMPING && !CVC5_MUZZLE */ DumpC DumpChannel; diff --git a/src/smt/dump.h b/src/smt/dump.h index 9aeb771dc..6e14fc59f 100644 --- a/src/smt/dump.h +++ b/src/smt/dump.h @@ -26,7 +26,7 @@ namespace cvc5 { class Command; class NodeCommand; -#if defined(CVC4_DUMPING) && !defined(CVC4_MUZZLE) +#if defined(CVC5_DUMPING) && !defined(CVC5_MUZZLE) class CVC4dumpstream { @@ -62,7 +62,7 @@ class CVC4dumpstream CVC4dumpstream& operator<<(const NodeCommand& nc); }; /* class CVC4dumpstream */ -#endif /* CVC4_DUMPING && !CVC4_MUZZLE */ +#endif /* CVC5_DUMPING && !CVC5_MUZZLE */ /** The dump class */ class DumpC diff --git a/src/smt/listeners.cpp b/src/smt/listeners.cpp index e322531a7..e7ea9bb40 100644 --- a/src/smt/listeners.cpp +++ b/src/smt/listeners.cpp @@ -71,7 +71,7 @@ void SmtNodeManagerListener::nmNotifyNewDatatypes( { if (Configuration::isAssertionBuild()) { - for (CVC4_UNUSED const TypeNode& dt : dtts) + for (CVC5_UNUSED const TypeNode& dt : dtts) { Assert(dt.isDatatype()); } diff --git a/src/smt/managed_ostreams.cpp b/src/smt/managed_ostreams.cpp index 09b454cf2..6962ef495 100644 --- a/src/smt/managed_ostreams.cpp +++ b/src/smt/managed_ostreams.cpp @@ -71,13 +71,13 @@ std::string ManagedDumpOStream::defaultSource() const{ void ManagedDumpOStream::initialize(std::ostream* outStream) { -#ifdef CVC4_DUMPING +#ifdef CVC5_DUMPING DumpOstreamUpdate dumpGetStream; dumpGetStream.apply(outStream); -#else /* CVC4_DUMPING */ +#else /* CVC5_DUMPING */ throw OptionException( "The dumping feature was disabled in this build of CVC4."); -#endif /* CVC4_DUMPING */ +#endif /* CVC5_DUMPING */ } void ManagedDumpOStream::addSpecialCases(OstreamOpener* opener) const { diff --git a/src/smt/set_defaults.cpp b/src/smt/set_defaults.cpp index 6c10eeb94..6a5ed52d0 100644 --- a/src/smt/set_defaults.cpp +++ b/src/smt/set_defaults.cpp @@ -1453,7 +1453,7 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) if (logic == LogicInfo("QF_UFNRA")) { -#ifdef CVC4_USE_POLY +#ifdef CVC5_USE_POLY if (!options::nlCad() && !options::nlCad.wasSetByUser()) { options::nlCad.set(true); @@ -1468,7 +1468,7 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) } #endif } -#ifndef CVC4_USE_POLY +#ifndef CVC5_USE_POLY if (options::nlCad()) { if (options::nlCad.wasSetByUser()) diff --git a/src/smt/smt_engine_state.cpp b/src/smt/smt_engine_state.cpp index b33f1e13c..c8f23f7f8 100644 --- a/src/smt/smt_engine_state.cpp +++ b/src/smt/smt_engine_state.cpp @@ -96,7 +96,7 @@ void SmtEngineState::notifyCheckSatResult(bool hasAssumptions, Result r) if (!d_expectedStatus.isUnknown() && !d_status.isUnknown() && d_status != d_expectedStatus) { - CVC4_FATAL() << "Expected result " << d_expectedStatus << " but got " + CVC5_FATAL() << "Expected result " << d_expectedStatus << " but got " << d_status; } // clear expected status diff --git a/src/smt_util/boolean_simplification.h b/src/smt_util/boolean_simplification.h index ef0c3f3de..fb3b90deb 100644 --- a/src/smt_util/boolean_simplification.h +++ b/src/smt_util/boolean_simplification.h @@ -39,7 +39,7 @@ class BooleanSimplification { static bool push_back_associative_commute_recursive( Node n, std::vector& buffer, Kind k, Kind notK, bool negateNode) - CVC4_WARN_UNUSED_RESULT; + CVC5_WARN_UNUSED_RESULT; public: /** @@ -165,8 +165,8 @@ class BooleanSimplification { AssertArgument(n.getKind() == k, n, "expected node to have kind %s", kindToString(k).c_str()); - bool b CVC4_UNUSED = - push_back_associative_commute_recursive(n, buffer, k, notK, false); + bool b CVC5_UNUSED = + push_back_associative_commute_recursive(n, buffer, k, notK, false); if(buffer.size() == 0) { // all the TRUEs for an AND (resp FALSEs for an OR) were simplified away diff --git a/src/theory/arith/approx_simplex.cpp b/src/theory/arith/approx_simplex.cpp index caa052065..76737976a 100644 --- a/src/theory/arith/approx_simplex.cpp +++ b/src/theory/arith/approx_simplex.cpp @@ -30,7 +30,7 @@ #include "theory/arith/normal_form.h" #include "theory/eager_proof_generator.h" -#ifdef CVC4_USE_GLPK +#ifdef CVC5_USE_GLPK #include "theory/arith/partial_model.h" #endif @@ -372,7 +372,7 @@ public: } // namespace cvc5 /* Begin the declaration of GLPK specific code. */ -#ifdef CVC4_USE_GLPK +#ifdef CVC5_USE_GLPK extern "C" { #include }/* extern "C" */ @@ -538,7 +538,7 @@ int ApproxGLPK::s_verbosity = 0; } // namespace arith } // namespace theory } // namespace cvc5 -#endif /*#ifdef CVC4_USE_GLPK */ +#endif /*#ifdef CVC5_USE_GLPK */ /* End the declaration of GLPK specific code. */ /* Begin GPLK/NOGLPK Glue code. */ @@ -546,14 +546,14 @@ namespace cvc5 { namespace theory { namespace arith { ApproximateSimplex* ApproximateSimplex::mkApproximateSimplexSolver(const ArithVariables& vars, TreeLog& l, ApproximateStatistics& s){ -#ifdef CVC4_USE_GLPK +#ifdef CVC5_USE_GLPK return new ApproxGLPK(vars, l, s); #else return new ApproxNoOp(vars, l, s); #endif } bool ApproximateSimplex::enabled() { -#ifdef CVC4_USE_GLPK +#ifdef CVC5_USE_GLPK return true; #else return false; @@ -565,12 +565,12 @@ bool ApproximateSimplex::enabled() { /* End GPLK/NOGLPK Glue code. */ /* Begin GPLK implementation. */ -#ifdef CVC4_USE_GLPK +#ifdef CVC5_USE_GLPK namespace cvc5 { namespace theory { namespace arith { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS static CutInfoKlass fromGlpkClass(int klass){ switch(klass){ case GLP_RF_GMI: return GmiCutKlass; @@ -1430,7 +1430,7 @@ static GmiInfo* gmiCut(glp_tree *tree, int exec_ord, int cut_ord){ int M = gmi->getMAtCreation(); // Get the tableau row - int nrows CVC4_UNUSED = glp_ios_cut_get_aux_nrows(tree, gmi->poolOrdinal()); + int nrows CVC5_UNUSED = glp_ios_cut_get_aux_nrows(tree, gmi->poolOrdinal()); Assert(nrows == 1); int rows[1+1]; glp_ios_cut_get_aux_rows(tree, gmi->poolOrdinal(), rows, NULL); @@ -3177,5 +3177,5 @@ void ApproxGLPK::tryCut(int nid, CutInfo& cut) } // namespace arith } // namespace theory } // namespace cvc5 -#endif /*#ifdef CVC4_USE_GLPK */ +#endif /*#ifdef CVC5_USE_GLPK */ /* End GPLK implementation. */ diff --git a/src/theory/arith/arith_static_learner.cpp b/src/theory/arith/arith_static_learner.cpp index ce54133c5..2b90a133a 100644 --- a/src/theory/arith/arith_static_learner.cpp +++ b/src/theory/arith/arith_static_learner.cpp @@ -259,7 +259,7 @@ void ArithStaticLearner::addBound(TNode n) { DeltaRational bound = constant; switch(Kind k = n.getKind()) { - case kind::LT: bound = DeltaRational(constant, -1); CVC4_FALLTHROUGH; + case kind::LT: bound = DeltaRational(constant, -1); CVC5_FALLTHROUGH; case kind::LEQ: if (maxFind == d_maxMap.end() || (*maxFind).second > bound) { @@ -267,7 +267,7 @@ void ArithStaticLearner::addBound(TNode n) { Debug("arith::static") << "adding bound " << n << endl; } break; - case kind::GT: bound = DeltaRational(constant, 1); CVC4_FALLTHROUGH; + case kind::GT: bound = DeltaRational(constant, 1); CVC5_FALLTHROUGH; case kind::GEQ: if (minFind == d_minMap.end() || (*minFind).second < bound) { diff --git a/src/theory/arith/dio_solver.cpp b/src/theory/arith/dio_solver.cpp index 6ceab1933..5c39b7fc6 100644 --- a/src/theory/arith/dio_solver.cpp +++ b/src/theory/arith/dio_solver.cpp @@ -619,7 +619,7 @@ std::pair DioSolver::solveIndex(DioS Debug("arith::dio") << "before solveIndex("< DioSolver::decomposeIndex( Debug("arith::dio") << "before decomposeIndex("< FocusSet; +// CVC5_PB_DS_NAMESPACE::pairing_heap_tag> FocusSet; // typedef FocusSet::point_iterator FocusSetHandle; diff --git a/src/theory/arith/nl/cad/cdcac.cpp b/src/theory/arith/nl/cad/cdcac.cpp index c9f3ce3da..4cd9077ca 100644 --- a/src/theory/arith/nl/cad/cdcac.cpp +++ b/src/theory/arith/nl/cad/cdcac.cpp @@ -17,7 +17,7 @@ #include "theory/arith/nl/cad/cdcac.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include "options/arith_options.h" #include "theory/arith/nl/cad/projections.h" diff --git a/src/theory/arith/nl/cad/cdcac.h b/src/theory/arith/nl/cad/cdcac.h index 0d5d4ce74..58aa41bd1 100644 --- a/src/theory/arith/nl/cad/cdcac.h +++ b/src/theory/arith/nl/cad/cdcac.h @@ -20,7 +20,7 @@ #ifndef CVC5__THEORY__ARITH__NL__CAD__CDCAC_H #define CVC5__THEORY__ARITH__NL__CAD__CDCAC_H -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/cad/cdcac_utils.cpp b/src/theory/arith/nl/cad/cdcac_utils.cpp index 999e491f6..3ceb36bd3 100644 --- a/src/theory/arith/nl/cad/cdcac_utils.cpp +++ b/src/theory/arith/nl/cad/cdcac_utils.cpp @@ -16,7 +16,7 @@ #include "theory/arith/nl/cad/cdcac_utils.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include "theory/arith/nl/cad/projections.h" diff --git a/src/theory/arith/nl/cad/cdcac_utils.h b/src/theory/arith/nl/cad/cdcac_utils.h index 3cfbb138c..50f2f8bc9 100644 --- a/src/theory/arith/nl/cad/cdcac_utils.h +++ b/src/theory/arith/nl/cad/cdcac_utils.h @@ -19,7 +19,7 @@ #ifndef CVC5__THEORY__ARITH__NL__CAD__CDCAC_UTILS_H #define CVC5__THEORY__ARITH__NL__CAD__CDCAC_UTILS_H -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/cad/constraints.cpp b/src/theory/arith/nl/cad/constraints.cpp index 75d1cb723..b244bd358 100644 --- a/src/theory/arith/nl/cad/constraints.cpp +++ b/src/theory/arith/nl/cad/constraints.cpp @@ -16,7 +16,7 @@ #include "theory/arith/nl/cad/constraints.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/cad/constraints.h b/src/theory/arith/nl/cad/constraints.h index efc69d468..1ddbfc821 100644 --- a/src/theory/arith/nl/cad/constraints.h +++ b/src/theory/arith/nl/cad/constraints.h @@ -19,7 +19,7 @@ #ifndef CVC5__THEORY__ARITH__NL__CAD__CONSTRAINTS_H #define CVC5__THEORY__ARITH__NL__CAD__CONSTRAINTS_H -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/cad/projections.cpp b/src/theory/arith/nl/cad/projections.cpp index 1bac0c160..8aea538f1 100644 --- a/src/theory/arith/nl/cad/projections.cpp +++ b/src/theory/arith/nl/cad/projections.cpp @@ -16,7 +16,7 @@ #include "theory/arith/nl/cad/projections.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include "base/check.h" diff --git a/src/theory/arith/nl/cad/projections.h b/src/theory/arith/nl/cad/projections.h index c1ce91303..f3c8aa0f1 100644 --- a/src/theory/arith/nl/cad/projections.h +++ b/src/theory/arith/nl/cad/projections.h @@ -19,7 +19,7 @@ #ifndef CVC5__THEORY__ARITH__NL__CAD_PROJECTIONS_H #define CVC5__THEORY__ARITH__NL__CAD_PROJECTIONS_H -#ifdef CVC4_USE_POLY +#ifdef CVC5_USE_POLY #include diff --git a/src/theory/arith/nl/cad/proof_generator.cpp b/src/theory/arith/nl/cad/proof_generator.cpp index 73e19aa28..291447647 100644 --- a/src/theory/arith/nl/cad/proof_generator.cpp +++ b/src/theory/arith/nl/cad/proof_generator.cpp @@ -14,7 +14,7 @@ #include "theory/arith/nl/cad/proof_generator.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include "theory/lazy_tree_proof_generator.h" #include "theory/arith/nl/poly_conversion.h" diff --git a/src/theory/arith/nl/cad/proof_generator.h b/src/theory/arith/nl/cad/proof_generator.h index 9365cc337..993524504 100644 --- a/src/theory/arith/nl/cad/proof_generator.h +++ b/src/theory/arith/nl/cad/proof_generator.h @@ -17,7 +17,7 @@ #ifndef CVC5__THEORY__ARITH__NL__CAD__PROOF_GENERATOR_H #define CVC5__THEORY__ARITH__NL__CAD__PROOF_GENERATOR_H -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/cad/variable_ordering.cpp b/src/theory/arith/nl/cad/variable_ordering.cpp index 7ebbc90dd..e7c8b214a 100644 --- a/src/theory/arith/nl/cad/variable_ordering.cpp +++ b/src/theory/arith/nl/cad/variable_ordering.cpp @@ -16,7 +16,7 @@ #include "theory/arith/nl/cad/variable_ordering.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include "util/poly_util.h" diff --git a/src/theory/arith/nl/cad/variable_ordering.h b/src/theory/arith/nl/cad/variable_ordering.h index b4336d395..fb40a7b7d 100644 --- a/src/theory/arith/nl/cad/variable_ordering.h +++ b/src/theory/arith/nl/cad/variable_ordering.h @@ -19,7 +19,7 @@ #ifndef CVC5__THEORY__ARITH__NL__CAD__VARIABLE_ORDERING_H #define CVC5__THEORY__ARITH__NL__CAD__VARIABLE_ORDERING_H -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/cad_solver.cpp b/src/theory/arith/nl/cad_solver.cpp index aa9bce776..202788ba1 100644 --- a/src/theory/arith/nl/cad_solver.cpp +++ b/src/theory/arith/nl/cad_solver.cpp @@ -31,7 +31,7 @@ CadSolver::CadSolver(InferenceManager& im, context::Context* ctx, ProofNodeManager* pnm) : -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP d_CAC(ctx, pnm), #endif d_foundSatisfiability(false), @@ -42,7 +42,7 @@ CadSolver::CadSolver(InferenceManager& im, SkolemManager* sm = nm->getSkolemManager(); d_ranVariable = sm->mkDummySkolem( "__z", nm->realType(), "", NodeManager::SKOLEM_EXACT_NAME); -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP ProofChecker* pc = pnm != nullptr ? pnm->getChecker() : nullptr; if (pc != nullptr) { @@ -56,7 +56,7 @@ CadSolver::~CadSolver() {} void CadSolver::initLastCall(const std::vector& assertions) { -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP if (Trace.isOn("nl-cad")) { Trace("nl-cad") << "CadSolver::initLastCall" << std::endl; @@ -83,7 +83,7 @@ void CadSolver::initLastCall(const std::vector& assertions) void CadSolver::checkFull() { -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP if (d_CAC.getConstraints().getConstraints().empty()) { Trace("nl-cad") << "No constraints. Return." << std::endl; return; @@ -115,7 +115,7 @@ void CadSolver::checkFull() void CadSolver::checkPartial() { -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP if (d_CAC.getConstraints().getConstraints().empty()) { Trace("nl-cad") << "No constraints. Return." << std::endl; return; @@ -165,7 +165,7 @@ void CadSolver::checkPartial() bool CadSolver::constructModelIfAvailable(std::vector& assertions) { -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP if (!d_foundSatisfiability) { return false; diff --git a/src/theory/arith/nl/cad_solver.h b/src/theory/arith/nl/cad_solver.h index 2ea27fce7..1d51cf9c5 100644 --- a/src/theory/arith/nl/cad_solver.h +++ b/src/theory/arith/nl/cad_solver.h @@ -87,7 +87,7 @@ class CadSolver */ Node d_ranVariable; -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP /** * The object implementing the actual decision procedure. */ diff --git a/src/theory/arith/nl/icp/candidate.cpp b/src/theory/arith/nl/icp/candidate.cpp index 31b7b085b..4a6d0748a 100644 --- a/src/theory/arith/nl/icp/candidate.cpp +++ b/src/theory/arith/nl/icp/candidate.cpp @@ -14,7 +14,7 @@ #include "theory/arith/nl/icp/candidate.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/icp/candidate.h b/src/theory/arith/nl/icp/candidate.h index 524342658..d65db52b5 100644 --- a/src/theory/arith/nl/icp/candidate.h +++ b/src/theory/arith/nl/icp/candidate.h @@ -17,7 +17,7 @@ #include "cvc4_private.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include #include "expr/node.h" diff --git a/src/theory/arith/nl/icp/icp_solver.cpp b/src/theory/arith/nl/icp/icp_solver.cpp index 2f6cdf220..39504c3aa 100644 --- a/src/theory/arith/nl/icp/icp_solver.cpp +++ b/src/theory/arith/nl/icp/icp_solver.cpp @@ -32,7 +32,7 @@ namespace arith { namespace nl { namespace icp { -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP namespace { /** A simple wrapper to nicely print an interval assignment. */ @@ -366,7 +366,7 @@ void ICPSolver::check() } } -#else /* CVC4_POLY_IMP */ +#else /* CVC5_POLY_IMP */ void ICPSolver::reset(const std::vector& assertions) { @@ -378,7 +378,7 @@ void ICPSolver::check() Unimplemented() << "ICPSolver requires CVC4 to be configured with LibPoly"; } -#endif /* CVC4_POLY_IMP */ +#endif /* CVC5_POLY_IMP */ } // namespace icp } // namespace nl diff --git a/src/theory/arith/nl/icp/icp_solver.h b/src/theory/arith/nl/icp/icp_solver.h index b392dc430..0efb2021f 100644 --- a/src/theory/arith/nl/icp/icp_solver.h +++ b/src/theory/arith/nl/icp/icp_solver.h @@ -17,9 +17,9 @@ #include "cvc4_private.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include -#endif /* CVC4_POLY_IMP */ +#endif /* CVC5_POLY_IMP */ #include "expr/node.h" #include "theory/arith/bound_inference.h" @@ -37,7 +37,7 @@ class InferenceManager; namespace nl { namespace icp { -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP /** * This class implements an ICP-based solver. As it is intended to be used in @@ -137,7 +137,7 @@ class ICPSolver void check(); }; -#else /* CVC4_POLY_IMP */ +#else /* CVC5_POLY_IMP */ class ICPSolver { @@ -147,7 +147,7 @@ class ICPSolver void check(); }; -#endif /* CVC4_POLY_IMP */ +#endif /* CVC5_POLY_IMP */ } // namespace icp } // namespace nl diff --git a/src/theory/arith/nl/icp/intersection.cpp b/src/theory/arith/nl/icp/intersection.cpp index e0e93e1dd..6a914bc03 100644 --- a/src/theory/arith/nl/icp/intersection.cpp +++ b/src/theory/arith/nl/icp/intersection.cpp @@ -14,7 +14,7 @@ #include "theory/arith/nl/icp/intersection.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/icp/intersection.h b/src/theory/arith/nl/icp/intersection.h index a77a605d0..a82ad6b8e 100644 --- a/src/theory/arith/nl/icp/intersection.h +++ b/src/theory/arith/nl/icp/intersection.h @@ -17,7 +17,7 @@ #include "cvc4_private.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/nl/icp/interval.h b/src/theory/arith/nl/icp/interval.h index 7716d029f..42f2084e0 100644 --- a/src/theory/arith/nl/icp/interval.h +++ b/src/theory/arith/nl/icp/interval.h @@ -17,7 +17,7 @@ #include "cvc4_private.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include #include "expr/node.h" diff --git a/src/theory/arith/nl/poly_conversion.cpp b/src/theory/arith/nl/poly_conversion.cpp index c7b549655..f708896a6 100644 --- a/src/theory/arith/nl/poly_conversion.cpp +++ b/src/theory/arith/nl/poly_conversion.cpp @@ -16,7 +16,7 @@ #include "poly_conversion.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include "expr/node.h" #include "expr/node_manager_attributes.h" @@ -451,7 +451,7 @@ Node lower_bound_as_node(const Node& var, poly::get_upper(poly::get_isolating_interval(alg))); int sl = poly::sign_at(get_defining_polynomial(alg), poly::get_lower(poly::get_isolating_interval(alg))); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS int su = poly::sign_at(get_defining_polynomial(alg), poly::get_upper(poly::get_isolating_interval(alg))); Assert(sl != 0 && su != 0 && sl != su); @@ -507,7 +507,7 @@ Node upper_bound_as_node(const Node& var, poly::get_lower(poly::get_isolating_interval(alg))); Rational u = poly_utils::toRational( poly::get_upper(poly::get_isolating_interval(alg))); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS int sl = poly::sign_at(get_defining_polynomial(alg), poly::get_lower(poly::get_isolating_interval(alg))); #endif diff --git a/src/theory/arith/nl/poly_conversion.h b/src/theory/arith/nl/poly_conversion.h index 0a9d0f313..c97923f23 100644 --- a/src/theory/arith/nl/poly_conversion.h +++ b/src/theory/arith/nl/poly_conversion.h @@ -19,7 +19,7 @@ #include "cvc4_private.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/theory/arith/partial_model.cpp b/src/theory/arith/partial_model.cpp index fe3408a43..6075853c7 100644 --- a/src/theory/arith/partial_model.cpp +++ b/src/theory/arith/partial_model.cpp @@ -193,7 +193,7 @@ bool ArithVariables::VarInfo::setAssignment(const DeltaRational& a, BoundsInfo& void ArithVariables::releaseArithVar(ArithVar v){ VarInfo& vi = d_vars.get(v); - size_t removed CVC4_UNUSED = d_nodeToArithVarMap.erase(vi.d_node); + size_t removed CVC5_UNUSED = d_nodeToArithVarMap.erase(vi.d_node); Assert(removed == 1); vi.uninitialize(); diff --git a/src/theory/arith/theory_arith_private.cpp b/src/theory/arith/theory_arith_private.cpp index 7ad0bbfbb..887d78082 100644 --- a/src/theory/arith/theory_arith_private.cpp +++ b/src/theory/arith/theory_arith_private.cpp @@ -213,7 +213,7 @@ static void drop( ConstraintCPVec& v, ConstraintP con){ static void resolve(ConstraintCPVec& buf, ConstraintP c, const ConstraintCPVec& pos, const ConstraintCPVec& neg){ - unsigned posPos CVC4_UNUSED = pos.size(); + unsigned posPos CVC5_UNUSED = pos.size(); for(unsigned i = 0, N = pos.size(); i < N; ++i){ if(pos[i] == c){ posPos = i; @@ -223,7 +223,7 @@ static void resolve(ConstraintCPVec& buf, ConstraintP c, const ConstraintCPVec& } Assert(posPos < pos.size()); ConstraintP negc = c->getNegation(); - unsigned negPos CVC4_UNUSED = neg.size(); + unsigned negPos CVC5_UNUSED = neg.size(); for(unsigned i = 0, N = neg.size(); i < N; ++i){ if(neg[i] == negc){ negPos = i; @@ -2373,8 +2373,8 @@ struct SizeOrd { void TheoryArithPrivate::subsumption( std::vector &confs) const { - int checks CVC4_UNUSED = 0; - int subsumed CVC4_UNUSED = 0; + int checks CVC5_UNUSED = 0; + int subsumed CVC5_UNUSED = 0; for (size_t i = 0, N = confs.size(); i < N; ++i) { ConstraintCPVec &conf = confs[i]; @@ -3336,7 +3336,7 @@ void TheoryArithPrivate::preNotifyFact(TNode atom, bool pol, TNode fact) ConstraintP curr = constraintFromFactQueue(fact); if (curr != NullConstraint) { - bool res CVC4_UNUSED = assertionCases(curr); + bool res CVC5_UNUSED = assertionCases(curr); Assert(!res || anyConflict()); } } @@ -3350,7 +3350,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) d_learnedBounds.pop(); Debug("arith::learned") << curr << endl; - bool res CVC4_UNUSED = assertionCases(curr); + bool res CVC5_UNUSED = assertionCases(curr); Assert(!res || anyConflict()); if(anyConflict()){ break; } @@ -5035,7 +5035,7 @@ std::pair TheoryArithPrivate::entailmentCheck(TNode lit, const Arith } // intentionally fall through to DISTINCT case! // entailments of negations are eager exit cases for EQUAL - CVC4_FALLTHROUGH; + CVC5_FALLTHROUGH; case DISTINCT: if(!bestPrimDiff.first.isNull()){ // primDir [dm * dp] <= primDir * dm * U < primDir * sep diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp index d0a653410..29cd94c1d 100644 --- a/src/theory/arrays/theory_arrays.cpp +++ b/src/theory/arrays/theory_arrays.cpp @@ -788,8 +788,8 @@ void TheoryArrays::preRegisterTermInternal(TNode node) Assert(weakEquivGetRep(node) == node); d_infoMap.setWeakEquivPointer(node, node[0]); d_infoMap.setWeakEquivIndex(node, node[1]); -#ifdef CVC4_ASSERTIONS - checkWeakEquiv(false); +#ifdef CVC5_ASSERTIONS + checkWeakEquiv(false); #endif } @@ -867,7 +867,7 @@ void TheoryArrays::notifySharedTerm(TNode t) d_sharedArrays.insert(t); } else { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS d_sharedOther.insert(t); #endif d_sharedTerms = true; @@ -940,7 +940,7 @@ void TheoryArrays::checkPair(TNode r1, TNode r2) // Should have been propagated to us Assert(false); break; - case EQUALITY_FALSE: CVC4_FALLTHROUGH; + case EQUALITY_FALSE: CVC5_FALLTHROUGH; case EQUALITY_FALSE_IN_MODEL: // This is unlikely, but I think it could happen Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair called when false in model" << std::endl; @@ -1238,11 +1238,11 @@ void TheoryArrays::postCheck(Effort level) d_infoMap.setWeakEquivPointer(b, a); d_infoMap.setWeakEquivIndex(b, TNode()); } -#ifdef CVC4_ASSERTIONS - checkWeakEquiv(false); +#ifdef CVC5_ASSERTIONS + checkWeakEquiv(false); #endif } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS checkWeakEquiv(true); #endif diff --git a/src/theory/booleans/circuit_propagator.h b/src/theory/booleans/circuit_propagator.h index ea56209ce..6ff91e5cb 100644 --- a/src/theory/booleans/circuit_propagator.h +++ b/src/theory/booleans/circuit_propagator.h @@ -103,7 +103,7 @@ class CircuitPropagator * @return a trust node encapsulating the proof for a conflict as a lemma that * proves false, or the null trust node otherwise */ - TrustNode propagate() CVC4_WARN_UNUSED_RESULT; + TrustNode propagate() CVC5_WARN_UNUSED_RESULT; /** * Get the back edges of this circuit. diff --git a/src/theory/bv/bitblast/aig_bitblaster.cpp b/src/theory/bv/bitblast/aig_bitblaster.cpp index fb5adb54c..4dd4419a4 100644 --- a/src/theory/bv/bitblast/aig_bitblaster.cpp +++ b/src/theory/bv/bitblast/aig_bitblaster.cpp @@ -24,7 +24,7 @@ #include "prop/sat_solver_factory.h" #include "smt/smt_statistics_registry.h" -#ifdef CVC4_USE_ABC +#ifdef CVC5_USE_ABC extern "C" { #include "base/abc/abc.h" @@ -168,7 +168,7 @@ AigBitblaster::AigBitblaster() solver = prop::SatSolverFactory::createKissat(smtStatisticsRegistry(), "AigBitblaster"); break; - default: CVC4_FATAL() << "Unknown SAT solver type"; + default: CVC5_FATAL() << "Unknown SAT solver type"; } d_satSolver.reset(solver); } @@ -497,4 +497,4 @@ AigBitblaster::Statistics::~Statistics() { } // namespace bv } // namespace theory } // namespace cvc5 -#endif // CVC4_USE_ABC +#endif // CVC5_USE_ABC diff --git a/src/theory/bv/bitblast/aig_bitblaster.h b/src/theory/bv/bitblast/aig_bitblaster.h index 2f4666a9b..37fac03af 100644 --- a/src/theory/bv/bitblast/aig_bitblaster.h +++ b/src/theory/bv/bitblast/aig_bitblaster.h @@ -40,7 +40,7 @@ class SatSolver; namespace theory { namespace bv { -#ifdef CVC4_USE_ABC +#ifdef CVC5_USE_ABC class AigBitblaster : public TBitblaster { @@ -106,7 +106,7 @@ class AigBitblaster : public TBitblaster Statistics d_statistics; }; -#else /* CVC4_USE_ABC */ +#else /* CVC5_USE_ABC */ /** * Dummy version of the AigBitblaster class that cannot be instantiated s.t. we @@ -117,7 +117,7 @@ class AigBitblaster : public TBitblaster AigBitblaster() = delete; }; -#endif /* CVC4_USE_ABC */ +#endif /* CVC5_USE_ABC */ } // namespace bv } // namespace theory diff --git a/src/theory/bv/bv_eager_solver.cpp b/src/theory/bv/bv_eager_solver.cpp index 97df17c58..365817676 100644 --- a/src/theory/bv/bv_eager_solver.cpp +++ b/src/theory/bv/bv_eager_solver.cpp @@ -48,7 +48,7 @@ void EagerBitblastSolver::turnOffAig() { void EagerBitblastSolver::initialize() { Assert(!isInitialized()); if (d_useAig) { -#ifdef CVC4_USE_ABC +#ifdef CVC5_USE_ABC d_aigBitblaster.reset(new AigBitblaster()); #else Unreachable(); @@ -77,7 +77,7 @@ void EagerBitblastSolver::assertFormula(TNode formula) { d_assertionSet.insert(formula); // ensures all atoms are bit-blasted and converted to AIG if (d_useAig) { -#ifdef CVC4_USE_ABC +#ifdef CVC5_USE_ABC d_aigBitblaster->bbFormula(formula); #else Unreachable(); @@ -96,7 +96,7 @@ bool EagerBitblastSolver::checkSat() { } if (d_useAig) { -#ifdef CVC4_USE_ABC +#ifdef CVC5_USE_ABC const std::vector assertions = {d_assertionSet.key_begin(), d_assertionSet.key_end()}; Assert(!assertions.empty()); diff --git a/src/theory/bv/theory_bv_rewrite_rules_simplification.h b/src/theory/bv/theory_bv_rewrite_rules_simplification.h index c0bce9097..397a01b78 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_simplification.h +++ b/src/theory/bv/theory_bv_rewrite_rules_simplification.h @@ -607,7 +607,7 @@ inline Node RewriteRule::apply(TNode node) z = nc > 1 ? zb.constructNode() : zb[0]; } m = utils::getSize(x); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS uint32_t n = utils::getSize(c); #endif my = y.isNull() ? 0 : utils::getSize(y); diff --git a/src/theory/fp/fp_converter.cpp b/src/theory/fp/fp_converter.cpp index 1d124045b..5b2f586ba 100644 --- a/src/theory/fp/fp_converter.cpp +++ b/src/theory/fp/fp_converter.cpp @@ -22,7 +22,7 @@ #include "util/floatingpoint.h" #include "util/floatingpoint_literal_symfpu.h" -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU #include "symfpu/core/add.h" #include "symfpu/core/classify.h" #include "symfpu/core/compare.h" @@ -39,11 +39,11 @@ #include "symfpu/utils/properties.h" #endif -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU namespace symfpu { using namespace ::cvc5::theory::fp::symfpuSymbolic; -#define CVC4_SYM_ITE_DFN(T) \ +#define CVC5_SYM_ITE_DFN(T) \ template <> \ struct ite \ { \ @@ -114,12 +114,12 @@ using namespace ::cvc5::theory::fp::symfpuSymbolic; } // Can (unsurprisingly) only ITE things which contain Nodes -CVC4_SYM_ITE_DFN(traits::rm); -CVC4_SYM_ITE_DFN(traits::prop); -CVC4_SYM_ITE_DFN(traits::sbv); -CVC4_SYM_ITE_DFN(traits::ubv); +CVC5_SYM_ITE_DFN(traits::rm); +CVC5_SYM_ITE_DFN(traits::prop); +CVC5_SYM_ITE_DFN(traits::sbv); +CVC5_SYM_ITE_DFN(traits::ubv); -#undef CVC4_SYM_ITE_DFN +#undef CVC5_SYM_ITE_DFN template <> traits::ubv orderEncode(const traits::ubv &b) @@ -144,7 +144,7 @@ void probabilityAnnotation(const traits::prop &p, }; #endif -#ifndef CVC4_USE_SYMFPU +#ifndef CVC5_USE_SYMFPU #define SYMFPU_NUMBER_OF_ROUNDING_MODES 5 #endif @@ -241,7 +241,7 @@ symbolicProposition symbolicProposition::operator^( bool symbolicRoundingMode::checkNodeType(const TNode n) { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return n.getType(false).isBitVector(SYMFPU_NUMBER_OF_ROUNDING_MODES); #else return false; @@ -253,7 +253,7 @@ symbolicRoundingMode::symbolicRoundingMode(const Node n) : nodeWrapper(n) Assert(checkNodeType(*this)); } -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU symbolicRoundingMode::symbolicRoundingMode(const unsigned v) : nodeWrapper(NodeManager::currentNM()->mkConst( BitVector(SYMFPU_NUMBER_OF_ROUNDING_MODES, v))) @@ -754,7 +754,7 @@ TypeNode floatingPointTypeInfo::getTypeNode(void) const FpConverter::FpConverter(context::UserContext* user) : d_additionalAssertions(user) -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU , d_fpMap(user), d_rmMap(user), @@ -767,7 +767,7 @@ FpConverter::FpConverter(context::UserContext* user) FpConverter::~FpConverter() {} -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Node FpConverter::ufToNode(const fpt &format, const uf &u) const { NodeManager *nm = NodeManager::currentNM(); @@ -844,11 +844,11 @@ FpConverter::uf FpConverter::buildComponents(TNode current) // Non-convertible things should only be added to the stack at the very start, // thus... -#define CVC4_FPCONV_PASSTHROUGH Assert(workStack.empty()) +#define CVC5_FPCONV_PASSTHROUGH Assert(workStack.empty()) Node FpConverter::convert(TNode node) { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU std::vector workStack; TNode result = node; @@ -1397,7 +1397,7 @@ Node FpConverter::convert(TNode node) } else { - CVC4_FPCONV_PASSTHROUGH; + CVC5_FPCONV_PASSTHROUGH; return result; } } @@ -1534,7 +1534,7 @@ Node FpConverter::convert(TNode node) /* Fall through... */ default: - CVC4_FPCONV_PASSTHROUGH; + CVC5_FPCONV_PASSTHROUGH; return result; break; } @@ -1652,7 +1652,7 @@ Node FpConverter::convert(TNode node) case kind::ROUNDINGMODE_BITBLAST: /* Fall through ... */ - default: CVC4_FPCONV_PASSTHROUGH; break; + default: CVC5_FPCONV_PASSTHROUGH; break; } } else if (t.isReal()) @@ -1691,12 +1691,12 @@ Node FpConverter::convert(TNode node) "expandDefinition"; break; - default: CVC4_FPCONV_PASSTHROUGH; break; + default: CVC5_FPCONV_PASSTHROUGH; break; } } else { - CVC4_FPCONV_PASSTHROUGH; + CVC5_FPCONV_PASSTHROUGH; } } @@ -1706,13 +1706,13 @@ Node FpConverter::convert(TNode node) #endif } -#undef CVC4_FPCONV_PASSTHROUGH +#undef CVC5_FPCONV_PASSTHROUGH Node FpConverter::getValue(Valuation &val, TNode var) { Assert(Theory::isLeafOf(var, THEORY_FP)); -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU TypeNode t(var.getType()); Assert(t.isRoundingMode() || t.isFloatingPoint()) diff --git a/src/theory/fp/fp_converter.h b/src/theory/fp/fp_converter.h index f3341f442..3a74627d5 100644 --- a/src/theory/fp/fp_converter.h +++ b/src/theory/fp/fp_converter.h @@ -32,11 +32,11 @@ #include "util/floatingpoint_size.h" #include "util/hash.h" -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU #include "symfpu/core/unpackedFloat.h" #endif -#ifdef CVC4_SYM_SYMBOLIC_EVAL +#ifdef CVC5_SYM_SYMBOLIC_EVAL // This allows debugging of the CVC4 symbolic back-end. // By enabling this and disabling constant folding in the rewriter, // SMT files that have operations on constants will be evaluated @@ -102,12 +102,12 @@ typedef traits::bwt bwt; class nodeWrapper : public Node { protected: -/* CVC4_SYM_SYMBOLIC_EVAL is for debugging CVC4 symbolic back-end issues. +/* CVC5_SYM_SYMBOLIC_EVAL is for debugging CVC4 symbolic back-end issues. * Enable this and disabling constant folding will mean that operations * that are input with constant args are 'folded' using the symbolic encoding * allowing them to be traced via GDB. */ -#ifdef CVC4_SYM_SYMBOLIC_EVAL +#ifdef CVC5_SYM_SYMBOLIC_EVAL nodeWrapper(const Node &n) : Node(theory::Rewriter::rewrite(n)) {} #else nodeWrapper(const Node &n) : Node(n) {} @@ -119,7 +119,7 @@ class symbolicProposition : public nodeWrapper protected: bool checkNodeType(const TNode node); -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU friend ::symfpu::ite; // For ITE #endif @@ -140,7 +140,7 @@ class symbolicRoundingMode : public nodeWrapper protected: bool checkNodeType(const TNode n); -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU friend ::symfpu::ite; // For ITE #endif @@ -182,7 +182,7 @@ class symbolicBitVector : public nodeWrapper bool checkNodeType(const TNode n); friend symbolicBitVector; // To allow conversion between the types -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU friend ::symfpu::ite >; // For ITE #endif @@ -313,7 +313,7 @@ class FpConverter context::CDList d_additionalAssertions; protected: -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU typedef symfpuSymbolic::traits traits; typedef ::symfpu::unpackedFloat uf; typedef symfpuSymbolic::traits::rm rm; diff --git a/src/theory/fp/theory_fp_rewriter.cpp b/src/theory/fp/theory_fp_rewriter.cpp index ba94dca13..51d2e5bd7 100644 --- a/src/theory/fp/theory_fp_rewriter.cpp +++ b/src/theory/fp/theory_fp_rewriter.cpp @@ -194,7 +194,7 @@ namespace rewrite { // Note these cannot be assumed to be symmetric for +0/-0, thus no symmetry reorder RewriteResponse compactMinMax (TNode node, bool isPreRewrite) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS Kind k = node.getKind(); Assert((k == kind::FLOATINGPOINT_MIN) || (k == kind::FLOATINGPOINT_MAX) || (k == kind::FLOATINGPOINT_MIN_TOTAL) @@ -885,7 +885,7 @@ namespace constantFold { bool result; switch (k) { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU case kind::FLOATINGPOINT_COMPONENT_NAN: result = arg0.isNaN(); break; case kind::FLOATINGPOINT_COMPONENT_INF: result = arg0.isInfinite(); break; case kind::FLOATINGPOINT_COMPONENT_ZERO: result = arg0.isZero(); break; @@ -909,7 +909,7 @@ namespace constantFold { // \todo Add a proper interface for this sort of thing to FloatingPoint #1915 return RewriteResponse( REWRITE_DONE, -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU NodeManager::currentNM()->mkConst((BitVector)arg0.getExponent()) #else node @@ -925,7 +925,7 @@ namespace constantFold { return RewriteResponse( REWRITE_DONE, -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU NodeManager::currentNM()->mkConst((BitVector)arg0.getSignificand()) #else node @@ -939,7 +939,7 @@ namespace constantFold { BitVector value; -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU /* \todo fix the numbering of rounding modes so this doesn't need * to call symfpu at all and remove the dependency on fp_converter.h #1915 */ RoundingMode arg0(node[0].getConst()); diff --git a/src/theory/fp/theory_fp_type_rules.cpp b/src/theory/fp/theory_fp_type_rules.cpp index d7060ad98..44936c440 100644 --- a/src/theory/fp/theory_fp_type_rules.cpp +++ b/src/theory/fp/theory_fp_type_rules.cpp @@ -711,7 +711,7 @@ TypeNode FloatingPointComponentExponent::computeType(NodeManager* nodeManager, } } -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU /* Need to create some symfpu objects as the size of bit-vector * that is needed for this component is dependent on the encoding * used (i.e. whether subnormals are forcibly normalised or not). @@ -751,7 +751,7 @@ TypeNode FloatingPointComponentSignificand::computeType( } } -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU /* As before we need to use some of sympfu. */ FloatingPointSize fps = operandType.getConst(); uint32_t bw = FloatingPoint::getUnpackedSignificandWidth(fps); @@ -783,7 +783,7 @@ TypeNode RoundingModeBitBlast::computeType(NodeManager* nodeManager, } } - return nodeManager->mkBitVectorType(CVC4_NUM_ROUNDING_MODES); + return nodeManager->mkBitVectorType(CVC5_NUM_ROUNDING_MODES); } Cardinality CardinalityComputer::computeCardinality(TypeNode type) diff --git a/src/theory/model_manager_distributed.cpp b/src/theory/model_manager_distributed.cpp index 61279ee11..b67f2dc8c 100644 --- a/src/theory/model_manager_distributed.cpp +++ b/src/theory/model_manager_distributed.cpp @@ -67,7 +67,7 @@ bool ModelManagerDistributed::prepareModel() // Consult each active theory to get all relevant information concerning the // model, which includes both dump their equality information and assigning // values. Notice the order of theories here is important and is the same - // as the list in CVC4_FOR_EACH_THEORY in theory_engine.cpp. + // as the list in CVC5_FOR_EACH_THEORY in theory_engine.cpp. for (TheoryId theoryId = theory::THEORY_FIRST; theoryId < theory::THEORY_LAST; ++theoryId) { diff --git a/src/theory/quantifiers/candidate_rewrite_filter.cpp b/src/theory/quantifiers/candidate_rewrite_filter.cpp index 7ada36dc2..d6bf5c8bd 100644 --- a/src/theory/quantifiers/candidate_rewrite_filter.cpp +++ b/src/theory/quantifiers/candidate_rewrite_filter.cpp @@ -237,7 +237,7 @@ bool CandidateRewriteFilter::notify(Node s, Trace("crf-match") << " " << vars[i] << " -> " << subs[i] << std::endl; } } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (unsigned i = 0, size = vars.size(); i < size; i++) { // By using internal representation of terms, we ensure polymorphism is diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp index 0a544f785..a1ae0a5d7 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp @@ -136,7 +136,7 @@ Node normalizePvMult( return result; } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS namespace { bool isLinearPlus( TNode n, diff --git a/src/theory/quantifiers/fun_def_evaluator.cpp b/src/theory/quantifiers/fun_def_evaluator.cpp index 9a3d465d5..f2ccb0806 100644 --- a/src/theory/quantifiers/fun_def_evaluator.cpp +++ b/src/theory/quantifiers/fun_def_evaluator.cpp @@ -139,7 +139,7 @@ Node FunDefEvaluator::evaluate(Node n) const << cur[childIdxToEval] << "\n"; continue; } - unsigned child CVC4_UNUSED = 0; + unsigned child CVC5_UNUSED = 0; for (const Node& cn : cur) { it = visited.find(cn); diff --git a/src/theory/quantifiers/instantiate.cpp b/src/theory/quantifiers/instantiate.cpp index 8fc1c4d13..c716554f9 100644 --- a/src/theory/quantifiers/instantiate.cpp +++ b/src/theory/quantifiers/instantiate.cpp @@ -131,7 +131,7 @@ bool Instantiate::addInstantiation(Node q, << std::endl; return false; } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS bool bad_inst = false; if (TermUtil::containsUninterpretedConstant(terms[i])) { diff --git a/src/theory/quantifiers/sygus/sygus_unif_io.cpp b/src/theory/quantifiers/sygus/sygus_unif_io.cpp index 9dfac1d68..7f60ddbbd 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_io.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_io.cpp @@ -1362,7 +1362,7 @@ Node SygusUnifIo::constructSol( // for ITE Node split_cond_enum; unsigned split_cond_res_index = 0; - CVC4_UNUSED bool set_split_cond_res_index = false; + CVC5_UNUSED bool set_split_cond_res_index = false; for (unsigned sc = 0, size = etis->d_cenum.size(); sc < size; sc++) { diff --git a/src/theory/quantifiers/term_tuple_enumerator.cpp b/src/theory/quantifiers/term_tuple_enumerator.cpp index e4e63787e..77d7771d1 100644 --- a/src/theory/quantifiers/term_tuple_enumerator.cpp +++ b/src/theory/quantifiers/term_tuple_enumerator.cpp @@ -153,7 +153,7 @@ class TermTupleEnumeratorBase : public TermTupleEnumeratorInterface virtual size_t prepareTerms(size_t variableIx) = 0; /** Get a given term for a given variable. */ virtual Node getTerm(size_t variableIx, - size_t term_index) CVC4_WARN_UNUSED_RESULT = 0; + size_t term_index) CVC5_WARN_UNUSED_RESULT = 0; }; /** diff --git a/src/theory/rewriter.cpp b/src/theory/rewriter.cpp index c247d8f08..a00e4dad4 100644 --- a/src/theory/rewriter.cpp +++ b/src/theory/rewriter.cpp @@ -191,7 +191,7 @@ Node Rewriter::rewriteTo(theory::TheoryId theoryId, TConvProofGenerator* tcpg) { RewriteWithProofsAttribute rpfa; -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS bool isEquality = node.getKind() == kind::EQUAL && (!node[0].getType().isBoolean()); if (d_rewriteStack == nullptr) @@ -329,21 +329,21 @@ Node Rewriter::rewriteTo(theory::TheoryId theoryId, // In the post rewrite if we've changed theories, we must do a full rewrite Assert(response.d_node != rewriteStackTop.d_node); //TODO: this is not thread-safe - should make this assertion dependent on sequential build -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS Assert(d_rewriteStack->find(response.d_node) == d_rewriteStack->end()); d_rewriteStack->insert(response.d_node); #endif Node rewritten = rewriteTo(newTheoryId, response.d_node, tcpg); rewriteStackTop.d_node = rewritten; -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS d_rewriteStack->erase(response.d_node); #endif break; } else if (response.d_status == REWRITE_DONE) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS RewriteResponse r2 = d_theoryRewriters[newTheoryId]->postRewrite(response.d_node); Assert(r2.d_node == response.d_node) @@ -504,7 +504,7 @@ RewriteResponse Rewriter::processTrustRewriteResponse( void Rewriter::clearCaches() { Rewriter* rewriter = getInstance(); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS rewriter->d_rewriteStack.reset(nullptr); #endif diff --git a/src/theory/rewriter.h b/src/theory/rewriter.h index 94057aa54..ab3e70719 100644 --- a/src/theory/rewriter.h +++ b/src/theory/rewriter.h @@ -225,10 +225,10 @@ class Rewriter { /** The proof generator */ std::unique_ptr d_tpg; -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS std::unique_ptr> d_rewriteStack = nullptr; -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ };/* class Rewriter */ } // namespace theory diff --git a/src/theory/strings/arith_entail.cpp b/src/theory/strings/arith_entail.cpp index a1b2c487f..f98f6514e 100644 --- a/src/theory/strings/arith_entail.cpp +++ b/src/theory/strings/arith_entail.cpp @@ -174,7 +174,7 @@ bool ArithEntail::checkApprox(Node ar) { if (approxMsums.find(aa) == approxMsums.end()) { - CVC4_UNUSED bool ret = + CVC5_UNUSED bool ret = ArithMSum::getMonomialSum(aa, approxMsums[aa]); Assert(ret); } diff --git a/src/theory/strings/core_solver.cpp b/src/theory/strings/core_solver.cpp index f38acfac2..cfe80eea2 100644 --- a/src/theory/strings/core_solver.cpp +++ b/src/theory/strings/core_solver.cpp @@ -608,7 +608,7 @@ void CoreSolver::normalizeEquivalenceClass(Node eqc, TypeNode stype) Node emp = Word::mkEmptyWord(stype); if (d_state.areEqual(eqc, emp)) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for( unsigned j=0; j= EFFORT_STANDARD; } - static inline bool standardEffortOnly(Effort e) CVC4_CONST_FUNCTION - { return e >= EFFORT_STANDARD && e < EFFORT_FULL; } - static inline bool fullEffort(Effort e) CVC4_CONST_FUNCTION - { return e == EFFORT_FULL; } + static inline bool standardEffortOrMore(Effort e) CVC5_CONST_FUNCTION + { + return e >= EFFORT_STANDARD; } + static inline bool standardEffortOnly(Effort e) CVC5_CONST_FUNCTION + { + return e >= EFFORT_STANDARD && e < EFFORT_FULL; } + static inline bool fullEffort(Effort e) CVC5_CONST_FUNCTION + { + return e == EFFORT_FULL; } /** * Get the id for this Theory. diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index dd130e28a..d1cc4dfc1 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -65,20 +65,20 @@ namespace theory { * Do not change this order. */ -#define CVC4_FOR_EACH_THEORY \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_BUILTIN) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_BOOL) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_UF) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_ARITH) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_BV) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_FP) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_ARRAYS) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_DATATYPES) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_SEP) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_SETS) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_BAGS) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_STRINGS) \ - CVC4_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_QUANTIFIERS) +#define CVC5_FOR_EACH_THEORY \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_BUILTIN) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_BOOL) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_UF) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_ARITH) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_BV) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_FP) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_ARRAYS) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_DATATYPES) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_SEP) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_SETS) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_BAGS) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_STRINGS) \ + CVC5_FOR_EACH_THEORY_STATEMENT(cvc5::theory::THEORY_QUANTIFIERS) } // namespace theory @@ -128,12 +128,12 @@ void TheoryEngine::finishInit() { // NOTE: This seems to be required since // theory::TheoryTraits::isParametric cannot be accessed without - // using the CVC4_FOR_EACH_THEORY_STATEMENT macro. -AJR + // using the CVC5_FOR_EACH_THEORY_STATEMENT macro. -AJR std::vector paraTheories; -#ifdef CVC4_FOR_EACH_THEORY_STATEMENT -#undef CVC4_FOR_EACH_THEORY_STATEMENT +#ifdef CVC5_FOR_EACH_THEORY_STATEMENT +#undef CVC5_FOR_EACH_THEORY_STATEMENT #endif -#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ +#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \ if (theory::TheoryTraits::isParametric \ && d_logicInfo.isTheoryEnabled(THEORY)) \ { \ @@ -141,7 +141,7 @@ void TheoryEngine::finishInit() } // Collect the parametric theories, which are given to the theory combination // manager below - CVC4_FOR_EACH_THEORY; + CVC5_FOR_EACH_THEORY; // Initialize the theory combination architecture if (options::tcMode() == options::TcMode::CARE_GRAPH) @@ -411,10 +411,10 @@ void TheoryEngine::check(Theory::Effort effort) { // Reset the interrupt flag d_interrupted = false; -#ifdef CVC4_FOR_EACH_THEORY_STATEMENT -#undef CVC4_FOR_EACH_THEORY_STATEMENT +#ifdef CVC5_FOR_EACH_THEORY_STATEMENT +#undef CVC5_FOR_EACH_THEORY_STATEMENT #endif -#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ +#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \ if (theory::TheoryTraits::hasCheck \ && d_logicInfo.isTheoryEnabled(THEORY)) \ { \ @@ -471,7 +471,7 @@ void TheoryEngine::check(Theory::Effort effort) { d_factsAsserted = false; // Do the checking - CVC4_FOR_EACH_THEORY; + CVC5_FOR_EACH_THEORY; Debug("theory") << "TheoryEngine::check(" << effort << "): running propagation after the initial check" << endl; @@ -562,19 +562,21 @@ void TheoryEngine::propagate(Theory::Effort effort) d_interrupted = false; // Definition of the statement that is to be run by every theory -#ifdef CVC4_FOR_EACH_THEORY_STATEMENT -#undef CVC4_FOR_EACH_THEORY_STATEMENT +#ifdef CVC5_FOR_EACH_THEORY_STATEMENT +#undef CVC5_FOR_EACH_THEORY_STATEMENT #endif -#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ - if (theory::TheoryTraits::hasPropagate && d_logicInfo.isTheoryEnabled(THEORY)) { \ - theoryOf(THEORY)->propagate(effort); \ +#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \ + if (theory::TheoryTraits::hasPropagate \ + && d_logicInfo.isTheoryEnabled(THEORY)) \ + { \ + theoryOf(THEORY)->propagate(effort); \ } // Reset the interrupt flag d_interrupted = false; // Propagate for each theory using the statement above - CVC4_FOR_EACH_THEORY; + CVC5_FOR_EACH_THEORY; } Node TheoryEngine::getNextDecisionRequest() @@ -665,19 +667,21 @@ bool TheoryEngine::presolve() { try { // Definition of the statement that is to be run by every theory -#ifdef CVC4_FOR_EACH_THEORY_STATEMENT -#undef CVC4_FOR_EACH_THEORY_STATEMENT +#ifdef CVC5_FOR_EACH_THEORY_STATEMENT +#undef CVC5_FOR_EACH_THEORY_STATEMENT #endif -#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ - if (theory::TheoryTraits::hasPresolve) { \ - theoryOf(THEORY)->presolve(); \ - if(d_inConflict) { \ - return true; \ - } \ - } +#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \ + if (theory::TheoryTraits::hasPresolve) \ + { \ + theoryOf(THEORY)->presolve(); \ + if (d_inConflict) \ + { \ + return true; \ + } \ + } // Presolve for each theory using the statement above - CVC4_FOR_EACH_THEORY; + CVC5_FOR_EACH_THEORY; } catch(const theory::Interrupted&) { Trace("theory") << "TheoryEngine::presolve() => interrupted" << endl; } @@ -690,14 +694,14 @@ void TheoryEngine::postsolve() { d_inSatMode = false; // Reset the interrupt flag d_interrupted = false; - bool CVC4_UNUSED wasInConflict = d_inConflict; + bool CVC5_UNUSED wasInConflict = d_inConflict; try { // Definition of the statement that is to be run by every theory -#ifdef CVC4_FOR_EACH_THEORY_STATEMENT -#undef CVC4_FOR_EACH_THEORY_STATEMENT +#ifdef CVC5_FOR_EACH_THEORY_STATEMENT +#undef CVC5_FOR_EACH_THEORY_STATEMENT #endif -#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ +#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \ if (theory::TheoryTraits::hasPostsolve) \ { \ theoryOf(THEORY)->postsolve(); \ @@ -706,7 +710,7 @@ void TheoryEngine::postsolve() { } // Postsolve for each theory using the statement above - CVC4_FOR_EACH_THEORY; + CVC5_FOR_EACH_THEORY; } catch(const theory::Interrupted&) { Trace("theory") << "TheoryEngine::postsolve() => interrupted" << endl; } @@ -718,16 +722,18 @@ void TheoryEngine::notifyRestart() { d_interrupted = false; // Definition of the statement that is to be run by every theory -#ifdef CVC4_FOR_EACH_THEORY_STATEMENT -#undef CVC4_FOR_EACH_THEORY_STATEMENT +#ifdef CVC5_FOR_EACH_THEORY_STATEMENT +#undef CVC5_FOR_EACH_THEORY_STATEMENT #endif -#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ - if (theory::TheoryTraits::hasNotifyRestart && d_logicInfo.isTheoryEnabled(THEORY)) { \ - theoryOf(THEORY)->notifyRestart(); \ +#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \ + if (theory::TheoryTraits::hasNotifyRestart \ + && d_logicInfo.isTheoryEnabled(THEORY)) \ + { \ + theoryOf(THEORY)->notifyRestart(); \ } // notify each theory using the statement above - CVC4_FOR_EACH_THEORY; + CVC5_FOR_EACH_THEORY; } void TheoryEngine::ppStaticLearn(TNode in, NodeBuilder& learned) @@ -736,16 +742,17 @@ void TheoryEngine::ppStaticLearn(TNode in, NodeBuilder& learned) d_interrupted = false; // Definition of the statement that is to be run by every theory -#ifdef CVC4_FOR_EACH_THEORY_STATEMENT -#undef CVC4_FOR_EACH_THEORY_STATEMENT +#ifdef CVC5_FOR_EACH_THEORY_STATEMENT +#undef CVC5_FOR_EACH_THEORY_STATEMENT #endif -#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ - if (theory::TheoryTraits::hasPpStaticLearn) { \ - theoryOf(THEORY)->ppStaticLearn(in, learned); \ +#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \ + if (theory::TheoryTraits::hasPpStaticLearn) \ + { \ + theoryOf(THEORY)->ppStaticLearn(in, learned); \ } // static learning for each theory using the statement above - CVC4_FOR_EACH_THEORY; + CVC5_FOR_EACH_THEORY; } bool TheoryEngine::isRelevant(Node lit) const @@ -1089,14 +1096,14 @@ void TheoryEngine::declareSepHeap(TypeNode locT, TypeNode dataT) } // Definition of the statement that is to be run by every theory -#ifdef CVC4_FOR_EACH_THEORY_STATEMENT -#undef CVC4_FOR_EACH_THEORY_STATEMENT +#ifdef CVC5_FOR_EACH_THEORY_STATEMENT +#undef CVC5_FOR_EACH_THEORY_STATEMENT #endif -#define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ +#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \ theoryOf(THEORY)->declareSepHeap(locT, dataT); // notify each theory using the statement above - CVC4_FOR_EACH_THEORY; + CVC5_FOR_EACH_THEORY; // remember the types we have set d_sepLocType = locT; diff --git a/src/theory/theory_model.cpp b/src/theory/theory_model.cpp index 814aa7ee4..357343a3c 100644 --- a/src/theory/theory_model.cpp +++ b/src/theory/theory_model.cpp @@ -353,7 +353,7 @@ void TheoryModel::addSubstitution( TNode x, TNode t, bool invalidateCache ){ Debug("model") << "Add substitution in model " << x << " -> " << t << std::endl; d_substitutions.addSubstitution( x, t, invalidateCache ); } else { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS Node oldX = d_substitutions.getSubstitution(x); // check that either the old substitution is the same, or it now maps to the new substitution if(oldX != t && d_substitutions.apply(oldX) != d_substitutions.apply(t)) { @@ -363,7 +363,7 @@ void TheoryModel::addSubstitution( TNode x, TNode t, bool invalidateCache ){ << "old mapping: " << d_substitutions.apply(oldX) << "\n" << "new mapping: " << d_substitutions.apply(t); } -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ } } diff --git a/src/theory/theory_model_builder.cpp b/src/theory/theory_model_builder.cpp index a8dd647f0..c06c6cd89 100644 --- a/src/theory/theory_model_builder.cpp +++ b/src/theory/theory_model_builder.cpp @@ -459,7 +459,7 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) bool evaluable = false; // Set to true if a term in the current equivalence class has been given an // assignment exclusion set. - bool hasESet CVC4_UNUSED = false; + bool hasESet CVC5_UNUSED = false; // Set to true if we found that a term in the current equivalence class has // been given an assignment exclusion set, and we have not seen this term // as part of a previous assignment exclusion group. In other words, when @@ -838,7 +838,7 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) isCorecursive = dt.isCodatatype() && (!dt.isFinite(t) || dt.isRecursiveSingleton(t)); } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS bool isUSortFiniteRestricted = false; if (options::finiteModelFind()) { @@ -861,7 +861,7 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) } Trace("model-builder") << " Assign phase, working on type: " << t << endl; - bool assignable, evaluable CVC4_UNUSED; + bool assignable, evaluable CVC5_UNUSED; std::map::iterator itAssigner; std::map::iterator itAssignerM; set* repSet = typeRepSet.getSet(t); @@ -935,7 +935,7 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) success = true; Trace("model-builder-debug") << "Check if excluded : " << n << std::endl; -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS if (isUSortFiniteRestricted) { // must not involve uninterpreted constants beyond cardinality @@ -1012,7 +1012,7 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) } } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS // Assert that all representatives have been converted to constants for (it = typeRepSet.begin(); it != typeRepSet.end(); ++it) { @@ -1024,7 +1024,7 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) Assert(false); } } -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ Trace("model-builder") << "Copy representatives to model..." << std::endl; tm->d_reps.clear(); @@ -1081,7 +1081,7 @@ void TheoryEngineModelBuilder::postProcessModel(bool incomplete, TheoryModel* m) void TheoryEngineModelBuilder::debugCheckModel(TheoryModel* tm) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS if (tm->hasApproximations()) { // models with approximations may fail the assertions below @@ -1125,7 +1125,7 @@ void TheoryEngineModelBuilder::debugCheckModel(TheoryModel* tm) } } } -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ // builder-specific debugging debugModel(tm); diff --git a/src/theory/type_enumerator.h b/src/theory/type_enumerator.h index 84d9ad03d..4ad449517 100644 --- a/src/theory/type_enumerator.h +++ b/src/theory/type_enumerator.h @@ -125,7 +125,7 @@ class TypeEnumerator { // On Mac clang, there appears to be a code generation bug in an exception // block here. For now, there doesn't appear a good workaround; just disable // assertions on that setup. -#if defined(CVC4_ASSERTIONS) && !(defined(__clang__)) +#if defined(CVC5_ASSERTIONS) && !(defined(__clang__)) if(d_te->isFinished()) { try { **d_te; @@ -145,7 +145,7 @@ class TypeEnumerator { Assert(false) << "didn't expect a NoMoreValuesException to be thrown"; } } -#endif /* CVC4_ASSERTIONS && !(APPLE || clang) */ +#endif /* CVC5_ASSERTIONS && !(APPLE || clang) */ return d_te->isFinished(); } Node operator*() @@ -153,7 +153,7 @@ class TypeEnumerator { // On Mac clang, there appears to be a code generation bug in an exception // block above (and perhaps here, too). For now, there doesn't appear a // good workaround; just disable assertions on that setup. -#if defined(CVC4_ASSERTIONS) && !(defined(__APPLE__) && defined(__clang__)) +#if defined(CVC5_ASSERTIONS) && !(defined(__APPLE__) && defined(__clang__)) try { Node n = **d_te; Assert(n.isConst()) << "Term " << n @@ -164,9 +164,9 @@ class TypeEnumerator { Assert(isFinished()); throw; } -#else /* CVC4_ASSERTIONS && !(APPLE || clang) */ +#else /* CVC5_ASSERTIONS && !(APPLE || clang) */ return **d_te; -#endif /* CVC4_ASSERTIONS && !(APPLE || clang) */ +#endif /* CVC5_ASSERTIONS && !(APPLE || clang) */ } TypeEnumerator& operator++() { diff --git a/src/theory/uf/equality_engine.cpp b/src/theory/uf/equality_engine.cpp index 5fbbd3700..17c2d5a5c 100644 --- a/src/theory/uf/equality_engine.cpp +++ b/src/theory/uf/equality_engine.cpp @@ -1387,7 +1387,7 @@ void EqualityEngine::getExplanation( cache[cacheKey] = eqp; // We can only explain the nodes that got merged -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS bool canExplain = getEqualityNode(t1Id).getFind() == getEqualityNode(t2Id).getFind() || (d_done && isConstant(t1Id) && isConstant(t2Id)); @@ -2385,7 +2385,7 @@ EqualityEngine::TriggerTermSetRef EqualityEngine::newTriggerTermSet( bool EqualityEngine::hasPropagatedDisequality(EqualityNodeId lhsId, EqualityNodeId rhsId) const { EqualityPair eq(lhsId, rhsId); bool propagated = d_propagatedDisequalities.find(eq) != d_propagatedDisequalities.end(); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS bool stored = d_disequalityReasonsMap.find(eq) != d_disequalityReasonsMap.end(); Assert(propagated == stored) << "These two should be in sync"; #endif @@ -2439,7 +2439,7 @@ void EqualityEngine::storePropagatedDisequality(TheoryId tag, EqualityNodeId lhs Assert(d_disequalityReasonsMap.find(pair1) == d_disequalityReasonsMap.end()) << "There can't be a proof if you're adding a new one"; DisequalityReasonRef ref(d_deducedDisequalityReasonsSize, d_deducedDisequalityReasons.size()); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS // Check that the reasons are valid for (unsigned i = ref.d_mergesStart; i < ref.d_mergesEnd; ++i) { diff --git a/src/theory/uf/symmetry_breaker.cpp b/src/theory/uf/symmetry_breaker.cpp index 0586da6a0..b52e39ebc 100644 --- a/src/theory/uf/symmetry_breaker.cpp +++ b/src/theory/uf/symmetry_breaker.cpp @@ -370,7 +370,7 @@ Node SymmetryBreaker::normInternal(TNode n, size_t level) { Debug("ufsymm:eq") << "UFSYMM " << n[0] << " <==> " << n[1] << endl; } } - CVC4_FALLTHROUGH; + CVC5_FALLTHROUGH; case kind::XOR: // commutative binary operator handling return n[1] < n[0] ? NodeManager::currentNM()->mkNode(k, n[1], n[0]) : Node(n); @@ -438,7 +438,7 @@ void SymmetryBreaker::assertFormula(TNode phi) { d_permutations.insert(p); } d_template.reset(); - bool good CVC4_UNUSED = d_template.match(phi); + bool good CVC5_UNUSED = d_template.match(phi); Assert(good); } } diff --git a/src/theory/valuation.h b/src/theory/valuation.h index 806b0dd8e..bad06b716 100644 --- a/src/theory/valuation.h +++ b/src/theory/valuation.h @@ -150,7 +150,7 @@ public: * differ from the input due to theory-rewriting and preprocessing, * as well as CNF conversion */ - Node ensureLiteral(TNode n) CVC4_WARN_UNUSED_RESULT; + Node ensureLiteral(TNode n) CVC5_WARN_UNUSED_RESULT; /** * This returns the theory-preprocessed form of term n. The theory diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 4bc6da1ae..015a484d1 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -85,14 +85,14 @@ libcvc4_add_sources( utility.h ) -if(CVC4_USE_CLN_IMP) +if(CVC5_USE_CLN_IMP) libcvc4_add_sources(rational_cln_imp.cpp integer_cln_imp.cpp) endif() -if(CVC4_USE_GMP_IMP) +if(CVC5_USE_GMP_IMP) libcvc4_add_sources(rational_gmp_imp.cpp integer_gmp_imp.cpp) endif() -if(CVC4_USE_POLY_IMP) +if(CVC5_USE_POLY_IMP) libcvc4_add_sources(real_algebraic_number_poly_imp.cpp real_algebraic_number_poly_imp.h) endif() diff --git a/src/util/floatingpoint.cpp b/src/util/floatingpoint.cpp index a9d404103..b6fa79e84 100644 --- a/src/util/floatingpoint.cpp +++ b/src/util/floatingpoint.cpp @@ -435,7 +435,7 @@ FloatingPoint::PartialRational FloatingPoint::convertToRational(void) const // unsigned int is not smaller than uint32_t static_assert(sizeof(unsigned int) >= sizeof(uint32_t), "Conversion float -> real could loose data"); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS // Note that multipling by 2^n requires n bits of space (worst case) // so, in effect, these tests limit us to cases where the resultant // number requires up to 2^32 bits = 512 megabyte to represent. diff --git a/src/util/floatingpoint_literal_symfpu.cpp b/src/util/floatingpoint_literal_symfpu.cpp index 011bce16d..f6bb9d541 100644 --- a/src/util/floatingpoint_literal_symfpu.cpp +++ b/src/util/floatingpoint_literal_symfpu.cpp @@ -15,7 +15,7 @@ #include "base/check.h" -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU #include "symfpu/core/add.h" #include "symfpu/core/classify.h" #include "symfpu/core/compare.h" @@ -34,10 +34,10 @@ /* -------------------------------------------------------------------------- */ -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU namespace symfpu { -#define CVC4_LIT_ITE_DFN(T) \ +#define CVC5_LIT_ITE_DFN(T) \ template <> \ struct ite<::cvc5::symfpuLiteral::Cvc5Prop, T> \ { \ @@ -49,12 +49,12 @@ namespace symfpu { } \ } -CVC4_LIT_ITE_DFN(::cvc5::symfpuLiteral::traits::rm); -CVC4_LIT_ITE_DFN(::cvc5::symfpuLiteral::traits::prop); -CVC4_LIT_ITE_DFN(::cvc5::symfpuLiteral::traits::sbv); -CVC4_LIT_ITE_DFN(::cvc5::symfpuLiteral::traits::ubv); +CVC5_LIT_ITE_DFN(::cvc5::symfpuLiteral::traits::rm); +CVC5_LIT_ITE_DFN(::cvc5::symfpuLiteral::traits::prop); +CVC5_LIT_ITE_DFN(::cvc5::symfpuLiteral::traits::sbv); +CVC5_LIT_ITE_DFN(::cvc5::symfpuLiteral::traits::ubv); -#undef CVC4_LIT_ITE_DFN +#undef CVC5_LIT_ITE_DFN } // namespace symfpu #endif @@ -64,7 +64,7 @@ namespace cvc5 { uint32_t FloatingPointLiteral::getUnpackedExponentWidth(FloatingPointSize& size) { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return SymFPUUnpackedFloatLiteral::exponentWidth(size); #else unimplemented(); @@ -75,7 +75,7 @@ uint32_t FloatingPointLiteral::getUnpackedExponentWidth(FloatingPointSize& size) uint32_t FloatingPointLiteral::getUnpackedSignificandWidth( FloatingPointSize& size) { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return SymFPUUnpackedFloatLiteral::significandWidth(size); #else unimplemented(); @@ -87,7 +87,7 @@ FloatingPointLiteral::FloatingPointLiteral(uint32_t exp_size, uint32_t sig_size, const BitVector& bv) : d_fp_size(exp_size, sig_size) -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU , d_symuf(symfpu::unpack( symfpuLiteral::Cvc5FPSize(exp_size, sig_size), bv)) @@ -98,7 +98,7 @@ FloatingPointLiteral::FloatingPointLiteral(uint32_t exp_size, FloatingPointLiteral::FloatingPointLiteral( const FloatingPointSize& size, FloatingPointLiteral::SpecialConstKind kind) : d_fp_size(size) -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU , d_symuf(SymFPUUnpackedFloatLiteral::makeNaN(size)) #endif @@ -111,7 +111,7 @@ FloatingPointLiteral::FloatingPointLiteral( FloatingPointLiteral::SpecialConstKind kind, bool sign) : d_fp_size(size) -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU , d_symuf(kind == FloatingPointLiteral::SpecialConstKind::FPINF ? SymFPUUnpackedFloatLiteral::makeInf(size, sign) @@ -125,7 +125,7 @@ FloatingPointLiteral::FloatingPointLiteral( FloatingPointLiteral::FloatingPointLiteral(const FloatingPointSize& size, const BitVector& bv) : d_fp_size(size) -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU , d_symuf(symfpu::unpack(size, bv)) #endif @@ -137,7 +137,7 @@ FloatingPointLiteral::FloatingPointLiteral(const FloatingPointSize& size, const BitVector& bv, bool signedBV) : d_fp_size(size) -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU , d_symuf(signedBV ? symfpu::convertSBVToFloat( symfpuLiteral::Cvc5FPSize(size), @@ -153,7 +153,7 @@ FloatingPointLiteral::FloatingPointLiteral(const FloatingPointSize& size, BitVector FloatingPointLiteral::pack(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU BitVector bv(symfpu::pack(d_fp_size, d_symuf)); #else unimplemented(); @@ -164,7 +164,7 @@ BitVector FloatingPointLiteral::pack(void) const FloatingPointLiteral FloatingPointLiteral::absolute(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return FloatingPointLiteral( d_fp_size, symfpu::absolute(d_fp_size, d_symuf)); #else @@ -175,7 +175,7 @@ FloatingPointLiteral FloatingPointLiteral::absolute(void) const FloatingPointLiteral FloatingPointLiteral::negate(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return FloatingPointLiteral( d_fp_size, symfpu::negate(d_fp_size, d_symuf)); #else @@ -187,7 +187,7 @@ FloatingPointLiteral FloatingPointLiteral::negate(void) const FloatingPointLiteral FloatingPointLiteral::add( const RoundingMode& rm, const FloatingPointLiteral& arg) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return FloatingPointLiteral(d_fp_size, symfpu::add( @@ -201,7 +201,7 @@ FloatingPointLiteral FloatingPointLiteral::add( FloatingPointLiteral FloatingPointLiteral::sub( const RoundingMode& rm, const FloatingPointLiteral& arg) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return FloatingPointLiteral(d_fp_size, symfpu::add( @@ -215,7 +215,7 @@ FloatingPointLiteral FloatingPointLiteral::sub( FloatingPointLiteral FloatingPointLiteral::mult( const RoundingMode& rm, const FloatingPointLiteral& arg) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return FloatingPointLiteral(d_fp_size, symfpu::multiply( @@ -229,7 +229,7 @@ FloatingPointLiteral FloatingPointLiteral::mult( FloatingPointLiteral FloatingPointLiteral::div( const RoundingMode& rm, const FloatingPointLiteral& arg) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return FloatingPointLiteral(d_fp_size, symfpu::divide( @@ -245,7 +245,7 @@ FloatingPointLiteral FloatingPointLiteral::fma( const FloatingPointLiteral& arg1, const FloatingPointLiteral& arg2) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg1.d_fp_size); Assert(d_fp_size == arg2.d_fp_size); return FloatingPointLiteral( @@ -260,7 +260,7 @@ FloatingPointLiteral FloatingPointLiteral::fma( FloatingPointLiteral FloatingPointLiteral::sqrt(const RoundingMode& rm) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return FloatingPointLiteral( d_fp_size, symfpu::sqrt(d_fp_size, rm, d_symuf)); #else @@ -271,7 +271,7 @@ FloatingPointLiteral FloatingPointLiteral::sqrt(const RoundingMode& rm) const FloatingPointLiteral FloatingPointLiteral::rti(const RoundingMode& rm) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return FloatingPointLiteral( d_fp_size, symfpu::roundToIntegral(d_fp_size, rm, d_symuf)); @@ -284,7 +284,7 @@ FloatingPointLiteral FloatingPointLiteral::rti(const RoundingMode& rm) const FloatingPointLiteral FloatingPointLiteral::rem( const FloatingPointLiteral& arg) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return FloatingPointLiteral(d_fp_size, symfpu::remainder( @@ -298,7 +298,7 @@ FloatingPointLiteral FloatingPointLiteral::rem( FloatingPointLiteral FloatingPointLiteral::maxTotal( const FloatingPointLiteral& arg, bool zeroCaseLeft) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return FloatingPointLiteral( d_fp_size, @@ -313,7 +313,7 @@ FloatingPointLiteral FloatingPointLiteral::maxTotal( FloatingPointLiteral FloatingPointLiteral::minTotal( const FloatingPointLiteral& arg, bool zeroCaseLeft) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return FloatingPointLiteral( d_fp_size, @@ -327,7 +327,7 @@ FloatingPointLiteral FloatingPointLiteral::minTotal( bool FloatingPointLiteral::operator==(const FloatingPointLiteral& fp) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return ((d_fp_size == fp.d_fp_size) && symfpu::smtlibEqual( d_fp_size, d_symuf, fp.d_symuf)); @@ -339,7 +339,7 @@ bool FloatingPointLiteral::operator==(const FloatingPointLiteral& fp) const bool FloatingPointLiteral::operator<=(const FloatingPointLiteral& arg) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return symfpu::lessThanOrEqual( d_fp_size, d_symuf, arg.d_symuf); @@ -351,7 +351,7 @@ bool FloatingPointLiteral::operator<=(const FloatingPointLiteral& arg) const bool FloatingPointLiteral::operator<(const FloatingPointLiteral& arg) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Assert(d_fp_size == arg.d_fp_size); return symfpu::lessThan( d_fp_size, d_symuf, arg.d_symuf); @@ -363,7 +363,7 @@ bool FloatingPointLiteral::operator<(const FloatingPointLiteral& arg) const BitVector FloatingPointLiteral::getExponent() const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return d_symuf.exponent; #else unimplemented(); @@ -374,7 +374,7 @@ BitVector FloatingPointLiteral::getExponent() const BitVector FloatingPointLiteral::getSignificand() const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return d_symuf.significand; #else unimplemented(); @@ -385,7 +385,7 @@ BitVector FloatingPointLiteral::getSignificand() const bool FloatingPointLiteral::getSign() const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return d_symuf.sign; #else unimplemented(); @@ -396,7 +396,7 @@ bool FloatingPointLiteral::getSign() const bool FloatingPointLiteral::isNormal(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::isNormal(d_fp_size, d_symuf); #else unimplemented(); @@ -406,7 +406,7 @@ bool FloatingPointLiteral::isNormal(void) const bool FloatingPointLiteral::isSubnormal(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::isSubnormal(d_fp_size, d_symuf); #else unimplemented(); @@ -416,7 +416,7 @@ bool FloatingPointLiteral::isSubnormal(void) const bool FloatingPointLiteral::isZero(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::isZero(d_fp_size, d_symuf); #else unimplemented(); @@ -426,7 +426,7 @@ bool FloatingPointLiteral::isZero(void) const bool FloatingPointLiteral::isInfinite(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::isInfinite(d_fp_size, d_symuf); #else unimplemented(); @@ -436,7 +436,7 @@ bool FloatingPointLiteral::isInfinite(void) const bool FloatingPointLiteral::isNaN(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::isNaN(d_fp_size, d_symuf); #else unimplemented(); @@ -446,7 +446,7 @@ bool FloatingPointLiteral::isNaN(void) const bool FloatingPointLiteral::isNegative(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::isNegative(d_fp_size, d_symuf); #else unimplemented(); @@ -456,7 +456,7 @@ bool FloatingPointLiteral::isNegative(void) const bool FloatingPointLiteral::isPositive(void) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::isPositive(d_fp_size, d_symuf); #else unimplemented(); @@ -467,7 +467,7 @@ bool FloatingPointLiteral::isPositive(void) const FloatingPointLiteral FloatingPointLiteral::convert( const FloatingPointSize& target, const RoundingMode& rm) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return FloatingPointLiteral( target, symfpu::convertFloatToFloat( @@ -482,7 +482,7 @@ BitVector FloatingPointLiteral::convertToSBVTotal(BitVectorSize width, const RoundingMode& rm, BitVector undefinedCase) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::convertFloatToSBV( d_fp_size, rm, d_symuf, width, undefinedCase); #else @@ -495,7 +495,7 @@ BitVector FloatingPointLiteral::convertToUBVTotal(BitVectorSize width, const RoundingMode& rm, BitVector undefinedCase) const { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU return symfpu::convertFloatToUBV( d_fp_size, rm, d_symuf, width, undefinedCase); #else @@ -504,7 +504,7 @@ BitVector FloatingPointLiteral::convertToUBVTotal(BitVectorSize width, #endif } -#ifndef CVC4_USE_SYMFPU +#ifndef CVC5_USE_SYMFPU void FloatingPointLiteral::unimplemented(void) { Unimplemented() << "no concrete implementation of FloatingPointLiteral"; diff --git a/src/util/floatingpoint_literal_symfpu.h.in b/src/util/floatingpoint_literal_symfpu.h.in index 8ef62c63b..e773c1f97 100644 --- a/src/util/floatingpoint_literal_symfpu.h.in +++ b/src/util/floatingpoint_literal_symfpu.h.in @@ -28,7 +28,7 @@ namespace cvc5 { // clang-format off -#if @CVC4_USE_SYMFPU@ +#if @CVC5_USE_SYMFPU@ // clang-format on using SymFPUUnpackedFloatLiteral = ::symfpu::unpackedFloat; @@ -65,7 +65,7 @@ class FloatingPointLiteral static uint32_t getUnpackedSignificandWidth(FloatingPointSize& size); // clang-format off -#if !@CVC4_USE_SYMFPU@ +#if !@CVC5_USE_SYMFPU@ // clang-format on /** Catch-all for unimplemented functions. */ static void unimplemented(void); @@ -197,7 +197,7 @@ class FloatingPointLiteral const RoundingMode& rm, BitVector undefinedCase) const; // clang-format off -#if @CVC4_USE_SYMFPU@ +#if @CVC5_USE_SYMFPU@ // clang-format on /** Return wrapped floating-point literal. */ const SymFPUUnpackedFloatLiteral& getSymUF() const { return d_symuf; } @@ -224,7 +224,7 @@ class FloatingPointLiteral const BitVector& sig) : d_fp_size(size) // clang-format off -#if @CVC4_USE_SYMFPU@ +#if @CVC5_USE_SYMFPU@ // clang-format on , d_symuf(SymFPUUnpackedFloatLiteral(sign, exp, sig)) @@ -233,7 +233,7 @@ class FloatingPointLiteral } // clang-format off -#if @CVC4_USE_SYMFPU@ +#if @CVC5_USE_SYMFPU@ // clang-format on /** Create a FP literal from a symFPU unpacked float. */ @@ -245,7 +245,7 @@ class FloatingPointLiteral /** The floating-point size of this floating-point literal. */ FloatingPointSize d_fp_size; // clang-format off -#if @CVC4_USE_SYMFPU@ +#if @CVC5_USE_SYMFPU@ // clang-format on /** The actual floating-point value, a SymFPU unpackedFloat. */ SymFPUUnpackedFloatLiteral d_symuf; diff --git a/src/util/floatingpoint_literal_symfpu_traits.cpp b/src/util/floatingpoint_literal_symfpu_traits.cpp index fe814317d..d1cd7621f 100644 --- a/src/util/floatingpoint_literal_symfpu_traits.cpp +++ b/src/util/floatingpoint_literal_symfpu_traits.cpp @@ -12,7 +12,7 @@ ** \brief SymFPU glue code for floating-point values. **/ -#if CVC4_USE_SYMFPU +#if CVC5_USE_SYMFPU #include "util/floatingpoint_literal_symfpu_traits.h" diff --git a/src/util/floatingpoint_literal_symfpu_traits.h.in b/src/util/floatingpoint_literal_symfpu_traits.h.in index 19abc009e..2c2504ab7 100644 --- a/src/util/floatingpoint_literal_symfpu_traits.h.in +++ b/src/util/floatingpoint_literal_symfpu_traits.h.in @@ -27,7 +27,7 @@ #define CVC5__UTIL__FLOATINGPOINT_LITERAL_SYMFPU_TRAITS_H // clang-format off -#if @CVC4_USE_SYMFPU@ +#if @CVC5_USE_SYMFPU@ // clang-format on #include "util/bitvector.h" diff --git a/src/util/hash.h b/src/util/hash.h index d21188f2c..a7cb214b0 100644 --- a/src/util/hash.h +++ b/src/util/hash.h @@ -25,7 +25,7 @@ namespace std { -#ifdef CVC4_NEED_HASH_UINT64_T +#ifdef CVC5_NEED_HASH_UINT64_T // on some versions and architectures of GNU C++, we need a // specialization of hash for 64-bit values template <> @@ -34,7 +34,7 @@ struct hash { return v; } };/* struct hash */ -#endif /* CVC4_NEED_HASH_UINT64_T */ +#endif /* CVC5_NEED_HASH_UINT64_T */ }/* std namespace */ diff --git a/src/util/integer.h.in b/src/util/integer.h.in index dbf1af22a..aabc8109d 100644 --- a/src/util/integer.h.in +++ b/src/util/integer.h.in @@ -16,27 +16,27 @@ // these gestures are used to avoid a public header dependence on cvc4autoconfig.h -#if @CVC4_NEED_INT64_T_OVERLOADS@ -# define CVC4_NEED_INT64_T_OVERLOADS +#if @CVC5_NEED_INT64_T_OVERLOADS@ +# define CVC5_NEED_INT64_T_OVERLOADS #endif -#if /* use CLN */ @CVC4_USE_CLN_IMP@ -# define CVC4_CLN_IMP -#endif /* @CVC4_USE_CLN_IMP@ */ -#if /* use GMP */ @CVC4_USE_GMP_IMP@ -# define CVC4_GMP_IMP -#endif /* @CVC4_USE_GMP_IMP@ */ +#if /* use CLN */ @CVC5_USE_CLN_IMP@ +# define CVC5_CLN_IMP +#endif /* @CVC5_USE_CLN_IMP@ */ +#if /* use GMP */ @CVC5_USE_GMP_IMP@ +# define CVC5_GMP_IMP +#endif /* @CVC5_USE_GMP_IMP@ */ -#ifdef CVC4_CLN_IMP +#ifdef CVC5_CLN_IMP # include "util/integer_cln_imp.h" # if SWIG %include "util/integer_cln_imp.h" # endif /* SWIG */ -#endif /* CVC4_CLN_IMP */ +#endif /* CVC5_CLN_IMP */ -#ifdef CVC4_GMP_IMP +#ifdef CVC5_GMP_IMP # include "util/integer_gmp_imp.h" # if SWIG %include "util/integer_gmp_imp.h" # endif /* SWIG */ -#endif /* CVC4_GMP_IMP */ +#endif /* CVC5_GMP_IMP */ diff --git a/src/util/integer_cln_imp.cpp b/src/util/integer_cln_imp.cpp index 3b70a98bf..c41b17fd6 100644 --- a/src/util/integer_cln_imp.cpp +++ b/src/util/integer_cln_imp.cpp @@ -20,9 +20,9 @@ #include "cvc4autoconfig.h" #include "util/integer.h" -#ifndef CVC4_CLN_IMP -#error "This source should only ever be built if CVC4_CLN_IMP is on !" -#endif /* CVC4_CLN_IMP */ +#ifndef CVC5_CLN_IMP +#error "This source should only ever be built if CVC5_CLN_IMP is on !" +#endif /* CVC5_CLN_IMP */ #include "base/check.h" diff --git a/src/util/integer_cln_imp.h b/src/util/integer_cln_imp.h index c3a9434b9..fdc55871d 100644 --- a/src/util/integer_cln_imp.h +++ b/src/util/integer_cln_imp.h @@ -75,10 +75,10 @@ class CVC4_EXPORT Integer Integer(signed long int z) : d_value(z) {} Integer(unsigned long int z) : d_value(z) {} -#ifdef CVC4_NEED_INT64_T_OVERLOADS +#ifdef CVC5_NEED_INT64_T_OVERLOADS Integer(int64_t z) : d_value(static_cast(z)) {} Integer(uint64_t z) : d_value(static_cast(z)) {} -#endif /* CVC4_NEED_INT64_T_OVERLOADS */ +#endif /* CVC5_NEED_INT64_T_OVERLOADS */ /** Destructor. */ ~Integer() {} diff --git a/src/util/integer_gmp_imp.cpp b/src/util/integer_gmp_imp.cpp index 399b7bbbe..a7ba33bb0 100644 --- a/src/util/integer_gmp_imp.cpp +++ b/src/util/integer_gmp_imp.cpp @@ -25,8 +25,8 @@ #include "base/check.h" #include "util/rational.h" -#ifndef CVC4_GMP_IMP -# error "This source should only ever be built if CVC4_GMP_IMP is on !" +#ifndef CVC5_GMP_IMP +#error "This source should only ever be built if CVC5_GMP_IMP is on !" #endif using namespace std; diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h index 077babe17..a5cc793ce 100644 --- a/src/util/integer_gmp_imp.h +++ b/src/util/integer_gmp_imp.h @@ -60,10 +60,10 @@ class CVC4_EXPORT Integer Integer(signed long int z) : d_value(z) {} Integer(unsigned long int z) : d_value(z) {} -#ifdef CVC4_NEED_INT64_T_OVERLOADS +#ifdef CVC5_NEED_INT64_T_OVERLOADS Integer(int64_t z) : d_value(static_cast(z)) {} Integer(uint64_t z) : d_value(static_cast(z)) {} -#endif /* CVC4_NEED_INT64_T_OVERLOADS */ +#endif /* CVC5_NEED_INT64_T_OVERLOADS */ /** Destructor. */ ~Integer() {} diff --git a/src/util/poly_util.cpp b/src/util/poly_util.cpp index 7cb8baae3..50f42140b 100644 --- a/src/util/poly_util.cpp +++ b/src/util/poly_util.cpp @@ -22,7 +22,7 @@ #include "poly_util.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include @@ -58,10 +58,10 @@ To cast_by_string(const From& f) Integer toInteger(const poly::Integer& i) { const mpz_class& gi = *poly::detail::cast_to_gmp(&i); -#ifdef CVC4_GMP_IMP +#ifdef CVC5_GMP_IMP return Integer(gi); #endif -#ifdef CVC4_CLN_IMP +#ifdef CVC5_CLN_IMP if (std::numeric_limits::min() <= gi && gi <= std::numeric_limits::max()) { @@ -76,10 +76,10 @@ Integer toInteger(const poly::Integer& i) Rational toRational(const poly::Integer& i) { return Rational(toInteger(i)); } Rational toRational(const poly::Rational& r) { -#ifdef CVC4_GMP_IMP +#ifdef CVC5_GMP_IMP return Rational(*poly::detail::cast_to_gmp(&r)); #endif -#ifdef CVC4_CLN_IMP +#ifdef CVC5_CLN_IMP return Rational(toInteger(numerator(r)), toInteger(denominator(r))); #endif } @@ -132,10 +132,10 @@ Rational toRationalBelow(const poly::Value& v) poly::Integer toInteger(const Integer& i) { -#ifdef CVC4_GMP_IMP +#ifdef CVC5_GMP_IMP return poly::Integer(i.getValue()); #endif -#ifdef CVC4_CLN_IMP +#ifdef CVC5_CLN_IMP if (std::numeric_limits::min() <= i.getValue() && i.getValue() <= std::numeric_limits::max()) { @@ -155,10 +155,10 @@ std::vector toInteger(const std::vector& vi) } poly::Rational toRational(const Rational& r) { -#ifdef CVC4_GMP_IMP +#ifdef CVC5_GMP_IMP return poly::Rational(r.getValue()); #endif -#ifdef CVC4_CLN_IMP +#ifdef CVC5_CLN_IMP return poly::Rational(toInteger(r.getNumerator()), toInteger(r.getDenominator())); #endif diff --git a/src/util/poly_util.h b/src/util/poly_util.h index 2ab44e120..5ab96b5b1 100644 --- a/src/util/poly_util.h +++ b/src/util/poly_util.h @@ -32,7 +32,7 @@ #include "util/rational.h" #include "util/real_algebraic_number.h" -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP #include diff --git a/src/util/rational.h.in b/src/util/rational.h.in index ff49ae638..b05aefbd3 100644 --- a/src/util/rational.h.in +++ b/src/util/rational.h.in @@ -16,27 +16,27 @@ // these gestures are used to avoid a public header dependence on cvc4autoconfig.h -#if @CVC4_NEED_INT64_T_OVERLOADS@ -# define CVC4_NEED_INT64_T_OVERLOADS +#if @CVC5_NEED_INT64_T_OVERLOADS@ +# define CVC5_NEED_INT64_T_OVERLOADS #endif -#if /* use CLN */ @CVC4_USE_CLN_IMP@ -# define CVC4_CLN_IMP -#endif /* @CVC4_USE_CLN_IMP@ */ -#if /* use GMP */ @CVC4_USE_GMP_IMP@ -# define CVC4_GMP_IMP -#endif /* @CVC4_USE_GMP_IMP@ */ +#if /* use CLN */ @CVC5_USE_CLN_IMP@ +# define CVC5_CLN_IMP +#endif /* @CVC5_USE_CLN_IMP@ */ +#if /* use GMP */ @CVC5_USE_GMP_IMP@ +# define CVC5_GMP_IMP +#endif /* @CVC5_USE_GMP_IMP@ */ -#ifdef CVC4_CLN_IMP +#ifdef CVC5_CLN_IMP # include "util/rational_cln_imp.h" # if SWIG %include "util/rational_cln_imp.h" # endif /* SWIG */ -#endif /* CVC4_CLN_IMP */ +#endif /* CVC5_CLN_IMP */ -#ifdef CVC4_GMP_IMP +#ifdef CVC5_GMP_IMP # include "util/rational_gmp_imp.h" # if SWIG %include "util/rational_gmp_imp.h" # endif /* SWIG */ -#endif /* CVC4_GMP_IMP */ +#endif /* CVC5_GMP_IMP */ diff --git a/src/util/rational_cln_imp.cpp b/src/util/rational_cln_imp.cpp index b12fd8d28..5d71e63f4 100644 --- a/src/util/rational_cln_imp.cpp +++ b/src/util/rational_cln_imp.cpp @@ -20,9 +20,9 @@ #include "cvc4autoconfig.h" -#ifndef CVC4_CLN_IMP -# error "This source should only ever be built if CVC4_CLN_IMP is on !" -#endif /* CVC4_CLN_IMP */ +#ifndef CVC5_CLN_IMP +#error "This source should only ever be built if CVC5_CLN_IMP is on !" +#endif /* CVC5_CLN_IMP */ #include "base/check.h" diff --git a/src/util/rational_cln_imp.h b/src/util/rational_cln_imp.h index 992218ed0..4614620d5 100644 --- a/src/util/rational_cln_imp.h +++ b/src/util/rational_cln_imp.h @@ -130,10 +130,10 @@ class CVC4_EXPORT Rational Rational(signed long int n) : d_value(n) {} Rational(unsigned long int n) : d_value(n) {} -#ifdef CVC4_NEED_INT64_T_OVERLOADS +#ifdef CVC5_NEED_INT64_T_OVERLOADS Rational(int64_t n) : d_value(static_cast(n)) {} Rational(uint64_t n) : d_value(static_cast(n)) {} -#endif /* CVC4_NEED_INT64_T_OVERLOADS */ +#endif /* CVC5_NEED_INT64_T_OVERLOADS */ /** * Constructs a canonical Rational from a numerator and denominator. @@ -155,7 +155,7 @@ class CVC4_EXPORT Rational d_value /= cln::cl_I(d); } -#ifdef CVC4_NEED_INT64_T_OVERLOADS +#ifdef CVC5_NEED_INT64_T_OVERLOADS Rational(int64_t n, int64_t d) : d_value(static_cast(n)) { d_value /= cln::cl_I(d); @@ -164,7 +164,7 @@ class CVC4_EXPORT Rational { d_value /= cln::cl_I(d); } -#endif /* CVC4_NEED_INT64_T_OVERLOADS */ +#endif /* CVC5_NEED_INT64_T_OVERLOADS */ Rational(const Integer& n, const Integer& d) : d_value(n.get_cl_I()) { diff --git a/src/util/rational_gmp_imp.cpp b/src/util/rational_gmp_imp.cpp index 69a2fa2dd..f64bca32f 100644 --- a/src/util/rational_gmp_imp.cpp +++ b/src/util/rational_gmp_imp.cpp @@ -21,9 +21,9 @@ #include "cvc4autoconfig.h" -#ifndef CVC4_GMP_IMP // Make sure this comes after cvc4autoconfig.h -# error "This source should only ever be built if CVC4_GMP_IMP is on !" -#endif /* CVC4_GMP_IMP */ +#ifndef CVC5_GMP_IMP // Make sure this comes after cvc4autoconfig.h +#error "This source should only ever be built if CVC5_GMP_IMP is on !" +#endif /* CVC5_GMP_IMP */ #include "base/check.h" diff --git a/src/util/rational_gmp_imp.h b/src/util/rational_gmp_imp.h index caaa26d1e..1509e3e16 100644 --- a/src/util/rational_gmp_imp.h +++ b/src/util/rational_gmp_imp.h @@ -97,7 +97,7 @@ class CVC4_EXPORT Rational Rational(signed long int n) : d_value(n, 1) { d_value.canonicalize(); } Rational(unsigned long int n) : d_value(n, 1) { d_value.canonicalize(); } -#ifdef CVC4_NEED_INT64_T_OVERLOADS +#ifdef CVC5_NEED_INT64_T_OVERLOADS Rational(int64_t n) : d_value(static_cast(n), 1) { d_value.canonicalize(); @@ -106,7 +106,7 @@ class CVC4_EXPORT Rational { d_value.canonicalize(); } -#endif /* CVC4_NEED_INT64_T_OVERLOADS */ +#endif /* CVC5_NEED_INT64_T_OVERLOADS */ /** * Constructs a canonical Rational from a numerator and denominator. @@ -128,7 +128,7 @@ class CVC4_EXPORT Rational d_value.canonicalize(); } -#ifdef CVC4_NEED_INT64_T_OVERLOADS +#ifdef CVC5_NEED_INT64_T_OVERLOADS Rational(int64_t n, int64_t d) : d_value(static_cast(n), static_cast(d)) { @@ -139,7 +139,7 @@ class CVC4_EXPORT Rational { d_value.canonicalize(); } -#endif /* CVC4_NEED_INT64_T_OVERLOADS */ +#endif /* CVC5_NEED_INT64_T_OVERLOADS */ Rational(const Integer& n, const Integer& d) : d_value(n.get_mpz(), d.get_mpz()) diff --git a/src/util/real_algebraic_number.h.in b/src/util/real_algebraic_number.h.in index 4a8982e0b..910b357d1 100644 --- a/src/util/real_algebraic_number.h.in +++ b/src/util/real_algebraic_number.h.in @@ -16,10 +16,10 @@ // these gestures are used to avoid a public header dependence on cvc4autoconfig.h -#if /* use libpoly */ @CVC4_USE_POLY_IMP@ -# define CVC4_POLY_IMP -#endif /* @CVC4_USE_POLY_IMP@ */ +#if /* use libpoly */ @CVC5_USE_POLY_IMP@ +# define CVC5_POLY_IMP +#endif /* @CVC5_USE_POLY_IMP@ */ -#ifdef CVC4_POLY_IMP +#ifdef CVC5_POLY_IMP # include "util/real_algebraic_number_poly_imp.h" -#endif /* CVC4_POLY_IMP */ +#endif /* CVC5_POLY_IMP */ diff --git a/src/util/real_algebraic_number_poly_imp.cpp b/src/util/real_algebraic_number_poly_imp.cpp index 5c7dd9468..013fc2a4a 100644 --- a/src/util/real_algebraic_number_poly_imp.cpp +++ b/src/util/real_algebraic_number_poly_imp.cpp @@ -17,9 +17,9 @@ #include "cvc4autoconfig.h" #include "util/real_algebraic_number.h" -#ifndef CVC4_POLY_IMP // Make sure this comes after cvc4autoconfig.h -#error "This source should only ever be built if CVC4_POLY_IMP is on!" -#endif /* CVC4_POLY_IMP */ +#ifndef CVC5_POLY_IMP // Make sure this comes after cvc4autoconfig.h +#error "This source should only ever be built if CVC5_POLY_IMP is on!" +#endif /* CVC5_POLY_IMP */ #include @@ -60,7 +60,7 @@ RealAlgebraicNumber::RealAlgebraicNumber(const std::vector& coefficients, long lower, long upper) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (long c : coefficients) { Assert(std::numeric_limits::min() <= c diff --git a/src/util/roundingmode.h b/src/util/roundingmode.h index 482e28781..871bece21 100644 --- a/src/util/roundingmode.h +++ b/src/util/roundingmode.h @@ -20,7 +20,7 @@ namespace cvc5 { -#define CVC4_NUM_ROUNDING_MODES 5 +#define CVC5_NUM_ROUNDING_MODES 5 /** * A concrete instance of the rounding mode sort diff --git a/src/util/sampler.cpp b/src/util/sampler.cpp index 5351a6175..a5ed5bbb4 100644 --- a/src/util/sampler.cpp +++ b/src/util/sampler.cpp @@ -76,27 +76,27 @@ FloatingPoint Sampler::pickFpBiased(unsigned e, unsigned s) // +/- inf // sign = x, exp = 11...11, sig = 00...00 - case 1: sign = one; CVC4_FALLTHROUGH; + case 1: sign = one; CVC5_FALLTHROUGH; case 2: exp = BitVector::mkOnes(e); break; // +/- zero // sign = x, exp = 00...00, sig = 00...00 - case 3: sign = one; CVC4_FALLTHROUGH; + case 3: sign = one; CVC5_FALLTHROUGH; case 4: break; // +/- max subnormal // sign = x, exp = 00...00, sig = 11...11 - case 5: sign = one; CVC4_FALLTHROUGH; + case 5: sign = one; CVC5_FALLTHROUGH; case 6: sig = BitVector::mkOnes(s - 1); break; // +/- min subnormal // sign = x, exp = 00...00, sig = 00...01 - case 7: sign = one; CVC4_FALLTHROUGH; + case 7: sign = one; CVC5_FALLTHROUGH; case 8: sig = BitVector(s - 1, static_cast(1)); break; // +/- max normal // sign = x, exp = 11...10, sig = 11...11 - case 9: sign = one; CVC4_FALLTHROUGH; + case 9: sign = one; CVC5_FALLTHROUGH; case 10: exp = BitVector::mkOnes(e) - BitVector(e, static_cast(1)); sig = BitVector::mkOnes(s - 1); @@ -104,7 +104,7 @@ FloatingPoint Sampler::pickFpBiased(unsigned e, unsigned s) // +/- min normal // sign = x, exp = 00...01, sig = 00...00 - case 11: sign = one; CVC4_FALLTHROUGH; + case 11: sign = one; CVC5_FALLTHROUGH; case 12: exp = BitVector(e, static_cast(1)); break; default: Unreachable(); diff --git a/src/util/statistics.cpp b/src/util/statistics.cpp index 494a70e6c..7053e9ea0 100644 --- a/src/util/statistics.cpp +++ b/src/util/statistics.cpp @@ -95,7 +95,7 @@ StatisticsBase::const_iterator StatisticsBase::end() const { } void StatisticsBase::flushInformation(std::ostream &out) const { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON for(StatSet::iterator i = d_stats.begin(); i != d_stats.end(); ++i) { @@ -104,11 +104,11 @@ void StatisticsBase::flushInformation(std::ostream &out) const { s->flushInformation(out); out << std::endl; } -#endif /* CVC4_STATISTICS_ON */ +#endif /* CVC5_STATISTICS_ON */ } void StatisticsBase::safeFlushInformation(int fd) const { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON for (StatSet::iterator i = d_stats.begin(); i != d_stats.end(); ++i) { Stat* s = *i; safe_print(fd, s->getName()); @@ -116,7 +116,7 @@ void StatisticsBase::safeFlushInformation(int fd) const { s->safeFlushInformation(fd); safe_print(fd, "\n"); } -#endif /* CVC4_STATISTICS_ON */ +#endif /* CVC5_STATISTICS_ON */ } SExpr StatisticsBase::getStatistic(std::string name) const { diff --git a/src/util/statistics_registry.cpp b/src/util/statistics_registry.cpp index f9e05e68f..094bf9709 100644 --- a/src/util/statistics_registry.cpp +++ b/src/util/statistics_registry.cpp @@ -24,10 +24,10 @@ #include "lib/clock_gettime.h" #include "util/ostream_util.h" -#ifdef CVC4_STATISTICS_ON -# define CVC4_USE_STATISTICS true +#ifdef CVC5_STATISTICS_ON +#define CVC5_USE_STATISTICS true #else -# define CVC4_USE_STATISTICS false +#define CVC5_USE_STATISTICS false #endif @@ -38,42 +38,42 @@ namespace cvc5 { void StatisticsRegistry::registerStat(Stat* s) { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON PrettyCheckArgument( d_stats.find(s) == d_stats.end(), s, "Statistic `%s' is already registered with this registry.", s->getName().c_str()); d_stats.insert(s); -#endif /* CVC4_STATISTICS_ON */ +#endif /* CVC5_STATISTICS_ON */ }/* StatisticsRegistry::registerStat_() */ void StatisticsRegistry::unregisterStat(Stat* s) { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON AlwaysAssert(s != nullptr); AlwaysAssert(d_stats.erase(s) > 0) << "Statistic `" << s->getName() << "' was not registered with this registry."; -#endif /* CVC4_STATISTICS_ON */ +#endif /* CVC5_STATISTICS_ON */ } /* StatisticsRegistry::unregisterStat() */ void StatisticsRegistry::flushStat(std::ostream &out) const { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON flushInformation(out); -#endif /* CVC4_STATISTICS_ON */ +#endif /* CVC5_STATISTICS_ON */ } void StatisticsRegistry::flushInformation(std::ostream &out) const { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON this->StatisticsBase::flushInformation(out); -#endif /* CVC4_STATISTICS_ON */ +#endif /* CVC5_STATISTICS_ON */ } void StatisticsRegistry::safeFlushInformation(int fd) const { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON this->StatisticsBase::safeFlushInformation(fd); -#endif /* CVC4_STATISTICS_ON */ +#endif /* CVC5_STATISTICS_ON */ } RegisterStatistic::RegisterStatistic(StatisticsRegistry* reg, Stat* stat) diff --git a/src/util/statistics_registry.h b/src/util/statistics_registry.h index cf47bdf2e..e0b0dc177 100644 --- a/src/util/statistics_registry.h +++ b/src/util/statistics_registry.h @@ -33,45 +33,45 @@ /** * On the design of the statistics: - * + * * Stat is the abstract base class for all statistic values. * It stores the name and provides (fully virtual) methods * flushInformation() and safeFlushInformation(). - * + * * BackedStat is an abstract templated base class for statistic values * that store the data themselves. It takes care of printing them already * and derived classes usually only need to provide methods to set the * value. - * - * ReferenceStat holds a reference (conceptually, it is implemented as a + * + * ReferenceStat holds a reference (conceptually, it is implemented as a * const pointer) to some data that is stored outside of the statistic. - * + * * IntStat is a BackedStat. - * + * * SizeStat holds a const reference to some container and provides the * size of this container. - * + * * AverageStat is a BackedStat. - * + * * HistogramStat counts instances of some type T. It is implemented as a * std::map. - * + * * IntegralHistogramStat is a (conceptual) specialization of HistogramStat - * for types that are (convertible to) integral. This allows to use a + * for types that are (convertible to) integral. This allows to use a * std::vector instead of a std::map. - * + * * TimerStat uses std::chrono to collect timing information. It is * implemented as BackedStat and provides methods * start() and stop(), accumulating times it was activated. It provides * the convenience class CodeTimer to allow for RAII-style usage. - * - * + * + * * All statistic classes should protect their custom methods using - * if (CVC4_USE_STATISTICS) { ... } + * if (CVC5_USE_STATISTICS) { ... } * Output methods (flushInformation() and safeFlushInformation()) are only * called when statistics are enabled and need no protection. - * - * + * + * * The statistic classes try to implement a consistent interface: * - if we store some generic data, we implement set() * - if we (conceptually) store a set of values, we implement operator<<() @@ -90,10 +90,10 @@ #include #include -#ifdef CVC4_STATISTICS_ON -# define CVC4_USE_STATISTICS true +#ifdef CVC5_STATISTICS_ON +#define CVC5_USE_STATISTICS true #else -# define CVC4_USE_STATISTICS false +#define CVC5_USE_STATISTICS false #endif #include "base/exception.h" diff --git a/src/util/stats_base.cpp b/src/util/stats_base.cpp index 3ae50cd51..5d34b43f2 100644 --- a/src/util/stats_base.cpp +++ b/src/util/stats_base.cpp @@ -22,7 +22,7 @@ namespace cvc5 { Stat::Stat(const std::string& name) : d_name(name) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { CheckArgument(d_name.find(", ") == std::string::npos, name, @@ -38,7 +38,7 @@ IntStat::IntStat(const std::string& name, int64_t init) /** Increment the underlying integer statistic. */ IntStat& IntStat::operator++() { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { ++d_data; } @@ -47,7 +47,7 @@ IntStat& IntStat::operator++() /** Increment the underlying integer statistic. */ IntStat& IntStat::operator++(int) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { ++d_data; } @@ -57,7 +57,7 @@ IntStat& IntStat::operator++(int) /** Increment the underlying integer statistic by the given amount. */ IntStat& IntStat::operator+=(int64_t val) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { d_data += val; } @@ -67,7 +67,7 @@ IntStat& IntStat::operator+=(int64_t val) /** Keep the maximum of the current statistic value and the given one. */ void IntStat::maxAssign(int64_t val) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { if (d_data < val) { @@ -79,7 +79,7 @@ void IntStat::maxAssign(int64_t val) /** Keep the minimum of the current statistic value and the given one. */ void IntStat::minAssign(int64_t val) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { if (d_data > val) { @@ -96,7 +96,7 @@ AverageStat::AverageStat(const std::string& name) /** Add an entry to the running-average calculation. */ AverageStat& AverageStat::operator<<(double e) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { ++d_count; d_sum += e; diff --git a/src/util/stats_base.h b/src/util/stats_base.h index 86a9321c0..9d168bad1 100644 --- a/src/util/stats_base.h +++ b/src/util/stats_base.h @@ -28,10 +28,10 @@ #include "util/sexpr.h" #include "util/stats_utils.h" -#ifdef CVC4_STATISTICS_ON -#define CVC4_USE_STATISTICS true +#ifdef CVC5_STATISTICS_ON +#define CVC5_USE_STATISTICS true #else -#define CVC4_USE_STATISTICS false +#define CVC5_USE_STATISTICS false #endif namespace cvc5 { @@ -103,7 +103,7 @@ class BackedStat : public Stat /** Set the underlying data value to the given value. */ void set(const T& t) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { d_data = t; } @@ -164,7 +164,7 @@ class ReferenceStat : public Stat /** Set this reference statistic to refer to the given data cell. */ void set(const T& t) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { d_data = &t; } diff --git a/src/util/stats_histogram.h b/src/util/stats_histogram.h index ba2135b58..e9968dd34 100644 --- a/src/util/stats_histogram.h +++ b/src/util/stats_histogram.h @@ -97,7 +97,7 @@ class IntegralHistogramStat : public Stat IntegralHistogramStat& operator<<(Integral val) { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { int64_t v = static_cast(val); if (d_hist.empty()) diff --git a/src/util/stats_timer.cpp b/src/util/stats_timer.cpp index fa513b0b4..eedb30b4c 100644 --- a/src/util/stats_timer.cpp +++ b/src/util/stats_timer.cpp @@ -33,7 +33,7 @@ void safe_print(int fd, const timer_stat_detail::duration& t) void TimerStat::start() { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { PrettyCheckArgument(!d_running, *this, "timer already running"); d_start = timer_stat_detail::clock::now(); @@ -43,7 +43,7 @@ void TimerStat::start() void TimerStat::stop() { - if (CVC4_USE_STATISTICS) + if (CVC5_USE_STATISTICS) { AlwaysAssert(d_running) << "timer not running"; d_data += timer_stat_detail::clock::now() - d_start; @@ -56,7 +56,7 @@ bool TimerStat::running() const { return d_running; } timer_stat_detail::duration TimerStat::get() const { auto data = d_data; - if (CVC4_USE_STATISTICS && d_running) + if (CVC5_USE_STATISTICS && d_running) { data += timer_stat_detail::clock::now() - d_start; } @@ -66,7 +66,7 @@ timer_stat_detail::duration TimerStat::get() const SExpr TimerStat::getValue() const { auto data = d_data; - if (CVC4_USE_STATISTICS && d_running) + if (CVC5_USE_STATISTICS && d_running) { data += timer_stat_detail::clock::now() - d_start; } diff --git a/src/util/string.cpp b/src/util/string.cpp index ec13956f4..b6f93aa0f 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -31,7 +31,7 @@ static_assert(UCHAR_MAX == 255, "Unsigned char is assumed to have 256 values."); String::String(const std::vector &s) : d_str(s) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (unsigned u : d_str) { Assert(u < num_codes()); @@ -226,7 +226,7 @@ std::vector String::toInternal(const std::string& s, str.insert(str.end(), nonEscCache.begin(), nonEscCache.end()); } } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS for (unsigned u : str) { Assert(u < num_codes()); diff --git a/src/util/utility.cpp b/src/util/utility.cpp index b07f046bf..cde74c6eb 100644 --- a/src/util/utility.cpp +++ b/src/util/utility.cpp @@ -43,7 +43,7 @@ std::unique_ptr openTmpFile(std::string* pattern) int r = mkstemp(tmpName); if (r == -1) { - CVC4_FATAL() << "Could not create temporary file " << *pattern; + CVC5_FATAL() << "Could not create temporary file " << *pattern; } std::unique_ptr tmpStream(new std::fstream(tmpName)); close(r); diff --git a/test/api/CMakeLists.txt b/test/api/CMakeLists.txt index 18c366a45..7df1342c3 100644 --- a/test/api/CMakeLists.txt +++ b/test/api/CMakeLists.txt @@ -24,14 +24,14 @@ add_custom_target(apitests COMMAND ctest --output-on-failure -L "api" -j${CTEST_NTHREADS} $$ARGS DEPENDS build-apitests) -set(CVC4_API_TEST_FLAGS - -D__BUILDING_CVC4_API_TEST -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS) +set(CVC5_API_TEST_FLAGS + -D__BUILDING_CVC5_API_TEST -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS) macro(cvc4_add_api_test name) set(test_bin_dir ${CMAKE_BINARY_DIR}/bin/test/api/) add_executable(${name} ${name}.cpp) target_link_libraries(${name} PUBLIC main-test) - target_compile_definitions(${name} PRIVATE ${CVC4_API_TEST_FLAGS}) + target_compile_definitions(${name} PRIVATE ${CVC5_API_TEST_FLAGS}) if(USE_CLN) target_link_libraries(${name} PRIVATE CLN) endif() diff --git a/test/api/issue4889.cpp b/test/api/issue4889.cpp index ed2340c18..8fef1cfca 100644 --- a/test/api/issue4889.cpp +++ b/test/api/issue4889.cpp @@ -18,7 +18,7 @@ using namespace cvc5::api; int main() { -#ifdef CVC4_USE_SYMFPU +#ifdef CVC5_USE_SYMFPU Solver slv; Sort sort_int = slv.getIntegerSort(); Sort sort_array = slv.mkArraySort(sort_int, sort_int); diff --git a/test/regress/run_regression.py b/test/regress/run_regression.py index ad46eec88..c212a3990 100755 --- a/test/regress/run_regression.py +++ b/test/regress/run_regression.py @@ -268,9 +268,9 @@ def run_regression(check_unsat_cores, check_proofs, dump, use_skip_return_code, if expected_exit_status is None: expected_exit_status = 0 - if 'CVC4_REGRESSION_ARGS' in os.environ: + if 'CVC5_REGRESSION_ARGS' in os.environ: basic_command_line_args += shlex.split( - os.environ['CVC4_REGRESSION_ARGS']) + os.environ['CVC5_REGRESSION_ARGS']) if not check_unsat_cores and ('(get-unsat-core)' in benchmark_content or '(get-unsat-assumptions)' in benchmark_content): diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 0be0b80e1..93ca679f3 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -27,7 +27,7 @@ add_custom_target(units COMMAND ctest --output-on-failure -L "unit" -j${CTEST_NTHREADS} $$ARGS DEPENDS build-units) -set(CVC4_UNIT_TEST_FLAGS_BLACK +set(CVC5_UNIT_TEST_FLAGS_BLACK -D__BUILDING_CVC4LIB_UNIT_TEST -D__BUILDING_CVC4PARSERLIB_UNIT_TEST -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS) @@ -35,7 +35,7 @@ set(CVC4_UNIT_TEST_FLAGS_BLACK macro(cvc4_add_unit_test is_white name output_dir) set(test_src ${CMAKE_CURRENT_LIST_DIR}/${name}.cpp) add_executable(${name} ${test_src}) - target_compile_definitions(${name} PRIVATE ${CVC4_UNIT_TEST_FLAGS_BLACK}) + target_compile_definitions(${name} PRIVATE ${CVC5_UNIT_TEST_FLAGS_BLACK}) gtest_add_tests(TARGET ${name}) target_link_libraries(${name} PUBLIC main-test) target_link_libraries(${name} PUBLIC GTest::Main) diff --git a/test/unit/context/cdlist_black.cpp b/test/unit/context/cdlist_black.cpp index a3241d058..c944b0722 100644 --- a/test/unit/context/cdlist_black.cpp +++ b/test/unit/context/cdlist_black.cpp @@ -138,7 +138,7 @@ TEST_F(TestContextBlackCDList, empty_iterator) TEST_F(TestContextBlackCDList, out_of_memory) { -#ifndef CVC4_MEMORY_LIMITING_DISABLED +#ifndef CVC5_MEMORY_LIMITING_DISABLED CDList list(d_context.get()); test::WithLimitedMemory wlm(1); diff --git a/test/unit/context/context_black.cpp b/test/unit/context/context_black.cpp index 0ad830162..ee5140da3 100644 --- a/test/unit/context/context_black.cpp +++ b/test/unit/context/context_black.cpp @@ -91,10 +91,10 @@ TEST_F(TestContextBlack, push_pop) // the interface doesn't declare any exceptions d_context->push(); d_context->pop(); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(d_context->pop(), "Cannot pop below level 0"); ASSERT_DEATH(d_context->pop(), "Cannot pop below level 0"); -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ } TEST_F(TestContextBlack, dtor) diff --git a/test/unit/context/context_mm_black.cpp b/test/unit/context/context_mm_black.cpp index 0f031ef5b..22b15d70d 100644 --- a/test/unit/context/context_mm_black.cpp +++ b/test/unit/context/context_mm_black.cpp @@ -36,7 +36,7 @@ class TestContextBlackMM : public TestInternal TEST_F(TestContextBlackMM, push_pop) { -#ifdef CVC4_DEBUG_CONTEXT_MEMORY_MANAGER +#ifdef CVC5_DEBUG_CONTEXT_MEMORY_MANAGER #warning "Using the debug context memory manager, omitting unit tests" #else // Push, then allocate, then pop diff --git a/test/unit/memory.h b/test/unit/memory.h index 726404e5e..45c65c202 100644 --- a/test/unit/memory.h +++ b/test/unit/memory.h @@ -20,7 +20,7 @@ ** ** The WithLimitedMemory destructor will re-establish the previous limit. ** - ** This class does not exist in CVC4_MEMORY_LIMITING_DISABLED is defined. + ** This class does not exist in CVC5_MEMORY_LIMITING_DISABLED is defined. ** This can be disabled for a variety of reasons. ** If this is disabled, there will be a function: ** void WarnWithLimitedMemoryDisabledReason() @@ -39,24 +39,24 @@ #include "base/check.h" #include "base/configuration_private.h" -// Conditionally define CVC4_MEMORY_LIMITING_DISABLED. +// Conditionally define CVC5_MEMORY_LIMITING_DISABLED. #ifdef __APPLE__ -# define CVC4_MEMORY_LIMITING_DISABLED 1 -# define CVC4_MEMORY_LIMITING_DISABLED_REASON "setrlimit() is broken on Mac." +#define CVC5_MEMORY_LIMITING_DISABLED 1 +#define CVC5_MEMORY_LIMITING_DISABLED_REASON "setrlimit() is broken on Mac." #else /* __APPLE__ */ // Tests cannot expect bad_alloc to be thrown due to limit memory using // setrlimit when ASAN is enable. ASAN instead aborts on mmap failures. # if IS_ASAN_BUILD -# define CVC4_MEMORY_LIMITING_DISABLED 1 -# define CVC4_MEMORY_LIMITING_DISABLED_REASON "ASAN's mmap failures abort." +#define CVC5_MEMORY_LIMITING_DISABLED 1 +#define CVC5_MEMORY_LIMITING_DISABLED_REASON "ASAN's mmap failures abort." # endif #endif namespace cvc5 { namespace test { -#ifndef CVC4_MEMORY_LIMITING_DISABLED +#ifndef CVC5_MEMORY_LIMITING_DISABLED class WithLimitedMemory { public: WithLimitedMemory() { remember(); } @@ -89,9 +89,9 @@ class WithLimitedMemory { } // namespace test } // namespace cvc5 -// Remove CVC4_MEMORY_LIMITING_DISABLED_REASON if it is defined. -#ifdef CVC4_MEMORY_LIMITING_DISABLED_REASON -#undef CVC4_MEMORY_LIMITING_DISABLED_REASON -#endif /* CVC4_MEMORY_LIMITING_DISABLED_REASON */ +// Remove CVC5_MEMORY_LIMITING_DISABLED_REASON if it is defined. +#ifdef CVC5_MEMORY_LIMITING_DISABLED_REASON +#undef CVC5_MEMORY_LIMITING_DISABLED_REASON +#endif /* CVC5_MEMORY_LIMITING_DISABLED_REASON */ #endif /* __CVC5__TEST__MEMORY_H */ diff --git a/test/unit/node/kind_map_black.cpp b/test/unit/node/kind_map_black.cpp index 7da3e5715..428da7206 100644 --- a/test/unit/node/kind_map_black.cpp +++ b/test/unit/node/kind_map_black.cpp @@ -39,7 +39,7 @@ TEST_F(TestNodeBlackKindMap, simple) ASSERT_TRUE(map.test(AND)); map.reset(AND); ASSERT_FALSE(map.test(AND)); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_THROW(map.set(LAST_KIND), AssertArgumentException); #endif } diff --git a/test/unit/node/node_black.cpp b/test/unit/node/node_black.cpp index cfe008ec0..b63541d6c 100644 --- a/test/unit/node/node_black.cpp +++ b/test/unit/node/node_black.cpp @@ -186,7 +186,7 @@ TEST_F(TestNodeBlackNode, operator_not_equals) /* operator[] */ TEST_F(TestNodeBlackNode, operator_square) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS // Basic bounds check on a node w/out children ASSERT_DEATH(Node::null()[-1], "i >= 0 && unsigned\\(i\\) < d_nchildren"); ASSERT_DEATH(Node::null()[0], "i >= 0 && unsigned\\(i\\) < d_nchildren"); @@ -205,7 +205,7 @@ TEST_F(TestNodeBlackNode, operator_square) ASSERT_EQ(tb, ite[1]); ASSERT_EQ(eb, ite[2]); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS // Bounds check on a node with children ASSERT_DEATH(ite == ite[-1], "i >= 0 && unsigned\\(i\\) < d_nchildren"); ASSERT_DEATH(ite == ite[4], "i >= 0 && unsigned\\(i\\) < d_nchildren"); @@ -422,7 +422,7 @@ TEST_F(TestNodeBlackNode, getOperator) ASSERT_EQ(a.getNumChildren(), 0); ASSERT_EQ(f, fa.getOperator()); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(f.getOperator(), "mk == kind::metakind::PARAMETERIZED"); ASSERT_DEATH(a.getOperator(), "mk == kind::metakind::PARAMETERIZED"); #endif @@ -443,7 +443,7 @@ TEST_F(TestNodeBlackNode, getNumChildren) testNaryExpForSize(AND, n); } -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(testNaryExpForSize(AND, 0), "getNumChildren\\(\\) >= " "kind::metakind::getMinArityForKind\\(getKind\\(\\)\\)"); @@ -456,7 +456,7 @@ TEST_F(TestNodeBlackNode, getNumChildren) ASSERT_DEATH(testNaryExpForSize(NOT, 2), "getNumChildren\\(\\) <= " "kind::metakind::getMaxArityForKind\\(getKind\\(\\)\\)"); -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ } TEST_F(TestNodeBlackNode, iterator) diff --git a/test/unit/node/node_builder_black.cpp b/test/unit/node/node_builder_black.cpp index 2b8ef7a04..fbf2b9108 100644 --- a/test/unit/node/node_builder_black.cpp +++ b/test/unit/node/node_builder_black.cpp @@ -55,7 +55,7 @@ TEST_F(TestNodeBlackNodeBuilder, ctors) /* Default size tests. */ NodeBuilder def; ASSERT_EQ(def.getKind(), UNDEFINED_KIND); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(def.getNumChildren(), "getKind\\(\\) != kind::UNDEFINED_KIND"); #endif @@ -65,7 +65,7 @@ TEST_F(TestNodeBlackNodeBuilder, ctors) NodeBuilder from_nm(d_nodeManager.get()); ASSERT_EQ(from_nm.getKind(), UNDEFINED_KIND); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(from_nm.getNumChildren(), "getKind\\(\\) != kind::UNDEFINED_KIND"); #endif @@ -77,7 +77,7 @@ TEST_F(TestNodeBlackNodeBuilder, ctors) /* Copy constructors */ NodeBuilder copy(def); ASSERT_EQ(copy.getKind(), UNDEFINED_KIND); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(copy.getNumChildren(), "getKind\\(\\) != kind::UNDEFINED_KIND"); #endif } @@ -100,7 +100,7 @@ TEST_F(TestNodeBlackNodeBuilder, getKind) ASSERT_EQ(noKind.getKind(), PLUS); Node n = noKind; -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(noKind.getKind(), "!isUsed\\(\\)"); #endif @@ -115,7 +115,7 @@ TEST_F(TestNodeBlackNodeBuilder, getNumChildren) Node x(d_skolemManager->mkDummySkolem("x", *d_intTypeNode)); NodeBuilder nb; -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb.getNumChildren(), "getKind\\(\\) != kind::UNDEFINED_KIND"); #endif @@ -126,7 +126,7 @@ TEST_F(TestNodeBlackNodeBuilder, getNumChildren) ASSERT_EQ(nb.getNumChildren(), 4u); nb.clear(); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb.getNumChildren(), "getKind\\(\\) != kind::UNDEFINED_KIND"); #endif @@ -139,7 +139,7 @@ TEST_F(TestNodeBlackNodeBuilder, getNumChildren) nb << x << x << x; ASSERT_EQ(nb.getNumChildren(), 6u); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb << PLUS, "getKind\\(\\) == kind::UNDEFINED_KIND"); Node n = nb; ASSERT_DEATH(nb.getNumChildren(), "!isUsed\\(\\)"); @@ -154,7 +154,7 @@ TEST_F(TestNodeBlackNodeBuilder, operator_square) Node i_2 = d_nodeManager->mkConst(true); Node i_K = d_nodeManager->mkNode(NOT, i_0); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(arr[-1], "index out of range"); ASSERT_DEATH(arr[0], "index out of range"); #endif @@ -184,7 +184,7 @@ TEST_F(TestNodeBlackNodeBuilder, operator_square) } ASSERT_EQ(arr[K], i_K); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS Node n = arr; ASSERT_DEATH(arr[0], "!isUsed\\(\\)"); #endif @@ -194,7 +194,7 @@ TEST_F(TestNodeBlackNodeBuilder, clear) { NodeBuilder nb; ASSERT_EQ(nb.getKind(), UNDEFINED_KIND); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb.getNumChildren(), "getKind\\(\\) != kind::UNDEFINED_KIND"); #endif @@ -205,7 +205,7 @@ TEST_F(TestNodeBlackNodeBuilder, clear) nb.clear(); ASSERT_EQ(nb.getKind(), UNDEFINED_KIND); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb.getNumChildren(), "getKind\\(\\) != kind::UNDEFINED_KIND"); #endif @@ -221,14 +221,14 @@ TEST_F(TestNodeBlackNodeBuilder, clear) push_back(nb, K); nb.clear(); ASSERT_EQ(nb.getKind(), UNDEFINED_KIND); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb.getNumChildren(), "getKind\\(\\) != kind::UNDEFINED_KIND"); #endif } TEST_F(TestNodeBlackNodeBuilder, operator_stream_insertion_kind) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS NodeBuilder spec(d_specKind); ASSERT_DEATH(spec << PLUS, "can't redefine the Kind of a NodeBuilder"); #endif @@ -246,20 +246,20 @@ TEST_F(TestNodeBlackNodeBuilder, operator_stream_insertion_kind) nb << d_nodeManager->mkConst(true) << d_nodeManager->mkConst(false); nb.clear(PLUS); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS Node n; ASSERT_DEATH(n = nb, "Nodes with kind PLUS must have at least 2 children"); nb.clear(PLUS); #endif -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb << PLUS, "can't redefine the Kind of a NodeBuilder"); #endif NodeBuilder testRef; ASSERT_EQ((testRef << d_specKind).getKind(), d_specKind); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS NodeBuilder testTwo; ASSERT_DEATH(testTwo << d_specKind << PLUS, "can't redefine the Kind of a NodeBuilder"); @@ -284,7 +284,7 @@ TEST_F(TestNodeBlackNodeBuilder, operator_stream_insertion_node) ASSERT_EQ(nb.getKind(), d_specKind); ASSERT_EQ(nb.getNumChildren(), K); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS Node n = nb; ASSERT_DEATH(nb << n, "!isUsed\\(\\)"); #endif @@ -317,7 +317,7 @@ TEST_F(TestNodeBlackNodeBuilder, append) d_nodeManager->mkNode(PLUS, r, d_nodeManager->mkNode(UMINUS, s), t)); Node q = d_nodeManager->mkNode(AND, x, z, d_nodeManager->mkNode(NOT, y)); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(d_nodeManager->mkNode(XOR, y, x, x), "Nodes with kind XOR must have at most 2 children"); #endif @@ -380,7 +380,7 @@ TEST_F(TestNodeBlackNodeBuilder, operator_node_cast) ASSERT_EQ(nexplicit.getKind(), d_specKind); ASSERT_EQ(nexplicit.getNumChildren(), K); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(Node blah = implicit, "!isUsed\\(\\)"); #endif } diff --git a/test/unit/node/node_manager_black.cpp b/test/unit/node/node_manager_black.cpp index 6ad6f583c..a2d25c8d8 100644 --- a/test/unit/node/node_manager_black.cpp +++ b/test/unit/node/node_manager_black.cpp @@ -302,7 +302,7 @@ TEST_F(TestNodeBlackNodeManager, mkPredicateType) /* This test is only valid if assertions are enabled. */ TEST_F(TestNodeBlackNodeManager, mkNode_too_few_children) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS Node x = d_skolemManager->mkDummySkolem("x", d_nodeManager->booleanType()); ASSERT_DEATH(d_nodeManager->mkNode(AND, x), "Nodes with kind AND must have at least 2 children"); @@ -312,7 +312,7 @@ TEST_F(TestNodeBlackNodeManager, mkNode_too_few_children) /* This test is only valid if assertions are enabled. */ TEST_F(TestNodeBlackNodeManager, mkNode_too_many_children) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS std::vector vars; const uint32_t max = metakind::getMaxArityForKind(AND); TypeNode boolType = d_nodeManager->booleanType(); diff --git a/test/unit/node/node_manager_white.cpp b/test/unit/node/node_manager_white.cpp index a13e76d03..986eac870 100644 --- a/test/unit/node/node_manager_white.cpp +++ b/test/unit/node/node_manager_white.cpp @@ -46,9 +46,9 @@ TEST_F(TestNodeWhiteNodeManager, oversized_node_builder) ASSERT_NO_THROW(nb.realloc(15)); ASSERT_NO_THROW(nb.realloc(25)); ASSERT_NO_THROW(nb.realloc(256)); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb.realloc(100), "toSize > d_nvMaxChildren"); -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ ASSERT_NO_THROW(nb.realloc(257)); ASSERT_NO_THROW(nb.realloc(4000)); ASSERT_NO_THROW(nb.realloc(20000)); @@ -56,9 +56,9 @@ TEST_F(TestNodeWhiteNodeManager, oversized_node_builder) ASSERT_NO_THROW(nb.realloc(65535)); ASSERT_NO_THROW(nb.realloc(65536)); ASSERT_NO_THROW(nb.realloc(67108863)); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(nb.realloc(67108863), "toSize > d_nvMaxChildren"); -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ } TEST_F(TestNodeWhiteNodeManager, topological_sort) diff --git a/test/unit/parser/parser_black.cpp b/test/unit/parser/parser_black.cpp index 5b695030e..27d008228 100644 --- a/test/unit/parser/parser_black.cpp +++ b/test/unit/parser/parser_black.cpp @@ -238,7 +238,7 @@ TEST_F(TestParserBlackCvCParser, good_inputs) TEST_F(TestParserBlackCvCParser, bad_inputs) { // competition builds don't do any checking -#ifndef CVC4_COMPETITION_MODE +#ifndef CVC5_COMPETITION_MODE tryBadInput("ASSERT;"); // no args tryBadInput("QUERY"); tryBadInput("CHECKSAT"); @@ -278,7 +278,7 @@ TEST_F(TestParserBlackCvCParser, good_exprs) TEST_F(TestParserBlackCvCParser, bad_exprs) { // competition builds don't do any checking -#ifndef CVC4_COMPETITION_MODE +#ifndef CVC5_COMPETITION_MODE tryBadInput("a AND"); // wrong arity tryBadInput("AND(a,b)"); // not infix tryBadInput("(OR (AND a b) c)"); // not infix @@ -326,7 +326,7 @@ TEST_F(TestParserBlackSmt2Parser, good_inputs) TEST_F(TestParserBlackSmt2Parser, bad_inputs) { // competition builds don't do any checking -#ifndef CVC4_COMPETITION_MODE +#ifndef CVC5_COMPETITION_MODE // no arguments tryBadInput("(assert)"); // illegal character in symbol @@ -366,7 +366,7 @@ TEST_F(TestParserBlackSmt2Parser, good_exprs) TEST_F(TestParserBlackSmt2Parser, bad_exprs) { // competition builds don't do any checking -#ifndef CVC4_COMPETITION_MODE +#ifndef CVC5_COMPETITION_MODE tryBadExpr("(and)"); // wrong arity tryBadExpr("(and a b"); // no closing paren tryBadExpr("(a and b)"); // infix diff --git a/test/unit/util/CMakeLists.txt b/test/unit/util/CMakeLists.txt index b898e1344..fc5484a1f 100644 --- a/test/unit/util/CMakeLists.txt +++ b/test/unit/util/CMakeLists.txt @@ -21,7 +21,7 @@ cvc4_add_unit_test_white(check_white util) cvc4_add_unit_test_black(configuration_black util) cvc4_add_unit_test_black(datatype_black util) cvc4_add_unit_test_black(exception_black util) -if(CVC4_USE_SYMFPU) +if(CVC5_USE_SYMFPU) cvc4_add_unit_test_black(floatingpoint_black util) endif() cvc4_add_unit_test_black(integer_black util) @@ -29,7 +29,7 @@ cvc4_add_unit_test_white(integer_white util) cvc4_add_unit_test_black(output_black util) cvc4_add_unit_test_black(rational_black util) cvc4_add_unit_test_white(rational_white util) -if(CVC4_USE_POLY_IMP) +if(CVC5_USE_POLY_IMP) cvc4_add_unit_test_black(real_algebraic_number_black util) endif() cvc4_add_unit_test_black(stats_black util) diff --git a/test/unit/util/assert_white.cpp b/test/unit/util/assert_white.cpp index bab612b62..245ef8aaa 100644 --- a/test/unit/util/assert_white.cpp +++ b/test/unit/util/assert_white.cpp @@ -29,7 +29,7 @@ class TestUtilWhite : public TestInternal TEST_F(TestUtilWhite, Assert) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(Assert(false), "false"); #else ASSERT_NO_THROW(Assert(false)); @@ -41,7 +41,7 @@ TEST_F(TestUtilWhite, Assert) TEST_F(TestUtilWhite, AssertArgument) { -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_THROW(AssertArgument(false, "x"), AssertArgumentException); #else ASSERT_NO_THROW(AssertArgument(false, "x")); diff --git a/test/unit/util/binary_heap_black.cpp b/test/unit/util/binary_heap_black.cpp index c00aeaeb2..76462b687 100644 --- a/test/unit/util/binary_heap_black.cpp +++ b/test/unit/util/binary_heap_black.cpp @@ -60,7 +60,7 @@ TEST_F(TestUtilBlackBinaryHeap, heap_series) // First test a heap of 1 element ASSERT_EQ(heap.size(), 0u); ASSERT_TRUE(heap.empty()); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(heap.top(), "!empty\\(\\)"); ASSERT_DEATH(heap.pop(), "!empty\\(\\)"); #endif @@ -77,7 +77,7 @@ TEST_F(TestUtilBlackBinaryHeap, heap_series) ASSERT_NO_THROW(heap.erase(h5)); ASSERT_TRUE(heap.empty()); ASSERT_EQ(heap.size(), 0u); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(heap.top(), "!empty\\(\\)"); ASSERT_DEATH(heap.pop(), "!empty\\(\\)"); #endif @@ -135,7 +135,7 @@ TEST_F(TestUtilBlackBinaryHeap, heap_series) ASSERT_TRUE(heap.begin() == heap.end()); ASSERT_TRUE(heap.empty()); ASSERT_EQ(heap.size(), 0u); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS ASSERT_DEATH(heap.top(), "!empty\\(\\)"); ASSERT_DEATH(heap.pop(), "!empty\\(\\)"); #endif diff --git a/test/unit/util/boolean_simplification_black.cpp b/test/unit/util/boolean_simplification_black.cpp index 2e266ce58..1ec9c923c 100644 --- a/test/unit/util/boolean_simplification_black.cpp +++ b/test/unit/util/boolean_simplification_black.cpp @@ -124,7 +124,7 @@ TEST_F(TestUtilBlackBooleanSimplification, negate) out = d_fa.andNode(d_ac).notNode(); test_nodes_equal(out, BooleanSimplification::negate(in)); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS in = Node(); ASSERT_THROW(BooleanSimplification::negate(in), AssertArgumentException); #endif @@ -166,7 +166,7 @@ TEST_F(TestUtilBlackBooleanSimplification, simplifyClause) << d_hfc << d_ac << d_d.andNode(d_b); test_nodes_equal(out, BooleanSimplification::simplifyClause(in)); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS in = d_nodeManager->mkNode(kind::AND, d_a, d_b); ASSERT_THROW(BooleanSimplification::simplifyClause(in), AssertArgumentException); @@ -212,7 +212,7 @@ TEST_F(TestUtilBlackBooleanSimplification, simplifyHornClause) << d_hfc << d_ac << d_d.notNode(); test_nodes_equal(out, BooleanSimplification::simplifyHornClause(in)); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS in = d_nodeManager->mkNode(kind::OR, d_a, d_b); ASSERT_THROW(BooleanSimplification::simplifyHornClause(in), AssertArgumentException); @@ -241,7 +241,7 @@ TEST_F(TestUtilBlackBooleanSimplification, simplifyConflict) << d_hfc.orNode(d_ac) << d_d << d_b; test_nodes_equal(out, BooleanSimplification::simplifyConflict(in)); -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS in = d_nodeManager->mkNode(kind::OR, d_a, d_b); ASSERT_THROW(BooleanSimplification::simplifyConflict(in), AssertArgumentException); diff --git a/test/unit/util/check_white.cpp b/test/unit/util/check_white.cpp index 4909e3a58..d517e4364 100644 --- a/test/unit/util/check_white.cpp +++ b/test/unit/util/check_white.cpp @@ -31,7 +31,7 @@ class TestUtilWhiteCheck : public TestInternal // This test just checks that this statement compiles. std::string terminalCvc4Fatal() const { - CVC4_FATAL() << "This is a test that confirms that CVC4_FATAL can be a " + CVC5_FATAL() << "This is a test that confirms that CVC5_FATAL can be a " "terminal statement in a function that has a non-void " "return type."; } @@ -45,8 +45,8 @@ TEST_F(TestUtilWhiteCheck, check) TEST_F(TestUtilWhiteCheck, dcheck) { Assert(K_ONE == 1) << "always passes"; -#ifndef CVC4_ASSERTIONS - Assert(false) << "Will not be compiled in when CVC4_ASSERTIONS off."; +#ifndef CVC5_ASSERTIONS + Assert(false) << "Will not be compiled in when CVC5_ASSERTIONS off."; #endif } diff --git a/test/unit/util/configuration_black.cpp b/test/unit/util/configuration_black.cpp index 35bfd4d78..508aa179b 100644 --- a/test/unit/util/configuration_black.cpp +++ b/test/unit/util/configuration_black.cpp @@ -27,46 +27,46 @@ class TestUtilBlackConfiguration : public TestInternal TEST_F(TestUtilBlackConfiguration, static_flags) { const bool debug = -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG true; -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ false; -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ const bool tracing = -#ifdef CVC4_TRACING +#ifdef CVC5_TRACING true; -#else /* CVC4_TRACING */ +#else /* CVC5_TRACING */ false; -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ const bool muzzled = -#ifdef CVC4_MUZZLE +#ifdef CVC5_MUZZLE true; -#else /* CVC4_MUZZLE */ +#else /* CVC5_MUZZLE */ false; -#endif /* CVC4_MUZZLE */ +#endif /* CVC5_MUZZLE */ const bool assertions = -#ifdef CVC4_ASSERTIONS +#ifdef CVC5_ASSERTIONS true; -#else /* CVC4_ASSERTIONS */ +#else /* CVC5_ASSERTIONS */ false; -#endif /* CVC4_ASSERTIONS */ +#endif /* CVC5_ASSERTIONS */ const bool coverage = -#ifdef CVC4_COVERAGE +#ifdef CVC5_COVERAGE true; -#else /* CVC4_COVERAGE */ +#else /* CVC5_COVERAGE */ false; -#endif /* CVC4_COVERAGE */ +#endif /* CVC5_COVERAGE */ const bool profiling = -#ifdef CVC4_PROFILING +#ifdef CVC5_PROFILING true; -#else /* CVC4_PROFILING */ +#else /* CVC5_PROFILING */ false; -#endif /* CVC4_PROFILING */ +#endif /* CVC5_PROFILING */ ASSERT_EQ(Configuration::isDebugBuild(), debug); ASSERT_EQ(Configuration::isTracingBuild(), tracing); diff --git a/test/unit/util/output_black.cpp b/test/unit/util/output_black.cpp index e951dd114..09991a6d0 100644 --- a/test/unit/util/output_black.cpp +++ b/test/unit/util/output_black.cpp @@ -82,7 +82,7 @@ TEST_F(TestUtilBlackOutput, output) Trace.on("foo"); Trace("foo") << "tracing3"; -#ifdef CVC4_MUZZLE +#ifdef CVC5_MUZZLE ASSERT_EQ(d_debugStream.str(), ""); ASSERT_EQ(d_messageStream.str(), ""); @@ -91,32 +91,32 @@ TEST_F(TestUtilBlackOutput, output) ASSERT_EQ(d_noticeStream.str(), ""); ASSERT_EQ(d_traceStream.str(), ""); -#else /* CVC4_MUZZLE */ +#else /* CVC5_MUZZLE */ -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG ASSERT_EQ(d_debugStream.str(), "testing1testing3"); -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ ASSERT_EQ(d_debugStream.str(), ""); -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ ASSERT_EQ(d_messageStream.str(), "a message"); ASSERT_EQ(d_warningStream.str(), "bad warning!"); ASSERT_EQ(d_chatStream.str(), "chatty"); ASSERT_EQ(d_noticeStream.str(), "note"); -#ifdef CVC4_TRACING +#ifdef CVC5_TRACING ASSERT_EQ(d_traceStream.str(), "tracing1tracing3"); -#else /* CVC4_TRACING */ +#else /* CVC5_TRACING */ ASSERT_EQ(d_traceStream.str(), ""); -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ -#endif /* CVC4_MUZZLE */ +#endif /* CVC5_MUZZLE */ } TEST_F(TestUtilBlackOutput, evaluation_off_when_it_is_supposed_to_be) { Debug.on("foo"); -#ifndef CVC4_DEBUG +#ifndef CVC5_DEBUG ASSERT_FALSE(Debug.isOn("foo")); Debug("foo") << failure() << std::endl; #else @@ -125,7 +125,7 @@ TEST_F(TestUtilBlackOutput, evaluation_off_when_it_is_supposed_to_be) Debug.off("foo"); Trace.on("foo"); -#ifndef CVC4_TRACING +#ifndef CVC5_TRACING ASSERT_FALSE(Trace.isOn("foo")); Trace("foo") << failure() << std::endl; #else @@ -133,7 +133,7 @@ TEST_F(TestUtilBlackOutput, evaluation_off_when_it_is_supposed_to_be) #endif Trace.off("foo"); -#ifdef CVC4_MUZZLE +#ifdef CVC5_MUZZLE ASSERT_FALSE(Debug.isOn("foo")); ASSERT_FALSE(Trace.isOn("foo")); ASSERT_FALSE(Warning.isOn()); @@ -158,7 +158,7 @@ TEST_F(TestUtilBlackOutput, evaluation_off_when_it_is_supposed_to_be) TEST_F(TestUtilBlackOutput, simple_print) { -#ifdef CVC4_MUZZLE +#ifdef CVC5_MUZZLE Debug.off("yo"); Debug("yo") << "foobar"; @@ -194,7 +194,7 @@ TEST_F(TestUtilBlackOutput, simple_print) ASSERT_EQ(d_noticeStream.str(), std::string()); d_noticeStream.str(""); -#else /* CVC4_MUZZLE */ +#else /* CVC5_MUZZLE */ Debug.off("yo"); Debug("yo") << "foobar"; @@ -202,11 +202,11 @@ TEST_F(TestUtilBlackOutput, simple_print) d_debugStream.str(""); Debug.on("yo"); Debug("yo") << "baz foo"; -#ifdef CVC4_DEBUG +#ifdef CVC5_DEBUG ASSERT_EQ(d_debugStream.str(), std::string("baz foo")); -#else /* CVC4_DEBUG */ +#else /* CVC5_DEBUG */ ASSERT_EQ(d_debugStream.str(), std::string()); -#endif /* CVC4_DEBUG */ +#endif /* CVC5_DEBUG */ d_debugStream.str(""); Trace.off("yo"); @@ -215,11 +215,11 @@ TEST_F(TestUtilBlackOutput, simple_print) d_traceStream.str(""); Trace.on("yo"); Trace("yo") << "baz foo"; -#ifdef CVC4_TRACING +#ifdef CVC5_TRACING ASSERT_EQ(d_traceStream.str(), std::string("baz foo")); -#else /* CVC4_TRACING */ +#else /* CVC5_TRACING */ ASSERT_EQ(d_traceStream.str(), std::string()); -#endif /* CVC4_TRACING */ +#endif /* CVC5_TRACING */ d_traceStream.str(""); Warning() << "baz foo"; @@ -238,7 +238,7 @@ TEST_F(TestUtilBlackOutput, simple_print) ASSERT_EQ(d_noticeStream.str(), std::string("baz foo")); d_noticeStream.str(""); -#endif /* CVC4_MUZZLE */ +#endif /* CVC5_MUZZLE */ } } // namespace test } // namespace cvc5 diff --git a/test/unit/util/real_algebraic_number_black.cpp b/test/unit/util/real_algebraic_number_black.cpp index 507be5ea0..c130023ca 100644 --- a/test/unit/util/real_algebraic_number_black.cpp +++ b/test/unit/util/real_algebraic_number_black.cpp @@ -20,8 +20,8 @@ namespace cvc5 { namespace test { -#ifndef CVC4_POLY_IMP -#error "This unit test should only be enabled for CVC4_POLY_IMP" +#ifndef CVC5_POLY_IMP +#error "This unit test should only be enabled for CVC5_POLY_IMP" #endif class TestUtilBlackRealAlgebraicNumber : public TestInternal diff --git a/test/unit/util/stats_black.cpp b/test/unit/util/stats_black.cpp index 2ee64ab33..c15b0cd47 100644 --- a/test/unit/util/stats_black.cpp +++ b/test/unit/util/stats_black.cpp @@ -36,7 +36,7 @@ class TestUtilBlackStats : public TestInternal TEST_F(TestUtilBlackStats, stats) { -#ifdef CVC4_STATISTICS_ON +#ifdef CVC5_STATISTICS_ON std::string empty, bar = "bar", baz = "baz"; ReferenceStat refStr("stat #1", empty); ReferenceStat refStr2("refStr2", bar); -- 2.30.2