absrefine_counterexample/libabstractionrefinement.a \
to-sat/libtosat.a sat/libminisat.a simplifier/libsimplifier.a \
extlib-constbv/libconstantbv.a extlib-abc/libabc.a \
+ cpp_interface/libcppinterface.a \
c_interface/libcinterface.a parser/libparser.a main/libmain.a)
mkdir -p $(@D)
$(RM) $@
STPManager/libstpmgr.a printer/libprinter.a \
absrefine_counterexample/libabstractionrefinement.a \
to-sat/libtosat.a simplifier/libsimplifier.a c_interface/libcinterface.a \
+ cpp_interface/libcppinterface.a \
extlib-constbv/libconstantbv.a extlib-abc/libabc.a parser/libparser.a \
main/libmain.a main/main.o): $(SRC)/AST/libast.a
$(MAKE) clean -C $(SRC)/to-sat
$(MAKE) clean -C $(SRC)/sat
$(MAKE) clean -C $(SRC)/c_interface
+ $(MAKE) clean -C $(SRC)/cpp_interface
$(MAKE) clean -C $(SRC)/parser
$(MAKE) clean -C $(SRC)/main
$(MAKE) clean -C tests/c-api-tests
#include <assert.h>
#include "fdstream.h"
#include "../printer/printers.h"
-#include "../parser/ParserInterface.h"
+#include "../cpp_interface/cpp_interface.h"
//These typedefs lower the effort of using the keyboard to type (too
//many overloaded meanings of the word type)
--- /dev/null
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
+
+SRCS = $(wildcard *.cpp)
+OBJS = $(SRCS:.cpp=.o)
+
+
+libcppinterface.a: $(OBJS)
+ $(RM) $@
+ $(AR) qcs $@ $^
+
+.PHONY: clean
+clean:
+ $(RM) *.o *~ *.a .#* depend
+
+depend: $(SRCS)
+ @$(call makedepend,$@,$(SRCS))
+
+-include depend
+
--- /dev/null
+#include "cpp_interface.h"
+
+namespace BEEV
+{
+
+
+// Does some simple caching of prior results.
+ void
+ ParserInterface::checkSat(vector<ASTVec> & assertionsSMT2)
+ {
+ bm.GetRunTimes()->stop(RunTimes::Parsing);
+ assert(assertionsSMT2.size() == cache.size());
+
+ Entry& cacheEntry = cache.back();
+
+ //cerr << "------------" << endl;
+ //printStatus();
+
+ if ((cacheEntry.result == SOLVER_SATISFIABLE || cacheEntry.result == SOLVER_UNSATISFIABLE)
+ && (assertionsSMT2.back().size() ==1 && assertionsSMT2.back()[0] == cacheEntry.node))
+ { // If we already know the answer then return.
+ if (bm.UserFlags.quick_statistics_flag)
+ {
+ bm.GetRunTimes()->print();
+ }
+
+ (GlobalSTP->tosat)->PrintOutput(cache.back().result);
+ bm.GetRunTimes()->start(RunTimes::Parsing);
+ return;
+ }
+
+ bm.ClearAllTables();
+ GlobalSTP->ClearAllTables();
+
+ // Loop through the set of assertions converting them to single nodes..
+ ASTVec v;
+ for (int i = 0; i < assertionsSMT2.size(); i++)
+ {
+ if (assertionsSMT2[i].size() == 1)
+ {}
+ else if (assertionsSMT2[i].size() == 0)
+ assertionsSMT2[i].push_back(bm.ASTTrue);
+ else
+ {
+ ASTNode v = parserInterface->CreateNode(AND, assertionsSMT2[i]);
+ assertionsSMT2[i].clear();
+ assertionsSMT2[i].push_back(v);
+ }
+ assert(assertionsSMT2[i].size() ==1);
+ v.push_back(assertionsSMT2[i][0]);
+ }
+
+ ASTNode query;
+
+ if (v.size() > 1)
+ query = parserInterface->CreateNode(AND, v);
+ else if (v.size() > 0)
+ query = v[0];
+ else
+ query = bm.ASTTrue;
+
+ SOLVER_RETURN_TYPE last_result = GlobalSTP->TopLevelSTP(query, bm.ASTFalse);
+
+ // Write in the answer to the current slot.
+ if (last_result ==SOLVER_SATISFIABLE || last_result ==SOLVER_UNSATISFIABLE)
+ {
+ Entry e(last_result);
+ e.node = assertionsSMT2.back()[0];
+ cacheEntry = e;
+ assert (!cacheEntry.node.IsNull());
+ }
+
+ // It's satisfiable, so everything beneath it is satisfiable too.
+ if (last_result ==SOLVER_SATISFIABLE)
+ {
+ for (int i=0; i < cache.size(); i++)
+ {
+ assert(cache[i].result != SOLVER_UNSATISFIABLE);
+ cache[i].result = SOLVER_SATISFIABLE;
+ }
+ }
+
+ if (bm.UserFlags.quick_statistics_flag)
+ {
+ bm.GetRunTimes()->print();
+ }
+
+ (GlobalSTP->tosat)->PrintOutput(last_result);
+ //printStatus();
+ bm.GetRunTimes()->start(RunTimes::Parsing);
+ }
+};
#include "../AST/AST.h"
#include "../AST/NodeFactory/NodeFactory.h"
#include <cassert>
-#include "LetMgr.h"
+#include "../parser/LetMgr.h"
#include "../STPManager/STPManager.h"
#include "../STPManager/STP.h"
//#include "../boost/pool/object_pool.hpp"
cerr<< endl;
}
- // Does some simple caching of prior results.
void
- checkSat(vector<ASTVec> & assertionsSMT2)
- {
- bm.GetRunTimes()->stop(RunTimes::Parsing);
- assert(assertionsSMT2.size() == cache.size());
-
- Entry& cacheEntry = cache.back();
-
- //cerr << "------------" << endl;
- //printStatus();
-
- if ((cacheEntry.result == SOLVER_SATISFIABLE || cacheEntry.result == SOLVER_UNSATISFIABLE)
- && (assertionsSMT2.back().size() ==1 && assertionsSMT2.back()[0] == cacheEntry.node))
- { // If we already know the answer then return.
- if (bm.UserFlags.quick_statistics_flag)
- {
- bm.GetRunTimes()->print();
- }
-
- (GlobalSTP->tosat)->PrintOutput(cache.back().result);
- bm.GetRunTimes()->start(RunTimes::Parsing);
- return;
- }
-
- bm.ClearAllTables();
- GlobalSTP->ClearAllTables();
-
- // Loop through the set of assertions converting them to single nodes..
- ASTVec v;
- for (int i = 0; i < assertionsSMT2.size(); i++)
- {
- if (assertionsSMT2[i].size() == 1)
- {}
- else if (assertionsSMT2[i].size() == 0)
- assertionsSMT2[i].push_back(bm.ASTTrue);
- else
- {
- ASTNode v = parserInterface->CreateNode(AND, assertionsSMT2[i]);
- assertionsSMT2[i].clear();
- assertionsSMT2[i].push_back(v);
- }
- assert(assertionsSMT2[i].size() ==1);
- v.push_back(assertionsSMT2[i][0]);
- }
-
- ASTNode query;
-
- if (v.size() > 1)
- query = parserInterface->CreateNode(AND, v);
- else if (v.size() > 0)
- query = v[0];
- else
- query = bm.ASTTrue;
-
- SOLVER_RETURN_TYPE last_result = GlobalSTP->TopLevelSTP(query, bm.ASTFalse);
-
- // Write in the answer to the current slot.
- if (last_result ==SOLVER_SATISFIABLE || last_result ==SOLVER_UNSATISFIABLE)
- {
- Entry e(last_result);
- e.node = assertionsSMT2.back()[0];
- cacheEntry = e;
- assert (!cacheEntry.node.IsNull());
- }
-
- // It's satisfiable, so everything beneath it is satisfiable too.
- if (last_result ==SOLVER_SATISFIABLE)
- {
- for (int i=0; i < cache.size(); i++)
- {
- assert(cache[i].result != SOLVER_UNSATISFIABLE);
- cache[i].result = SOLVER_SATISFIABLE;
- }
- }
-
- if (bm.UserFlags.quick_statistics_flag)
- {
- bm.GetRunTimes()->print();
- }
-
- (GlobalSTP->tosat)->PrintOutput(last_result);
- //printStatus();
- bm.GetRunTimes()->start(RunTimes::Parsing);
- }
+ checkSat(vector<ASTVec> & assertionsSMT2);
void cleanUp()
{
#include "../STPManager/STP.h"
#include "../AST/NodeFactory/TypeChecker.h"
#include "../AST/NodeFactory/SimplifyingNodeFactory.h"
-#include "../parser/ParserInterface.h"
+#include "../cpp_interface/cpp_interface.h"
#include <sys/time.h>
#include <memory>
#include <iostream>
#include "parser.h"
#include "parsecvc.hpp"
-#include "ParserInterface.h"
+#include "../cpp_interface/cpp_interface.h"
using namespace std;
using namespace BEEV;
********************************************************************/
#include "parser.h"
-#include "ParserInterface.h"
+#include "../cpp_interface/cpp_interface.h"
using namespace std;
using namespace BEEV;
#include <iostream>
#include "parser.h"
#include "parsesmt.hpp"
-#include "ParserInterface.h"
+#include "../cpp_interface/cpp_interface.h"
using namespace std;
using namespace BEEV;
********************************************************************/
// -*- c++ -*-
-#include "ParserInterface.h"
+#include "../cpp_interface/cpp_interface.h"
using namespace std;
using namespace BEEV;
// -*- c++ -*-L
#include "parser.h"
#include "parsesmt2.hpp"
-#include "ParserInterface.h"
+#include "../cpp_interface/cpp_interface.h"
extern char *smt2text;
extern int smt2error (const char *msg);
********************************************************************/
// -*- c++ -*-
-#include "ParserInterface.h"
+#include "../cpp_interface/cpp_interface.h"
using namespace std;
using namespace BEEV;