AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I config
-SUBDIRS = src doc contrib
+SUBDIRS = src test doc contrib
+
+.PHONY: test
+test: check
touch stamp-h
aclocal -I config
autoconf -I config
-automake -ac --foreign
+automake -ac --foreign -Woverride
if test -z "$DOXYGEN"; then
AC_MSG_WARN([documentation targets require doxygen. Set your PATH appropriately or set DOXYGEN to point to a valid doxygen binary.])
fi
+AC_ARG_VAR(DOXYGEN, [location of doxygen binary])
+
+CXXTESTGEN=
+AC_PATH_PROG(CXXTESTGEN, cxxtestgen.pl, [], [$CXXTEST:$PATH])
+if test -z "$CXXTESTGEN"; then
+ AC_MSG_NOTICE([unit tests disabled, cxxtestgen.pl not found.])
+elif test -z "$CXXTEST"; then
+ CXXTEST=$(dirname "$CXXTESTGEN")
+ AC_MSG_CHECKING([for location of CxxTest headers])
+ if test -e "$CXXTEST/cxxtest/TestRunner.h"; then
+ AC_MSG_RESULT([$CXXTEST])
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_WARN([unit tests disabled, CxxTest headers not found.])
+ CXXTESTGEN=
+ CXXTEST=
+ fi
+fi
+AC_ARG_VAR(CXXTEST, [path to CxxTest installation])
+AM_CONDITIONAL([HAVE_CXXTESTGEN], [test -n "$CXXTESTGEN"])
+
+AC_ARG_VAR(TEST_CPPFLAGS, [CXXFLAGS to use when testing (default=$CPPFLAGS)])
+AC_ARG_VAR(TEST_CXXFLAGS, [CXXFLAGS to use when testing (default=$CXXFLAGS)])
+AC_ARG_VAR(TEST_LDFLAGS, [LDFLAGS to use when testing (default=$LDFLAGS)])
# Checks for libraries.
AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/])])
src/context/Makefile
src/parser/Makefile
src/theory/Makefile
+ test/Makefile
])
AC_OUTPUT
INCLUDES = -I@srcdir@/include -I@srcdir@
+AM_CXXFLAGS = -Wall -fvisibility=hidden
SUBDIRS = util expr context prop smt theory parser main
INCLUDES = -I@srcdir@/../include -I@srcdir@/..
-AM_CXXFLAGS = -Wall
+AM_CXXFLAGS = -Wall -fvisibility=hidden
noinst_LIBRARIES = libcontext.a
**
**/
-#ifndef __CVC4_CONTEXT_H
-#define __CVC4_CONTEXT_H
+#ifndef __CVC4__CONTEXT__CONTEXT_H
+#define __CVC4__CONTEXT__CONTEXT_H
namespace CVC4 {
+namespace context {
class Context;
template <class T>
class CDSet;
+}/* CVC4::context namespace */
}/* CVC4 namespace */
-#endif /* __CVC4_CONTEXT_H */
+#endif /* __CVC4__CONTEXT__CONTEXT_H */
INCLUDES = -I@srcdir@/../include -I@srcdir@/..
-AM_CXXFLAGS = -Wall
+AM_CXXFLAGS = -Wall -fvisibility=hidden
noinst_LIBRARIES = libexpr.a
**
**/
-#ifndef __CVC4_ATTR_TYPE_H
-#define __CVC4_ATTR_TYPE_H
+#ifndef __CVC4__EXPR__ATTR_TYPE_H
+#define __CVC4__EXPR__ATTR_TYPE_H
#include "expr_attribute.h"
namespace CVC4 {
+namespace expr {
class Type;
extern AttrTable<Type_attr> type_table;
-} /* CVC4 namespace */
+}/* CVC4::expr namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_ATTR_TYPE_H */
+#endif /* __CVC4__EXPR__ATTR_TYPE_H */
#include "expr_value.h"
#include "expr_builder.h"
+using namespace CVC4::expr;
+
namespace CVC4 {
Expr Expr::s_null(0);
Expr::Expr(ExprValue* ev)
: d_ev(ev) {
- // FIXME: thread-safety
- ++d_ev->d_rc;
+ d_ev->inc();
}
Expr::Expr(const Expr& e) {
- // FIXME: thread-safety
if((d_ev = e.d_ev))
- ++d_ev->d_rc;
+ d_ev->inc();
}
Expr::~Expr() {
- // FIXME: thread-safety
- --d_ev->d_rc;
+ d_ev->dec();
}
Expr& Expr::operator=(const Expr& e) {
- // FIXME: thread-safety
if(d_ev)
- --d_ev->d_rc;
+ d_ev->dec();
if((d_ev = e.d_ev))
- ++d_ev->d_rc;
+ d_ev->inc();
return *this;
}
return ExprBuilder(*this).substExpr(oldTerms, newTerms);
}
-} /* CVC4 namespace */
+}/* CVC4 namespace */
**
**/
-#ifndef __CVC4_EXPR_ATTRIBUTE_H
-#define __CVC4_EXPR_ATTRIBUTE_H
+#ifndef __CVC4__EXPR__EXPR_ATTRIBUTE_H
+#define __CVC4__EXPR__EXPR_ATTRIBUTE_H
// TODO WARNING this file needs work !
#include "cvc4_expr.h"
namespace CVC4 {
+namespace expr {
template <class value_type>
class AttrTables;
};
-} /* CVC4 namespace */
+}/* CVC4::expr namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_EXPR_ATTRIBUTE_H */
+#endif /* __CVC4__EXPR__EXPR_ATTRIBUTE_H */
v->reserve(nchild_thresh + 5);
for(ExprValue** i = d_children.u_arr; i != d_children.u_arr + nchild_thresh; ++i) {
v->push_back(Expr(*i));
- i->dec();
+ (*i)->dec();
}
- v.push_back(e);
+ v->push_back(e);
d_children.u_vec = v;
++d_nchildren;
} else if(d_nchildren > nchild_thresh) {
- d_children.u_vec.push_back(e);
+ d_children.u_vec->push_back(e);
++d_nchildren;
} else {
- ExprValue *ev = e->d_ev;
+ ExprValue *ev = e.d_ev;
d_children.u_arr[d_nchildren] = ev;
ev->inc();
++d_nchildren;
}
- return *this;
}
-void ExprBuilder::addChild(const ExprValue* ev) {
+void ExprBuilder::addChild(ExprValue* ev) {
if(d_nchildren == nchild_thresh) {
vector<Expr>* v = new vector<Expr>();
v->reserve(nchild_thresh + 5);
for(ExprValue** i = d_children.u_arr; i != d_children.u_arr + nchild_thresh; ++i) {
v->push_back(Expr(*i));
- i->dec();
+ (*i)->dec();
}
- v.push_back(Expr(ev));
+ v->push_back(Expr(ev));
d_children.u_vec = v;
++d_nchildren;
} else if(d_nchildren > nchild_thresh) {
- d_children.u_vec.push_back(Expr(ev));
+ d_children.u_vec->push_back(Expr(ev));
++d_nchildren;
} else {
d_children.u_arr[d_nchildren] = ev;
ev->inc();
++d_nchildren;
}
- return *this;
}
void ExprBuilder::collapse() {
v->reserve(nchild_thresh + 5);
}
- return *this;
}
// not const
MultExprBuilder ExprBuilder::operator* (Expr) {
}
-} /* CVC4 namespace */
+}/* CVC4 namespace */
**
**/
-#ifndef __CVC4_EXPR_BUILDER_H
-#define __CVC4_EXPR_BUILDER_H
+#ifndef __CVC4__EXPR_BUILDER_H
+#define __CVC4__EXPR_BUILDER_H
#include <vector>
#include "expr_manager.h"
} d_children;
void addChild(const Expr&);
- void addChild(const ExprValue*);
+ void addChild(ExprValue*);
void collapse();
typedef ExprValue** ev_iterator;
typedef ExprValue const** const_ev_iterator;
- void reset(const ExprValue*);
+ ExprBuilder& reset(const ExprValue*);
public:
};/* class MultExprBuilder */
-} /* CVC4 namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_EXPR_BUILDER_H */
+#endif /* __CVC4__EXPR_BUILDER_H */
return ExprBuilder(this, kind).append(children);
}
-} /* CVC4 namespace */
+}/* CVC4 namespace */
**
**/
-#ifndef __CVC4_EXPR_MANAGER_H
-#define __CVC4_EXPR_MANAGER_H
+#ifndef __CVC4__EXPR_MANAGER_H
+#define __CVC4__EXPR_MANAGER_H
#include <vector>
#include "cvc4_expr.h"
// do we want a varargs one? perhaps not..
};
-} /* CVC4 namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_EXPR_MANAGER_H */
+#endif /* __CVC4__EXPR_MANAGER_H */
return d_children - 1;
}
-} /* CVC4 namespace */
+}/* CVC4 namespace */
** reference count on ExprValue instances and
**/
-#ifndef __CVC4_EXPR_VALUE_H
-#define __CVC4_EXPR_VALUE_H
+#ifndef __CVC4__EXPR__EXPR_VALUE_H
+#define __CVC4__EXPR__EXPR_VALUE_H
#include <stdint.h>
#include "cvc4_expr.h"
namespace CVC4 {
+class Expr;
+class ExprBuilder;
+
+namespace expr {
+
/**
* This is an ExprValue.
*/
/** Variable number of child nodes */
Expr d_children[0];
- friend class Expr;
- friend class ExprBuilder;
+ // todo add exprMgr ref in debug case
+
+ friend class CVC4::Expr;
+ friend class CVC4::ExprBuilder;
- ExprValue* inc() { /* FIXME thread safety */ ++d_rc; return this; }
- ExprValue* dec() { /* FIXME thread safety */ --d_rc; return this; }
+ ExprValue* inc();
+ ExprValue* dec();
public:
/** Hash this expression.
const_iterator rend() const;
};
-} /* CVC4 namespace */
+}/* CVC4::expr namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_EXPR_VALUE_H */
+#endif /* __CVC4__EXPR__EXPR_VALUE_H */
**
**/
-#ifndef __CVC4_KIND_H
-#define __CVC4_KIND_H
+#ifndef __CVC4__KIND_H
+#define __CVC4__KIND_H
namespace CVC4 {
// placeholder for design & development work.
enum Kind {
+ /* undefined */
UNDEFINED_KIND = -1,
+
+ /* built-ins */
EQUAL,
+ ITE,
+ SKOLEM,
+ VARIABLE,
+
+ /* propositional connectives */
+ FALSE,
+ TRUE,
+
+ NOT,
+
AND,
+ IFF,
OR,
XOR,
- NOT,
+
+ /* from arith */
PLUS,
- MINUS,
- ITE,
- IFF,
- SKOLEM,
- SUBST
+ MINUS
+
};/* enum Kind */
}/* CVC4 namespace */
-#endif /* __CVC4_KIND_H */
+#endif /* __CVC4__KIND_H */
**
**/
-#ifndef __CVC4_VC_H
-#define __CVC4_VC_H
+#ifndef __CVC4_H
+#define __CVC4_H
-#include "command.h"
+#include "util/command.h"
#include "cvc4_expr.h"
/* TODO provide way of querying whether you fall into a fragment /
void query(Expr);
};
-} /* CVC4 namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_VC_H */
+#endif /* __CVC4_H */
#include <vector>
#include <stdint.h>
+#include "expr/kind.h"
namespace CVC4 {
-class ExprValue;
+namespace expr {
+ class ExprValue;
+}/* CVC4::expr namespace */
+
+using CVC4::expr::ExprValue;
/**
* Encapsulation of an ExprValue pointer. The reference count is
typedef Expr* iterator;
typedef Expr const* const_iterator;
+ friend class ExprBuilder;
+
public:
Expr(const Expr&);
Expr substExpr(const std::vector<Expr>& oldTerms,
const std::vector<Expr>& newTerms) const;
+ inline Kind getKind() const;
+
static Expr null() { return s_null; }
- friend class ExprBuilder;
};/* class Expr */
-} /* CVC4 namespace */
+}/* CVC4 namespace */
+
+#include "expr/expr_value.h"
+
+namespace CVC4 {
+
+inline Kind Expr::getKind() const {
+ return Kind(d_ev->d_kind);
+}
+
+}/* CVC4 namespace */
#endif /* __CVC4_EXPR_H */
INCLUDES = -I@srcdir@/../include -I@srcdir@/..
-AM_CXXFLAGS = -Wall
+AM_CXXFLAGS = -Wall -fvisibility=hidden
bin_PROGRAMS = cvc4
-#ifndef __CVC4_ABOUT_H
-#define __CVC4_ABOUT_H
+#ifndef __CVC4__MAIN__ABOUT_H
+#define __CVC4__MAIN__ABOUT_H
namespace CVC4 {
-namespace Main {
+namespace main {
const char about[] = "\
This is a pre-release of CVC4.\n\
New York University\n\
";
-}/* CVC4::Main namespace */
+}/* CVC4::main namespace */
}/* CVC4 namespace */
#endif /* __CVC4_MAIN_H */
throw new Exception(string("Could not open input file `") + argv[firstArgIndex] + "' for reading: " + strerror(errno));
exit(1);
}
+
+ // ExprManager *exprMgr = ...;
+ // SmtEngine smt(exprMgr, &opts);
+ // Parser parser(infile, exprMgr, &opts);
+ // while(!parser.done) {
+ // Command *cmd = parser.get();
+ // cmd->invoke(smt);
+ // delete cmd;
+ // }
}
} catch(CVC4::Main::OptionException* e) {
if(opts.smtcomp_mode) {
#include "util/exception.h"
#include "util/options.h"
-#ifndef __CVC4_MAIN_H
-#define __CVC4_MAIN_H
+#ifndef __CVC4__MAIN__MAIN_H
+#define __CVC4__MAIN__MAIN_H
namespace CVC4 {
-namespace Main {
+namespace main {
class OptionException : public CVC4::Exception {
public:
int parseOptions(int argc, char** argv, CVC4::Options*) throw(CVC4::Exception*);
void cvc4_init() throw();
-}/* CVC4::Main namespace */
+}/* CVC4::main namespace */
}/* CVC4 namespace */
-#endif /* __CVC4_MAIN_H */
+#endif /* __CVC4__MAIN__MAIN_H */
-#ifndef __CVC4_USAGE_H
-#define __CVC4_USAGE_H
+#ifndef __CVC4__MAIN__USAGE_H
+#define __CVC4__MAIN__USAGE_H
namespace CVC4 {
-namespace Main {
+namespace main {
// no more % chars in here without being escaped; it's used as a
// printf() format string
--stats give statistics on exit\n\
";
-}/* CVC4::Main namespace */
+}/* CVC4::main namespace */
}/* CVC4 namespace */
-#endif /* __CVC4_USAGE_H */
+#endif /* __CVC4__MAIN__USAGE_H */
void sigint_handler(int sig, siginfo_t* info, void*) {
fprintf(stderr, "CVC4 interrupted by user.\n");
- exit(info->si_signo + 128);
+ abort();
}
void segv_handler(int sig, siginfo_t* info, void*) {
fprintf(stderr, "CVC4 suffered a segfault.\n");
- exit(info->si_signo + 128);
+ abort();
}
void cvc4_init() throw() {
-INCLUDES = -I@srcdir@/../include -I@srcdir@/..
-AM_CXXFLAGS = -Wall
+INCLUDES = -I@srcdir@/../include -I@srcdir@/.. -I@builddir@
+AM_CXXFLAGS = -Wall -fvisibility=hidden
noinst_LIBRARIES = libparser.a
** Parser abstraction.
**/
-#ifndef __CVC4_PARSER_H
-#define __CVC4_PARSER_H
+#ifndef __CVC4__PARSER__PARSER_H
+#define __CVC4__PARSER__PARSER_H
#include "core/exception.h"
#include "core/lang.h"
namespace CVC4 {
+namespace parser {
class ValidityChecker;
class Expr;
class ParserTemp;
extern ParserTemp* parserTemp;
+}/* CVC4::parser namespace */
}/* CVC4 namespace */
-#endif /* __CVC4_PARSER_H */
+#endif /* __CVC4__PARSER__PARSER_H */
** Exception class.
**/
-#ifndef __CVC4_PARSER_EXCEPTION_H
-#define __CVC4_PARSER_EXCEPTION_H
+#ifndef __CVC4__PARSER__PARSER_EXCEPTION_H
+#define __CVC4__PARSER__PARSER_EXCEPTION_H
-#include "core/exception.h"
+#include "util/exception.h"
#include <string>
#include <iostream>
namespace CVC4 {
+namespace parser {
class ParserException: public Exception {
public:
}
}; // end of class ParserException
+}/* CVC4::parser namespace */
}/* CVC4 namespace */
-#endif /* __CVC4_PARSER_EXCEPTION_H */
+#endif /* __CVC4__PARSER__PARSER_EXCEPTION_H */
** New York University
**/
-#ifndef __CVC4_PARSER_STATE_H
-#define __CVC4_PARSER_STATE_H
+#ifndef __CVC4__PARSER__PARSER_STATE_H
+#define __CVC4__PARSER__PARSER_STATE_H
#include <iostream>
#include <sstream>
#include "cvc4_expr.h"
-#include "exception.h"
+#include "util/exception.h"
namespace CVC4 {
-class ValidityChecker;
+class SmtEngine;
+
+namespace parser {
class ParserState {
private:
// The currently used prompt
std::string prompt;
public:
- ValidityChecker* vc;
+ SmtEngine* vc;
std::istream* is;
// The current input line
int lineNum;
void setPrompt2() { prompt = prompt2; }
};
-} /* CVC4 namespace */
+}/* CVC4::parser namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_PARSER_STATE_H */
+#endif /* __CVC4__PARSER__PARSER_STATE_H */
%{
-#include "vc.h"
-#include "parser_exception.h"
-#include "parser_state.h"
+#include "cvc4.h"
+#include "parser/parser_exception.h"
+#include "parser/parser_state.h"
//#include "rational.h"
// Exported shared data
namespace CVC4 {
- extern ParserState* parserState;
-}
+ namespace parser {
+ extern ParserState* parserState;
+ }/* CVC4::parser namespace */
+}/* CVC4 hnamespace */
+
// Define shortcuts for various things
-#define TMP CVC4::parserState
-#define EXPR CVC4::parserState->expr
-#define VC (CVC4::parserState->vc)
+#define TMP CVC4::parser::parserState
+#define EXPR CVC4::parser::parserState->expr
+#define VC (CVC4::parser::parserState->vc)
#define RAT(args) CVC4::newRational args
// Suppress the bogus warning suppression in bison (it generates
int PLerror(const char *s)
{
std::ostringstream ss;
- ss << CVC4::parserState->fileName << ":" << CVC4::parserState->lineNum
+ ss << CVC4::parser::parserState->fileName << ":" << CVC4::parser::parserState->lineNum
<< ": " << s;
- return CVC4::parserState->error(ss.str());
+ return CVC4::parser::parserState->error(ss.str());
}
%{
#include <iostream>
-#include "expr_manager.h" /* for the benefit of parsePL_defs.h */
-#include "parser_state.h"
-#include "pl.hpp"
-#include "debug.h"
+#include "expr/expr_manager.h" /* for the benefit of parsePL_defs.h */
+#include "parser/parser_state.h"
+#include "parser/pl.hpp"
+#include "util/debug.h"
namespace CVC4 {
- extern ParserState* parserState;
-}
+ namespace parser {
+ extern ParserState* parserState;
+ }/* CVC4::parser namespace */
+}/* CVC4 namespace */
extern int PL_inputLine;
extern char *PLtext;
-extern int PLerror (const char *msg);
+extern int PLerror(const char *msg);
static int PLinput(std::istream& is, char* buf, int size) {
int res;
if(is) {
// If interactive, read line by line; otherwise read as much as we
// can gobble
- if(CVC4::parserState->interactive) {
+ if(CVC4::parser::parserState->interactive) {
// Print the current prompt
- std::cout << CVC4::parserState->getPrompt() << std::flush;
+ std::cout << CVC4::parser::parserState->getPrompt() << std::flush;
// Set the prompt to "middle of the command" one
- CVC4::parserState->setPrompt2();
+ CVC4::parser::parserState->setPrompt2();
// Read the line
is.getline(buf, size-1);
} else // Set the terminator char to 0
// Redefine the input buffer function to read from an istream
#define YY_INPUT(buf,result,max_size) \
- result = PLinput(*CVC4::parserState->is, buf, max_size);
+ result = PLinput(*CVC4::parser::parserState->is, buf, max_size);
int PL_bufSize() { return YY_BUF_SIZE; }
YY_BUFFER_STATE PL_buf_state() { return YY_CURRENT_BUFFER; }
%%
-[\n] { CVC4::parserState->lineNum++; }
+[\n] { CVC4::parser::parserState->lineNum++; }
[ \t\r\f] { /* skip whitespace */ }
"%" { BEGIN COMMENT; }
<COMMENT>"\n" { BEGIN INITIAL; /* return to normal mode */
- CVC4::parserState->lineNum++; }
+ CVC4::parser::parserState->lineNum++; }
<COMMENT>. { /* stay in comment mode */ }
<INITIAL>"\"" { BEGIN STRING_LITERAL;
** commands in SMT-LIB language.
**/
-#include "vc.h"
-#include "parser_exception.h"
-#include "parser_state.h"
+#include "cvc4.h"
+#include "parser/parser_exception.h"
+#include "parser/parser_state.h"
// Exported shared data
namespace CVC4 {
%{
#include <iostream>
-#include "smtlib.hpp"
-#include "debug.h"
+#include "parser/smtlib.hpp"
+#include "util/debug.h"
namespace CVC4 {
extern ParserTemp* parserTemp;
INCLUDES = -I@srcdir@/../include -I@srcdir@/..
-AM_CXXFLAGS = -Wall
+AM_CXXFLAGS = -Wall -fvisibility=hidden
SUBDIRS = minisat
INCLUDES = -I@srcdir@/mtl -I@srcdir@/core -I@srcdir@/../../include
+AM_CXXFLAGS = -Wall -fvisibility=hidden
noinst_LIBRARIES = libminisat.a
libminisat_a_SOURCES = \
**
**/
-#ifndef __CVC4_PROP_ENGINE_H
-#define __CVC4_PROP_ENGINE_H
+#ifndef __CVC4__PROP__PROP_ENGINE_H
+#define __CVC4__PROP__PROP_ENGINE_H
#include "core/cvc4_expr.h"
#include "core/decision_engine.h"
#include "core/theory_engine.h"
namespace CVC4 {
+namespace prop {
// In terms of abstraction, this is below (and provides services to)
// Prover and above (and requires the services of) a specific
};/* class PropEngine */
-}
+}/* CVC4::prop namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_PROP_ENGINE_H */
+#endif /* __CVC4__PROP__PROP_ENGINE_H */
**
**/
-#ifndef __CVC4_SAT_H
-#define __CVC4_SAT_H
+#ifndef __CVC4__PROP__SAT_H
+#define __CVC4__PROP__SAT_H
namespace CVC4 {
+namespace prop {
-} /* CVC4 namespace */
+}/* CVC4::prop namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_SAT_H */
+#endif /* __CVC4__PROP__SAT_H */
INCLUDES = -I@srcdir@/../include -I@srcdir@/..
-AM_CXXFLAGS = -Wall
+AM_CXXFLAGS = -Wall -fvisibility=hidden
noinst_LIBRARIES = libsmt.a
**
**/
-#ifndef __CVC4_PROVER_H
-#define __CVC4_PROVER_H
+#ifndef __CVC4__SMT__SMT_ENGINE_H
+#define __CVC4__SMT__SMT_ENGINE_H
#include <vector>
#include "core/cvc4_expr.h"
// PropEngine.
namespace CVC4 {
+namespace smt {
// TODO: SAT layer (esp. CNF- versus non-clausal solvers under the
// hood): use a type parameter and have check() delegate, or subclass
void pop();
};/* class SmtEngine */
-} /* CVC4 namespace */
+}/* CVC4::smt namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_PROVER_H */
+#endif /* __CVC4__SMT__SMT_ENGINE_H */
INCLUDES = -I@srcdir@/../include -I@srcdir@/..
-AM_CXXFLAGS = -Wall
+AM_CXXFLAGS = -Wall -fvisibility=hidden
noinst_LIBRARIES = libtheory.a
**
**/
-#ifndef __CVC4_THEORY_H
-#define __CVC4_THEORY_H
+#ifndef __CVC4__THEORY__THEORY_H
+#define __CVC4__THEORY__THEORY_H
#include "core/cvc4_expr.h"
#include "core/literal.h"
namespace CVC4 {
+namespace theory {
/**
* Base class for T-solvers. Abstract DPLL(T).
};/* class Theory */
+}/* CVC4::theory namespace */
}/* CVC4 namespace */
-#endif /* __CVC4_THEORY_H */
+#endif /* __CVC4__THEORY__THEORY_H */
**
**/
-#ifndef __CVC4_THEORY_ENGINE_H
-#define __CVC4_THEORY_ENGINE_H
+#ifndef __CVC4__THEORY__THEORY_ENGINE_H
+#define __CVC4__THEORY__THEORY_ENGINE_H
namespace CVC4 {
+namespace theory {
// In terms of abstraction, this is below (and provides services to)
// PropEngine.
public:
};/* class TheoryEngine */
+}/* CVC4::theory namespace */
}/* CVC4 namespace */
-#endif /* __CVC4_THEORY_ENGINE_H */
+#endif /* __CVC4__THEORY__THEORY_ENGINE_H */
INCLUDES = -I@srcdir@/../include -I@srcdir@/..
-AM_CXXFLAGS = -Wall
+AM_CXXFLAGS = -Wall -fvisibility=hidden
noinst_LIBRARIES = libutil.a
**
**/
-#ifndef __CVC4_ASSERT_H
-#define __CVC4_ASSERT_H
+#ifndef __CVC4__ASSERT_H
+#define __CVC4__ASSERT_H
#include <cassert>
# define cvc4assert(x)
#endif /* DEBUG */
-#endif /* __CVC4_ASSERT_H */
+#endif /* __CVC4__ASSERT_H */
**
**/
-#ifndef __CVC4_COMMAND_H
-#define __CVC4_COMMAND_H
+#ifndef __CVC4__COMMAND_H
+#define __CVC4__COMMAND_H
namespace CVC4 {
class Command { // distinct from Exprs
};
-} /* CVC4 namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_COMMAND_H */
+#endif /* __CVC4__COMMAND_H */
**
**/
-#ifndef __CVC4_DEBUG_H
-#define __CVC4_DEBUG_H
+#ifndef __CVC4__DEBUG_H
+#define __CVC4__DEBUG_H
#include <cassert>
# define cvc4assert(x)
#endif /* DEBUG */
-#endif /* __CVC4_DEBUG_H */
+#endif /* __CVC4__DEBUG_H */
**
**/
-#ifndef __CVC4_DECISION_ENGINE_H
-#define __CVC4_DECISION_ENGINE_H
+#ifndef __CVC4__DECISION_ENGINE_H
+#define __CVC4__DECISION_ENGINE_H
#include "core/literal.h"
}/* CVC4 namespace */
-#endif /* __CVC4_DECISION_ENGINE_H */
+#endif /* __CVC4__DECISION_ENGINE_H */
** Exception class.
**/
-#ifndef __CVC4_EXCEPTION_H
-#define __CVC4_EXCEPTION_H
+#ifndef __CVC4__EXCEPTION_H
+#define __CVC4__EXCEPTION_H
#include <string>
#include <iostream>
namespace CVC4 {
- class Exception {
- protected:
- std::string d_msg;
- public:
- // Constructors
- Exception(): d_msg("Unknown exception") { }
- Exception(const std::string& msg): d_msg(msg) { }
- Exception(const char* msg): d_msg(msg) { }
- // Destructor
- virtual ~Exception() { }
- // NON-VIRTUAL METHODs for setting and printing the error message
- void setMessage(const std::string& msg) { d_msg = msg; }
- // Printing: feel free to redefine toString(). When inherited,
- // it's recommended that this method print the type of exception
- // before the actual message.
- virtual std::string toString() const { return d_msg; }
- // No need to overload operator<< for the inherited classes
- friend std::ostream& operator<<(std::ostream& os, const Exception& e);
-
- }; // end of class Exception
-
- inline std::ostream& operator<<(std::ostream& os, const Exception& e) {
- return os << e.toString();
- }
+class Exception {
+protected:
+ std::string d_msg;
+public:
+ // Constructors
+ Exception(): d_msg("Unknown exception") { }
+ Exception(const std::string& msg): d_msg(msg) { }
+ Exception(const char* msg): d_msg(msg) { }
+ // Destructor
+ virtual ~Exception() { }
+ // NON-VIRTUAL METHODs for setting and printing the error message
+ void setMessage(const std::string& msg) { d_msg = msg; }
+ // Printing: feel free to redefine toString(). When inherited,
+ // it's recommended that this method print the type of exception
+ // before the actual message.
+ virtual std::string toString() const { return d_msg; }
+ // No need to overload operator<< for the inherited classes
+ friend std::ostream& operator<<(std::ostream& os, const Exception& e);
+
+}; // end of class Exception
+
+inline std::ostream& operator<<(std::ostream& os, const Exception& e) {
+ return os << e.toString();
+}
}/* CVC4 namespace */
-#endif /* __CVC4_EXCEPTION_H */
+#endif /* __CVC4__EXCEPTION_H */
**
**/
-#ifndef __CVC4_LITERAL_H
-#define __CVC4_LITERAL_H
+#ifndef __CVC4__LITERAL_H
+#define __CVC4__LITERAL_H
namespace CVC4 {
}/* CVC4 namespace */
-#endif /* __CVC4_LITERAL_H */
+#endif /* __CVC4__LITERAL_H */
**
**/
-#ifndef __CVC4_MODEL_H
-#define __CVC4_MODEL_H
+#ifndef __CVC4__MODEL_H
+#define __CVC4__MODEL_H
namespace CVC4 {
}/* CVC4 namespace */
-#endif /* __CVC4_MODEL_H */
+#endif /* __CVC4__MODEL_H */
-#ifndef __CVC4_OPTIONS_H
-#define __CVC4_OPTIONS_H
+#ifndef __CVC4__OPTIONS_H
+#define __CVC4__OPTIONS_H
namespace CVC4 {
}/* CVC4 namespace */
-#endif /* __CVC4_OPTIONS_H */
+#endif /* __CVC4__OPTIONS_H */
**
**/
-#ifndef __CVC4_RESULT_H
-#define __CVC4_RESULT_H
+#ifndef __CVC4__RESULT_H
+#define __CVC4__RESULT_H
namespace CVC4 {
}/* CVC4 namespace */
-#endif /* __CVC4_RESULT_H */
+#endif /* __CVC4__RESULT_H */
**
**/
-#ifndef __CVC4_UNIQUE_ID_H
-#define __CVC4_UNIQUE_ID_H
+#ifndef __CVC4__UNIQUE_ID_H
+#define __CVC4__UNIQUE_ID_H
namespace CVC4 {
template <class T>
unsigned UniqueID<T>::s_topID = 0;
-} /* CVC4 namespace */
+}/* CVC4 namespace */
-#endif /* __CVC4_UNIQUE_ID_H */
+#endif /* __CVC4__UNIQUE_ID_H */
--- /dev/null
+if HAVE_CXXTESTGEN
+
+AM_CPPFLAGS = -I. "-I$(CXXTEST)" "-I@top_srcdir@/src/include" "-I@top_srcdir@/src"
+AM_CXXFLAGS = -fno-access-control
+AM_LDFLAGS = -L@top_builddir@/src/libcvc4.a
+TESTS = \
+ expr/expr_black \
+ expr/expr_white
+
+%.cpp: %.h
+ $(CXXTESTGEN) --have-eh --have-std --error-printer -o $@ $<
+%: %.cpp
+ $(CXX) $(TEST_CPPFLAGS) $(AM_CPPFLAGS) $(TEST_CXXFLAGS) $(AM_CXXFLAGS) -o $@ $(TEST_LDFLAGS) $(AM_LDFLAGS) $< @top_builddir@/src/libcvc4.a
+
+MOSTLYCLEANFILES = $(TESTS) $(TESTS:%=%.cpp)
+
+else
+
+# force a user-visible failure for "make check"
+TESTS = no_cxxtest
+
+endif
+
--- /dev/null
+/* Black box testing of CVC4::Expr. */
+
+#include <cxxtest/TestSuite.h>
+
+#include "cvc4_expr.h"
+
+using namespace CVC4;
+
+class ExprBlack : public CxxTest::TestSuite {
+public:
+
+ void testNull() {
+ Expr::s_null;
+ }
+
+ void testCopyCtor() {
+ Expr e(Expr::s_null);
+ }
+};
--- /dev/null
+/* White box testing of CVC4::Expr. */
+
+#include <cxxtest/TestSuite.h>
+
+#include "cvc4_expr.h"
+
+using namespace CVC4;
+
+class ExprWhite : public CxxTest::TestSuite {
+public:
+
+ void testNull() {
+ Expr::s_null;
+ }
+
+ void testCopyCtor() {
+ Expr e(Expr::s_null);
+ }
+};
--- /dev/null
+#!/bin/sh
+
+echo
+echo '***************************************************************************'
+echo '* *'
+echo '* ERROR: CxxTest was not found at configure-time; tests cannot be run. *'
+echo '* *'
+echo '***************************************************************************'
+echo
+
+exit 1
+