diff options
author | Morgan Deters <mdeters@gmail.com> | 2012-07-16 15:53:22 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2012-07-16 15:53:22 +0000 |
commit | 36615c5e7332e26645b33ce9b6bab25439a5108e (patch) | |
tree | 166efefced107009f4a68ff3d0c6623540dfa435 /test/system | |
parent | 25396f93b7df85c80a39ed207483e28a8c86ff26 (diff) |
Support for having two SmtEngines with the same ExprManager.
Basically, this involves creating a separate StatisticsRegistry for the
ExprManager and for the SmtEngine. Otherwise, theories register the
same statistic twice. This is a larger problem, though, for creating
multiple instances of theories, and that is unaddressed. Still,
separating out the expr statistics into a separate registry is probably
a good idea, since the expr package is somewhat separate anyway (and in
the short term it allows two SmtEngines to co-exist).
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/Makefile.am | 3 | ||||
-rw-r--r-- | test/system/boilerplate.cpp | 1 | ||||
-rw-r--r-- | test/system/two_smt_engines.cpp | 37 |
3 files changed, 40 insertions, 1 deletions
diff --git a/test/system/Makefile.am b/test/system/Makefile.am index 7fa7b4a68..070f69639 100644 --- a/test/system/Makefile.am +++ b/test/system/Makefile.am @@ -2,7 +2,8 @@ TESTS_ENVIRONMENT = TEST_EXTENSIONS = .class CPLUSPLUS_TESTS = \ boilerplate \ - ouroborous + ouroborous \ + two_smt_engines # cvc3_main TESTS = $(CPLUSPLUS_TESTS) diff --git a/test/system/boilerplate.cpp b/test/system/boilerplate.cpp index c64c1463e..18a560c0e 100644 --- a/test/system/boilerplate.cpp +++ b/test/system/boilerplate.cpp @@ -30,6 +30,7 @@ using namespace std; int main() { ExprManager em; Options opts; + cout << "foo: " << opts.threadArgv.size() << endl; SmtEngine smt(&em); Result r = smt.query(em.mkConst(true)); diff --git a/test/system/two_smt_engines.cpp b/test/system/two_smt_engines.cpp new file mode 100644 index 000000000..35d6c92cf --- /dev/null +++ b/test/system/two_smt_engines.cpp @@ -0,0 +1,37 @@ +/********************* */ +/*! \file two_smt_engines.cpp + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009-2012 The Analysis of Computer Systems Group (ACSys) + ** Courant Institute of Mathematical Sciences + ** New York University + ** See the file COPYING in the top-level source directory for licensing + ** information.\endverbatim + ** + ** \brief A simple test of multiple SmtEngines + ** + ** A simple test of multiple SmtEngines. + **/ + +#include <iostream> +#include <sstream> + +#include "expr/expr.h" +#include "smt/smt_engine.h" + +using namespace CVC4; +using namespace std; + +int main() { + ExprManager em; + Options opts; + SmtEngine smt(&em); + SmtEngine smt2(&em); + Result r = smt.query(em.mkConst(true)); + + return r == Result::VALID ? 0 : 1; +} + |