summaryrefslogtreecommitdiff
path: root/src/main/portfolio_util.cpp
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/portfolio_util.cpp
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/portfolio_util.cpp')
-rw-r--r--src/main/portfolio_util.cpp47
1 files changed, 47 insertions, 0 deletions
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 */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback