summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorTim King <taking@google.com>2015-12-30 11:45:37 -0800
committerTim King <taking@google.com>2015-12-30 11:45:37 -0800
commitfa7f30a4ba08afe066604daee87006b4fb5f21f7 (patch)
tree6eecac7cce64fa00f4ac5c18f023f1bc234435a3 /src/main
parent1ce397129214a427a10ff3e33069e315fe13eec1 (diff)
Shuffling around public vs. private headers
- Adding a script contrib/test_install_headers.h that tests whether one can include all cvc4_public headers. CVC4 can pass this test after this commit. - Making lib/{clock_gettime.h,ffs.h,strtok_r.h} cvc4_private. - Making prop/sat_solver_factory.h cvc4_private. - Moving the expr iostream manipulators into their own files: expr_iomanip.{h,cpp}. - Setting the generated *_options.h files back to being cvc4_private. -- Removing the usage of options/expr_options.h from expr.h. -- Removing the include of base_options.h from options.h. - Cleaning up CPP macros in cvc4_public headers. -- Changing the ROLL macro in floatingpoint.h into an inline function. -- Removing the now unused flag -D__BUILDING_STATISTICS_FOR_EXPORT.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/command_executor.cpp1
-rw-r--r--src/main/command_executor_portfolio.cpp1
-rw-r--r--src/main/driver_unified.cpp9
-rw-r--r--src/main/interactive_shell.cpp1
-rw-r--r--src/main/main.cpp1
-rw-r--r--src/main/portfolio_util.cpp47
-rw-r--r--src/main/portfolio_util.h44
-rw-r--r--src/main/util.cpp1
8 files changed, 64 insertions, 41 deletions
diff --git a/src/main/command_executor.cpp b/src/main/command_executor.cpp
index 0b53c3cbe..aa43cff0f 100644
--- a/src/main/command_executor.cpp
+++ b/src/main/command_executor.cpp
@@ -22,6 +22,7 @@
#include <string>
#include "main/main.h"
+#include "options/base_options.h"
#include "options/main_options.h"
#include "options/printer_options.h"
#include "options/smt_options.h"
diff --git a/src/main/command_executor_portfolio.cpp b/src/main/command_executor_portfolio.cpp
index a1f737d1d..c471ae585 100644
--- a/src/main/command_executor_portfolio.cpp
+++ b/src/main/command_executor_portfolio.cpp
@@ -31,6 +31,7 @@
#include "expr/pickler.h"
#include "main/main.h"
#include "main/portfolio.h"
+#include "options/base_options.h"
#include "options/main_options.h"
#include "options/options.h"
#include "options/printer_options.h"
diff --git a/src/main/driver_unified.cpp b/src/main/driver_unified.cpp
index 7e82e1bd1..3ad26c6a2 100644
--- a/src/main/driver_unified.cpp
+++ b/src/main/driver_unified.cpp
@@ -22,8 +22,11 @@
#include <iostream>
#include <new>
-#include "base/output.h"
+// This must come before PORTFOLIO_BUILD.
#include "cvc4autoconfig.h"
+
+#include "base/output.h"
+#include "expr/expr_iomanip.h"
#include "expr/expr_manager.h"
#include "expr/result.h"
#include "expr/statistics_registry.h"
@@ -35,6 +38,7 @@
#include "main/interactive_shell.h"
#include "main/main.h"
+#include "options/base_options.h"
#include "options/main_options.h"
#include "options/options.h"
#include "options/quantifiers_options.h"
@@ -284,7 +288,8 @@ int runCvc4(int argc, char* argv[], Options& opts) {
opts.set(options::replayStream, new Parser::ExprStream(replayParser));
}
if( opts[options::replayLog] != NULL ) {
- *opts[options::replayLog] << language::SetLanguage(opts[options::outputLanguage]) << Expr::setdepth(-1);
+ *opts[options::replayLog] << language::SetLanguage(opts[options::outputLanguage])
+ << expr::ExprSetDepth(-1);
}
int returnValue = 0;
diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp
index 7b146b3b0..6888d3af5 100644
--- a/src/main/interactive_shell.cpp
+++ b/src/main/interactive_shell.cpp
@@ -40,6 +40,7 @@
#include "base/output.h"
#include "options/language.h"
+#include "options/base_options.h"
#include "options/main_options.h"
#include "options/options.h"
#include "options/smt_options.h"
diff --git a/src/main/main.cpp b/src/main/main.cpp
index 36a339d94..3f0842cc5 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -28,6 +28,7 @@
#include "expr/statistics.h"
#include "main/command_executor.h"
#include "main/interactive_shell.h"
+#include "options/base_options.h"
#include "options/language.h"
#include "options/main_options.h"
#include "parser/parser.h"
diff --git a/src/main/portfolio_util.cpp b/src/main/portfolio_util.cpp
index 6b5fe4723..1ec0b961c 100644
--- a/src/main/portfolio_util.cpp
+++ b/src/main/portfolio_util.cpp
@@ -12,11 +12,14 @@
** \brief Code relevant only for portfolio builds
**/
+#include "main/portfolio_util.h"
+
#include <unistd.h>
#include <cassert>
#include <vector>
+#include "options/base_options.h"
#include "options/main_options.h"
#include "options/options.h"
#include "options/prop_options.h"
@@ -96,4 +99,48 @@ vector<Options> parseThreadSpecificOptions(Options opts)
return threadOptions;
}
+void PortfolioLemmaOutputChannel::notifyNewLemma(Expr lemma) {
+ if(int(lemma.getNumChildren()) > options::sharingFilterByLength()) {
+ return;
+ }
+ ++cnt;
+ Trace("sharing") << d_tag << ": " << lemma << std::endl;
+ expr::pickle::Pickle pkl;
+ try {
+ d_pickler.toPickle(lemma, pkl);
+ d_sharedChannel->push(pkl);
+ if(Trace.isOn("showSharing") && options::thread_id() == 0) {
+ *options::out() << "thread #0: notifyNewLemma: " << lemma
+ << std::endl;
+ }
+ } catch(expr::pickle::PicklingException& p){
+ Trace("sharing::blocked") << lemma << std::endl;
+ }
+}
+
+
+PortfolioLemmaInputChannel::PortfolioLemmaInputChannel(std::string tag,
+ SharedChannel<ChannelFormat>* c,
+ ExprManager* em,
+ VarMap& to,
+ VarMap& from)
+ : d_tag(tag), d_sharedChannel(c), d_pickler(em, to, from)
+{}
+
+bool PortfolioLemmaInputChannel::hasNewLemma(){
+ Debug("lemmaInputChannel") << d_tag << ": " << "hasNewLemma" << std::endl;
+ return !d_sharedChannel->empty();
+}
+
+Expr PortfolioLemmaInputChannel::getNewLemma() {
+ Debug("lemmaInputChannel") << d_tag << ": " << "getNewLemma" << std::endl;
+ expr::pickle::Pickle pkl = d_sharedChannel->pop();
+
+ Expr e = d_pickler.fromPickle(pkl);
+ if(Trace.isOn("showSharing") && options::thread_id() == 0) {
+ *options::out() << "thread #0: getNewLemma: " << e << std::endl;
+ }
+ return e;
+}
+
}/*CVC4 namespace */
diff --git a/src/main/portfolio_util.h b/src/main/portfolio_util.h
index d6d6a2d02..2b1e22754 100644
--- a/src/main/portfolio_util.h
+++ b/src/main/portfolio_util.h
@@ -20,6 +20,7 @@
#include "base/output.h"
#include "expr/pickler.h"
#include "options/main_options.h"
+#include "smt/smt_engine.h"
#include "smt_util/lemma_input_channel.h"
#include "smt_util/lemma_output_channel.h"
#include "util/channel.h"
@@ -49,25 +50,7 @@ public:
~PortfolioLemmaOutputChannel() throw() { }
- void notifyNewLemma(Expr lemma) {
- if(int(lemma.getNumChildren()) > options::sharingFilterByLength()) {
- return;
- }
- ++cnt;
- Trace("sharing") << d_tag << ": " << lemma << std::endl;
- expr::pickle::Pickle pkl;
- try {
- d_pickler.toPickle(lemma, pkl);
- d_sharedChannel->push(pkl);
- if(Trace.isOn("showSharing") && options::thread_id() == 0) {
- *options::out() << "thread #0: notifyNewLemma: " << lemma
- << std::endl;
- }
- } catch(expr::pickle::PicklingException& p){
- Trace("sharing::blocked") << lemma << std::endl;
- }
- }
-
+ void notifyNewLemma(Expr lemma);
};/* class PortfolioLemmaOutputChannel */
class PortfolioLemmaInputChannel : public LemmaInputChannel {
@@ -81,29 +64,12 @@ public:
SharedChannel<ChannelFormat>* c,
ExprManager* em,
VarMap& to,
- VarMap& from) :
- d_tag(tag),
- d_sharedChannel(c),
- d_pickler(em, to, from){
- }
+ VarMap& from);
~PortfolioLemmaInputChannel() throw() { }
- bool hasNewLemma(){
- Debug("lemmaInputChannel") << d_tag << ": " << "hasNewLemma" << std::endl;
- return !d_sharedChannel->empty();
- }
-
- Expr getNewLemma() {
- Debug("lemmaInputChannel") << d_tag << ": " << "getNewLemma" << std::endl;
- expr::pickle::Pickle pkl = d_sharedChannel->pop();
-
- Expr e = d_pickler.fromPickle(pkl);
- if(Trace.isOn("showSharing") && options::thread_id() == 0) {
- *options::out() << "thread #0: getNewLemma: " << e << std::endl;
- }
- return e;
- }
+ bool hasNewLemma();
+ Expr getNewLemma();
};/* class PortfolioLemmaInputChannel */
diff --git a/src/main/util.cpp b/src/main/util.cpp
index 86272ee53..ce4e4509d 100644
--- a/src/main/util.cpp
+++ b/src/main/util.cpp
@@ -34,6 +34,7 @@
#include "expr/statistics.h"
#include "main/command_executor.h"
#include "main/main.h"
+#include "options/base_options.h"
#include "options/options.h"
#include "smt/smt_engine.h"
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback