Add abc to build id and fix static building.
Add abc to --show-config output and Configuration class API.
Add ability to select abc source path.
Fix arch_flags for abc.
exit 1; \
fi
./autogen.sh
- ./configure competition --disable-shared --enable-static-binary --with-cln --with-glpk --with-abc --enable-gpl
+ ./configure competition --disable-shared --enable-static-binary --with-cln --with-glpk --with-abc --without-readline --enable-gpl
$(MAKE)
strip builds/bin/cvc4
$(MAKE) check
exit 1; \
fi
./autogen.sh
- ./configure competition --disable-shared --enable-static-binary --with-cln --with-glpk --with-abc --enable-gpl CXXFLAGS=-DCVC4_SMTCOMP_APPLICATION_TRACK CFLAGS=-DCVC4_SMTCOMP_APPLICATION_TRACK
+ ./configure competition --disable-shared --enable-static-binary --with-cln --with-glpk --with-abc --without-readline --enable-gpl CXXFLAGS=-DCVC4_SMTCOMP_APPLICATION_TRACK CFLAGS=-DCVC4_SMTCOMP_APPLICATION_TRACK
$(MAKE)
strip builds/bin/cvc4
$(MAKE) check
exit 1; \
fi
./autogen.sh
- ./configure competition --disable-shared --enable-static-binary --with-gmp --with-portfolio --with-glpk --with-abc --enable-gpl
+ ./configure competition --disable-shared --enable-static-binary --with-gmp --with-portfolio --with-glpk --with-abc --without-readline --enable-gpl
$(MAKE)
strip builds/bin/pcvc4
# some test cases fail (and are known to fail)
--- /dev/null
+# CVC4_CHECK_FOR_ABC
+# ------------------
+# Look for abc and link it in, but only if user requested.
+AC_DEFUN([CVC4_CHECK_FOR_ABC], [
+AC_MSG_CHECKING([whether user requested abc support])
+LIBABC=
+have_libabc=0
+ABC_LIBS=
+if test "$with_abc" = no; then
+ AC_MSG_RESULT([no, abc disabled by user])
+elif test "$with_abc" = yes; then
+ AC_MSG_RESULT([yes, abc requested by user])
+
+ # Get the location of all the ABC stuff
+ AC_ARG_VAR(ABC_HOME, [path to top level of abc source tree])
+ AC_ARG_WITH(
+ [abc-dir],
+ AS_HELP_STRING(
+ [--with-abc-dir=PATH],
+ [path to top level of abc source tree]
+ ),
+ [ABC_HOME="$withval"],
+ [ if test -z "$ABC_HOME"; then
+ AC_MSG_FAILURE([must give --with-abc-dir=PATH or define environment variable ABC_HOME!])
+ fi
+ ]
+ )
+ if ! test -d "$ABC_HOME" || ! test -x "$ABC_HOME/arch_flags"; then
+ AC_MSG_FAILURE([either $ABC_HOME is not an abc source tree or it's not yet built])
+ fi
+
+ AC_MSG_CHECKING([for arch_flags to use with libabc])
+ libabc_arch_flags="$("$ABC_HOME/arch_flags")"
+ AC_MSG_RESULT([$libabc_arch_flags])
+ CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-I$ABC_HOME/src $libabc_arch_flags"
+ ABC_LDFLAGS="-L$ABC_HOME"
+
+ dnl Try a bunch of combinations until something works :-/
+ cvc4_save_LDFLAGS="$LDFLAGS"
+ ABC_LIBS=
+ CPPFLAGS="$CPPFLAGS -I$ABC_HOME/src $libabc_arch_flags"
+ LDFLAGS="$LDFLAGS $ABC_LDFLAGS"
+ AC_CHECK_HEADER([base/abc/abc.h], [], [AC_MSG_FAILURE([cannot find abc.h, the ABC header!])])
+ AC_MSG_CHECKING([how to link abc])
+ CVC4_TRY_ABC_WITH([])
+ CVC4_TRY_ABC_WITH([-lm])
+ CVC4_TRY_ABC_WITH([-lm -lrt])
+ CVC4_TRY_ABC_WITH([-lm -lrt -ldl])
+ CVC4_TRY_ABC_WITH([-lm -lrt -lreadline -ldl])
+ CVC4_TRY_ABC_WITH([-lm -lpthread])
+ CVC4_TRY_ABC_WITH([-lm -lpthread -lrt])
+ CVC4_TRY_ABC_WITH([-lm -lpthread -lrt -ldl])
+ CVC4_TRY_ABC_WITH([-lm -lpthread -lrt -lreadline -ldl])
+ dnl CVC4_TRY_ABC_WITH([-lm -rdynamic -lreadline -lpthread -lrt -ldl])
+ if test -z "$ABC_LIBS"; then
+ AC_MSG_FAILURE([cannot link against libabc!])
+ else
+ AC_MSG_RESULT([$ABC_LIBS])
+ # make sure it works in static builds, too
+ if test "$enable_static_binary" = yes; then
+ ABC_LIBS=
+ AC_MSG_CHECKING([whether statically-linked abc is functional])
+ CVC4_TRY_STATIC_ABC_WITH([])
+ CVC4_TRY_STATIC_ABC_WITH([-lm])
+ CVC4_TRY_STATIC_ABC_WITH([-lm -lrt])
+ CVC4_TRY_STATIC_ABC_WITH([-lm -lrt -ldl])
+ CVC4_TRY_STATIC_ABC_WITH([-lm -lrt -lreadline -ldl])
+ CVC4_TRY_STATIC_ABC_WITH([-lm -lpthread])
+ CVC4_TRY_STATIC_ABC_WITH([-lm -lpthread -lrt])
+ CVC4_TRY_STATIC_ABC_WITH([-lm -lpthread -lrt -ldl])
+ CVC4_TRY_STATIC_ABC_WITH([-lm -lpthread -lrt -lreadline -ldl])
+ if test -n "$ABC_LIBS"; then
+ AC_MSG_RESULT([yes, it works])
+ with_abc=yes
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([abc installation appears incompatible with static-binary])
+ fi
+ else
+ with_abc=yes
+ fi
+ fi
+ if test "$with_abc" = yes; then
+ have_libabc=1
+ else
+ with_abc=no
+ have_libreadline=0
+ ABC_LIBS=
+ fi
+ LDFLAGS="$cvc4_save_LDFLAGS"
+else
+ AC_MSG_RESULT([no, user didn't request abc])
+ with_abc=no
+fi
+])# CVC4_CHECK_FOR_ABC
+
+# CVC4_TRY_ABC_WITH(LIBS)
+# -----------------------
+# Try AC_CHECK_LIB(abc) with the given linking libraries
+AC_DEFUN([CVC4_TRY_ABC_WITH], [
+if test -z "$ABC_LIBS"; then
+ AC_LANG_PUSH([C++])
+ cvc4_save_LIBS="$LIBS"
+ LIBS="-labc $1"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([extern "C" { void Abc_Start(); }],
+ [Abc_Start()])],
+ [ABC_LIBS="-labc $1"],
+ [])
+ LIBS="$cvc4_save_LIBS"
+ AC_LANG_POP([C++])
+fi
+])# CVC4_TRY_ABC_WITH
+
+# CVC4_TRY_STATIC_ABC_WITH(LIBS)
+# ------------------------------
+# Try AC_CHECK_LIB(abc) with the given linking libraries
+AC_DEFUN([CVC4_TRY_STATIC_ABC_WITH], [
+if test -z "$ABC_LIBS"; then
+ AC_LANG_PUSH([C++])
+ cvc4_save_LIBS="$LIBS"
+ cvc4_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="-static $LDFLAGS"
+ LIBS="-labc-static $1"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([extern "C" { void Abc_Start(); }],
+ [Abc_Start()])],
+ [ABC_LIBS="-labc-static $1"],
+ [ LIBS="-labc $1"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([extern "C" { void Abc_Start(); }],
+ [Abc_Start()])],
+ [ABC_LIBS="-labc $1"]) ])
+ LIBS="$cvc4_save_LIBS"
+ LDFLAGS="$cvc4_save_LDFLAGS"
+ AC_LANG_POP([C++])
+fi
+])# CVC4_TRY_STATIC_ABC_WITH
# Also you can specify "cln" or "gmp". If "gmp", the build dir
# contains the string "gmp". (gmp is considered the default.)
#
-# Also for glpk.
+# Also for glpk and abc.
#
if [ $# -eq 0 ]; then
done
build_type_suffix=
-for arg in cln glpk staticbinary optimized proof debugsymbols statistics replay assertions tracing muzzle coverage profiling; do
+for arg in cln glpk abc staticbinary optimized proof debugsymbols statistics replay assertions tracing muzzle coverage profiling; do
if eval [ -n '"${'$arg'+set}"' ]; then
if eval [ '"${'$arg'}"' -eq 0 ]; then
build_type_suffix=$build_type_suffix-no$arg
if expr "$ac_option" : '.*-glpk' >/dev/null || expr "$ac_option" : '.*-glpk-' >/dev/null; then
eval 'ac_cvc4_rewritten_args="${ac_cvc4_rewritten_args+$ac_cvc4_rewritten_args }\"--with-glpk\""'
fi
+ if expr "$ac_option" : '.*-noabc' >/dev/null || expr "$ac_option" : '.*-noabc-' >/dev/null; then
+ eval 'ac_cvc4_rewritten_args="${ac_cvc4_rewritten_args+$ac_cvc4_rewritten_args }\"--without-abc\""'
+ fi
+ if expr "$ac_option" : '.*-abc' >/dev/null || expr "$ac_option" : '.*-abc-' >/dev/null; then
+ eval 'ac_cvc4_rewritten_args="${ac_cvc4_rewritten_args+$ac_cvc4_rewritten_args }\"--with-abc\""'
+ fi
for x in cln gmp; do
if expr "$ac_option" : '.*-no'$x'$' >/dev/null || expr "$ac_option" : '.*-no'$x'-' >/dev/null; then
eval 'ac_cvc4_rewritten_args="${ac_cvc4_rewritten_args+$ac_cvc4_rewritten_args }\"--without-$x\""'
if test -z "${with_build+set}"; then
with_build=production
fi
-if test -z "${enable_optimized+set}" -a -z "${enable_debug_symbols+set}" -a -z "${enable_assertions+set}" -a -z "${enable_tracing+set}" -a -z "${enable_dumping+set}" -a -z "${enable_muzzle+set}" -a -z "${enable_coverage+set}" -a -z "${enable_profiling+set}" -a -z "${enable_statistics+set}" -a -z "${enable_replay+set}" -a -z "${with_gmp+set}" -a -z "${with_cln+set}" -a -z "${with_glpk+set}"; then
+if test -z "${enable_optimized+set}" -a -z "${enable_debug_symbols+set}" -a -z "${enable_assertions+set}" -a -z "${enable_tracing+set}" -a -z "${enable_dumping+set}" -a -z "${enable_muzzle+set}" -a -z "${enable_coverage+set}" -a -z "${enable_profiling+set}" -a -z "${enable_statistics+set}" -a -z "${enable_replay+set}" -a -z "${with_gmp+set}" -a -z "${with_cln+set}" -a -z "${with_glpk+set}" -a -z "${with_abc+set}"; then
custom_build_profile=no
else
custom_build_profile=yes
btargs="$btargs glpk"
fi
fi
+if test -n "${with_abc+set}"; then
+ if test "$with_abc" = yes; then
+ btargs="$btargs abc"
+ fi
+fi
AC_MSG_RESULT([$with_build])
AM_INIT_AUTOMAKE([1.11 no-define tar-pax parallel-tests color-tests subdir-objects])
]
)
-# [chris 8/24/2010] --with-gmp has no practical effect, since GMP is
-# the default. Could be useful if other options are added later.
-
AC_ARG_WITH(
[gmp],
AS_HELP_STRING(
AM_CONDITIONAL([CVC4_USE_GLPK], [test $have_libglpk -eq 1])
AC_SUBST([GLPK_LIBS])
-AC_ARG_WITH(
- [abc],
- AS_HELP_STRING(
- [--with-abc],
- [use the ABC AIG library]
- ),
- [case "$withval" in
- y|ye|yes|Y|YE|YES) cvc4_use_abc=1 ;;
- n|no|N|NO) cvc4_use_abc=0 ;;
- esac
- ]
-)
-
-if test $cvc4_use_abc -eq 1; then
- # must add dl and pthread separately and before abc
- AC_CHECK_LIB(dl, dlopen, , [AC_MSG_ERROR([dl not found])], [])
- AC_CHECK_LIB(pthread, pthread_create, , [AC_MSG_ERROR([pthread not found])], [])
- AC_CHECK_LIB(abc, Abc_Start, , [AC_MSG_ERROR([abc not found])], [-lm -ldl -rdynamic -lreadline -ltermcap -lpthread -lrt -ldl])
- AC_DEFINE_UNQUOTED(CVC4_USE_ABC, [], [Defined if linked against the ABC AIG library.])
+# Build with libabc (defined in config/abc.m4)
+AC_ARG_WITH([abc],
+ [AS_HELP_STRING([--with-abc],
+ [use the ABC AIG library])], [], [with_abc=])
+CVC4_CHECK_FOR_ABC
+if test $have_libabc -eq 1; then
+ CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_USE_ABC"
fi
+AM_CONDITIONAL([CVC4_USE_ABC], [test $have_libabc -eq 1])
+AC_SUBST([ABC_LDFLAGS])
+AC_SUBST([ABC_LIBS])
# Check to see if this version/architecture of GNU C++ explicitly
# instantiates __gnu_cxx::hash<uint64_t> or not. Some do, some don't.
CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }${BOOST_CPPFLAGS:+$BOOST_CPPFLAGS }$CVC4CPPFLAGS"
CXXFLAGS="${CXXFLAGS:+$CXXFLAGS }$CVC4CXXFLAGS -Wno-deprecated"
CFLAGS="${CFLAGS:+$CFLAGS }$CVC4CFLAGS -Wno-deprecated -fexceptions"
-LDFLAGS="${LDFLAGS:+$LDFLAGS }$CVC4LDFLAGS -ldl"
+LDFLAGS="${LDFLAGS:+$LDFLAGS }$CVC4LDFLAGS"
# visibility flag not supported for Windows builds
# also increase default stack size for Windows binaries
MP library : $mplibrary
GLPK : $with_glpk
+ABC : $with_abc
Readline : $with_readline
CPPFLAGS : $CPPFLAGS
-#!/bin/bash -x
+#!/bin/bash
#
set -e
cp src/base/main/main.c src/base/main/main.c.orig
sed 's,^// *#define ABC_LIB *$,#define ABC_LIB,' src/base/main/main.c.orig > src/base/main/main.c
-make libabc.a OPTFLAGS=-O
+# Build optimized, without readline, without pthreads.
+# These aren't necessary for our usage and we don't want the dependencies.
+make libabc.a OPTFLAGS=-O READLINE=0 PTHREADS=0
mv libabc.a libabc-static.a
make clean
-make libabc.a OPTFLAGS='-O -fPIC'
+make libabc.a OPTFLAGS='-O -fPIC' READLINE=0 PTHREADS=0
echo
echo ===================== Now configure CVC4 with =====================
-echo ./configure --with-abc=`pwd`
+echo ./configure --with-abc --with-abc-dir=`pwd`
libcvc4_la_LIBADD += $(GLPK_LIBS)
endif
+if CVC4_USE_ABC
+libcvc4_la_LIBADD += $(ABC_LIBS)
+libcvc4_la_LDFLAGS += $(ABC_LDFLAGS)
+endif
+
BUILT_SOURCES = \
theory/rewriter_tables.h \
theory/theory_traits.h \
printf("\n");
printf("cudd : %s\n", Configuration::isBuiltWithCudd() ? "yes" : "no");
printf("cln : %s\n", Configuration::isBuiltWithCln() ? "yes" : "no");
- printf("glpk : %s\n", Configuration::isBuiltWithGlpk() ? "yes" : "no");
printf("gmp : %s\n", Configuration::isBuiltWithGmp() ? "yes" : "no");
+ printf("glpk : %s\n", Configuration::isBuiltWithGlpk() ? "yes" : "no");
+ printf("abc : %s\n", Configuration::isBuiltWithAbc() ? "yes" : "no");
printf("tls : %s\n", Configuration::isBuiltWithTlsSupport() ? "yes" : "no");
exit(0);
}
for(int t = 0; t < numThreads; ++t) {
if(optionWaitToJoin) {
threads[t].join();
- }
+ }
}
std::pair<int, S> retval(global_winner, threads_returnValue[global_winner]);
void bvToBool();
// Abstract common structure over small domains to UF
- // return true if changes were made.
- void bvAbstraction();
-
+ // return true if changes were made.
+ void bvAbstraction();
+
// Simplify ITE structure
bool simpITE();
Notice() << "SmtEngine: turning off incremental to support eager bit-blasting" << endl;
setOption("incremental", SExpr("false"));
}
-
+
if (! options::bvEagerExplanations.wasSetByUser() &&
d_logic.isTheoryEnabled(THEORY_ARRAY) &&
d_logic.isTheoryEnabled(THEORY_BV)) {
options::bvEagerExplanations.set(true);
}
-
-
// Turn on arith rewrite equalities only for pure arithmetic
if(! options::arithRewriteEq.wasSetByUser()) {
bool arithRewriteEq = d_logic.isPure(THEORY_ARITH) && !d_logic.isQuantified();
d_assertionsToPreprocess[i] = Rewriter::rewrite(new_assertions[i]);
}
// if we are using the lazy solver and the abstraction
- // applies, then UF symbols were introduced
+ // applies, then UF symbols were introduced
if (options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY &&
changed) {
LogicRequest req(d_smt);
- req.widenLogic(THEORY_UF);
+ req.widenLogic(THEORY_UF);
}
}
// before ppRewrite check if only core theory for BV theory
d_smt.d_theoryEngine->staticInitializeBVOptions(d_assertionsToCheck);
-
+
// Theory preprocessing
if (d_smt.d_earlyTheoryPP) {
Chat() << "...doing early theory preprocessing..." << endl;
Debug("smt") << " d_assertionsToPreprocess: " << d_assertionsToPreprocess.size() << endl;
Debug("smt") << " d_assertionsToCheck : " << d_assertionsToCheck.size() << endl;
-
+
if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER &&
!d_smt.d_logic.isPure(THEORY_BV)) {
throw ModalException("Eager bit-blasting does not currently support theory combination. "
"Note that in a QF_BV problem UF symbols can be introduced for division. "
- "Try --bv-div-zero-const to interpret division by zero as a constant.");
+ "Try --bv-div-zero-const to interpret division by zero as a constant.");
}
if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) {
- d_smt.d_theoryEngine->mkAckermanizationAsssertions(d_assertionsToPreprocess);
+ d_smt.d_theoryEngine->mkAckermanizationAsssertions(d_assertionsToPreprocess);
}
-
if ( options::bvAbstraction() &&
!options::incrementalSolving()) {
bvAbstraction();
dumpAssertions("post-bv-abstraction", d_assertionsToPreprocess);
}
-
+
dumpAssertions("pre-boolean-terms", d_assertionsToPreprocess);
{
Chat() << "rewriting Boolean terms..." << endl;
bvToBool();
dumpAssertions("post-bv-to-bool", d_assertionsToPreprocess);
}
-
+
if( d_smt.d_logic.isTheoryEnabled(THEORY_STRINGS) ) {
dumpAssertions("pre-strings-pp", d_assertionsToPreprocess);
CVC4::theory::strings::StringsPreprocess sp;
if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) {
for (unsigned i = 0; i < d_assertionsToCheck.size(); ++i) {
Node eager_atom = NodeManager::currentNM()->mkNode(kind::BITVECTOR_EAGER_ATOM, d_assertionsToCheck[i]);
- d_assertionsToCheck[i] = eager_atom;
+ d_assertionsToCheck[i] = eager_atom;
}
}
-
+
// Push the formula to decision engine
if(noConflict) {
Chat() << "pushing to decision engine..." << endl;
dumpAssertions("post-everything", d_assertionsToCheck);
+ // Push the formula to SAT
{
Chat() << "converting to CNF..." << endl;
TimerStat::CodeTimer codeTimer(d_smt.d_stats->d_cnfConversionTime);
d_smt.d_propEngine->assertFormula(d_assertionsToCheck[i]);
}
}
-
d_assertionsProcessed = true;
** Major contributors: none
** Minor contributors (to current version): Liana Hadarean, Tim King, ACSYS, Christopher L. Conway, Dejan Jovanovic, Francois Bobot
** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2013 New York University and The University of Iowa
+ ** Copyright (c) 2009-2014 New York University and The University of Iowa
** See the file COPYING in the top-level source directory for licensing
** information.\endverbatim
**
return IS_GLPK_BUILD;
}
+bool Configuration::isBuiltWithAbc() {
+ return IS_ABC_BUILD;
+}
+
bool Configuration::isBuiltWithCudd() {
return false;
}
** Major contributors: none
** Minor contributors (to current version): ACSYS, Liana Hadarean, Tim King, Francois Bobot
** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2013 New York University and The University of Iowa
+ ** Copyright (c) 2009-2014 New York University and The University of Iowa
** See the file COPYING in the top-level source directory for licensing
** information.\endverbatim
**
static bool isBuiltWithGlpk();
+ static bool isBuiltWithAbc();
+
static bool isBuiltWithReadline();
static bool isBuiltWithCudd();
** Major contributors: ACSYS, Morgan Deters
** Minor contributors (to current version): Liana Hadarean, Tim King
** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2013 New York University and The University of Iowa
+ ** Copyright (c) 2009-2014 New York University and The University of Iowa
** See the file COPYING in the top-level source directory for licensing
** information.\endverbatim
**
# define IS_GLPK_BUILD false
#endif /* CVC4_USE_GLPK */
+#if CVC4_USE_ABC
+# define IS_ABC_BUILD true
+#else /* CVC4_USE_ABC */
+# define IS_ABC_BUILD false
+#endif /* CVC4_USE_ABC */
+
#ifdef HAVE_LIBREADLINE
# define IS_READLINE_BUILD true
#else /* HAVE_LIBREADLINE */