summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAina Niemetz <aina.niemetz@gmail.com>2017-08-25 15:39:16 -0700
committerGitHub <noreply@github.com>2017-08-25 15:39:16 -0700
commitdfa69ff98a14fcc0f2387e59a0c9994ef440e7d0 (patch)
tree23031231926757cb9b8aab425d8354683a3a66d7 /src
parent378a0c45070ec033493c52e4fa92e6d03b89b6c0 (diff)
Move LFSC checker out of the CVC repository. (#222)
LFSC now lives outside of the CVC4 repository and is not part of the CVC4 distribution anymore. As a consequence, we + Add --with-lfsc and --with-lfsc-directory as configure options. In the case where CVC4 has not been built with integrated LFSC, all code that interacts with LFSC is disabled. + Disable proof checking if CVC4_USE_LFSC is not defined. Configuring the build with --check-proofs but without --with-lfsc results in an error. + Do not call LFSC's cleanup function (but we should in the future). LFSC checker segfaults during cleanup on regression testcase regress0/bv/core/bitvec7.smt. Disabled call to lfscc_cleanup until the problem in lfscc is fixed. + Disable building with LFSC for the distcheck travis build since it is not part of the distribution anymore. Further, make distcheck with LFSC would require to call contrib/get-lfsc-checker before calling make check on the temp build (the build of the unpacked distribution tar ball).
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am9
-rw-r--r--src/base/configuration_private.h6
-rw-r--r--src/options/options_handler.cpp11
-rw-r--r--src/options/options_handler.h1
-rw-r--r--src/options/smt_options2
-rw-r--r--src/smt/smt_engine_check_proof.cpp31
6 files changed, 38 insertions, 22 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 151bcaaa6..916733016 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,7 +16,7 @@ AM_CPPFLAGS = \
-D__BUILDING_CVC4LIB \
-D __STDC_LIMIT_MACROS \
-D __STDC_FORMAT_MACROS \
- -I@builddir@ -I@srcdir@/include -I@srcdir@ -I@top_srcdir@/proofs/lfsc_checker
+ -I@builddir@ -I@srcdir@/include -I@srcdir@
AM_CXXFLAGS = -Wall -Wno-unknown-pragmas -Wno-parentheses $(FLAG_VISIBILITY_HIDDEN)
SUBDIRS = lib base options util expr smt_util prop/minisat prop/bvminisat . parser compat bindings main
@@ -476,7 +476,6 @@ libcvc4_la_LIBADD = \
@builddir@/prop/bvminisat/libbvminisat.la
if CVC4_PROOF
libcvc4_la_LIBADD += \
- @top_builddir@/proofs/lfsc_checker/liblfsc_checker.la \
@top_builddir@/proofs/signatures/libsignatures.la
endif
@@ -498,6 +497,12 @@ libcvc4_la_LIBADD += $(CRYPTOMINISAT_LIBS)
libcvc4_la_LDFLAGS += $(CRYPTOMINISAT_LDFLAGS)
endif
+if CVC4_USE_LFSC
+libcvc4_la_LIBADD += $(LFSC_LIBS)
+libcvc4_la_LDFLAGS += $(LFSC_LDFLAGS)
+endif
+
+
BUILT_SOURCES = \
theory/rewriter_tables.h \
diff --git a/src/base/configuration_private.h b/src/base/configuration_private.h
index 93133be24..6d9201dde 100644
--- a/src/base/configuration_private.h
+++ b/src/base/configuration_private.h
@@ -120,6 +120,12 @@ namespace CVC4 {
# define IS_CRYPTOMINISAT_BUILD false
#endif /* CVC4_USE_CRYPTOMINISAT */
+#if CVC4_USE_LFSC
+#define IS_LFSC_BUILD true
+#else /* CVC4_USE_LFSC */
+#define IS_LFSC_BUILD false
+#endif /* CVC4_USE_LFSC */
+
#ifdef HAVE_LIBREADLINE
# define IS_READLINE_BUILD true
#else /* HAVE_LIBREADLINE */
diff --git a/src/options/options_handler.cpp b/src/options/options_handler.cpp
index 5658b17b0..87dc1ecc1 100644
--- a/src/options/options_handler.cpp
+++ b/src/options/options_handler.cpp
@@ -1281,6 +1281,17 @@ void OptionsHandler::proofEnabledBuild(std::string option, bool value) throw(Opt
#endif /* CVC4_PROOF */
}
+void OptionsHandler::LFSCEnabledBuild(std::string option, bool value) {
+#ifndef CVC4_USE_LFSC
+ if (value) {
+ std::stringstream ss;
+ ss << "option `" << option << "' requires a build of CVC4 with integrated "
+ "LFSC; this binary was not built with LFSC";
+ throw OptionException(ss.str());
+ }
+#endif /* CVC4_USE_LFSC */
+}
+
void OptionsHandler::notifyDumpToFile(std::string option) {
d_options->d_dumpToFileListeners.notify();
}
diff --git a/src/options/options_handler.h b/src/options/options_handler.h
index 16c77b166..923a87d3a 100644
--- a/src/options/options_handler.h
+++ b/src/options/options_handler.h
@@ -143,6 +143,7 @@ public:
SimplificationMode stringToSimplificationMode(std::string option, std::string optarg) throw(OptionException);
void setProduceAssertions(std::string option, bool value) throw();
void proofEnabledBuild(std::string option, bool value) throw(OptionException);
+ void LFSCEnabledBuild(std::string option, bool value);
void notifyDumpToFile(std::string option);
void notifySetRegularOutputChannel(std::string option);
void notifySetDiagnosticOutputChannel(std::string option);
diff --git a/src/options/smt_options b/src/options/smt_options
index 5f50ed202..00424e103 100644
--- a/src/options/smt_options
+++ b/src/options/smt_options
@@ -33,7 +33,7 @@ option omitDontCares --omit-dont-cares bool :default false
When producing a model, omit variables whose value does not matter
option proof produce-proofs --proof bool :default false :predicate proofEnabledBuild :notify notifyBeforeSearch
turn on proof generation
-option checkProofs check-proofs --check-proofs bool :link --proof :link-smt produce-proofs :notify notifyBeforeSearch :read-write
+option checkProofs check-proofs --check-proofs bool :link --proof :link-smt produce-proofs :predicate LFSCEnabledBuild :notify notifyBeforeSearch :read-write
after UNSAT/VALID, machine-check the generated proof
option dumpProofs --dump-proofs bool :default false :link --proof :link-smt produce-proofs
output proofs after every UNSAT/VALID response
diff --git a/src/smt/smt_engine_check_proof.cpp b/src/smt/smt_engine_check_proof.cpp
index f25dd5a51..f48f6753d 100644
--- a/src/smt/smt_engine_check_proof.cpp
+++ b/src/smt/smt_engine_check_proof.cpp
@@ -28,15 +28,16 @@
#include <fstream>
#include <string>
-// #warning "TODO: Why is lfsc's check.h being included like this?"
-#include "check.h"
-
#include "base/configuration_private.h"
#include "base/cvc4_assert.h"
#include "base/output.h"
#include "smt/smt_engine.h"
#include "util/statistics_registry.h"
+#if (IS_LFSC_BUILD && IS_PROOFS_BUILD)
+#include "lfscc.h"
+#endif
+
using namespace CVC4;
using namespace std;
@@ -61,7 +62,7 @@ public:
void SmtEngine::checkProof() {
-#if IS_PROOFS_BUILD
+#if (IS_LFSC_BUILD && IS_PROOFS_BUILD)
Chat() << "generating proof..." << endl;
@@ -113,23 +114,15 @@ void SmtEngine::checkProof() {
pfStream << proof::plf_signatures << endl;
pf->toStream(pfStream);
pfStream.close();
- args a;
- a.show_runs = false;
- a.no_tail_calls = false;
- a.compile_scc = false;
- a.compile_scc_debug = false;
- a.run_scc = false;
- a.use_nested_app = false;
- a.compile_lib = false;
- init();
- check_file(pfFile, a);
+ lfscc_init();
+ lfscc_check_file(pfFile, false, false, false, false, false, false, false);
+ // FIXME: we should actually call lfscc_cleanup here, but lfscc_cleanup
+ // segfaults on regress0/bv/core/bitvec7.smt
+ //lfscc_cleanup();
free(pfFile);
close(fd);
-#else /* IS_PROOFS_BUILD */
-
+#else /* (IS_LFSC_BUILD && IS_PROOFS_BUILD) */
Unreachable("This version of CVC4 was built without proof support; cannot check proofs.");
-
-#endif /* IS_PROOFS_BUILD */
-
+#endif /* (IS_LFSC_BUILD && IS_PROOFS_BUILD) */
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback