From 6660ab05c399d309208251263faeff3be2964f7b Mon Sep 17 00:00:00 2001 From: Alex Ozdemir Date: Mon, 17 Dec 2018 15:01:23 -0800 Subject: [PATCH] Configured for linking against drat2er (#2754) drat2er is a C/C++ project which includes support for * Checking DRAT proofs * Converting DRAT proofs to LRAT proofs * Converting DRAT proofs to ER proofs It does the first 2 by using drat-trim under the hood. I've modified our CMake configuration to allow drat2er to be linked into CVC4, and I added a contrib script. --- CMakeLists.txt | 12 ++++++++++++ cmake/FindDrat2Er.cmake | 31 +++++++++++++++++++++++++++++++ configure.sh | 14 ++++++++++++++ contrib/get-drat2er | 25 +++++++++++++++++++++++++ src/CMakeLists.txt | 4 ++++ src/base/configuration_private.h | 6 ++++++ 6 files changed, 92 insertions(+) create mode 100644 cmake/FindDrat2Er.cmake create mode 100755 contrib/get-drat2er diff --git a/CMakeLists.txt b/CMakeLists.txt index 099fc00fa..3265830cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,7 @@ cvc4_option(USE_READLINE "Use readline for better interactive support") # > for options where we don't need to detect if set by user (default: OFF) option(USE_CADICAL "Use CaDiCaL SAT solver") option(USE_CRYPTOMINISAT "Use CryptoMiniSat SAT solver") +option(USE_DRAT2ER "Include drat2er for making eager BV proofs") option(USE_LFSC "Use LFSC proof checker") option(USE_SYMFPU "Use SymFPU for floating point support") option(USE_PYTHON2 "Prefer using Python 2 (for Python bindings)") @@ -108,6 +109,7 @@ set(ANTLR_DIR "" CACHE STRING "Set ANTLR3 install directory") set(CADICAL_DIR "" CACHE STRING "Set CaDiCaL install directory") set(CRYPTOMINISAT_DIR "" CACHE STRING "Set CryptoMiniSat install directory") set(CXXTEST_DIR "" CACHE STRING "Set CxxTest install directory") +set(DRAT2ER_DIR "" CACHE STRING "Set drat2er install directory") set(GLPK_DIR "" CACHE STRING "Set GLPK install directory") set(GMP_DIR "" CACHE STRING "Set GMP install directory") set(LFSC_DIR "" CACHE STRING "Set LFSC install directory") @@ -410,6 +412,12 @@ if(USE_CRYPTOMINISAT) add_definitions(-DCVC4_USE_CRYPTOMINISAT) endif() +if(USE_DRAT2ER) + set(Drat2Er_HOME ${DRAT2ER_DIR}) + find_package(Drat2Er REQUIRED) + add_definitions(-DCVC4_USE_DRAT2ER) +endif() + if(USE_GLPK) set(GPL_LIBS "${GPL_LIBS} glpk") set(GLPK_HOME ${GLPK_DIR}) @@ -523,6 +531,7 @@ message("") print_config("ABC :" USE_ABC) print_config("CaDiCaL :" USE_CADICAL) print_config("CryptoMiniSat :" USE_CRYPTOMINISAT) +print_config("drat2er :" USE_DRAT2ER) print_config("GLPK :" USE_GLPK) print_config("LFSC :" USE_LFSC) @@ -546,6 +555,9 @@ endif() if(CRYPTOMINISAT_DIR) message("CRYPTOMINISAT dir : ${CRYPTOMINISAT_DIR}") endif() +if(DRAT2ER_DIR) + message("DRAT2ER dir : ${DRAT2ER_DIR}") +endif() if(GLPK_DIR) message("GLPK dir : ${GLPK_DIR}") endif() diff --git a/cmake/FindDrat2Er.cmake b/cmake/FindDrat2Er.cmake new file mode 100644 index 000000000..e0bc8d446 --- /dev/null +++ b/cmake/FindDrat2Er.cmake @@ -0,0 +1,31 @@ +# Find drat2er +# Drat2Er_FOUND - system has Drat2Er lib +# Drat2Er_INCLUDE_DIR - the Drat2Er include directory +# Drat2Er_LIBRARIES - Libraries needed to use Drat2Er + + +# Check default location of Drat2Er built with contrib/get-drat2er. +# If the user provides a directory we will not search the default paths and +# fail if Drat2Er was not found in the specified directory. +if(NOT Drat2Er_HOME) + set(Drat2Er_HOME ${PROJECT_SOURCE_DIR}/drat2er/build/install) +endif() + +find_path(Drat2Er_INCLUDE_DIR + NAMES drat2er.h + PATHS ${Drat2Er_HOME}/include + NO_DEFAULT_PATH) +find_library(Drat2Er_LIBRARIES + NAMES libdrat2er.a + PATHS ${Drat2Er_HOME}/lib + NO_DEFAULT_PATH) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Drat2Er + DEFAULT_MSG + Drat2Er_INCLUDE_DIR Drat2Er_LIBRARIES) + +mark_as_advanced(Drat2Er_INCLUDE_DIR Drat2Er_LIBRARIES) +if(Drat2Er_LIBRARIES) + message(STATUS "Found Drat2Er libs: ${Drat2Er_LIBRARIES}") +endif() diff --git a/configure.sh b/configure.sh index 7fa842f70..e53d8caa7 100755 --- a/configure.sh +++ b/configure.sh @@ -55,6 +55,7 @@ The following flags enable optional packages (disable with --no-