From: Morgan Deters Date: Fri, 2 Sep 2011 20:41:08 +0000 (+0000) Subject: Merge from my post-smtcomp branch. Includes: X-Git-Tag: cvc5-1.0.0~8484 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d18e5ebed9a5b20ed6a8fe21d11842acf6fa7ea;p=cvc5.git Merge from my post-smtcomp branch. Includes: Dumping infrastructure. Can dump preprocessed queries and clauses. Can also dump queries (for testing with another solver) to see if any conflicts are missed, T-propagations are missed, all lemmas are T-valid, etc. For a full list of options see --dump=help. CUDD building much cleaner. Documentation and assertion fixes. Printer improvements, printing of commands in language-defined way, etc. Typechecker stuff in expr package now autogenerated, no need to manually edit the expr package when adding a new theory. CVC3 compatibility layer (builds as libcompat). SWIG detection and language binding support (infrastructure). Support for some Z3 extended commands (like datatypes) in SMT-LIBv2 mode (when not in compliance mode). Copyright and file headers regenerated. --- diff --git a/INSTALL b/INSTALL deleted file mode 100644 index be1290c3c..000000000 --- a/INSTALL +++ /dev/null @@ -1,9 +0,0 @@ -To build, use the top-level script "autogen.sh" to invoke various -autotools. You'll need reasonably new automake, autoconf, and libtool -installed. Then ./configure && make as usual. - -To build a source release, use "make dist"; this will include the -configure script and all the bits of automake/autoconf/libtool that -are necessary for an independent install. - --- Morgan Deters Mon, 02 Nov 2009 17:54:27 -0500 diff --git a/Makefile.am b/Makefile.am index ecb9c6eda..5fb6ff9e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,9 +9,9 @@ SUBDIRS = src test contrib .PHONY: units systemtests regress regress0 regress1 regress2 regress3 systemtests regress regress0 regress1 regress2 regress3: all - (cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1 + +(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1 units: all - (cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1 + +(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1 LCOV = lcov GENHTML = genhtml @@ -29,7 +29,7 @@ if COVERAGE_ENABLED # work...) lcov: all $(LCOV) -z -d . - $(MAKE) check -C test/unit + +$(MAKE) check -C test/unit $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES) mkdir -p "@top_srcdir@/html" @@ -40,7 +40,7 @@ lcov: all lcov-all: all $(LCOV) -z -d . - $(MAKE) check -C test + +$(MAKE) check -C test $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES) mkdir -p "@top_srcdir@/html" @@ -53,7 +53,7 @@ lcov-all: all # modules/test-types; unfortunately lcov 1.8 directory paths # are broken(?) or at least different than 1.7 lcov18: all - @for testtype in public black white; do \ + +@for testtype in public black white; do \ echo; echo "=== Collecting coverage data from $$testtype unit tests ==="; \ echo $(LCOV) -z -d .; \ $(LCOV) -z -d . || exit 1; \ @@ -90,6 +90,18 @@ EXTRA_DIST = \ Makefile.subdir \ config/build-type \ config/mkbuilddir \ - config/doxygen.cfg + config/doxygen.cfg \ + doc/cvc4.1.in \ + doc/cvc4.5.in \ + doc/libcvc4.3.in \ + doc/libcvc4parser.3.in \ + doc/libcvc4compat.3.in +man_MANS = \ + doc/cvc4.1 \ + doc/cvc4.5 \ + doc/libcvc4.3 \ + doc/libcvc4parser.3 \ + doc/libcvc4compat.3 + dist-hook: cp -p "$(srcdir)/Makefile" "$(distdir)/Makefile" diff --git a/Makefile.builds.in b/Makefile.builds.in index e6d6e7bcd..2eec9c777 100644 --- a/Makefile.builds.in +++ b/Makefile.builds.in @@ -31,6 +31,9 @@ libdir = @libdir@ abs_builddir = @abs_builddir@ distdir = @PACKAGE@-@VERSION@ +# Are we building the libcvc4compat library ? +CVC4_BUILD_LIBCOMPAT = @CVC4_BUILD_LIBCOMPAT@ + # Are we building static/dynamic libraries/binaries? One or the other can be # on, or both. BUILDING_STATIC = @BUILDING_STATIC@ @@ -41,7 +44,7 @@ STATIC_BINARY = @STATIC_BINARY@ _default_build_: all all: # build the current build profile - (cd $(CURRENT_BUILD) && $(MAKE) $@) + +(cd $(CURRENT_BUILD) && $(MAKE) $@) # set up builds/$(CURRENT_BUILD)/...prefix.../bin # and builds/$(CURRENT_BUILD)/...prefix.../lib $(mkinstalldirs) "$(CURRENT_BUILD)$(bindir)" "$(CURRENT_BUILD)$(libdir)" @@ -53,6 +56,12 @@ all: $(CURRENT_BUILD)/libtool --mode=install install -v \ $(CURRENT_BUILD)/src/parser/libcvc4parser.la \ "$(abs_builddir)$(libdir)" +ifeq ($(CVC4_BUILD_LIBCOMPAT),yes) +# install libcvc4compat + $(CURRENT_BUILD)/libtool --mode=install install -v \ + $(CURRENT_BUILD)/src/compat/libcvc4compat.la \ + "$(abs_builddir)$(libdir)" +endif ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10) # if we're building shared libs and the binary is not static, relink # the handling with empty $relink_command is a hack for Mac OS @@ -85,6 +94,10 @@ endif $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/libcvc4.la "`pwd`$(libdir)" # install libcvc4parser $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/parser/libcvc4parser.la "`pwd`$(libdir)" +ifeq ($(CVC4_BUILD_LIBCOMPAT),yes) +# install libcvc4compat + $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/compat/libcvc4compat.la "`pwd`$(libdir)" +endif ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10) # if we're building shared libs and the binary is not static, relink # the handling with empty $relink_command is a hack for Mac OS @@ -109,31 +122,31 @@ endif test -e lib || ln -sfv ".$(libdir)" lib test -e bin || ln -sfv ".$(bindir)" bin -check test units regress: all - (cd $(CURRENT_BUILD)/test && $(MAKE) $@) +check test units systemtests regress: all + +(cd $(CURRENT_BUILD)/test && $(MAKE) $@) units%: - (cd $(CURRENT_BUILD)/test && $(MAKE) units TEST_PREFIX=$(subst units:,,$@)) + +(cd $(CURRENT_BUILD)/test && $(MAKE) units TEST_PREFIX=$(subst units:,,$@)) regress%: all - (cd $(CURRENT_BUILD)/test && $(MAKE) $@) + +(cd $(CURRENT_BUILD)/test && $(MAKE) $@) dist: - (cd $(CURRENT_BUILD) && $(MAKE) $@) + +(cd $(CURRENT_BUILD) && $(MAKE) $@) $(install_sh) \ $(CURRENT_BUILD)/$(distdir).tar.gz \ "`pwd`" TAGS tags: - (cd $(CURRENT_BUILD) && $(MAKE) $@) + +(cd $(CURRENT_BUILD) && $(MAKE) $@) ln -sf $(CURRENT_BUILD)/TAGS . .PHONY: TAGS tags .PHONY: doc-builds doc-prereq doc-builds: doc-prereq - (cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc) + +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc) doc-prereq: - (cd $(CURRENT_BUILD) && for dir in `find . -name Makefile | xargs grep -l BUILT_SOURCES`; do (cd `dirname "$$dir"`; (cat Makefile; echo 'doc-prereq: $$(BUILT_SOURCES)') | make -f- doc-prereq); done) + +(cd $(CURRENT_BUILD) && for dir in `find . -name Makefile | xargs grep -l BUILT_SOURCES`; do (cd `dirname "$$dir"`; (cat Makefile; echo 'doc-prereq: $$(BUILT_SOURCES)') | $(MAKE) -f- doc-prereq); done) # any other target than the default doesn't do the extra stuff above %: - (cd $(CURRENT_BUILD) && $(MAKE) $@) + +(cd $(CURRENT_BUILD) && $(MAKE) $@) diff --git a/README b/README index f3c38d2cb..562ae3938 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ -This is a prerelease version of CVC4; distribution is restricted. +This is a prerelease version of CVC4. -For a suggestion of editing CVC4 code with emacs, see README.emacs. +*** Quick-start instructions To build, you'll need reasonably new automake, autoconf, and libtool installed (see below). Execute, @@ -33,19 +33,32 @@ Optional: CLN v1.3 (Class Library for Numbers) Optional: CUDD v2.4.2 (Colorado University Decision Diagram package) Optional: GNU Readline library (for an improved interactive experience) -CUDD, if desired, must be installed in a special manner. The default -distribution from vlsi.colorado.edu doesn't build shared objects, -and names things that make it difficult to compose software -dependences (e.g. a "libutil" is distributed). So we packaged our -own version of cudd that changes only its build process, making it -play nicely with libtool and packaging all the various cudd libraries -into just a few. This version must be used for cvc4, and is available -from the CVC4 apt repository by dropping the following line into your -/etc/apt/sources.list: +CUDD, if desired, must be installed delicately. The CVC4 configure +script attempts to auto-detect the locations and names of CUDD headers +and libraries the way that the Fedora RPMs install them, the way that +our NYU-provided Debian packages install them, and the way they exist +when you download and build the CUDD sources directly. If you install +from Fedora RPMs or our Debian packages (remember, you need the C++ +development package for CVC4), the process should be completely +automatic, since the libraries and headers are installed in a standard +location. If you download the sources yourself, you need to build +them in a special way. Fortunately, the "contrib/build-cudd-with-libtool.sh" +script in the CVC4 source tree does exactly what you need: it patches +the CUDD makefiles to use libtool, builds the libtool libraries, then +reverses the patch to leave the makefiles as they were. Once you +run this script on an unpacked CUDD 2.4.2 source distribution, then +CVC4's configure script should pick up the libraries if you provide +--with-cudd-dir=/PATH/TO/CUDD/SOURCES. + +If you want to force linking to CUDD, provide --with-cudd to the +configure script; this makes it a hard requirement rather than an +optional add-on. + +The NYU-provided Debian packaging of CUDD 2.4.2 is here: deb http://goedel.cims.nyu.edu/cvc4-builds/debian unstable/ -The debian source package "cudd", available from the same repository, +The Debian source package "cudd", available from the same repository, includes a diff of all changes made to cudd makefiles. *** Build dependencies @@ -58,3 +71,7 @@ Autoconf v2.61 Libtool v2.2 ANTLR3 v3.2 +*** Emacs mode + +For a suggestion of editing CVC4 code with emacs, see README.emacs. + diff --git a/autogen.sh b/autogen.sh index 3f143a12c..2bbdd850b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -287,9 +287,9 @@ if [ "x$AUTOCONF_OPTIONS" = "x" ] ; then AUTOCONF_OPTIONS="-f" fi if [ "x$AUTOMAKE_OPTIONS" = "x" ] ; then - AUTOMAKE_OPTIONS="-a -c -f" + AUTOMAKE_OPTIONS="-a -c -f -Wno-portability" fi -ALT_AUTOMAKE_OPTIONS="-a -c" +ALT_AUTOMAKE_OPTIONS="-a -c -Wno-portability" if [ "x$LIBTOOLIZE_OPTIONS" = "x" ] ; then LIBTOOLIZE_OPTIONS="--automake -c -f" fi diff --git a/config/bindings.m4 b/config/bindings.m4 new file mode 100644 index 000000000..cdab33e3e --- /dev/null +++ b/config/bindings.m4 @@ -0,0 +1,102 @@ +# CVC4_SUPPORTED_BINDINGS +# ----------------------- +# Supported language bindings for CVC4. +AC_DEFUN([CVC4_SUPPORTED_BINDINGS], +[java,csharp,perl,php,python,ruby,tcl,ocaml]) + +# CVC4_CHECK_BINDINGS(DEFAULT_BINDINGS_LIST) +# ------------------------------------------ +# Check for user language binding preferences, and what is possible +# to build on the build host. +AC_DEFUN([CVC4_CHECK_BINDINGS], [ +dnl Check for SWIG (for building language bindings) +noswig=no + +m4_foreach(lang,[CVC4_SUPPORTED_BINDINGS], +[[cvc4_build_]]lang[[_bindings=no +]]) + +AC_ARG_VAR(SWIG, [SWIG binary (used to generate language bindings)]) +AC_ARG_WITH([swig], + [AS_HELP_STRING([--with-swig=BINARY], [path to swig binary])], + [if test "$withval" = no; then noswig=yes; else SWIG="$withval"; fi]) +AC_ARG_ENABLE([language-bindings], + [AS_HELP_STRING([--enable-language-bindings=][CVC4_SUPPORTED_BINDINGS], [specify language bindings to build])], + [cvc4_check_for_bindings=no; if test "$enableval" = no; then try_bindings=; else try_bindings="$enableval"; fi], + [cvc4_check_for_bindings=yes; try_bindings=]) +CVC4_LANGUAGE_BINDINGS= +if test "$noswig" = yes; then + AC_MSG_WARN([use of swig disabled by user.]) + SWIG= + if test "$cvc4_check_for_bindings" = no -a -n "$try_bindings"; then + AC_MSG_ERROR([language bindings requested by user, but swig disabled.]) + fi +else + if test -z "$SWIG"; then + AC_CHECK_PROGS(SWIG, swig, swig, []) + else + AC_CHECK_PROG(SWIG, "$SWIG", "$SWIG", []) + fi + if test -z "$SWIG"; then + AC_MSG_WARN([language bindings disabled, swig not found.]) + if test "$cvc4_check_for_bindings" = no -a -n "$try_bindings"; then + AC_MSG_ERROR([language bindings requested by user, but swig disabled.]) + fi + else + AC_MSG_CHECKING([for requested user language bindings]) + if test "$cvc4_check_for_bindings" = yes; then + try_bindings='$1' + else + try_bindings=$(echo "$try_bindings" | sed 's/,/ /g') + fi + AC_MSG_RESULT([$try_bindings]) + JAVA_INCLUDES= + for binding in $try_bindings; do + binding_error=no + AC_MSG_CHECKING([for availability of $binding binding]) + case "$binding" in + c++) AC_MSG_RESULT([C++ is built by default]);; + java) + JAVA_INCLUDES="-I/usr/lib/jvm/java-6-sun-1.6.0.26/include -I/usr/lib/jvm/java-6-sun-1.6.0.26/include/linux" + cvc4_build_java_binding=yes + AC_MSG_RESULT([Java support will be built]);; + csharp) + binding_error=yes + AC_MSG_RESULT([$binding not supported yet]);; + perl) + binding_error=yes + AC_MSG_RESULT([$binding not supported yet]);; + php) + binding_error=yes + AC_MSG_RESULT([$binding not supported yet]);; + python) + binding_error=yes + AC_MSG_RESULT([$binding not supported yet]);; + ruby) + binding_error=yes + AC_MSG_RESULT([$binding not supported yet]);; + tcl) + binding_error=yes + AC_MSG_RESULT([$binding not supported yet]);; + ocaml) + binding_error=yes + AC_MSG_RESULT([$binding not supported yet]);; + *) AC_MSG_RESULT([unknown binding]); binding_error=yes;; + esac + if test "$binding_error" = yes -a "$cvc4_check_for_bindings" = no; then + AC_MSG_ERROR([Language binding \`$binding' requested by user, but it cannot be built.]) + fi + CVC4_LANGUAGE_BINDINGS="${CVC4_LANGUAGE_BINDINGS:+$CVC4_LANGUAGE_BINDINGS }$binding" + done + fi +fi + +m4_foreach([lang], [CVC4_SUPPORTED_BINDINGS], +[AM_CONDITIONAL([CVC4_LANGUAGE_BINDING_]m4_toupper(lang), [test "$cvc4_build_]lang[_bindings" = yes]) +])dnl + +AC_SUBST(SWIG) +AC_SUBST(JAVA_INCLUDES) +AC_SUBST(CVC4_LANGUAGE_BINDINGS) + +])# CVC4_CHECK_BINDINGS diff --git a/config/cudd.m4 b/config/cudd.m4 new file mode 100644 index 000000000..7a569a3e9 --- /dev/null +++ b/config/cudd.m4 @@ -0,0 +1,116 @@ +# CVC4_CHECK_CUDD +# --------------- +# Check for CUDD libraries and headers. Complicated because different +# packagers have packaged it differently. +AC_DEFUN([CVC4_CHECK_CUDD], [ +CUDD_CPPFLAGS= +CUDD_LDFLAGS= +CUDD_LIBS= +cvc4cudd=no +AC_MSG_CHECKING([whether user requested CUDD support]) +AC_ARG_WITH([cudd], + [AS_HELP_STRING([--with-cudd], [force linking/not linking against CUDD])], + [with_cudd_set=yes], + [with_cudd=check; with_cudd_set=no]) +AC_ARG_WITH([cudd-dir], + [AS_HELP_STRING([--with-cudd-dir=DIR], [path to cudd installation])], + [CUDD_DIR="$withval"], + [if test "$with_cudd_set" = yes -a "$with_cudd" != yes -a "$with_cudd" != no -a "$with_cudd" != check; then + dnl maybe the user gave --with-cudd=DIR ? + CUDD_DIR="$with_cudd" + with_cudd=yes + fi]) +if test -n "$CUDD_DIR" -a "$with_cudd_set" = no; then + dnl if --with-cudd-dir or CUDD_DIR given, force --with-cudd + dnl unless --with-cudd=... given explicitly + with_cudd=yes +fi +if test "$with_cudd" = no; then + AC_MSG_RESULT([no, CUDD disabled by user]) +else + if test "$with_cudd" = check; then + AC_MSG_RESULT([no preference by user, will auto-detect]) + else + AC_MSG_RESULT([yes, CUDD enabled by user]) + fi + if test -z "$CUDD_DIR"; then + dnl default location if unspecified + CUDD_DIR=/usr + fi + AC_MSG_CHECKING([for C++ cudd includes under $CUDD_DIR]) + result="not found" + cvc4save_CPPFLAGS="$CPPFLAGS" + AC_LANG_PUSH([C++]) + for cuddinc in "$CUDD_DIR/include" "$CUDD_DIR/include/cudd" "$CUDD_DIR"; do + CPPFLAGS="$cvc4save_CPPFLAGS -I$cuddinc" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ +#include +#include "cuddObj.hh"], + [ +Cudd c; +BDD b = c.bddVar() | c.bddOne(); +])], + [ CUDD_CPPFLAGS="-I$cuddinc" + result="$cuddinc" + cvc4cudd=yes + break + ]) + done + CPPFLAGS="$cvc4save_CPPFLAGS" + AC_MSG_RESULT([$result]) + if test $cvc4cudd = yes; then + AC_MSG_CHECKING([for C++ cudd libraries under $CUDD_DIR]) + cvc4cudd=no + result="not found" + cvc4save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $CUDD_CPPFLAGS" + cvc4save_LDFLAGS="$LDFLAGS" + cvc4save_LIBS="$LIBS" + cvc4save_ac_link="$ac_link" + ac_link="libtool --mode=link $ac_link" + dnl This is messy. We try to find Fedora packages, Debian packages, and + dnl a built CUDD source directory. We can't -lutil or -lst because these + dnl names of CUDD libraries conflict with other libraries commonly + dnl installed. So we fall back to naming them directly. The CUDD + dnl sources build static libs only, so we go with that. + for cuddlibdirs in "-L$CUDD_DIR/lib" "-L$CUDD_DIR/lib/cudd" "-L$CUDD_DIR"; do + for cuddlibs in -lcuddxx -lcuddobj; do + LDFLAGS="$cvc4save_LDFLAGS $cuddlibdirs" + LIBS="$cvc4save_LIBS $cuddlibs" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([ +#include +#include "cuddObj.hh"], + [ +Cudd c; +BDD b = c.bddVar() | c.bddOne(); +])], + [ CUDD_LDFLAGS="$cuddlibdirs" + CUDD_LIBS="$cuddlibs" + result="$cuddlibdirs $cuddlibs" + cvc4cudd=yes + break + ]) + done + if test -n "$CUDD_LDFLAGS"; then break; fi + done + CPPFLAGS="$cvc4save_CPPFLAGS" + LDFLAGS="$cvc4save_LDFLAGS" + LIBS="$cvc4save_LIBS" + ac_link="$cvc4save_ac_link" + AC_MSG_RESULT([$result]); + if test $cvc4cudd = yes; then + AC_DEFINE_UNQUOTED(CVC4_CUDD, [], [Defined if using the CU Decision Diagram package (cudd).]) + fi + fi + AC_LANG_POP([C++]) +fi +AC_SUBST([CUDD_CPPFLAGS]) +AC_SUBST([CUDD_LDFLAGS]) +AC_SUBST([CUDD_LIBS]) + +if test "$with_cudd" = yes -a "$cvc4cudd" = no; then + AC_ERROR([--with-cudd was given, but cudd not available]) +fi +])# CVC4_CHECK_CUDD diff --git a/config/cvc4.m4 b/config/cvc4.m4 index c58d976b5..4adc88c61 100644 --- a/config/cvc4.m4 +++ b/config/cvc4.m4 @@ -22,8 +22,9 @@ do # regexp `\?' not supported on Mac OS X ac_option_build=`expr "$ac_option" : '\([[^-]]*\)-\{0,1\}'` ac_cvc4_build_profile_set=yes + as_me=configure AC_MSG_NOTICE([CVC4: building profile $ac_option_build]) - for x in optimized statistics replay assertions tracing muzzle coverage profiling; do + for x in optimized statistics replay assertions tracing dumping muzzle coverage profiling; 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 }\"--disable-$x\""' fi diff --git a/config/doxygen.cfg b/config/doxygen.cfg index 65d3c3103..6787ea7f9 100644 --- a/config/doxygen.cfg +++ b/config/doxygen.cfg @@ -302,12 +302,12 @@ EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. -EXTRACT_PRIVATE = YES +EXTRACT_PRIVATE = $(DOXYGEN_EXTRACT_PRIVATE) # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. -EXTRACT_STATIC = YES +EXTRACT_STATIC = $(DOXYGEN_EXTRACT_STATIC) # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. diff --git a/config/mkbuilddir b/config/mkbuilddir index ddec67023..87cd3460e 100755 --- a/config/mkbuilddir +++ b/config/mkbuilddir @@ -21,23 +21,24 @@ fi target=$1 build_type=$2 +: ${as_me:=mkbuilddir} : ${as_echo:=echo} : ${RM:=rm -f} : ${MKDIR_P:=mkdir -p} : ${LN_S:=ln -s} -$as_echo "Setting up builds/$target/$build_type..." +$as_echo "$as_me: Setting up builds/$target/$build_type..." $RM config.log config.status confdefs.h builds/Makefile $MKDIR_P "builds/$target/$build_type" $LN_S "$target/$build_type/Makefile.builds" builds/Makefile -$as_echo "Creating builds/current..." +$as_echo "$as_me: Creating builds/current..." (echo "# This is the most-recently-configured CVC4 build"; \ echo "# 'make' in the top-level source directory applies to this build"; \ echo "CURRENT_BUILD = $target/$build_type") > builds/current for dir in src test; do - $as_echo "Linking builds/$dir..." + $as_echo "$as_me: Linking builds/$dir..." $RM "builds/$dir" $LN_S "$target/$build_type/$dir" "builds/$dir" done diff --git a/configure.ac b/configure.ac index 192bfcff2..1b23bf1f0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,11 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -m4_define(_CVC4_MAJOR, 0 ) dnl version (major) -m4_define(_CVC4_MINOR, 0 ) dnl version (minor) -m4_define(_CVC4_RELEASE, 0 ) dnl version (alpha) -m4_define(_CVC4_RELEASE_STRING, [prerelease]) dnl version string +m4_define(_CVC4_MAJOR, 0) dnl version (major) +m4_define(_CVC4_MINOR, 0) dnl version (minor) +m4_define(_CVC4_RELEASE, 0) dnl version (alpha) +m4_define(_CVC4_EXTRAVERSION, [prerelease]) dnl version (extra) +m4_define(_CVC4_RELEASE_STRING, _CVC4_MAJOR[.]_CVC4_MINOR[]m4_if(_CVC4_RELEASE,[0],,[.]_CVC4_RELEASE)_CVC4_EXTRAVERSION) dnl version string dnl Preprocess CL args. Defined in config/cvc4.m4 CVC4_AC_INIT @@ -21,6 +22,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) CVC4_MAJOR=_CVC4_MAJOR CVC4_MINOR=_CVC4_MINOR CVC4_RELEASE=_CVC4_RELEASE +CVC4_EXTRAVERSION=_CVC4_EXTRAVERSION CVC4_RELEASE_STRING=_CVC4_RELEASE_STRING # Libtool version numbers for libraries @@ -41,8 +43,10 @@ CVC4_RELEASE_STRING=_CVC4_RELEASE_STRING # For guidance on when to change the version number, refer to the # developer's guide. -CVC4_LIBRARY_VERSION=$CVC4_MAJOR:$CVC4_MINOR:$CVC4_RELEASE -CVC4_PARSER_LIBRARY_VERSION=$CVC4_MAJOR:$CVC4_MINOR:$CVC4_RELEASE +CVC4_LIBRARY_VERSION=0:0:0 +CVC4_PARSER_LIBRARY_VERSION=0:0:0 +CVC4_COMPAT_LIBRARY_VERSION=0:0:0 +CVC4_BINDINGS_LIBRARY_VERSION=0:0:0 # Using the AC_CANONICAL_* macros destroy the command line you get # from $@, which we want later for determining the build profile. So @@ -77,6 +81,8 @@ AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET +as_me=configure + if test "$enable_shared" = no -a "$user_specified_enable_or_disable_shared" = yes; then enable_static=yes fi @@ -90,7 +96,7 @@ AC_ARG_WITH([build], if test -z "${with_build+set}" -o "$with_build" = default; then with_build=default 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_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}"; 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}"; then custom_build_profile=no else custom_build_profile=yes @@ -131,6 +137,13 @@ if test -n "${enable_tracing+set}"; then btargs="$btargs notracing" fi fi +if test -n "${enable_dumping+set}"; then + if test "$enable_dumping" = yes; then + btargs="$btargs dumping" + else + btargs="$btargs nodumping" + fi +fi if test -n "${enable_muzzle+set}"; then if test "$enable_muzzle" = yes; then btargs="$btargs muzzle" @@ -327,10 +340,12 @@ else AC_MSG_RESULT([this one (user-specified)]) fi +as_me=configure + # Unpack standard build types. Any particular options can be overriden with # --enable/disable-X options case "$with_build" in - production) # highly optimized, no assertions, no tracing + production) # highly optimized, no assertions, no tracing, dumping CVC4CPPFLAGS= CVC4CXXFLAGS= CVC4CFLAGS= @@ -343,9 +358,10 @@ case "$with_build" in if test -z "${enable_replay+set}" ; then enable_replay=no ; fi if test -z "${enable_assertions+set}" ; then enable_assertions=no ; fi if test -z "${enable_tracing+set}" ; then enable_tracing=no ; fi + if test -z "${enable_dumping+set}" ; then enable_dumping=yes ; fi if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi ;; - debug) # unoptimized, debug symbols, assertions, tracing + debug) # unoptimized, debug symbols, assertions, tracing, dumping CVC4CPPFLAGS=-DCVC4_DEBUG CVC4CXXFLAGS='-fno-inline' CVC4CFLAGS='-fno-inline' @@ -357,9 +373,10 @@ case "$with_build" in if test -z "${enable_replay+set}" ; then enable_replay=yes ; fi if test -z "${enable_assertions+set}" ; then enable_assertions=yes ; fi if test -z "${enable_tracing+set}" ; then enable_tracing=yes ; fi + if test -z "${enable_dumping+set}" ; then enable_dumping=yes ; fi if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi ;; - default) # moderately optimized, assertions, tracing + default) # moderately optimized, assertions, tracing, dumping CVC4CPPFLAGS= CVC4CXXFLAGS= CVC4CFLAGS= @@ -372,9 +389,10 @@ case "$with_build" in if test -z "${enable_replay+set}" ; then enable_replay=yes ; fi if test -z "${enable_assertions+set}" ; then enable_assertions=yes ; fi if test -z "${enable_tracing+set}" ; then enable_tracing=yes ; fi + if test -z "${enable_dumping+set}" ; then enable_dumping=yes ; fi if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi ;; - competition) # maximally optimized, no assertions, no tracing, muzzled + competition) # maximally optimized, no assertions, no tracing, no dumping, muzzled CVC4CPPFLAGS='-DCVC4_COMPETITION_MODE' CVC4CXXFLAGS='-funroll-all-loops -fexpensive-optimizations -fno-enforce-eh-specs' CVC4CFLAGS='-funroll-all-loops -fexpensive-optimizations -fno-enforce-eh-specs' @@ -387,6 +405,7 @@ case "$with_build" in if test -z "${enable_replay+set}" ; then enable_replay=no ; fi if test -z "${enable_assertions+set}" ; then enable_assertions=no ; fi if test -z "${enable_tracing+set}" ; then enable_tracing=no ; fi + if test -z "${enable_dumping+set}" ; then enable_dumping=no ; fi if test -z "${enable_muzzle+set}" ; then enable_muzzle=yes ; fi if test -z "${user_specified_enable_or_disable_shared}"; then enable_shared=no; fi if test -z "${user_specified_enable_or_disable_static}"; then enable_static=yes; fi @@ -520,6 +539,21 @@ if test "$enable_tracing" = yes; then CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_TRACING" fi +AC_MSG_CHECKING([whether to do a dump-capable build of CVC4]) +AC_ARG_ENABLE([dumping], + [AS_HELP_STRING([--disable-dumping], + [remove all dumping code from CVC4])]) + +if test -z "${enable_dumping+set}"; then + enable_dumping=yes +fi + +AC_MSG_RESULT([$enable_dumping]) + +if test "$enable_dumping" = yes; then + CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_DUMPING" +fi + AC_MSG_CHECKING([whether to do a muzzled build of CVC4]) AC_ARG_ENABLE([muzzle], [AS_HELP_STRING([--enable-muzzle], @@ -603,11 +637,27 @@ fi # Check for ANTLR runantlr script (defined in config/antlr.m4) AC_PROG_ANTLR +# Doxygen configuration +AC_ARG_ENABLE([internals-documentation], + [AS_HELP_STRING([--enable-internals-documentation], + [build Doxygen documentation for static and private member functions])]) +if test "$enable_internals_documentation" = yes; then + DOXYGEN_EXTRACT_PRIVATE=YES + DOXYGEN_EXTRACT_STATIC=YES +else + DOXYGEN_EXTRACT_PRIVATE=NO + DOXYGEN_EXTRACT_STATIC=NO +fi +AC_SUBST([DOXYGEN_EXTRACT_PRIVATE]) +AC_SUBST([DOXYGEN_EXTRACT_STATIC]) + +DX_MAN_FEATURE(OFF) DX_PDF_FEATURE(OFF) DX_PS_FEATURE(OFF) DX_DOT_FEATURE(OFF) DX_INIT_DOXYGEN($PACKAGE_NAME, config/doxygen.cfg, $srcdir/doc) +AC_ARG_ENABLE([unit-testing], AS_HELP_STRING([--disable-unit-testing], [don't build support for unit testing, even if available]), , [enable_unit_testing=check]) AC_ARG_VAR(CXXTEST, [path to CxxTest installation]) AC_SUBST([CXXTEST]) @@ -631,7 +681,11 @@ AC_PATH_PROG(CXXTESTGEN, cxxtestgen.pl, [], [$CXXTEST:$PATH]) if test -z "$CXXTESTGEN"; then AC_PATH_PROG(CXXTESTGEN, cxxtestgen.py, [], [$CXXTEST:$PATH]) fi -if test -z "$CXXTESTGEN"; then +if test "$enable_unit_testing" = "no"; then + AC_MSG_NOTICE([unit tests disabled by user request.]) + CXXTESTGEN= + CXXTEST= +elif test -z "$CXXTESTGEN"; then AC_MSG_NOTICE([unit tests disabled, neither cxxtestgen.pl nor cxxtestgen.py found.]) elif test -z "$CXXTEST"; then CXXTEST=`dirname "$CXXTESTGEN"` @@ -650,6 +704,10 @@ elif test -z "$CXXTEST"; then fi fi +if test "$enable_unit_testing" = yes -a -z "$CXXTESTGEN"; then + AC_MSG_ERROR([--enable-unit-testing given but cxxtest not found.]) +fi + AM_CONDITIONAL([HAVE_CXXTESTGEN], [test -n "$CXXTESTGEN"]) AC_ARG_VAR(TEST_CPPFLAGS, [CPPFLAGS to use when testing (default=$CPPFLAGS)]) @@ -684,67 +742,18 @@ AC_SEARCH_LIBS([clock_gettime], [rt], [Defined to 1 if clock_gettime() is supported by the platform.])], [AC_LIBOBJ([clock_gettime])]) -CUDD_CPPFLAGS= -CUDD_LDFLAGS= -cvc4cudd=no -AC_MSG_CHECKING([whether user requested CUDD support]) -AC_ARG_WITH([cudd], [AS_HELP_STRING([--with-cudd], [force linking/not linking against CUDD])], [], [with_cudd=check]) -if test "$with_cudd" = no; then - AC_MSG_RESULT([no, CUDD disabled by user]) -else - if test "$with_cudd" = check; then - AC_MSG_RESULT([no preference by user, will auto-detect]) - else - AC_MSG_RESULT([yes, CUDD enabled by user]) - fi - AC_ARG_WITH([cudd-dir], - [AS_HELP_STRING([--with-cudd-dir=DIR], [path to cudd installation])], - [CUDD_DIR="$withval"]) - if test -z "$CUDD_DIR"; then - CUDD_DIR=/usr - fi - AC_MSG_CHECKING([for cudd includes under $CUDD_DIR]) - result="not found" - for cuddinc in "$CUDD_DIR/include" "$CUDD_DIR/include/cudd" "$CUDD_DIR"; do - if test -r "$cuddinc/cudd.h"; then - dnl TODO - should do a TRY_COMPILE instead - CUDD_CPPFLAGS="\"-I$cuddinc\"" - result="$cuddinc" - cvc4cudd=yes - break - fi - done - AC_MSG_RESULT([$result]) - if test $cvc4cudd = yes; then - AC_MSG_CHECKING([for cudd libraries under $CUDD_DIR]) - cvc4cudd=no - result="not found" - for cuddlib in "$CUDD_DIR/lib" "$CUDD_DIR/lib/cudd" "$CUDD_DIR"; do - if test -r "$cuddlib/libcuddxx.la"; then - dnl TODO - should do a TRY_LINK instead, that has the extra benefit - dnl of making sure both shared & static work - CUDD_LDFLAGS="\"-L$cuddlib\" -lcuddxx" - result="$cuddlib" - cvc4cudd=yes - break - fi - done - AC_MSG_RESULT([$result]); - if test $cvc4cudd = yes; then - AC_DEFINE_UNQUOTED(CVC4_CUDD, [], [Defined if using the CU Decision Diagram package (cudd).]) - fi - fi -fi -AC_SUBST([CUDD_CPPFLAGS]) -AC_SUBST([CUDD_LDFLAGS]) - -if test "$with_cudd" = yes -a "$cvc4cudd" = no; then - AC_ERROR([--with-cudd was given, but cudd not available]) -fi +# Check for the presence of CUDD libraries +CVC4_CHECK_CUDD # Check for antlr C++ runtime (defined in config/antlr.m4) AC_LIB_ANTLR +# Check for user preferences for language bindings to build, and for +# build support. The arg list is the default set if unspecified by +# the user (the actual built set is the subset that appears to be +# supported by the build host). +CVC4_CHECK_BINDINGS dnl ([java csharp perl php python ruby tcl ocaml]) + # Checks for header files. AC_CHECK_HEADERS([getopt.h unistd.h]) @@ -756,28 +765,19 @@ AC_CHECK_HEADERS([getopt.h unistd.h]) #AC_TYPE_UINT64_T #AC_TYPE_SIZE_T -# Whether to compile with google profiling tools -cvc4_use_google_perftools=0 -AC_ARG_WITH( - [google_perftools], - AS_HELP_STRING( - [--with-google-perftools], - [use Google Performance Tools] - ), - [if test "$withval" != no; then - cvc4_use_google_perftools=1 - fi - ] -) - -AC_MSG_CHECKING([whether to link in google perftools libraries]) -if test $cvc4_use_google_perftools = 1; then +# Whether to build compatibility library +CVC4_BUILD_LIBCOMPAT=yes +AC_ARG_WITH([compat], + AS_HELP_STRING([--with-compat], [build compatibility library (CVC3 API layer)]), + [if test "$withval" = no; then CVC4_BUILD_LIBCOMPAT=no; fi]) +AC_MSG_CHECKING([whether to build compatibility library (CVC3 API layer)]) +if test "$CVC4_BUILD_LIBCOMPAT" = yes; then AC_MSG_RESULT([yes]) - AC_CHECK_LIB([tcmalloc], [MallocExtension_GetAllocatedSize], , [AC_MSG_ERROR([cannot link google-perftools test program with -ltcmalloc])], [-lpthread]) - AC_CHECK_LIB([profiler], [ProfilerStart], , [AC_MSG_ERROR([cannot link google-perftools test program with -lprofiler])], [-lpthread]) else - AC_MSG_RESULT([no (user didn't request it)]) + AC_MSG_RESULT([no, disabled by user]) fi +AC_SUBST(CVC4_BUILD_LIBCOMPAT) +AM_CONDITIONAL([CVC4_BUILD_LIBCOMPAT], [test "$CVC4_BUILD_LIBCOMPAT" = yes]) # Check for availability of TLS support (e.g. __thread storage class) AC_MSG_CHECKING([whether to use compiler-supported TLS if available]) @@ -798,11 +798,27 @@ fi AC_SUBST([CVC4_TLS]) AC_SUBST([CVC4_TLS_SUPPORTED]) -# Checks for library functions. -# (empty) - -# Some definitions for config.h -# (empty) +# Whether to compile with google profiling tools +cvc4_use_google_perftools=0 +AC_ARG_WITH( + [google_perftools], + AS_HELP_STRING( + [--with-google-perftools], + [use Google Performance Tools] + ), + [if test "$withval" != no; then + cvc4_use_google_perftools=1 + fi + ] +) +AC_MSG_CHECKING([whether to link in google perftools libraries]) +if test $cvc4_use_google_perftools = 1; then + AC_MSG_RESULT([yes]) + AC_CHECK_LIB([tcmalloc], [MallocExtension_GetAllocatedSize], , [AC_MSG_ERROR([cannot link google-perftools test program with -ltcmalloc])], [-lpthread]) + AC_CHECK_LIB([profiler], [ProfilerStart], , [AC_MSG_ERROR([cannot link google-perftools test program with -lprofiler])], [-lpthread]) +else + AC_MSG_RESULT([no (user didn't request it)]) +fi # Prepare configure output @@ -817,10 +833,13 @@ AM_CONDITIONAL([COVERAGE_ENABLED], [test "$enable_coverage" = yes]) AC_SUBST(CVC4_LIBRARY_VERSION) AC_SUBST(CVC4_PARSER_LIBRARY_VERSION) +AC_SUBST(CVC4_COMPAT_LIBRARY_VERSION) +AC_SUBST(CVC4_BINDINGS_LIBRARY_VERSION) AC_DEFINE_UNQUOTED(CVC4_MAJOR, ${CVC4_MAJOR}, [Major component of the version of CVC4.]) AC_DEFINE_UNQUOTED(CVC4_MINOR, ${CVC4_MINOR}, [Minor component of the version of CVC4.]) AC_DEFINE_UNQUOTED(CVC4_RELEASE, ${CVC4_RELEASE}, [Release component of the version of CVC4.]) +AC_DEFINE_UNQUOTED(CVC4_EXTRAVERSION, ["${CVC4_EXTRAVERSION}"], [Extraversion component of the version of CVC4.]) AC_DEFINE_UNQUOTED(CVC4_RELEASE_STRING, ["${CVC4_RELEASE_STRING}"], [Full release string for CVC4.]) CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }$CVC4CPPFLAGS" @@ -863,6 +882,9 @@ fi AC_SUBST(CVC4_USE_CLN_IMP) AC_SUBST(CVC4_USE_GMP_IMP) +MAN_DATE=`date '+%B %Y'` +AC_SUBST(MAN_DATE) + AC_CONFIG_FILES([ Makefile.builds Makefile] @@ -873,6 +895,12 @@ CVC4_CONFIG_FILE_ONLY_IF_CHANGED([src/util/rational.h]) CVC4_CONFIG_FILE_ONLY_IF_CHANGED([src/util/integer.h]) CVC4_CONFIG_FILE_ONLY_IF_CHANGED([src/util/tls.h]) +CVC4_CONFIG_FILE_ONLY_IF_CHANGED([doc/cvc4.1]) +CVC4_CONFIG_FILE_ONLY_IF_CHANGED([doc/cvc4.5]) +CVC4_CONFIG_FILE_ONLY_IF_CHANGED([doc/libcvc4.3]) +CVC4_CONFIG_FILE_ONLY_IF_CHANGED([doc/libcvc4parser.3]) +CVC4_CONFIG_FILE_ONLY_IF_CHANGED([doc/libcvc4compat.3]) + AC_OUTPUT # Final information to the user @@ -889,6 +917,8 @@ fi support_unit_tests='cxxtest not found; unit tests not supported' if test -n "$CXXTEST"; then support_unit_tests='unit testing infrastructure enabled in build directory' +elif test "$enable_unit_testing" = no; then + support_unit_tests='unit testing disabled by user' fi if test "$enable_optimized" = yes; then @@ -912,6 +942,15 @@ else mplibrary='gmp (LGPL)' fi +CVC4_COMPAT_LIBRARY_VERSION_or_nobuild="$CVC4_COMPAT_LIBRARY_VERSION" +CVC4_BINDINGS_LIBRARY_VERSION_or_nobuild="$CVC4_BINDINGS_LIBRARY_VERSION" +if test "$CVC4_BUILD_LIBCOMPAT" = no; then + CVC4_COMPAT_LIBRARY_VERSION_or_nobuild="N/A" +fi +if test -z "$CVC4_LANGUAGE_BINDINGS"; then + CVC4_BINDINGS_LIBRARY_VERSION_or_nobuild="N/A" +fi + cat < Wed, 13 Jul 2011 18:03:11 -0400 +# + +cd "$(dirname "$0")" +if [ $# -ne 1 -o "$1" = -h -o "$1" = -help -o "$1" = --help ]; then + echo "usage: $(basename "$0") cudd-dir" >&2 + exit 1 +fi + +patch="$(pwd)/$(basename "$0")" +if [ ! -r "$patch" ]; then + echo "error: can't read patch at \`$patch'" >&2 + exit 1 +fi +cudd_dir="$1" + +arch=$(../config/config.guess | cut -f1 -d-) +case "$arch" in + i?86) XCFLAGS='-mtune=pentium4 -malign-double -DHAVE_IEEE_754 -DBSD' ;; + x86_64) XCFLAGS='-mtune=native -DHAVE_IEEE_754 -DBSD -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8' ;; + *) XCFLAGS= ;; +esac + +set -ex + +XCFLAGS="$XCFLAGS" + +version_info=0:0:0 + +prefix="$cudd_dir" +eprefix="$prefix" +bindir="$eprefix/bin" +datadir="$prefix/share" +includedir="$prefix/include" +libdir="$prefix/lib" +mandir="$datadir/man/man1" +docdir="$datadir/doc" + +cd "$cudd_dir" +patch -p1 < "$patch" +make "XCFLAGS=$XCFLAGS" "CC=libtool --mode=compile gcc" "CPP=libtool --mode=compile g++" libdir="$libdir" version_info="$version_info" DDDEBUG= MTRDEBUG= ICFLAGS=-O2 +mkdir -p "$libdir" +libtool --mode=install cp libcudd.la "$libdir/libcudd.la" +libtool --mode=install cp libcuddxx.la "$libdir/libcuddxx.la" +libtool --mode=install cp libdddmp.la "$libdir/libdddmp.la" +libtool --finish "$libdir" +patch -p1 -R < "$patch" +exit + +# patch follows + +--- a/Makefile ++++ b/Makefile +@@ -221,11 +221,16 @@ + + build: + sh ./setup.sh +- @for dir in $(DIRS); do \ ++ +@for dir in $(BDIRS) obj; do \ + (cd $$dir; \ + echo Making $$dir ...; \ +- make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\ ++ make CC="$(CC)" RANLIB="$(RANLIB)" MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\ + done ++ libtool --mode=link gcc -rpath "$(libdir)" -version-info "$(version_info)" -o libcudd.la cudd/libcudd.la mtr/libmtr.la epd/libepd.la util/libutil.la st/libst.la -lm ++ libtool --mode=link gcc -rpath "${libdir}" -version-info "$(version_info)" -o libdddmp.la dddmp/libdddmp.la ++ libtool --mode=link g++ -rpath "$(libdir)" -version-info "$(version_info)" -o libcuddxx.la obj/libobj.la -lcudd ++ +@(cd nanotrav; \ ++ make CC="$(CC)" RANLIB="$(RANLIB)" MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" ) + + nanotrav: build + +@@ -319,4 +324,6 @@ + echo Cleaning $$dir ...; \ + make -s EXE="$(EXE)" distclean ) \ + done ++ rm -f libcudd* libdddmp* ++ rm -fr .libs + sh ./shutdown.sh +--- a/cudd/Makefile ++++ b/cudd/Makefile +@@ -59,7 +59,7 @@ + cuddZddPort.c cuddZddReord.c cuddZddSetop.c cuddZddSymm.c \ + cuddZddUtil.c + PHDR = cudd.h cuddInt.h +-POBJ = $(PSRC:.c=.o) ++POBJ = $(PSRC:.c=.lo) + PUBJ = $(PSRC:.c=.u) + TARGET = test$(P)$(EXE) + TARGETu = test$(P)-u +@@ -71,12 +71,11 @@ + + #------------------------------------------------------ + +-lib$(P).a: $(POBJ) +- ar rv $@ $? +- $(RANLIB) $@ ++lib$(P).la: $(POBJ) ++ libtool --mode=link gcc -o $@ $? + +-.c.o: $(PSRC) $(PHDR) +- $(CC) -c $< -I$(INCLUDE) $(CFLAGS) $(DDDEBUG) ++%.lo: %.c ++ $(CC) -c -o $@ $< -I$(INCLUDE) $(CFLAGS) $(DDDEBUG) + + optimize_dec: lib$(P).b + +@@ -116,9 +115,10 @@ + programs: $(TARGET) $(TARGETu) lintpgm + + clean: +- rm -f *.o *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ ++ rm -f *.o *.lo *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ + .pure core *.warnings + + distclean: clean +- rm -f $(TARGET) $(TARGETu) lib*.a lib$(P).b llib-l$(P).ln \ ++ rm -f $(TARGET) $(TARGETu) lib*.a lib*.la lib$(P).b llib-l$(P).ln \ + *.bak *~ tags .gdb_history *.qv *.qx ++ rm -fr .libs +--- a/dddmp/Makefile ++++ b/dddmp/Makefile +@@ -148,7 +148,7 @@ + dddmpStoreMisc.c dddmpUtil.c dddmpBinary.c dddmpConvert.c \ + dddmpDbg.c + PHDR = dddmp.h dddmpInt.h $(INCLUDE)/cudd.h $(INCLUDE)/cuddInt.h +-POBJ = $(PSRC:.c=.o) ++POBJ = $(PSRC:.c=.lo) + PUBJ = $(PSRC:.c=.u) + TARGET = test$(P)$(EXE) + TARGETu = test$(P)-u +@@ -182,12 +182,11 @@ + $(WHERE)/mtr/llib-lmtr.ln $(WHERE)/st/llib-lst.ln \ + $(WHERE)/util/llib-lutil.ln + +-lib$(P).a: $(POBJ) +- ar rv $@ $? +- $(RANLIB) $@ ++lib$(P).la: $(POBJ) ++ libtool --mode=link gcc -o $@ $? + +-.c.o: $(PHDR) +- $(CC) -c $< -I$(INCLUDE) $(ICFLAGS) $(XCFLAGS) $(DDDEBUG) $(MTRDEBUG) $(DDDMPDEBUG) $(LDFLAGS) ++%.lo: %.c ++ $(CC) -c -o $@ $< -I$(INCLUDE) $(ICFLAGS) $(XCFLAGS) $(DDDEBUG) $(MTRDEBUG) $(DDDMPDEBUG) $(LDFLAGS) + + optimize_dec: lib$(P).b + +@@ -231,12 +230,13 @@ + #----------------------------------------------------------------------------# + + clean: +- rm -f *.o *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ ++ rm -f *.o *.lo *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ + .pure core *.warnings + + distclean: clean +- rm -f $(TARGET) $(TARGETu) lib*.a lib$(P).b llib-l$(P).ln \ ++ rm -f $(TARGET) $(TARGETu) lib*.a lib*.la lib$(P).b llib-l$(P).ln \ + *.bak *~ tags .gdb_history *.qv *.qx ++ rm -fr .libs + + + +--- a/epd/Makefile ++++ b/epd/Makefile +@@ -19,7 +19,7 @@ + P = epd + PSRC = epd.c + PHDR = epd.h +-POBJ = $(PSRC:.c=.o) ++POBJ = $(PSRC:.c=.lo) + PUBJ = $(PSRC:.c=.u) + + WHERE = .. +@@ -27,12 +27,11 @@ + + #--------------------------- + +-lib$(P).a: $(POBJ) +- ar rv $@ $? +- $(RANLIB) $@ ++lib$(P).la: $(POBJ) ++ libtool --mode=link gcc -o $@ $? + +-.c.o: $(PSRC) $(PHDR) +- $(CC) -c $< -I$(INCLUDE) $(CFLAGS) ++%.lo: %.c ++ $(CC) -c -o $@ $< -I$(INCLUDE) $(CFLAGS) + + optimize_dec: lib$(P).b + +@@ -58,7 +57,8 @@ + all: lib$(P).a lib$(P).b llib-l$(P).ln tags + + clean: +- rm -f *.o *.u .pure *.warnings ++ rm -f *.o *.lo *.u .pure *.warnings + + distclean: clean +- rm -f lib*.a lib$(P).b llib-l$(P).ln tags *~ *.bak *.qv *.qx ++ rm -f lib*.a lib*.la lib$(P).b llib-l$(P).ln tags *~ *.bak *.qv *.qx ++ rm -fr .libs +--- a/mtr/Makefile ++++ b/mtr/Makefile +@@ -30,7 +30,7 @@ + P = mtr + PSRC = mtrBasic.c mtrGroup.c + PHDR = mtr.h +-POBJ = $(PSRC:.c=.o) ++POBJ = $(PSRC:.c=.lo) + PUBJ = $(PSRC:.c=.u) + SRC = test$(P).c + HDR = +@@ -49,12 +49,11 @@ + + #--------------------------- + +-lib$(P).a: $(POBJ) +- ar rv $@ $? +- $(RANLIB) $@ ++lib$(P).la: $(POBJ) ++ libtool --mode=link gcc -o $@ $? + +-.c.o: $(PSRC) $(PHDR) +- $(CC) -c $< -I$(INCLUDE) $(CFLAGS) $(MTRDEBUG) ++%.lo: %.c ++ $(CC) -c -o $@ $< -I$(INCLUDE) $(CFLAGS) $(MTRDEBUG) + + optimize_dec: lib$(P).b + +@@ -88,9 +87,10 @@ + cc -O3 $(XCFLAGS) $(LDFLAGS) -o $@ $(UBJ) $(BLIBS) -lm + + clean: +- rm -f *.o *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ ++ rm -f *.o *.lo *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ + .pure core *.warnings + + distclean: clean +- rm -f $(TARGET) $(TARGETu) lib*.a lib$(P).b llib-l$(P).ln \ ++ rm -f $(TARGET) $(TARGETu) lib*.a lib*.la lib$(P).b llib-l$(P).ln \ + *.bak *~ tags *.qv *.qx ++ rm -fr .libs +--- a/nanotrav/Makefile ++++ b/nanotrav/Makefile +@@ -19,9 +19,7 @@ + + INCLUDE = $(WHERE)/include + +-LIBS = $(WHERE)/dddmp/libdddmp.a $(WHERE)/cudd/libcudd.a \ +- $(WHERE)/mtr/libmtr.a $(WHERE)/st/libst.a $(WHERE)/util/libutil.a \ +- $(WHERE)/epd/libepd.a ++LIBS = $(WHERE)/libcudd.la $(WHERE)/libdddmp.la + + MNEMLIB = + #MNEMLIB = $(WHERE)/mnemosyne/libmnem.a +@@ -39,7 +37,7 @@ + HDR = bnet.h ntr.h $(WHERE)/include/dddmp.h $(WHERE)/include/cudd.h \ + $(WHERE)/include/cuddInt.h + +-OBJ = $(SRC:.c=.o) ++OBJ = $(SRC:.c=.lo) + UBJ = $(SRC:.c=.u) + + MFLAG = +@@ -61,10 +59,10 @@ + #------------------------------------------------------ + + $(TARGET): $(SRC) $(OBJ) $(HDR) $(LIBS) $(MNEMLIB) +- $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(MNEMLIB) -lm ++ libtool --mode=link gcc $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(MNEMLIB) -lm + +-.c.o: $(HDR) +- $(CC) -c $< -I$(INCLUDE) $(CFLAGS) $(DDDEBUG) ++%.lo: %.c ++ $(CC) -c -o $@ $< -I$(INCLUDE) $(CFLAGS) $(DDDEBUG) + + # if the header files change, recompile + $(OBJ): $(HDR) +@@ -91,8 +89,9 @@ + pixie $(TARGETu) + + clean: +- rm -f *.o *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ ++ rm -f *.o *.lo *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ + .pure core *.warnings + + distclean: clean + rm -f $(TARGET) $(TARGETu) *.bak *~ .gdb_history *.qv *.qx ++ rm -fr .libs +--- a/obj/Makefile ++++ b/obj/Makefile +@@ -45,7 +45,7 @@ + P = obj + PSRC = cuddObj.cc + PHDR = cuddObj.hh $(INCLUDE)/cudd.h +-POBJ = $(PSRC:.cc=.o) ++POBJ = $(PSRC:.cc=.lo) + PUBJ = $(PSRC:.cc=.u) + TARGET = test$(P)$(EXE) + TARGETu = test$(P)-u +@@ -57,12 +57,11 @@ + + #------------------------------------------------------ + +-lib$(P).a: $(POBJ) +- ar rv $@ $? +- $(RANLIB) $@ ++lib$(P).la: $(POBJ) ++ libtool --mode=link g++ -o $@ $? + +-.cc.o: $(PHDR) +- $(CPP) -c $< -I$(INCLUDE) $(CFLAGS) $(DDDEBUG) ++%.lo: %.cc ++ $(CPP) -c -o $@ $< -I$(INCLUDE) $(CFLAGS) $(DDDEBUG) + + optimize_dec: lib$(P).b + +@@ -102,9 +101,10 @@ + programs: $(TARGET) $(TARGETu) lintpgm + + clean: +- rm -f *.o *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ ++ rm -f *.o *.lo *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \ + .pure core *.warnings + + distclean: clean +- rm -f $(TARGET) $(TARGETu) lib*.a lib$(P).b llib-l$(P).ln \ ++ rm -f $(TARGET) $(TARGETu) lib*.a lib*.la lib$(P).b llib-l$(P).ln \ + *.bak *~ tags .gdb_history *.qv *.qx ++ rm -fr .libs +--- a/st/Makefile ++++ b/st/Makefile +@@ -19,7 +19,7 @@ + P = st + PSRC = st.c + PHDR = st.h +-POBJ = $(PSRC:.c=.o) ++POBJ = $(PSRC:.c=.lo) + PUBJ = $(PSRC:.c=.u) + + WHERE = .. +@@ -27,12 +27,11 @@ + + #--------------------------- + +-lib$(P).a: $(POBJ) +- ar rv $@ $? +- $(RANLIB) $@ ++lib$(P).la: $(POBJ) ++ libtool --mode=link gcc -o $@ $? + +-.c.o: $(PHDR) +- $(CC) -c $< -I$(INCLUDE) $(CFLAGS) ++%.lo: %.c ++ $(CC) -c -o $@ $< -I$(INCLUDE) $(CFLAGS) + + optimize_dec: lib$(P).b + +@@ -58,7 +57,8 @@ + all: lib$(P).a lib$(P).b llib-l$(P).ln tags + + clean: +- rm -f *.o *.u .pure *.warnings ++ rm -f *.o *.lo *.u .pure *.warnings + + distclean: clean +- rm -f lib*.a lib$(P).b llib-l$(P).ln tags *~ *.bak *.qv *.qx ++ rm -f lib*.a lib*.la lib$(P).b llib-l$(P).ln tags *~ *.bak *.qv *.qx ++ rm -fr .libs +--- a/util/Makefile ++++ b/util/Makefile +@@ -21,19 +21,18 @@ + PSRC = cpu_time.c cpu_stats.c getopt.c safe_mem.c strsav.c texpand.c \ + ptime.c prtime.c pipefork.c pathsearch.c stub.c \ + tmpfile.c datalimit.c +-POBJ = $(PSRC:.c=.o) ++POBJ = $(PSRC:.c=.lo) + PUBJ = $(PSRC:.c=.u) + PHDR = util.h + + WHERE = .. + INCLUDE = $(WHERE)/include + +-lib$(P).a: $(POBJ) +- ar rv $@ $? +- $(RANLIB) $@ ++lib$(P).la: $(POBJ) ++ libtool --mode=link gcc -o $@ $? + +-.c.o: $(PHDR) +- $(CC) -c $< -I$(INCLUDE) $(FLAGS) $(CFLAGS) ++%.lo: %.c ++ $(CC) -c -o $@ $< -I$(INCLUDE) $(FLAGS) $(CFLAGS) + + optimize_dec: lib$(P).b + +@@ -59,7 +58,8 @@ + all: lib$(P).a lib$(P).b llib-l$(P).ln tags + + clean: +- rm -f *.o *.u core *.warnings ++ rm -f *.o *.lo *.u core *.warnings + + distclean: clean +- rm -f lib$(P).a lib$(P).b llib-l$(P).ln tags *.bak *~ .pure ++ rm -f lib$(P).a lib$(P).la lib$(P).b llib-l$(P).ln tags *.bak *~ .pure ++ rm -fr .libs diff --git a/contrib/cut-release b/contrib/cut-release new file mode 100755 index 000000000..5ca8d5a9b --- /dev/null +++ b/contrib/cut-release @@ -0,0 +1,186 @@ +#!/bin/bash +# +# usage: cut-release [-n] version-designation [make-args...] +# + +function isthatright { + echo -n "Does that look right? [y/n] " + while read yn; do + if [ "$yn" = y -o "$yn" = Y -o "$yn" = yes -o "$yn" = YES -o "$yn" = Yes ]; then + break + elif [ "$yn" = n -o "$yn" = N -o "$yn" = no -o "$yn" = NO -o "$yn" = No ]; then + echo "Aborting as per user request." >&2 + exit 1 + else + echo -n "[y/n] " + fi + done +} + +if [ "$1" = -n ]; then + dryrun=true + shift +else + dryrun=false +fi + +if [ $# -lt 1 ]; then + echo "Usage: $(basename "$0") [-n] version-designation [make-args...]" >&2 + echo "-n does a dry run (i.e., do sanity checks and build but don't touch the repository)" + exit 1 +fi + +if ! [ -e src/expr/node.h -a -e .svn ]; then + echo "$(basename "$0"): ERROR: you should run this from the top-level of a CVC4 subversion working directory" >&2 + exit 1 +fi + +version="$1" +shift + +if echo "$version" | grep '[^a-zA-Z0-9_.+(){}^%#-]' &>/dev/null; then + echo "$(basename "$0"): ERROR: version designation \`$version' contains illegal characters" >&2 + exit 1 +fi + +vs=($(echo "$version" | sed 's,^\([0-9]*\)\.\([0-9]*\)\(\.\([0-9]*\)\)\?\(.*\),\1 \2 \4 \5,')) +major=${vs[0]} +minor=${vs[1]} +release=${vs[2]-0} +extra=${vs[3]} +echo +echo "Major : $major" +echo "Minor : $minor" +echo "Release: $release" +echo "Extra : $extra" +echo +version="$major.$minor" +if [ "$release" != 0 ]; then + version="$version.$release" +fi +version="$version$extra" +echo "Version: $version" +echo +isthatright + +if ! svn ls "https://subversive.cims.nyu.edu/cvc4/cvc4/tags/releases/$version" 2>&1 >/dev/null | grep non-existent >/dev/null; then + echo "$(basename "$0"): ERROR: subversion repo already contains a release \`$version'" >&2 + $dryrun || exit 1 +fi + +if $dryrun; then + if [ -n "$(svn status -q configure.ac)" ]; then + echo "$(basename "$0"): ERROR: in dry-run mode, cannot operate properly with local modifications to \"configure.ac\", sorry" >&2 + exit 1 + fi +elif [ -n "$(svn status -q)" ]; then + echo "$(basename "$0"): ERROR: \"svn status\" indicates there are local modifications; please commit first" >&2 + exit 1 +fi + +root="$(svn info | grep "^Repository Root: https://subversive.cims.nyu.edu/.*" | cut -f3 -d' ')" +if [ -z "$root" ]; then + echo "$(basename "$0"): ERROR: can't get repository root URL" 2>&1 + $dryrun || exit 1 +fi + +if [ `svn -uq status | wc -l` -ne 1 ]; then + echo "$(basename "$0"): ERROR: this working directory isn't up to date" 2>&1 + $dryrun || exit 1 +fi + +if ! grep '^m4_define(_CVC4_MAJOR, *[0-9][0-9]* *)' configure.ac &>/dev/null || + ! grep '^m4_define(_CVC4_MINOR, *[0-9][0-9]* *)' configure.ac &>/dev/null || + ! grep '^m4_define(_CVC4_RELEASE, *[0-9][0-9]* *)' configure.ac &>/dev/null || + ! grep '^m4_define(_CVC4_EXTRAVERSION, *\[.*\] *)' configure.ac &>/dev/null; then + echo "$(basename "$0"): ERROR: cannot locate the version info lines of configure.ac" >&2 + $dryrun || exit 1 +fi +perl -pi -e 's/^m4_define\(_CVC4_MAJOR, ( *)[0-9]+( *)\)/m4_define(_CVC4_MAJOR, ${1}'"$major"'$2)/; + s/^m4_define\(_CVC4_MINOR, ( *)[0-9]+( *)\)/m4_define(_CVC4_MINOR, ${1}'"$minor"'$2)/; + s/^m4_define\(_CVC4_RELEASE, ( *)[0-9]+( *)\)/m4_define(_CVC4_RELEASE, ${1}'"$release"'$2)/; + s/^m4_define\(_CVC4_EXTRAVERSION, ( *)\[.*\]( *)\)/m4_define(_CVC4_EXTRAVERSION, $1\['"$extra"'\]$2)/' configure.ac + +trap 'echo; echo; echo "Aborting in error."; svn revert configure.ac; echo' EXIT + +echo +echo 'Made the following change to configure.ac:' +echo +svn diff configure.ac +echo +isthatright + +if ! grep '^m4_define(_CVC4_MAJOR, *'"$major"' *)' configure.ac &>/dev/null || + ! grep '^m4_define(_CVC4_MINOR, *'"$minor"' *)' configure.ac &>/dev/null || + ! grep '^m4_define(_CVC4_RELEASE, *'"$release"' *)' configure.ac &>/dev/null || + ! grep '^m4_define(_CVC4_EXTRAVERSION, *\['"$extra"'\] *)' configure.ac &>/dev/null; then + echo "$(basename "$0"): INTERNAL ERROR: cannot find the modified version info lines in configure.ac, bailing..." >&2 + exit 1 +fi +if [ -z "$(svn status -q configure.ac)" ]; then + echo "$(basename "$0"): INTERNAL ERROR: \"svn status\" indicates there are no local modifications to configure.ac; I expected the ones I just made!" >&2 + exit 1 +fi + +if ! $SHELL -c '\ + version="'$version'"; \ + set -ex; \ + ./autogen.sh; \ + mkdir "release-$version"; \ + cd "release-$version"; \ + ../configure production-cln-staticbinary --disable-shared --enable-unit-testing --with-cudd --with-readline; \ + make dist "$@"; \ + tar xf "cvc4-$version.tar.gz"; \ + cd "cvc4-$version"; \ + ./configure production-cln-staticbinary --disable-shared --enable-unit-testing --with-cudd --with-readline; \ + make check "$@"; \ + make distcheck "$@"; \ +'; then + exit 1 +fi + +if ! [ -e release-$version/cvc4-$version.tar.gz ]; then + echo "$(basename "$0"): INTERNAL ERROR: cannot find the distribution tarball I just built" >&2 + exit 1 +fi +if ! [ -e release-$version/src/main/cvc4 ]; then + echo "$(basename "$0"): INTERNAL ERROR: cannot find the binary I just built" >&2 + exit 1 +fi + +echo +echo 'This release of CVC4 will identify itself as:' +echo +release-$version/src/main/cvc4 --version +echo +isthatright + +echo +echo 'This binary release of CVC4 will identify itself as being configured like this:' +echo +release-$version/src/main/cvc4 --show-config +echo +isthatright + +echo +echo "Signing tarball..." +cp -p "release-$version/cvc4-$version.tar.gz" . +gpg -b --armor "cvc4-$version.tar.gz" + +echo +echo "Signing binary..." +cp -p "release-$version/src/main/cvc4" "cvc4-$version" +gpg -b --armor "cvc4-$version" + +echo +echo "About to run: svn commit -m \"Cutting release $version.\"" +isthatright +$dryrun || svn commit -m "Cutting release $version." + +echo +echo "About to run: svn copy -m \"Cutting release $version.\" \"$root\" \"https://subversive.cims.nyu.edu/cvc4/cvc4/tags/releases/$version\"" +isthatright +$dryrun || svn copy -m "Cutting release $version." "$root" "https://subversive.cims.nyu.edu/cvc4/cvc4/tags/releases/$version" + +trap '' EXIT + diff --git a/contrib/update-copyright.pl b/contrib/update-copyright.pl index 93ec5e6f0..282bffd5d 100755 --- a/contrib/update-copyright.pl +++ b/contrib/update-copyright.pl @@ -5,6 +5,7 @@ # Copyright (c) 2009, 2010, 2011 The CVC4 Project # # usage: update-copyright [-m] [files/directories...] +# update-copyright [-h | --help] # # This script goes through a source directory rewriting the top bits of # source files to match a template (inline, below). For files with no @@ -29,6 +30,7 @@ # It ignores any directory matching $excluded_directories # (so, you should add here any sources imported but not covered under # the license.) +# my $excluded_directories = '^(minisat|CVS|generated)$'; # re-include bounded_token_buffer.{h,cpp} @@ -65,6 +67,16 @@ use Fcntl ':mode'; my $dir = $0; $dir =~ s,/[^/]+/*$,,; +if($#ARGV >= 0 && $ARGV[0] eq '-h' || $ARGV[0] eq '--help') { + open(my $SELF, $0) || die "error opening $0 for reading"; + while($_ = <$SELF>) { + last if !/^#/; + print; + } + close $SELF; + exit; +} + # whether we ONLY process files with svn status "M" my $modonly = 0; diff --git a/doc/cvc4.1.in b/doc/cvc4.1.in new file mode 100644 index 000000000..926ce6b12 --- /dev/null +++ b/doc/cvc4.1.in @@ -0,0 +1,199 @@ +.\" Process this file with +.\" groff -man -Tascii cvc4.1 +.\" +.TH CVC4 1 "@MAN_DATE@" "CVC4 release @VERSION@" "User Manuals" +.SH NAME +cvc4 \- an automated theorem prover +.SH SYNOPSIS +.B cvc4 [ +.I options +.B ] [ +.I file +.B ] +.SH DESCRIPTION +.B cvc4 +is an automated theorem prover for first-order formulas with respect +to background theories of interest. + +With +.I file +, commands are read from +.I file +and executed. CVC4 supports the SMT-LIB (versions 1.2 and 2.0) input +format, as well as its own native \(lqpresentation language\(rq (see +.BR cvc4 (5) +), which is similar in many respects to CVC3's presentation language, +but not identical. + +If +.I file +is unspecified, standard input is read (and the +.B CVC4 +presentation language is assumed). If +.I file +is unspecified and +.B CVC4 +is connected to a terminal, interactive mode is assumed. + +.SH OPTIONS +.IP "--lang=LANG | -L LANG" +force input language (default is \(lqauto\(rq; see --lang help) +.IP --output-lang=LANG +force output language (default is \(lqauto\(rq; see --output-lang help) +.IP "--version | -V" +identify this CVC4 binary +.IP "--help | -h" +this command line reference +.IP --parse-only +exit after parsing input +.IP --preprocess-only +exit after preprocessing (useful with --stats or --dump) +.IP --dump=MODE +dump preprocessed assertions, T-propagations, etc., see --dump=help +.IP --dump-to=FILE +all dumping goes to FILE (instead of stdout) +.IP --mmap +memory map file input +.IP --show-config +show CVC4 static configuration +.IP --segv-nospin +don't spin on segfault waiting for gdb +.IP --lazy-type-checking +type check expressions only when necessary (default) +.IP --eager-type-checking +type check expressions immediately on creation (debug builds only) +.IP --no-type-checking +never type check expressions +.IP --no-checking +disable ALL semantic checks, including type checks +.IP --no-theory-registration +disable theory reg (not safe for some theories) +.IP --strict-parsing +fail on non-conformant inputs (SMT2 only) +.IP "--verbose | -v" +increase verbosity (may be repeated) +.IP "--quiet | -q" +decrease verbosity (may be repeated) +.IP "--trace=FLAG | -t FLAG" +trace something (e.g. -t pushpop), can repeat +.IP "--debug=FLAG | -d FLAG" +debug something (e.g. -d arith), can repeat +.IP --stats +give statistics on exit +.IP --default-expr-depth=N +print exprs to depth N (0 == default, -1 == no limit) +.IP --print-expr-types +print types with variables when printing exprs +.IP --interactive +run interactively +.IP --no-interactive +do not run interactively +.IP --produce-models +support the get-value command +.IP --produce-assignments +support the get-assignment command +.IP --lazy-definition-expansion +expand define-fun lazily +.IP --simplification=MODE +choose simplification mode, see --simplification=help +.IP --no-static-learning +turn off static learning (e.g. diamond-breaking) +.IP --replay=file +replay decisions from file +.IP --replay-log=file +log decisions and propagations to file +.IP --pivot-rule=RULE +change the pivot rule (see --pivot-rule help) +.IP --pivot-threshold=N +sets the number of heuristic pivots per variable per simplex instance +.IP --prop-row-length=N +sets the maximum row length to be used in propagation +.IP --random-freq=P +sets the frequency of random decisions in the sat solver(P=0.0 by default) +.IP --random-seed=S +sets the random seed for the sat solver +.IP --disable-variable-removal +enable permanent removal of variables in arithmetic (UNSAFE! experts only) +.IP --disable-arithmetic-propagation +turns on arithmetic propagation +.IP --disable-symmetry-breaker +turns off UF symmetry breaker (Deharbe et al., CADE 2011) +.IP --incremental +enable incremental solving + +.\".SH FILES +.\".SH ENVIRONMENT +.SH DIAGNOSTICS +.B CVC4 +reports all syntactic and semantic errors on standard error. +.SH HISTORY +The +.B CVC4 +effort is the culmination of fifteen years of theorem proving +research, starting with the +.I Stanford Validity Checker (SVC) +in 1996. + +SVC's successor, the +.I Cooperating Validity Checker (CVC), +had a more optimized internal design, produced proofs, used the +.I Chaff +SAT solver, and featured a number of usability +enhancements. Its name comes from the cooperative nature of +decision procedures in Nelson-Oppen theory combination, +which share amongst each other equalities between shared terms. + +CVC Lite, first made available in 2003, was a rewrite of CVC +that attempted to make CVC +more flexible (hence the \(lqlite\(rq) while extending the feature set: +CVCLite supported quantifiers where its predecessors did not. +CVC3 was a major overhaul of portions of CVC Lite: it added +better decision procedure implementations, added support for using +MiniSat in the core, and had generally better performance. + +CVC4 is the new version, the fifth generation of this validity +checker line that is now celebrating fifteen years of heritage. +It represents a complete re-evaluation of +the core architecture to be both performant and to serve as a cutting-edge research vehicle +for the next several years. Rather than taking CVC3 +and redesigning problem parts, we've taken a clean-room approach, +starting from scratch. Before using any designs from CVC3, we have +thoroughly scrutinized, vetted, and updated them. Many parts of CVC4 +bear only a superficial resemblance, if any, to their correspondent in CVC3. + +However, CVC4 is fundamentally similar to CVC3 and many other +modern SMT solvers: it is a DPLL( +.I T +) solver, +with a SAT solver at its core and a delegation path to different decision +procedure implementations, each in charge of solving formulas in some +background theory. + +The re-evaluation and ground-up rewrite was necessitated, we felt, by +the performance characteristics of CVC3. CVC3 has many useful +features, but some core aspects of the design led to high memory use, and +the use of heavyweight computation (where more nimble engineering +approaches could suffice) makes CVC3 a much slower prover than other tools. +As these designs are central to CVC3, a new version was preferable to a +selective re-engineering, which would have ballooned in short order. +.SH VERSION +This manual page refers to +.B CVC4 +version @VERSION@. +.SH BUGS +A Bugzilla for the CVC4 project is maintained at +.BR http://goedel.cs.nyu.edu/bugzilla3/ . +.SH AUTHORS +.B CVC4 +is developed by a team of researchers at New York University +and the University of Iowa. +See the AUTHORS file in the distribution for a full list of +contributors. +.SH "SEE ALSO" +.BR libcvc4 (3), +.BR libcvc4parser (3), +.BR libcvc4compat (3) + +Additionally, the CVC4 wiki contains useful information about the +design and internals of CVC4. It is maintained at +.BR http://goedel.cs.nyu.edu/wiki/ . diff --git a/doc/cvc4.5.in b/doc/cvc4.5.in new file mode 100644 index 000000000..d862eec8a --- /dev/null +++ b/doc/cvc4.5.in @@ -0,0 +1,21 @@ +.\" Process this file with +.\" groff -man -Tascii cvc4.5 +.\" +.TH CVC4 5 "@MAN_DATE@" "CVC4 release @VERSION@" "Languages documentation" +.SH NAME +cvc4 \- the native input language for CVC4 +.SH DESCRIPTION +.B cvc4 +is an automated theorem prover for first-order formulas with respect +to background theories of interest. + +.SH HISTORY +.SH "SEE ALSO" +.BR cvc4 (1), +.BR libcvc4 (3), +.BR libcvc4parser (3), +.BR libcvc4compat (3) + +Additionally, the CVC4 wiki contains useful information about the +design and internals of CVC4. It is maintained at +.BR http://goedel.cs.nyu.edu/wiki/ . diff --git a/doc/libcvc4.3.in b/doc/libcvc4.3.in new file mode 100644 index 000000000..245db524e --- /dev/null +++ b/doc/libcvc4.3.in @@ -0,0 +1,15 @@ +.\" Process this file with +.\" groff -man -Tascii libcvc4.3 +.\" +.TH LIBCVC4 3 "@MAN_DATE@" "CVC4 release @VERSION@" "CVC4 Library Interfaces" +.SH NAME +libcvc4 \- a library interface for the CVC4 theorem prover +.SH DESCRIPTION +.SH "SEE ALSO" +.BR cvc4 (1), +.BR libcvc4parser (3), +.BR libcvc4compat (3) + +Additionally, the CVC4 wiki contains useful information about the +design and internals of CVC4. It is maintained at +.BR http://goedel.cs.nyu.edu/wiki/ . diff --git a/doc/libcvc4compat.3.in b/doc/libcvc4compat.3.in new file mode 100644 index 000000000..e429fc815 --- /dev/null +++ b/doc/libcvc4compat.3.in @@ -0,0 +1,15 @@ +.\" Process this file with +.\" groff -man -Tascii libcvc4compat.3 +.\" +.TH LIBCVC4COMPAT 3 "@MAN_DATE@" "CVC4 release @VERSION@" "CVC4 Library Interfaces" +.SH NAME +libcvc4compat \- a CVC3 compatibility library interface for the CVC4 theorem prover +.SH DESCRIPTION +.SH "SEE ALSO" +.BR cvc4 (1), +.BR libcvc4 (3), +.BR libcvc4parser (3) + +Additionally, the CVC4 wiki contains useful information about the +design and internals of CVC4. It is maintained at +.BR http://goedel.cs.nyu.edu/wiki/ . diff --git a/doc/libcvc4parser.3.in b/doc/libcvc4parser.3.in new file mode 100644 index 000000000..fa17d6d18 --- /dev/null +++ b/doc/libcvc4parser.3.in @@ -0,0 +1,15 @@ +.\" Process this file with +.\" groff -man -Tascii libcvc4parser.3 +.\" +.TH LIBCVC4PARSER 3 "@MAN_DATE@" "CVC4 release @VERSION@" "CVC4 Library Interfaces" +.SH NAME +libcvc4parser \- a parser library interface for the CVC4 theorem prover +.SH DESCRIPTION +.SH "SEE ALSO" +.BR cvc4 (1), +.BR libcvc4 (3), +.BR libcvc4compat (3) + +Additionally, the CVC4 wiki contains useful information about the +design and internals of CVC4. It is maintained at +.BR http://goedel.cs.nyu.edu/wiki/ . diff --git a/src/Makefile.am b/src/Makefile.am index de9aa0339..9ffe249ee 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,10 +17,12 @@ AM_CPPFLAGS = \ -I@srcdir@/include -I@srcdir@ -I@builddir@ AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) -SUBDIRS = lib expr util context theory prop smt printer . parser main +SUBDIRS = lib expr util context theory prop smt printer bindings . parser compat main lib_LTLIBRARIES = libcvc4.la +if HAVE_CXXTESTGEN noinst_LTLIBRARIES = libcvc4_noinst.la +endif libcvc4_la_LDFLAGS = -version-info $(LIBCVC4_VERSION) @@ -57,10 +59,6 @@ EXTRA_DIST = \ include/cvc4_private.h \ include/cvc4_public.h -publicheaders = \ - include/cvc4_public.h \ - include/cvc4parser_public.h - subversion_versioninfo.cpp: svninfo $(AM_V_GEN)( \ if test -s svninfo; then \ @@ -87,16 +85,39 @@ svninfo: svninfo.tmp svninfo.tmp: $(AM_V_GEN)(cd "$(top_srcdir)" && svn info && echo "Modifications: `test -z \"\`svn status -q\`\" && echo false || echo true`") >"$@" 2>/dev/null || true -install-data-local: $(publicheaders) - $(mkinstalldirs) $(DESTDIR)$(prefix)$(includedir)/cvc4 - @for f in $(publicheaders); do \ - echo $(INSTALL_DATA) "$(srcdir)/$$f" "$(DESTDIR)$(prefix)$(includedir)/cvc4"; \ - $(INSTALL_DATA) "$(srcdir)/$$f" "$(DESTDIR)$(prefix)$(includedir)/cvc4"; \ +install-data-local: + (echo include/cvc4_public.h; \ + find * -name '*.h' | \ + xargs grep -l '^# *include *"cvc4.*_public\.h"'; \ + (cd "$(srcdir)" && find * -name '*.h' | \ + xargs grep -l '^# *include *"cvc4.*_public\.h"')) | \ + while read f; do \ + if expr "$$f" : ".*_\(template\|private\|test_utils\)\.h$$" &>/dev/null; then \ + continue; \ + fi; \ + d="$$(echo "$$f" | sed 's,^include/,,')"; \ + $(mkinstalldirs) "$$(dirname "$(DESTDIR)$(includedir)/cvc4/$$d")"; \ + if [ -e "$$f" ]; then \ + path="$$f"; \ + else \ + path="$(srcdir)/$$f"; \ + fi; \ + echo $(INSTALL_DATA) "$$path" "$(DESTDIR)$(includedir)/cvc4/$$d"; \ + $(INSTALL_DATA) "$$path" "$(DESTDIR)$(includedir)/cvc4/$$d"; \ done uninstall-local: - @for f in $(publicheaders); do \ - f=`echo "$$f" | sed 's,.*/,,'`; \ - rm -f "$(DESTDIR)$(prefix)$(includedir)/cvc4/$$f"; \ + -(echo include/cvc4_public.h; \ + find * -name '*.h' | \ + xargs grep -l '^# *include *"cvc4.*_public\.h"'; \ + (cd "$(srcdir)" && find * -name '*.h' | \ + xargs grep -l '^# *include *"cvc4.*_public\.h"')) | \ + while read f; do \ + if expr "$$f" : ".*_\(template\|private\|test_utils\)\.h$$" &>/dev/null; then \ + continue; \ + fi; \ + d="$$(echo "$$f" | sed 's,^include/,,')"; \ + rm -f "$(DESTDIR)$(includedir)/cvc4/$$d"; \ + rmdir -p "$$(dirname "$(DESTDIR)$(includedir)/cvc4/$$d")" 2>/dev/null; \ done - @rmdir "$(DESTDIR)$(prefix)$(includedir)/cvc4" + -rmdir "$(DESTDIR)$(includedir)/cvc4" diff --git a/src/bindings/Makefile b/src/bindings/Makefile new file mode 100644 index 000000000..419d3a1b4 --- /dev/null +++ b/src/bindings/Makefile @@ -0,0 +1,4 @@ +topdir = ../.. +srcdir = src/bindings + +include $(topdir)/Makefile.subdir diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am new file mode 100644 index 000000000..cd314f957 --- /dev/null +++ b/src/bindings/Makefile.am @@ -0,0 +1,58 @@ +AM_CPPFLAGS = \ + -D__BUILDING_CVC4BINDINGSLIB \ + -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/.. +AM_CXXFLAGS = -Wall $(FLAG_VISIBILITY_HIDDEN) + +lib_LTLIBRARIES = +if CVC4_LANGUAGE_BINDING_JAVA +lib_LTLIBRARIES += libcvc4bindings_java.la +endif +# cvc4bindings_csharp.so \ +# cvc4bindings_perl.so \ +# cvc4bindings_php.so \ +# cvc4bindings_python.so \ +# cvc4bindings_ocaml.so \ +# cvc4bindings_ruby.so \ +# cvc4bindings_tcl.so + +nodist_libcvc4bindings_java_la_SOURCES = java.cpp +#nodist_cvc4bindings_csharp_so_SOURCES = csharp.cpp +#nodist_cvc4bindings_perl_so_SOURCES = perl.cpp +#nodist_cvc4bindings_php_so_SOURCES = php.cpp +#nodist_cvc4bindings_python_so_SOURCES = python.cpp +#nodist_cvc4bindings_ocaml_so_SOURCES = ocaml.cpp +#nodist_cvc4bindings_ruby_so_SOURCES = ruby.cpp +#nodist_cvc4bindings_tcl_so_SOURCES = tcl.cpp + +BUILT_SOURCES = \ + java.cpp \ + csharp.cpp \ + perl.cpp \ + php.cpp \ + python.cpp \ + ocaml.cpp \ + ruby.cpp \ + tcl.cpp + +CLEANFILES = \ + $(BUILT_SOURCES) \ + cvc4.java \ + cvc4.cs \ + cvc4JNI.java \ + cvc4.php \ + cvc4PINVOKE.cs \ + cvc4.pm \ + cvc4.py \ + php_cvc4.h + +java.lo: java.cpp; $(LTCXXCOMPILE) $(JAVA_INCLUDES) -o $@ $< +java.cpp:: +csharp.cpp:: +perl.cpp:: +php.cpp:: +python.cpp:: +ocaml.cpp:: +ruby.cpp:: +tcl.cpp:: +$(patsubst %,%.cpp,$(filter-out c c++,$(CVC4_LANGUAGE_BINDINGS))):: %.cpp: @srcdir@/../smt/smt_engine.h + $(AM_V_GEN)$(SWIG) -w503 -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/.. -module cvc4 -c++ -$(patsubst %.cpp,%,$@) -o $@ $< diff --git a/src/compat/Makefile b/src/compat/Makefile new file mode 100644 index 000000000..675bd8827 --- /dev/null +++ b/src/compat/Makefile @@ -0,0 +1,4 @@ +topdir = ../.. +srcdir = src/compat + +include $(topdir)/Makefile.subdir diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am new file mode 100644 index 000000000..905eaa6c4 --- /dev/null +++ b/src/compat/Makefile.am @@ -0,0 +1,50 @@ +# LIBCVC4COMPAT_VERSION (-version-info) is in the form current:revision:age +# +# current - +# increment if interfaces have been added, removed or changed +# revision - +# increment if source code has changed +# set to zero if current is incremented +# age - +# increment if interfaces have been added +# set to zero if interfaces have been removed +# or changed +# +LIBCVC4COMPAT_VERSION = @CVC4_COMPAT_LIBRARY_VERSION@ + +AM_CPPFLAGS = \ + -D__BUILDING_CVC4COMPATLIB \ + -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/.. $(ANTLR_INCLUDES) +AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) + +if CVC4_BUILD_LIBCOMPAT + +nobase_lib_LTLIBRARIES = libcvc4compat.la +if HAVE_CXXTESTGEN +noinst_LTLIBRARIES = libcvc4compat_noinst.la +endif + +libcvc4compat_la_LDFLAGS = \ + -version-info $(LIBCVC4COMPAT_VERSION) +libcvc4compat_noinst_la_LDFLAGS = + +libcvc4compat_la_LIBADD = \ + @builddir@/../lib/libreplacements.la +libcvc4compat_noinst_la_LIBADD = \ + @builddir@/../lib/libreplacements.la + +libcvc4compat_la_SOURCES = \ + cvc3_compat.h \ + cvc3_compat.cpp + +libcvc4compat_noinst_la_SOURCES = \ + cvc3_compat.h \ + cvc3_compat.cpp + +else + +EXTRA_DIST = \ + cvc3_compat.h \ + cvc3_compat.cpp + +endif diff --git a/src/compat/cvc3_compat.cpp b/src/compat/cvc3_compat.cpp new file mode 100644 index 000000000..99cf4e84b --- /dev/null +++ b/src/compat/cvc3_compat.cpp @@ -0,0 +1,1886 @@ +/********************* */ +/*! \file cvc3_compat.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, 2010, 2011 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 CVC3 compatibility layer for CVC4 + ** + ** CVC3 compatibility layer for CVC4. + **/ + +#include "compat/cvc3_compat.h" + +#include "expr/kind.h" +#include "expr/command.h" + +#include "util/rational.h" +#include "util/integer.h" +#include "util/bitvector.h" + +#include "parser/parser.h" +#include "parser/parser_builder.h" + +#include +#include +#include + +using namespace std; + +namespace CVC3 { + +std::string int2string(int n) { + std::ostringstream ss; + ss << n; + return ss.str(); +} + +std::ostream& operator<<(std::ostream& out, CLFlagType clft) { + switch(clft) { + case CLFLAG_NULL: out << "CLFLAG_NULL"; + case CLFLAG_BOOL: out << "CLFLAG_BOOL"; + case CLFLAG_INT: out << "CLFLAG_INT"; + case CLFLAG_STRING: out << "CLFLAG_STRING"; + case CLFLAG_STRVEC: out << "CLFLAG_STRVEC"; + default: out << "CLFlagType!UNKNOWN"; + } + + return out; +} + +std::ostream& operator<<(std::ostream& out, QueryResult qr) { + switch(qr) { + case SATISFIABLE: out << "SATISFIABLE/INVALID"; break; + case UNSATISFIABLE: out << "VALID/UNSATISFIABLE"; break; + case ABORT: out << "ABORT"; break; + case UNKNOWN: out << "UNKNOWN"; break; + default: out << "QueryResult!UNKNOWN"; + } + + return out; +} + +std::ostream& operator<<(std::ostream& out, FormulaValue fv) { + switch(fv) { + case TRUE_VAL: out << "TRUE_VAL"; break; + case FALSE_VAL: out << "FALSE_VAL"; break; + case UNKNOWN_VAL: out << "UNKNOWN_VAL"; break; + default: out << "FormulaValue!UNKNOWN"; + } + + return out; +} + +std::ostream& operator<<(std::ostream& out, CVC3CardinalityKind c) { + switch(c) { + case CARD_FINITE: out << "CARD_FINITE"; break; + case CARD_INFINITE: out << "CARD_INFINITE"; break; + case CARD_UNKNOWN: out << "CARD_UNKNOWN"; break; + default: out << "CVC3CardinalityKind!UNKNOWN"; + } + + return out; +} + +static string toString(CLFlagType clft) { + stringstream sstr; + sstr << clft; + return sstr.str(); +} + +bool operator==(const Cardinality& c, CVC3CardinalityKind d) { + switch(d) { + case CARD_FINITE: + return c.isFinite(); + case CARD_INFINITE: + return c.isInfinite(); + case CARD_UNKNOWN: + return c.isUnknown(); + } + + Unhandled(d); +} + +bool operator==(CVC3CardinalityKind d, const Cardinality& c) { + return c == d; +} + +bool operator!=(const Cardinality& c, CVC3CardinalityKind d) { + return !(c == d); +} + +bool operator!=(CVC3CardinalityKind d, const Cardinality& c) { + return !(c == d); +} + +Type::Type() : + CVC4::Type() { +} + +Type::Type(const CVC4::Type& type) : + CVC4::Type(type) { +} + +Type::Type(const Type& type) : + CVC4::Type(type) { +} + +Expr Type::getExpr() const { + Unimplemented(); +} + +int Type::arity() const { + return isSort() ? CVC4::SortType(*this).getParamTypes().size() : 0; +} + +Type Type::operator[](int i) const { + return Type(CVC4::Type(CVC4::SortType(*this).getParamTypes()[i])); +} + +bool Type::isBool() const { + return isBoolean(); +} + +bool Type::isSubtype() const { + return false; +} + +Cardinality Type::card() const { + return getCardinality(); +} + +Expr Type::enumerateFinite(Unsigned n) const { + Unimplemented(); +} + +Unsigned Type::sizeFinite() const { + return getCardinality().getFiniteCardinality().getUnsignedLong(); +} + +Type Type::typeBool(ExprManager* em) { + return Type(CVC4::Type(em->booleanType())); +} + +Type Type::funType(const std::vector& typeDom, + const Type& typeRan) { + const vector& dom = + *reinterpret_cast*>(&typeDom); + return Type(typeRan.getExprManager()->mkFunctionType(dom, typeRan)); +} + +Type Type::funType(const Type& typeRan) const { + return Type(getExprManager()->mkFunctionType(*this, typeRan)); +} + +Expr::Expr() : CVC4::Expr() { +} + +Expr::Expr(const Expr& e) : CVC4::Expr(e) { +} + +Expr::Expr(const CVC4::Expr& e) : CVC4::Expr(e) { +} + +Expr Expr::eqExpr(const Expr& right) const { + return getEM()->mkExpr(CVC4::kind::EQUAL, *this, right); +} + +Expr Expr::notExpr() const { + return getEM()->mkExpr(CVC4::kind::NOT, *this); +} + +Expr Expr::negate() const { + // avoid double-negatives + return (getKind() == CVC4::kind::NOT) ? + (*this)[0] : + Expr(getEM()->mkExpr(CVC4::kind::NOT, *this)); +} + +Expr Expr::andExpr(const Expr& right) const { + return getEM()->mkExpr(CVC4::kind::AND, *this, right); +} + +Expr Expr::orExpr(const Expr& right) const { + return getEM()->mkExpr(CVC4::kind::OR, *this, right); +} + +Expr Expr::iteExpr(const Expr& thenpart, const Expr& elsepart) const { + return getEM()->mkExpr(CVC4::kind::ITE, *this, thenpart, elsepart); +} + +Expr Expr::iffExpr(const Expr& right) const { + return getEM()->mkExpr(CVC4::kind::IFF, *this, right); +} + +Expr Expr::impExpr(const Expr& right) const { + return getEM()->mkExpr(CVC4::kind::IMPLIES, *this, right); +} + +Expr Expr::xorExpr(const Expr& right) const { + return getEM()->mkExpr(CVC4::kind::XOR, *this, right); +} + +Expr Expr::substExpr(const std::vector& oldTerms, + const std::vector& newTerms) const { + const vector& o = + *reinterpret_cast*>(&oldTerms); + const vector& n = + *reinterpret_cast*>(&newTerms); + + return Expr(substitute(o, n)); +} + +Expr Expr::substExpr(const ExprHashMap& oldToNew) const { + const hash_map& o2n = + *reinterpret_cast*>(&oldToNew); + + return Expr(substitute(o2n)); +} + +Expr Expr::operator!() const { + return notExpr(); +} + +Expr Expr::operator&&(const Expr& right) const { + return andExpr(right); +} + +Expr Expr::operator||(const Expr& right) const { + return orExpr(right); +} + +size_t Expr::hash(const Expr& e) { + return CVC4::ExprHashFunction()(e); +} + +size_t Expr::hash() const { + return CVC4::ExprHashFunction()(*this); +} + +bool Expr::isFalse() const { + return getKind() == CVC4::kind::CONST_BOOLEAN && !getConst(); +} + +bool Expr::isTrue() const { + return getKind() == CVC4::kind::CONST_BOOLEAN && getConst(); +} + +bool Expr::isBoolConst() const { + return getKind() == CVC4::kind::CONST_BOOLEAN; +} + +bool Expr::isVar() const { + return isVariable(); +} + +bool Expr::isEq() const { + return getKind() == CVC4::kind::EQUAL; +} + +bool Expr::isNot() const { + return getKind() == CVC4::kind::NOT; +} + +bool Expr::isAnd() const { + return getKind() == CVC4::kind::AND; +} + +bool Expr::isOr() const { + return getKind() == CVC4::kind::OR; +} + +bool Expr::isITE() const { + return getKind() == CVC4::kind::ITE; +} + +bool Expr::isIff() const { + return getKind() == CVC4::kind::IFF; +} + +bool Expr::isImpl() const { + return getKind() == CVC4::kind::IMPLIES; +} + +bool Expr::isXor() const { + return getKind() == CVC4::kind::XOR; +} + +bool Expr::isRational() const { + return getKind() == CVC4::kind::CONST_RATIONAL; +} + +bool Expr::isSkolem() const { + return getKind() == CVC4::kind::SKOLEM; +} + +std::vector< std::vector > Expr::getTriggers() const { + return vector< vector >(); +} + +ExprManager* Expr::getEM() const { + return getExprManager(); +} + +std::vector Expr::getKids() const { + vector v = getChildren(); + return *reinterpret_cast*>(&v); +} + +ExprIndex Expr::getIndex() const { + return getId(); +} + +int Expr::arity() const { + return getNumChildren(); +} + +Expr Expr::unnegate() const { + return isNot() ? Expr((*this)[0]) : *this; +} + +bool Expr::isInitialized() const { + return !isNull(); +} + +Type Expr::getType() const { + return Type(this->CVC4::Expr::getType()); +} + +Type Expr::lookupType() const { + return getType(); +} + +Expr Expr::operator[](int i) const { + return Expr(this->CVC4::Expr::operator[](i)); +} + +CLFlag::CLFlag(bool b, const std::string& help, bool display) : + d_tp(CLFLAG_BOOL) { + d_data.b = b; +} + +CLFlag::CLFlag(int i, const std::string& help, bool display) : + d_tp(CLFLAG_INT) { + d_data.i = i; +} + +CLFlag::CLFlag(const std::string& s, const std::string& help, bool display) : + d_tp(CLFLAG_STRING) { + d_data.s = new string(s); +} + +CLFlag::CLFlag(const char* s, const std::string& help, bool display) : + d_tp(CLFLAG_STRING) { + d_data.s = new string(s); +} + +CLFlag::CLFlag(const std::vector >& sv, + const std::string& help, bool display) : + d_tp(CLFLAG_STRVEC) { + d_data.sv = new vector >(sv); +} + +CLFlag::CLFlag() : + d_tp(CLFLAG_NULL) { +} + +CLFlag::CLFlag(const CLFlag& f) : + d_tp(f.d_tp) { + switch(d_tp) { + case CLFLAG_STRING: + d_data.s = new string(*f.d_data.s); + break; + case CLFLAG_STRVEC: + d_data.sv = new vector >(*f.d_data.sv); + break; + default: + d_data = f.d_data; + } +} + +CLFlag::~CLFlag() { + switch(d_tp) { + case CLFLAG_STRING: + delete d_data.s; + break; + case CLFLAG_STRVEC: + delete d_data.sv; + break; + default: + ; // nothing to do + } +} + +CLFlag& CLFlag::operator=(const CLFlag& f) { + if(this == &f) { + // self-assignment + return *this; + } + + // try to preserve the existing heap objects if possible + if(d_tp == f.d_tp) { + switch(d_tp) { + case CLFLAG_STRING: + *d_data.s = *f.d_data.s; + break; + case CLFLAG_STRVEC: + *d_data.sv = *f.d_data.sv; + break; + default: + d_data = f.d_data; + } + } else { + switch(d_tp) { + case CLFLAG_STRING: + delete d_data.s; + break; + case CLFLAG_STRVEC: + delete d_data.sv; + break; + default: + ; // nothing to do here + } + + switch(f.d_tp) { + case CLFLAG_STRING: + d_data.s = new string(*f.d_data.s); + break; + case CLFLAG_STRVEC: + d_data.sv = new vector >(*f.d_data.sv); + break; + default: + d_data = f.d_data; + } + } + d_tp = f.d_tp; + return *this; +} + +CLFlag& CLFlag::operator=(bool b) { + CheckArgument(d_tp == CLFLAG_BOOL, this); + d_data.b = b; + return *this; +} + +CLFlag& CLFlag::operator=(int i) { + CheckArgument(d_tp == CLFLAG_INT, this); + d_data.i = i; + return *this; +} + +CLFlag& CLFlag::operator=(const std::string& s) { + CheckArgument(d_tp == CLFLAG_STRING, this); + *d_data.s = s; + return *this; +} + +CLFlag& CLFlag::operator=(const char* s) { + CheckArgument(d_tp == CLFLAG_STRING, this); + *d_data.s = s; + return *this; +} + +CLFlag& CLFlag::operator=(const std::pair& p) { + CheckArgument(d_tp == CLFLAG_STRVEC, this); + d_data.sv->push_back(p); + return *this; +} + +CLFlag& CLFlag::operator=(const std::vector >& sv) { + CheckArgument(d_tp == CLFLAG_STRVEC, this); + *d_data.sv = sv; + return *this; +} + +CLFlagType CLFlag::getType() const { + return d_tp; +} + +bool CLFlag::modified() const { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +bool CLFlag::display() const { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +const bool& CLFlag::getBool() const { + CheckArgument(d_tp == CLFLAG_BOOL, this); + return d_data.b; +} + +const int& CLFlag::getInt() const { + CheckArgument(d_tp == CLFLAG_INT, this); + return d_data.i; +} + +const std::string& CLFlag::getString() const { + CheckArgument(d_tp == CLFLAG_STRING, this); + return *d_data.s; +} + +const std::vector >& CLFlag::getStrVec() const { + CheckArgument(d_tp == CLFLAG_STRVEC, this); + return *d_data.sv; +} + +const std::string& CLFlag::getHelp() const { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void CLFlags::addFlag(const std::string& name, const CLFlag& f) { + d_map[name] = f; +} + +size_t CLFlags::countFlags(const std::string& name) const { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +size_t CLFlags::countFlags(const std::string& name, + std::vector& names) const { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +const CLFlag& CLFlags::getFlag(const std::string& name) const { + FlagMap::const_iterator i = d_map.find(name); + CheckArgument(i != d_map.end(), name, "No command-line flag by that name, or not supported."); + return (*i).second; +} + +const CLFlag& CLFlags::operator[](const std::string& name) const { + return getFlag(name); +} + +void CLFlags::setFlag(const std::string& name, const CLFlag& f) { + FlagMap::iterator i = d_map.find(name); + CheckArgument(i != d_map.end(), name, "No command-line flag by that name, or not supported."); + CheckArgument((*i).second.getType() == f.getType(), f, + "Command-line flag `%s' has type %s, but caller tried to set to a %s.", + name.c_str(), + toString((*i).second.getType()).c_str(), + toString(f.getType()).c_str()); + (*i).second = f; +} + +void CLFlags::setFlag(const std::string& name, bool b) { + FlagMap::iterator i = d_map.find(name); + CheckArgument(i != d_map.end(), name, "No command-line flag by that name, or not supported."); + (*i).second = b; +} + +void CLFlags::setFlag(const std::string& name, int i) { + FlagMap::iterator it = d_map.find(name); + CheckArgument(it != d_map.end(), name, "No command-line flag by that name, or not supported."); + (*it).second = i; +} + +void CLFlags::setFlag(const std::string& name, const std::string& s) { + FlagMap::iterator i = d_map.find(name); + CheckArgument(i != d_map.end(), name, "No command-line flag by that name, or not supported."); + (*i).second = s; +} + +void CLFlags::setFlag(const std::string& name, const char* s) { + FlagMap::iterator i = d_map.find(name); + CheckArgument(i != d_map.end(), name, "No command-line flag by that name, or not supported."); + (*i).second = s; +} + +void CLFlags::setFlag(const std::string& name, const std::pair& p) { + FlagMap::iterator i = d_map.find(name); + CheckArgument(i != d_map.end(), name, "No command-line flag by that name, or not supported."); + (*i).second = p; +} + +void CLFlags::setFlag(const std::string& name, + const std::vector >& sv) { + FlagMap::iterator i = d_map.find(name); + CheckArgument(i != d_map.end(), name, "No command-line flag by that name, or not supported."); + (*i).second = sv; +} + +ValidityChecker::ValidityChecker() : + d_clflags(new CLFlags()), + d_em(), + d_smt(&d_em) { +} + +ValidityChecker::ValidityChecker(const CLFlags& clflags) : + d_clflags(new CLFlags(clflags)), + d_em(), + d_smt(&d_em) { +} + +ValidityChecker::~ValidityChecker() { + delete d_clflags; +} + +CLFlags& ValidityChecker::getFlags() const { + return *d_clflags; +} + +void ValidityChecker::reprocessFlags() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +CLFlags ValidityChecker::createFlags() { + CLFlags flags; + + // We expect the user to type cvc3 -h to get help, which will set + // the "help" flag to false; that's why it's initially true. + + // Overall system control flags + flags.addFlag("timeout", CLFlag(0, "Kill cvc3 process after given number of seconds (0==no limit)")); + flags.addFlag("stimeout", CLFlag(0, "Set time resource limit in tenths of seconds for a query(0==no limit)")); + flags.addFlag("resource", CLFlag(0, "Set finite resource limit (0==no limit)")); + flags.addFlag("mm", CLFlag("chunks", "Memory manager (chunks, malloc)")); + + // Information printing flags + flags.addFlag("help",CLFlag(true, "print usage information and exit")); + flags.addFlag("unsupported",CLFlag(true, "print usage for old/unsupported/experimental options")); + flags.addFlag("version",CLFlag(true, "print version information and exit")); + flags.addFlag("interactive", CLFlag(false, "Interactive mode")); + flags.addFlag("stats", CLFlag(false, "Print run-time statistics")); + flags.addFlag("seed", CLFlag(1, "Set the seed for random sequence")); + flags.addFlag("printResults", CLFlag(true, "Print results of interactive commands.")); + flags.addFlag("dump-log", CLFlag("", "Dump API call log in CVC3 input " + "format to given file " + "(off when file name is \"\")")); + flags.addFlag("parse-only", CLFlag(false,"Parse the input, then exit.")); + + //Translation related flags + flags.addFlag("expResult", CLFlag("", "For smtlib translation. Give the expected result", false)); + flags.addFlag("category", CLFlag("unknown", "For smtlib translation. Give the category", false)); + flags.addFlag("translate", CLFlag(false, "Produce a complete translation from " + "the input language to output language. ")); + flags.addFlag("real2int", CLFlag(false, "When translating, convert reals to integers.", false)); + flags.addFlag("convertArith", CLFlag(false, "When translating, try to rewrite arith terms into smt-lib subset", false)); + flags.addFlag("convert2diff", CLFlag("", "When translating, try to force into difference logic. Legal values are int and real.", false)); + flags.addFlag("iteLiftArith", CLFlag(false, "For translation. If true, ite's are lifted out of arith exprs.", false)); + flags.addFlag("convertArray", CLFlag(false, "For translation. If true, arrays are converted to uninterpreted functions if possible.", false)); + flags.addFlag("combineAssump", CLFlag(false, "For translation. If true, assumptions are combined into the query.", false)); + flags.addFlag("convert2array", CLFlag(false, "For translation. If true, try to convert to array-only theory", false)); + flags.addFlag("convertToBV",CLFlag(0, "For translation. Set to nonzero to convert ints to bv's of that length", false)); + flags.addFlag("convert-eq-iff",CLFlag(false, "Convert equality on Boolean expressions to iff.", false)); + flags.addFlag("preSimplify",CLFlag(false, "Simplify each assertion or query before translating it", false)); + flags.addFlag("dump-tcc", CLFlag(false, "Compute and dump TCC only")); + flags.addFlag("trans-skip-pp", CLFlag(false, "Skip preprocess step in translation module", false)); + flags.addFlag("trans-skip-difficulty", CLFlag(false, "Leave out difficulty attribute during translation to SMT v2.0", false)); + flags.addFlag("promote", CLFlag(true, "Promote undefined logic combinations to defined logic combinations during translation to SMT", false)); + + // Parser related flags + flags.addFlag("old-func-syntax",CLFlag(false, "Enable parsing of old-style function syntax", false)); + + // Pretty-printing related flags + flags.addFlag("dagify-exprs", + CLFlag(true, "Print expressions with sharing as DAGs")); + flags.addFlag("lang", CLFlag("presentation", "Input language " + "(presentation, smt, smt2, internal)")); + flags.addFlag("output-lang", CLFlag("", "Output language " + "(presentation, smtlib, simplify, internal, lisp, tptp, spass)")); + flags.addFlag("indent", CLFlag(false, "Print expressions with indentation")); + flags.addFlag("width", CLFlag(80, "Suggested line width for printing")); + flags.addFlag("print-depth", CLFlag(-1, "Max. depth to print expressions ")); + flags.addFlag("print-assump", CLFlag(false, "Print assumptions in Theorems ")); + + // Search Engine (SAT) related flags + flags.addFlag("sat",CLFlag("minisat", "choose a SAT solver to use " + "(sat, minisat)")); + flags.addFlag("de",CLFlag("dfs", "choose a decision engine to use " + "(dfs, sat)")); + + // Proofs and Assumptions + flags.addFlag("proofs", CLFlag(false, "Produce proofs")); + flags.addFlag("check-proofs", CLFlag(false, "Check proofs on-the-fly")); + flags.addFlag("minimizeClauses", CLFlag(false, "Use brute-force minimization of clauses", false)); + flags.addFlag("dynack", CLFlag(false, "Use dynamic Ackermannization", false)); + flags.addFlag("smart-clauses", CLFlag(true, "Learn multiple clauses per conflict")); + // Core framework switches + flags.addFlag("tcc", CLFlag(false, "Check TCCs for each ASSERT and QUERY")); + flags.addFlag("cnf", CLFlag(true, "Convert top-level Boolean formulas to CNF", false)); + flags.addFlag("ignore-cnf-vars", CLFlag(false, "Do not split on aux. CNF vars (with +cnf)", false)); + flags.addFlag("orig-formula", CLFlag(false, "Preserve the original formula with +cnf (for splitter heuristics)", false)); + flags.addFlag("liftITE", CLFlag(false, "Eagerly lift all ITE exprs")); + flags.addFlag("iflift", CLFlag(false, "Translate if-then-else terms to CNF (with +cnf)", false)); + flags.addFlag("circuit", CLFlag(false, "With +cnf, use circuit propagation", false)); + flags.addFlag("un-ite-ify", CLFlag(false, "Unconvert ITE expressions", false)); + flags.addFlag("ite-cond-simp", + CLFlag(false, "Replace ITE condition by TRUE/FALSE in subexprs", false)); + flags.addFlag("preprocess", CLFlag(true, "Preprocess queries")); + flags.addFlag("pp-pushneg", CLFlag(false, "Push negation in preprocessor")); + flags.addFlag("pp-bryant", CLFlag(false, "Enable Bryant algorithm for UF", false)); + flags.addFlag("pp-budget", CLFlag(0, "Budget for new preprocessing step", false)); + flags.addFlag("pp-care", CLFlag(true, "Enable care-set preprocessing step", false)); + flags.addFlag("simp-and", CLFlag(false, "Rewrite x&y to x&y[x/true]", false)); + flags.addFlag("simp-or", CLFlag(false, "Rewrite x|y to x|y[x/false]", false)); + flags.addFlag("pp-batch", CLFlag(false, "Ignore assumptions until query, then process all at once")); + + // Negate the query when translate into tptp + flags.addFlag("negate-query", CLFlag(true, "Negate the query when translate into TPTP format"));; + + // Concrete model generation (counterexamples) flags + flags.addFlag("counterexample", CLFlag(false, "Dump counterexample if formula is invalid or satisfiable")); + flags.addFlag("model", CLFlag(false, "Dump model if formula is invalid or satisfiable")); + flags.addFlag("unknown-check-model", CLFlag(false, "Try to generate model if formula is unknown")); + flags.addFlag("applications", CLFlag(true, "Add relevant function applications and array accesses to the concrete countermodel")); + // Debugging flags (only for the debug build) + // #ifdef _CVC3_DEBUG_MODE + vector > sv; + flags.addFlag("trace", CLFlag(sv, "Tracing. Multiple flags add up.")); + flags.addFlag("dump-trace", CLFlag("", "Dump debugging trace to " + "given file (off when file name is \"\")")); + // #endif + // DP-specific flags + + // Arithmetic + flags.addFlag("arith-new",CLFlag(false, "Use new arithmetic dp", false)); + flags.addFlag("arith3",CLFlag(false, "Use old arithmetic dp that works well with combined theories", false)); + flags.addFlag("var-order", + CLFlag(false, "Use simple variable order in arith", false)); + flags.addFlag("ineq-delay", CLFlag(0, "Accumulate this many inequalities before processing (-1 for don't process until necessary)")); + + flags.addFlag("nonlinear-sign-split", CLFlag(true, "Whether to split on the signs of nontrivial nonlinear terms")); + + flags.addFlag("grayshadow-threshold", CLFlag(-1, "Ignore gray shadows bigger than this (makes solver incomplete)")); + flags.addFlag("pathlength-threshold", CLFlag(-1, "Ignore gray shadows bigger than this (makes solver incomplete)")); + + // Arrays + flags.addFlag("liftReadIte", CLFlag(true, "Lift read of ite")); + + //for LFSC stuff, disable Tseitin CNF conversion, by Yeting + flags.addFlag("cnf-formula", CLFlag(false, "The input must be in CNF. This option automatically enables '-de sat' and disable preprocess")); + + //for LFSC print out, by Yeting + //flags.addFlag("lfsc", CLFlag(false, "the input is already in CNF. This option automatically enables -de sat and disable -preprocess")); + + // for LFSC print, allows different modes by Liana + flags.addFlag("lfsc-mode", + CLFlag(0, "lfsc mode 0: off, 1:normal, 2:cvc3-mimic etc.")); + + + // Quantifiers + flags.addFlag("max-quant-inst", CLFlag(200, "The maximum number of" + " naive instantiations")); + + flags.addFlag("quant-new", + CLFlag(true, "If this option is false, only naive instantiation is called")); + + flags.addFlag("quant-lazy", CLFlag(false, "Instantiate lazily", false)); + + flags.addFlag("quant-sem-match", + CLFlag(false, "Attempt to match semantically when instantiating", false)); + +// flags.addFlag("quant-const-match", +// CLFlag(true, "When matching semantically, only match with constants", false)); + + flags.addFlag("quant-complete-inst", + CLFlag(false, "Try complete instantiation heuristic. +pp-batch will be automatically enabled")); + + flags.addFlag("quant-max-IL", + CLFlag(100, "The maximum Instantiation Level allowed")); + + flags.addFlag("quant-inst-lcache", + CLFlag(true, "Cache instantiations")); + + flags.addFlag("quant-inst-gcache", + CLFlag(false, "Cache instantiations", false)); + + flags.addFlag("quant-inst-tcache", + CLFlag(false, "Cache instantiations", false)); + + + flags.addFlag("quant-inst-true", + CLFlag(true, "Ignore true instantiations")); + + flags.addFlag("quant-pullvar", + CLFlag(false, "Pull out vars", false)); + + flags.addFlag("quant-score", + CLFlag(true, "Use instantiation level")); + + flags.addFlag("quant-polarity", + CLFlag(false, "Use polarity ", false)); + + flags.addFlag("quant-eqnew", + CLFlag(true, "Use new equality matching")); + + flags.addFlag("quant-max-score", + CLFlag(0, "Maximum initial dynamic score")); + + flags.addFlag("quant-trans3", + CLFlag(true, "Use trans heuristic")); + + flags.addFlag("quant-trans2", + CLFlag(true, "Use trans2 heuristic")); + + flags.addFlag("quant-naive-num", + CLFlag(1000, "Maximum number to call naive instantiation")); + + flags.addFlag("quant-naive-inst", + CLFlag(true, "Use naive instantiation")); + + flags.addFlag("quant-man-trig", + CLFlag(true, "Use manual triggers")); + + flags.addFlag("quant-gfact", + CLFlag(false, "Send facts to core directly", false)); + + flags.addFlag("quant-glimit", + CLFlag(1000, "Limit for gfacts", false)); + + flags.addFlag("print-var-type", //by yeting, as requested by Sascha Boehme for proofs + CLFlag(false, "Print types for bound variables")); + + // Bitvectors + flags.addFlag("bv32-flag", + CLFlag(false, "assume that all bitvectors are 32bits with no overflow", false)); + + // Uninterpreted Functions + flags.addFlag("trans-closure", + CLFlag(false,"enables transitive closure of binary relations", false)); + + // Datatypes + flags.addFlag("dt-smartsplits", + CLFlag(true, "enables smart splitting in datatype theory", false)); + flags.addFlag("dt-lazy", + CLFlag(false, "lazy splitting on datatypes", false)); + + return flags; +} + +ValidityChecker* ValidityChecker::create(const CLFlags& flags) { + return new ValidityChecker(flags); +} + +ValidityChecker* ValidityChecker::create() { + return new ValidityChecker(createFlags()); +} + +Type ValidityChecker::boolType() { + return d_em.booleanType(); +} + +Type ValidityChecker::realType() { + return d_em.realType(); +} + +Type ValidityChecker::intType() { + return d_em.integerType(); +} + +Type ValidityChecker::subrangeType(const Expr& l, const Expr& r) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::subtypeType(const Expr& pred, const Expr& witness) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::tupleType(const Type& type0, const Type& type1) { + vector types; + types.push_back(type0); + types.push_back(type1); + return d_em.mkTupleType(types); +} + +Type ValidityChecker::tupleType(const Type& type0, const Type& type1, const Type& type2) { + vector types; + types.push_back(type0); + types.push_back(type1); + types.push_back(type2); + return d_em.mkTupleType(types); +} + +Type ValidityChecker::tupleType(const std::vector& types) { + const vector& v = + *reinterpret_cast*>(&types); + return Type(d_em.mkTupleType(v)); +} + +Type ValidityChecker::recordType(const std::string& field, const Type& type) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::recordType(const std::string& field0, const Type& type0, + const std::string& field1, const Type& type1) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::recordType(const std::string& field0, const Type& type0, + const std::string& field1, const Type& type1, + const std::string& field2, const Type& type2) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::recordType(const std::vector& fields, + const std::vector& types) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::dataType(const std::string& name, + const std::string& constructor, + const std::vector& selectors, + const std::vector& types) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::dataType(const std::string& name, + const std::vector& constructors, + const std::vector >& selectors, + const std::vector >& types) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::dataType(const std::vector& names, + const std::vector >& constructors, + const std::vector > >& selectors, + const std::vector > >& types, + std::vector& returnTypes) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::arrayType(const Type& typeIndex, const Type& typeData) { + return d_em.mkArrayType(typeIndex, typeData); +} + +Type ValidityChecker::bitvecType(int n) { + CheckArgument(n >= 0, n, "cannot construct a bitvector type of negative size"); + return d_em.mkBitVectorType(n); +} + +Type ValidityChecker::funType(const Type& typeDom, const Type& typeRan) { + return d_em.mkFunctionType(typeDom, typeRan); +} + +Type ValidityChecker::funType(const std::vector& typeDom, const Type& typeRan) { + const vector& dom = + *reinterpret_cast*>(&typeDom); + return Type(d_em.mkFunctionType(dom, typeRan)); +} + +Type ValidityChecker::createType(const std::string& typeName) { + return d_em.mkSort(typeName); +} + +Type ValidityChecker::createType(const std::string& typeName, const Type& def) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::lookupType(const std::string& typeName) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +ExprManager* ValidityChecker::getEM() { + return &d_em; +} + +Expr ValidityChecker::varExpr(const std::string& name, const Type& type) { + return d_em.mkVar(name, type); +} + +Expr ValidityChecker::varExpr(const std::string& name, const Type& type, + const Expr& def) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::lookupVar(const std::string& name, Type* type) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::getType(const Expr& e) { + return d_em.getType(e); +} + +Type ValidityChecker::getBaseType(const Expr& e) { + Type t = d_em.getType(e); + return t.isInteger() ? Type(d_em.realType()) : t; +} + +Type ValidityChecker::getBaseType(const Type& t) { + return t.isInteger() ? Type(d_em.realType()) : t; +} + +Expr ValidityChecker::getTypePred(const Type&t, const Expr& e) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::stringExpr(const std::string& str) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::idExpr(const std::string& name) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::listExpr(const std::vector& kids) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::listExpr(const Expr& e1) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::listExpr(const Expr& e1, const Expr& e2) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::listExpr(const Expr& e1, const Expr& e2, const Expr& e3) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::listExpr(const std::string& op, + const std::vector& kids) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::listExpr(const std::string& op, const Expr& e1) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::listExpr(const std::string& op, const Expr& e1, + const Expr& e2) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::listExpr(const std::string& op, const Expr& e1, + const Expr& e2, const Expr& e3) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::printExpr(const Expr& e) { + printExpr(e, Message()); +} + +void ValidityChecker::printExpr(const Expr& e, std::ostream& os) { + Expr::setdepth::Scope sd(os, -1); + Expr::printtypes::Scope pt(os, false); + Expr::setlanguage::Scope sl(os, d_em.getOptions()->outputLanguage); + os << e; +} + +Expr ValidityChecker::parseExpr(const Expr& e) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::parseType(const Expr& e) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::importExpr(const Expr& e) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Type ValidityChecker::importType(const Type& t) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::cmdsFromString(const std::string& s, InputLanguage lang) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::exprFromString(const std::string& e) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::trueExpr() { + return d_em.mkConst(true); +} + +Expr ValidityChecker::falseExpr() { + return d_em.mkConst(false); +} + +Expr ValidityChecker::notExpr(const Expr& child) { + return d_em.mkExpr(CVC4::kind::NOT, child); +} + +Expr ValidityChecker::andExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::AND, left, right); +} + +Expr ValidityChecker::andExpr(const std::vector& children) { + const vector& v = + *reinterpret_cast*>(&children); + return d_em.mkExpr(CVC4::kind::AND, v); +} + +Expr ValidityChecker::orExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::OR, left, right); +} + +Expr ValidityChecker::orExpr(const std::vector& children) { + const vector& v = + *reinterpret_cast*>(&children); + return d_em.mkExpr(CVC4::kind::OR, v); +} + +Expr ValidityChecker::impliesExpr(const Expr& hyp, const Expr& conc) { + return d_em.mkExpr(CVC4::kind::IMPLIES, hyp, conc); +} + +Expr ValidityChecker::iffExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::IFF, left, right); +} + +Expr ValidityChecker::eqExpr(const Expr& child0, const Expr& child1) { + return d_em.mkExpr(CVC4::kind::EQUAL, child0, child1); +} + +Expr ValidityChecker::iteExpr(const Expr& ifpart, const Expr& thenpart, + const Expr& elsepart) { + return d_em.mkExpr(CVC4::kind::ITE, ifpart, thenpart, elsepart); +} + +Expr ValidityChecker::distinctExpr(const std::vector& children) { + const vector& v = + *reinterpret_cast*>(&children); + return d_em.mkExpr(CVC4::kind::DISTINCT, v); +} + +Op ValidityChecker::createOp(const std::string& name, const Type& type) { + return d_em.mkVar(name, type); +} + +Op ValidityChecker::createOp(const std::string& name, const Type& type, + const Expr& def) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Op ValidityChecker::lookupOp(const std::string& name, Type* type) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::funExpr(const Op& op, const Expr& child) { + return d_em.mkExpr(CVC4::kind::APPLY_UF, op, child); +} + +Expr ValidityChecker::funExpr(const Op& op, const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::APPLY_UF, op, left, right); +} + +Expr ValidityChecker::funExpr(const Op& op, const Expr& child0, + const Expr& child1, const Expr& child2) { + return d_em.mkExpr(CVC4::kind::APPLY_UF, op, child0, child1, child2); +} + +Expr ValidityChecker::funExpr(const Op& op, const std::vector& children) { + vector opkids; + opkids.push_back(op); + opkids.insert(opkids.end(), children.begin(), children.end()); + return d_em.mkExpr(CVC4::kind::APPLY_UF, opkids); +} + +bool ValidityChecker::addPairToArithOrder(const Expr& smaller, const Expr& bigger) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::ratExpr(int n, int d) { + return d_em.mkConst(Rational(n, d)); +} + +Expr ValidityChecker::ratExpr(const std::string& n, const std::string& d, int base) { + return d_em.mkConst(Rational(n + '/' + d, base)); +} + +Expr ValidityChecker::ratExpr(const std::string& n, int base) { + return d_em.mkConst(Rational(n, base)); +} + +Expr ValidityChecker::uminusExpr(const Expr& child) { + return d_em.mkExpr(CVC4::kind::UMINUS, child); +} + +Expr ValidityChecker::plusExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::PLUS, left, right); +} + +Expr ValidityChecker::plusExpr(const std::vector& children) { + const vector& v = + *reinterpret_cast*>(&children); + return d_em.mkExpr(CVC4::kind::PLUS, v); +} + +Expr ValidityChecker::minusExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::MINUS, left, right); +} + +Expr ValidityChecker::multExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::MULT, left, right); +} + +Expr ValidityChecker::powExpr(const Expr& x, const Expr& n) { + return d_em.mkExpr(CVC4::kind::POW, x, n); +} + +Expr ValidityChecker::divideExpr(const Expr& numerator, + const Expr& denominator) { + return d_em.mkExpr(CVC4::kind::DIVISION, numerator, denominator); +} + +Expr ValidityChecker::ltExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::LT, left, right); +} + +Expr ValidityChecker::leExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::LEQ, left, right); +} + +Expr ValidityChecker::gtExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::GT, left, right); +} + +Expr ValidityChecker::geExpr(const Expr& left, const Expr& right) { + return d_em.mkExpr(CVC4::kind::GEQ, left, right); +} + +Expr ValidityChecker::recordExpr(const std::string& field, const Expr& expr) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::recordExpr(const std::string& field0, const Expr& expr0, + const std::string& field1, const Expr& expr1) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::recordExpr(const std::string& field0, const Expr& expr0, + const std::string& field1, const Expr& expr1, + const std::string& field2, const Expr& expr2) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::recordExpr(const std::vector& fields, + const std::vector& exprs) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::recSelectExpr(const Expr& record, const std::string& field) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::recUpdateExpr(const Expr& record, const std::string& field, + const Expr& newValue) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::readExpr(const Expr& array, const Expr& index) { + return d_em.mkExpr(CVC4::kind::SELECT, array, index); +} + +Expr ValidityChecker::writeExpr(const Expr& array, const Expr& index, + const Expr& newValue) { + return d_em.mkExpr(CVC4::kind::STORE, array, index, newValue); +} + +Expr ValidityChecker::newBVConstExpr(const std::string& s, int base) { + return d_em.mkConst(CVC4::BitVector(s, base)); +} + +Expr ValidityChecker::newBVConstExpr(const std::vector& bits) { + Integer value = 0; + for(vector::const_iterator i = bits.begin(); i != bits.end(); ++i) { + value *= 2; + value += *i ? 1 : 0; + } + return d_em.mkConst(CVC4::BitVector(bits.size(), value)); +} + +Expr ValidityChecker::newBVConstExpr(const Rational& r, int len) { + // implementation based on CVC3's TheoryBitvector::newBVConstExpr() + + CheckArgument(r.getDenominator() == 1, r, "ValidityChecker::newBVConstExpr: " + "not an integer: `%s'", r.toString().c_str()); + CheckArgument(len > 0, len, "ValidityChecker::newBVConstExpr: " + "len = %d", len); + + string s(r.toString(2)); + size_t strsize = s.size(); + size_t length = len; + Expr res; + if(length > 0 && length != strsize) { + //either (length > strsize) or (length < strsize) + if(length < strsize) { + s = s.substr(strsize - length, length); + } else { + string zeros(""); + for(size_t i = 0, pad = length - strsize; i < pad; ++i) + zeros += "0"; + s = zeros + s; + } + } + + return newBVConstExpr(s, 2); +} + +Expr ValidityChecker::newConcatExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only concat a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only concat a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_CONCAT, t1, t2); +} + +Expr ValidityChecker::newConcatExpr(const std::vector& kids) { + const vector& v = + *reinterpret_cast*>(&kids); + return d_em.mkExpr(CVC4::kind::BITVECTOR_CONCAT, v); +} + +Expr ValidityChecker::newBVExtractExpr(const Expr& e, int hi, int low) { + CheckArgument(e.getType().isBitVector(), e, "can only bvextract from a bitvector, not a `%s'", e.getType().toString().c_str()); + CheckArgument(hi >= low, hi, "extraction [%d:%d] is bad; possibly inverted?", hi, low); + CheckArgument(low >= 0, low, "extraction [%d:%d] is bad (negative)", hi, low); + CheckArgument(CVC4::BitVectorType(e.getType()).getSize() > unsigned(hi), hi, "bitvector is of size %u, extraction [%d:%d] is off-the-end", CVC4::BitVectorType(e.getType()).getSize(), hi, low); + return d_em.mkExpr(CVC4::kind::BITVECTOR_EXTRACT, + d_em.mkConst(CVC4::BitVectorExtract(hi, low)), e); +} + +Expr ValidityChecker::newBVNegExpr(const Expr& t1) { + // CVC3's BVNEG => SMT-LIBv2 bvnot + CheckArgument(t1.getType().isBitVector(), t1, "can only bvneg a bitvector, not a `%s'", t1.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_NOT, t1); +} + +Expr ValidityChecker::newBVAndExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvand a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvand a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_AND, t1, t2); +} + +Expr ValidityChecker::newBVAndExpr(const std::vector& kids) { + // BVAND is not N-ary + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::newBVOrExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvor a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvor a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_OR, t1, t2); +} + +Expr ValidityChecker::newBVOrExpr(const std::vector& kids) { + // BVOR is not N-ary + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::newBVXorExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvxor a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvxor a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_XOR, t1, t2); +} + +Expr ValidityChecker::newBVXorExpr(const std::vector& kids) { + // BVXOR is not N-ary + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::newBVXnorExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvxnor a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvxnor a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_XNOR, t1, t2); +} + +Expr ValidityChecker::newBVXnorExpr(const std::vector& kids) { + // BVXNOR is not N-ary + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::newBVNandExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvnand a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvnand a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_NAND, t1, t2); +} + +Expr ValidityChecker::newBVNorExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvnor a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvnor a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_NOR, t1, t2); +} + +Expr ValidityChecker::newBVCompExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvcomp a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvcomp a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_COMP, t1, t2); +} + +Expr ValidityChecker::newBVLTExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvlt a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvlt a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_ULT, t1, t2); +} + +Expr ValidityChecker::newBVLEExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvle a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvle a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_ULE, t1, t2); +} + +Expr ValidityChecker::newBVSLTExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvslt a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvslt a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_SLT, t1, t2); +} + +Expr ValidityChecker::newBVSLEExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvsle a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvsle a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_SLE, t1, t2); +} + +Expr ValidityChecker::newSXExpr(const Expr& t1, int len) { + CheckArgument(t1.getType().isBitVector(), t1, "can only sx a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(len >= 0, len, "must sx by a positive integer"); + CheckArgument(unsigned(len) >= CVC4::BitVectorType(t1.getType()).getSize(), len, "cannot sx by something smaller than the bitvector (%d < %u)", len, CVC4::BitVectorType(t1.getType()).getSize()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_SIGN_EXTEND, + d_em.mkConst(CVC4::BitVectorSignExtend(len)), t1); +} + +Expr ValidityChecker::newBVUminusExpr(const Expr& t1) { + // CVC3's BVUMINUS => SMT-LIBv2 bvneg + CheckArgument(t1.getType().isBitVector(), t1, "can only bvuminus a bitvector, not a `%s'", t1.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_NEG, t1); +} + +Expr ValidityChecker::newBVSubExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvsub a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvsub by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_SUB, t1, t2); +} + +Expr ValidityChecker::newBVPlusExpr(int numbits, const std::vector& k) { + // BVPLUS is not N-ary + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::newBVPlusExpr(int numbits, const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvplus a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvplus a bitvector, not a `%s'", t2.getType().toString().c_str()); + Expr e = d_em.mkExpr(CVC4::kind::BITVECTOR_PLUS, t1, t2); + unsigned size = CVC4::BitVectorType(e.getType()).getSize(); + CheckArgument(numbits > 0, numbits, + "argument must be positive integer, not %u", numbits); + CheckArgument(unsigned(numbits) == size, numbits, + "argument must match computed size of bitvector sum: " + "passed size == %u, computed size == %u", numbits, size); + return e; +} + +Expr ValidityChecker::newBVMultExpr(int numbits, const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvmult a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvmult by a bitvector, not a `%s'", t2.getType().toString().c_str()); + Expr e = d_em.mkExpr(CVC4::kind::BITVECTOR_MULT, t1, t2); + unsigned size = CVC4::BitVectorType(e.getType()).getSize(); + CheckArgument(numbits > 0, numbits, + "argument must be positive integer, not %u", numbits); + CheckArgument(unsigned(numbits) == size, numbits, + "argument must match computed size of bitvector product: " + "passed size == %u, computed size == %u", numbits, size); + return e; +} + +Expr ValidityChecker::newBVUDivExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvudiv a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvudiv by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_UDIV, t1, t2); +} + +Expr ValidityChecker::newBVURemExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvurem a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvurem by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_UREM, t1, t2); +} + +Expr ValidityChecker::newBVSDivExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvsdiv a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvsdiv by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_SDIV, t1, t2); +} + +Expr ValidityChecker::newBVSRemExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvsrem a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvsrem by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_SREM, t1, t2); +} + +Expr ValidityChecker::newBVSModExpr(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only bvsmod a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only bvsmod by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_SMOD, t1, t2); +} + +Expr ValidityChecker::newFixedLeftShiftExpr(const Expr& t1, int r) { + CheckArgument(t1.getType().isBitVector(), t1, "can only left-shift a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(r >= 0, r, "left shift amount must be >= 0 (you passed %d)", r); + // Defined in: + // http://www.cs.nyu.edu/acsys/cvc3/doc/user_doc.html#user_doc_pres_lang_expr_bit + return d_em.mkExpr(CVC4::kind::BITVECTOR_CONCAT, t1, d_em.mkConst(CVC4::BitVector(r))); +} + +Expr ValidityChecker::newFixedConstWidthLeftShiftExpr(const Expr& t1, int r) { + CheckArgument(t1.getType().isBitVector(), t1, "can only right-shift a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(r >= 0, r, "const-width left shift amount must be >= 0 (you passed %d)", r); + // just turn it into a BVSHL + return d_em.mkExpr(CVC4::kind::BITVECTOR_SHL, t1, d_em.mkConst(CVC4::BitVector(CVC4::BitVectorType(t1.getType()).getSize(), unsigned(r)))); +} + +Expr ValidityChecker::newFixedRightShiftExpr(const Expr& t1, int r) { + CheckArgument(t1.getType().isBitVector(), t1, "can only right-shift a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(r >= 0, r, "right shift amount must be >= 0 (you passed %d)", r); + // Defined in: + // http://www.cs.nyu.edu/acsys/cvc3/doc/user_doc.html#user_doc_pres_lang_expr_bit + // Should be equivalent to a BVLSHR; just turn it into that. + return d_em.mkExpr(CVC4::kind::BITVECTOR_LSHR, t1, d_em.mkConst(CVC4::BitVector(CVC4::BitVectorType(t1.getType()).getSize(), unsigned(r)))); +} + +Expr ValidityChecker::newBVSHL(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only right-shift a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only right-shift by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_SHL, t1, t2); +} + +Expr ValidityChecker::newBVLSHR(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only right-shift a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only right-shift by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_LSHR, t1, t2); +} + +Expr ValidityChecker::newBVASHR(const Expr& t1, const Expr& t2) { + CheckArgument(t1.getType().isBitVector(), t1, "can only right-shift a bitvector, not a `%s'", t1.getType().toString().c_str()); + CheckArgument(t2.getType().isBitVector(), t2, "can only right-shift by a bitvector, not a `%s'", t2.getType().toString().c_str()); + return d_em.mkExpr(CVC4::kind::BITVECTOR_ASHR, t1, t2); +} + +Rational ValidityChecker::computeBVConst(const Expr& e) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::tupleExpr(const std::vector& exprs) { + const vector& v = + *reinterpret_cast*>(&exprs); + return d_em.mkExpr(CVC4::kind::TUPLE, v); +} + +Expr ValidityChecker::tupleSelectExpr(const Expr& tuple, int index) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::tupleUpdateExpr(const Expr& tuple, int index, + const Expr& newValue) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::datatypeConsExpr(const std::string& constructor, const std::vector& args) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::datatypeSelExpr(const std::string& selector, const Expr& arg) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::datatypeTestExpr(const std::string& constructor, const Expr& arg) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::boundVarExpr(const std::string& name, const std::string& uid, + const Type& type) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::forallExpr(const std::vector& vars, const Expr& body) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::forallExpr(const std::vector& vars, const Expr& body, + const Expr& trigger) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::forallExpr(const std::vector& vars, const Expr& body, + const std::vector& triggers) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::forallExpr(const std::vector& vars, const Expr& body, + const std::vector >& triggers) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::setTriggers(const Expr& e, const std::vector > & triggers) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::setTriggers(const Expr& e, const std::vector& triggers) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::setTrigger(const Expr& e, const Expr& trigger) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::setMultiTrigger(const Expr& e, const std::vector& multiTrigger) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::existsExpr(const std::vector& vars, const Expr& body) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Op ValidityChecker::lambdaExpr(const std::vector& vars, const Expr& body) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Op ValidityChecker::transClosure(const Op& op) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::simulateExpr(const Expr& f, const Expr& s0, + const std::vector& inputs, + const Expr& n) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::setResourceLimit(unsigned limit) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::setTimeLimit(unsigned limit) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::assertFormula(const Expr& e) { + d_smt.assertFormula(CVC4::BoolExpr(e)); +} + +void ValidityChecker::registerAtom(const Expr& e) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::getImpliedLiteral() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::simplify(const Expr& e) { + return d_smt.simplify(e); +} + +static QueryResult cvc4resultToCvc3result(CVC4::Result r) { + switch(r.isSat()) { + case CVC4::Result::SAT: + return SATISFIABLE; + case CVC4::Result::UNSAT: + return UNSATISFIABLE; + default: + ; + } + + switch(r.isValid()) { + case CVC4::Result::VALID: + return VALID; + case CVC4::Result::INVALID: + return INVALID; + default: + return UNKNOWN; + } +} + +QueryResult ValidityChecker::query(const Expr& e) { + return cvc4resultToCvc3result(d_smt.query(CVC4::BoolExpr(e))); +} + +QueryResult ValidityChecker::checkUnsat(const Expr& e) { + return cvc4resultToCvc3result(d_smt.checkSat(CVC4::BoolExpr(e))); +} + +QueryResult ValidityChecker::checkContinue() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +QueryResult ValidityChecker::restart(const Expr& e) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::returnFromCheck() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::getUserAssumptions(std::vector& assumptions) { + CheckArgument(assumptions.empty(), assumptions, "assumptions arg must be empty"); + vector v = d_smt.getAssertions(); + assumptions.swap(*reinterpret_cast*>(&v)); +} + +void ValidityChecker::getInternalAssumptions(std::vector& assumptions) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::getAssumptions(std::vector& assumptions) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::getAssumptionsUsed(std::vector& assumptions) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::getProofQuery() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::getCounterExample(std::vector& assumptions, + bool inOrder) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::getConcreteModel(ExprMap& m) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +QueryResult ValidityChecker::tryModelGeneration() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +FormulaValue ValidityChecker::value(const Expr& e) { + CheckArgument(e.getType() == d_em.booleanType(), e, "argument must be a formula"); + return d_smt.getValue(e).getConst() ? TRUE_VAL : FALSE_VAL; +} + +bool ValidityChecker::inconsistent(std::vector& assumptions) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +bool ValidityChecker::inconsistent() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +bool ValidityChecker::incomplete() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +bool ValidityChecker::incomplete(std::vector& reasons) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Proof ValidityChecker::getProof() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::getTCC() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::getAssumptionsTCC(std::vector& assumptions) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Proof ValidityChecker::getProofTCC() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Expr ValidityChecker::getClosure() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Proof ValidityChecker::getProofClosure() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +int ValidityChecker::stackLevel() { + return d_smt.getStackLevel(); +} + +void ValidityChecker::push() { + d_smt.push(); +} + +void ValidityChecker::pop() { + d_smt.pop(); +} + +void ValidityChecker::popto(int stackLevel) { + CheckArgument(stackLevel >= 0, stackLevel, + "Cannot pop to a negative stack level %u", stackLevel); + CheckArgument(unsigned(stackLevel) <= d_smt.getStackLevel(), stackLevel, + "Cannot pop to a level higher than the current one! " + "At level %u, user requested level %d", + d_smt.getStackLevel(), stackLevel); + while(unsigned(stackLevel) < d_smt.getStackLevel()) { + pop(); + } +} + +int ValidityChecker::scopeLevel() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::pushScope() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::popScope() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::poptoScope(int scopeLevel) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +Context* ValidityChecker::getCurrentContext() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::reset() { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +void ValidityChecker::logAnnotation(const Expr& annot) { + Unimplemented("This CVC3 compatibility function not yet implemented (sorry!)"); +} + +static void doCommands(CVC4::parser::Parser* parser, CVC4::SmtEngine& smt, CVC4::Options& opts) { + while(CVC4::Command* cmd = parser->nextCommand()) { + if(opts.verbosity >= 0) { + cmd->invoke(&smt, *opts.out); + } else { + cmd->invoke(&smt); + } + delete cmd; + } +} + +void ValidityChecker::loadFile(const std::string& fileName, + InputLanguage lang, + bool interactive, + bool calledFromParser) { + CVC4::Options opts = *d_em.getOptions(); + opts.inputLanguage = lang; + opts.interactive = interactive; + CVC4::parser::ParserBuilder parserBuilder(&d_em, fileName, opts); + CVC4::parser::Parser* parser = parserBuilder.build(); + doCommands(parser, d_smt, opts); + delete parser; +} + +void ValidityChecker::loadFile(std::istream& is, + InputLanguage lang, + bool interactive) { + CVC4::Options opts = *d_em.getOptions(); + opts.inputLanguage = lang; + opts.interactive = interactive; + CVC4::parser::ParserBuilder parserBuilder(&d_em, "[stream]", opts); + CVC4::parser::Parser* parser = parserBuilder.withStreamInput(is).build(); + doCommands(parser, d_smt, opts); + delete parser; +} + +Statistics& ValidityChecker::getStatistics() { + return *d_smt.getStatisticsRegistry(); +} + +void ValidityChecker::printStatistics() { + Message() << d_smt.getStatisticsRegistry(); +} + +}/* CVC3 namespace */ diff --git a/src/compat/cvc3_compat.h b/src/compat/cvc3_compat.h new file mode 100644 index 000000000..36c5c0f6a --- /dev/null +++ b/src/compat/cvc3_compat.h @@ -0,0 +1,1465 @@ +/********************* */ +/*! \file cvc3_compat.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 CVC3 compatibility layer for CVC4 + ** + ** CVC3 compatibility layer for CVC4. This version was derived from + ** the following CVS revisions of the following files in CVC3. If + ** those files have a later revision, then this file might be out of + ** date. + ** + ** src/include/vc.h 1.36 + ** src/include/expr.h 1.39 + ** src/include/command_line_flags.h 1.3 + ** src/include/queryresult.h 1.2 + ** src/include/formula_value.h 1.1 + **/ + +#include "cvc4_public.h" + +#ifndef __CVC4__CVC3_COMPAT_H +#define __CVC4__CVC3_COMPAT_H + +// keep the CVC3 include guard also +#if defined(_cvc3__include__vc_h_) || \ + defined(_cvc3__expr_h_) || \ + defined(_cvc3__command_line_flags_h_) || \ + defined(_cvc3__include__queryresult_h_) || \ + defined(_cvc3__include__formula_value_h_) + +#error "A CVC3 header file was included before CVC4's cvc3_compat.h header. Please include cvc3_compat.h rather than any CVC3 headers." + +#else + +// define these so the files are skipped if the user #includes them too +#define _cvc3__expr_h_ +#define _cvc3__include__vc_h_ +#define _cvc3__command_line_flags_h_ +#define _cvc3__include__queryresult_h_ +#define _cvc3__include__formula_value_h_ + +#include "expr/expr_manager.h" +#include "expr/expr.h" +#include "expr/type.h" + +#include "smt/smt_engine.h" + +#include "util/rational.h" +#include "util/integer.h" + +#include "util/exception.h" +#include "util/hash.h" + +#include +#include +#include + +// some #defines that CVC3 exported to userspace :( +#ifdef CVC4_DEBUG +# define DebugAssert(cond, ...) Assert(cond, "CVC3-style assertion failed"); +# define IF_DEBUG(x) x +#else +# define DebugAssert(...) +# define IF_DEBUG(x) +#endif +#define FatalAssert(cond, ...) AlwaysAssert(cond, "CVC3-style assertion failed"); + +//class CInterface; + +namespace CVC3 { + +std::string int2string(int n); + +//! Different types of command line flags +typedef enum { + CLFLAG_NULL, + CLFLAG_BOOL, + CLFLAG_INT, + CLFLAG_STRING, + CLFLAG_STRVEC //!< Vector of pair +} CLFlagType; + +std::ostream& operator<<(std::ostream& out, CLFlagType clft); + +/*! + Class CLFlag (for Command Line Flag) + + Author: Sergey Berezin + + Date: Fri May 30 14:10:48 2003 + + This class implements a data structure to hold a value of a single + command line flag. +*/ +class CLFlag { + //! Type of the argument + CLFlagType d_tp; + //! The argument + union { + bool b; + int i; + std::string* s; + std::vector >* sv; + } d_data; + +public: + + //! Constructor for a boolean flag + CLFlag(bool b, const std::string& help, bool display = true); + //! Constructor for an integer flag + CLFlag(int i, const std::string& help, bool display = true); + //! Constructor for a string flag + CLFlag(const std::string& s, const std::string& help, bool display = true); + //! Constructor for a string flag from char* + CLFlag(const char* s, const std::string& help, bool display = true); + //! Constructor for a vector flag + CLFlag(const std::vector >& sv, + const std::string& help, bool display = true); + //! Default constructor + CLFlag(); + //! Copy constructor + CLFlag(const CLFlag& f); + //! Destructor + ~CLFlag(); + + //! Assignment from another flag + CLFlag& operator=(const CLFlag& f); + //! Assignment of a boolean value + /*! The flag must already have the right type */ + CLFlag& operator=(bool b); + //! Assignment of an integer value + /*! The flag must already have the right type */ + CLFlag& operator=(int i); + //! Assignment of a string value + /*! The flag must already have a string type. */ + CLFlag& operator=(const std::string& s); + //! Assignment of an string value from char* + /*! The flag must already have a string type. */ + CLFlag& operator=(const char* s); + //! Assignment of a string value with a boolean tag to a vector flag + /*! The flag must already have a vector type. The pair of + will be appended to the vector. */ + CLFlag& operator=(const std::pair& p); + //! Assignment of a vector value + /*! The flag must already have a vector type. */ + CLFlag& operator=(const std::vector >& sv); + + // Accessor methods + //! Return the type of the flag + CLFlagType getType() const; + /*! @brief Return true if the flag was modified from the default + value (e.g. set on the command line) */ + bool modified() const; + //! Return true if flag should be displayed in regular help + bool display() const; + + // The value accessors return a reference. For the system-wide + // flags, this reference will remain valid throughout the run of the + // program, even if the flag's value changes. So, the reference can + // be cached, and the value can be checked directly (which is more + // efficient). + const bool& getBool() const; + + const int& getInt() const; + + const std::string& getString() const; + + const std::vector >& getStrVec() const; + + const std::string& getHelp() const; + +};/* class CLFlag */ + +/////////////////////////////////////////////////////////////////////// +// Class CLFlag (for Command Line Flag) +// +// Author: Sergey Berezin +// Date: Fri May 30 14:10:48 2003 +// +// Database of command line flags. +/////////////////////////////////////////////////////////////////////// + +class CLFlags { + typedef std::map FlagMap; + FlagMap d_map; + +public: + // Public methods + // Add a new flag. The name must be a complete flag name. + void addFlag(const std::string& name, const CLFlag& f); + // Count how many flags match the name prefix + size_t countFlags(const std::string& name) const; + // Match the name prefix and add all the matching names to the vector + size_t countFlags(const std::string& name, + std::vector& names) const; + // Retrieve an existing flag. The 'name' must be a full name of an + // existing flag. + const CLFlag& getFlag(const std::string& name) const; + + const CLFlag& operator[](const std::string& name) const; + + // Setting the flag to a new value, but preserving the help string. + // The 'name' prefix must uniquely resolve to an existing flag. + void setFlag(const std::string& name, const CLFlag& f); + + // Variants of setFlag for all the types + void setFlag(const std::string& name, bool b); + void setFlag(const std::string& name, int i); + void setFlag(const std::string& name, const std::string& s); + void setFlag(const std::string& name, const char* s); + void setFlag(const std::string& name, const std::pair& p); + void setFlag(const std::string& name, + const std::vector >& sv); + +};/* class CLFlags */ + +class Context; +class Proof {}; + +using CVC4::ExprManager; +using CVC4::InputLanguage; +using CVC4::Rational; +using CVC4::Integer; +using CVC4::Exception; +using CVC4::Cardinality; +using namespace CVC4::kind; + +typedef size_t ExprIndex; +typedef CVC4::TypeCheckingException TypecheckException; +typedef size_t Unsigned; + +static const int READ = ::CVC4::kind::SELECT; +static const int WRITE = ::CVC4::kind::STORE; + +// CVC4 has a more sophisticated Cardinality type; +// but we can support comparison against CVC3's more +// coarse-grained Cardinality. +enum CVC3CardinalityKind { + CARD_FINITE, + CARD_INFINITE, + CARD_UNKNOWN +};/* enum CVC3CardinalityKind */ + +std::ostream& operator<<(std::ostream& out, CVC3CardinalityKind c); + +bool operator==(const Cardinality& c, CVC3CardinalityKind d); +bool operator==(CVC3CardinalityKind d, const Cardinality& c); +bool operator!=(const Cardinality& c, CVC3CardinalityKind d); +bool operator!=(CVC3CardinalityKind d, const Cardinality& c); + +class Expr; + +template +class ExprMap : public std::map { +};/* class ExprMap */ + +template +class ExprHashMap : public std::hash_map { +public: + void insert(Expr a, Expr b); +};/* class ExprHashMap */ + +class Type : public CVC4::Type { +public: + Type(); + Type(const CVC4::Type& type); + Type(const Type& type); + Expr getExpr() const; + + // Reasoning about children + int arity() const; + Type operator[](int i) const; + + // Core testers + bool isBool() const; + bool isSubtype() const; + //! Return cardinality of type + Cardinality card() const; + //! Return nth (starting with 0) element in a finite type + /*! Returns NULL Expr if unable to compute nth element + */ + Expr enumerateFinite(Unsigned n) const; + //! Return size of a finite type; returns 0 if size cannot be determined + Unsigned sizeFinite() const; + + // Core constructors + static Type typeBool(ExprManager* em); + static Type funType(const std::vector& typeDom, const Type& typeRan); + Type funType(const Type& typeRan) const; + +};/* class CVC3::Type */ + +/** + * Expr class for CVC3 compatibility layer. + * + * This class is identical to (and convertible to/from) a CVC4 Expr, + * except that a few additional functions are supported to provide + * naming compatibility with CVC3. + */ +class Expr : public CVC4::Expr { +public: + Expr(); + Expr(const Expr& e); + Expr(const CVC4::Expr& e); + + // Compound expression constructors + Expr eqExpr(const Expr& right) const; + Expr notExpr() const; + Expr negate() const; // avoid double-negatives + Expr andExpr(const Expr& right) const; + Expr orExpr(const Expr& right) const; + Expr iteExpr(const Expr& thenpart, const Expr& elsepart) const; + Expr iffExpr(const Expr& right) const; + Expr impExpr(const Expr& right) const; + Expr xorExpr(const Expr& right) const; + + Expr substExpr(const std::vector& oldTerms, + const std::vector& newTerms) const; + Expr substExpr(const ExprHashMap& oldToNew) const; + + Expr operator!() const; + Expr operator&&(const Expr& right) const; + Expr operator||(const Expr& right) const; + + static size_t hash(const Expr& e); + + size_t hash() const; + + // Core expression testers + + bool isFalse() const; + bool isTrue() const; + bool isBoolConst() const; + bool isVar() const; + + bool isEq() const; + bool isNot() const; + bool isAnd() const; + bool isOr() const; + bool isITE() const; + bool isIff() const; + bool isImpl() const; + bool isXor() const; + + bool isRational() const; + bool isSkolem() const; + + //! Get the manual triggers of the closure Expr + std::vector< std::vector > getTriggers() const; + + // Get the expression manager. The expression must be non-null. + ExprManager* getEM() const; + + // Return a ref to the vector of children. + std::vector getKids() const; + + // Get the index field + ExprIndex getIndex() const; + + // Return the number of children. Note, that an application of a + // user-defined function has the arity of that function (the number + // of arguments), and the function name itself is part of the + // operator. + int arity() const; + + // Return the ith child. As with arity, it's also the ith argument + // in function application. + Expr operator[](int i) const; + + //! Remove leading NOT if any + Expr unnegate() const; + + // Check if Expr is not Null + bool isInitialized() const; + + //! Get the type. Recursively compute if necessary + Type getType() const; + //! Look up the current type. Do not recursively compute (i.e. may be NULL) + Type lookupType() const; + +};/* class CVC3::Expr */ + +typedef Expr Op; +typedef CVC4::StatisticsRegistry Statistics; + +#define PRESENTATION_LANG ::CVC4::language::input::LANG_CVC4 +#define SMTLIB_LANG ::CVC4::language::input::LANG_SMTLIB +#define SMTLIB_V2_LANG ::CVC4::language::input::LANG_SMTLIB_V2 +#define AST_LANG ::CVC4::language::input::LANG_AST + +/*****************************************************************************/ +/* + * Type for result of queries. VALID and UNSATISFIABLE are treated as + * equivalent, as are SATISFIABLE and INVALID. + */ +/*****************************************************************************/ +typedef enum QueryResult { + SATISFIABLE = 0, + INVALID = 0, + VALID = 1, + UNSATISFIABLE = 1, + ABORT, + UNKNOWN +} QueryResult; + +std::ostream& operator<<(std::ostream& out, QueryResult qr); + +/*****************************************************************************/ +/* + * Type for truth value of formulas. + */ +/*****************************************************************************/ +typedef enum FormulaValue { + TRUE_VAL, + FALSE_VAL, + UNKNOWN_VAL +} FormulaValue; + +std::ostream& operator<<(std::ostream& out, FormulaValue fv); + +/*****************************************************************************/ +/*! + *\class ValidityChecker + *\brief CVC3 API (compatibility layer for CVC4) + * + * All terms and formulas are represented as expressions using the Expr class. + * The notion of a context is also important. A context is a "background" set + * of formulas which are assumed to be true or false. Formulas can be added to + * the context explicitly, using assertFormula, or they may be added as part of + * processing a query command. At any time, the current set of formulas making + * up the context can be retrieved using getAssumptions. + */ +/*****************************************************************************/ +class CVC4_PUBLIC ValidityChecker { + + CLFlags* d_clflags; + CVC4::ExprManager d_em; + CVC4::SmtEngine d_smt; + + ValidityChecker(const CLFlags& clflags); + +public: + //! Constructor + ValidityChecker(); + //! Destructor + virtual ~ValidityChecker(); + + //! Return the set of command-line flags + /*! The flags are returned by reference, and if modified, will have an + immediate effect on the subsequent commands. Note that not all flags will + have such an effect; some flags are used only at initialization time (like + "sat"), and therefore, will not take effect if modified after + ValidityChecker is created. + */ + virtual CLFlags& getFlags() const; + //! Force reprocessing of all flags + virtual void reprocessFlags(); + + /***************************************************************************/ + /* + * Static methods + */ + /***************************************************************************/ + + //! Create the set of command line flags with default values; + /*! + \return the set of flags by value + */ + static CLFlags createFlags(); + //! Create an instance of ValidityChecker + /*! + \param flags is the set of command line flags. + */ + static ValidityChecker* create(const CLFlags& flags); + //! Create an instance of ValidityChecker using default flag values. + static ValidityChecker* create(); + + /***************************************************************************/ + /*! + *\name Type-related methods + * Methods for creating and looking up types + *\sa class Type + *@{ + */ + /***************************************************************************/ + + // Basic types + virtual Type boolType(); //!< Create type BOOLEAN + + virtual Type realType(); //!< Create type REAL + + virtual Type intType(); //!< Create type INT + + //! Create a subrange type [l..r] + /*! l and r can be Null; l=Null represents minus infinity, r=Null is + * plus infinity. + */ + virtual Type subrangeType(const Expr& l, const Expr& r); + + //! Creates a subtype defined by the given predicate + /*! + * \param pred is a predicate taking one argument of type T and returning + * Boolean. The resulting type is a subtype of T whose elements x are those + * satisfying the predicate pred(x). + * + * \param witness is an expression of type T for which pred holds (if a Null + * expression is passed as a witness, cvc will try to prove \f$\exists x. pred(x))\f$. + * if the witness check fails, a TypecheckException is thrown. + */ + virtual Type subtypeType(const Expr& pred, const Expr& witness); + + // Tuple types + //! 2-element tuple + virtual Type tupleType(const Type& type0, const Type& type1); + + //! 3-element tuple + virtual Type tupleType(const Type& type0, const Type& type1, + const Type& type2); + //! n-element tuple (from a vector of types) + virtual Type tupleType(const std::vector& types); + + // Record types + //! 1-element record + virtual Type recordType(const std::string& field, const Type& type); + + //! 2-element record + /*! Fields will be sorted automatically */ + virtual Type recordType(const std::string& field0, const Type& type0, + const std::string& field1, const Type& type1); + //! 3-element record + /*! Fields will be sorted automatically */ + virtual Type recordType(const std::string& field0, const Type& type0, + const std::string& field1, const Type& type1, + const std::string& field2, const Type& type2); + //! n-element record (fields and types must be of the same length) + /*! Fields will be sorted automatically */ + virtual Type recordType(const std::vector& fields, + const std::vector& types); + + // Datatypes + + //! Single datatype, single constructor + /*! The types are either type exressions (obtained from a type with + * getExpr()) or string expressions containing the name of (one of) the + * dataType(s) being defined. */ + virtual Type dataType(const std::string& name, + const std::string& constructor, + const std::vector& selectors, + const std::vector& types); + + //! Single datatype, multiple constructors + /*! The types are either type exressions (obtained from a type with + * getExpr()) or string expressions containing the name of (one of) the + * dataType(s) being defined. */ + virtual Type dataType(const std::string& name, + const std::vector& constructors, + const std::vector >& selectors, + const std::vector >& types); + + //! Multiple datatypes + /*! The types are either type exressions (obtained from a type with + * getExpr()) or string expressions containing the name of (one of) the + * dataType(s) being defined. */ + virtual void dataType(const std::vector& names, + const std::vector >& constructors, + const std::vector > >& selectors, + const std::vector > >& types, + std::vector& returnTypes); + + //! Create an array type (ARRAY typeIndex OF typeData) + virtual Type arrayType(const Type& typeIndex, const Type& typeData); + + //! Create a bitvector type of length n + virtual Type bitvecType(int n); + + //! Create a function type typeDom -> typeRan + virtual Type funType(const Type& typeDom, const Type& typeRan); + + //! Create a function type (t1,t2,...,tn) -> typeRan + virtual Type funType(const std::vector& typeDom, const Type& typeRan); + + //! Create named user-defined uninterpreted type + virtual Type createType(const std::string& typeName); + + //! Create named user-defined interpreted type (type abbreviation) + virtual Type createType(const std::string& typeName, const Type& def); + + //! Lookup a user-defined (uninterpreted) type by name. Returns Null if none. + virtual Type lookupType(const std::string& typeName); + + /*@}*/ // End of Type-related methods + + /***************************************************************************/ + /*! + *\name General Expr methods + *\sa class Expr + *\sa class ExprManager + *@{ + */ + /***************************************************************************/ + + //! Return the ExprManager + virtual ExprManager* getEM(); + + //! Create a variable with a given name and type + /*! + \param name is the name of the variable + \param type is its type. The type cannot be a function type. + \return an Expr representation of a new variable + */ + virtual Expr varExpr(const std::string& name, const Type& type); + + //! Create a variable with a given name, type, and value + virtual Expr varExpr(const std::string& name, const Type& type, + const Expr& def); + + //! Get the variable associated with a name, and its type + /*! + \param name is the variable name + \param type is where the type value is returned + + \return a variable by the name. If there is no such Expr, a NULL \ + Expr is returned. + */ + virtual Expr lookupVar(const std::string& name, Type* type); + + //! Get the type of the Expr. + virtual Type getType(const Expr& e); + + //! Get the largest supertype of the Expr. + virtual Type getBaseType(const Expr& e); + + //! Get the largest supertype of the Type. + virtual Type getBaseType(const Type& t); + + //! Get the subtype predicate + virtual Expr getTypePred(const Type&t, const Expr& e); + + //! Create a string Expr + virtual Expr stringExpr(const std::string& str); + + //! Create an ID Expr + virtual Expr idExpr(const std::string& name); + + //! Create a list Expr + /*! Intermediate representation for DP-specific expressions. + * Normally, the first element of the list is a string Expr + * representing an operator, and the rest of the list are the + * arguments. For example, + * + * kids.push_back(vc->stringExpr("PLUS")); + * kids.push_back(x); // x and y are previously created Exprs + * kids.push_back(y); + * Expr lst = vc->listExpr(kids); + * + * Or, alternatively (using its overloaded version): + * + * Expr lst = vc->listExpr("PLUS", x, y); + * + * or + * + * vector summands; + * summands.push_back(x); summands.push_back(y); ... + * Expr lst = vc->listExpr("PLUS", summands); + */ + virtual Expr listExpr(const std::vector& kids); + + //! Overloaded version of listExpr with one argument + virtual Expr listExpr(const Expr& e1); + + //! Overloaded version of listExpr with two arguments + virtual Expr listExpr(const Expr& e1, const Expr& e2); + + //! Overloaded version of listExpr with three arguments + virtual Expr listExpr(const Expr& e1, const Expr& e2, const Expr& e3); + + //! Overloaded version of listExpr with string operator and many arguments + virtual Expr listExpr(const std::string& op, + const std::vector& kids); + + //! Overloaded version of listExpr with string operator and one argument + virtual Expr listExpr(const std::string& op, const Expr& e1); + + //! Overloaded version of listExpr with string operator and two arguments + virtual Expr listExpr(const std::string& op, const Expr& e1, + const Expr& e2); + + //! Overloaded version of listExpr with string operator and three arguments + virtual Expr listExpr(const std::string& op, const Expr& e1, + const Expr& e2, const Expr& e3); + + //! Prints e to the standard output + virtual void printExpr(const Expr& e); + + //! Prints e to the given ostream + virtual void printExpr(const Expr& e, std::ostream& os); + + //! Parse an expression using a Theory-specific parser + virtual Expr parseExpr(const Expr& e); + + //! Parse a type expression using a Theory-specific parser + virtual Type parseType(const Expr& e); + + //! Import the Expr from another instance of ValidityChecker + /*! When expressions need to be passed among several instances of + * ValidityChecker, they need to be explicitly imported into the + * corresponding instance using this method. The return result is + * an identical expression that belongs to the current instance of + * ValidityChecker, and can be safely used as part of more complex + * expressions from the same instance. + */ + virtual Expr importExpr(const Expr& e); + + //! Import the Type from another instance of ValidityChecker + /*! \sa getType() */ + virtual Type importType(const Type& t); + + //! Parse a sequence of commands from a presentation language string + virtual void cmdsFromString(const std::string& s, + InputLanguage lang = PRESENTATION_LANG); + + //! Parse an expression from a presentation language string + virtual Expr exprFromString(const std::string& e); + + /*@}*/ // End of General Expr Methods + + /***************************************************************************/ + /*! + *\name Core expression methods + * Methods for manipulating core expressions + * + * Except for equality and ite, the children provided as arguments must be of + * type Boolean. + *@{ + */ + /***************************************************************************/ + + //! Return TRUE Expr + virtual Expr trueExpr(); + + //! Return FALSE Expr + virtual Expr falseExpr(); + + //! Create negation + virtual Expr notExpr(const Expr& child); + + //! Create 2-element conjunction + virtual Expr andExpr(const Expr& left, const Expr& right); + + //! Create n-element conjunction + virtual Expr andExpr(const std::vector& children); + + //! Create 2-element disjunction + virtual Expr orExpr(const Expr& left, const Expr& right); + + //! Create n-element disjunction + virtual Expr orExpr(const std::vector& children); + + //! Create Boolean implication + virtual Expr impliesExpr(const Expr& hyp, const Expr& conc); + + //! Create left IFF right (boolean equivalence) + virtual Expr iffExpr(const Expr& left, const Expr& right); + + //! Create an equality expression. + /*! + The two children must have the same type, and cannot be of type + Boolean. + */ + virtual Expr eqExpr(const Expr& child0, const Expr& child1); + + //! Create IF ifpart THEN thenpart ELSE elsepart ENDIF + /*! + \param ifpart must be of type Boolean. + \param thenpart and \param elsepart must have the same type, which will + also be the type of the ite expression. + */ + virtual Expr iteExpr(const Expr& ifpart, const Expr& thenpart, + const Expr& elsepart); + + /** + * Create an expression asserting that all the children are different. + * @param children the children to be asserted different + */ + virtual Expr distinctExpr(const std::vector& children); + + /*@}*/ // End of Core expression methods + + /***************************************************************************/ + /*! + *\name User-defined (uninterpreted) function methods + * Methods for manipulating uninterpreted function expressions + *@{ + */ + /***************************************************************************/ + + //! Create a named uninterpreted function with a given type + /*! + \param name is the new function's name (as ID Expr) + \param type is a function type ( [range -> domain] ) + */ + virtual Op createOp(const std::string& name, const Type& type); + + //! Create a named user-defined function with a given type + virtual Op createOp(const std::string& name, const Type& type, + const Expr& def); + + //! Get the Op associated with a name, and its type + /*! + \param name is the operator name + \param type is where the type value is returned + + \return an Op by the name. If there is no such Op, a NULL \ + Op is returned. + */ + virtual Op lookupOp(const std::string& name, Type* type); + + //! Unary function application (op must be of function type) + virtual Expr funExpr(const Op& op, const Expr& child); + + //! Binary function application (op must be of function type) + virtual Expr funExpr(const Op& op, const Expr& left, const Expr& right); + + //! Ternary function application (op must be of function type) + virtual Expr funExpr(const Op& op, const Expr& child0, + const Expr& child1, const Expr& child2); + + //! n-ary function application (op must be of function type) + virtual Expr funExpr(const Op& op, const std::vector& children); + + /*@}*/ // End of User-defined (uninterpreted) function methods + + /***************************************************************************/ + /*! + *\name Arithmetic expression methods + * Methods for manipulating arithmetic expressions + * + * These functions create arithmetic expressions. The children provided + * as arguments must be of type Real. + *@{ + */ + /***************************************************************************/ + + /*! + * Add the pair of variables to the variable ordering for aritmetic solving. + * Terms that are not arithmetic will be ignored. + * \param smaller the smaller variable + * \param bigger the bigger variable + */ + virtual bool addPairToArithOrder(const Expr& smaller, const Expr& bigger); + + //! Create a rational number with numerator n and denominator d. + /*! + \param n the numerator + \param d the denominator, cannot be 0. + */ + virtual Expr ratExpr(int n, int d = 1); + + //! Create a rational number with numerator n and denominator d. + /*! + Here n and d are given as strings. They are converted to + arbitrary-precision integers according to the given base. + */ + virtual Expr ratExpr(const std::string& n, const std::string& d, int base); + + //! Create a rational from a single string. + /*! + \param n can be a string containing an integer, a pair of integers + "nnn/ddd", or a number in the fixed or floating point format. + \param base is the base in which to interpret the string. + */ + virtual Expr ratExpr(const std::string& n, int base = 10); + + //! Unary minus. + virtual Expr uminusExpr(const Expr& child); + + //! Create 2-element sum (left + right) + virtual Expr plusExpr(const Expr& left, const Expr& right); + + //! Create n-element sum + virtual Expr plusExpr(const std::vector& children); + + //! Make a difference (left - right) + virtual Expr minusExpr(const Expr& left, const Expr& right); + + //! Create a product (left * right) + virtual Expr multExpr(const Expr& left, const Expr& right); + + //! Create a power expression (x ^ n); n must be integer + virtual Expr powExpr(const Expr& x, const Expr& n); + + //! Create expression x / y + virtual Expr divideExpr(const Expr& numerator, const Expr& denominator); + + //! Create (left < right) + virtual Expr ltExpr(const Expr& left, const Expr& right); + + //! Create (left <= right) + virtual Expr leExpr(const Expr& left, const Expr& right); + + //! Create (left > right) + virtual Expr gtExpr(const Expr& left, const Expr& right); + + //! Create (left >= right) + virtual Expr geExpr(const Expr& left, const Expr& right); + + /*@}*/ // End of Arithmetic expression methods + + /***************************************************************************/ + /*! + *\name Record expression methods + * Methods for manipulating record expressions + *@{ + */ + /***************************************************************************/ + + //! Create a 1-element record value (# field := expr #) + /*! Fields will be sorted automatically */ + virtual Expr recordExpr(const std::string& field, const Expr& expr); + + //! Create a 2-element record value (# field0 := expr0, field1 := expr1 #) + /*! Fields will be sorted automatically */ + virtual Expr recordExpr(const std::string& field0, const Expr& expr0, + const std::string& field1, const Expr& expr1); + + //! Create a 3-element record value (# field_i := expr_i #) + /*! Fields will be sorted automatically */ + virtual Expr recordExpr(const std::string& field0, const Expr& expr0, + const std::string& field1, const Expr& expr1, + const std::string& field2, const Expr& expr2); + + //! Create an n-element record value (# field_i := expr_i #) + /*! + * \param fields + * \param exprs must be the same length as fields + * + * Fields will be sorted automatically + */ + virtual Expr recordExpr(const std::vector& fields, + const std::vector& exprs); + + //! Create record.field (field selection) + /*! Create an expression representing the selection of a field from + a record. */ + virtual Expr recSelectExpr(const Expr& record, const std::string& field); + + //! Record update; equivalent to "record WITH .field := newValue" + /*! Notice the `.' before field in the presentation language (and + the comment above); this is to distinguish it from datatype + update. + */ + virtual Expr recUpdateExpr(const Expr& record, const std::string& field, + const Expr& newValue); + + /*@}*/ // End of Record expression methods + + /***************************************************************************/ + /*! + *\name Array expression methods + * Methods for manipulating array expressions + *@{ + */ + /***************************************************************************/ + + //! Create an expression array[index] (array access) + /*! Create an expression for the value of array at the given index */ + virtual Expr readExpr(const Expr& array, const Expr& index); + + //! Array update; equivalent to "array WITH index := newValue" + virtual Expr writeExpr(const Expr& array, const Expr& index, + const Expr& newValue); + + /*@}*/ // End of Array expression methods + + /***************************************************************************/ + /*! + *\name Bitvector expression methods + * Methods for manipulating bitvector expressions + *@{ + */ + /***************************************************************************/ + + // Bitvector constants + // From a string of digits in a given base + virtual Expr newBVConstExpr(const std::string& s, int base = 2); + // From a vector of bools + virtual Expr newBVConstExpr(const std::vector& bits); + // From a rational: bitvector is of length 'len', or the min. needed length when len=0. + virtual Expr newBVConstExpr(const Rational& r, int len = 0); + + // Concat and extract + virtual Expr newConcatExpr(const Expr& t1, const Expr& t2); + virtual Expr newConcatExpr(const std::vector& kids); + virtual Expr newBVExtractExpr(const Expr& e, int hi, int low); + + // Bitwise Boolean operators: Negation, And, Nand, Or, Nor, Xor, Xnor + virtual Expr newBVNegExpr(const Expr& t1); + + virtual Expr newBVAndExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVAndExpr(const std::vector& kids); + + virtual Expr newBVOrExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVOrExpr(const std::vector& kids); + + virtual Expr newBVXorExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVXorExpr(const std::vector& kids); + + virtual Expr newBVXnorExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVXnorExpr(const std::vector& kids); + + virtual Expr newBVNandExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVNorExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVCompExpr(const Expr& t1, const Expr& t2); + + // Unsigned bitvector inequalities + virtual Expr newBVLTExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVLEExpr(const Expr& t1, const Expr& t2); + + // Signed bitvector inequalities + virtual Expr newBVSLTExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVSLEExpr(const Expr& t1, const Expr& t2); + + // Sign-extend t1 to a total of len bits + virtual Expr newSXExpr(const Expr& t1, int len); + + // Bitvector arithmetic: unary minus, plus, subtract, multiply + virtual Expr newBVUminusExpr(const Expr& t1); + virtual Expr newBVSubExpr(const Expr& t1, const Expr& t2); + //! 'numbits' is the number of bits in the result + virtual Expr newBVPlusExpr(int numbits, const std::vector& k); + virtual Expr newBVPlusExpr(int numbits, const Expr& t1, const Expr& t2); + virtual Expr newBVMultExpr(int numbits, + const Expr& t1, const Expr& t2); + + virtual Expr newBVUDivExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVURemExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVSDivExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVSRemExpr(const Expr& t1, const Expr& t2); + virtual Expr newBVSModExpr(const Expr& t1, const Expr& t2); + + // Left shift by r bits: result is old size + r bits + virtual Expr newFixedLeftShiftExpr(const Expr& t1, int r); + // Left shift by r bits: result is same size as t1 + virtual Expr newFixedConstWidthLeftShiftExpr(const Expr& t1, int r); + // Logical right shift by r bits: result is same size as t1 + virtual Expr newFixedRightShiftExpr(const Expr& t1, int r); + // Left shift with shift parameter an arbitrary bit-vector expr + virtual Expr newBVSHL(const Expr& t1, const Expr& t2); + // Logical right shift with shift parameter an arbitrary bit-vector expr + virtual Expr newBVLSHR(const Expr& t1, const Expr& t2); + // Arithmetic right shift with shift parameter an arbitrary bit-vector expr + virtual Expr newBVASHR(const Expr& t1, const Expr& t2); + // Get value of BV Constant + virtual Rational computeBVConst(const Expr& e); + + /*@}*/ // End of Bitvector expression methods + + /***************************************************************************/ + /*! + *\name Other expression methods + * Methods for manipulating other kinds of expressions + *@{ + */ + /***************************************************************************/ + + //! Tuple expression + virtual Expr tupleExpr(const std::vector& exprs); + + //! Tuple select; equivalent to "tuple.n", where n is an numeral (e.g. tup.5) + virtual Expr tupleSelectExpr(const Expr& tuple, int index); + + //! Tuple update; equivalent to "tuple WITH index := newValue" + virtual Expr tupleUpdateExpr(const Expr& tuple, int index, + const Expr& newValue); + + //! Datatype constructor expression + virtual Expr datatypeConsExpr(const std::string& constructor, const std::vector& args); + + //! Datatype selector expression + virtual Expr datatypeSelExpr(const std::string& selector, const Expr& arg); + + //! Datatype tester expression + virtual Expr datatypeTestExpr(const std::string& constructor, const Expr& arg); + + //! Create a bound variable with a given name, unique ID (uid) and type + /*! + \param name is the name of the variable + \param uid is the unique ID (a string), which must be unique for + each variable + \param type is its type. The type cannot be a function type. + \return an Expr representation of a new variable + */ + virtual Expr boundVarExpr(const std::string& name, + const std::string& uid, + const Type& type); + + //! Universal quantifier + virtual Expr forallExpr(const std::vector& vars, const Expr& body); + //! Universal quantifier with a trigger + virtual Expr forallExpr(const std::vector& vars, const Expr& body, + const Expr& trigger); + //! Universal quantifier with a set of triggers. + virtual Expr forallExpr(const std::vector& vars, const Expr& body, + const std::vector& triggers); + //! Universal quantifier with a set of multi-triggers. + virtual Expr forallExpr(const std::vector& vars, const Expr& body, + const std::vector >& triggers); + + //! Set triggers for quantifier instantiation + /*! + * \param e the expression for which triggers are being set. + * \param triggers Each item in triggers is a vector of Expr containing one + * or more patterns. A pattern is a term or Atomic predicate sub-expression + * of e. A vector containing more than one pattern is treated as a + * multi-trigger. Patterns will be matched in the order they occur in + * the vector. + */ + virtual void setTriggers(const Expr& e, const std::vector > & triggers); + //! Set triggers for quantifier instantiation (no multi-triggers) + virtual void setTriggers(const Expr& e, const std::vector& triggers); + //! Set a single trigger for quantifier instantiation + virtual void setTrigger(const Expr& e, const Expr& trigger); + //! Set a single multi-trigger for quantifier instantiation + virtual void setMultiTrigger(const Expr& e, const std::vector& multiTrigger); + + //! Existential quantifier + virtual Expr existsExpr(const std::vector& vars, const Expr& body); + + //! Lambda-expression + virtual Op lambdaExpr(const std::vector& vars, const Expr& body); + + //! Transitive closure of a binary predicate + virtual Op transClosure(const Op& op); + + //! Symbolic simulation expression + /*! + * \param f is the next state function (LAMBDA-expression) + * \param s0 is the initial state + * \param inputs is the vector of LAMBDA-expressions representing + * the sequences of inputs to f + * \param n is a constant, the number of cycles to run the simulation. + */ + virtual Expr simulateExpr(const Expr& f, const Expr& s0, + const std::vector& inputs, + const Expr& n); + + /*@}*/ // End of Other expression methods + + /***************************************************************************/ + /*! + *\name Validity checking methods + * Methods related to validity checking + * + * This group includes methods for asserting formulas, checking + * validity in the given logical context, manipulating the scope + * level of the context, etc. + *@{ + */ + /***************************************************************************/ + + //! Set the resource limit (0==unlimited, 1==exhausted). + /*! Currently, the limit is the total number of processed facts. */ + virtual void setResourceLimit(unsigned limit); + + //! Set a time limit in tenth of a second, + /*! counting the cpu time used by the current process from now on. + * Currently, when the limit is reached, cvc3 tries to quickly + * terminate, probably with the status unknown. + */ + virtual void setTimeLimit(unsigned limit); + + //! Assert a new formula in the current context. + /*! This creates the assumption e |- e. The formula must have Boolean type. + */ + virtual void assertFormula(const Expr& e); + + //! Register an atomic formula of interest. + /*! Registered atoms are tracked by the decision procedures. If one of them + is deduced to be true or false, it is added to a list of implied literals. + Implied literals can be retrieved with the getImpliedLiteral function */ + virtual void registerAtom(const Expr& e); + + //! Return next literal implied by last assertion. Null Expr if none. + /*! Returned literals are either registered atomic formulas or their negation + */ + virtual Expr getImpliedLiteral(); + + //! Simplify e with respect to the current context + virtual Expr simplify(const Expr& e); + + //! Check validity of e in the current context. + /*! If it returns VALID, the scope and context are the same + * as when called. If it returns INVALID, the context will be one which + * falsifies the query. If it returns UNKNOWN, the context will falsify the + * query, but the context may be inconsistent. Finally, if it returns + * ABORT, the context will be one which satisfies as much as possible. + * + * \param e is the queried formula + */ + virtual QueryResult query(const Expr& e); + + //! Check satisfiability of the expr in the current context. + /*! Equivalent to query(!e) */ + virtual QueryResult checkUnsat(const Expr& e); + + //! Get the next model + /*! This method should only be called after a query which returns + INVALID. Its return values are as for query(). */ + virtual QueryResult checkContinue(); + + //! Restart the most recent query with e as an additional assertion. + /*! This method should only be called after a query which returns + INVALID. Its return values are as for query(). */ + virtual QueryResult restart(const Expr& e); + + //! Returns to context immediately before last invalid query. + /*! This method should only be called after a query which returns false. + */ + virtual void returnFromCheck(); + + //! Get assumptions made by the user in this and all previous contexts. + /*! User assumptions are created either by calls to assertFormula or by a + * call to query. In the latter case, the negated query is added as an + * assumption. + * \param assumptions should be empty on entry. + */ + virtual void getUserAssumptions(std::vector& assumptions); + + //! Get assumptions made internally in this and all previous contexts. + /*! Internal assumptions are literals assumed by the sat solver. + * \param assumptions should be empty on entry. + */ + virtual void getInternalAssumptions(std::vector& assumptions); + + //! Get all assumptions made in this and all previous contexts. + /*! \param assumptions should be empty on entry. + */ + virtual void getAssumptions(std::vector& assumptions); + + //! Returns the set of assumptions used in the proof of queried formula. + /*! It returns a subset of getAssumptions(). If the last query was false + * or there has not yet been a query, it does nothing. + * NOTE: this functionality is not supported yet + * \param assumptions should be empty on entry. + */ + virtual void getAssumptionsUsed(std::vector& assumptions); + + virtual Expr getProofQuery(); + + + //! Return the internal assumptions that make the queried formula false. + /*! This method should only be called after a query which returns + false. It will try to return the simplest possible subset of + the internal assumptions sufficient to make the queried expression + false. + \param assumptions should be empty on entry. + \param inOrder if true, returns the assumptions in the order they + were made. This is slightly more expensive than inOrder = false. + */ + virtual void getCounterExample(std::vector& assumptions, + bool inOrder=true); + + //! Will assign concrete values to all user created variables + /*! This function should only be called after a query which return false. + */ + virtual void getConcreteModel(ExprMap & m); + + //! If the result of the last query was UNKNOWN try to actually build the model + //! to verify the result. + /*! This function should only be called after a query which return unknown. + */ + virtual QueryResult tryModelGeneration(); + + //:ALEX: returns the current truth value of a formula + // returns UNKNOWN_VAL if e is not associated + // with a boolean variable in the SAT module, + // i.e. if its value can not determined without search. + virtual FormulaValue value(const Expr& e); + + //! Returns true if the current context is inconsistent. + /*! Also returns a minimal set of assertions used to determine the + inconsistency. + \param assumptions should be empty on entry. + */ + virtual bool inconsistent(std::vector& assumptions); + + //! Returns true if the current context is inconsistent. + virtual bool inconsistent(); + + //! Returns true if the invalid result from last query() is imprecise + /*! + * Some decision procedures in CVC are incomplete (quantifier + * elimination, non-linear arithmetic, etc.). If any incomplete + * features were used during the last query(), and the result is + * "invalid" (query() returns false), then this result is + * inconclusive. It means that the system gave up the search for + * contradiction at some point. + */ + virtual bool incomplete(); + + //! Returns true if the invalid result from last query() is imprecise + /*! + * \sa incomplete() + * + * The argument is filled with the reasons for incompleteness (they + * are intended to be shown to the end user). + */ + virtual bool incomplete(std::vector& reasons); + + //! Returns the proof term for the last proven query + /*! If there has not been a successful query, it should return a NULL proof + */ + virtual Proof getProof(); + + //! Returns the TCC of the last assumption or query + /*! Returns Null if no assumptions or queries were performed. */ + virtual Expr getTCC(); + + //! Return the set of assumptions used in the proof of the last TCC + virtual void getAssumptionsTCC(std::vector& assumptions); + + //! Returns the proof of TCC of the last assumption or query + /*! Returns Null if no assumptions or queries were performed. */ + virtual Proof getProofTCC(); + + //! After successful query, return its closure |- Gamma => phi + /*! Turn a valid query Gamma |- phi into an implication + * |- Gamma => phi. + * + * Returns Null if last query was invalid. + */ + virtual Expr getClosure(); + + //! Construct a proof of the query closure |- Gamma => phi + /*! Returns Null if last query was Invalid. */ + virtual Proof getProofClosure(); + + /*@}*/ // End of Validity checking methods + + /***************************************************************************/ + /*! + *\name Context methods + * Methods for manipulating contexts + * + * Contexts support stack-based push and pop. There are two + * separate notions of the current context stack. stackLevel(), push(), + * pop(), and popto() work with the user-level notion of the stack. + * + * scopeLevel(), pushScope(), popScope(), and poptoScope() work with + * the internal stack which is more fine-grained than the user + * stack. + * + * Do not use the scope methods unless you know what you are doing. + * *@{ + */ + /***************************************************************************/ + + //! Returns the current stack level. Initial level is 0. + virtual int stackLevel(); + + //! Checkpoint the current context and increase the scope level + virtual void push(); + + //! Restore the current context to its state at the last checkpoint + virtual void pop(); + + //! Restore the current context to the given stackLevel. + /*! + \param stackLevel should be greater than or equal to 0 and less + than or equal to the current scope level. + */ + virtual void popto(int stackLevel); + + //! Returns the current scope level. Initially, the scope level is 1. + virtual int scopeLevel(); + + /*! @brief Checkpoint the current context and increase the + * internal scope level. Do not use unless you + * know what you're doing! + */ + virtual void pushScope(); + + /*! @brief Restore the current context to its state at the last + * internal checkpoint. Do not use unless you know + * what you're doing! + */ + virtual void popScope(); + + //! Restore the current context to the given scopeLevel. + /*! + \param scopeLevel should be less than or equal to the current scope level. + + If scopeLevel is less than 1, then the current context is reset + and the scope level is set to 1. + */ + virtual void poptoScope(int scopeLevel); + + //! Get the current context + virtual Context* getCurrentContext(); + + //! Destroy and recreate validity checker: resets everything except for flags + virtual void reset(); + + //! Add an annotation to the current script - prints annot when translating + virtual void logAnnotation(const Expr& annot); + + /*@}*/ // End of Context methods + + /***************************************************************************/ + /*! + *\name Reading files + * Methods for reading external files + *@{ + */ + /***************************************************************************/ + + //! Read and execute the commands from a file given by name ("" means stdin) + virtual void loadFile(const std::string& fileName, + InputLanguage lang = PRESENTATION_LANG, + bool interactive = false, + bool calledFromParser = false); + + //! Read and execute the commands from a stream + virtual void loadFile(std::istream& is, + InputLanguage lang = PRESENTATION_LANG, + bool interactive = false); + + /*@}*/ // End of methods for reading files + + /***************************************************************************/ + /*! + *\name Reporting Statistics + * Methods for collecting and reporting run-time statistics + *@{ + */ + /***************************************************************************/ + + //! Get statistics object + virtual Statistics& getStatistics(); + + //! Print collected statistics to stdout + virtual void printStatistics(); + + /*@}*/ // End of Statistics Methods + +};/* class ValidityChecker */ + +template +void ExprHashMap::insert(Expr a, Expr b) { + (*this)[a] = b; +} + +}/* CVC3 namespace */ + +#endif /* _cvc3__include__vc_h_ */ +#endif /* __CVC4__CVC3_COMPAT_H */ diff --git a/src/context/Makefile.am b/src/context/Makefile.am index 9e349a06b..ca5772d7c 100644 --- a/src/context/Makefile.am +++ b/src/context/Makefile.am @@ -18,4 +18,8 @@ libcontext_la_SOURCES = \ cdmap_forward.h \ cdset.h \ cdset_forward.h \ - cdvector.h + cdcirclist.h \ + cdcirclist_forward.h \ + cdvector.h \ + stacking_map.h \ + stacking_vector.h diff --git a/src/context/cdcirclist.h b/src/context/cdcirclist.h new file mode 100644 index 000000000..cc6b60217 --- /dev/null +++ b/src/context/cdcirclist.h @@ -0,0 +1,418 @@ +/********************* */ +/*! \file cdcirclist.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 Context-dependent circular list class + ** + ** Context-dependent circular list class. + **/ + +#include "cvc4_private.h" + +#ifndef __CVC4__CONTEXT__CDCIRCLIST_H +#define __CVC4__CONTEXT__CDCIRCLIST_H + +#include +#include +#include +#include + +#include "context/context.h" +#include "context/context_mm.h" +#include "context/cdcirclist_forward.h" +#include "context/cdo.h" +#include "util/Assert.h" + +namespace CVC4 { +namespace context { + +// CDO for pointers in particular, adds * and -> operators +template +class CDPtr : public CDO { + typedef CDO super; + + // private copy ctor + CDPtr(const CDPtr& cdptr) : + super(cdptr) { + } + +public: + + CDPtr(Context* context, T* data = NULL) : + super(context, data) { + } + + CDPtr(bool allocatedInCMM, Context* context, T* data = NULL) : + super(allocatedInCMM, context, data) { + } + + // undesirable to put this here, since CDO<> does it already (?) + virtual ~CDPtr() throw(AssertionException) { this->destroy(); } + + virtual ContextObj* save(ContextMemoryManager* pCMM) { + Debug("context") << "save cdptr " << this << " (value " << super::get() << ")"; + ContextObj* p = new(pCMM) CDPtr(*this); + Debug("context") << " to " << p << std::endl; + return p; + } + + virtual void restore(ContextObj* pContextObj) { + Debug("context") << "restore cdptr " << this << " (using " << pContextObj << ") from " << super::get(); + this->super::restore(pContextObj); + Debug("context") << " to " << super::get() << std::endl; + } + + CDPtr& operator=(T* data) { + Debug("context") << "set " << this << " from " << super::get(); + super::set(data); + Debug("context") << " to " << super::get() << std::endl; + return *this; + } + // assignment is just like using the underlying ptr + CDPtr& operator=(const CDPtr& cdptr) { + return *this = cdptr.get(); + } + + T& operator*() { return *super::get(); } + T* operator->() { return super::get(); } + const T& operator*() const { return *super::get(); } + const T* operator->() const { return super::get(); } +};/* class CDPtr */ + + +/** + * Class representing a single link in a CDCircList<>. + * + * The underlying T object is immutable, only the structure of the + * list is mutable, so only that's backtracked. + */ +template +class CDCircElement { + typedef CDCircElement elt_t; + const T d_t; + CDPtr d_prev; + CDPtr d_next; + friend class CDCircList; +public: + CDCircElement(Context* context, const T& t, + elt_t* prev = NULL, elt_t* next = NULL) : + d_t(t), + d_prev(true, context, prev), + d_next(true, context, next) { + } + + CDPtr& next() { return d_next; } + CDPtr& prev() { return d_prev; } + elt_t* next() const { return d_next; } + elt_t* prev() const { return d_prev; } + T element() const { return d_t; } +};/* class CDCircElement<> */ + + +/** + * Generic context-dependent circular list. Items themselves are not + * context dependent, only the forward and backward links. This + * allows two lists to be spliced together in constant time (see + * concat()). The list *structure* is mutable (things can be spliced + * in, removed, added, the list can be cleared, etc.) in a + * context-dependent manner, but the list items are immutable. To + * replace an item A in the list with B, A must be removed and + * B added in the same location. + */ +template +class CDCircList : public ContextObj { +public: + + /** List carrier element type */ + typedef CDCircElement elt_t; + /** The value type with which this CDCircList<> was instantiated. */ + typedef T value_type; + /** The allocator type with which this CDCircList<> was instantiated. */ + typedef AllocatorT Allocator; + +private: + + /** Head element of the circular list */ + CDPtr d_head; + /** The context with which we're associated */ + Context* d_context; + /** Our allocator */ + typename Allocator::template rebind< CDCircElement >::other d_allocator; + +public: + + CDCircList(Context* context, const Allocator& alloc = Allocator()) : + ContextObj(context), + d_head(context, NULL), + d_context(context), + d_allocator(alloc) { + } + + CDCircList(bool allocatedInCMM, Context* context, const Allocator& alloc = Allocator()) : + ContextObj(allocatedInCMM, context), + d_head(allocatedInCMM, context, NULL), + d_context(context), + d_allocator(alloc) { + Debug("cdcirclist") << "head " << &d_head << " in cmm ? " << allocatedInCMM << std::endl; + } + + ~CDCircList() throw(AssertionException) { + // by context contract, call destroy() here + destroy(); + } + + void clear() { + d_head = NULL; + } + + bool empty() const { + return d_head == NULL; + } + + CDPtr& head() { + return d_head; + } + + CDPtr& tail() { + return empty() ? d_head : d_head->d_prev; + } + + const elt_t* head() const { + return d_head; + } + + const elt_t* tail() const { + return empty() ? d_head : d_head->d_prev; + } + + T front() const { + Assert(! empty()); + return head()->element(); + } + + T back() const { + Assert(! empty()); + return tail()->element(); + } + + void push_back(const T& t) { + if(Debug.isOn("cdcirclist:paranoid")) { + debugCheck(); + } + // FIXME LEAK! (should alloc in CMM, no?) + elt_t* x = d_allocator.allocate(1); + if(empty()) { + // zero-element case + new(x) elt_t(d_context, t, x, x); + d_head = x; + } else { + // N-element case + new(x) elt_t(d_context, t, d_head->d_prev, d_head); + d_head->d_prev->d_next = x; + d_head->d_prev = x; + } + } + + /** + * Concatenate two lists. This modifies both: afterward, the two + * lists might have different heads, but they will have the same + * elements in the same (circular) order. + */ + void concat(CDCircList& l) { + Assert(this != &l, "cannot concat a list with itself"); + + if(d_head == NULL) { + d_head = l.d_head; + return; + } else if(l.d_head == NULL) { + l.d_head = d_head; + return; + } + + // splice together the two circular lists + CDPtr &l1head = head(), &l2head = l.head(); + CDPtr &l1tail = tail(), &l2tail = l.tail(); + // l2tail will change underneath us in what's below (because it's + // the same as l2head->prev()), so we have to keep a regular + // pointer to it + elt_t* oldl2tail = l2tail; + + Debug("cdcirclist") << "concat1 " << this << " " << &l << std::endl; + l1tail->next() = l2head; + Debug("cdcirclist") << "concat2" << std::endl; + l2head->prev() = l1tail; + + Debug("cdcirclist") << "concat3" << std::endl; + oldl2tail->next() = l1head; + Debug("cdcirclist") << "concat4" << std::endl; + l1head->prev() = oldl2tail; + Debug("cdcirclist") << "concat5" << std::endl; + } + + class iterator { + const CDCircList* d_list; + const elt_t* d_current; + friend class CDCircList; + public: + iterator(const CDCircList* list, const elt_t* first) : + d_list(list), + d_current(first) { + } + iterator(const iterator& other) : + d_list(other.d_list), + d_current(other.d_current) { + } + + bool operator==(const iterator& other) const { + return d_list == other.d_list && d_current == other.d_current; + } + bool operator!=(const iterator& other) const { + return !(*this == other); + } + iterator& operator++() { + Assert(d_current != NULL, "iterator already off the end"); + if(d_current == d_list->tail()) { + d_current = NULL; + } else { + d_current = d_current->next(); + } + return *this; + } + iterator operator++(int) { + const elt_t* old = d_current; + ++*this; + return iterator(d_list, old); + } + iterator& operator--() { + // undefined to go off the beginning, but don't have a check for that + if(d_current == NULL) { + d_current = d_list->tail(); + } else { + d_current = d_current->prev(); + } + return *this; + } + iterator operator--(int) { + const elt_t* old = d_current; + --*this; + return iterator(d_list, old); + } + T operator*() { + Assert(d_current != NULL, "iterator already off the end"); + return d_current->element(); + } + };/* class CDCircList<>::iterator */ + + // list elements are immutable + typedef iterator const_iterator; + + iterator begin() { + if(Debug.isOn("cdcirclist:paranoid")) { + debugCheck(); + } + return iterator(this, head()); + } + + iterator end() { + if(Debug.isOn("cdcirclist:paranoid")) { + debugCheck(); + } + return iterator(this, NULL); + } + + const_iterator begin() const { + return const_iterator(this, head()); + } + + const_iterator end() const { + return const_iterator(this, NULL); + } + + iterator erase(iterator pos) { + Assert(pos.d_current != NULL); + if(pos.d_current->prev() == pos.d_current) { + // one-elt list + d_head = NULL; + return iterator(this, NULL); + } else { + // N-elt list + if(pos.d_current == d_head) { + // removing list head + elt_t *pHead = head(), *pTail = tail(); + pTail->next() = pHead->next(); + pHead->next()->prev() = pTail; + d_head = pHead->next(); + return iterator(this, d_head); + // can't free old head, because of backtracking + } else { + // not removing list head + const elt_t *elt = pos.d_current; + elt_t *prev = pos.d_current->prev(); + prev->next() = elt->next(); + elt->next()->prev() = prev; + return iterator(this, elt->next()); + // can't free elt, because of backtracking + } + } + } + +private: + + // do not permit copy/assignment + CDCircList(const CDCircList&) CVC4_UNUSED; + CDCircList& operator=(const CDCircList&) CVC4_UNUSED; + +public: + /** Check internal structure and invariants of the list */ + void debugCheck() const { + elt_t* p = d_head; + Debug("cdcirclist") << "this is " << this << std::endl; + if(p == NULL) { + Debug("cdcirclist") << "head[" << &d_head << "] is NULL : " << d_context->getLevel() << std::endl; + // empty list + return; + } + Debug("cdcirclist") << "head[" << &d_head << "] is " << p << " next " << p->d_next << " prev " << p->d_prev << " : " << d_context->getLevel() << std::endl;//p->d_t << std::endl; + do { + elt_t* p_last = p; + p = p->d_next; + if(p == NULL) { + Debug("cdcirclist") << "****** ERROR ON LINE ABOVE, next == NULL ******" << std::endl; + break; + } + Debug("cdcirclist") << " p is " << p << " next " << p->d_next << " prev " << p->d_prev << " : " << std::endl;//p->d_t << std::endl; + if(p->d_prev != p_last) { + Debug("cdcirclist") << "****** ERROR ON LINE ABOVE, prev != last ******" << std::endl; + } + //Assert(p->d_prev == p_last); + Assert(p != NULL); + } while(p != d_head); + } + +private: + + // Nothing to save; the elements take care of themselves + virtual ContextObj* save(ContextMemoryManager* pCMM) { + Unreachable(); + } + + // Similarly, nothing to restore + virtual void restore(ContextObj* data) { + Unreachable(); + } + +};/* class CDCircList<> */ + +}/* CVC4::context namespace */ +}/* CVC4 namespace */ + +#endif /* __CVC4__CONTEXT__CDCIRCLIST_H */ diff --git a/src/context/cdcirclist_forward.h b/src/context/cdcirclist_forward.h new file mode 100644 index 000000000..56a39e96f --- /dev/null +++ b/src/context/cdcirclist_forward.h @@ -0,0 +1,45 @@ +/********************* */ +/*! \file cdcirclist_forward.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 This is a forward declaration header to declare the + ** CDCircList<> template + ** + ** This is a forward declaration header to declare the CDCircList<> + ** template. It's useful if you want to forward-declare CDCircList<> + ** without including the full cdcirclist.h header, for example, in a + ** public header context, or to keep compile times low when only a + ** forward declaration is needed. + **/ + +#include "cvc4_public.h" + +#ifndef __CVC4__CONTEXT__CDCIRCLIST_FORWARD_H +#define __CVC4__CONTEXT__CDCIRCLIST_FORWARD_H + +#include + +namespace __gnu_cxx { + template struct hash; +}/* __gnu_cxx namespace */ + +namespace CVC4 { + namespace context { + template + class ContextMemoryAllocator; + + template > + class CDCircList; + }/* CVC4::context namespace */ +}/* CVC4 namespace */ + +#endif /* __CVC4__CONTEXT__CDCIRCLIST_FORWARD_H */ diff --git a/src/context/cdlist.h b/src/context/cdlist.h index c999ecadb..dea9f8be7 100644 --- a/src/context/cdlist.h +++ b/src/context/cdlist.h @@ -3,17 +3,18 @@ ** \verbatim ** Original author: mdeters ** Major contributors: none - ** Minor contributors (to current version): barrett, taking + ** Minor contributors (to current version): taking ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 Context-dependent list class. + ** \brief Context-dependent list class (only supports append) ** - ** Context-dependent list class. + ** Context-dependent list class. This list only supports appending + ** to the list; on backtrack, the list is simply shortened. **/ #include "cvc4_private.h" diff --git a/src/context/cdlist_context_memory.h b/src/context/cdlist_context_memory.h index 45a44756d..fcb51fe20 100644 --- a/src/context/cdlist_context_memory.h +++ b/src/context/cdlist_context_memory.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/cdlist_forward.h b/src/context/cdlist_forward.h index a1e50c7c8..90c439085 100644 --- a/src/context/cdlist_forward.h +++ b/src/context/cdlist_forward.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/cdmap.h b/src/context/cdmap.h index c71459835..3ac99f729 100644 --- a/src/context/cdmap.h +++ b/src/context/cdmap.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): taking, dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/cdmap_forward.h b/src/context/cdmap_forward.h index 214d9e700..331d6a93e 100644 --- a/src/context/cdmap_forward.h +++ b/src/context/cdmap_forward.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/cdo.h b/src/context/cdo.h index f4c4a7e29..025e8e337 100644 --- a/src/context/cdo.h +++ b/src/context/cdo.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): barrett ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -40,13 +40,29 @@ class CDO : public ContextObj { */ T d_data; +protected: + + /** + * Copy constructor - it's private to ensure it is only used by save(). + * Basic CDO objects, cannot be copied-they have to be unique. + */ + CDO(const CDO& cdo) : ContextObj(cdo), d_data(cdo.d_data) {} + + /** + * operator= for CDO is private to ensure CDO object is not copied. + */ + CDO& operator=(const CDO& cdo) CVC4_UNUSED; + /** * Implementation of mandatory ContextObj method save: simply copies the * current data to a copy using the copy constructor. Memory is allocated * using the ContextMemoryManager. */ virtual ContextObj* save(ContextMemoryManager* pCMM) { - return new(pCMM) CDO(*this); + Debug("context") << "save cdo " << this << " (value " << get() << ")"; + ContextObj* p = new(pCMM) CDO(*this); + Debug("context") << " to " << p << std::endl; + return p; } /** @@ -54,20 +70,11 @@ class CDO : public ContextObj { * saved data back from the saved copy using operator= for T. */ virtual void restore(ContextObj* pContextObj) { + //Debug("context") << "restore cdo " << this << " from " << get(); d_data = ((CDO*) pContextObj)->d_data; + //Debug("context") << " to " << get() << std::endl; } - /** - * Copy constructor - it's private to ensure it is only used by save(). - * Basic CDO objects, cannot be copied-they have to be unique. - */ - CDO(const CDO& cdo) : ContextObj(cdo), d_data(cdo.d_data) {} - - /** - * operator= for CDO is private to ensure CDO object is not copied. - */ - CDO& operator=(const CDO& cdo); - public: /** @@ -75,7 +82,8 @@ public: * value of d_data. */ CDO(Context* context) : - ContextObj(context) { + ContextObj(context), + d_data(T()) { } /** @@ -90,7 +98,8 @@ public: * allocating contextual objects with non-standard allocators." */ CDO(bool allocatedInCMM, Context* context) : - ContextObj(allocatedInCMM, context) { + ContextObj(allocatedInCMM, context), + d_data(T()) { } /** @@ -100,7 +109,8 @@ public: * is assigned by the default constructor for T */ CDO(Context* context, const T& data) : - ContextObj(context) { + ContextObj(context), + d_data(T()) { makeCurrent(); d_data = data; } @@ -119,7 +129,8 @@ public: * allocating contextual objects with non-standard allocators." */ CDO(bool allocatedInCMM, Context* context, const T& data) : - ContextObj(allocatedInCMM, context) { + ContextObj(allocatedInCMM, context), + d_data(T()) { makeCurrent(); d_data = data; } diff --git a/src/context/cdset.h b/src/context/cdset.h index 268c3127b..8699d9cf4 100644 --- a/src/context/cdset.h +++ b/src/context/cdset.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/cdset_forward.h b/src/context/cdset_forward.h index af3c6f85c..2339552a6 100644 --- a/src/context/cdset_forward.h +++ b/src/context/cdset_forward.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/cdvector.h b/src/context/cdvector.h index cb86d5c4d..49d1b67e9 100644 --- a/src/context/cdvector.h +++ b/src/context/cdvector.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/context.cpp b/src/context/context.cpp index 9b40e9780..2b220d5b4 100644 --- a/src/context/context.cpp +++ b/src/context/context.cpp @@ -5,7 +5,7 @@ ** Major contributors: barrett ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -78,8 +78,10 @@ void Context::pop() { // Notify the (pre-pop) ContextNotifyObj objects ContextNotifyObj* pCNO = d_pCNOpre; while(pCNO != NULL) { + // pre-store the "next" pointer in case pCNO deletes itself on notify() + ContextNotifyObj* next = pCNO->d_pCNOnext; pCNO->notify(); - pCNO = pCNO->d_pCNOnext; + pCNO = next; } // Grab the top Scope @@ -97,8 +99,10 @@ void Context::pop() { // Notify the (post-pop) ContextNotifyObj objects pCNO = d_pCNOpost; while(pCNO != NULL) { + // pre-store the "next" pointer in case pCNO deletes itself on notify() + ContextNotifyObj* next = pCNO->d_pCNOnext; pCNO->notify(); - pCNO = pCNO->d_pCNOnext; + pCNO = next; } Trace("pushpop") << std::string(2 * getLevel(), ' ') << "} Pop [to " @@ -135,6 +139,7 @@ void Context::addNotifyObjPost(ContextNotifyObj* pCNO) { void ContextObj::update() throw(AssertionException) { Debug("context") << "before update(" << this << "):" << std::endl + << "context is " << getContext() << std::endl << *getContext() << std::endl; // Call save() to save the information in the current object @@ -203,6 +208,7 @@ ContextObj* ContextObj::restoreAndContinue() throw(AssertionException) { // Assert(d_pScope == d_pScope->getContext()->getBottomScope(), // "Expected bottom scope"); + Debug("context") << "NULL restore object! " << this << std::endl; pContextObjNext = d_pContextObjNext; // Nothing else to do @@ -261,22 +267,28 @@ void ContextObj::destroy() throw(AssertionException) { ContextObj::ContextObj(Context* pContext) : - d_pContextObjRestore(NULL) { + d_pScope(NULL), + d_pContextObjRestore(NULL), + d_pContextObjNext(NULL), + d_ppContextObjPrev(NULL) { Assert(pContext != NULL, "NULL context pointer"); - Debug("context") << "create new ContextObj(" << this << ")" << std::endl; + Debug("context") << "create new ContextObj(" << this << " inCMM=false)" << std::endl; d_pScope = pContext->getBottomScope(); d_pScope->addToChain(this); } ContextObj::ContextObj(bool allocatedInCMM, Context* pContext) : - d_pContextObjRestore(NULL) { + d_pScope(NULL), + d_pContextObjRestore(NULL), + d_pContextObjNext(NULL), + d_ppContextObjPrev(NULL) { Assert(pContext != NULL, "NULL context pointer"); - Debug("context") << "create new ContextObj(" << this << ")" << std::endl; + Debug("context") << "create new ContextObj(" << this << " inCMM=" << allocatedInCMM << ")" << std::endl; if(allocatedInCMM) { d_pScope = pContext->getTopScope(); } else { @@ -326,12 +338,15 @@ std::ostream& operator<<(std::ostream& out, std::ostream& operator<<(std::ostream& out, const Scope& scope) throw(AssertionException) { - out << "Scope " << scope.d_level << ":"; + out << "Scope " << scope.d_level << " [" << &scope << "]:"; ContextObj* pContextObj = scope.d_pContextObjList; Assert(pContextObj == NULL || pContextObj->prev() == &scope.d_pContextObjList); while(pContextObj != NULL) { out << " <--> " << pContextObj; + if(pContextObj->d_pScope != &scope) { + out << " XXX bad scope" << std::endl; + } Assert(pContextObj->d_pScope == &scope); Assert(pContextObj->next() == NULL || pContextObj->next()->prev() == &pContextObj->next()); diff --git a/src/context/context.h b/src/context/context.h index 34107ef29..1e69964a0 100644 --- a/src/context/context.h +++ b/src/context/context.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: mdeters ** Major contributors: barrett - ** Minor contributors (to current version): taking, dejan + ** Minor contributors (to current version): dejan, taking ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/context_mm.cpp b/src/context/context_mm.cpp index fde69a149..aea2fe9c2 100644 --- a/src/context/context_mm.cpp +++ b/src/context/context_mm.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/context/context_mm.h b/src/context/context_mm.h index 56ef7ab59..66db21424 100644 --- a/src/context/context_mm.h +++ b/src/context/context_mm.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -161,10 +161,11 @@ public: }; ContextMemoryAllocator(ContextMemoryManager* mm) throw() : d_mm(mm) {} - ContextMemoryAllocator(const ContextMemoryAllocator& alloc) throw() : d_mm(alloc.d_mm) {} + template + ContextMemoryAllocator(const ContextMemoryAllocator& alloc) throw() : d_mm(alloc.getCMM()) {} ~ContextMemoryAllocator() throw() {} - ContextMemoryManager* getCMM() { return d_mm; } + ContextMemoryManager* getCMM() const { return d_mm; } T* address(T& v) const { return &v; } T const* address(T const& v) const { return &v; } size_t max_size() const throw() { diff --git a/src/context/stacking_map.h b/src/context/stacking_map.h new file mode 100644 index 000000000..2dec1845c --- /dev/null +++ b/src/context/stacking_map.h @@ -0,0 +1,162 @@ +/********************* */ +/*! \file stacking_map.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 Backtrackable map using an undo stack + ** + ** Backtrackable map using an undo stack rather than storing items in + ** a CDMap<>. + **/ + +#include "cvc4_private.h" + +#ifndef __CVC4__CONTEXT__STACKING_MAP_H +#define __CVC4__CONTEXT__STACKING_MAP_H + +#include +#include +#include + +#include "expr/node.h" +#include "context/cdo.h" + +namespace CVC4 { +namespace context { + +template +struct StackingMapArgType { + typedef T argtype; +};/* struct StackingMapArgType */ + +template <> +struct StackingMapArgType { + typedef TNode argtype; +};/* struct StackingMapArgType */ + + +template +struct StackingMapRestoreValue { + typedef typename StackingMapArgType::argtype ArgType; + static void restore(__gnu_cxx::hash_map& map, const ArgType& k, const ValueType& v) { + map[k] = v; + } +};/* struct StackingMapRestoreValue */ + +template +struct StackingMapRestoreValue { + typedef typename StackingMapArgType::argtype ArgType; + static void restore(__gnu_cxx::hash_map& map, const ArgType& k, TNode v) { + if(v.isNull()) { + map.erase(k); + } else { + map[k] = v; + } + } +};/* struct StackingMapRestoreValue */ + +template +struct StackingMapRestoreValue { + typedef typename StackingMapArgType::argtype ArgType; + static void restore(__gnu_cxx::hash_map& map, const ArgType& k, TNode v) { + if(v.isNull()) { + map.erase(k); + } else { + map[k] = v; + } + } +};/* struct StackingMapRestoreValue */ + + +template +class StackingMap : context::ContextNotifyObj { + /** Our underlying map type. */ + typedef __gnu_cxx::hash_map MapType; + + /** + * The type for arguments being passed in. It's the same as + * KeyType, unless KeyType is Node, then it's TNode for efficiency. + */ + typedef typename StackingMapArgType::argtype ArgType; + + /** Our map of keys to their values. */ + MapType d_map; + + /** Our undo stack for changes made to d_map. */ + std::vector > d_trace; + + /** Our current offset in the d_trace stack (context-dependent). */ + context::CDO d_offset; + +public: + typedef typename MapType::const_iterator const_iterator; + + StackingMap(context::Context* ctxt) : + context::ContextNotifyObj(ctxt), + d_offset(ctxt, 0) { + } + + ~StackingMap() throw() { } + + const_iterator find(ArgType n) const { return d_map.find(n); } + const_iterator end() const { return d_map.end(); } + + /** + * Return a key's value in the key-value map. If n is not a key in + * the map, this function returns a default-constructed value. + */ + ValueType operator[](ArgType n) const { + const_iterator it = find(n); + if(it == end()) { + return ValueType(); + } else { + return (*it).second; + } + } + //ValueType& operator[](ArgType n) { return d_map[n]; }// not permitted--bypasses set() logic + + /** + * Set the value in the key-value map for Node n to newValue. + */ + void set(ArgType n, const ValueType& newValue); + + /** + * Called by the Context when a pop occurs. Cancels everything to the + * current context level. Overrides ContextNotifyObj::notify(). + */ + void notify(); + +};/* class StackingMap<> */ + +template +void StackingMap::set(ArgType n, const ValueType& newValue) { + Trace("sm") << "SM setting " << n << " : " << newValue << " @ " << d_trace.size() << std::endl; + ValueType& ref = d_map[n]; + d_trace.push_back(std::make_pair(n, ValueType(ref))); + d_offset = d_trace.size(); + ref = newValue; +} + +template +void StackingMap::notify() { + Trace("sm") << "SM cancelling : " << d_offset << " < " << d_trace.size() << " ?" << std::endl; + while(d_offset < d_trace.size()) { + std::pair p = d_trace.back(); + StackingMapRestoreValue::restore(d_map, p.first, p.second); + d_trace.pop_back(); + } + Trace("sm") << "SM cancelling finished." << std::endl; +} + +}/* CVC4::context namespace */ +}/* CVC4 namespace */ + +#endif /*__CVC4__CONTEXT__STACKING_MAP_H */ diff --git a/src/context/stacking_vector.h b/src/context/stacking_vector.h new file mode 100644 index 000000000..9987731d4 --- /dev/null +++ b/src/context/stacking_vector.h @@ -0,0 +1,116 @@ +/********************* */ +/*! \file stacking_vector.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 Backtrackable vector using an undo stack + ** + ** Backtrackable vector using an undo stack rather than storing items in + ** a CDVector<>. + **/ + +#include "cvc4_private.h" + +#ifndef __CVC4__CONTEXT__STACKING_VECTOR_H +#define __CVC4__CONTEXT__STACKING_VECTOR_H + +#include +#include + +#include "context/cdo.h" + +namespace CVC4 { +namespace context { + +template +class StackingVector : context::ContextNotifyObj { + /** Our underlying map type. */ + typedef std::vector VectorType; + + /** Our map of indices to their values. */ + VectorType d_map; + + /** Our undo stack for changes made to d_map. */ + std::vector > d_trace; + + /** Our current offset in the d_trace stack (context-dependent). */ + context::CDO d_offset; + +public: + typedef typename VectorType::const_iterator const_iterator; + + StackingVector(context::Context* ctxt) : + context::ContextNotifyObj(ctxt), + d_offset(ctxt, 0) { + } + + ~StackingVector() throw() { } + + /** + * Return a value from the vector. If n is not a key in + * the map, this function returns a default-constructed T. + */ + T operator[](size_t n) const { + return n < d_map.size() ? d_map[n] : T(); + } + //T& operator[](ArgType n) { return d_map[n]; }// not permitted--bypasses set() logic + + /** + * Set the value in the key-value map for Node n to newValue. + */ + void set(size_t n, const T& newValue); + + /** + * Return the current size of the vector. Note that once a certain + * size is achieved, the size never goes down again, although the + * elements off the old end of the vector will be replaced with + * default-constructed T values. + */ + size_t size() const { + return d_map.size(); + } + + /** + * Called by the Context when a pop occurs. Cancels everything to the + * current context level. Overrides ContextNotifyObj::notify(). + */ + void notify(); + +};/* class StackingVector<> */ + +template +void StackingVector::set(size_t n, const T& newValue) { + Trace("sv") << "SV setting " << n << " : " << newValue << " @ " << d_trace.size() << std::endl; + if(n >= d_map.size()) { + d_map.resize(n + 1); + } + T& ref = d_map[n]; + d_trace.push_back(std::make_pair(n, T(ref))); + d_offset = d_trace.size(); + ref = newValue; +} + +template +void StackingVector::notify() { + Trace("sv") << "SV cancelling : " << d_offset << " < " << d_trace.size() << " ?" << std::endl; + while(d_offset < d_trace.size()) { + std::pair p = d_trace.back(); + Trace("sv") << "SV cancelling: " << p.first << " back to " << p.second << std::endl; + d_map[p.first] = p.second; + d_trace.pop_back(); + } + Trace("sv") << "SV cancelling finished." << std::endl; +} + +}/* CVC4::context namespace */ +}/* CVC4 namespace */ + +#endif /*__CVC4__CONTEXT__STACKING_VECTOR_H */ diff --git a/src/expr/Makefile.am b/src/expr/Makefile.am index 352647642..738604f90 100644 --- a/src/expr/Makefile.am +++ b/src/expr/Makefile.am @@ -16,6 +16,7 @@ libexpr_la_SOURCES = \ type.cpp \ node_value.h \ node_manager.h \ + type_checker.h \ attribute.h \ attribute_internals.h \ attribute.cpp \ @@ -37,7 +38,8 @@ nodist_libexpr_la_SOURCES = \ expr.h \ expr.cpp \ expr_manager.h \ - expr_manager.cpp + expr_manager.cpp \ + type_checker.cpp EXTRA_DIST = \ kind_template.h \ @@ -47,6 +49,7 @@ EXTRA_DIST = \ expr_manager_template.cpp \ expr_template.h \ expr_template.cpp \ + type_checker_template.cpp \ mkkind \ mkmetakind \ mkexpr @@ -59,6 +62,7 @@ BUILT_SOURCES = \ expr.cpp \ expr_manager.h \ expr_manager.cpp \ + type_checker.cpp \ $(top_builddir)/src/theory/.subdirs CLEANFILES = \ @@ -68,6 +72,7 @@ CLEANFILES = \ expr.cpp \ expr_manager.h \ expr_manager.cpp \ + type_checker.cpp \ $(top_builddir)/src/theory/.subdirs include @top_srcdir@/src/theory/Makefile.subdirs @@ -127,3 +132,11 @@ expr_manager.cpp: expr_manager_template.cpp mkexpr @top_builddir@/src/theory/.su $< \ `cat @top_builddir@/src/theory/.subdirs` \ > $@) || (rm -f $@ && exit 1) + +type_checker.cpp: type_checker_template.cpp mkexpr @top_builddir@/src/theory/.subdirs @top_srcdir@/src/theory/*/kinds + $(AM_V_at)chmod +x @srcdir@/mkexpr + $(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true + $(AM_V_GEN)(@srcdir@/mkexpr \ + $< \ + `cat @top_builddir@/src/theory/.subdirs` \ + > $@) || (rm -f $@ && exit 1) diff --git a/src/expr/attribute.cpp b/src/expr/attribute.cpp index 85c0fe528..d58173454 100644 --- a/src/expr/attribute.cpp +++ b/src/expr/attribute.cpp @@ -5,7 +5,7 @@ ** Major contributors: dejan ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/attribute.h b/src/expr/attribute.h index 9b21184d0..3da3799be 100644 --- a/src/expr/attribute.h +++ b/src/expr/attribute.h @@ -5,7 +5,7 @@ ** Major contributors: dejan ** Minor contributors (to current version): cconway, taking ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/command.cpp b/src/expr/command.cpp index 2783e8eaa..5fb4d1fbd 100644 --- a/src/expr/command.cpp +++ b/src/expr/command.cpp @@ -78,6 +78,10 @@ EmptyCommand::EmptyCommand(std::string name) : d_name(name) { } +std::string EmptyCommand::getName() const { + return d_name; +} + void EmptyCommand::invoke(SmtEngine* smtEngine) { /* empty commands have no implementation */ } @@ -88,6 +92,10 @@ AssertCommand::AssertCommand(const BoolExpr& e) : d_expr(e) { } +BoolExpr AssertCommand::getExpr() const { + return d_expr; +} + void AssertCommand::invoke(SmtEngine* smtEngine) { smtEngine->assertFormula(d_expr); } @@ -106,10 +114,18 @@ void PopCommand::invoke(SmtEngine* smtEngine) { /* class CheckSatCommand */ +CheckSatCommand::CheckSatCommand() : + d_expr() { +} + CheckSatCommand::CheckSatCommand(const BoolExpr& expr) : d_expr(expr) { } +BoolExpr CheckSatCommand::getExpr() const { + return d_expr; +} + void CheckSatCommand::invoke(SmtEngine* smtEngine) { d_result = smtEngine->checkSat(d_expr); } @@ -128,6 +144,10 @@ QueryCommand::QueryCommand(const BoolExpr& e) : d_expr(e) { } +BoolExpr QueryCommand::getExpr() const { + return d_expr; +} + void QueryCommand::invoke(SmtEngine* smtEngine) { d_result = smtEngine->query(d_expr); } @@ -145,6 +165,23 @@ void QueryCommand::printResult(std::ostream& out) const { QuitCommand::QuitCommand() { } +void QuitCommand::invoke(SmtEngine* smtEngine) { + Dump("benchmark") << *this; +} + +/* class CommentCommand */ + +CommentCommand::CommentCommand(std::string comment) : d_comment(comment) { +} + +std::string CommentCommand::getComment() const { + return d_comment; +} + +void CommentCommand::invoke(SmtEngine* smtEngine) { + Dump("benchmark") << *this; +} + /* class CommandSequence */ CommandSequence::CommandSequence() : @@ -175,51 +212,150 @@ void CommandSequence::invoke(SmtEngine* smtEngine, std::ostream& out) { } } -/* class DeclarationCommand */ +CommandSequence::const_iterator CommandSequence::begin() const { + return d_commandSequence.begin(); +} + +CommandSequence::const_iterator CommandSequence::end() const { + return d_commandSequence.end(); +} + +CommandSequence::iterator CommandSequence::begin() { + return d_commandSequence.begin(); +} + +CommandSequence::iterator CommandSequence::end() { + return d_commandSequence.end(); +} + +/* class DeclarationSequenceCommand */ + +/* class DeclarationDefinitionCommand */ + +DeclarationDefinitionCommand::DeclarationDefinitionCommand(const std::string& id) : + d_symbol(id) { +} + +std::string DeclarationDefinitionCommand::getSymbol() const { + return d_symbol; +} + +/* class DeclareFunctionCommand */ + +DeclareFunctionCommand::DeclareFunctionCommand(const std::string& id, Type t) : + DeclarationDefinitionCommand(id), + d_type(t) { +} + +Type DeclareFunctionCommand::getType() const { + return d_type; +} + +void DeclareFunctionCommand::invoke(SmtEngine* smtEngine) { + Dump("declarations") << *this << endl; +} + +/* class DeclareTypeCommand */ + +DeclareTypeCommand::DeclareTypeCommand(const std::string& id, size_t arity, Type t) : + DeclarationDefinitionCommand(id), + d_arity(arity), + d_type(t) { +} + +size_t DeclareTypeCommand::getArity() const { + return d_arity; +} + +Type DeclareTypeCommand::getType() const { + return d_type; +} + +void DeclareTypeCommand::invoke(SmtEngine* smtEngine) { + Dump("declarations") << *this << endl; +} + +/* class DefineTypeCommand */ -DeclarationCommand::DeclarationCommand(const std::string& id, Type t) : +DefineTypeCommand::DefineTypeCommand(const std::string& id, + Type t) : + DeclarationDefinitionCommand(id), + d_params(), d_type(t) { - d_declaredSymbols.push_back(id); } -DeclarationCommand::DeclarationCommand(const std::vector& ids, Type t) : - d_declaredSymbols(ids), +DefineTypeCommand::DefineTypeCommand(const std::string& id, + const std::vector& params, + Type t) : + DeclarationDefinitionCommand(id), + d_params(params), d_type(t) { } -const std::vector& DeclarationCommand::getDeclaredSymbols() const { - return d_declaredSymbols; +const std::vector& DefineTypeCommand::getParameters() const { + return d_params; } -Type DeclarationCommand::getDeclaredType() const { +Type DefineTypeCommand::getType() const { return d_type; } +void DefineTypeCommand::invoke(SmtEngine* smtEngine) { + Dump("declarations") << *this << endl; +} + /* class DefineFunctionCommand */ -DefineFunctionCommand::DefineFunctionCommand(Expr func, +DefineFunctionCommand::DefineFunctionCommand(const std::string& id, + Expr func, + Expr formula) : + DeclarationDefinitionCommand(id), + d_func(func), + d_formals(), + d_formula(formula) { +} + +DefineFunctionCommand::DefineFunctionCommand(const std::string& id, + Expr func, const std::vector& formals, Expr formula) : + DeclarationDefinitionCommand(id), d_func(func), d_formals(formals), d_formula(formula) { } +Expr DefineFunctionCommand::getFunction() const { + return d_func; +} + +const std::vector& DefineFunctionCommand::getFormals() const { + return d_formals; +} + +Expr DefineFunctionCommand::getFormula() const { + return d_formula; +} + void DefineFunctionCommand::invoke(SmtEngine* smtEngine) { - smtEngine->defineFunction(d_func, d_formals, d_formula); + Dump("declarations") << *this << endl; + if(!d_func.isNull()) { + smtEngine->defineFunction(d_func, d_formals, d_formula); + } } -/* class DefineFunctionCommand */ +/* class DefineNamedFunctionCommand */ -DefineNamedFunctionCommand::DefineNamedFunctionCommand(Expr func, +DefineNamedFunctionCommand::DefineNamedFunctionCommand(const std::string& id, + Expr func, const std::vector& formals, Expr formula) : - DefineFunctionCommand(func, formals, formula) { + DefineFunctionCommand(id, func, formals, formula) { } void DefineNamedFunctionCommand::invoke(SmtEngine* smtEngine) { this->DefineFunctionCommand::invoke(smtEngine); - if(d_func.getType().isBoolean()) { + if(!d_func.isNull() && d_func.getType().isBoolean()) { smtEngine->addToAssignment(d_func.getExprManager()->mkExpr(kind::APPLY, d_func)); } @@ -231,6 +367,10 @@ SimplifyCommand::SimplifyCommand(Expr term) : d_term(term) { } +Expr SimplifyCommand::getTerm() const { + return d_term; +} + void SimplifyCommand::invoke(SmtEngine* smtEngine) { d_result = smtEngine->simplify(d_term); } @@ -249,6 +389,10 @@ GetValueCommand::GetValueCommand(Expr term) : d_term(term) { } +Expr GetValueCommand::getTerm() const { + return d_term; +} + void GetValueCommand::invoke(SmtEngine* smtEngine) { d_result = d_term.getExprManager()->mkExpr(kind::TUPLE, d_term, smtEngine->getValue(d_term)); @@ -305,6 +449,10 @@ SetBenchmarkStatusCommand::SetBenchmarkStatusCommand(BenchmarkStatus status) : d_status(status) { } +BenchmarkStatus SetBenchmarkStatusCommand::getStatus() const { + return d_status; +} + void SetBenchmarkStatusCommand::invoke(SmtEngine* smtEngine) { stringstream ss; ss << d_status; @@ -326,6 +474,10 @@ SetBenchmarkLogicCommand::SetBenchmarkLogicCommand(std::string logic) : d_logic(logic) { } +std::string SetBenchmarkLogicCommand::getLogic() const { + return d_logic; +} + void SetBenchmarkLogicCommand::invoke(SmtEngine* smtEngine) { try { smtEngine->setLogic(d_logic); @@ -337,11 +489,19 @@ void SetBenchmarkLogicCommand::invoke(SmtEngine* smtEngine) { /* class SetInfoCommand */ -SetInfoCommand::SetInfoCommand(std::string flag, SExpr& sexpr) : +SetInfoCommand::SetInfoCommand(std::string flag, const SExpr& sexpr) : d_flag(flag), d_sexpr(sexpr) { } +std::string SetInfoCommand::getFlag() const { + return d_flag; +} + +SExpr SetInfoCommand::getSExpr() const { + return d_sexpr; +} + void SetInfoCommand::invoke(SmtEngine* smtEngine) { try { smtEngine->setInfo(d_flag, d_sexpr); @@ -369,6 +529,10 @@ GetInfoCommand::GetInfoCommand(std::string flag) : d_flag(flag) { } +std::string GetInfoCommand::getFlag() const { + return d_flag; +} + void GetInfoCommand::invoke(SmtEngine* smtEngine) { try { stringstream ss; @@ -391,11 +555,19 @@ void GetInfoCommand::printResult(std::ostream& out) const { /* class SetOptionCommand */ -SetOptionCommand::SetOptionCommand(std::string flag, SExpr& sexpr) : +SetOptionCommand::SetOptionCommand(std::string flag, const SExpr& sexpr) : d_flag(flag), d_sexpr(sexpr) { } +std::string SetOptionCommand::getFlag() const { + return d_flag; +} + +SExpr SetOptionCommand::getSExpr() const { + return d_sexpr; +} + void SetOptionCommand::invoke(SmtEngine* smtEngine) { try { smtEngine->setOption(d_flag, d_sexpr); @@ -423,6 +595,10 @@ GetOptionCommand::GetOptionCommand(std::string flag) : d_flag(flag) { } +std::string GetOptionCommand::getFlag() const { + return d_flag; +} + void GetOptionCommand::invoke(SmtEngine* smtEngine) { try { d_result = smtEngine->getOption(d_flag).getValue(); @@ -446,17 +622,19 @@ void GetOptionCommand::printResult(std::ostream& out) const { DatatypeDeclarationCommand::DatatypeDeclarationCommand(const DatatypeType& datatype) : d_datatypes() { d_datatypes.push_back(datatype); - Debug("datatypes") << "Create datatype command." << endl; } DatatypeDeclarationCommand::DatatypeDeclarationCommand(const std::vector& datatypes) : d_datatypes(datatypes) { - Debug("datatypes") << "Create datatype command." << endl; +} + +const std::vector& +DatatypeDeclarationCommand::getDatatypes() const { + return d_datatypes; } void DatatypeDeclarationCommand::invoke(SmtEngine* smtEngine) { - Debug("datatypes") << "Invoke datatype command." << endl; - //smtEngine->addDatatypeDefinitions(d_datatype); + Dump("declarations") << *this << endl; } /* output stream insertion operator for benchmark statuses */ diff --git a/src/expr/command.h b/src/expr/command.h index 50d382038..5cf4f6fa0 100644 --- a/src/expr/command.h +++ b/src/expr/command.h @@ -2,8 +2,8 @@ /*! \file command.h ** \verbatim ** Original author: mdeters - ** Major contributors: dejan - ** Minor contributors (to current version): cconway + ** Major contributors: none + ** Minor contributors (to current version): cconway, dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -59,26 +59,31 @@ std::ostream& operator<<(std::ostream& out, class CVC4_PUBLIC Command { public: + virtual ~Command() {} + virtual void invoke(SmtEngine* smtEngine) = 0; virtual void invoke(SmtEngine* smtEngine, std::ostream& out); - virtual ~Command() {}; + virtual void toStream(std::ostream& out, int toDepth = -1, bool types = false, OutputLanguage language = language::output::LANG_AST) const; + std::string toString() const; + virtual void printResult(std::ostream& out) const; + };/* class Command */ /** - * EmptyCommands (and its subclasses) are the residue of a command - * after the parser handles them (and there's nothing left to do). + * EmptyCommands are the residue of a command after the parser handles + * them (and there's nothing left to do). */ class CVC4_PUBLIC EmptyCommand : public Command { protected: std::string d_name; public: EmptyCommand(std::string name = ""); + std::string getName() const; void invoke(SmtEngine* smtEngine); - std::string getName() const { return d_name; } };/* class EmptyCommand */ class CVC4_PUBLIC AssertCommand : public Command { @@ -86,8 +91,8 @@ protected: BoolExpr d_expr; public: AssertCommand(const BoolExpr& e); + BoolExpr getExpr() const; void invoke(SmtEngine* smtEngine); - BoolExpr getExpr() const { return d_expr; } };/* class AssertCommand */ class CVC4_PUBLIC PushCommand : public Command { @@ -100,30 +105,59 @@ public: void invoke(SmtEngine* smtEngine); };/* class PopCommand */ -class CVC4_PUBLIC DeclarationCommand : public EmptyCommand { +class CVC4_PUBLIC DeclarationDefinitionCommand : public Command { +protected: + std::string d_symbol; +public: + DeclarationDefinitionCommand(const std::string& id); + std::string getSymbol() const; +};/* class DeclarationDefinitionCommand */ + +class CVC4_PUBLIC DeclareFunctionCommand : public DeclarationDefinitionCommand { +protected: + Type d_type; +public: + DeclareFunctionCommand(const std::string& id, Type type); + Type getType() const; + void invoke(SmtEngine* smtEngine); +};/* class DeclareFunctionCommand */ + +class CVC4_PUBLIC DeclareTypeCommand : public DeclarationDefinitionCommand { +protected: + size_t d_arity; + Type d_type; +public: + DeclareTypeCommand(const std::string& id, size_t arity, Type t); + size_t getArity() const; + Type getType() const; + void invoke(SmtEngine* smtEngine); +};/* class DeclareTypeCommand */ + +class CVC4_PUBLIC DefineTypeCommand : public DeclarationDefinitionCommand { protected: - std::vector d_declaredSymbols; + std::vector d_params; Type d_type; public: - DeclarationCommand(const std::string& id, Type t); - DeclarationCommand(const std::vector& ids, Type t); - const std::vector& getDeclaredSymbols() const; - Type getDeclaredType() const; -};/* class DeclarationCommand */ + DefineTypeCommand(const std::string& id, Type t); + DefineTypeCommand(const std::string& id, const std::vector& params, Type t); + const std::vector& getParameters() const; + Type getType() const; + void invoke(SmtEngine* smtEngine); +};/* class DefineTypeCommand */ -class CVC4_PUBLIC DefineFunctionCommand : public Command { +class CVC4_PUBLIC DefineFunctionCommand : public DeclarationDefinitionCommand { protected: Expr d_func; std::vector d_formals; Expr d_formula; public: - DefineFunctionCommand(Expr func, - const std::vector& formals, - Expr formula); + DefineFunctionCommand(const std::string& id, Expr func, Expr formula); + DefineFunctionCommand(const std::string& id, Expr func, + const std::vector& formals, Expr formula); + Expr getFunction() const; + const std::vector& getFormals() const; + Expr getFormula() const; void invoke(SmtEngine* smtEngine); - Expr getFunction() const { return d_func; } - const std::vector& getFormals() const { return d_formals; } - Expr getFormula() const { return d_formula; } };/* class DefineFunctionCommand */ /** @@ -133,9 +167,8 @@ public: */ class CVC4_PUBLIC DefineNamedFunctionCommand : public DefineFunctionCommand { public: - DefineNamedFunctionCommand(Expr func, - const std::vector& formals, - Expr formula); + DefineNamedFunctionCommand(const std::string& id, Expr func, + const std::vector& formals, Expr formula); void invoke(SmtEngine* smtEngine); };/* class DefineNamedFunctionCommand */ @@ -144,9 +177,10 @@ protected: BoolExpr d_expr; Result d_result; public: + CheckSatCommand(); CheckSatCommand(const BoolExpr& expr); + BoolExpr getExpr() const; void invoke(SmtEngine* smtEngine); - BoolExpr getExpr() const { return d_expr; } Result getResult() const; void printResult(std::ostream& out) const; };/* class CheckSatCommand */ @@ -157,8 +191,8 @@ protected: Result d_result; public: QueryCommand(const BoolExpr& e); + BoolExpr getExpr() const; void invoke(SmtEngine* smtEngine); - BoolExpr getExpr() const { return d_expr; } Result getResult() const; void printResult(std::ostream& out) const; };/* class QueryCommand */ @@ -170,8 +204,8 @@ protected: Expr d_result; public: SimplifyCommand(Expr term); + Expr getTerm() const; void invoke(SmtEngine* smtEngine); - Expr getTerm() const { return d_term; } Expr getResult() const; void printResult(std::ostream& out) const; };/* class SimplifyCommand */ @@ -182,8 +216,8 @@ protected: Expr d_result; public: GetValueCommand(Expr term); + Expr getTerm() const; void invoke(SmtEngine* smtEngine); - Expr getTerm() const { return d_term; } Expr getResult() const; void printResult(std::ostream& out) const; };/* class GetValueCommand */ @@ -214,8 +248,8 @@ protected: BenchmarkStatus d_status; public: SetBenchmarkStatusCommand(BenchmarkStatus status); + BenchmarkStatus getStatus() const; void invoke(SmtEngine* smtEngine); - BenchmarkStatus getStatus() const { return d_status; } };/* class SetBenchmarkStatusCommand */ class CVC4_PUBLIC SetBenchmarkLogicCommand : public Command { @@ -224,8 +258,8 @@ protected: std::string d_logic; public: SetBenchmarkLogicCommand(std::string logic); + std::string getLogic() const; void invoke(SmtEngine* smtEngine); - std::string getLogic() const { return d_logic; } };/* class SetBenchmarkLogicCommand */ class CVC4_PUBLIC SetInfoCommand : public Command { @@ -234,10 +268,10 @@ protected: SExpr d_sexpr; std::string d_result; public: - SetInfoCommand(std::string flag, SExpr& sexpr); + SetInfoCommand(std::string flag, const SExpr& sexpr); + std::string getFlag() const; + SExpr getSExpr() const; void invoke(SmtEngine* smtEngine); - std::string getFlag() const { return d_flag; } - SExpr getSExpr() const { return d_sexpr; } std::string getResult() const; void printResult(std::ostream& out) const; };/* class SetInfoCommand */ @@ -248,8 +282,8 @@ protected: std::string d_result; public: GetInfoCommand(std::string flag); + std::string getFlag() const; void invoke(SmtEngine* smtEngine); - std::string getFlag() const { return d_flag; } std::string getResult() const; void printResult(std::ostream& out) const; };/* class GetInfoCommand */ @@ -260,10 +294,10 @@ protected: SExpr d_sexpr; std::string d_result; public: - SetOptionCommand(std::string flag, SExpr& sexpr); + SetOptionCommand(std::string flag, const SExpr& sexpr); + std::string getFlag() const; + SExpr getSExpr() const; void invoke(SmtEngine* smtEngine); - std::string getFlag() const { return d_flag; } - SExpr getSExpr() const { return d_sexpr; } std::string getResult() const; void printResult(std::ostream& out) const; };/* class SetOptionCommand */ @@ -274,8 +308,8 @@ protected: std::string d_result; public: GetOptionCommand(std::string flag); + std::string getFlag() const; void invoke(SmtEngine* smtEngine); - std::string getFlag() const { return d_flag; } std::string getResult() const; void printResult(std::ostream& out) const; };/* class GetOptionCommand */ @@ -286,15 +320,24 @@ private: public: DatatypeDeclarationCommand(const DatatypeType& datatype); DatatypeDeclarationCommand(const std::vector& datatypes); + const std::vector& getDatatypes() const; void invoke(SmtEngine* smtEngine); - const std::vector& getDatatypes() const { return d_datatypes; } };/* class DatatypeDeclarationCommand */ -class CVC4_PUBLIC QuitCommand : public EmptyCommand { +class CVC4_PUBLIC QuitCommand : public Command { public: QuitCommand(); + void invoke(SmtEngine* smtEngine); };/* class QuitCommand */ +class CVC4_PUBLIC CommentCommand : public Command { + std::string d_comment; +public: + CommentCommand(std::string comment); + std::string getComment() const; + void invoke(SmtEngine* smtEngine); +};/* class CommentCommand */ + class CVC4_PUBLIC CommandSequence : public Command { private: /** All the commands to be executed (in sequence) */ @@ -304,20 +347,27 @@ private: public: CommandSequence(); ~CommandSequence(); + + void addCommand(Command* cmd); + void invoke(SmtEngine* smtEngine); void invoke(SmtEngine* smtEngine, std::ostream& out); - void addCommand(Command* cmd); typedef std::vector::iterator iterator; typedef std::vector::const_iterator const_iterator; - const_iterator begin() const { return d_commandSequence.begin(); } - const_iterator end() const { return d_commandSequence.end(); } + const_iterator begin() const; + const_iterator end() const; + + iterator begin(); + iterator end(); - iterator begin() { return d_commandSequence.begin(); } - iterator end() { return d_commandSequence.end(); } };/* class CommandSequence */ +class CVC4_PUBLIC DeclarationSequence : public CommandSequence { +public: +};/* class DeclarationSequence */ + }/* CVC4 namespace */ #endif /* __CVC4__COMMAND_H */ diff --git a/src/expr/convenience_node_builders.h b/src/expr/convenience_node_builders.h index 655accde3..451250e52 100644 --- a/src/expr/convenience_node_builders.h +++ b/src/expr/convenience_node_builders.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/declaration_scope.cpp b/src/expr/declaration_scope.cpp index ae91efa68..37c709b6a 100644 --- a/src/expr/declaration_scope.cpp +++ b/src/expr/declaration_scope.cpp @@ -3,7 +3,7 @@ ** \verbatim ** Original author: cconway ** Major contributors: mdeters - ** Minor contributors (to current version): dejan + ** Minor contributors (to current version): dejan, ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/expr/declaration_scope.h b/src/expr/declaration_scope.h index d695a3bf8..4bce5e1be 100644 --- a/src/expr/declaration_scope.h +++ b/src/expr/declaration_scope.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: cconway ** Major contributors: mdeters - ** Minor contributors (to current version): none + ** Minor contributors (to current version): ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/expr/expr_manager_template.cpp b/src/expr/expr_manager_template.cpp index 038f58f95..f013c1644 100644 --- a/src/expr/expr_manager_template.cpp +++ b/src/expr/expr_manager_template.cpp @@ -3,7 +3,7 @@ ** \verbatim ** Original author: dejan ** Major contributors: cconway, mdeters - ** Minor contributors (to current version): none + ** Minor contributors (to current version): ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -116,6 +116,10 @@ ExprManager::~ExprManager() { delete d_ctxt; } +const Options* ExprManager::getOptions() const { + return d_nodeManager->getOptions(); +} + BooleanType ExprManager::booleanType() const { NodeManagerScope nms(d_nodeManager); return BooleanType(Type(d_nodeManager, new TypeNode(d_nodeManager->booleanType()))); diff --git a/src/expr/expr_manager_template.h b/src/expr/expr_manager_template.h index eb67277a1..2828ae381 100644 --- a/src/expr/expr_manager_template.h +++ b/src/expr/expr_manager_template.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: dejan ** Major contributors: mdeters - ** Minor contributors (to current version): taking, cconway + ** Minor contributors (to current version): ajreynol, taking, cconway ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -114,6 +114,9 @@ public: */ ~ExprManager(); + /** Get this node manager's options */ + const Options* getOptions() const; + /** Get the type for booleans */ BooleanType booleanType() const; diff --git a/src/expr/expr_stream.h b/src/expr/expr_stream.h index a6b99fb73..990ce9982 100644 --- a/src/expr/expr_stream.h +++ b/src/expr/expr_stream.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/expr_template.cpp b/src/expr/expr_template.cpp index 7c2d02809..619fd5280 100644 --- a/src/expr/expr_template.cpp +++ b/src/expr/expr_template.cpp @@ -21,15 +21,19 @@ #include "expr/expr_manager_scope.h" #include "util/Assert.h" +#include +#include + ${includes} // This is a hack, but an important one: if there's an error, the // compiler directs the user to the template file instead of the // generated one. We don't want the user to modify the generated one, // since it'll get overwritten on a later build. -#line 31 "${template}" +#line 34 "${template}" using namespace CVC4::kind; +using namespace std; namespace CVC4 { @@ -73,7 +77,7 @@ TypeCheckingException::~TypeCheckingException() throw () { } void TypeCheckingException::toStream(std::ostream& os) const { - os << "Error type-checking " << d_expr << ": " << d_msg << std::endl << *d_expr; + os << "Error type-checking " << d_expr << ": " << d_msg << endl << *d_expr; } Expr TypeCheckingException::getExpression() const { @@ -208,6 +212,59 @@ Type Expr::getType(bool check) const throw (TypeCheckingException) { return d_exprManager->getType(*this, check); } +Expr Expr::substitute(Expr e, Expr replacement) const { + return Expr(d_exprManager, new Node(d_node->substitute(TNode(*e.d_node), TNode(*replacement.d_node)))); +} + +template +class NodeIteratorAdaptor : public std::iterator { + Iterator d_iterator; +public: + NodeIteratorAdaptor(Iterator i) : d_iterator(i) { + } + NodeIteratorAdaptor& operator++() { ++d_iterator; return *this; } + NodeIteratorAdaptor operator++(int) { NodeIteratorAdaptor i(d_iterator); ++d_iterator; return i; } + bool operator==(NodeIteratorAdaptor i) { return d_iterator == i.d_iterator; } + bool operator!=(NodeIteratorAdaptor i) { return !(*this == i); } + Node operator*() { return Node::fromExpr(*d_iterator); } +};/* class NodeIteratorAdaptor */ + +template +static inline NodeIteratorAdaptor mkNodeIteratorAdaptor(Iterator i) { + return NodeIteratorAdaptor(i); +} + +Expr Expr::substitute(const std::vector exes, + const std::vector& replacements) const { + return Expr(d_exprManager, + new Node(d_node->substitute(mkNodeIteratorAdaptor(exes.begin()), + mkNodeIteratorAdaptor(exes.end()), + mkNodeIteratorAdaptor(replacements.begin()), + mkNodeIteratorAdaptor(replacements.end())))); +} + +template +class NodePairIteratorAdaptor : public std::iterator > { + Iterator d_iterator; +public: + NodePairIteratorAdaptor(Iterator i) : d_iterator(i) { + } + NodePairIteratorAdaptor& operator++() { ++d_iterator; return *this; } + NodePairIteratorAdaptor operator++(int) { NodePairIteratorAdaptor i(d_iterator); ++d_iterator; return i; } + bool operator==(NodePairIteratorAdaptor i) { return d_iterator == i.d_iterator; } + bool operator!=(NodePairIteratorAdaptor i) { return !(*this == i); } + pair operator*() { return make_pair(Node::fromExpr((*d_iterator).first), Node::fromExpr((*d_iterator).second)); } +};/* class NodePairIteratorAdaptor */ + +template +static inline NodePairIteratorAdaptor mkNodePairIteratorAdaptor(Iterator i) { + return NodePairIteratorAdaptor(i); +} + +Expr Expr::substitute(const std::hash_map map) const { + return Expr(d_exprManager, new Node(d_node->substitute(mkNodePairIteratorAdaptor(map.begin()), mkNodePairIteratorAdaptor(map.end())))); +} + Expr::const_iterator::const_iterator() : d_iterator(NULL) { } @@ -280,6 +337,12 @@ Expr::operator bool() const { return !isNull(); } +bool Expr::isVariable() const { + ExprManagerScope ems(*this); + Assert(d_node != NULL, "Unexpected NULL expression pointer!"); + return d_node->getMetaKind() == kind::metakind::VARIABLE; +} + bool Expr::isConst() const { ExprManagerScope ems(*this); Assert(d_node != NULL, "Unexpected NULL expression pointer!"); diff --git a/src/expr/expr_template.h b/src/expr/expr_template.h index bffb37ddb..e95e434fe 100644 --- a/src/expr/expr_template.h +++ b/src/expr/expr_template.h @@ -35,12 +35,13 @@ ${includes} #include "util/exception.h" #include "util/language.h" +#include "util/hash.h" // This is a hack, but an important one: if there's an error, the // compiler directs the user to the template file instead of the // generated one. We don't want the user to modify the generated one, // since it'll get overwritten on a later build. -#line 44 "${template}" +#line 45 "${template}" namespace CVC4 { @@ -121,6 +122,11 @@ std::ostream& operator<<(std::ostream& out, */ std::ostream& operator<<(std::ostream& out, const Expr& e) CVC4_PUBLIC; +// for hash_maps, hash_sets.. +struct ExprHashFunction { + size_t operator()(CVC4::Expr e) const; +};/* struct ExprHashFunction */ + /** * Class encapsulating CVC4 expressions and methods for constructing new * expressions. @@ -343,6 +349,22 @@ public: */ Type getType(bool check = false) const throw (TypeCheckingException); + /** + * Substitute "replacement" in for "e". + */ + Expr substitute(Expr e, Expr replacement) const; + + /** + * Substitute "replacements" in for "exes". + */ + Expr substitute(const std::vector exes, + const std::vector& replacements) const; + + /** + * Substitute pairs of (ex,replacement) from the given map. + */ + Expr substitute(const std::hash_map map) const; + /** * Returns the string representation of the expression. * @return a string representation of the expression @@ -365,18 +387,28 @@ public: /** * Check if this is a null expression. + * * @return true if a null expression */ bool isNull() const; /** * Check if this is a null expression. + * * @return true if NOT a null expression */ operator bool() const; + /** + * Check if this is an expression representing a variable. + * + * @return true if a variable expression + */ + bool isVariable() const; + /** * Check if this is an expression representing a constant. + * * @return true if a constant expression */ bool isConst() const; @@ -541,7 +573,7 @@ public: /** * Make a Boolean if-then-else expression using this expression as the - * condition, and given the then and else parts + * condition, and given the then and else parts. * @param then_e the then branch expression * @param else_e the else branch expression * @return the if-then-else expression @@ -550,13 +582,14 @@ public: /** * Make a term if-then-else expression using this expression as the - * condition, and given the then and else parts + * condition, and given the then and else parts. * @param then_e the then branch expression * @param else_e the else branch expression * @return the if-then-else expression */ Expr iteExpr(const Expr& then_e, const Expr& else_e) const; -}; + +};/* class BoolExpr */ namespace expr { @@ -791,7 +824,7 @@ public: ${getConst_instantiations} -#line 795 "${template}" +#line 828 "${template}" namespace expr { @@ -839,12 +872,9 @@ inline std::ostream& operator<<(std::ostream& out, ExprSetLanguage l) { }/* CVC4::expr namespace */ -// for hash_maps, hash_sets.. -struct ExprHashFunction { - size_t operator()(CVC4::Expr e) const { - return (size_t) e.getId(); - } -};/* struct ExprHashFunction */ +inline size_t ExprHashFunction::operator()(CVC4::Expr e) const { + return (size_t) e.getId(); +} }/* CVC4 namespace */ diff --git a/src/expr/kind_map.h b/src/expr/kind_map.h index a02339e5e..974bd6791 100644 --- a/src/expr/kind_map.h +++ b/src/expr/kind_map.h @@ -1,7 +1,7 @@ /********************* */ /*! \file kind_map.h ** \verbatim - ** Original author: mdeters + ** Original author: dejan ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. diff --git a/src/expr/metakind_template.h b/src/expr/metakind_template.h index 5f9aa6619..a954a7f70 100644 --- a/src/expr/metakind_template.h +++ b/src/expr/metakind_template.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/mkexpr b/src/expr/mkexpr index 479ef6d11..69f7019ab 100755 --- a/src/expr/mkexpr +++ b/src/expr/mkexpr @@ -107,6 +107,25 @@ function endtheory { seen_endtheory=true } +function typechecker { + # typechecker header + lineno=${BASH_LINENO[0]} + check_theory_seen + typechecker_includes="${typechecker_includes} +#include \"$1\"" +} + +function typerule { + # typerule OPERATOR typechecking-class + lineno=${BASH_LINENO[0]} + check_theory_seen + typerules="${typerules} + case kind::$1: + typeNode = $2::computeType(nodeManager, n, check); + break; +" +} + function sort { # sort TYPE cardinality [well-founded ground-term header | not-well-founded] ["comment"] lineno=${BASH_LINENO[0]} @@ -225,6 +244,8 @@ for var in \ getConst_implementations \ mkConst_instantiations \ mkConst_implementations \ + typechecker_includes \ + typerules \ ; do eval text="\${text//\\\$\\{$var\\}/\${$var}}" done diff --git a/src/expr/mkkind b/src/expr/mkkind index 47d02863e..abb238f1a 100755 --- a/src/expr/mkkind +++ b/src/expr/mkkind @@ -118,6 +118,18 @@ function endtheory { seen_endtheory=true } +function typechecker { + # typechecker header + lineno=${BASH_LINENO[0]} + check_theory_seen +} + +function typerule { + # typerule OPERATOR typechecking-class + lineno=${BASH_LINENO[0]} + check_theory_seen +} + function rewriter { # properties prop* lineno=${BASH_LINENO[0]} diff --git a/src/expr/mkmetakind b/src/expr/mkmetakind index 46a69dee5..d84691e14 100755 --- a/src/expr/mkmetakind +++ b/src/expr/mkmetakind @@ -93,6 +93,18 @@ function endtheory { seen_endtheory=true } +function typechecker { + # typechecker header + lineno=${BASH_LINENO[0]} + check_theory_seen +} + +function typerule { + # typerule OPERATOR typechecking-class + lineno=${BASH_LINENO[0]} + check_theory_seen +} + function rewriter { # rewriter class header lineno=${BASH_LINENO[0]} diff --git a/src/expr/node.h b/src/expr/node.h index f501dba21..0f4b55d4a 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include "expr/type.h" @@ -832,16 +834,23 @@ public: */ inline bool hasSubterm(NodeTemplate t, bool strict = false) const; - NodeTemplate eqNode(const NodeTemplate& right) const; + template + NodeTemplate eqNode(const NodeTemplate& right) const; NodeTemplate notNode() const; - NodeTemplate andNode(const NodeTemplate& right) const; - NodeTemplate orNode(const NodeTemplate& right) const; - NodeTemplate iteNode(const NodeTemplate& thenpart, - const NodeTemplate& elsepart) const; - NodeTemplate iffNode(const NodeTemplate& right) const; - NodeTemplate impNode(const NodeTemplate& right) const; - NodeTemplate xorNode(const NodeTemplate& right) const; + template + NodeTemplate andNode(const NodeTemplate& right) const; + template + NodeTemplate orNode(const NodeTemplate& right) const; + template + NodeTemplate iteNode(const NodeTemplate& thenpart, + const NodeTemplate& elsepart) const; + template + NodeTemplate iffNode(const NodeTemplate& right) const; + template + NodeTemplate impNode(const NodeTemplate& right) const; + template + NodeTemplate xorNode(const NodeTemplate& right) const; };/* class NodeTemplate */ @@ -1085,8 +1094,9 @@ operator=(const NodeTemplate& e) { } template +template NodeTemplate -NodeTemplate::eqNode(const NodeTemplate& right) const { +NodeTemplate::eqNode(const NodeTemplate& right) const { assertTNodeNotExpired(); return NodeManager::currentNM()->mkNode(kind::EQUAL, *this, right); } @@ -1098,44 +1108,50 @@ NodeTemplate NodeTemplate::notNode() const { } template +template NodeTemplate -NodeTemplate::andNode(const NodeTemplate& right) const { +NodeTemplate::andNode(const NodeTemplate& right) const { assertTNodeNotExpired(); return NodeManager::currentNM()->mkNode(kind::AND, *this, right); } template +template NodeTemplate -NodeTemplate::orNode(const NodeTemplate& right) const { +NodeTemplate::orNode(const NodeTemplate& right) const { assertTNodeNotExpired(); return NodeManager::currentNM()->mkNode(kind::OR, *this, right); } template +template NodeTemplate -NodeTemplate::iteNode(const NodeTemplate& thenpart, - const NodeTemplate& elsepart) const { +NodeTemplate::iteNode(const NodeTemplate& thenpart, + const NodeTemplate& elsepart) const { assertTNodeNotExpired(); return NodeManager::currentNM()->mkNode(kind::ITE, *this, thenpart, elsepart); } template +template NodeTemplate -NodeTemplate::iffNode(const NodeTemplate& right) const { +NodeTemplate::iffNode(const NodeTemplate& right) const { assertTNodeNotExpired(); return NodeManager::currentNM()->mkNode(kind::IFF, *this, right); } template +template NodeTemplate -NodeTemplate::impNode(const NodeTemplate& right) const { +NodeTemplate::impNode(const NodeTemplate& right) const { assertTNodeNotExpired(); return NodeManager::currentNM()->mkNode(kind::IMPLIES, *this, right); } template +template NodeTemplate -NodeTemplate::xorNode(const NodeTemplate& right) const { +NodeTemplate::xorNode(const NodeTemplate& right) const { assertTNodeNotExpired(); return NodeManager::currentNM()->mkNode(kind::XOR, *this, right); } @@ -1273,11 +1289,13 @@ NodeTemplate::substitute(Iterator1 nodesBegin, } // otherwise compute - Assert( nodesEnd - nodesBegin == replacementsEnd - replacementsBegin, + Assert( std::distance(nodesBegin, nodesEnd) == std::distance(replacementsBegin, replacementsEnd), "Substitution iterator ranges must be equal size" ); - Iterator1 j = find(nodesBegin, nodesEnd, *this); + Iterator1 j = find(nodesBegin, nodesEnd, TNode(*this)); if(j != nodesEnd) { - Node n = *(replacementsBegin + (j - nodesBegin)); + Iterator2 b = replacementsBegin; + std::advance(b, std::distance(nodesBegin, j)); + Node n = *b; cache[*this] = n; return n; } else if(getNumChildren() == 0) { diff --git a/src/expr/node_builder.h b/src/expr/node_builder.h index 156d14299..2cb2527b2 100644 --- a/src/expr/node_builder.h +++ b/src/expr/node_builder.h @@ -5,7 +5,7 @@ ** Major contributors: dejan ** Minor contributors (to current version): taking, cconway ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp index ce3db4a40..3b4d8ac66 100644 --- a/src/expr/node_manager.cpp +++ b/src/expr/node_manager.cpp @@ -18,21 +18,15 @@ ** Reviewed by Chris Conway, Apr 5 2010 (bug #65). **/ -#include "node_manager.h" - -#include "theory/builtin/theory_builtin_type_rules.h" -#include "theory/booleans/theory_bool_type_rules.h" -#include "theory/uf/theory_uf_type_rules.h" -#include "theory/arith/theory_arith_type_rules.h" -#include "theory/arrays/theory_arrays_type_rules.h" -#include "theory/bv/theory_bv_type_rules.h" -#include "theory/datatypes/theory_datatypes_type_rules.h" +#include "expr/node_manager.h" #include "util/Assert.h" #include "util/options.h" #include "util/stats.h" #include "util/tls.h" +#include "expr/type_checker.h" + #include #include #include @@ -241,234 +235,6 @@ void NodeManager::reclaimZombies() { } }/* NodeManager::reclaimZombies() */ -TypeNode NodeManager::computeType(TNode n, bool check) - throw (TypeCheckingExceptionPrivate, AssertionException) { - TypeNode typeNode; - - // Infer the type - switch(n.getKind()) { - case kind::VARIABLE: - typeNode = getAttribute(n, TypeAttr()); - break; - case kind::SKOLEM: - typeNode = getAttribute(n, TypeAttr()); - break; - case kind::BUILTIN: - typeNode = builtinOperatorType(); - break; - case kind::SORT_TYPE: - typeNode = kindType(); - break; - case kind::APPLY: - typeNode = CVC4::theory::builtin::ApplyTypeRule::computeType(this, n, check); - break; - case kind::EQUAL: - typeNode = CVC4::theory::builtin::EqualityTypeRule::computeType(this, n, check); - break; - case kind::DISTINCT: - typeNode = CVC4::theory::builtin::DistinctTypeRule::computeType(this, n, check); - break; - case kind::TUPLE: - typeNode = CVC4::theory::builtin::TupleTypeRule::computeType(this, n, check); - break; - case kind::CONST_BOOLEAN: - typeNode = CVC4::theory::boolean::BooleanTypeRule::computeType(this, n, check); - break; - case kind::NOT: - typeNode = CVC4::theory::boolean::BooleanTypeRule::computeType(this, n, check); - break; - case kind::AND: - typeNode = CVC4::theory::boolean::BooleanTypeRule::computeType(this, n, check); - break; - case kind::IFF: - typeNode = CVC4::theory::boolean::BooleanTypeRule::computeType(this, n, check); - break; - case kind::IMPLIES: - typeNode = CVC4::theory::boolean::BooleanTypeRule::computeType(this, n, check); - break; - case kind::OR: - typeNode = CVC4::theory::boolean::BooleanTypeRule::computeType(this, n, check); - break; - case kind::XOR: - typeNode = CVC4::theory::boolean::BooleanTypeRule::computeType(this, n, check); - break; - case kind::ITE: - typeNode = CVC4::theory::boolean::IteTypeRule::computeType(this, n, check); - break; - case kind::APPLY_UF: - typeNode = CVC4::theory::uf::UfTypeRule::computeType(this, n, check); - break; - case kind::PLUS: - typeNode = CVC4::theory::arith::ArithOperatorTypeRule::computeType(this, n, check); - break; - case kind::MULT: - typeNode = CVC4::theory::arith::ArithOperatorTypeRule::computeType(this, n, check); - break; - case kind::MINUS: - typeNode = CVC4::theory::arith::ArithOperatorTypeRule::computeType(this, n, check); - break; - case kind::UMINUS: - typeNode = CVC4::theory::arith::ArithOperatorTypeRule::computeType(this, n, check); - break; - case kind::DIVISION: - typeNode = CVC4::theory::arith::ArithOperatorTypeRule::computeType(this, n, check); - break; - case kind::CONST_RATIONAL: - typeNode = CVC4::theory::arith::ArithConstantTypeRule::computeType(this, n, check); - break; - case kind::CONST_INTEGER: - typeNode = CVC4::theory::arith::ArithConstantTypeRule::computeType(this, n, check); - break; - case kind::LT: - typeNode = CVC4::theory::arith::ArithPredicateTypeRule::computeType(this, n, check); - break; - case kind::LEQ: - typeNode = CVC4::theory::arith::ArithPredicateTypeRule::computeType(this, n, check); - break; - case kind::GT: - typeNode = CVC4::theory::arith::ArithPredicateTypeRule::computeType(this, n, check); - break; - case kind::GEQ: - typeNode = CVC4::theory::arith::ArithPredicateTypeRule::computeType(this, n, check); - break; - case kind::SELECT: - typeNode = CVC4::theory::arrays::ArraySelectTypeRule::computeType(this, n, check); - break; - case kind::STORE: - typeNode = CVC4::theory::arrays::ArrayStoreTypeRule::computeType(this, n, check); - break; - case kind::CONST_BITVECTOR: - typeNode = CVC4::theory::bv::BitVectorConstantTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_AND: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_OR: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_XOR: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_NOT: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_NAND: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_NOR: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_XNOR: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_COMP: - typeNode = CVC4::theory::bv::BitVectorCompRule::computeType(this, n, check); - break; - case kind::BITVECTOR_MULT: - typeNode = CVC4::theory::bv::BitVectorArithRule::computeType(this, n, check); - break; - case kind::BITVECTOR_PLUS: - typeNode = CVC4::theory::bv::BitVectorArithRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SUB: - typeNode = CVC4::theory::bv::BitVectorArithRule::computeType(this, n, check); - break; - case kind::BITVECTOR_NEG: - typeNode = CVC4::theory::bv::BitVectorArithRule::computeType(this, n, check); - break; - case kind::BITVECTOR_UDIV: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_UREM: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SDIV: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SREM: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SMOD: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SHL: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_LSHR: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_ASHR: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_ROTATE_LEFT: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_ROTATE_RIGHT: - typeNode = CVC4::theory::bv::BitVectorFixedWidthTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_ULT: - typeNode = CVC4::theory::bv::BitVectorPredicateTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_ULE: - typeNode = CVC4::theory::bv::BitVectorPredicateTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_UGT: - typeNode = CVC4::theory::bv::BitVectorPredicateTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_UGE: - typeNode = CVC4::theory::bv::BitVectorPredicateTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SLT: - typeNode = CVC4::theory::bv::BitVectorPredicateTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SLE: - typeNode = CVC4::theory::bv::BitVectorPredicateTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SGT: - typeNode = CVC4::theory::bv::BitVectorPredicateTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SGE: - typeNode = CVC4::theory::bv::BitVectorPredicateTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_EXTRACT: - typeNode = CVC4::theory::bv::BitVectorExtractTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_CONCAT: - typeNode = CVC4::theory::bv::BitVectorConcatRule::computeType(this, n, check); - break; - case kind::BITVECTOR_REPEAT: - typeNode = CVC4::theory::bv::BitVectorRepeatTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_ZERO_EXTEND: - typeNode = CVC4::theory::bv::BitVectorExtendTypeRule::computeType(this, n, check); - break; - case kind::BITVECTOR_SIGN_EXTEND: - typeNode = CVC4::theory::bv::BitVectorExtendTypeRule::computeType(this, n, check); - break; - case kind::APPLY_CONSTRUCTOR: - typeNode = CVC4::theory::datatypes::DatatypeConstructorTypeRule::computeType(this, n, check); - break; - case kind::APPLY_SELECTOR: - typeNode = CVC4::theory::datatypes::DatatypeSelectorTypeRule::computeType(this, n, check); - break; - case kind::APPLY_TESTER: - typeNode = CVC4::theory::datatypes::DatatypeTesterTypeRule::computeType(this, n, check); - break; - case kind::APPLY_TYPE_ASCRIPTION: - typeNode = CVC4::theory::datatypes::DatatypeAscriptionTypeRule::computeType(this, n, check); - break; - default: - Debug("getType") << "FAILURE" << std::endl; - Unhandled(n.getKind()); - } - - setAttribute(n, TypeAttr(), typeNode); - setAttribute(n, TypeCheckedAttr(), - check || getAttribute(n, TypeCheckedAttr())); - - return typeNode; -} - TypeNode NodeManager::getType(TNode n, bool check) throw (TypeCheckingExceptionPrivate, AssertionException) { // Many theories' type checkers call Node::getType() directly. @@ -510,7 +276,7 @@ TypeNode NodeManager::getType(TNode n, bool check) if( readyToCompute ) { /* All the children have types, time to compute */ - typeNode = computeType(m, check); + typeNode = TypeChecker::computeType(this, m, check); worklist.pop(); } } // end while @@ -520,7 +286,7 @@ TypeNode NodeManager::getType(TNode n, bool check) } else if( !hasType || needsCheck ) { /* We can compute the type top-down, without worrying about deep recursion. */ - typeNode = computeType(n, check); + typeNode = TypeChecker::computeType(this, n, check); } /* The type should be have been computed and stored. */ diff --git a/src/expr/node_manager.h b/src/expr/node_manager.h index 0ac215f1e..6adcb62a9 100644 --- a/src/expr/node_manager.h +++ b/src/expr/node_manager.h @@ -11,7 +11,7 @@ ** See the file COPYING in the top-level source directory for licensing ** information.\endverbatim ** - ** \brief A manager for Nodes. + ** \brief A manager for Nodes ** ** A manager for Nodes. ** @@ -48,6 +48,8 @@ class StatisticsRegistry; namespace expr { +class TypeChecker; + // Definition of an attribute for the variable name. // TODO: hide this attribute behind a NodeManager interface. namespace attr { @@ -64,6 +66,7 @@ class NodeManager { template friend class CVC4::NodeBuilder; friend class NodeManagerScope; friend class expr::NodeValue; + friend class expr::TypeChecker; /** Predicate for use with STL algorithms */ struct NodeValueReferenceCountNonZero { @@ -250,9 +253,6 @@ class NodeManager { // undefined private copy constructor (disallow copy) NodeManager(const NodeManager&) CVC4_UNDEFINED; - TypeNode computeType(TNode n, bool check = false) - throw (TypeCheckingExceptionPrivate, AssertionException); - void init(); public: diff --git a/src/expr/node_self_iterator.h b/src/expr/node_self_iterator.h index c38243b0a..37c28ab07 100644 --- a/src/expr/node_self_iterator.h +++ b/src/expr/node_self_iterator.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/node_value.cpp b/src/expr/node_value.cpp index 666462875..5fe48b01d 100644 --- a/src/expr/node_value.cpp +++ b/src/expr/node_value.cpp @@ -2,10 +2,10 @@ /*! \file node_value.cpp ** \verbatim ** Original author: mdeters - ** Major contributors: none - ** Minor contributors (to current version): dejan + ** Major contributors: dejan + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/node_value.h b/src/expr/node_value.h index 2c11b58d5..71aa37926 100644 --- a/src/expr/node_value.h +++ b/src/expr/node_value.h @@ -2,10 +2,10 @@ /*! \file node_value.h ** \verbatim ** Original author: mdeters - ** Major contributors: dejan - ** Minor contributors (to current version): cconway, taking + ** Major contributors: none + ** Minor contributors (to current version): cconway, taking, dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/expr/type.cpp b/src/expr/type.cpp index e162065b0..28bcb460f 100644 --- a/src/expr/type.cpp +++ b/src/expr/type.cpp @@ -3,7 +3,7 @@ ** \verbatim ** Original author: cconway ** Major contributors: dejan, mdeters - ** Minor contributors (to current version): none + ** Minor contributors (to current version): ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/expr/type.h b/src/expr/type.h index a63ca6cf0..5bff8d12a 100644 --- a/src/expr/type.h +++ b/src/expr/type.h @@ -2,8 +2,8 @@ /*! \file type.h ** \verbatim ** Original author: cconway - ** Major contributors: mdeters, dejan - ** Minor contributors (to current version): none + ** Major contributors: dejan, mdeters + ** Minor contributors (to current version): ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -397,7 +397,7 @@ class CVC4_PUBLIC BooleanType : public Type { public: /** Construct from the base type */ - BooleanType(const Type& type) throw(AssertionException); + BooleanType(const Type& type = Type()) throw(AssertionException); };/* class BooleanType */ /** @@ -408,7 +408,7 @@ class CVC4_PUBLIC IntegerType : public Type { public: /** Construct from the base type */ - IntegerType(const Type& type) throw(AssertionException); + IntegerType(const Type& type = Type()) throw(AssertionException); };/* class IntegerType */ /** @@ -419,7 +419,7 @@ class CVC4_PUBLIC RealType : public Type { public: /** Construct from the base type */ - RealType(const Type& type) throw(AssertionException); + RealType(const Type& type = Type()) throw(AssertionException); };/* class RealType */ /** @@ -441,7 +441,7 @@ class CVC4_PUBLIC FunctionType : public Type { public: /** Construct from the base type */ - FunctionType(const Type& type) throw(AssertionException); + FunctionType(const Type& type = Type()) throw(AssertionException); /** Get the argument types */ std::vector getArgTypes() const; @@ -458,7 +458,7 @@ class CVC4_PUBLIC TupleType : public Type { public: /** Construct from the base type */ - TupleType(const Type& type) throw(AssertionException); + TupleType(const Type& type = Type()) throw(AssertionException); /** Get the constituent types */ std::vector getTypes() const; @@ -472,7 +472,7 @@ class CVC4_PUBLIC ArrayType : public Type { public: /** Construct from the base type */ - ArrayType(const Type& type) throw(AssertionException); + ArrayType(const Type& type = Type()) throw(AssertionException); /** Get the index type */ Type getIndexType() const; @@ -489,7 +489,7 @@ class CVC4_PUBLIC SortType : public Type { public: /** Construct from the base type */ - SortType(const Type& type) throw(AssertionException); + SortType(const Type& type = Type()) throw(AssertionException); /** Get the name of the sort */ std::string getName() const; @@ -510,7 +510,7 @@ class CVC4_PUBLIC SortConstructorType : public Type { public: /** Construct from the base type */ - SortConstructorType(const Type& type) throw(AssertionException); + SortConstructorType(const Type& type = Type()) throw(AssertionException); /** Get the name of the sort constructor */ std::string getName() const; @@ -530,7 +530,7 @@ class CVC4_PUBLIC KindType : public Type { public: /** Construct from the base type */ - KindType(const Type& type) throw(AssertionException); + KindType(const Type& type = Type()) throw(AssertionException); };/* class KindType */ /** @@ -541,7 +541,7 @@ class CVC4_PUBLIC BitVectorType : public Type { public: /** Construct from the base type */ - BitVectorType(const Type& type) throw(AssertionException); + BitVectorType(const Type& type = Type()) throw(AssertionException); /** * Returns the size of the bit-vector type. @@ -559,7 +559,7 @@ class CVC4_PUBLIC DatatypeType : public Type { public: /** Construct from the base type */ - DatatypeType(const Type& type) throw(AssertionException); + DatatypeType(const Type& type = Type()) throw(AssertionException); /** Get the underlying datatype */ const Datatype& getDatatype() const; @@ -599,7 +599,7 @@ class CVC4_PUBLIC ConstructorType : public Type { public: /** Construct from the base type */ - ConstructorType(const Type& type) throw(AssertionException); + ConstructorType(const Type& type = Type()) throw(AssertionException); /** Get the range type */ DatatypeType getRangeType() const; @@ -621,7 +621,7 @@ class CVC4_PUBLIC SelectorType : public Type { public: /** Construct from the base type */ - SelectorType(const Type& type) throw(AssertionException); + SelectorType(const Type& type = Type()) throw(AssertionException); /** Get the domain type for this selector (the datatype type) */ DatatypeType getDomain() const; @@ -639,7 +639,7 @@ class CVC4_PUBLIC TesterType : public Type { public: /** Construct from the base type */ - TesterType(const Type& type) throw(AssertionException); + TesterType(const Type& type = Type()) throw(AssertionException); /** Get the type that this tester tests (the datatype type) */ DatatypeType getDomain() const; diff --git a/src/expr/type_checker.h b/src/expr/type_checker.h new file mode 100644 index 000000000..0c8093469 --- /dev/null +++ b/src/expr/type_checker.h @@ -0,0 +1,40 @@ +/********************* */ +/*! \file type_checker.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: cconway, dejan + ** Minor contributors (to current version): acsys, taking + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 type checker + ** + ** A type checker. + **/ + +#include "cvc4_private.h" + +#ifndef __CVC4__EXPR__TYPE_CHECKER_H +#define __CVC4__EXPR__TYPE_CHECKER_H + +#include "expr/node.h" + +namespace CVC4 { +namespace expr { + +class TypeChecker { +public: + + static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check = false) + throw (TypeCheckingExceptionPrivate, AssertionException); + +};/* class TypeChecker */ + +}/* CVC4::expr namespace */ +}/* CVC4 namespace */ + +#endif /* __CVC4__EXPR__TYPE_CHECKER_H */ diff --git a/src/expr/type_checker_template.cpp b/src/expr/type_checker_template.cpp new file mode 100644 index 000000000..2791376b5 --- /dev/null +++ b/src/expr/type_checker_template.cpp @@ -0,0 +1,66 @@ +/********************* */ +/*! \file type_checker_template.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, 2010, 2011 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 TypeChecker implementation + ** + ** TypeChecker implementation. + **/ + +#line 20 "${template}" + +#include "expr/type_checker.h" +#include "expr/node_manager.h" + +${typechecker_includes} + +#line 27 "${template}" + +namespace CVC4 { +namespace expr { + +TypeNode TypeChecker::computeType(NodeManager* nodeManager, TNode n, bool check) + throw (TypeCheckingExceptionPrivate, AssertionException) { + TypeNode typeNode; + + // Infer the type + switch(n.getKind()) { + case kind::VARIABLE: + case kind::SKOLEM: + typeNode = nodeManager->getAttribute(n, NodeManager::TypeAttr()); + break; + case kind::BUILTIN: + typeNode = nodeManager->builtinOperatorType(); + break; + case kind::SORT_TYPE: + typeNode = nodeManager->kindType(); + break; + +${typerules} + +#line 51 "${template}" + + default: + Debug("getType") << "FAILURE" << std::endl; + Unhandled(n.getKind()); + } + + nodeManager->setAttribute(n, NodeManager::TypeAttr(), typeNode); + nodeManager->setAttribute(n, NodeManager::TypeCheckedAttr(), + check || nodeManager->getAttribute(n, NodeManager::TypeCheckedAttr())); + + return typeNode; + +}/* TypeChecker::computeType */ + +}/* CVC4::expr namespace */ +}/* CVC4 namespace */ diff --git a/src/expr/type_node.cpp b/src/expr/type_node.cpp index 76a084204..51d86904a 100644 --- a/src/expr/type_node.cpp +++ b/src/expr/type_node.cpp @@ -2,8 +2,8 @@ /*! \file type_node.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none - ** Minor contributors (to current version): none + ** Major contributors: mdeters + ** Minor contributors (to current version): taking, ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/expr/type_node.h b/src/expr/type_node.h index 3f4e52d36..25af3aae6 100644 --- a/src/expr/type_node.h +++ b/src/expr/type_node.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: dejan ** Major contributors: mdeters - ** Minor contributors (to current version): taking + ** Minor contributors (to current version): taking, ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/include/cvc4_private.h b/src/include/cvc4_private.h index ea9c8371f..11d4a2ea9 100644 --- a/src/include/cvc4_private.h +++ b/src/include/cvc4_private.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/include/cvc4_public.h b/src/include/cvc4_public.h index 1e26699ec..6dec72736 100644 --- a/src/include/cvc4_public.h +++ b/src/include/cvc4_public.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -71,12 +71,14 @@ # define CVC4_NORETURN __attribute__ ((__noreturn__)) # define CVC4_CONST_FUNCTION __attribute__ ((__const__)) # define CVC4_PURE_FUNCTION __attribute__ ((__pure__)) +# define CVC4_DEPRECATED __attribute__ ((__deprecated__)) # define CVC4_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) #else /* ! __GNUC__ */ # define CVC4_UNUSED # define CVC4_NORETURN # define CVC4_CONST_FUNCTION # define CVC4_PURE_FUNCTION +# define CVC4_DEPRECATED # define CVC4_WARN_UNUSED_RESULT #endif /* __GNUC__ */ diff --git a/src/include/cvc4parser_private.h b/src/include/cvc4parser_private.h index cfd4405e6..bb4354178 100644 --- a/src/include/cvc4parser_private.h +++ b/src/include/cvc4parser_private.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/include/cvc4parser_public.h b/src/include/cvc4parser_public.h index a60d281bb..e86356942 100644 --- a/src/include/cvc4parser_public.h +++ b/src/include/cvc4parser_public.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/lib/clock_gettime.c b/src/lib/clock_gettime.c index 97c8f28a8..0d888fa8e 100644 --- a/src/lib/clock_gettime.c +++ b/src/lib/clock_gettime.c @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/lib/replacements.h b/src/lib/replacements.h index a0a9475f4..ee2ffc2dd 100644 --- a/src/lib/replacements.h +++ b/src/lib/replacements.h @@ -16,8 +16,6 @@ ** Common header for replacement function sources. **/ -#include "cvc4_public.h" - #ifndef __CVC4__LIB__REPLACEMENTS_H #define __CVC4__LIB__REPLACEMENTS_H diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index 707fc0ef3..8f1d54a3a 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -2,8 +2,8 @@ /*! \file interactive_shell.cpp ** \verbatim ** Original author: cconway - ** Major contributors: none - ** Minor contributors (to current version): mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -237,11 +237,14 @@ Command* InteractiveShell::readCommand() { break; } else { #if HAVE_LIBREADLINE - DeclarationCommand* dcmd = - dynamic_cast(cmd); - if(dcmd != NULL) { - const vector& ids = dcmd->getDeclaredSymbols(); - s_declarations.insert(ids.begin(), ids.end()); + if(dynamic_cast(cmd) != NULL) { + s_declarations.insert(dynamic_cast(cmd)->getSymbol()); + } else if(dynamic_cast(cmd) != NULL) { + s_declarations.insert(dynamic_cast(cmd)->getSymbol()); + } else if(dynamic_cast(cmd) != NULL) { + s_declarations.insert(dynamic_cast(cmd)->getSymbol()); + } else if(dynamic_cast(cmd) != NULL) { + s_declarations.insert(dynamic_cast(cmd)->getSymbol()); } #endif /* HAVE_LIBREADLINE */ } diff --git a/src/main/interactive_shell.h b/src/main/interactive_shell.h index 4fa2d6e96..f6852b95b 100644 --- a/src/main/interactive_shell.h +++ b/src/main/interactive_shell.h @@ -2,7 +2,7 @@ /*! \file interactive_shell.h ** \verbatim ** Original author: cconway - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/main/main.cpp b/src/main/main.cpp index 1423befb6..ef19e1604 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -183,6 +183,7 @@ int runCvc4(int argc, char* argv[]) { Chat.setStream(CVC4::null_os); Message.setStream(CVC4::null_os); Warning.setStream(CVC4::null_os); + Dump.setStream(CVC4::null_os); } else { if(options.verbosity < 2) { Chat.setStream(CVC4::null_os); @@ -228,7 +229,10 @@ int runCvc4(int argc, char* argv[]) { } } - OutputLanguage outLang = language::toOutputLanguage(options.inputLanguage); + if(options.outputLanguage == language::output::LANG_AUTO) { + options.outputLanguage = language::toOutputLanguage(options.inputLanguage); + } + // Determine which messages to show based on smtcomp_mode and verbosity if(Configuration::isMuzzledBuild()) { Debug.setStream(CVC4::null_os); @@ -237,6 +241,7 @@ int runCvc4(int argc, char* argv[]) { Chat.setStream(CVC4::null_os); Message.setStream(CVC4::null_os); Warning.setStream(CVC4::null_os); + Dump.setStream(CVC4::null_os); } else { if(options.verbosity < 2) { Chat.setStream(CVC4::null_os); @@ -249,12 +254,15 @@ int runCvc4(int argc, char* argv[]) { Warning.setStream(CVC4::null_os); } - Debug.getStream() << Expr::setlanguage(outLang); - Trace.getStream() << Expr::setlanguage(outLang); - Notice.getStream() << Expr::setlanguage(outLang); - Chat.getStream() << Expr::setlanguage(outLang); - Message.getStream() << Expr::setlanguage(outLang); - Warning.getStream() << Expr::setlanguage(outLang); + Debug.getStream() << Expr::setlanguage(options.outputLanguage); + Trace.getStream() << Expr::setlanguage(options.outputLanguage); + Notice.getStream() << Expr::setlanguage(options.outputLanguage); + Chat.getStream() << Expr::setlanguage(options.outputLanguage); + Message.getStream() << Expr::setlanguage(options.outputLanguage); + Warning.getStream() << Expr::setlanguage(options.outputLanguage); + Dump.getStream() << Expr::setlanguage(options.outputLanguage) + << Expr::setdepth(-1) + << Expr::printtypes(false); } Parser* replayParser = NULL; @@ -271,7 +279,7 @@ int runCvc4(int argc, char* argv[]) { options.replayStream = new Parser::ExprStream(replayParser); } if( options.replayLog != NULL ) { - *options.replayLog << Expr::setlanguage(outLang) << Expr::setdepth(-1); + *options.replayLog << Expr::setlanguage(options.outputLanguage) << Expr::setdepth(-1); } // Parse and execute commands until we are done @@ -296,8 +304,7 @@ int runCvc4(int argc, char* argv[]) { delete cmd; } } else { - ParserBuilder parserBuilder = - ParserBuilder(&exprMgr, filename, options); + ParserBuilder parserBuilder(&exprMgr, filename, options); if( inputFromStdin ) { parserBuilder.withStreamInput(cin); diff --git a/src/main/main.h b/src/main/main.h index e472b43f1..1771198f4 100644 --- a/src/main/main.h +++ b/src/main/main.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: mdeters ** Major contributors: none - ** Minor contributors (to current version): dejan, barrett + ** Minor contributors (to current version): cconway ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/main/usage.h b/src/main/usage.h index 5ad96aea6..c11a2b73e 100644 --- a/src/main/usage.h +++ b/src/main/usage.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): cconway ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/main/util.cpp b/src/main/util.cpp index bf42025a0..255d84205 100644 --- a/src/main/util.cpp +++ b/src/main/util.cpp @@ -3,9 +3,9 @@ ** \verbatim ** Original author: mdeters ** Major contributors: none - ** Minor contributors (to current version): acsys + ** Minor contributors (to current version): acsys, cconway ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/Makefile.am b/src/parser/Makefile.am index 2b90da502..f1802c6c5 100644 --- a/src/parser/Makefile.am +++ b/src/parser/Makefile.am @@ -20,7 +20,9 @@ AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) SUBDIRS = smt smt2 cvc nobase_lib_LTLIBRARIES = libcvc4parser.la +if HAVE_CXXTESTGEN noinst_LTLIBRARIES = libcvc4parser_noinst.la +endif libcvc4parser_la_LDFLAGS = $(ANTLR_LDFLAGS) \ -version-info $(LIBCVC4PARSER_VERSION) diff --git a/src/parser/antlr_input.cpp b/src/parser/antlr_input.cpp index 74157acd7..c51d4b8c3 100644 --- a/src/parser/antlr_input.cpp +++ b/src/parser/antlr_input.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h index 4ae063266..913dd8013 100644 --- a/src/parser/antlr_input.h +++ b/src/parser/antlr_input.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: cconway ** Major contributors: none - ** Minor contributors (to current version): mdeters, dejan + ** Minor contributors (to current version): dejan, mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/bounded_token_factory.cpp b/src/parser/bounded_token_factory.cpp index 5f42f0f29..71b8849e5 100644 --- a/src/parser/bounded_token_factory.cpp +++ b/src/parser/bounded_token_factory.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/bounded_token_factory.h b/src/parser/bounded_token_factory.h index 4d510c9e3..84697fd3e 100644 --- a/src/parser/bounded_token_factory.h +++ b/src/parser/bounded_token_factory.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g index 75a59c6e0..1f817350c 100644 --- a/src/parser/cvc/Cvc.g +++ b/src/parser/cvc/Cvc.g @@ -3,7 +3,7 @@ ** \verbatim ** Original author: cconway ** Major contributors: mdeters - ** Minor contributors (to current version): dejan + ** Minor contributors (to current version): dejan, ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -64,6 +64,7 @@ tokens { PRINT_TYPE_TOK = 'PRINT_TYPE'; CALL_TOK = 'CALL'; ECHO_TOK = 'ECHO'; + EXIT_TOK = 'EXIT'; INCLUDE_TOK = 'INCLUDE'; DUMP_PROOF_TOK = 'DUMP_PROOF'; DUMP_ASSUMPTIONS_TOK = 'DUMP_ASSUMPTIONS'; @@ -84,7 +85,6 @@ tokens { AND_TOK = 'AND'; BOOLEAN_TOK = 'BOOLEAN'; - ECHO_TOK = 'ECHO'; ELSEIF_TOK = 'ELSIF'; ELSE_TOK = 'ELSE'; ENDIF_TOK = 'ENDIF'; @@ -448,38 +448,39 @@ namespace CVC4 { /** * This class is just here to get around an unfortunate bit of Antlr. * We use strings below as return values from rules, which require - * them to be constructible by a uintptr_t. So we derive the string + * them to be constructible by a void*. So we derive the string * class to provide just such a conversion. */ class myString : public std::string { public: myString(const std::string& s) : std::string(s) {} - myString(uintptr_t) : std::string() {} + myString(void*) : std::string() {} myString() : std::string() {} };/* class myString */ /** - * Just exists to give us the uintptr_t construction that + * Just exists to give us the void* construction that * ANTLR requires. */ class mySubrangeBound : public CVC4::SubrangeBound { public: mySubrangeBound() : CVC4::SubrangeBound() {} - mySubrangeBound(uintptr_t) : CVC4::SubrangeBound() {} + mySubrangeBound(void*) : CVC4::SubrangeBound() {} mySubrangeBound(const Integer& i) : CVC4::SubrangeBound(i) {} mySubrangeBound(const SubrangeBound& b) : CVC4::SubrangeBound(b) {} };/* class mySubrangeBound */ /** - * Just exists to give us the uintptr_t construction that + * Just exists to give us the void* construction that * ANTLR requires. */ struct myExpr : public CVC4::Expr { myExpr() : CVC4::Expr() {} - myExpr(uintptr_t) : CVC4::Expr() {} + myExpr(void*) : CVC4::Expr() {} myExpr(const Expr& e) : CVC4::Expr(e) {} myExpr(const myExpr& e) : CVC4::Expr(e) {} };/* struct myExpr */ + }/* CVC4::parser::cvc namespace */ }/* CVC4::parser namespace */ }/* CVC4 namespace */ @@ -532,7 +533,7 @@ using namespace CVC4::parser; * Parses an expression. * @return the parsed expression */ -parseExpr returns [CVC4::parser::cvc::myExpr expr] +parseExpr returns [CVC4::Expr expr = CVC4::Expr()] : formula[expr] | EOF ; @@ -541,7 +542,7 @@ parseExpr returns [CVC4::parser::cvc::myExpr expr] * Parses a command (the whole benchmark) * @return the command of the benchmark */ -parseCommand returns [CVC4::Command* cmd] +parseCommand returns [CVC4::Command* cmd = NULL] : c=command { $cmd = c; } | EOF { $cmd = NULL; } ; @@ -580,7 +581,6 @@ mainCommand[CVC4::Command*& cmd] std::vector dts; Debug("parser-extra") << "command: " << AntlrInput::tokenText(LT(1)) << std::endl; std::string s; - k = 0; } /* our bread & butter */ : ASSERT_TOK formula[f] { cmd = new AssertCommand(f); } @@ -696,6 +696,9 @@ mainCommand[CVC4::Command*& cmd] | { Message() << std::endl; } ) + | EXIT_TOK + { cmd = new QuitCommand(); } + | INCLUDE_TOK ( ( str[s] | IDENTIFIER { s = AntlrInput::tokenText($IDENTIFIER); } ) { UNSUPPORTED("INCLUDE command"); } @@ -752,15 +755,15 @@ toplevelDeclaration[CVC4::Command*& cmd] Debug("parser-extra") << "declaration: " << AntlrInput::tokenText(LT(1)) << std::endl; } : identifierList[ids,CHECK_NONE,SYM_VARIABLE] COLON - ( declareVariables[t,ids,true] { cmd = new DeclarationCommand(ids, t); } - | declareTypes[ids] { cmd = new DeclarationCommand(ids, EXPR_MANAGER->kindType()); } ) + ( declareVariables[cmd,t,ids,true] + | declareTypes[cmd,ids] ) ; /** * A bound variable declaration. */ boundVarDecl[std::vector& ids, CVC4::Type& t] - : identifierList[ids,CHECK_NONE,SYM_VARIABLE] COLON declareVariables[t,ids,false] + : identifierList[ids,CHECK_NONE,SYM_VARIABLE] COLON declareVariables[*(Command**)NULL,t,ids,false] ; /** @@ -808,13 +811,14 @@ boundVarDeclReturn[std::vector& terms, * because type declarations are always top-level, except for * type-lets, which don't use this rule. */ -declareTypes[const std::vector& idList] +declareTypes[CVC4::Command*& cmd, const std::vector& idList] @init { Type t; } /* A sort declaration (e.g., "T : TYPE") */ : TYPE_TOK - { for(std::vector::const_iterator i = idList.begin(); + { DeclarationSequence* seq = new DeclarationSequence(); + for(std::vector::const_iterator i = idList.begin(); i != idList.end(); ++i) { // Don't allow a type variable to clash with a previously @@ -822,8 +826,11 @@ declareTypes[const std::vector& idList] // non-type variable can clash unambiguously. Break from CVC3 // behavior here. PARSER_STATE->checkDeclaration(*i, CHECK_UNDECLARED, SYM_SORT); + Type sort = PARSER_STATE->mkSort(*i); + Command* decl = new DeclareTypeCommand(*i, 0, sort); + seq->addCommand(decl); } - PARSER_STATE->mkSorts(idList); + cmd = seq; } /* A type alias "T : TYPE = foo..." */ @@ -843,16 +850,20 @@ declareTypes[const std::vector& idList] * re-declared if topLevel is true (CVC allows re-declaration if the * types are compatible---if they aren't compatible, an error is * thrown). Also if topLevel is true, variable definitions are - * permitted. + * permitted and "cmd" is output. */ -declareVariables[CVC4::Type& t, const std::vector& idList, bool topLevel] +declareVariables[CVC4::Command*& cmd, CVC4::Type& t, const std::vector& idList, bool topLevel] @init { Expr f; Debug("parser-extra") << "declType: " << AntlrInput::tokenText(LT(1)) << std::endl; } /* A variable declaration (or definition) */ : type[t,CHECK_DECLARED] ( EQUAL_TOK formula[f] )? - { if(f.isNull()) { + { DeclarationSequence* seq = NULL; + if(topLevel) { + cmd = seq = new DeclarationSequence(); + } + if(f.isNull()) { Debug("parser") << "working on " << idList.front() << " : " << t << std::endl; // CVC language allows redeclaration of variables if types are the same for(std::vector::const_iterator i = idList.begin(), @@ -877,6 +888,10 @@ declareVariables[CVC4::Type& t, const std::vector& idList, bool top } else { Debug("parser") << " " << *i << " not declared" << std::endl; PARSER_STATE->mkVar(*i, t); + if(topLevel) { + Command* decl = new DeclareFunctionCommand(*i, t); + seq->addCommand(decl); + } } } } else { @@ -892,6 +907,8 @@ declareVariables[CVC4::Type& t, const std::vector& idList, bool top ++i) { PARSER_STATE->checkDeclaration(*i, CHECK_UNDECLARED, SYM_VARIABLE); PARSER_STATE->defineFunction(*i, f); + Command* decl = new DefineFunctionCommand(*i, Expr(), f); + seq->addCommand(decl); } } } @@ -1007,10 +1024,10 @@ restrictedTypePossiblyFunctionLHS[CVC4::Type& t, /* named types */ : identifier[id,check,SYM_SORT] parameterization[check,types]? - { + { if(check == CHECK_DECLARED || PARSER_STATE->isDeclared(id, SYM_SORT)) { - Debug("parser-param") << "param: getSort " << id << " " << types.size() << " " << PARSER_STATE->getArity( id ) + Debug("parser-param") << "param: getSort " << id << " " << types.size() << " " << PARSER_STATE->getArity( id ) << " " << PARSER_STATE->isDeclared(id, SYM_SORT) << std::endl; if( types.size()>0 ){ t = PARSER_STATE->getSort(id, types); @@ -1024,7 +1041,7 @@ restrictedTypePossiblyFunctionLHS[CVC4::Type& t, }else{ t = PARSER_STATE->mkUnresolvedTypeConstructor(id,types); t = SortConstructorType(t).instantiate( types ); - Debug("parser-param") << "param: make unres param type " << id << " " << types.size() << " " + Debug("parser-param") << "param: make unres param type " << id << " " << types.size() << " " << PARSER_STATE->getArity( id ) << std::endl; } } @@ -1095,7 +1112,7 @@ restrictedTypePossiblyFunctionLHS[CVC4::Type& t, } ; -parameterization[CVC4::parser::DeclarationCheck check, +parameterization[CVC4::parser::DeclarationCheck check, std::vector& params] @init { Type t; @@ -1146,7 +1163,7 @@ formula[CVC4::Expr& f] ; morecomparisons[std::vector& expressions, - std::vector& operators] returns [size_t i] + std::vector& operators] returns [size_t i = 0] @init { unsigned op; Expr f; @@ -1165,10 +1182,7 @@ morecomparisons[std::vector& expressions, ; /** Matches 0 or more NOTs. */ -nots returns [size_t n] -@init { - $n = 0; -} +nots returns [size_t n = 0] : ( NOT_TOK { ++$n; } )* ; @@ -1208,8 +1222,9 @@ prefixFormula[CVC4::Expr& f] RPAREN COLON formula[f] { PARSER_STATE->popScope(); Type t = EXPR_MANAGER->mkFunctionType(types, f.getType()); - Expr func = PARSER_STATE->mkAnonymousFunction("lambda", t); - Command* cmd = new DefineFunctionCommand(func, terms, f); + std::string name = "lambda"; + Expr func = PARSER_STATE->mkAnonymousFunction(name, t); + Command* cmd = new DefineFunctionCommand(name, func, terms, f); PARSER_STATE->preemptCommand(cmd); f = func; } @@ -1735,17 +1750,18 @@ datatypeDef[std::vector& datatypes] Type t; std::vector< Type > params; } - /* This really needs to be CHECK_NONE, or mutually-recursive datatypes - * won't work, because this type will already be "defined" as an - * unresolved type; don't worry, we check below. */ + /* This really needs to be CHECK_NONE, or mutually-recursive + * datatypes won't work, because this type will already be + * "defined" as an unresolved type; don't worry, we check + * below. */ : identifier[id,CHECK_NONE,SYM_SORT] { PARSER_STATE->pushScope(); } - ( LBRACKET identifier[id2,CHECK_UNDECLARED,SYM_SORT] { + ( LBRACKET identifier[id2,CHECK_UNDECLARED,SYM_SORT] { t = PARSER_STATE->mkSort(id2); - params.push_back( t ); + params.push_back( t ); } - ( COMMA identifier[id2,CHECK_UNDECLARED,SYM_SORT] { + ( COMMA identifier[id2,CHECK_UNDECLARED,SYM_SORT] { t = PARSER_STATE->mkSort(id2); - params.push_back( t ); } + params.push_back( t ); } )* RBRACKET )? { datatypes.push_back(Datatype(id,params)); @@ -1768,8 +1784,7 @@ constructorDef[CVC4::Datatype& type] CVC4::Datatype::Constructor* ctor = NULL; } : identifier[id,CHECK_UNDECLARED,SYM_SORT] - { - // make the tester + { // make the tester std::string testerId("is_"); testerId.append(id); PARSER_STATE->checkDeclaration(testerId, CHECK_UNDECLARED, SYM_SORT); @@ -1826,7 +1841,7 @@ DECIMAL_LITERAL * in the BVPLUS/BVMINUS/BVMULT rules where $INTEGER_LITERAL was * returning a reference to the wrong token?! */ -numeral returns [unsigned k] +numeral returns [unsigned k = 0] : INTEGER_LITERAL { $k = AntlrInput::tokenToUnsigned($INTEGER_LITERAL); } ; @@ -1834,7 +1849,7 @@ numeral returns [unsigned k] /** * Similar to numeral but for arbitrary-precision, signed integer. */ -integer returns [CVC4::Integer k] +integer returns [CVC4::Integer k = 0] : INTEGER_LITERAL { $k = AntlrInput::tokenToInteger($INTEGER_LITERAL); } | MINUS_TOK INTEGER_LITERAL diff --git a/src/parser/cvc/cvc_input.cpp b/src/parser/cvc/cvc_input.cpp index 541ac0eac..d91a13bee 100644 --- a/src/parser/cvc/cvc_input.cpp +++ b/src/parser/cvc/cvc_input.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/cvc/cvc_input.h b/src/parser/cvc/cvc_input.h index efe0a522f..9a1f24fde 100644 --- a/src/parser/cvc/cvc_input.h +++ b/src/parser/cvc/cvc_input.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/input.cpp b/src/parser/input.cpp index 36e96516f..27b207342 100644 --- a/src/parser/input.cpp +++ b/src/parser/input.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters, cconway ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/memory_mapped_input_buffer.cpp b/src/parser/memory_mapped_input_buffer.cpp index aad5aaec0..dad38c913 100644 --- a/src/parser/memory_mapped_input_buffer.cpp +++ b/src/parser/memory_mapped_input_buffer.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/memory_mapped_input_buffer.h b/src/parser/memory_mapped_input_buffer.h index 18618a090..ccbe04059 100644 --- a/src/parser/memory_mapped_input_buffer.h +++ b/src/parser/memory_mapped_input_buffer.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index 78e70572a..3f2ec107a 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -3,7 +3,7 @@ ** \verbatim ** Original author: dejan ** Major contributors: cconway, mdeters - ** Minor contributors (to current version): none + ** Minor contributors (to current version): ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -227,15 +227,6 @@ Parser::mkSortConstructor(const std::string& name, size_t arity) { return type; } -std::vector -Parser::mkSorts(const std::vector& names) { - std::vector types; - for(unsigned i = 0; i < names.size(); ++i) { - types.push_back(mkSort(names[i])); - } - return types; -} - SortType Parser::mkUnresolvedType(const std::string& name) { SortType unresolved = mkSort(name); d_unresolved.insert(unresolved); @@ -243,7 +234,7 @@ SortType Parser::mkUnresolvedType(const std::string& name) { } SortConstructorType -Parser::mkUnresolvedTypeConstructor(const std::string& name, +Parser::mkUnresolvedTypeConstructor(const std::string& name, size_t arity) { SortConstructorType unresolved = mkSortConstructor(name,arity); d_unresolved.insert(unresolved); @@ -251,7 +242,7 @@ Parser::mkUnresolvedTypeConstructor(const std::string& name, } SortConstructorType -Parser::mkUnresolvedTypeConstructor(const std::string& name, +Parser::mkUnresolvedTypeConstructor(const std::string& name, const std::vector& params) { Debug("parser") << "newSortConstructor(P)(" << name << ", " << params.size() << ")" << std::endl; @@ -356,13 +347,15 @@ void Parser::checkDeclaration(const std::string& varName, switch(check) { case CHECK_DECLARED: if( !isDeclared(varName, type) ) { - parseError("Symbol " + varName + " not declared as a " + (type == SYM_VARIABLE ? "variable" : "type")); + parseError("Symbol " + varName + " not declared as a " + + (type == SYM_VARIABLE ? "variable" : "type")); } break; case CHECK_UNDECLARED: if( isDeclared(varName, type) ) { - parseError("Symbol " + varName + " previously declared as a " + (type == SYM_VARIABLE ? "variable" : "type")); + parseError("Symbol " + varName + " previously declared as a " + + (type == SYM_VARIABLE ? "variable" : "type")); } break; diff --git a/src/parser/parser.h b/src/parser/parser.h index b2f76b39d..5ce016b85 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: cconway ** Major contributors: mdeters - ** Minor contributors (to current version): dejan + ** Minor contributors (to current version): dejan, ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -367,11 +367,6 @@ public: */ SortConstructorType mkSortConstructor(const std::string& name, size_t arity); - /** - * Creates new sorts with the given names (all of arity 0). - */ - std::vector mkSorts(const std::vector& names); - /** * Creates a new "unresolved type," used only during parsing. */ diff --git a/src/parser/smt/Smt.g b/src/parser/smt/Smt.g index 2a3a79125..da20c68a2 100644 --- a/src/parser/smt/Smt.g +++ b/src/parser/smt/Smt.g @@ -2,7 +2,7 @@ /*! \file Smt.g ** \verbatim ** Original author: cconway - ** Major contributors: mdeters, dejan + ** Major contributors: dejan, mdeters ** Minor contributors (to current version): taking ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) @@ -143,7 +143,7 @@ parseExpr returns [CVC4::parser::smt::myExpr expr] * Parses a command (the whole benchmark) * @return the command of the benchmark */ -parseCommand returns [CVC4::Command* cmd] +parseCommand returns [CVC4::Command* cmd = NULL] : b = benchmark { $cmd = b; } ; @@ -151,7 +151,7 @@ parseCommand returns [CVC4::Command* cmd] * Matches the whole SMT-LIB benchmark. * @return the sequence command containing the whole problem */ -benchmark returns [CVC4::Command* cmd] +benchmark returns [CVC4::Command* cmd = NULL] : LPAREN_TOK BENCHMARK_TOK IDENTIFIER c = benchAttributes RPAREN_TOK { $cmd = c; } | EOF { $cmd = 0; } @@ -162,7 +162,7 @@ benchmark returns [CVC4::Command* cmd] * command sequence. * @return the command sequence */ -benchAttributes returns [CVC4::CommandSequence* cmd_seq] +benchAttributes returns [CVC4::CommandSequence* cmd_seq = NULL] @init { cmd_seq = new CommandSequence(); } @@ -174,26 +174,42 @@ benchAttributes returns [CVC4::CommandSequence* cmd_seq] * a corresponding command * @return a command corresponding to the attribute */ -benchAttribute returns [CVC4::Command* smt_command] +benchAttribute returns [CVC4::Command* smt_command = NULL] @declarations { std::string name; BenchmarkStatus b_status; Expr expr; + Command* c; } : LOGIC_TOK identifier[name,CHECK_NONE,SYM_VARIABLE] - { PARSER_STATE->setLogic(name); - smt_command = new SetBenchmarkLogicCommand(name); } + { PARSER_STATE->preemptCommand(new SetBenchmarkLogicCommand(name)); + PARSER_STATE->setLogic(name); + smt_command = new EmptyCommand(); + } | ASSUMPTION_TOK annotatedFormula[expr] - { smt_command = new AssertCommand(expr); } + { smt_command = new AssertCommand(expr); } | FORMULA_TOK annotatedFormula[expr] { smt_command = new CheckSatCommand(expr); } | STATUS_TOK status[b_status] { smt_command = new SetBenchmarkStatusCommand(b_status); } - | EXTRAFUNS_TOK LPAREN_TOK (functionDeclaration)+ RPAREN_TOK - | EXTRAPREDS_TOK LPAREN_TOK (predicateDeclaration)+ RPAREN_TOK - | EXTRASORTS_TOK LPAREN_TOK sortDeclaration+ RPAREN_TOK + | EXTRAFUNS_TOK LPAREN_TOK + ( { smt_command = new CommandSequence(); } + functionDeclaration[c] + { ((CommandSequence*) smt_command)->addCommand(c); } + )+ RPAREN_TOK + | EXTRAPREDS_TOK LPAREN_TOK + ( { smt_command = new CommandSequence(); } + predicateDeclaration[c] + { ((CommandSequence*) smt_command)->addCommand(c); } + )+ RPAREN_TOK + | EXTRASORTS_TOK LPAREN_TOK + ( { smt_command = new CommandSequence(); } + sortDeclaration[c] + { ((CommandSequence*) smt_command)->addCommand(c); } + )+ RPAREN_TOK | NOTES_TOK STRING_LITERAL - | annotation + { smt_command = new CommentCommand(AntlrInput::tokenText($STRING_LITERAL)); } + | annotation[smt_command] ; /** @@ -417,11 +433,12 @@ functionSymbol[CVC4::Expr& fun] /** * Matches an attribute name from the input (:attribute_name). */ -attribute +attribute[std::string& s] : ATTR_IDENTIFIER + { s = AntlrInput::tokenText($ATTR_IDENTIFIER); } ; -functionDeclaration +functionDeclaration[CVC4::Command*& smt_command] @declarations { std::string name; std::vector sorts; @@ -435,13 +452,15 @@ functionDeclaration } else { t = EXPR_MANAGER->mkFunctionType(sorts); } - PARSER_STATE->mkVar(name, t); } + PARSER_STATE->mkVar(name, t); + smt_command = new DeclareFunctionCommand(name, t); + } ; /** * Matches the declaration of a predicate and declares it */ -predicateDeclaration +predicateDeclaration[CVC4::Command*& smt_command] @declarations { std::string name; std::vector p_sorts; @@ -453,16 +472,20 @@ predicateDeclaration } else { t = EXPR_MANAGER->mkPredicateType(p_sorts); } - PARSER_STATE->mkVar(name, t); } + PARSER_STATE->mkVar(name, t); + smt_command = new DeclareFunctionCommand(name, t); + } ; -sortDeclaration +sortDeclaration[CVC4::Command*& smt_command] @declarations { std::string name; } : sortName[name,CHECK_UNDECLARED] { Debug("parser") << "sort decl: '" << name << "'" << std::endl; - PARSER_STATE->mkSort(name); } + Type type = PARSER_STATE->mkSort(name); + smt_command = new DeclareTypeCommand(name, 0, type); + } ; /** @@ -503,8 +526,19 @@ status[ CVC4::BenchmarkStatus& status ] /** * Matches an annotation, which is an attribute name, with an optional user */ -annotation - : attribute (USER_VALUE)? +annotation[CVC4::Command*& smt_command] +@init { + std::string key; + smt_command = NULL; +} + : attribute[key] + ( USER_VALUE + { smt_command = new SetInfoCommand(key, AntlrInput::tokenText($USER_VALUE)); } + )? + { if(smt_command == NULL) { + smt_command = new EmptyCommand(std::string("annotation: ") + key); + } + } ; /** @@ -676,21 +710,20 @@ FLET_IDENTIFIER ; /** - * Matches the value of user-defined annotations or attributes. The only constraint imposed on a user-defined value is that it start with - * an open brace and end with closed brace. + * Matches the value of user-defined annotations or attributes. The + * only constraint imposed on a user-defined value is that it start + * with an open brace and end with closed brace. */ USER_VALUE - : '{' - ( '\\{' | '\\}' | ~('{' | '}') )* - '}' + : '{' ( '\\{' | '\\}' | ~('{' | '}') )* '}' ; - /** * Matches and skips whitespace in the input. */ WHITESPACE - : (' ' | '\t' | '\f' | '\r' | '\n')+ { SKIP();; } + : (' ' | '\t' | '\f' | '\r' | '\n')+ + { SKIP(); } ; /** @@ -716,7 +749,8 @@ STRING_LITERAL * Matches the comments and ignores them */ COMMENT - : ';' (~('\n' | '\r'))* { SKIP();; } + : ';' (~('\n' | '\r'))* + { SKIP(); } ; diff --git a/src/parser/smt/smt.cpp b/src/parser/smt/smt.cpp index a8dabeffe..a6e716b77 100644 --- a/src/parser/smt/smt.cpp +++ b/src/parser/smt/smt.cpp @@ -2,8 +2,8 @@ /*! \file smt.cpp ** \verbatim ** Original author: cconway - ** Major contributors: none - ** Minor contributors (to current version): dejan, mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -20,6 +20,7 @@ namespace std { } #include "expr/type.h" +#include "expr/command.h" #include "parser/parser.h" #include "parser/smt/smt.h" @@ -80,6 +81,10 @@ void Smt::addTheory(Theory theory) { case THEORY_ARRAYS_EX: { Type indexType = mkSort("Index"); Type elementType = mkSort("Element"); + DeclarationSequence* seq = new DeclarationSequence(); + seq->addCommand(new DeclareTypeCommand("Index", 0, indexType)); + seq->addCommand(new DeclareTypeCommand("Element", 0, elementType)); + preemptCommand(seq); defineType("Array", getExprManager()->mkArrayType(indexType,elementType)); @@ -88,9 +93,11 @@ void Smt::addTheory(Theory theory) { break; } - case THEORY_EMPTY: - mkSort("U"); + case THEORY_EMPTY: { + Type sort = mkSort("U"); + preemptCommand(new DeclareTypeCommand("U", 0, sort)); break; + } case THEORY_REALS_INTS: defineType("Real", getExprManager()->realType()); diff --git a/src/parser/smt/smt.h b/src/parser/smt/smt.h index 98ebf6410..11a30c2fc 100644 --- a/src/parser/smt/smt.h +++ b/src/parser/smt/smt.h @@ -2,8 +2,8 @@ /*! \file smt.h ** \verbatim ** Original author: cconway - ** Major contributors: none - ** Minor contributors (to current version): mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/parser/smt/smt_input.cpp b/src/parser/smt/smt_input.cpp index d062683d3..d368339f5 100644 --- a/src/parser/smt/smt_input.cpp +++ b/src/parser/smt/smt_input.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/smt/smt_input.h b/src/parser/smt/smt_input.h index 2fb037f06..b976a3b6a 100644 --- a/src/parser/smt/smt_input.h +++ b/src/parser/smt/smt_input.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 091e6c93c..5ae04adea 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -143,7 +143,7 @@ parseExpr returns [CVC4::parser::smt2::myExpr expr] * Parses a command * @return the parsed command, or NULL if we've reached the end of the input */ -parseCommand returns [CVC4::Command* cmd] +parseCommand returns [CVC4::Command* cmd = NULL] : LPAREN_TOK c = command RPAREN_TOK { $cmd = c; } | EOF { $cmd = 0; } ; @@ -151,7 +151,7 @@ parseCommand returns [CVC4::Command* cmd] /** * Parse the internal portion of the command, ignoring the surrounding parentheses. */ -command returns [CVC4::Command* cmd] +command returns [CVC4::Command* cmd = NULL] @declarations { std::string name; std::vector names; @@ -192,11 +192,11 @@ command returns [CVC4::Command* cmd] << "' arity=" << n << std::endl; unsigned arity = AntlrInput::tokenToUnsigned(n); if(arity == 0) { - PARSER_STATE->mkSort(name); - $cmd = new DeclarationCommand(name, EXPR_MANAGER->kindType()); + Type type = PARSER_STATE->mkSort(name); + $cmd = new DeclareTypeCommand(name, 0, type); } else { - PARSER_STATE->mkSortConstructor(name, arity); - $cmd = new DeclarationCommand(name, EXPR_MANAGER->kindType()); + Type type = PARSER_STATE->mkSortConstructor(name, arity); + $cmd = new DeclareTypeCommand(name, arity, type); } } | /* sort definition */ @@ -216,7 +216,7 @@ command returns [CVC4::Command* cmd] // Do NOT call mkSort, since that creates a new sort! // This name is not its own distinct sort, it's an alias. PARSER_STATE->defineParameterizedType(name, sorts, t); - $cmd = new EmptyCommand; + $cmd = new DefineTypeCommand(name, sorts, t); } | /* function declaration */ DECLARE_FUN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] @@ -227,7 +227,7 @@ command returns [CVC4::Command* cmd] t = EXPR_MANAGER->mkFunctionType(sorts, t); } PARSER_STATE->mkVar(name, t); - $cmd = new DeclarationCommand(name,t); } + $cmd = new DeclareFunctionCommand(name, t); } | /* function definition */ DEFINE_FUN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK @@ -259,10 +259,16 @@ command returns [CVC4::Command* cmd] // must not be extended with the name itself; no recursion // permitted) Expr func = PARSER_STATE->mkFunction(name, t); - $cmd = new DefineFunctionCommand(func, terms, expr); + $cmd = new DefineFunctionCommand(name, func, terms, expr); } | /* value query */ - GET_VALUE_TOK LPAREN_TOK termList[terms,expr] RPAREN_TOK + ( GET_VALUE_TOK | + EVAL_TOK + { if(PARSER_STATE->strictModeEnabled()) { + PARSER_STATE->parseError("Strict compliance mode doesn't recognize \"eval\". Maybe you want (get-value...)?"); + } + } ) + LPAREN_TOK termList[terms,expr] RPAREN_TOK { if(terms.size() == 1) { $cmd = new GetValueCommand(terms[0]); } else { @@ -289,36 +295,86 @@ command returns [CVC4::Command* cmd] GET_ASSERTIONS_TOK { cmd = new GetAssertionsCommand; } | /* push */ - PUSH_TOK k=INTEGER_LITERAL - { unsigned n = AntlrInput::tokenToUnsigned(k); - if(n == 0) { - cmd = new EmptyCommand; - } else if(n == 1) { - cmd = new PushCommand; - } else { - CommandSequence* seq = new CommandSequence; - do { - seq->addCommand(new PushCommand); - } while(--n > 0); - cmd = seq; + PUSH_TOK + ( k=INTEGER_LITERAL + { unsigned n = AntlrInput::tokenToUnsigned(k); + if(n == 0) { + cmd = new EmptyCommand; + } else if(n == 1) { + cmd = new PushCommand; + } else { + CommandSequence* seq = new CommandSequence; + do { + seq->addCommand(new PushCommand); + } while(--n > 0); + cmd = seq; + } } - } - | POP_TOK k=INTEGER_LITERAL - { unsigned n = AntlrInput::tokenToUnsigned(k); - if(n == 0) { - cmd = new EmptyCommand; - } else if(n == 1) { - cmd = new PopCommand; - } else { - CommandSequence* seq = new CommandSequence; - do { - seq->addCommand(new PopCommand); - } while(--n > 0); - cmd = seq; + | { if(PARSER_STATE->strictModeEnabled()) { + PARSER_STATE->parseError("Strict compliance mode demands an integer to be provided to PUSH. Maybe you want (push 1)?"); + } else { + cmd = new PushCommand; + } + } ) + | POP_TOK + ( k=INTEGER_LITERAL + { unsigned n = AntlrInput::tokenToUnsigned(k); + if(n == 0) { + cmd = new EmptyCommand; + } else if(n == 1) { + cmd = new PopCommand; + } else { + CommandSequence* seq = new CommandSequence; + do { + seq->addCommand(new PopCommand); + } while(--n > 0); + cmd = seq; + } } - } + | { if(PARSER_STATE->strictModeEnabled()) { + PARSER_STATE->parseError("Strict compliance mode demands an integer to be provided to POP. Maybe you want (pop 1)?"); + } else { + cmd = new PopCommand; + } + } ) | EXIT_TOK { cmd = new QuitCommand; } + + /* CVC4-extended SMT-LIBv2 commands */ + | extendedCommand[cmd] + { if(PARSER_STATE->strictModeEnabled()) { + PARSER_STATE->parseError("Extended commands are not permitted while operating in strict compliance mode."); + } + } + ; + +extendedCommand[CVC4::Command*& cmd] +@declarations { + std::vector dts; + Expr e; +} + /* Z3's extended SMT-LIBv2 set of commands syntax */ + : DECLARE_DATATYPES_TOK + { /* open a scope to keep the UnresolvedTypes contained */ + PARSER_STATE->pushScope(); } + LPAREN_TOK ( LPAREN_TOK datatypeDef[dts] RPAREN_TOK )+ RPAREN_TOK + { PARSER_STATE->popScope(); + cmd = new DatatypeDeclarationCommand(PARSER_STATE->mkMutualDatatypeTypes(dts)); } + + + | DECLARE_SORTS_TOK + | DECLARE_FUNS_TOK + | DECLARE_PREDS_TOK + | DEFINE_TOK + | DEFINE_SORTS_TOK + | DECLARE_CONST_TOK + + | SIMPLIFY_TOK term[e] + { cmd = new SimplifyCommand(e); } + | ECHO_TOK + ( STRING_LITERAL + { Message() << AntlrInput::tokenText($STRING_LITERAL) << std::endl; } + | { Message() << std::endl; } ) ; symbolicExpr[CVC4::SExpr& sexpr] @@ -441,7 +497,7 @@ term[CVC4::Expr& expr] Expr func = PARSER_STATE->mkFunction(name, expr.getType()); // bind name to expr with define-fun Command* c = - new DefineNamedFunctionCommand(func, std::vector(), expr); + new DefineNamedFunctionCommand(name, func, std::vector(), expr); PARSER_STATE->preemptCommand(c); } else { std::stringstream ss; @@ -716,6 +772,73 @@ nonemptyNumeralList[std::vector& numerals] )+ ; +/** + * Parses a datatype definition + */ +datatypeDef[std::vector& datatypes] +@init { + std::string id, id2; + Type t; + std::vector< Type > params; +} + /* This really needs to be CHECK_NONE, or mutually-recursive + * datatypes won't work, because this type will already be + * "defined" as an unresolved type; don't worry, we check + * below. */ + : symbol[id,CHECK_NONE,SYM_SORT] { PARSER_STATE->pushScope(); } + ( '[' symbol[id2,CHECK_UNDECLARED,SYM_SORT] { + t = PARSER_STATE->mkSort(id2); + params.push_back( t ); + } + ( symbol[id2,CHECK_UNDECLARED,SYM_SORT] { + t = PARSER_STATE->mkSort(id2); + params.push_back( t ); } + )* ']' + )? + { datatypes.push_back(Datatype(id,params)); + if(!PARSER_STATE->isUnresolvedType(id)) { + // if not unresolved, must be undeclared + PARSER_STATE->checkDeclaration(id, CHECK_UNDECLARED, SYM_SORT); + } + } + ( LPAREN_TOK constructorDef[datatypes.back()] RPAREN_TOK )+ + { PARSER_STATE->popScope(); } + ; + +/** + * Parses a constructor defintion for type + */ +constructorDef[CVC4::Datatype& type] +@init { + std::string id; + CVC4::Datatype::Constructor* ctor = NULL; +} + : symbol[id,CHECK_UNDECLARED,SYM_SORT] + { // make the tester + std::string testerId("is_"); + testerId.append(id); + PARSER_STATE->checkDeclaration(testerId, CHECK_UNDECLARED, SYM_SORT); + ctor = new CVC4::Datatype::Constructor(id, testerId); + } + ( LPAREN_TOK selector[*ctor] RPAREN_TOK )* + { // make the constructor + type.addConstructor(*ctor); + Debug("parser-idt") << "constructor: " << id.c_str() << std::endl; + delete ctor; + } + ; + +selector[CVC4::Datatype::Constructor& ctor] +@init { + std::string id; + Type t, t2; +} + : symbol[id,CHECK_UNDECLARED,SYM_SORT] sortSymbol[t] + { ctor.addArg(id, t); + Debug("parser-idt") << "selector: " << id.c_str() << std::endl; + } + ; + // Base SMT-LIB tokens ASSERT_TOK : 'assert'; CHECKSAT_TOK : 'check-sat'; @@ -741,6 +864,18 @@ GET_OPTION_TOK : 'get-option'; PUSH_TOK : 'push'; POP_TOK : 'pop'; +// extended commands +DECLARE_DATATYPES_TOK : 'declare-datatypes'; +DECLARE_SORTS_TOK : 'declare-sorts'; +DECLARE_FUNS_TOK : 'declare-funs'; +DECLARE_PREDS_TOK : 'declare-preds'; +DEFINE_TOK : 'define'; +DEFINE_SORTS_TOK : 'define-sorts'; +DECLARE_CONST_TOK : 'declare-const'; +SIMPLIFY_TOK : 'simplify'; +EVAL_TOK : 'eval'; +ECHO_TOK : 'echo'; + // operators (NOTE: theory symbols go here) AMPERSAND_TOK : '&'; AND_TOK : 'and'; @@ -759,7 +894,6 @@ MINUS_TOK : '-'; NOT_TOK : 'not'; OR_TOK : 'or'; PERCENT_TOK : '%'; -PIPE_TOK : '|'; PLUS_TOK : '+'; POUND_TOK : '#'; SELECT_TOK : 'select'; diff --git a/src/parser/smt2/smt2_input.cpp b/src/parser/smt2/smt2_input.cpp index 9a349785c..acd0e17f6 100644 --- a/src/parser/smt2/smt2_input.cpp +++ b/src/parser/smt2/smt2_input.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/parser/smt2/smt2_input.h b/src/parser/smt2/smt2_input.h index 04fe48fe1..05a62c30d 100644 --- a/src/parser/smt2/smt2_input.h +++ b/src/parser/smt2/smt2_input.h @@ -2,10 +2,10 @@ /*! \file smt2_input.h ** \verbatim ** Original author: cconway - ** Major contributors: none - ** Minor contributors (to current version): mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/printer/ast/ast_printer.cpp b/src/printer/ast/ast_printer.cpp index 5863ded9f..082765765 100644 --- a/src/printer/ast/ast_printer.cpp +++ b/src/printer/ast/ast_printer.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -112,9 +112,12 @@ void AstPrinter::toStream(std::ostream& out, const Command* c, tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || + tryToStream(out, c) || tryToStream(out, c) || - tryToStream(out, c) || + tryToStream(out, c) || tryToStream(out, c) || + tryToStream(out, c) || + tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || @@ -126,7 +129,8 @@ void AstPrinter::toStream(std::ostream& out, const Command* c, tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || - tryToStream(out, c)) { + tryToStream(out, c) || + tryToStream(out, c)) { return; } @@ -167,6 +171,16 @@ static void toStream(std::ostream& out, const QuitCommand* c) { out << "Quit()"; } +static void toStream(std::ostream& out, const DeclarationSequence* c) { + out << "DeclarationSequence[" << endl; + for(CommandSequence::const_iterator i = c->begin(); + i != c->end(); + ++i) { + out << *i << endl; + } + out << "]"; +} + static void toStream(std::ostream& out, const CommandSequence* c) { out << "CommandSequence[" << endl; for(CommandSequence::const_iterator i = c->begin(); @@ -177,13 +191,8 @@ static void toStream(std::ostream& out, const CommandSequence* c) { out << "]"; } -static void toStream(std::ostream& out, const DeclarationCommand* c) { - const vector& declaredSymbols = c->getDeclaredSymbols(); - out << "Declare(["; - copy( declaredSymbols.begin(), declaredSymbols.end() - 1, - ostream_iterator(out, ", ") ); - out << declaredSymbols.back(); - out << "])"; +static void toStream(std::ostream& out, const DeclareFunctionCommand* c) { + out << "Declare(" << c->getSymbol() << "," << c->getType() << ")"; } static void toStream(std::ostream& out, const DefineFunctionCommand* c) { @@ -199,6 +208,22 @@ static void toStream(std::ostream& out, const DefineFunctionCommand* c) { out << "], << " << formula << " >> )"; } +static void toStream(std::ostream& out, const DeclareTypeCommand* c) { + out << "DeclareType(" << c->getSymbol() << "," << c->getArity() << "," + << c->getType() << ")"; +} + +static void toStream(std::ostream& out, const DefineTypeCommand* c) { + const vector& params = c->getParameters(); + out << "DefineType(" << c->getSymbol() << ",["; + if(params.size() > 0) { + copy( params.begin(), params.end() - 1, + ostream_iterator(out, ", ") ); + out << params.back(); + } + out << "]," << c->getType() << ")"; +} + static void toStream(std::ostream& out, const DefineNamedFunctionCommand* c) { out << "DefineNamedFunction( "; toStream(out, static_cast(c)); @@ -252,6 +277,10 @@ static void toStream(std::ostream& out, const DatatypeDeclarationCommand* c) { out << "])"; } +static void toStream(std::ostream& out, const CommentCommand* c) { + out << "CommentCommand([" << c->getComment() << "])"; +} + template static bool tryToStream(std::ostream& out, const Command* c) { if(typeid(*c) == typeid(T)) { diff --git a/src/printer/ast/ast_printer.h b/src/printer/ast/ast_printer.h index ddc3c50b8..69c39915b 100644 --- a/src/printer/ast/ast_printer.h +++ b/src/printer/ast/ast_printer.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/printer/cvc/cvc_printer.cpp b/src/printer/cvc/cvc_printer.cpp index 8e089a8a3..0f3d635bd 100644 --- a/src/printer/cvc/cvc_printer.cpp +++ b/src/printer/cvc/cvc_printer.cpp @@ -28,6 +28,7 @@ #include #include #include +#include using namespace std; @@ -172,6 +173,15 @@ void CvcPrinter::toStream(std::ostream& out, TNode n, return; } else if(n.getMetaKind() == kind::metakind::PARAMETERIZED) { switch(n.getKind()) { + case kind::SORT_TYPE: { + std::string name; + if(n.getAttribute(expr::VarNameAttr(), name)) { + out << name; + } else { + goto default_case; + } + break; + } case kind::BITVECTOR_EXTRACT: out << n[0] << n.getOperator().getConst(); break; @@ -192,6 +202,7 @@ void CvcPrinter::toStream(std::ostream& out, TNode n, break; default: + default_case: out << n.getOperator(); if(n.getNumChildren() > 0) { out << '('; @@ -231,9 +242,24 @@ void CvcPrinter::toStream(std::ostream& out, TNode n, case kind::SELECT: out << n[0] << '[' << n[1] << ']'; break; - case kind::STORE: - out << n[0] << " WITH [" << n[1] << "] = " << n[2]; + case kind::STORE: { + stack stk; + stk.push(n); + while(stk.top()[0].getKind() == kind::STORE) { + stk.push(stk.top()[0]); + } + out << '('; + TNode x = stk.top(); + out << x[0] << " WITH [" << x[1] << "] := " << x[2]; + stk.pop(); + while(!stk.empty()) { + x = stk.top(); + out << ", [" << x[1] << "] := " << x[2]; + stk.pop(); + } + out << ')'; break; + } case kind::TUPLE_TYPE: out << '['; @@ -301,7 +327,9 @@ void CvcPrinter::toStream(std::ostream& out, TNode n, // infix binary operator out << '(' << n[0] << ' ' << n.getOperator() << ' ' << n[1] << ')'; } else if(n.getKind() == kind::AND || - n.getKind() == kind::OR) { + n.getKind() == kind::OR || + n.getKind() == kind::PLUS || + n.getKind() == kind::MULT) { // infix N-ary operator TNode::iterator i = n.begin(); out << '(' << *i++; @@ -347,9 +375,12 @@ void CvcPrinter::toStream(std::ostream& out, const Command* c, tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || + tryToStream(out, c) || tryToStream(out, c) || - tryToStream(out, c) || + tryToStream(out, c) || tryToStream(out, c) || + tryToStream(out, c) || + tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || @@ -361,7 +392,8 @@ void CvcPrinter::toStream(std::ostream& out, const Command* c, tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || - tryToStream(out, c)) { + tryToStream(out, c) || + tryToStream(out, c)) { return; } @@ -385,16 +417,22 @@ static void toStream(std::ostream& out, const CheckSatCommand* c) { BoolExpr e = c->getExpr(); if(!e.isNull()) { out << "CHECKSAT " << e << ";"; + } else { + out << "CHECKSAT;"; } - out << "CHECKSAT;"; } static void toStream(std::ostream& out, const QueryCommand* c) { - out << "QUERY " << c->getExpr() << ";"; + BoolExpr e = c->getExpr(); + if(!e.isNull()) { + out << "QUERY " << e << ";"; + } else { + out << "QUERY TRUE;"; + } } static void toStream(std::ostream& out, const QuitCommand* c) { - Unhandled("quit command"); + //out << "EXIT;"; } static void toStream(std::ostream& out, const CommandSequence* c) { @@ -405,14 +443,22 @@ static void toStream(std::ostream& out, const CommandSequence* c) { } } -static void toStream(std::ostream& out, const DeclarationCommand* c) { - const vector& declaredSymbols = c->getDeclaredSymbols(); - Type declaredType = c->getDeclaredType(); - Assert(declaredSymbols.size() > 0); - copy( declaredSymbols.begin(), declaredSymbols.end() - 1, - ostream_iterator(out, ", ") ); - out << declaredSymbols.back(); - out << " : " << declaredType << ";"; +static void toStream(std::ostream& out, const DeclarationSequence* c) { + DeclarationSequence::const_iterator i = c->begin(); + for(;;) { + DeclarationDefinitionCommand* dd = + static_cast(*i++); + if(i != c->end()) { + out << dd->getSymbol() << ", "; + } else { + out << *dd; + break; + } + } +} + +static void toStream(std::ostream& out, const DeclareFunctionCommand* c) { + out << c->getSymbol() << " : " << c->getType() << ";"; } static void toStream(std::ostream& out, const DefineFunctionCommand* c) { @@ -430,6 +476,22 @@ static void toStream(std::ostream& out, const DefineFunctionCommand* c) { out << "): " << formula << ";"; } +static void toStream(std::ostream& out, const DeclareTypeCommand* c) { + if(c->getArity() > 0) { + Unhandled("Don't know how to print parameterized type declaration " + "in CVC language:\n%s", c->toString().c_str()); + } + out << c->getSymbol() << " : TYPE;"; +} + +static void toStream(std::ostream& out, const DefineTypeCommand* c) { + if(c->getParameters().size() > 0) { + Unhandled("Don't know how to print parameterized type definition " + "in CVC language:\n%s", c->toString().c_str()); + } + out << c->getSymbol() << " : TYPE = " << c->getType() << ";"; +} + static void toStream(std::ostream& out, const DefineNamedFunctionCommand* c) { toStream(out, static_cast(c)); } @@ -484,6 +546,10 @@ static void toStream(std::ostream& out, const DatatypeDeclarationCommand* c) { } } +static void toStream(std::ostream& out, const CommentCommand* c) { + out << "% " << c->getComment(); +} + template static bool tryToStream(std::ostream& out, const Command* c) { if(typeid(*c) == typeid(T)) { diff --git a/src/printer/cvc/cvc_printer.h b/src/printer/cvc/cvc_printer.h index d794c82e8..fd478dbe5 100644 --- a/src/printer/cvc/cvc_printer.h +++ b/src/printer/cvc/cvc_printer.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/printer/printer.cpp b/src/printer/printer.cpp index ca5935bec..6714d355e 100644 --- a/src/printer/printer.cpp +++ b/src/printer/printer.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/printer/printer.h b/src/printer/printer.h index eae2fc48f..7294ab231 100644 --- a/src/printer/printer.h +++ b/src/printer/printer.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/printer/smt/smt_printer.cpp b/src/printer/smt/smt_printer.cpp index de22a04c1..ed7f8febf 100644 --- a/src/printer/smt/smt_printer.cpp +++ b/src/printer/smt/smt_printer.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/printer/smt/smt_printer.h b/src/printer/smt/smt_printer.h index 058a6b18c..14d6c09e1 100644 --- a/src/printer/smt/smt_printer.h +++ b/src/printer/smt/smt_printer.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index 5ce571904..5758b1101 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -23,6 +23,8 @@ #include #include +#include "util/boolean_simplification.h" + using namespace std; namespace CVC4 { @@ -64,6 +66,17 @@ void Smt2Printer::toStream(std::ostream& out, TNode n, // constant if(n.getMetaKind() == kind::metakind::CONSTANT) { switch(n.getKind()) { + case kind::TYPE_CONSTANT: + switch(n.getConst()) { + case BOOLEAN_TYPE: out << "Boolean"; break; + case REAL_TYPE: out << "Real"; break; + case INTEGER_TYPE: out << "Int"; break; + default: + // fall back on whatever operator<< does on underlying type; we + // might luck out and be SMT-LIB v2 compliant + kind::metakind::NodeValueConstPrinter::toStream(out, n); + } + break; case kind::BITVECTOR_TYPE: out << "(_ BitVec " << n.getConst().size << ")"; break; @@ -91,11 +104,20 @@ void Smt2Printer::toStream(std::ostream& out, TNode n, return; } + if(n.getKind() == kind::SORT_TYPE) { + std::string name; + if(n.getAttribute(expr::VarNameAttr(), name)) { + out << name; + return; + } + } + bool stillNeedToPrintParams = true; // operator out << '('; switch(n.getKind()) { // builtin theory + case kind::APPLY: break; case kind::EQUAL: out << "= "; break; case kind::DISTINCT: out << "distinct "; break; case kind::TUPLE: break; @@ -111,7 +133,6 @@ void Smt2Printer::toStream(std::ostream& out, TNode n, // uf theory case kind::APPLY_UF: break; - case kind::SORT_TYPE: break; // arith theory case kind::PLUS: out << "+ "; break; @@ -127,6 +148,7 @@ void Smt2Printer::toStream(std::ostream& out, TNode n, // arrays theory case kind::SELECT: out << "select "; break; case kind::STORE: out << "store "; break; + case kind::ARRAY_TYPE: out << "Array "; break; // bv theory case kind::BITVECTOR_CONCAT: out << "concat "; break; @@ -253,8 +275,10 @@ void Smt2Printer::toStream(std::ostream& out, const Command* c, tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || - tryToStream(out, c) || + tryToStream(out, c) || tryToStream(out, c) || + tryToStream(out, c) || + tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || @@ -266,7 +290,8 @@ void Smt2Printer::toStream(std::ostream& out, const Command* c, tryToStream(out, c) || tryToStream(out, c) || tryToStream(out, c) || - tryToStream(out, c)) { + tryToStream(out, c) || + tryToStream(out, c)) { return; } @@ -289,13 +314,25 @@ static void toStream(std::ostream& out, const PopCommand* c) { static void toStream(std::ostream& out, const CheckSatCommand* c) { BoolExpr e = c->getExpr(); if(!e.isNull()) { - out << "(assert " << e << ")"; + out << PushCommand() << endl + << AssertCommand(e) << endl + << CheckSatCommand() << endl + << PopCommand() << endl; + } else { + out << "(check-sat)"; } - out << "(check-sat)"; } static void toStream(std::ostream& out, const QueryCommand* c) { - Unhandled("query command"); + BoolExpr e = c->getExpr(); + if(!e.isNull()) { + out << PushCommand() << endl + << AssertCommand(BooleanSimplification::negate(e)) << endl + << CheckSatCommand() << endl + << PopCommand() << endl; + } else { + out << "(check-sat)"; + } } static void toStream(std::ostream& out, const QuitCommand* c) { @@ -310,26 +347,21 @@ static void toStream(std::ostream& out, const CommandSequence* c) { } } -static void toStream(std::ostream& out, const DeclarationCommand* c) { - const vector& declaredSymbols = c->getDeclaredSymbols(); - Type declaredType = c->getDeclaredType(); - for(vector::const_iterator i = declaredSymbols.begin(); - i != declaredSymbols.end(); - ++i) { - if(declaredType.isFunction()) { - FunctionType ft = declaredType; - out << "(declare-fun " << *i << " ("; - const vector argTypes = ft.getArgTypes(); - if(argTypes.size() > 0) { - copy( argTypes.begin(), argTypes.end() - 1, - ostream_iterator(out, " ") ); - out << argTypes.back(); - } - out << ") " << ft.getRangeType() << ")"; - } else { - out << "(declare-fun " << *i << " () " << declaredType << ")"; +static void toStream(std::ostream& out, const DeclareFunctionCommand* c) { + Type type = c->getType(); + out << "(declare-fun " << c->getSymbol() << " ("; + if(type.isFunction()) { + FunctionType ft = type; + const vector argTypes = ft.getArgTypes(); + if(argTypes.size() > 0) { + copy( argTypes.begin(), argTypes.end() - 1, + ostream_iterator(out, " ") ); + out << argTypes.back(); } + type = ft.getRangeType(); } + + out << ") " << type << ")"; } static void toStream(std::ostream& out, const DefineFunctionCommand* c) { @@ -337,14 +369,34 @@ static void toStream(std::ostream& out, const DefineFunctionCommand* c) { const vector& formals = c->getFormals(); Expr formula = c->getFormula(); out << "(define-fun " << func << " ("; - for(vector::const_iterator i = formals.begin(); - i != formals.end(); - ++i) { + vector::const_iterator i = formals.begin(); + for(;;) { out << "(" << (*i) << " " << (*i).getType() << ")"; + ++i; + if(i != formals.end()) { + out << " "; + } else { + break; + } } out << ") " << FunctionType(func.getType()).getRangeType() << " " << formula << ")"; } +static void toStream(std::ostream& out, const DeclareTypeCommand* c) { + out << "(declare-sort " << c->getSymbol() << " " << c->getArity() << ")"; +} + +static void toStream(std::ostream& out, const DefineTypeCommand* c) { + const vector& params = c->getParameters(); + out << "(define-sort " << c->getSymbol() << " ("; + if(params.size() > 0) { + copy( params.begin(), params.end() - 1, + ostream_iterator(out, " ") ); + out << params.back(); + } + out << ") " << c->getType() << ")"; +} + static void toStream(std::ostream& out, const DefineNamedFunctionCommand* c) { out << "DefineNamedFunction( "; toStream(out, static_cast(c)); @@ -406,6 +458,10 @@ static void toStream(std::ostream& out, const DatatypeDeclarationCommand* c) { Unhandled("datatype declaration command"); } +static void toStream(std::ostream& out, const CommentCommand* c) { + out << "(set-info :notes \"" << c->getComment() << "\")"; +} + template static bool tryToStream(std::ostream& out, const Command* c) { if(typeid(*c) == typeid(T)) { diff --git a/src/printer/smt2/smt2_printer.h b/src/printer/smt2/smt2_printer.h index 4bae8a2e1..2086370ae 100644 --- a/src/printer/smt2/smt2_printer.h +++ b/src/printer/smt2/smt2_printer.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/prop/cnf_stream.cpp b/src/prop/cnf_stream.cpp index 9797e4c67..5b8e4c3f3 100644 --- a/src/prop/cnf_stream.cpp +++ b/src/prop/cnf_stream.cpp @@ -2,8 +2,8 @@ /*! \file cnf_stream.cpp ** \verbatim ** Original author: taking - ** Major contributors: dejan - ** Minor contributors (to current version): cconway, mdeters + ** Major contributors: mdeters, dejan + ** Minor contributors (to current version): cconway ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -18,13 +18,15 @@ ** of given an equisatisfiable stream of assertions to PropEngine. **/ -#include "sat.h" +#include "prop/sat.h" #include "prop/cnf_stream.h" #include "prop/prop_engine.h" #include "theory/theory_engine.h" #include "expr/node.h" #include "util/Assert.h" #include "util/output.h" +#include "expr/command.h" +#include "expr/expr.h" #include @@ -57,6 +59,21 @@ TseitinCnfStream::TseitinCnfStream(SatInputInterface* satSolver, theory::Registr void CnfStream::assertClause(TNode node, SatClause& c) { Debug("cnf") << "Inserting into stream " << c << endl; + if(Dump.isOn("clauses")) { + if(Message.isOn()) { + if(c.size() == 1) { + Message() << AssertCommand(BoolExpr(getNode(c[0]).toExpr())) << endl; + } else { + Assert(c.size() > 1); + NodeBuilder<> b(kind::OR); + for(int i = 0; i < c.size(); ++i) { + b << getNode(c[i]); + } + Node n = b; + Message() << AssertCommand(BoolExpr(n.toExpr())) << endl; + } + } + } d_satSolver->addClause(c, d_removable); } @@ -114,7 +131,8 @@ SatLiteral CnfStream::newLiteral(TNode node, bool theoryLiteral) { // If it's a theory literal, need to store it for back queries if ( theoryLiteral || - ( CVC4_USE_REPLAY && Options::current()->replayLog != NULL ) ) { + ( CVC4_USE_REPLAY && Options::current()->replayLog != NULL ) || + Dump.isOn("clauses") ) { d_nodeCache[lit] = node; d_nodeCache[~lit] = node.notNode(); } @@ -580,6 +598,15 @@ void TseitinCnfStream::convertAndAssert(TNode node, bool removable, bool negated void TseitinCnfStream::convertAndAssert(TNode node, bool negated) { Debug("cnf") << "convertAndAssert(" << node << ", negated = " << (negated ? "true" : "false") << ")" << endl; + + if(hasLiteral(node)) { + Debug("cnf") << "==> fortunate literal detected!" << endl; + ++d_fortunateLiterals; + SatLiteral lit = getLiteral(node); + //d_satSolver->renewVar(lit); + assertClause(node, negated ? ~lit : lit); + } + switch(node.getKind()) { case AND: convertAndAssertAnd(node, negated); diff --git a/src/prop/cnf_stream.h b/src/prop/cnf_stream.h index fd0ab6291..ecb0fd2fb 100644 --- a/src/prop/cnf_stream.h +++ b/src/prop/cnf_stream.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: taking ** Major contributors: mdeters, dejan - ** Minor contributors (to current version): cconway + ** Minor contributors (to current version): barrett, cconway ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -77,6 +77,24 @@ protected: /** Top level nodes that we translated */ std::vector d_translationTrail; + /** + * How many literals were already mapped at the top-level when we + * tried to convertAndAssert() something. This + * achieves early detection of units and leads to fewer + * clauses. It's motivated by the following pattern: + * + * ASSERT BIG FORMULA => x + * (and then later...) + * ASSERT BIG FORMULA + * + * With the first assert, BIG FORMULA is clausified, and a literal + * is assigned for the top level so that the final clause for the + * implication is "lit => x". But without "fortunate literal + * detection," when BIG FORMULA is later asserted, it is clausified + * separately, and "lit" is never asserted as a unit clause. + */ + KEEP_STATISTIC(IntStat, d_fortunateLiterals, "prop::CnfStream::fortunateLiterals", 0); + /** Remove nots from the node */ TNode stripNot(TNode node) { while (node.getKind() == kind::NOT) { diff --git a/src/prop/minisat/Makefile.am b/src/prop/minisat/Makefile.am index 3e844ef79..6e003c248 100644 --- a/src/prop/minisat/Makefile.am +++ b/src/prop/minisat/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = \ -D__BUILDING_CVC4LIB \ -D __STDC_LIMIT_MACROS \ - -D __STDC_FORMAT_MACROS \ + -D __STDC_FORMAT_MACROS \ -I@srcdir@/ -I@srcdir@/../.. -I@builddir@/../.. -I@srcdir@/../../include AM_CXXFLAGS = -Wall -Wno-parentheses -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) diff --git a/src/prop/minisat/core/Solver.cc b/src/prop/minisat/core/Solver.cc index 711379519..e160e1ef5 100644 --- a/src/prop/minisat/core/Solver.cc +++ b/src/prop/minisat/core/Solver.cc @@ -20,9 +20,14 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA #include +#include + #include "mtl/Sort.h" #include "core/Solver.h" + #include "prop/sat.h" +#include "util/output.h" +#include "expr/command.h" using namespace Minisat; using namespace CVC4; @@ -287,10 +292,16 @@ bool Solver::satisfied(const Clause& c) const { // Revert to the state at given level (keeping all assignment at 'level' but not beyond). // void Solver::cancelUntil(int level) { + Debug("minisat") << "minisat::cancelUntil(" << level << std::endl; + if (decisionLevel() > level){ // Pop the SMT context - for (int l = trail_lim.size() - level; l > 0; --l) + for (int l = trail_lim.size() - level; l > 0; --l) { context->pop(); + if(Dump.isOn("state")) { + Dump("state") << PopCommand() << std::endl; + } + } for (int c = trail.size()-1; c >= trail_lim[level]; c--){ Var x = var(trail[c]); assigns [x] = l_Undef; diff --git a/src/prop/minisat/core/Solver.h b/src/prop/minisat/core/Solver.h index 4c6e98a2e..8e5e05b1c 100644 --- a/src/prop/minisat/core/Solver.h +++ b/src/prop/minisat/core/Solver.h @@ -23,6 +23,8 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA #include "cvc4_private.h" +#include + #include "mtl/Vec.h" #include "mtl/Heap.h" #include "mtl/Alg.h" @@ -31,12 +33,14 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA #include "context/context.h" #include "theory/theory.h" +#include "util/output.h" +#include "expr/command.h" namespace CVC4 { namespace prop { class SatSolver; -} -} +}/* CVC4::prop namespace */ +}/* CVC4 namespace */ namespace Minisat { @@ -441,7 +445,7 @@ inline bool Solver::addClause (Lit p, bool removable) inline bool Solver::addClause (Lit p, Lit q, bool removable) { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); return addClause_(add_tmp, removable); } inline bool Solver::addClause (Lit p, Lit q, Lit r, bool removable) { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); add_tmp.push(r); return addClause_(add_tmp, removable); } inline bool Solver::locked (const Clause& c) const { return value(c[0]) == l_True && isPropagatedBy(var(c[0]), c); } -inline void Solver::newDecisionLevel() { trail_lim.push(trail.size()); context->push(); } +inline void Solver::newDecisionLevel() { trail_lim.push(trail.size()); context->push(); if(Dump.isOn("state")) { Dump("state") << CVC4::PushCommand() << std::endl; } } inline int Solver::decisionLevel () const { return trail_lim.size(); } inline uint32_t Solver::abstractLevel (Var x) const { return 1 << (level(x) & 31); } @@ -495,6 +499,6 @@ inline void Solver::toDimacs (const char* file, Lit p, Lit q, Lit r){ ve //================================================================================================= -} +}/* Minisat namespace */ #endif diff --git a/src/prop/prop_engine.cpp b/src/prop/prop_engine.cpp index 046e4ef7e..c8e4083b1 100644 --- a/src/prop/prop_engine.cpp +++ b/src/prop/prop_engine.cpp @@ -2,8 +2,8 @@ /*! \file prop_engine.cpp ** \verbatim ** Original author: mdeters - ** Major contributors: taking, cconway, dejan - ** Minor contributors (to current version): none + ** Major contributors: dejan + ** Minor contributors (to current version): barrett, taking, cconway ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -90,14 +90,10 @@ void PropEngine::assertLemma(TNode node, bool negated, bool removable) { //Assert(d_inCheckSat, "Sat solver should be in solve()!"); Debug("prop::lemmas") << "assertLemma(" << node << ")" << endl; - if(Options::current()->preprocessOnly) { - if(Message.isOn()) { - // If "preprocess only" mode is in effect, the lemmas we get - // here are due to theory reasoning during preprocessing. So - // push the lemma to the Message() stream. - expr::ExprSetDepth::Scope sdScope(Message.getStream(), -1); - Message() << AssertCommand(BoolExpr(node.toExpr())) << endl; - } + if(!d_inCheckSat && Dump.isOn("learned")) { + Dump("learned") << AssertCommand(BoolExpr(node.toExpr())) << endl; + } else if(Dump.isOn("lemmas")) { + Dump("lemmas") << AssertCommand(BoolExpr(node.toExpr())) << endl; } //TODO This comment is now false diff --git a/src/prop/prop_engine.h b/src/prop/prop_engine.h index 599439987..af7067130 100644 --- a/src/prop/prop_engine.h +++ b/src/prop/prop_engine.h @@ -3,18 +3,18 @@ ** \verbatim ** Original author: mdeters ** Major contributors: taking, dejan - ** Minor contributors (to current version): cconway + ** Minor contributors (to current version): cconway, barrett ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 The PropEngine (proposiitonal engine); main interface point - ** between CVC4's SMT infrastructure and the SAT solver. + ** \brief The PropEngine (propositional engine); main interface point + ** between CVC4's SMT infrastructure and the SAT solver ** - ** The PropEngine (proposiitonal engine); main interface point + ** The PropEngine (propositional engine); main interface point ** between CVC4's SMT infrastructure and the SAT solver. **/ @@ -118,6 +118,7 @@ public: * Return true if node has an associated SAT literal */ bool isSatLiteral(TNode node); + /** * Check if the node has a value and return it if yes. */ diff --git a/src/prop/sat.cpp b/src/prop/sat.cpp index a7eced6f2..8bda0fd1e 100644 --- a/src/prop/sat.cpp +++ b/src/prop/sat.cpp @@ -2,7 +2,7 @@ /*! \file sat.cpp ** \verbatim ** Original author: cconway - ** Major contributors: dejan, mdeters, taking + ** Major contributors: dejan, taking, mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/smt/bad_option_exception.h b/src/smt/bad_option_exception.h index 13e5d96d0..8fafb952e 100644 --- a/src/smt/bad_option_exception.h +++ b/src/smt/bad_option_exception.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/smt/modal_exception.h b/src/smt/modal_exception.h index c5c0f6ab2..de0565aa1 100644 --- a/src/smt/modal_exception.h +++ b/src/smt/modal_exception.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/smt/no_such_function_exception.h b/src/smt/no_such_function_exception.h index 0a5f2889c..615f6ab2b 100644 --- a/src/smt/no_such_function_exception.h +++ b/src/smt/no_such_function_exception.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index dcfa43424..3f1111879 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -70,7 +70,7 @@ namespace smt { */ class DefinedFunction { Node d_func; - std::vector d_formals; + vector d_formals; Node d_formula; public: DefinedFunction() {} @@ -114,7 +114,7 @@ class SmtEnginePrivate { theory::SubstitutionMap d_topLevelSubstitutions; /** - * Runs the nonslausal solver and tries to solve all the assigned + * Runs the nonclausal solver and tries to solve all the assigned * theory literals. */ void nonClausalSimplify(); @@ -215,6 +215,9 @@ SmtEngine::SmtEngine(ExprManager* em) throw(AssertionException) : } void SmtEngine::shutdown() { + if(Dump.isOn("benchmark")) { + Dump("benchmark") << QuitCommand() << endl; + } d_propEngine->shutdown(); d_theoryEngine->shutdown(); } @@ -248,6 +251,9 @@ void SmtEngine::setLogic(const std::string& s) throw(ModalException) { if(d_logic != "") { throw ModalException("logic already set"); } + if(Dump.isOn("benchmark")) { + Dump("benchmark") << SetBenchmarkLogicCommand(s) << endl; + } d_logic = s; d_theoryEngine->setLogic(s); @@ -259,7 +265,10 @@ void SmtEngine::setLogic(const std::string& s) throw(ModalException) { void SmtEngine::setInfo(const std::string& key, const SExpr& value) throw(BadOptionException, ModalException) { - Debug("smt") << "SMT setInfo(" << key << ", " << value << ")" << endl; + Trace("smt") << "SMT setInfo(" << key << ", " << value << ")" << endl; + if(Dump.isOn("benchmark")) { + Dump("benchmark") << SetInfoCommand(key, value) << endl; + } if(key == ":name" || key == ":source" || key == ":category" || @@ -285,7 +294,7 @@ void SmtEngine::setInfo(const std::string& key, const SExpr& value) SExpr SmtEngine::getInfo(const std::string& key) const throw(BadOptionException) { - Debug("smt") << "SMT getInfo(" << key << ")" << endl; + Trace("smt") << "SMT getInfo(" << key << ")" << endl; if(key == ":all-statistics") { vector stats; for(StatisticsRegistry::const_iterator i = StatisticsRegistry::begin(); @@ -323,7 +332,10 @@ SExpr SmtEngine::getInfo(const std::string& key) const void SmtEngine::setOption(const std::string& key, const SExpr& value) throw(BadOptionException, ModalException) { - Debug("smt") << "SMT setOption(" << key << ", " << value << ")" << endl; + Trace("smt") << "SMT setOption(" << key << ", " << value << ")" << endl; + if(Dump.isOn("benchmark")) { + Dump("benchmark") << SetOptionCommand(key, value) << endl; + } if(key == ":print-success") { throw BadOptionException(); @@ -362,7 +374,10 @@ void SmtEngine::setOption(const std::string& key, const SExpr& value) SExpr SmtEngine::getOption(const std::string& key) const throw(BadOptionException) { - Debug("smt") << "SMT getOption(" << key << ")" << endl; + Trace("smt") << "SMT getOption(" << key << ")" << endl; + if(Dump.isOn("benchmark")) { + Dump("benchmark") << GetOptionCommand(key) << endl; + } if(key == ":print-success") { return SExpr("true"); } else if(key == ":expand-definitions") { @@ -393,9 +408,21 @@ SExpr SmtEngine::getOption(const std::string& key) const void SmtEngine::defineFunction(Expr func, const std::vector& formals, Expr formula) { - Debug("smt") << "SMT defineFunction(" << func << ")" << endl; + Trace("smt") << "SMT defineFunction(" << func << ")" << endl; + /* + if(Dump.isOn("declarations")) { + stringstream ss; + ss << Expr::setlanguage(Expr::setlanguage::getLanguage(Dump("declarations"))) + << func; + Dump("declarations") << DefineFunctionCommand(ss.str(), func, formals, formula) + << endl; + } + */ NodeManagerScope nms(d_nodeManager); - Type formulaType = formula.getType(Options::current()->typeChecking);// type check body + + // type check body + Type formulaType = formula.getType(Options::current()->typeChecking); + Type funcType = func.getType(); Type rangeType = funcType.isFunction() ? FunctionType(funcType).getRangeType() : funcType; @@ -501,7 +528,7 @@ Node SmtEnginePrivate::expandDefinitions(TNode n, hash_mapsimplificationStyle == Options::AGGRESSIVE_SIMPLIFICATION_STYLE; - booleans::CircuitPropagator propagator(d_nonClausalLearnedLiterals, true, true, goNuts); + booleans::CircuitPropagator propagator(d_nonClausalLearnedLiterals, true, true); // Assert all the assertions to the propagator - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): asserting to propagator" << std::endl; + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "asserting to propagator" << endl; for (unsigned i = 0; i < d_assertionsToPreprocess.size(); ++ i) { propagator.assert(d_assertionsToPreprocess[i]); } - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): propagating" << std::endl; + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "propagating" << endl; if (propagator.propagate()) { // If in conflict, just return false - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): conflict in non-clausal propagation" << std::endl; + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "conflict in non-clausal propagation" << endl; d_assertionsToCheck.push_back(NodeManager::currentNM()->mkConst(false)); return; } else { @@ -562,7 +593,8 @@ void SmtEnginePrivate::nonClausalSimplify() { unsigned j = 0; for(unsigned i = 0, i_end = d_nonClausalLearnedLiterals.size(); i < i_end; ++ i) { // Simplify the literal we learned wrt previous substitutions - Node learnedLiteral = theory::Rewriter::rewrite(d_topLevelSubstitutions.apply(d_nonClausalLearnedLiterals[i])); + Node learnedLiteral = + theory::Rewriter::rewrite(d_topLevelSubstitutions.apply(d_nonClausalLearnedLiterals[i])); // It might just simplify to a constant if (learnedLiteral.isConst()) { if (learnedLiteral.getConst()) { @@ -570,23 +602,30 @@ void SmtEnginePrivate::nonClausalSimplify() { continue; } else { // If the learned literal simplifies to false, we're in conflict - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): conflict with " << d_nonClausalLearnedLiterals[i] << std::endl; + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "conflict with " + << d_nonClausalLearnedLiterals[i] << endl; d_assertionsToCheck.push_back(NodeManager::currentNM()->mkConst(false)); return; } } // Solve it with the corresponding theory - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): solving " << learnedLiteral << std::endl; - Theory::SolveStatus solveStatus = d_smt.d_theoryEngine->solve(learnedLiteral, d_topLevelSubstitutions); + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "solving " << learnedLiteral << endl; + Theory::SolveStatus solveStatus = + d_smt.d_theoryEngine->solve(learnedLiteral, d_topLevelSubstitutions); switch (solveStatus) { case Theory::SOLVE_STATUS_CONFLICT: // If in conflict, we return false - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): conflict while solving " << learnedLiteral << std::endl; + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "conflict while solving " + << learnedLiteral << endl; d_assertionsToCheck.push_back(NodeManager::currentNM()->mkConst(false)); return; case Theory::SOLVE_STATUS_SOLVED: // The literal should rewrite to true - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): solved " << learnedLiteral << std::endl; + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "solved " << learnedLiteral << endl; Assert(theory::Rewriter::rewrite(d_topLevelSubstitutions.apply(learnedLiteral)).isConst()); break; default: @@ -601,38 +640,53 @@ void SmtEnginePrivate::nonClausalSimplify() { for (unsigned i = 0; i < d_nonClausalLearnedLiterals.size(); ++ i) { d_assertionsToCheck.push_back(theory::Rewriter::rewrite(d_topLevelSubstitutions.apply(d_nonClausalLearnedLiterals[i]))); - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): non-clausal learned : " << d_assertionsToCheck.back() << std::endl; + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "non-clausal learned : " + << d_assertionsToCheck.back() << endl; } d_nonClausalLearnedLiterals.clear(); for (unsigned i = 0; i < d_assertionsToPreprocess.size(); ++ i) { d_assertionsToCheck.push_back(theory::Rewriter::rewrite(d_topLevelSubstitutions.apply(d_assertionsToPreprocess[i]))); - Debug("simplify") << "SmtEnginePrivate::nonClausalSimplify(): non-clausal preprocessed: " << d_assertionsToCheck.back() << std::endl; + Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): " + << "non-clausal preprocessed: " + << d_assertionsToCheck.back() << endl; } d_assertionsToPreprocess.clear(); } -void SmtEnginePrivate::simplifyAssertions() throw(NoSuchFunctionException, AssertionException) { +void SmtEnginePrivate::simplifyAssertions() + throw(NoSuchFunctionException, AssertionException) { try { - Debug("simplify") << "SmtEnginePrivate::simplify()" << std::endl; + Trace("simplify") << "SmtEnginePrivate::simplify()" << endl; if(!Options::current()->lazyDefinitionExpansion) { - Debug("simplify") << "SmtEnginePrivate::simplify(): expanding definitions" << std::endl; + Trace("simplify") << "SmtEnginePrivate::simplify(): expanding definitions" << endl; TimerStat::CodeTimer codeTimer(d_smt.d_definitionExpansionTime); hash_map cache; for (unsigned i = 0; i < d_assertionsToPreprocess.size(); ++ i) { - d_assertionsToPreprocess[i] = expandDefinitions(d_assertionsToPreprocess[i], cache); + d_assertionsToPreprocess[i] = + expandDefinitions(d_assertionsToPreprocess[i], cache); } } - // Perform the non-clausal simplification - Debug("simplify") << "SmtEnginePrivate::simplify(): performing non-clausal simplification" << std::endl; - nonClausalSimplify(); + if(Options::current()->simplificationMode != Options::SIMPLIFICATION_MODE_NONE) { + // Perform non-clausal simplification + Trace("simplify") << "SmtEnginePrivate::simplify(): " + << "performing non-clausal simplification" << endl; + nonClausalSimplify(); + } else { + Assert(d_assertionsToCheck.empty()); + d_assertionsToCheck.swap(d_assertionsToPreprocess); + } - // Perform static learning - Debug("simplify") << "SmtEnginePrivate::simplify(): performing static learning" << std::endl; - staticLearning(); + if(Options::current()->doStaticLearning) { + // Perform static learning + Trace("simplify") << "SmtEnginePrivate::simplify(): " + << "performing static learning" << endl; + staticLearning(); + } // Remove ITEs removeITEs(); @@ -652,38 +706,34 @@ void SmtEnginePrivate::simplifyAssertions() throw(NoSuchFunctionException, Asser } Result SmtEngine::check() { - Debug("smt") << "SmtEngine::check()" << endl; + Trace("smt") << "SmtEngine::check()" << endl; // make sure the prop layer has all assertions - Debug("smt") << "SmtEngine::check(): processing assertion" << endl; + Trace("smt") << "SmtEngine::check(): processing assertion" << endl; d_private->processAssertions(); - Debug("smt") << "SmtEngine::check(): running check" << endl; + Trace("smt") << "SmtEngine::check(): running check" << endl; return d_propEngine->checkSat(); } Result SmtEngine::quickCheck() { - Debug("smt") << "SMT quickCheck()" << endl; + Trace("smt") << "SMT quickCheck()" << endl; return Result(Result::VALIDITY_UNKNOWN, Result::REQUIRES_FULL_CHECK); } void SmtEnginePrivate::processAssertions() { - Debug("smt") << "SmtEnginePrivate::processAssertions()" << endl; + Trace("smt") << "SmtEnginePrivate::processAssertions()" << endl; // Simplify the assertions simplifyAssertions(); - if(Options::current()->preprocessOnly) { - if(Message.isOn()) { - // Push the formula to the Message() stream - for (unsigned i = 0; i < d_assertionsToCheck.size(); ++ i) { - expr::ExprSetDepth::Scope sdScope(Message.getStream(), -1); - Message() << AssertCommand(BoolExpr(d_assertionsToCheck[i].toExpr())) << endl; - } + if(Dump.isOn("assertions")) { + // Push the simplified assertions to the dump output stream + for (unsigned i = 0; i < d_assertionsToCheck.size(); ++ i) { + Dump("assertions") + << AssertCommand(BoolExpr(d_assertionsToCheck[i].toExpr())) << endl; } - // We still call into SAT below so that we can output theory - // contributions that come from presolve(). } // Push the formula to SAT @@ -693,9 +743,10 @@ void SmtEnginePrivate::processAssertions() { d_assertionsToCheck.clear(); } -void SmtEnginePrivate::addFormula(TNode n) throw(NoSuchFunctionException, AssertionException) { +void SmtEnginePrivate::addFormula(TNode n) + throw(NoSuchFunctionException, AssertionException) { - Debug("smt") << "SmtEnginePrivate::addFormula(" << n << ")" << endl; + Trace("smt") << "SmtEnginePrivate::addFormula(" << n << ")" << endl; // Add the normalized formula to the queue d_assertionsToPreprocess.push_back(theory::Rewriter::rewrite(n)); @@ -721,32 +772,44 @@ void SmtEngine::ensureBoolean(const BoolExpr& e) { Result SmtEngine::checkSat(const BoolExpr& e) { - Assert(e.getExprManager() == d_exprManager); + Assert(e.isNull() || e.getExprManager() == d_exprManager); NodeManagerScope nms(d_nodeManager); - Debug("smt") << "SmtEngine::checkSat(" << e << ")" << endl; + Trace("smt") << "SmtEngine::checkSat(" << e << ")" << endl; if(d_queryMade && !Options::current()->incrementalSolving) { - throw ModalException("Cannot make multiple queries unless incremental solving is enabled (try --incremental)"); + throw ModalException("Cannot make multiple queries unless " + "incremental solving is enabled " + "(try --incremental)"); } - // Enuser that the expression is Boolean - ensureBoolean(e); + // Ensure that the expression is type-checked at this point, and Boolean + if(!e.isNull()) { + ensureBoolean(e); + } // Push the context internalPush(); - // Add the + // Note that a query has been made d_queryMade = true; // Add the formula - d_problemExtended = true; - d_private->addFormula(e.getNode()); + if(!e.isNull()) { + d_problemExtended = true; + d_private->addFormula(e.getNode()); + } // Run the check Result r = check().asSatisfiabilityResult(); + // Dump the query if requested + if(Dump.isOn("benchmark")) { + // the expr already got dumped out if assertion-dumping is on + Dump("benchmark") << CheckSatCommand() << endl; + } + // Pop the context internalPop(); @@ -755,36 +818,65 @@ Result SmtEngine::checkSat(const BoolExpr& e) { d_problemExtended = false; - Debug("smt") << "SmtEngine::checkSat(" << e << ") => " << r << endl; + Trace("smt") << "SmtEngine::checkSat(" << e << ") => " << r << endl; return r; } Result SmtEngine::query(const BoolExpr& e) { + + Assert(!e.isNull()); Assert(e.getExprManager() == d_exprManager); + NodeManagerScope nms(d_nodeManager); - Debug("smt") << "SMT query(" << e << ")" << endl; + + Trace("smt") << "SMT query(" << e << ")" << endl; + if(d_queryMade && !Options::current()->incrementalSolving) { throw ModalException("Cannot make multiple queries unless " "incremental solving is enabled " "(try --incremental)"); } - d_queryMade = true; - ensureBoolean(e);// ensure expr is type-checked at this point + + // Ensure that the expression is type-checked at this point, and Boolean + ensureBoolean(e); + + // Push the context internalPush(); + + // Note that a query has been made + d_queryMade = true; + + // Add the formula + d_problemExtended = true; d_private->addFormula(e.getNode().notNode()); + + // Run the check Result r = check().asValidityResult(); + + // Dump the query if requested + if(Dump.isOn("benchmark")) { + // the expr already got dumped out if assertion-dumping is on + Dump("benchmark") << CheckSatCommand() << endl; + } + + // Pop the context internalPop(); + + // Remember the status d_status = r; + d_problemExtended = false; - Debug("smt") << "SMT query(" << e << ") ==> " << r << endl; + + Trace("smt") << "SMT query(" << e << ") ==> " << r << endl; + return r; } Result SmtEngine::assertFormula(const BoolExpr& e) { Assert(e.getExprManager() == d_exprManager); NodeManagerScope nms(d_nodeManager); - Debug("smt") << "SmtEngine::assertFormula(" << e << ")" << endl; + Trace("smt") << "SmtEngine::assertFormula(" << e << ")" << endl; ensureBoolean(e); if(d_assertionList != NULL) { d_assertionList->push_back(e); @@ -799,7 +891,10 @@ Expr SmtEngine::simplify(const Expr& e) { if( Options::current()->typeChecking ) { e.getType(true);// ensure expr is type-checked at this point } - Debug("smt") << "SMT simplify(" << e << ")" << endl; + Trace("smt") << "SMT simplify(" << e << ")" << endl; + if(Dump.isOn("benchmark")) { + Dump("benchmark") << SimplifyCommand(e) << endl; + } return d_private->applySubstitutions(e).toExpr(); } @@ -807,8 +902,14 @@ Expr SmtEngine::getValue(const Expr& e) throw(ModalException, AssertionException) { Assert(e.getExprManager() == d_exprManager); NodeManagerScope nms(d_nodeManager); - Type type = e.getType(Options::current()->typeChecking);// ensure expr is type-checked at this point - Debug("smt") << "SMT getValue(" << e << ")" << endl; + + // ensure expr is type-checked at this point + Type type = e.getType(Options::current()->typeChecking); + + Trace("smt") << "SMT getValue(" << e << ")" << endl; + if(Dump.isOn("benchmark")) { + Dump("benchmark") << GetValueCommand(e) << endl; + } if(!Options::current()->produceModels) { const char* msg = "Cannot get value when produce-models options is off."; @@ -831,7 +932,7 @@ Expr SmtEngine::getValue(const Expr& e) // Normalize for the theories Node n = theory::Rewriter::rewrite(e.getNode()); - Debug("smt") << "--- getting value of " << n << endl; + Trace("smt") << "--- getting value of " << n << endl; Node resultNode = d_theoryEngine->getValue(n); // type-check the result we got @@ -867,7 +968,10 @@ bool SmtEngine::addToAssignment(const Expr& e) throw(AssertionException) { } SExpr SmtEngine::getAssignment() throw(ModalException, AssertionException) { - Debug("smt") << "SMT getAssignment()" << endl; + Trace("smt") << "SMT getAssignment()" << endl; + if(Dump.isOn("benchmark")) { + Dump("benchmark") << GetAssignmentCommand() << endl; + } if(!Options::current()->produceAssignments) { const char* msg = "Cannot get the current assignment when " @@ -898,7 +1002,7 @@ SExpr SmtEngine::getAssignment() throw(ModalException, AssertionException) { // Normalize Node n = theory::Rewriter::rewrite(*i); - Debug("smt") << "--- getting value of " << n << endl; + Trace("smt") << "--- getting value of " << n << endl; Node resultNode = d_theoryEngine->getValue(n); // type-check the result we got @@ -920,8 +1024,11 @@ SExpr SmtEngine::getAssignment() throw(ModalException, AssertionException) { vector SmtEngine::getAssertions() throw(ModalException, AssertionException) { + if(Dump.isOn("benchmark")) { + Dump("benchmark") << GetAssertionsCommand() << endl; + } NodeManagerScope nms(d_nodeManager); - Debug("smt") << "SMT getAssertions()" << endl; + Trace("smt") << "SMT getAssertions()" << endl; if(!Options::current()->interactive) { const char* msg = "Cannot query the current assertion list when not in interactive mode."; @@ -931,21 +1038,33 @@ vector SmtEngine::getAssertions() return vector(d_assertionList->begin(), d_assertionList->end()); } +size_t SmtEngine::getStackLevel() const { + NodeManagerScope nms(d_nodeManager); + Trace("smt") << "SMT getStackLevel()" << endl; + return d_context->getLevel(); +} + void SmtEngine::push() { NodeManagerScope nms(d_nodeManager); - Debug("smt") << "SMT push()" << endl; + Trace("smt") << "SMT push()" << endl; + if(Dump.isOn("benchmark")) { + Dump("benchmark") << PushCommand() << endl; + } if(!Options::current()->incrementalSolving) { throw ModalException("Cannot push when not solving incrementally (use --incremental)"); } d_userLevels.push_back(d_userContext->getLevel()); internalPush(); - Debug("userpushpop") << "SmtEngine: pushed to level " + Trace("userpushpop") << "SmtEngine: pushed to level " << d_userContext->getLevel() << endl; } void SmtEngine::pop() { NodeManagerScope nms(d_nodeManager); - Debug("smt") << "SMT pop()" << endl; + Trace("smt") << "SMT pop()" << endl; + if(Dump.isOn("benchmark")) { + Dump("benchmark") << PopCommand() << endl; + } if(!Options::current()->incrementalSolving) { throw ModalException("Cannot pop when not solving incrementally (use --incremental)"); } @@ -955,21 +1074,23 @@ void SmtEngine::pop() { } d_userLevels.pop_back(); - Debug("userpushpop") << "SmtEngine: popped to level " + Trace("userpushpop") << "SmtEngine: popped to level " << d_userContext->getLevel() << endl; // FIXME: should we reset d_status here? // SMT-LIBv2 spec seems to imply no, but it would make sense to.. } void SmtEngine::internalPop() { - Debug("smt") << "internalPop()" << endl; + Trace("smt") << "internalPop()" << endl; d_propEngine->pop(); d_userContext->pop(); } void SmtEngine::internalPush() { - Debug("smt") << "internalPush()" << endl; - // TODO: this is the right thing to do, but needs serious thinking to keep completeness + Trace("smt") << "internalPush()" << endl; + // TODO: this is the right thing to do, but needs serious thinking + // to keep completeness + // // d_private->processAssertions(); d_userContext->push(); d_propEngine->push(); diff --git a/src/smt/smt_engine.h b/src/smt/smt_engine.h index 81bd5cb47..698f9ba2e 100644 --- a/src/smt/smt_engine.h +++ b/src/smt/smt_engine.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: mdeters ** Major contributors: dejan - ** Minor contributors (to current version): none + ** Minor contributors (to current version): cconway ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -23,6 +23,26 @@ #include +#if SWIG +%include "cvc4_public.h" +%include "util/rational.h" +%include "util/exception.h" +%include "expr/kind.h" +%include "util/integer.h" +%include "util/cardinality.h" +%include "util/sexpr.h" +%include "util/language.h" +%include "expr/type.h" +%include "expr/expr.h" +%include "expr/expr_manager.h" +%{ +#include "util/integer.h" +#include "expr/expr_manager.h" +#include "expr/type.h" +#include "expr/expr.h" +%} +#endif + #include "context/cdlist_forward.h" #include "context/cdmap_forward.h" #include "context/cdset_forward.h" @@ -253,16 +273,17 @@ public: Result assertFormula(const BoolExpr& e); /** - * Add a formula to the current context and call check(). Returns - * true iff consistent. + * Check validity of an expression with respect to the current set + * of assertions by asserting the query expression's negation and + * calling check(). Returns valid, invalid, or unknown result. */ Result query(const BoolExpr& e); /** - * Add a formula to the current context and call check(). Returns - * true iff consistent. + * Assert a formula (if provided) to the current context and call + * check(). Returns sat, unsat, or unknown result. */ - Result checkSat(const BoolExpr& e); + Result checkSat(const BoolExpr& e = BoolExpr()); /** * Simplify a formula without doing "much" work. Does not involve @@ -306,6 +327,11 @@ public: */ std::vector getAssertions() throw(ModalException, AssertionException); + /** + * Get the current context level. + */ + size_t getStackLevel() const; + /** * Push a user-level context. */ diff --git a/src/theory/arith/arith_priority_queue.cpp b/src/theory/arith/arith_priority_queue.cpp index 872c25e3b..3b1f5f395 100644 --- a/src/theory/arith/arith_priority_queue.cpp +++ b/src/theory/arith/arith_priority_queue.cpp @@ -1,3 +1,22 @@ +/********************* */ +/*! \file arith_priority_queue.cpp + ** \verbatim + ** Original author: taking + ** Major contributors: none + ** Minor contributors (to current version): mdeters + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + #include "theory/arith/arith_priority_queue.h" diff --git a/src/theory/arith/arith_priority_queue.h b/src/theory/arith/arith_priority_queue.h index f912d7753..1e7e3460b 100644 --- a/src/theory/arith/arith_priority_queue.h +++ b/src/theory/arith/arith_priority_queue.h @@ -1,3 +1,22 @@ +/********************* */ +/*! \file arith_priority_queue.h + ** \verbatim + ** Original author: taking + ** Major contributors: none + ** Minor contributors (to current version): mdeters + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + #include "cvc4_private.h" diff --git a/src/theory/arith/arith_prop_manager.cpp b/src/theory/arith/arith_prop_manager.cpp index 7f38c74a7..d1fce5b90 100644 --- a/src/theory/arith/arith_prop_manager.cpp +++ b/src/theory/arith/arith_prop_manager.cpp @@ -1,3 +1,22 @@ +/********************* */ +/*! \file arith_prop_manager.cpp + ** \verbatim + ** Original author: taking + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + #include "theory/arith/arith_prop_manager.h" diff --git a/src/theory/arith/arith_prop_manager.h b/src/theory/arith/arith_prop_manager.h index 39bcb7477..82f58c7a0 100644 --- a/src/theory/arith/arith_prop_manager.h +++ b/src/theory/arith/arith_prop_manager.h @@ -1,3 +1,22 @@ +/********************* */ +/*! \file arith_prop_manager.h + ** \verbatim + ** Original author: taking + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + #include "cvc4_private.h" #ifndef __CVC4__THEORY__ARITH__ARITH_PROP_MANAGER_H diff --git a/src/theory/arith/arith_rewriter.cpp b/src/theory/arith/arith_rewriter.cpp index 8d12e78fe..66223b479 100644 --- a/src/theory/arith/arith_rewriter.cpp +++ b/src/theory/arith/arith_rewriter.cpp @@ -2,8 +2,8 @@ /*! \file arith_rewriter.cpp ** \verbatim ** Original author: taking - ** Major contributors: dejan - ** Minor contributors (to current version): mdeters + ** Major contributors: none + ** Minor contributors (to current version): mdeters, dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/theory/arith/arith_static_learner.h b/src/theory/arith/arith_static_learner.h index c58778215..03402a6f1 100644 --- a/src/theory/arith/arith_static_learner.h +++ b/src/theory/arith/arith_static_learner.h @@ -2,8 +2,8 @@ /*! \file arith_static_learner.h ** \verbatim ** Original author: taking - ** Major contributors: none - ** Minor contributors (to current version): none + ** Major contributors: mdeters + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/theory/arith/arith_utilities.h b/src/theory/arith/arith_utilities.h index 2dee26be4..3a1135f74 100644 --- a/src/theory/arith/arith_utilities.h +++ b/src/theory/arith/arith_utilities.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: taking ** Major contributors: none - ** Minor contributors (to current version): mdeters + ** Minor contributors (to current version): dejan, mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/atom_database.cpp b/src/theory/arith/atom_database.cpp index 5c3519435..774d0eb22 100644 --- a/src/theory/arith/atom_database.cpp +++ b/src/theory/arith/atom_database.cpp @@ -3,9 +3,9 @@ ** \verbatim ** Original author: taking ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/atom_database.h b/src/theory/arith/atom_database.h index 25020977a..af7068ada 100644 --- a/src/theory/arith/atom_database.h +++ b/src/theory/arith/atom_database.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: taking ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/delta_rational.cpp b/src/theory/arith/delta_rational.cpp index d0e4ed1f4..c5c5c629b 100644 --- a/src/theory/arith/delta_rational.cpp +++ b/src/theory/arith/delta_rational.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/delta_rational.h b/src/theory/arith/delta_rational.h index c70d26db5..c8a5e39a7 100644 --- a/src/theory/arith/delta_rational.h +++ b/src/theory/arith/delta_rational.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/kinds b/src/theory/arith/kinds index db47062bb..bf5ea24c1 100644 --- a/src/theory/arith/kinds +++ b/src/theory/arith/kinds @@ -5,6 +5,7 @@ # theory THEORY_ARITH ::CVC4::theory::arith::TheoryArith "theory/arith/theory_arith.h" +typechecker "theory/arith/theory_arith_type_rules.h" properties stable-infinite properties check propagate staticLearning presolve notifyRestart @@ -17,6 +18,7 @@ operator MULT 2: "arithmetic multiplication" operator MINUS 2 "arithmetic binary subtraction operator" operator UMINUS 1 "arithmetic unary negation" operator DIVISION 2 "arithmetic division" +operator POW 2 "arithmetic power" sort REAL_TYPE \ Cardinality::REALS \ @@ -58,4 +60,19 @@ operator LEQ 2 "less than or equal, x <= y" operator GT 2 "greater than, x > y" operator GEQ 2 "greater than or equal, x >= y" +typerule PLUS ::CVC4::theory::arith::ArithOperatorTypeRule +typerule MULT ::CVC4::theory::arith::ArithOperatorTypeRule +typerule MINUS ::CVC4::theory::arith::ArithOperatorTypeRule +typerule UMINUS ::CVC4::theory::arith::ArithOperatorTypeRule +typerule DIVISION ::CVC4::theory::arith::ArithOperatorTypeRule +typerule POW ::CVC4::theory::arith::ArithOperatorTypeRule + +typerule CONST_RATIONAL ::CVC4::theory::arith::ArithConstantTypeRule +typerule CONST_INTEGER ::CVC4::theory::arith::ArithConstantTypeRule + +typerule LT ::CVC4::theory::arith::ArithPredicateTypeRule +typerule LEQ ::CVC4::theory::arith::ArithPredicateTypeRule +typerule GT ::CVC4::theory::arith::ArithPredicateTypeRule +typerule GEQ ::CVC4::theory::arith::ArithPredicateTypeRule + endtheory diff --git a/src/theory/arith/normal_form.cpp b/src/theory/arith/normal_form.cpp index b529a8077..e7df14df7 100644 --- a/src/theory/arith/normal_form.cpp +++ b/src/theory/arith/normal_form.cpp @@ -3,9 +3,9 @@ ** \verbatim ** Original author: taking ** Major contributors: mdeters - ** Minor contributors (to current version): none + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/normal_form.h b/src/theory/arith/normal_form.h index d6e79318d..6e2d706cc 100644 --- a/src/theory/arith/normal_form.h +++ b/src/theory/arith/normal_form.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: taking ** Major contributors: mdeters - ** Minor contributors (to current version): none + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/ordered_set.h b/src/theory/arith/ordered_set.h index e44ba8687..c126ab568 100644 --- a/src/theory/arith/ordered_set.h +++ b/src/theory/arith/ordered_set.h @@ -1,3 +1,22 @@ +/********************* */ +/*! \file ordered_set.h + ** \verbatim + ** Original author: taking + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + #include #include #include "expr/kind.h" diff --git a/src/theory/arith/partial_model.cpp b/src/theory/arith/partial_model.cpp index 3cd8ed926..ed8f837d1 100644 --- a/src/theory/arith/partial_model.cpp +++ b/src/theory/arith/partial_model.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/partial_model.h b/src/theory/arith/partial_model.h index f07e524aa..aa333046b 100644 --- a/src/theory/arith/partial_model.h +++ b/src/theory/arith/partial_model.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/simplex.cpp b/src/theory/arith/simplex.cpp index 3e2d90674..77e7e1060 100644 --- a/src/theory/arith/simplex.cpp +++ b/src/theory/arith/simplex.cpp @@ -1,3 +1,22 @@ +/********************* */ +/*! \file simplex.cpp + ** \verbatim + ** Original author: taking + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + #include "theory/arith/simplex.h" diff --git a/src/theory/arith/simplex.h b/src/theory/arith/simplex.h index b3f43baf1..04b4ca784 100644 --- a/src/theory/arith/simplex.h +++ b/src/theory/arith/simplex.h @@ -1,3 +1,22 @@ +/********************* */ +/*! \file simplex.h + ** \verbatim + ** Original author: taking + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + #include "cvc4_private.h" diff --git a/src/theory/arith/tableau.cpp b/src/theory/arith/tableau.cpp index b432416bd..ef3206650 100644 --- a/src/theory/arith/tableau.cpp +++ b/src/theory/arith/tableau.cpp @@ -3,9 +3,9 @@ ** \verbatim ** Original author: taking ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/tableau.h b/src/theory/arith/tableau.h index e14436f8c..3da3d68a5 100644 --- a/src/theory/arith/tableau.h +++ b/src/theory/arith/tableau.h @@ -2,10 +2,10 @@ /*! \file tableau.h ** \verbatim ** Original author: taking - ** Major contributors: mdeters - ** Minor contributors (to current version): dejan + ** Major contributors: none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/theory_arith.cpp b/src/theory/arith/theory_arith.cpp index 2664aaac3..4369c6de0 100644 --- a/src/theory/arith/theory_arith.cpp +++ b/src/theory/arith/theory_arith.cpp @@ -2,10 +2,10 @@ /*! \file theory_arith.cpp ** \verbatim ** Original author: taking - ** Major contributors: none - ** Minor contributors (to current version): barrett, dejan, mdeters + ** Major contributors: mdeters, dejan + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/theory_arith.h b/src/theory/arith/theory_arith.h index 7e14f6b06..2e85659e4 100644 --- a/src/theory/arith/theory_arith.h +++ b/src/theory/arith/theory_arith.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: mdeters ** Major contributors: taking - ** Minor contributors (to current version): barrett + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arith/theory_arith_type_rules.h b/src/theory/arith/theory_arith_type_rules.h index 8bfd2aef6..9c69ec684 100644 --- a/src/theory/arith/theory_arith_type_rules.h +++ b/src/theory/arith/theory_arith_type_rules.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters, cconway ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arrays/array_info.cpp b/src/theory/arrays/array_info.cpp index 5a836fdc2..1e06621b4 100644 --- a/src/theory/arrays/array_info.cpp +++ b/src/theory/arrays/array_info.cpp @@ -3,9 +3,9 @@ ** \verbatim ** Original author: lianah ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arrays/array_info.h b/src/theory/arrays/array_info.h index ce3f015b5..fcc45bbd5 100644 --- a/src/theory/arrays/array_info.h +++ b/src/theory/arrays/array_info.h @@ -1,3 +1,22 @@ +/********************* */ +/*! \file array_info.h + ** \verbatim + ** Original author: lianah + ** Major contributors: none + ** Minor contributors (to current version): mdeters + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + /*! \file array_info.h ** \verbatim ** Original author: lianah diff --git a/src/theory/arrays/kinds b/src/theory/arrays/kinds index 30242db30..2f4bc7313 100644 --- a/src/theory/arrays/kinds +++ b/src/theory/arrays/kinds @@ -5,6 +5,7 @@ # theory THEORY_ARRAY ::CVC4::theory::arrays::TheoryArrays "theory/arrays/theory_arrays.h" +typechecker "theory/arrays/theory_arrays_type_rules.h" properties polite stable-infinite properties check propagate presolve @@ -23,4 +24,7 @@ operator SELECT 2 "array select" # store a i e is a[i] <= e operator STORE 3 "array store" +typerule SELECT ::CVC4::theory::arrays::ArraySelectTypeRule +typerule STORE ::CVC4::theory::arrays::ArrayStoreTypeRule + endtheory diff --git a/src/theory/arrays/static_fact_manager.cpp b/src/theory/arrays/static_fact_manager.cpp index 1e135514a..dfa32418f 100644 --- a/src/theory/arrays/static_fact_manager.cpp +++ b/src/theory/arrays/static_fact_manager.cpp @@ -1,11 +1,11 @@ /********************* */ /*! \file static_fact_manager.cpp ** \verbatim - ** Original author: mdeters + ** Original author: barrett ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arrays/static_fact_manager.h b/src/theory/arrays/static_fact_manager.h index de487f97c..5e1ba27a3 100644 --- a/src/theory/arrays/static_fact_manager.h +++ b/src/theory/arrays/static_fact_manager.h @@ -1,11 +1,11 @@ /********************* */ /*! \file static_fact_manager.h ** \verbatim - ** Original author: mdeters + ** Original author: barrett ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp index 888a98a45..6985aaea8 100644 --- a/src/theory/arrays/theory_arrays.cpp +++ b/src/theory/arrays/theory_arrays.cpp @@ -2,8 +2,8 @@ /*! \file theory_arrays.cpp ** \verbatim ** Original author: barrett - ** Major contributors: none - ** Minor contributors (to current version): mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -22,6 +22,7 @@ #include "expr/kind.h" #include #include "theory/rewriter.h" +#include "expr/command.h" using namespace std; using namespace CVC4; @@ -689,7 +690,7 @@ void TheoryArrays::appendToDiseqList(TNode of, TNode eq) { * Iterates through the indices of a and stores of b and checks if any new * Row lemmas need to be instantiated. */ -bool TheoryArrays::isRedundandRowLemma(TNode a, TNode b, TNode i, TNode j) { +bool TheoryArrays::isRedundantRowLemma(TNode a, TNode b, TNode i, TNode j) { Assert(a.getType().isArray()); Assert(b.getType().isArray()); @@ -984,7 +985,7 @@ void TheoryArrays::checkRowLemmas(TNode a, TNode b) { TNode j = store[1]; TNode c = store[0]; - if( !isRedundandRowLemma(store, c, j, i)){ + if( !isRedundantRowLemma(store, c, j, i)){ //&&!propagateFromRow(store, c, j, i)) { queueRowLemma(store, c, j, i); } @@ -1004,7 +1005,7 @@ void TheoryArrays::checkRowLemmas(TNode a, TNode b) { TNode c = store[0]; if ( isNonLinear(c) - &&!isRedundandRowLemma(store, c, j, i)){ + &&!isRedundantRowLemma(store, c, j, i)){ //&&!propagateFromRow(store, c, j, i)) { queueRowLemma(store, c, j, i); } @@ -1066,7 +1067,7 @@ void TheoryArrays::checkRowForIndex(TNode i, TNode a) { Assert(store.getKind()==kind::STORE); TNode j = store[1]; //Trace("arrays-lem")<<"Arrays::checkRowForIndex ("<end(); it++) { TNode j = *it; - if(!isRedundandRowLemma(a, b, i, j)) { + if(!isRedundantRowLemma(a, b, i, j)) { //Trace("arrays-lem")<<"Arrays::checkRowStore ("<mkVar(a.getType()[0]); + TypeNode ixType = a.getType()[0]; + Node k = nm->mkVar(ixType); + if(Dump.isOn("declarations")) { + stringstream kss; + kss << Expr::setlanguage(Expr::setlanguage::getLanguage(Dump("declarations"))) << k; + string ks = kss.str(); + Dump("declarations") + << CommentCommand(ks + " is an extensional lemma index variable " + "from the theory of arrays") << endl + << DeclareFunctionCommand(ks, ixType.toType()) << endl; + } Node eq = nm->mkNode(kind::EQUAL, a, b); Node ak = nm->mkNode(kind::SELECT, a, k); Node bk = nm->mkNode(kind::SELECT, b, k); @@ -1154,7 +1165,7 @@ inline void TheoryArrays::addExtLemma(TNode a, TNode b) { ++d_numExt; return; } - Trace("arrays-cle")<<"Arrays::checkExtLemmas lemma already generated. \n"; + Trace("arrays-cle")<<"Arrays::checkExtLemmas lemma already generated. \n"; } diff --git a/src/theory/arrays/theory_arrays.h b/src/theory/arrays/theory_arrays.h index cf822cb65..37fffd2ec 100644 --- a/src/theory/arrays/theory_arrays.h +++ b/src/theory/arrays/theory_arrays.h @@ -2,10 +2,10 @@ /*! \file theory_arrays.h ** \verbatim ** Original author: mdeters - ** Major contributors: barrett - ** Minor contributors (to current version): none + ** Major contributors: none + ** Minor contributors (to current version): barrett ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -254,7 +254,7 @@ private: bool isAxiom(TNode lhs, TNode rhs); - bool isRedundandRowLemma(TNode a, TNode b, TNode i, TNode j); + bool isRedundantRowLemma(TNode a, TNode b, TNode i, TNode j); bool isRedundantInContext(TNode a, TNode b, TNode i, TNode j); diff --git a/src/theory/arrays/theory_arrays_rewriter.h b/src/theory/arrays/theory_arrays_rewriter.h index d7b37d8ba..8c1c16de2 100644 --- a/src/theory/arrays/theory_arrays_rewriter.h +++ b/src/theory/arrays/theory_arrays_rewriter.h @@ -2,7 +2,7 @@ /*! \file theory_arrays_rewriter.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: barrett, mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/arrays/union_find.cpp b/src/theory/arrays/union_find.cpp index b0f06b78e..57fd412e4 100644 --- a/src/theory/arrays/union_find.cpp +++ b/src/theory/arrays/union_find.cpp @@ -1,11 +1,11 @@ /********************* */ /*! \file union_find.cpp ** \verbatim - ** Original author: mdeters + ** Original author: lianah ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/arrays/union_find.h b/src/theory/arrays/union_find.h index 4a882806c..7ae85424d 100644 --- a/src/theory/arrays/union_find.h +++ b/src/theory/arrays/union_find.h @@ -1,11 +1,11 @@ /********************* */ /*! \file union_find.h ** \verbatim - ** Original author: mdeters + ** Original author: lianah ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/booleans/circuit_propagator.cpp b/src/theory/booleans/circuit_propagator.cpp index fd44ec13b..318fdecce 100644 --- a/src/theory/booleans/circuit_propagator.cpp +++ b/src/theory/booleans/circuit_propagator.cpp @@ -2,7 +2,7 @@ /*! \file circuit_propagator.cpp ** \verbatim ** Original author: mdeters - ** Major contributors: none + ** Major contributors: dejan ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) @@ -29,11 +29,11 @@ namespace CVC4 { namespace theory { namespace booleans { -void CircuitPropagator::assert(TNode assertion) +void CircuitPropagator::assert(TNode assertion) { if (assertion.getKind() == kind::AND) { for (unsigned i = 0; i < assertion.getNumChildren(); ++ i) { - assert(assertion[i]); + assert(assertion[i]); } } else { // Analyze the assertion for back-edges and all that diff --git a/src/theory/booleans/circuit_propagator.h b/src/theory/booleans/circuit_propagator.h index 73a5be0f8..9593f7735 100644 --- a/src/theory/booleans/circuit_propagator.h +++ b/src/theory/booleans/circuit_propagator.h @@ -2,7 +2,7 @@ /*! \file circuit_propagator.h ** \verbatim ** Original author: mdeters - ** Major contributors: none + ** Major contributors: dejan ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) @@ -189,20 +189,16 @@ private: bool d_forwardPropagation; /** Whether to perform backward propagation */ bool d_backwardPropagation; - /** Whether to perform expensive propagations */ - bool d_expensivePropagation; public: /** * Construct a new CircuitPropagator with the given atoms and backEdges. */ - CircuitPropagator(std::vector& outLearnedLiterals, bool enableForward = true, bool enableBackward = true, bool enableExpensive = true) : + CircuitPropagator(std::vector& outLearnedLiterals, bool enableForward = true, bool enableBackward = true) : d_conflict(false), d_learnedLiterals(outLearnedLiterals), d_forwardPropagation(enableForward), - d_backwardPropagation(enableBackward), - d_expensivePropagation(enableExpensive) - { + d_backwardPropagation(enableBackward) { } /** Assert for propagation */ diff --git a/src/theory/booleans/kinds b/src/theory/booleans/kinds index d540d57f5..5580418e5 100644 --- a/src/theory/booleans/kinds +++ b/src/theory/booleans/kinds @@ -5,6 +5,7 @@ # theory THEORY_BOOL ::CVC4::theory::booleans::TheoryBool "theory/booleans/theory_bool.h" +typechecker "theory/booleans/theory_bool_type_rules.h" properties finite @@ -31,4 +32,14 @@ operator OR 2: "logical or" operator XOR 2 "exclusive or" operator ITE 3 "if-then-else" +typerule CONST_BOOLEAN ::CVC4::theory::boolean::BooleanTypeRule + +typerule NOT ::CVC4::theory::boolean::BooleanTypeRule +typerule AND ::CVC4::theory::boolean::BooleanTypeRule +typerule IFF ::CVC4::theory::boolean::BooleanTypeRule +typerule IMPLIES ::CVC4::theory::boolean::BooleanTypeRule +typerule OR ::CVC4::theory::boolean::BooleanTypeRule +typerule XOR ::CVC4::theory::boolean::BooleanTypeRule +typerule ITE ::CVC4::theory::boolean::IteTypeRule + endtheory diff --git a/src/theory/booleans/theory_bool.cpp b/src/theory/booleans/theory_bool.cpp index 01185281a..2be1dac55 100644 --- a/src/theory/booleans/theory_bool.cpp +++ b/src/theory/booleans/theory_bool.cpp @@ -2,7 +2,7 @@ /*! \file theory_bool.cpp ** \verbatim ** Original author: mdeters - ** Major contributors: none + ** Major contributors: dejan ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/booleans/theory_bool.h b/src/theory/booleans/theory_bool.h index ce9938b10..d53337fa7 100644 --- a/src/theory/booleans/theory_bool.h +++ b/src/theory/booleans/theory_bool.h @@ -2,8 +2,8 @@ /*! \file theory_bool.h ** \verbatim ** Original author: mdeters - ** Major contributors: taking - ** Minor contributors (to current version): barrett + ** Major contributors: none + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/theory/booleans/theory_bool_rewriter.cpp b/src/theory/booleans/theory_bool_rewriter.cpp index d2693268f..4f41d2fa5 100644 --- a/src/theory/booleans/theory_bool_rewriter.cpp +++ b/src/theory/booleans/theory_bool_rewriter.cpp @@ -2,7 +2,7 @@ /*! \file theory_bool_rewriter.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters, barrett ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/booleans/theory_bool_rewriter.h b/src/theory/booleans/theory_bool_rewriter.h index 4a23249d4..6771f775c 100644 --- a/src/theory/booleans/theory_bool_rewriter.h +++ b/src/theory/booleans/theory_bool_rewriter.h @@ -2,7 +2,7 @@ /*! \file theory_bool_rewriter.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/booleans/theory_bool_type_rules.h b/src/theory/booleans/theory_bool_type_rules.h index 09030d331..e6c3e0f54 100644 --- a/src/theory/booleans/theory_bool_type_rules.h +++ b/src/theory/booleans/theory_bool_type_rules.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters, cconway ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/builtin/kinds b/src/theory/builtin/kinds index d170469e0..83a372726 100644 --- a/src/theory/builtin/kinds +++ b/src/theory/builtin/kinds @@ -36,7 +36,6 @@ # check the theory supports the check() function # propagate the theory supports propagate() (and explain()) # staticLearning the theory supports staticLearning() -# registerTerm the theory supports registerTerm() # notifyRestart the theory supports notifyRestart() # presolve the theory supports presolve() # @@ -59,6 +58,12 @@ # future, so if possible, do not rely on them being called (and # implement them as a no-op). # +# typechecker header +# +# Declare that this theory's typechecker class is defined in the +# given header. (#include'd by the TypeChecker class in the expr +# package.) +# # variable K ["comment"] # # This declares a kind K that has no operator (it's conceptually a @@ -122,6 +127,19 @@ # For consistency, constants taking a non-void payload should # start with "CONST_", but this is not enforced. # +# typerule K typechecker-class +# +# Declares that a (previously-declared) kind K is typechecked by +# the typechecker-class. This class should be defined by the +# header given to the "typechecker" command, above. The +# typechecker-class is used this way by the main TypeChecker code: +# +# typechecker-class::computeType(NodeManager* nm, TNode n, bool check) +# +# It returns TypeNode. It should compute the type of n and return it, +# and if "check" is true, should actually perform type checking instead +# of simply type computation. +# # sort K cardinality [well-founded ground-term header | not-well-founded] ["comment"] # # This creates a kind K that represents a sort (a "type constant"). @@ -217,6 +235,7 @@ # theory THEORY_BUILTIN ::CVC4::theory::builtin::TheoryBuiltin "theory/builtin/theory_builtin.h" +typechecker "theory/builtin/theory_builtin_type_rules.h" properties stable-infinite @@ -282,4 +301,9 @@ well-founded TUPLE_TYPE \ "::CVC4::theory::builtin::TupleProperties::mkGroundTerm(%TYPE%)" \ "theory/builtin/theory_builtin_type_rules.h" +typerule APPLY ::CVC4::theory::builtin::ApplyTypeRule +typerule EQUAL ::CVC4::theory::builtin::EqualityTypeRule +typerule DISTINCT ::CVC4::theory::builtin::DistinctTypeRule +typerule TUPLE ::CVC4::theory::builtin::TupleTypeRule + endtheory diff --git a/src/theory/builtin/theory_builtin.cpp b/src/theory/builtin/theory_builtin.cpp index 1c779bd79..e955539d5 100644 --- a/src/theory/builtin/theory_builtin.cpp +++ b/src/theory/builtin/theory_builtin.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/builtin/theory_builtin.h b/src/theory/builtin/theory_builtin.h index 4e62401ff..5c3c70443 100644 --- a/src/theory/builtin/theory_builtin.h +++ b/src/theory/builtin/theory_builtin.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: mdeters ** Major contributors: none - ** Minor contributors (to current version): barrett + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/builtin/theory_builtin_rewriter.cpp b/src/theory/builtin/theory_builtin_rewriter.cpp index b71d66c03..f62140263 100644 --- a/src/theory/builtin/theory_builtin_rewriter.cpp +++ b/src/theory/builtin/theory_builtin_rewriter.cpp @@ -2,7 +2,7 @@ /*! \file theory_builtin_rewriter.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/builtin/theory_builtin_type_rules.h b/src/theory/builtin/theory_builtin_type_rules.h index 3bfb7fdc5..ce06b4259 100644 --- a/src/theory/builtin/theory_builtin_type_rules.h +++ b/src/theory/builtin/theory_builtin_type_rules.h @@ -5,7 +5,7 @@ ** Major contributors: cconway, mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/bv/cd_set_collection.h b/src/theory/bv/cd_set_collection.h index 30e4e47ec..ba9d104a1 100644 --- a/src/theory/bv/cd_set_collection.h +++ b/src/theory/bv/cd_set_collection.h @@ -1,3 +1,22 @@ +/********************* */ +/*! \file cd_set_collection.h + ** \verbatim + ** Original author: dejan + ** Major contributors: none + ** Minor contributors (to current version): mdeters + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + /* * set_collection.h * diff --git a/src/theory/bv/equality_engine.cpp b/src/theory/bv/equality_engine.cpp index fa0650506..ee4e9903c 100644 --- a/src/theory/bv/equality_engine.cpp +++ b/src/theory/bv/equality_engine.cpp @@ -2,10 +2,10 @@ /*! \file equality_engine.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/bv/equality_engine.h b/src/theory/bv/equality_engine.h index 31a4bfd27..558fd2b7b 100644 --- a/src/theory/bv/equality_engine.h +++ b/src/theory/bv/equality_engine.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: dejan ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/bv/kinds b/src/theory/bv/kinds index d10e32ee0..d502c5ecb 100644 --- a/src/theory/bv/kinds +++ b/src/theory/bv/kinds @@ -5,6 +5,7 @@ # theory THEORY_BV ::CVC4::theory::bv::TheoryBV "theory/bv/theory_bv.h" +typechecker "theory/bv/theory_bv_type_rules.h" properties finite properties check propagate @@ -99,4 +100,47 @@ parameterized BITVECTOR_SIGN_EXTEND BITVECTOR_SIGN_EXTEND_OP 1 "bit-vector sign- parameterized BITVECTOR_ROTATE_LEFT BITVECTOR_ROTATE_LEFT_OP 1 "bit-vector rotate left" parameterized BITVECTOR_ROTATE_RIGHT BITVECTOR_ROTATE_RIGHT_OP 1 "bit-vector rotate right" +typerule CONST_BITVECTOR ::CVC4::theory::bv::BitVectorConstantTypeRule + +typerule BITVECTOR_AND ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_OR ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_XOR ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_NOT ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_NAND ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_NOR ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_XNOR ::CVC4::theory::bv::BitVectorFixedWidthTypeRule + +typerule BITVECTOR_COMP ::CVC4::theory::bv::BitVectorCompRule + +typerule BITVECTOR_MULT ::CVC4::theory::bv::BitVectorArithRule +typerule BITVECTOR_PLUS ::CVC4::theory::bv::BitVectorArithRule +typerule BITVECTOR_SUB ::CVC4::theory::bv::BitVectorArithRule +typerule BITVECTOR_NEG ::CVC4::theory::bv::BitVectorArithRule + +typerule BITVECTOR_UDIV ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_UREM ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_SDIV ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_SREM ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_SMOD ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_SHL ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_LSHR ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_ASHR ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_ROTATE_LEFT ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_ROTATE_RIGHT ::CVC4::theory::bv::BitVectorFixedWidthTypeRule + +typerule BITVECTOR_ULT ::CVC4::theory::bv::BitVectorPredicateTypeRule +typerule BITVECTOR_ULE ::CVC4::theory::bv::BitVectorPredicateTypeRule +typerule BITVECTOR_UGT ::CVC4::theory::bv::BitVectorPredicateTypeRule +typerule BITVECTOR_UGE ::CVC4::theory::bv::BitVectorPredicateTypeRule +typerule BITVECTOR_SLT ::CVC4::theory::bv::BitVectorPredicateTypeRule +typerule BITVECTOR_SLE ::CVC4::theory::bv::BitVectorPredicateTypeRule +typerule BITVECTOR_SGT ::CVC4::theory::bv::BitVectorPredicateTypeRule +typerule BITVECTOR_SGE ::CVC4::theory::bv::BitVectorPredicateTypeRule + +typerule BITVECTOR_EXTRACT ::CVC4::theory::bv::BitVectorExtractTypeRule +typerule BITVECTOR_CONCAT ::CVC4::theory::bv::BitVectorConcatRule +typerule BITVECTOR_REPEAT ::CVC4::theory::bv::BitVectorRepeatTypeRule +typerule BITVECTOR_ZERO_EXTEND ::CVC4::theory::bv::BitVectorExtendTypeRule +typerule BITVECTOR_SIGN_EXTEND ::CVC4::theory::bv::BitVectorExtendTypeRule + endtheory diff --git a/src/theory/bv/slice_manager.h b/src/theory/bv/slice_manager.h index 4fb11f105..9e0b09f2f 100644 --- a/src/theory/bv/slice_manager.h +++ b/src/theory/bv/slice_manager.h @@ -1,3 +1,22 @@ +/********************* */ +/*! \file slice_manager.h + ** \verbatim + ** Original author: dejan + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + /* * slice_manager.h * diff --git a/src/theory/bv/theory_bv.cpp b/src/theory/bv/theory_bv.cpp index 593274281..c1fa692b9 100644 --- a/src/theory/bv/theory_bv.cpp +++ b/src/theory/bv/theory_bv.cpp @@ -2,10 +2,10 @@ /*! \file theory_bv.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/bv/theory_bv.h b/src/theory/bv/theory_bv.h index 27fadce0b..5c6797e76 100644 --- a/src/theory/bv/theory_bv.h +++ b/src/theory/bv/theory_bv.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: mdeters ** Major contributors: dejan - ** Minor contributors (to current version): barrett + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/bv/theory_bv_rewrite_rules.h b/src/theory/bv/theory_bv_rewrite_rules.h index b66fef0a9..68f75847f 100644 --- a/src/theory/bv/theory_bv_rewrite_rules.h +++ b/src/theory/bv/theory_bv_rewrite_rules.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: dejan ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/bv/theory_bv_rewrite_rules_core.h b/src/theory/bv/theory_bv_rewrite_rules_core.h index e94388754..b1541fa4a 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_core.h +++ b/src/theory/bv/theory_bv_rewrite_rules_core.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: dejan ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/bv/theory_bv_rewriter.cpp b/src/theory/bv/theory_bv_rewriter.cpp index 5bcbdf746..a232ad33b 100644 --- a/src/theory/bv/theory_bv_rewriter.cpp +++ b/src/theory/bv/theory_bv_rewriter.cpp @@ -2,7 +2,7 @@ /*! \file theory_bv_rewriter.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/bv/theory_bv_rewriter.h b/src/theory/bv/theory_bv_rewriter.h index 7af5b4496..20da74ce8 100644 --- a/src/theory/bv/theory_bv_rewriter.h +++ b/src/theory/bv/theory_bv_rewriter.h @@ -2,7 +2,7 @@ /*! \file theory_bv_rewriter.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/bv/theory_bv_type_rules.h b/src/theory/bv/theory_bv_type_rules.h index 613df47f3..926ceb767 100644 --- a/src/theory/bv/theory_bv_type_rules.h +++ b/src/theory/bv/theory_bv_type_rules.h @@ -2,10 +2,10 @@ /*! \file theory_bv_type_rules.h ** \verbatim ** Original author: dejan - ** Major contributors: cconway - ** Minor contributors (to current version): mdeters + ** Major contributors: mdeters, cconway + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/bv/theory_bv_utils.h b/src/theory/bv/theory_bv_utils.h index a3135f077..fc4fbf834 100644 --- a/src/theory/bv/theory_bv_utils.h +++ b/src/theory/bv/theory_bv_utils.h @@ -2,10 +2,10 @@ /*! \file theory_bv_utils.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/datatypes/datatypes_rewriter.h b/src/theory/datatypes/datatypes_rewriter.h index b4ff7e135..14f05d14c 100644 --- a/src/theory/datatypes/datatypes_rewriter.h +++ b/src/theory/datatypes/datatypes_rewriter.h @@ -1,8 +1,8 @@ /********************* */ /*! \file datatypes_rewriter.h ** \verbatim - ** Original author: ajreynol - ** Major contributors: mdeters + ** Original author: mdeters + ** Major contributors: ajreynol ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/datatypes/explanation_manager.cpp b/src/theory/datatypes/explanation_manager.cpp index 10ee9bf64..6107e7f2c 100644 --- a/src/theory/datatypes/explanation_manager.cpp +++ b/src/theory/datatypes/explanation_manager.cpp @@ -1,3 +1,22 @@ +/********************* */ +/*! \file explanation_manager.cpp + ** \verbatim + ** Original author: ajreynol + ** Major contributors: none + ** Minor contributors (to current version): mdeters + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + #include "theory/datatypes/explanation_manager.h" using namespace std; diff --git a/src/theory/datatypes/kinds b/src/theory/datatypes/kinds index 47896b1e0..e90712129 100644 --- a/src/theory/datatypes/kinds +++ b/src/theory/datatypes/kinds @@ -5,6 +5,7 @@ # theory THEORY_DATATYPES ::CVC4::theory::datatypes::TheoryDatatypes "theory/datatypes/theory_datatypes.h" +typechecker "theory/datatypes/theory_datatypes_type_rules.h" properties check presolve @@ -70,4 +71,9 @@ constant ASCRIPTION_TYPE \ "util/ascription_type.h" \ "a type parameter for type ascription" +typerule APPLY_CONSTRUCTOR ::CVC4::theory::datatypes::DatatypeConstructorTypeRule +typerule APPLY_SELECTOR ::CVC4::theory::datatypes::DatatypeSelectorTypeRule +typerule APPLY_TESTER ::CVC4::theory::datatypes::DatatypeTesterTypeRule +typerule APPLY_TYPE_ASCRIPTION ::CVC4::theory::datatypes::DatatypeAscriptionTypeRule + endtheory diff --git a/src/theory/datatypes/theory_datatypes.cpp b/src/theory/datatypes/theory_datatypes.cpp index 6aed9e9fa..7c474a811 100644 --- a/src/theory/datatypes/theory_datatypes.cpp +++ b/src/theory/datatypes/theory_datatypes.cpp @@ -2,8 +2,8 @@ /*! \file theory_datatypes.cpp ** \verbatim ** Original author: ajreynol - ** Major contributors: mdeters - ** Minor contributors (to current version): none + ** Major contributors: none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/theory/datatypes/theory_datatypes.h b/src/theory/datatypes/theory_datatypes.h index 1b9e357ed..d91e9e7f4 100644 --- a/src/theory/datatypes/theory_datatypes.h +++ b/src/theory/datatypes/theory_datatypes.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: ajreynol ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/theory/datatypes/theory_datatypes_type_rules.h b/src/theory/datatypes/theory_datatypes_type_rules.h index 578de69a2..347bc16b3 100644 --- a/src/theory/datatypes/theory_datatypes_type_rules.h +++ b/src/theory/datatypes/theory_datatypes_type_rules.h @@ -2,7 +2,7 @@ /*! \file theory_datatypes_type_rules.h ** \verbatim ** Original author: ajreynol - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/datatypes/union_find.cpp b/src/theory/datatypes/union_find.cpp index e56c9f282..eacc4e798 100644 --- a/src/theory/datatypes/union_find.cpp +++ b/src/theory/datatypes/union_find.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/datatypes/union_find.h b/src/theory/datatypes/union_find.h index 31b18e7e9..51d1d85bc 100644 --- a/src/theory/datatypes/union_find.h +++ b/src/theory/datatypes/union_find.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: ajreynol ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/interrupted.h b/src/theory/interrupted.h index d8a54b1e4..0796f3cb0 100644 --- a/src/theory/interrupted.h +++ b/src/theory/interrupted.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/mkrewriter b/src/theory/mkrewriter index ec659d0bb..395317045 100755 --- a/src/theory/mkrewriter +++ b/src/theory/mkrewriter @@ -94,6 +94,18 @@ function endtheory { seen_endtheory=true } +function typechecker { + # typechecker header + lineno=${BASH_LINENO[0]} + check_theory_seen +} + +function typerule { + # typerule OPERATOR typechecking-class + lineno=${BASH_LINENO[0]} + check_theory_seen +} + function rewriter { # rewriter class header class="$1" diff --git a/src/theory/mktheorytraits b/src/theory/mktheorytraits index 538ffb25f..852b29711 100755 --- a/src/theory/mktheorytraits +++ b/src/theory/mktheorytraits @@ -43,7 +43,6 @@ theory_for_each_macro="#define CVC4_FOR_EACH_THEORY \\ theory_has_check="false" theory_has_propagate="false" theory_has_staticLearning="false" -theory_has_registerTerm="false" theory_has_notifyRestart="false" theory_has_presolve="false" @@ -130,7 +129,6 @@ struct TheoryTraits<${theory_id}> { static const bool hasCheck = ${theory_has_check}; static const bool hasPropagate = ${theory_has_propagate}; static const bool hasStaticLearning = ${theory_has_staticLearning}; - static const bool hasRegisterTerm = ${theory_has_registerTerm}; static const bool hasNotifyRestart = ${theory_has_notifyRestart}; static const bool hasPresolve = ${theory_has_presolve}; };/* struct TheoryTraits<${theory_id}> */ @@ -139,7 +137,7 @@ struct TheoryTraits<${theory_id}> { # warnings about theory content and properties dir="$(dirname "$kf")/../../" if [ -e "$dir/$theory_header" ]; then - for function in check propagate staticLearning registerTerm notifyRestart presolve; do + for function in check propagate staticLearning notifyRestart presolve; do if eval "\$theory_has_$function"; then grep '\<'"$function"' *\((\|;\)' "$dir/$theory_header" | grep -vq '^ */\(/\|\*\)' || echo "$kf: warning: $theory_class has property \"$function\" in its kinds file but doesn't appear to declare the function" >&2 @@ -155,7 +153,6 @@ struct TheoryTraits<${theory_id}> { theory_has_check="false" theory_has_propagate="false" theory_has_staticLearning="false" - theory_has_registerTerm="false" theory_has_notifyRestart="false" theory_has_presolve="false" @@ -172,6 +169,17 @@ struct TheoryTraits<${theory_id}> { lineno=${BASH_LINENO[0]} } +function typechecker { + # typechecker header + lineno=${BASH_LINENO[0]} + check_theory_seen +} + +function typerule { + # typerule OPERATOR typechecking-class + lineno=${BASH_LINENO[0]} + check_theory_seen +} function properties { # properties property* @@ -188,7 +196,6 @@ function properties { propagate) theory_has_propagate="true";; staticLearning) theory_has_staticLearning="true";; presolve) theory_has_presolve="true";; - registerTerm) theory_has_registerTerm="true";; notifyRestart) theory_has_notifyRestart="true";; *) echo "$kf:$lineno: error: unknown theory property \"$property\"" >&2; exit 1;; esac diff --git a/src/theory/output_channel.h b/src/theory/output_channel.h index d82e628c1..bf928cb62 100644 --- a/src/theory/output_channel.h +++ b/src/theory/output_channel.h @@ -2,10 +2,10 @@ /*! \file output_channel.h ** \verbatim ** Original author: mdeters - ** Major contributors: taking - ** Minor contributors (to current version): barrett + ** Major contributors: none + ** Minor contributors (to current version): taking, barrett ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/rewriter.cpp b/src/theory/rewriter.cpp index bb42a5ec7..f6aa75bbd 100644 --- a/src/theory/rewriter.cpp +++ b/src/theory/rewriter.cpp @@ -2,7 +2,7 @@ /*! \file rewriter.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/rewriter.h b/src/theory/rewriter.h index 884d0af72..f1a0e2b30 100644 --- a/src/theory/rewriter.h +++ b/src/theory/rewriter.h @@ -2,7 +2,7 @@ /*! \file rewriter.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/rewriter_attributes.h b/src/theory/rewriter_attributes.h index a2b2d06b7..c958abb68 100644 --- a/src/theory/rewriter_attributes.h +++ b/src/theory/rewriter_attributes.h @@ -2,7 +2,7 @@ /*! \file rewriter_attributes.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/rewriter_tables_template.h b/src/theory/rewriter_tables_template.h index cbbff95c1..34204ec2d 100644 --- a/src/theory/rewriter_tables_template.h +++ b/src/theory/rewriter_tables_template.h @@ -2,7 +2,7 @@ /*! \file rewriter_tables_template.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/shared_data.cpp b/src/theory/shared_data.cpp index 50e916832..3e89dec7e 100644 --- a/src/theory/shared_data.cpp +++ b/src/theory/shared_data.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/shared_data.h b/src/theory/shared_data.h index 181508c54..7d6a9ebd2 100644 --- a/src/theory/shared_data.h +++ b/src/theory/shared_data.h @@ -2,10 +2,10 @@ /*! \file shared_data.h ** \verbatim ** Original author: barrett - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/shared_term_manager.cpp b/src/theory/shared_term_manager.cpp index 03afa984e..20f7a82f1 100644 --- a/src/theory/shared_term_manager.cpp +++ b/src/theory/shared_term_manager.cpp @@ -3,9 +3,9 @@ ** \verbatim ** Original author: barrett ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/shared_term_manager.h b/src/theory/shared_term_manager.h index 7263ac93a..faea8d687 100644 --- a/src/theory/shared_term_manager.h +++ b/src/theory/shared_term_manager.h @@ -2,10 +2,10 @@ /*! \file shared_term_manager.h ** \verbatim ** Original author: barrett - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/substitutions.cpp b/src/theory/substitutions.cpp index 76551bc18..88e5b3dba 100644 --- a/src/theory/substitutions.cpp +++ b/src/theory/substitutions.cpp @@ -1,7 +1,7 @@ /********************* */ /*! \file substitutions.cpp ** \verbatim - ** Original author: mdeters + ** Original author: dejan ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. diff --git a/src/theory/substitutions.h b/src/theory/substitutions.h index f59c17dc0..849c8f166 100644 --- a/src/theory/substitutions.h +++ b/src/theory/substitutions.h @@ -2,7 +2,7 @@ /*! \file substitutions.h ** \verbatim ** Original author: mdeters - ** Major contributors: none + ** Major contributors: dejan ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/theory.cpp b/src/theory/theory.cpp index 576e0188b..b772d9d23 100644 --- a/src/theory/theory.cpp +++ b/src/theory/theory.cpp @@ -5,7 +5,7 @@ ** Major contributors: taking ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/theory.h b/src/theory/theory.h index 62a8cb4d6..a1d62ca04 100644 --- a/src/theory/theory.h +++ b/src/theory/theory.h @@ -23,6 +23,7 @@ #include "expr/node.h" #include "expr/attribute.h" +#include "expr/command.h" #include "theory/valuation.h" #include "theory/substitutions.h" #include "theory/output_channel.h" @@ -125,10 +126,9 @@ protected: Valuation d_valuation; /** - * Returns the next atom in the assertFact() queue. Guarantees that - * registerTerm() has been called on the theory specific subterms. + * Returns the next atom in the assertFact() queue. * - * @return the next atom in the assertFact() queue. + * @return the next atom in the assertFact() queue */ TNode get() { Assert( !done(), "Theory::get() called with assertion queue empty!" ); @@ -136,7 +136,11 @@ protected: d_wasSharedTermFact = false; d_factsHead = d_factsHead + 1; Trace("theory") << "Theory::get() => " << fact - << " (" << d_facts.size() - d_factsHead << " left)" << std::endl; + << " (" << d_facts.size() - d_factsHead << " left)" + << std::endl; + if(Dump.isOn("state")) { + Dump("state") << AssertCommand(fact.toExpr()) << std::endl; + } return fact; } diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index e604c45df..040582c9f 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -2,8 +2,8 @@ /*! \file theory_engine.cpp ** \verbatim ** Original author: mdeters - ** Major contributors: taking, barrett, dejan - ** Minor contributors (to current version): cconway + ** Major contributors: barrett, dejan + ** Minor contributors (to current version): cconway, taking ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -37,18 +37,18 @@ using namespace std; using namespace CVC4; using namespace CVC4::theory; -/** Tag for the "preregisterTerm()-has-benn-called" flag on nodes */ -struct PreRegisteredAttrTag {}; -/** The "preregisterTerm()-has-been-called" flag on Nodes */ -typedef expr::Attribute PreRegisteredAttr; - TheoryEngine::TheoryEngine(context::Context* ctxt) : d_propEngine(NULL), d_context(ctxt), d_activeTheories(0), + d_atomPreprocessingCache(), + d_possiblePropagations(), + d_hasPropagated(ctxt), d_theoryOut(this, ctxt), + d_sharedTermManager(NULL), d_hasShutDown(false), d_incomplete(ctxt, false), + d_logic(""), d_statistics(), d_preRegistrationVisitor(*this, ctxt) { @@ -87,6 +87,10 @@ struct preregister_stack_element { };/* struct preprocess_stack_element */ void TheoryEngine::preRegister(TNode preprocessed) { + if(Dump.isOn("missed-t-propagations")) { + d_possiblePropagations.push_back(preprocessed); + } + NodeVisitor::run(d_preRegistrationVisitor, preprocessed); } @@ -112,8 +116,14 @@ void TheoryEngine::check(theory::Theory::Effort effort) { // Do the checking try { CVC4_FOR_EACH_THEORY; + + if(Dump.isOn("missed-t-conflicts")) { + Dump("missed-t-conflicts") + << CommentCommand("Completeness check for T-conflicts; expect sat") << endl + << CheckSatCommand() << endl; + } } catch(const theory::Interrupted&) { - Trace("theory") << "TheoryEngine::check() => conflict" << std::endl; + Trace("theory") << "TheoryEngine::check() => conflict" << endl; } } @@ -124,11 +134,54 @@ void TheoryEngine::propagate() { #endif #define CVC4_FOR_EACH_THEORY_STATEMENT(THEORY) \ if (theory::TheoryTraits::hasPropagate && isActive(THEORY)) { \ - reinterpret_cast::theory_class*>(d_theoryTable[THEORY])->propagate(theory::Theory::FULL_EFFORT); \ + reinterpret_cast::theory_class*>(d_theoryTable[THEORY])->propagate(theory::Theory::FULL_EFFORT); \ } // Propagate for each theory using the statement above CVC4_FOR_EACH_THEORY; + + if(Dump.isOn("missed-t-propagations")) { + for(vector::iterator i = d_possiblePropagations.begin(); + i != d_possiblePropagations.end(); + ++i) { + if(d_hasPropagated.find(*i) == d_hasPropagated.end()) { + Dump("missed-t-propagations") + << CommentCommand("Completeness check for T-propagations; expect invalid") << endl + << QueryCommand((*i).toExpr()) << endl; + } + } + } +} + +Node TheoryEngine::getExplanation(TNode node, theory::Theory* theory) { + theory->explain(node); + if(Dump.isOn("t-explanations")) { + Dump("t-explanations") + << CommentCommand(string("theory explanation from ") + + theory->identify() + ": expect valid") << endl + << QueryCommand(d_theoryOut.d_explanationNode.get().impNode(node).toExpr()) + << endl; + } + Assert(properExplanation(node, d_theoryOut.d_explanationNode.get())); + return d_theoryOut.d_explanationNode; +} + +bool TheoryEngine::properConflict(TNode conflict) const { + Assert(!conflict.isNull()); +#warning fixme + return true; +} + +bool TheoryEngine::properPropagation(TNode lit) const { + Assert(!lit.isNull()); +#warning fixme + return true; +} + +bool TheoryEngine::properExplanation(TNode node, TNode expl) const { + Assert(!node.isNull() && !expl.isNull()); +#warning fixme + return true; } Node TheoryEngine::getValue(TNode node) { @@ -212,11 +265,27 @@ void TheoryEngine::staticLearning(TNode in, NodeBuilder<>& learned) { CVC4_FOR_EACH_THEORY; } +void TheoryEngine::shutdown() { + // Set this first; if a Theory shutdown() throws an exception, + // at least the destruction of the TheoryEngine won't confound + // matters. + d_hasShutDown = true; + + // Shutdown all the theories + for(unsigned theoryId = 0; theoryId < theory::THEORY_LAST; ++theoryId) { + if(d_theoryTable[theoryId]) { + d_theoryTable[theoryId]->shutdown(); + } + } + + theory::Rewriter::shutdown(); +} + theory::Theory::SolveStatus TheoryEngine::solve(TNode literal, SubstitutionMap& substitionOut) { TNode atom = literal.getKind() == kind::NOT ? literal[0] : literal; - Trace("theory") << "TheoryEngine::solve(" << literal << "): solving with " << theoryOf(atom)->getId() << std::endl; + Trace("theory") << "TheoryEngine::solve(" << literal << "): solving with " << theoryOf(atom)->getId() << endl; Theory::SolveStatus solveStatus = theoryOf(atom)->solve(literal, substitionOut); - Trace("theory") << "TheoryEngine::solve(" << literal << ") => " << solveStatus << std::endl; + Trace("theory") << "TheoryEngine::solve(" << literal << ") => " << solveStatus << endl; return solveStatus; } @@ -230,9 +299,9 @@ struct preprocess_stack_element { Node TheoryEngine::preprocess(TNode assertion) { - Trace("theory") << "TheoryEngine::preprocess(" << assertion << ")" << std::endl; + Trace("theory") << "TheoryEngine::preprocess(" << assertion << ")" << endl; - // Do a topological sort of the subexpressions and substitute them + // Do a topological sort of the subexpressions and substitute them vector toVisit; toVisit.push_back(assertion); @@ -242,7 +311,7 @@ Node TheoryEngine::preprocess(TNode assertion) { preprocess_stack_element& stackHead = toVisit.back(); TNode current = stackHead.node; - Debug("theory::internal") << "TheoryEngine::preprocess(" << assertion << "): processing " << current << std::endl; + Debug("theory::internal") << "TheoryEngine::preprocess(" << assertion << "): processing " << current << endl; // If node already in the cache we're done, pop from the stack NodeMap::iterator find = d_atomPreprocessingCache.find(current); @@ -270,7 +339,7 @@ Node TheoryEngine::preprocess(TNode assertion) { } // Mark the substitution and continue Node result = builder; - Debug("theory::internal") << "TheoryEngine::preprocess(" << assertion << "): setting " << current << " -> " << result << std::endl; + Debug("theory::internal") << "TheoryEngine::preprocess(" << assertion << "): setting " << current << " -> " << result << endl; d_atomPreprocessingCache[current] = result; toVisit.pop_back(); } else { @@ -287,7 +356,7 @@ Node TheoryEngine::preprocess(TNode assertion) { } } else { // No children, so we're done - Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << assertion << "): setting " << current << " -> " << current << std::endl; + Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << assertion << "): setting " << current << " -> " << current << endl; d_atomPreprocessingCache[current] = current; toVisit.pop_back(); } diff --git a/src/theory/theory_engine.h b/src/theory/theory_engine.h index 2107bcb66..815a79a5a 100644 --- a/src/theory/theory_engine.h +++ b/src/theory/theory_engine.h @@ -2,8 +2,8 @@ /*! \file theory_engine.h ** \verbatim ** Original author: mdeters - ** Major contributors: taking, dejan - ** Minor contributors (to current version): cconway, barrett + ** Major contributors: dejan + ** Minor contributors (to current version): cconway, barrett, taking ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -26,7 +26,9 @@ #include #include "expr/node.h" +#include "expr/command.h" #include "prop/prop_engine.h" +#include "context/cdset.h" #include "theory/shared_term_manager.h" #include "theory/theory.h" #include "theory/substitutions.h" @@ -76,6 +78,19 @@ class TheoryEngine { typedef std::hash_map NodeMap; NodeMap d_atomPreprocessingCache; + /** + * Used for "missed-t-propagations" dumping mode only. A set of all + * theory-propagable literals. + */ + std::vector d_possiblePropagations; + + /** + * Used for "missed-t-propagations" dumping mode only. A + * context-dependent set of those theory-propagable literals that + * have been propagated. + */ + context::CDSet d_hasPropagated; + /** * An output channel for Theory that passes messages * back to a TheoryEngine. @@ -122,13 +137,16 @@ class TheoryEngine { d_explanationNode(context) { } - void newFact(TNode n); - void conflict(TNode conflictNode, bool safe) throw(theory::Interrupted, AssertionException) { Trace("theory") << "EngineOutputChannel::conflict(" << conflictNode << ")" << std::endl; d_inConflict = true; + if(Dump.isOn("t-conflicts")) { + Dump("t-conflicts") << CommentCommand("theory conflict: expect unsat") << std::endl + << CheckSatCommand(conflictNode.toExpr()) << std::endl; + } + Assert(d_engine->properConflict(conflictNode)); ++(d_engine->d_statistics.d_statConflicts); // Construct the lemma (note that no CNF caching should happen as all the literals already exists) @@ -144,6 +162,15 @@ class TheoryEngine { throw(theory::Interrupted, AssertionException) { Trace("theory") << "EngineOutputChannel::propagate(" << lit << ")" << std::endl; + if(Dump.isOn("t-propagations")) { + Dump("t-propagations") + << CommentCommand("negation of theory propagation: expect valid") << std::endl + << QueryCommand(lit.toExpr()) << std::endl; + } + if(Dump.isOn("missed-t-propagations")) { + d_engine->d_hasPropagated.insert(lit); + } + Assert(d_engine->properPropagation(lit)); d_propagatedLiterals.push_back(lit); ++(d_engine->d_statistics.d_statPropagate); } @@ -152,6 +179,10 @@ class TheoryEngine { throw(theory::Interrupted, TypeCheckingExceptionPrivate, AssertionException) { Trace("theory") << "EngineOutputChannel::lemma(" << node << ")" << std::endl; + if(Dump.isOn("t-lemmas")) { + Dump("t-lemmas") << CommentCommand("theory lemma: expect valid") << std::endl + << QueryCommand(node.toExpr()) << std::endl; + } ++(d_engine->d_statistics.d_statLemma); d_engine->newLemma(node, false, removable); @@ -161,12 +192,12 @@ class TheoryEngine { throw(theory::Interrupted, AssertionException) { Trace("theory") << "EngineOutputChannel::explanation(" << explanationNode << ")" << std::endl; + // handle dumping of explanations elsewhere.. d_explanationNode = explanationNode; ++(d_engine->d_statistics.d_statExplanation); } - void setIncomplete() - throw(theory::Interrupted, AssertionException) { + void setIncomplete() throw(theory::Interrupted, AssertionException) { d_engine->d_incomplete = true; } };/* class EngineOutputChannel */ @@ -176,12 +207,6 @@ class TheoryEngine { /** Pointer to Shared Term Manager */ SharedTermManager* d_sharedTermManager; - /** - * Whether or not theory registration is on. May not be safe to - * turn off with some theories. - */ - bool d_theoryRegistration; - /** * Debugging flag to ensure that shutdown() is called before the * destructor. @@ -224,14 +249,15 @@ public: * there is another theory it will be deleted. */ template - void addTheory() { + inline void addTheory() { TheoryClass* theory = new TheoryClass(d_context, d_theoryOut, theory::Valuation(this)); d_theoryTable[theory->getId()] = theory; d_sharedTermManager->registerTheory(static_cast(theory)); } /** - * Set's the logic (smt-lib format). All theory specific setup/hacks should go in here. + * Sets the logic (SMT-LIB format). All theory specific setup/hacks + * should go in here. */ void setLogic(std::string logic); @@ -239,7 +265,7 @@ public: return d_sharedTermManager; } - void setPropEngine(prop::PropEngine* propEngine) { + inline void setPropEngine(prop::PropEngine* propEngine) { Assert(d_propEngine == NULL); d_propEngine = propEngine; } @@ -247,7 +273,7 @@ public: /** * Get a pointer to the underlying propositional engine. */ - prop::PropEngine* getPropEngine() const { + inline prop::PropEngine* getPropEngine() const { return d_propEngine; } @@ -260,7 +286,7 @@ public: /** * Return whether or not we are incomplete (in the current context). */ - bool isIncomplete() { + inline bool isIncomplete() { return d_incomplete; } @@ -269,21 +295,7 @@ public: * destruction. It is important because there are destruction * ordering issues between PropEngine and Theory. */ - void shutdown() { - // Set this first; if a Theory shutdown() throws an exception, - // at least the destruction of the TheoryEngine won't confound - // matters. - d_hasShutDown = true; - - // Shutdown all the theories - for(unsigned theoryId = 0; theoryId < theory::THEORY_LAST; ++theoryId) { - if(d_theoryTable[theoryId]) { - d_theoryTable[theoryId]->shutdown(); - } - } - - theory::Rewriter::shutdown(); - } + void shutdown(); /** * Get the theory associated to a given Node. @@ -367,7 +379,7 @@ public: return d_theoryOut.d_propagatedLiterals; } - void clearPropagatedLiterals() { + inline void clearPropagatedLiterals() { d_theoryOut.d_propagatedLiterals.clear(); } @@ -384,16 +396,25 @@ public: void propagate(); - inline Node getExplanation(TNode node, theory::Theory* theory) { - theory->explain(node); - return d_theoryOut.d_explanationNode; - } + Node getExplanation(TNode node, theory::Theory* theory); + + bool properConflict(TNode conflict) const; + bool properPropagation(TNode lit) const; + bool properExplanation(TNode node, TNode expl) const; inline Node getExplanation(TNode node) { d_theoryOut.d_explanationNode = Node::null(); TNode atom = node.getKind() == kind::NOT ? node[0] : node; theoryOf(atom)->explain(node); Assert(!d_theoryOut.d_explanationNode.get().isNull()); + if(Dump.isOn("t-explanations")) { + Dump("t-explanations") + << CommentCommand(std::string("theory explanation from ") + + theoryOf(atom)->identify() + ": expect valid") << std::endl + << QueryCommand(d_theoryOut.d_explanationNode.get().impNode(node).toExpr()) + << std::endl; + } + Assert(properExplanation(node, d_theoryOut.d_explanationNode.get())); return d_theoryOut.d_explanationNode; } diff --git a/src/theory/theory_test_utils.h b/src/theory/theory_test_utils.h index 0b377fb11..ec2405295 100644 --- a/src/theory/theory_test_utils.h +++ b/src/theory/theory_test_utils.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/theory_traits_template.h b/src/theory/theory_traits_template.h index 525c06b3c..bbf13b425 100644 --- a/src/theory/theory_traits_template.h +++ b/src/theory/theory_traits_template.h @@ -2,7 +2,7 @@ /*! \file theory_traits_template.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/uf/Makefile.am b/src/theory/uf/Makefile.am index fc0f32927..f25e50ec9 100644 --- a/src/theory/uf/Makefile.am +++ b/src/theory/uf/Makefile.am @@ -5,10 +5,6 @@ AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) noinst_LTLIBRARIES = libuf.la -# force automake to link using g++ -nodist_EXTRA_libuf_la_SOURCES = \ - dummy.cpp - libuf_la_SOURCES = \ theory_uf.h \ theory_uf.cpp \ @@ -19,10 +15,4 @@ libuf_la_SOURCES = \ symmetry_breaker.h \ symmetry_breaker.cpp -libuf_la_LIBADD = \ - @builddir@/tim/libuftim.la \ - @builddir@/morgan/libufmorgan.la - -SUBDIRS = tim morgan - EXTRA_DIST = kinds diff --git a/src/theory/uf/equality_engine.h b/src/theory/uf/equality_engine.h index 4f3879560..ba607526f 100644 --- a/src/theory/uf/equality_engine.h +++ b/src/theory/uf/equality_engine.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/uf/equality_engine_impl.h b/src/theory/uf/equality_engine_impl.h index 1dd9963f7..bea6ff9a9 100644 --- a/src/theory/uf/equality_engine_impl.h +++ b/src/theory/uf/equality_engine_impl.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/uf/kinds b/src/theory/uf/kinds index 6cec23385..1f8643330 100644 --- a/src/theory/uf/kinds +++ b/src/theory/uf/kinds @@ -5,11 +5,14 @@ # theory THEORY_UF ::CVC4::theory::uf::TheoryUF "theory/uf/theory_uf.h" +typechecker "theory/uf/theory_uf_type_rules.h" properties stable-infinite -properties check propagate staticLearning presolve notifyRestart +properties check propagate staticLearning presolve rewriter ::CVC4::theory::uf::TheoryUfRewriter "theory/uf/theory_uf_rewriter.h" parameterized APPLY_UF VARIABLE 1: "uninterpreted function application" +typerule APPLY_UF ::CVC4::theory::uf::UfTypeRule + endtheory diff --git a/src/theory/uf/morgan/Makefile b/src/theory/uf/morgan/Makefile deleted file mode 100644 index 4f6767bdd..000000000 --- a/src/theory/uf/morgan/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -topdir = ../../../.. -srcdir = src/theory/uf/morgan - -include $(topdir)/Makefile.subdir diff --git a/src/theory/uf/morgan/Makefile.am b/src/theory/uf/morgan/Makefile.am deleted file mode 100644 index 886178a6f..000000000 --- a/src/theory/uf/morgan/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -AM_CPPFLAGS = \ - -D__BUILDING_CVC4LIB \ - -I@srcdir@/../../../include -I@srcdir@/../../.. -I@builddir@/../../.. -AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) - -noinst_LTLIBRARIES = libufmorgan.la - -libufmorgan_la_SOURCES = \ - theory_uf_morgan.h \ - theory_uf_morgan.cpp \ - union_find.h \ - union_find.cpp \ - stacking_map.h \ - stacking_map.cpp - -EXTRA_DIST = diff --git a/src/theory/uf/morgan/stacking_map.cpp b/src/theory/uf/morgan/stacking_map.cpp deleted file mode 100644 index 16a85e71b..000000000 --- a/src/theory/uf/morgan/stacking_map.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/********************* */ -/*! \file stacking_map.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, 2010 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 Backtrackable map using an undo stack - ** - ** Backtrackable map using an undo stack rather than storing items in - ** a CDMap<>. - **/ - -#include - -#include "theory/uf/morgan/stacking_map.h" -#include "util/Assert.h" -#include "expr/node.h" - -using namespace std; - -namespace CVC4 { -namespace theory { -namespace uf { -namespace morgan { - -template -TNode StackingMap::find(TNode n) const { - typename MapType::const_iterator i = d_map.find(n); - if(i == d_map.end()) { - return TNode(); - } else { - return (*i).second; - } -} - -template -void StackingMap::set(TNode n, TNode newValue) { - Trace("ufsm") << "UFSM setting " << n << " : " << newValue << " @ " << d_trace.size() << endl; - NodeType& ref = d_map[n]; - d_trace.push_back(make_pair(n, TNode(ref))); - d_offset = d_trace.size(); - ref = newValue; -} - -template -void StackingMap::notify() { - Trace("ufsm") << "UFSM cancelling : " << d_offset << " < " << d_trace.size() << " ?" << endl; - while(d_offset < d_trace.size()) { - pair p = d_trace.back(); - if(p.second.isNull()) { - d_map.erase(p.first); - Trace("ufsm") << "UFSM " << d_trace.size() << " erasing " << p.first << endl; - } else { - d_map[p.first] = p.second; - Trace("ufsm") << "UFSM " << d_trace.size() << " replacing " << p << endl; - } - d_trace.pop_back(); - } - Trace("ufufsm") << "UFSM cancelling finished." << endl; -} - -// The following declarations allow us to put functions in the .cpp file -// instead of the header, since we know which instantiations are needed. - -template TNode StackingMap::find(TNode n) const; -template void StackingMap::set(TNode n, TNode newValue); -template void StackingMap::notify(); - -template TNode StackingMap::find(TNode n) const; -template void StackingMap::set(TNode n, TNode newValue); -template void StackingMap::notify(); - -}/* CVC4::theory::uf::morgan namespace */ -}/* CVC4::theory::uf namespace */ -}/* CVC4::theory namespace */ -}/* CVC4 namespace */ diff --git a/src/theory/uf/morgan/stacking_map.h b/src/theory/uf/morgan/stacking_map.h deleted file mode 100644 index c54acc363..000000000 --- a/src/theory/uf/morgan/stacking_map.h +++ /dev/null @@ -1,91 +0,0 @@ -/********************* */ -/*! \file stacking_map.h - ** \verbatim - ** Original author: mdeters - ** Major contributors: none - ** Minor contributors (to current version): none - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 Backtrackable map using an undo stack - ** - ** Backtrackable map using an undo stack rather than storing items in - ** a CDMap<>. - **/ - -#include "cvc4_private.h" - -#ifndef __CVC4__THEORY__UF__MORGAN__STACKING_MAP_H -#define __CVC4__THEORY__UF__MORGAN__STACKING_MAP_H - -#include -#include -#include - -#include "expr/node.h" -#include "context/cdo.h" - -namespace CVC4 { - -namespace context { - class Context; -}/* CVC4::context namespace */ - -namespace theory { -namespace uf { -namespace morgan { - -// NodeType \in { Node, TNode } -template -class StackingMap : context::ContextNotifyObj { - /** Our underlying map type. */ - typedef __gnu_cxx::hash_map MapType; - - /** - * Our map of Nodes to their values. - */ - MapType d_map; - - /** Our undo stack for changes made to d_map. */ - std::vector > d_trace; - - /** Our current offset in the d_trace stack (context-dependent). */ - context::CDO d_offset; - -public: - StackingMap(context::Context* ctxt) : - context::ContextNotifyObj(ctxt), - d_offset(ctxt, 0) { - } - - ~StackingMap() throw() { } - - /** - * Return a Node's value in the key-value map. If n is not a key in - * the map, this function returns TNode::null(). - */ - TNode find(TNode n) const; - - /** - * Set the value in the key-value map for Node n to newValue. - */ - void set(TNode n, TNode newValue); - - /** - * Called by the Context when a pop occurs. Cancels everything to the - * current context level. Overrides ContextNotifyObj::notify(). - */ - void notify(); - -};/* class StackingMap<> */ - -}/* CVC4::theory::uf::morgan namespace */ -}/* CVC4::theory::uf namespace */ -}/* CVC4::theory namespace */ -}/* CVC4 namespace */ - -#endif /*__CVC4__THEORY__UF__MORGAN__STACKING_MAP_H */ diff --git a/src/theory/uf/morgan/theory_uf_morgan.cpp b/src/theory/uf/morgan/theory_uf_morgan.cpp deleted file mode 100644 index 01bab53ac..000000000 --- a/src/theory/uf/morgan/theory_uf_morgan.cpp +++ /dev/null @@ -1,751 +0,0 @@ -/********************* */ -/*! \file theory_uf_morgan.cpp - ** \verbatim - ** Original author: taking - ** Major contributors: mdeters - ** Minor contributors (to current version): none - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 Implementation of the theory of uninterpreted functions. - ** - ** Implementation of the theory of uninterpreted functions. - **/ - -#include "theory/uf/morgan/theory_uf_morgan.h" -#include "theory/valuation.h" -#include "expr/kind.h" -#include "util/congruence_closure.h" -#include "theory/uf/symmetry_breaker.h" - -#include - -using namespace std; - -using namespace CVC4; -using namespace CVC4::context; -using namespace CVC4::theory; -using namespace CVC4::theory::uf; -using namespace CVC4::theory::uf::morgan; - -TheoryUFMorgan::TheoryUFMorgan(Context* ctxt, OutputChannel& out, Valuation valuation) : - TheoryUF(ctxt, out, valuation), - d_assertions(ctxt), - d_ccChannel(this), - d_cc(ctxt, &d_ccChannel), - d_unionFind(ctxt), - d_disequalities(ctxt), - d_equalities(ctxt), - d_conflict(), - d_trueNode(), - d_falseNode(), - d_trueEqFalseNode(), - d_ccExplanationLength("theory::uf::morgan::cc::averageExplanationLength", - d_cc.getExplanationLength()), - d_ccNewSkolemVars("theory::uf::morgan::cc::newSkolemVariables", - d_cc.getNewSkolemVars()) { - - StatisticsRegistry::registerStat(&d_ccExplanationLength); - StatisticsRegistry::registerStat(&d_ccNewSkolemVars); - - NodeManager* nm = NodeManager::currentNM(); - TypeNode boolType = nm->booleanType(); - d_trueNode = nm->mkVar("TRUE_UF", boolType); - d_falseNode = nm->mkVar("FALSE_UF", boolType); - d_trueEqFalseNode = nm->mkNode(kind::IFF, d_trueNode, d_falseNode); - addDisequality(d_trueEqFalseNode); - d_cc.addTerm(d_trueNode); - d_cc.addTerm(d_falseNode); -} - -TheoryUFMorgan::~TheoryUFMorgan() { - d_trueNode = Node::null(); - d_falseNode = Node::null(); - d_trueEqFalseNode = Node::null(); - - StatisticsRegistry::unregisterStat(&d_ccExplanationLength); - StatisticsRegistry::unregisterStat(&d_ccNewSkolemVars); -} - -void TheoryUFMorgan::preRegisterTerm(TNode n) { - Debug("uf") << "uf: preRegisterTerm(" << n << ")" << endl; - if(n.getKind() == kind::EQUAL || n.getKind() == kind::IFF) { - registerEqualityForPropagation(n); - } -} - -void TheoryUFMorgan::registerTerm(TNode n) { - Debug("uf") << "uf: registerTerm(" << n << ")" << endl; -} - -Node TheoryUFMorgan::constructConflict(TNode diseq) { - Debug("uf") << "uf: begin constructConflict()" << endl; - Debug("uf") << "uf: using diseq == " << diseq << endl; - - Node explanation = d_cc.explain(diseq[0], diseq[1]); - - NodeBuilder<> nb(kind::AND); - if(explanation.getKind() == kind::AND) { - for(TNode::iterator i = TNode(explanation).begin(); - i != TNode(explanation).end(); - ++i) { - TNode n = *i; - Assert(n.getKind() == kind::EQUAL || - n.getKind() == kind::IFF); - Assert(n[0] != d_trueNode && - n[0] != d_falseNode); - if(n[1] == d_trueNode) { - nb << n[0]; - } else if(n[1] == d_falseNode) { - nb << n[0].notNode(); - } else { - nb << n; - } - } - } else { - Assert(explanation.getKind() == kind::EQUAL || - explanation.getKind() == kind::IFF); - Assert(explanation[0] != d_trueNode && - explanation[0] != d_falseNode); - if(explanation[1] == d_trueNode) { - nb << explanation[0]; - } else if(explanation[1] == d_falseNode) { - nb << explanation[0].notNode(); - } else { - nb << explanation; - } - } - if(diseq != d_trueEqFalseNode) { - nb << diseq.notNode(); - } - - // by construction this should be true - Assert(nb.getNumChildren() > 1); - - Node conflict = nb; - Debug("uf") << "conflict constructed : " << conflict << endl; - - Debug("uf") << "uf: ending constructConflict()" << endl; - - return conflict; -} - -void TheoryUFMorgan::notifyCongruent(TNode a, TNode b) { - Debug("uf") << "uf: notified of merge " << a << endl - << " and " << b << endl; - if(!d_conflict.isNull()) { - // if already a conflict, we don't care - return; - } - - merge(a, b); -} - -void TheoryUFMorgan::merge(TNode a, TNode b) { - Assert(d_conflict.isNull()); - - // make "a" the one with shorter diseqList - EqLists::iterator deq_ia = d_disequalities.find(a); - EqLists::iterator deq_ib = d_disequalities.find(b); - if(deq_ia != d_disequalities.end()) { - if(deq_ib == d_disequalities.end() || - (*deq_ia).second->size() > (*deq_ib).second->size()) { - TNode tmp = a; - a = b; - b = tmp; - Debug("uf") << " swapping to make a shorter diseqList" << endl; - } - } - a = find(a); - b = find(b); - Debug("uf") << "uf: uf reps are " << a << endl - << " and " << b << endl; - - if(a == b) { - return; - } - - // should have already found such a conflict - Assert(find(d_trueNode) != find(d_falseNode)); - - d_unionFind.setCanon(a, b); - - EqLists::iterator deq_i = d_disequalities.find(a); - // a set of other trees we are already disequal to, and their - // (TNode) equalities (for optimizations below) - map alreadyDiseqs; - if(deq_i != d_disequalities.end()) { - EqLists::iterator deq_ib = d_disequalities.find(b); - if(deq_ib != d_disequalities.end()) { - EqList* deq = (*deq_ib).second; - for(EqList::const_iterator j = deq->begin(); j != deq->end(); ++j) { - TNode deqn = *j; - TNode s = deqn[0]; - TNode t = deqn[1]; - TNode sp = find(s); - TNode tp = find(t); - Assert(sp == b || tp == b); - if(sp == b) { - alreadyDiseqs[tp] = deqn; - } else { - alreadyDiseqs[sp] = deqn; - } - } - } - - EqList* deq = (*deq_i).second; - if(Debug.isOn("uf")) { - Debug("uf") << "a == " << a << endl; - Debug("uf") << "size of deq(a) is " << deq->size() << endl; - } - for(EqList::const_iterator j = deq->begin(); j != deq->end(); ++j) { - Debug("uf") << " deq(a) ==> " << *j << endl; - TNode deqn = *j; - Assert(deqn.getKind() == kind::EQUAL || - deqn.getKind() == kind::IFF); - TNode s = deqn[0]; - TNode t = deqn[1]; - if(Debug.isOn("uf")) { - Debug("uf") << " s ==> " << s << endl - << " t ==> " << t << endl - << " find(s) ==> " << debugFind(s) << endl - << " find(t) ==> " << debugFind(t) << endl; - } - TNode sp = find(s); - TNode tp = find(t); - if(sp == tp) { - d_conflict = deqn; - return; - } - Assert(sp == b || tp == b); - // optimization: don't put redundant diseq's in the list - if(sp == b) { - if(alreadyDiseqs.find(tp) == alreadyDiseqs.end()) { - appendToDiseqList(b, deqn); - alreadyDiseqs[tp] = deqn; - } - } else { - if(alreadyDiseqs.find(sp) == alreadyDiseqs.end()) { - appendToDiseqList(b, deqn); - alreadyDiseqs[sp] = deqn; - } - } - } - Debug("uf") << "end diseq-list." << endl; - } - - // Note that at this point, alreadyDiseqs contains everything we're - // disequal to, and the attendant disequality - - // FIXME these could be "remembered" and then done in propagation (?) -// EqLists::iterator eq_i = d_equalities.find(a); -// if(eq_i != d_equalities.end()) { -// EqList* eq = (*eq_i).second; -// if(Debug.isOn("uf")) { -// Debug("uf") << "a == " << a << endl; -// Debug("uf") << "size of eq(a) is " << eq->size() << endl; -// } -// for(EqList::const_iterator j = eq->begin(); j != eq->end(); ++j) { -// Debug("uf") << " eq(a) ==> " << *j << endl; -// TNode eqn = *j; -// Assert(eqn.getKind() == kind::EQUAL || -// eqn.getKind() == kind::IFF); -// TNode s = eqn[0]; -// TNode t = eqn[1]; -// if(Debug.isOn("uf")) { -// Debug("uf") << " s ==> " << s << endl -// << " t ==> " << t << endl -// << " find(s) ==> " << debugFind(s) << endl -// << " find(t) ==> " << debugFind(t) << endl; -// } -// TNode sp = find(s); -// TNode tp = find(t); -// if(sp == tp) { -// // propagation of equality -// Debug("uf:prop") << " uf-propagating " << eqn << endl; -// ++d_propagations; -// d_out->propagate(eqn); -// } else { -// Assert(sp == b || tp == b); -// appendToEqList(b, eqn); -// if(sp == b) { -// map::const_iterator k = alreadyDiseqs.find(tp); -// if(k != alreadyDiseqs.end()) { -// // propagation of disequality -// // FIXME: this will propagate the same disequality on every -// // subsequent merge, won't it?? -// Node deqn = (*k).second.notNode(); -// Debug("uf:prop") << " uf-propagating " << deqn << endl; -// ++d_propagations; -// d_out->propagate(deqn); -// } -// } else { -// map::const_iterator k = alreadyDiseqs.find(sp); -// if(k != alreadyDiseqs.end()) { -// // propagation of disequality -// // FIXME: this will propagate the same disequality on every -// // subsequent merge, won't it?? -// Node deqn = (*k).second.notNode(); -// Debug("uf:prop") << " uf-propagating " << deqn << endl; -// ++d_propagations; -// d_out->propagate(deqn); -// } -// } -// } -// } -// Debug("uf") << "end eq-list." << endl; -// } -} - -void TheoryUFMorgan::appendToDiseqList(TNode of, TNode eq) { - Debug("uf") << "appending " << eq << endl - << " to diseq list of " << of << endl; - Assert(eq.getKind() == kind::EQUAL || - eq.getKind() == kind::IFF); - Assert(of == debugFind(of)); - EqLists::iterator deq_i = d_disequalities.find(of); - EqList* deq; - if(deq_i == d_disequalities.end()) { - deq = new(getContext()->getCMM()) EqList(true, getContext(), false, - ContextMemoryAllocator(getContext()->getCMM())); - d_disequalities.insertDataFromContextMemory(of, deq); - } else { - deq = (*deq_i).second; - } - deq->push_back(eq); - if(Debug.isOn("uf")) { - Debug("uf") << " size is now " << deq->size() << endl; - } -} - -void TheoryUFMorgan::appendToEqList(TNode of, TNode eq) { - Debug("uf") << "appending " << eq << endl - << " to eq list of " << of << endl; - Assert(eq.getKind() == kind::EQUAL || - eq.getKind() == kind::IFF); - Assert(of == debugFind(of)); - EqLists::iterator eq_i = d_equalities.find(of); - EqList* eql; - if(eq_i == d_equalities.end()) { - eql = new(getContext()->getCMM()) EqList(true, getContext(), false, - ContextMemoryAllocator(getContext()->getCMM())); - d_equalities.insertDataFromContextMemory(of, eql); - } else { - eql = (*eq_i).second; - } - eql->push_back(eq); - if(Debug.isOn("uf")) { - Debug("uf") << " size is now " << eql->size() << endl; - } -} - -void TheoryUFMorgan::addDisequality(TNode eq) { - Assert(eq.getKind() == kind::EQUAL || - eq.getKind() == kind::IFF); - - TNode a = eq[0]; - TNode b = eq[1]; - - appendToDiseqList(find(a), eq); - appendToDiseqList(find(b), eq); -} - -void TheoryUFMorgan::registerEqualityForPropagation(TNode eq) { - // should NOT be in search at this point, this must be called during - // preregistration - - // FIXME with lemmas on demand, this could miss future propagations, - // since we are not necessarily at context level 0, but are updating - // context-sensitive structures. - - Assert(eq.getKind() == kind::EQUAL || - eq.getKind() == kind::IFF); - - TNode a = eq[0]; - TNode b = eq[1]; - - appendToEqList(find(a), eq); - appendToEqList(find(b), eq); -} - -void TheoryUFMorgan::check(Effort level) { - TimerStat::CodeTimer codeTimer(d_checkTimer); - - Debug("uf") << "uf: begin check(" << level << ")" << endl; - - while(!done()) { - Assert(d_conflict.isNull()); - - Node assertion = get(); - - //d_activeAssertions.push_back(assertion); - - Debug("uf") << "uf check(): " << assertion << endl; - - switch(assertion.getKind()) { - case kind::EQUAL: - case kind::IFF: - d_cc.addEquality(assertion); - if(!d_conflict.isNull()) { - Node conflict = constructConflict(d_conflict); - d_conflict = Node::null(); - ++d_conflicts; - d_out->conflict(conflict, false); - return; - } - merge(assertion[0], assertion[1]); - break; - case kind::APPLY_UF: - { // predicate - - // assert it's a predicate - Assert(assertion.getOperator().getType().getRangeType().isBoolean()); - - Node eq = NodeManager::currentNM()->mkNode(kind::IFF, - assertion, d_trueNode); - d_cc.addTerm(assertion); - d_cc.addEquality(eq); - - if(!d_conflict.isNull()) { - Node conflict = constructConflict(d_conflict); - d_conflict = Node::null(); - ++d_conflicts; - d_out->conflict(conflict, false); - return; - } - - if(Debug.isOn("uf")) { - Debug("uf") << "true == false ? " - << (find(d_trueNode) == find(d_falseNode)) << endl; - } - - Assert(find(d_trueNode) != find(d_falseNode)); - - merge(eq[0], eq[1]); - } - break; - case kind::NOT: - if(assertion[0].getKind() == kind::EQUAL || - assertion[0].getKind() == kind::IFF) { - Node a = assertion[0][0]; - Node b = assertion[0][1]; - - addDisequality(assertion[0]); - - d_cc.addTerm(a); - d_cc.addTerm(b); - - if(Debug.isOn("uf")) { - Debug("uf") << " a ==> " << a << endl - << " b ==> " << b << endl - << " find(a) ==> " << debugFind(a) << endl - << " find(b) ==> " << debugFind(b) << endl; - } - - // There are two ways to get a conflict here. - if(!d_conflict.isNull()) { - // We get a conflict this way if we weren't watching a, b - // before and we were just now notified (via - // notifyCongruent()) when we called addTerm() above that - // they are congruent. We make this a separate case (even - // though the check in the "else if.." below would also - // catch it, so that we can clear out d_conflict. - Node conflict = constructConflict(d_conflict); - d_conflict = Node::null(); - ++d_conflicts; - d_out->conflict(conflict, false); - return; - } else if(find(a) == find(b)) { - // We get a conflict this way if we WERE previously watching - // a, b and were notified previously (via notifyCongruent()) - // that they were congruent. - Node conflict = constructConflict(assertion[0]); - ++d_conflicts; - d_out->conflict(conflict, false); - return; - } - - // If we get this far, there should be nothing conflicting due - // to this disequality. - Assert(!d_cc.areCongruent(a, b)); - } else { - // negation of a predicate - Assert(assertion[0].getKind() == kind::APPLY_UF); - - // assert it's a predicate - Assert(assertion[0].getOperator().getType().getRangeType().isBoolean()); - - Node eq = NodeManager::currentNM()->mkNode(kind::IFF, - assertion[0], d_falseNode); - d_cc.addTerm(assertion[0]); - d_cc.addEquality(eq); - - if(!d_conflict.isNull()) { - Node conflict = constructConflict(d_conflict); - d_conflict = Node::null(); - ++d_conflicts; - d_out->conflict(conflict, false); - return; - } - - if(Debug.isOn("uf")) { - Debug("uf") << "true == false ? " - << (find(d_trueNode) == find(d_falseNode)) << endl; - } - - Assert(find(d_trueNode) != find(d_falseNode)); - - merge(eq[0], eq[1]); - } - break; - default: - Unhandled(assertion.getKind()); - } - - /* - if(Debug.isOn("uf")) { - dump(); - } - */ - } - Assert(d_conflict.isNull()); - Debug("uf") << "uf check() done = " << (done() ? "true" : "false") - << endl; - - /* - for(CDList::const_iterator diseqIter = d_disequality.begin(); - diseqIter != d_disequality.end(); - ++diseqIter) { - - TNode left = (*diseqIter)[0]; - TNode right = (*diseqIter)[1]; - if(Debug.isOn("uf")) { - Debug("uf") << "testing left: " << left << endl - << " right: " << right << endl - << " find(L): " << debugFind(left) << endl - << " find(R): " << debugFind(right) << endl - << " areCong: " << d_cc.areCongruent(left, right) - << endl; - } - Assert((debugFind(left) == debugFind(right)) == - d_cc.areCongruent(left, right)); - } - */ - - Debug("uf") << "uf: end check(" << level << ")" << endl; -} - -void TheoryUFMorgan::propagate(Effort level) { - TimerStat::CodeTimer codeTimer(d_propagateTimer); - - Debug("uf") << "uf: begin propagate(" << level << ")" << endl; - // propagation is done in check(), for now - // FIXME need to find a slick way to propagate predicates - Debug("uf") << "uf: end propagate(" << level << ")" << endl; -} - -void TheoryUFMorgan::explain(TNode n) { - TimerStat::CodeTimer codeTimer(d_explainTimer); - - Debug("uf") << "uf: begin explain([" << n << "])" << endl; - Unimplemented(); - Debug("uf") << "uf: end explain([" << n << "])" << endl; -} - -void TheoryUFMorgan::presolve() { - TimerStat::CodeTimer codeTimer(d_presolveTimer); - - Debug("uf") << "uf: begin presolve()" << endl; - if(Options::current()->ufSymmetryBreaker) { - vector newClauses; - d_symb.apply(newClauses); - for(vector::const_iterator i = newClauses.begin(); - i != newClauses.end(); - ++i) { - d_out->lemma(*i); - } - } - Debug("uf") << "uf: end presolve()" << endl; -} - -void TheoryUFMorgan::notifyRestart() { - Debug("uf") << "uf: begin notifyDecisionLevelZero()" << endl; - Debug("uf") << "uf: end notifyDecisionLevelZero()" << endl; -} - -Node TheoryUFMorgan::getValue(TNode n) { - NodeManager* nodeManager = NodeManager::currentNM(); - - switch(n.getKind()) { - - case kind::VARIABLE: - case kind::APPLY_UF: - if(n.getType().isBoolean()) { - if(d_cc.areCongruent(d_trueNode, n)) { - return nodeManager->mkConst(true); - } else if(d_cc.areCongruent(d_falseNode, n)) { - return nodeManager->mkConst(false); - } - } - return d_cc.normalize(n); - - case kind::EQUAL: // 2 args - return nodeManager-> - mkConst( d_valuation.getValue(n[0]) == d_valuation.getValue(n[1]) ); - - default: - Unhandled(n.getKind()); - } -} - -void TheoryUFMorgan::staticLearning(TNode n, NodeBuilder<>& learned) { - TimerStat::CodeTimer codeTimer(d_staticLearningTimer); - - vector workList; - workList.push_back(n); - __gnu_cxx::hash_set processed; - - while(!workList.empty()) { - n = workList.back(); - - bool unprocessedChildren = false; - for(TNode::iterator i = n.begin(), iend = n.end(); i != iend; ++i) { - if(processed.find(*i) == processed.end()) { - // unprocessed child - workList.push_back(*i); - unprocessedChildren = true; - } - } - - if(unprocessedChildren) { - continue; - } - - workList.pop_back(); - // has node n been processed in the meantime ? - if(processed.find(n) != processed.end()) { - continue; - } - processed.insert(n); - - // == DIAMONDS == - - Debug("diamonds") << "===================== looking at" << endl - << n << endl; - - // binary OR of binary ANDs of EQUALities - if(n.getKind() == kind::OR && n.getNumChildren() == 2 && - n[0].getKind() == kind::AND && n[0].getNumChildren() == 2 && - n[1].getKind() == kind::AND && n[1].getNumChildren() == 2 && - (n[0][0].getKind() == kind::EQUAL || n[0][0].getKind() == kind::IFF) && - (n[0][1].getKind() == kind::EQUAL || n[0][1].getKind() == kind::IFF) && - (n[1][0].getKind() == kind::EQUAL || n[1][0].getKind() == kind::IFF) && - (n[1][1].getKind() == kind::EQUAL || n[1][1].getKind() == kind::IFF)) { - // now we have (a = b && c = d) || (e = f && g = h) - - Debug("diamonds") << "has form of a diamond!" << endl; - - TNode - a = n[0][0][0], b = n[0][0][1], - c = n[0][1][0], d = n[0][1][1], - e = n[1][0][0], f = n[1][0][1], - g = n[1][1][0], h = n[1][1][1]; - - // test that one of {a, b} = one of {c, d}, and make "b" the - // shared node (i.e. put in the form (a = b && b = d)) - // note we don't actually care about the shared ones, so the - // "swaps" below are one-sided, ignoring b and c - if(a == c) { - a = b; - } else if(a == d) { - a = b; - d = c; - } else if(b == c) { - // nothing to do - } else if(b == d) { - d = c; - } else { - // condition not satisfied - Debug("diamonds") << "+ A fails" << endl; - continue; - } - - Debug("diamonds") << "+ A holds" << endl; - - // same: one of {e, f} = one of {g, h}, and make "f" the - // shared node (i.e. put in the form (e = f && f = h)) - if(e == g) { - e = f; - } else if(e == h) { - e = f; - h = g; - } else if(f == g) { - // nothing to do - } else if(f == h) { - h = g; - } else { - // condition not satisfied - Debug("diamonds") << "+ B fails" << endl; - continue; - } - - Debug("diamonds") << "+ B holds" << endl; - - // now we have (a = b && b = d) || (e = f && f = h) - // test that {a, d} == {e, h} - if( (a == e && d == h) || - (a == h && d == e) ) { - // learn: n implies a == d - Debug("diamonds") << "+ C holds" << endl; - Node newEquality = a.getType().isBoolean() ? a.iffNode(d) : a.eqNode(d); - Debug("diamonds") << " ==> " << newEquality << endl; - learned << n.impNode(newEquality); - } else { - Debug("diamonds") << "+ C fails" << endl; - } - } - } - - if(Options::current()->ufSymmetryBreaker) { - d_symb.assertFormula(n); - } -} - -/* -void TheoryUFMorgan::dump() { - if(!Debug.isOn("uf")) { - return; - } - Debug("uf") << "============== THEORY_UF ==============" << endl; - Debug("uf") << "Active assertions list:" << endl; - for(context::CDList::const_iterator i = d_activeAssertions.begin(); - i != d_activeAssertions.end(); - ++i) { - Debug("uf") << " " << *i << endl; - } - Debug("uf") << "Congruence union-find:" << endl; - for(UnionFind::const_iterator i = d_unionFind.begin(); - i != d_unionFind.end(); - ++i) { - Debug("uf") << " " << (*i).first << " ==> " << (*i).second - << endl; - } - Debug("uf") << "Disequality lists:" << endl; - for(EqLists::const_iterator i = d_disequalities.begin(); - i != d_disequalities.end(); - ++i) { - Debug("uf") << " " << (*i).first << ":" << endl; - EqList* dl = (*i).second; - for(EqList::const_iterator j = dl->begin(); - j != dl->end(); - ++j) { - Debug("uf") << " " << *j << endl; - } - } - Debug("uf") << "=======================================" << endl; -} -*/ diff --git a/src/theory/uf/morgan/theory_uf_morgan.h b/src/theory/uf/morgan/theory_uf_morgan.h deleted file mode 100644 index e801f383e..000000000 --- a/src/theory/uf/morgan/theory_uf_morgan.h +++ /dev/null @@ -1,267 +0,0 @@ -/********************* */ -/*! \file theory_uf_morgan.h - ** \verbatim - ** Original author: taking - ** Major contributors: mdeters - ** Minor contributors (to current version): none - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 Implementation of the theory of uninterpreted functions with - ** equality - ** - ** Implementation of the theory of uninterpreted functions with equality, - ** based on CVC4's congruence closure module (which is in turn based on - ** the Nieuwenhuis and Oliveras paper, Fast Congruence Closure and - ** Extensions. - **/ - -#include "cvc4_private.h" - -#ifndef __CVC4__THEORY__UF__MORGAN__THEORY_UF_MORGAN_H -#define __CVC4__THEORY__UF__MORGAN__THEORY_UF_MORGAN_H - -#include "expr/node.h" -#include "expr/attribute.h" - -#include "theory/theory.h" -#include "theory/uf/theory_uf.h" -#include "theory/uf/morgan/union_find.h" -#include "theory/uf/symmetry_breaker.h" - -#include "context/context.h" -#include "context/context_mm.h" -#include "context/cdlist.h" -#include "util/congruence_closure.h" - -namespace CVC4 { -namespace theory { -namespace uf { -namespace morgan { - -class TheoryUFMorgan : public TheoryUF { - -private: - - class CongruenceChannel { - TheoryUFMorgan* d_uf; - - public: - CongruenceChannel(TheoryUFMorgan* uf) : d_uf(uf) {} - void notifyCongruent(TNode a, TNode b) { - d_uf->notifyCongruent(a, b); - } - };/* class CongruenceChannel */ - friend class CongruenceChannel; - - /** - * List of all of the non-negated literals from the assertion queue. - * This is used only for conflict generation. - * This differs from pending as the program generates new equalities that - * are not in this list. - * This will probably be phased out in future version. - */ - context::CDList d_assertions; - - SymmetryBreaker d_symb; - - /** - * Our channel connected to the congruence closure module. - */ - CongruenceChannel d_ccChannel; - - /** - * Instance of the congruence closure module. - */ - CongruenceClosure > d_cc; - - /** - * Our union find for equalities. - */ - UnionFind d_unionFind; - - typedef context::CDList > EqList; - typedef context::CDMap EqLists; - - /** List of all disequalities this theory has seen. */ - EqLists d_disequalities; - - /** List of all (potential) equalities to be propagated. */ - EqLists d_equalities; - - Node d_conflict; - - Node d_trueNode, d_falseNode, d_trueEqFalseNode; - - // === STATISTICS === - /** time spent in check() */ - KEEP_STATISTIC(TimerStat, - d_checkTimer, - "theory::uf::morgan::checkTime"); - /** time spent in propagate() */ - KEEP_STATISTIC(TimerStat, - d_propagateTimer, - "theory::uf::morgan::propagateTime"); - - /** time spent in explain() */ - KEEP_STATISTIC(TimerStat, - d_explainTimer, - "theory::uf::morgan::explainTime"); - /** time spent in staticLearning() */ - KEEP_STATISTIC(TimerStat, - d_staticLearningTimer, - "theory::uf::morgan::staticLearningTime"); - /** time spent in presolve() */ - KEEP_STATISTIC(TimerStat, - d_presolveTimer, - "theory::uf::morgan::presolveTime"); - /** number of UF conflicts */ - KEEP_STATISTIC(IntStat, - d_conflicts, - "theory::uf::morgan::conflicts", 0); - /** number of UF propagations */ - KEEP_STATISTIC(IntStat, - d_propagations, - "theory::uf::morgan::propagations", 0); - /** CC module expl length */ - WrappedStat d_ccExplanationLength; - /** CC module # skolem vars */ - WrappedStat d_ccNewSkolemVars; - -public: - - /** Constructs a new instance of TheoryUF w.r.t. the provided context.*/ - TheoryUFMorgan(context::Context* ctxt, OutputChannel& out, Valuation valuation); - - /** Destructor for UF theory, cleans up memory and statistics. */ - ~TheoryUFMorgan(); - - /** - * Registers a previously unseen [in this context] node n. - * For TheoryUF, this sets up and maintains invaraints about - * equivalence class data-structures. - * - * Overloads a void registerTerm(TNode n); from theory.h. - * See theory/theory.h for more information about this method. - */ - void registerTerm(TNode n); - - /** - * Currently this does nothing. - * - * Overloads a void preRegisterTerm(TNode n); from theory.h. - * See theory/theory.h for more information about this method. - */ - void preRegisterTerm(TNode n); - - /** - * Checks whether the set of literals provided to the theory is consistent. - * - * If this is called at any effort level, it computes the congruence closure - * of all of the positive literals in the context. - * - * If this is called at full effort it checks if any of the negative literals - * are inconsistent with the congruence closure. - * - * Overloads void check(Effort level); from theory.h. - * See theory/theory.h for more information about this method. - */ - void check(Effort level); - - /** - * Propagates theory literals. - * - * Overloads void propagate(Effort level); from theory.h. - * See theory/theory.h for more information about this method. - */ - void propagate(Effort level); - - /** - * Explains a previously theory-propagated literal. - * - * Overloads void explain(TNode n, Effort level); from theory.h. - * See theory/theory.h for more information about this method. - */ - void explain(TNode n); - - /** - * The theory should only add (via .operator<< or .append()) to the - * "learned" builder. It is a conjunction to add to the formula at - * the top-level and may contain other theories' contributions. - */ - void staticLearning(TNode in, NodeBuilder<>& learned); - - /** - * A Theory is called with presolve exactly one time per user - * check-sat. presolve() is called after preregistration, - * rewriting, and Boolean propagation, (other theories' - * propagation?), but the notified Theory has not yet had its - * check() or propagate() method called. A Theory may empty its - * assertFact() queue using get(). A Theory can raise conflicts, - * add lemmas, and propagate literals during presolve(). - */ - void presolve(); - - /** - * Notification sent to the Theory when the search restarts. - */ - void notifyRestart(); - - /** - * Gets a theory value. - * - * Overloads Node getValue(TNode n); from theory.h. - * See theory/theory.h for more information about this method. - */ - Node getValue(TNode n); - - std::string identify() const { return std::string("TheoryUFMorgan"); } - -private: - - /** Constructs a conflict from an inconsistent disequality. */ - Node constructConflict(TNode diseq); - - inline TNode find(TNode a); - inline TNode debugFind(TNode a) const; - - void appendToDiseqList(TNode of, TNode eq); - void appendToEqList(TNode of, TNode eq); - void addDisequality(TNode eq); - void registerEqualityForPropagation(TNode eq); - - /** - * Receives a notification from the congruence closure module that - * two nodes have been merged into the same congruence class. - */ - void notifyCongruent(TNode a, TNode b); - - /** - * Internally handle a congruence, whether generated by the CC - * module or from a theory check(). Merges the classes from a and b - * and looks for a conflict. If there is one, sets d_conflict. - */ - void merge(TNode a, TNode b); - - void dump(); - -};/* class TheoryUFMorgan */ - -inline TNode TheoryUFMorgan::find(TNode a) { - return d_unionFind.find(a); -} - -inline TNode TheoryUFMorgan::debugFind(TNode a) const { - return d_unionFind.debugFind(a); -} - -}/* CVC4::theory::uf::morgan namespace */ -}/* CVC4::theory::uf namespace */ -}/* CVC4::theory namespace */ -}/* CVC4 namespace */ - -#endif /* __CVC4__THEORY__UF__MORGAN__THEORY_UF_MORGAN_H */ diff --git a/src/theory/uf/morgan/union_find.cpp b/src/theory/uf/morgan/union_find.cpp deleted file mode 100644 index 135320707..000000000 --- a/src/theory/uf/morgan/union_find.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/********************* */ -/*! \file union_find.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, 2010 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 Path-compressing, backtrackable union-find using an undo - ** stack - ** - ** Path-compressing, backtrackable union-find using an undo stack - ** rather than storing items in a CDMap<>. - **/ - -#include - -#include "theory/uf/morgan/union_find.h" -#include "util/Assert.h" -#include "expr/node.h" - -using namespace std; - -namespace CVC4 { -namespace theory { -namespace uf { -namespace morgan { - -template -void UnionFind::notify() { - Trace("ufuf") << "UFUF cancelling : " << d_offset << " < " << d_trace.size() << " ?" << endl; - while(d_offset < d_trace.size()) { - pair p = d_trace.back(); - if(p.second.isNull()) { - d_map.erase(p.first); - Trace("ufuf") << "UFUF " << d_trace.size() << " erasing " << p.first << endl; - } else { - d_map[p.first] = p.second; - Trace("ufuf") << "UFUF " << d_trace.size() << " replacing " << p << endl; - } - d_trace.pop_back(); - } - Trace("ufuf") << "UFUF cancelling finished." << endl; -} - -// The following declarations allow us to put functions in the .cpp file -// instead of the header, since we know which instantiations are needed. - -template void UnionFind::notify(); - -template void UnionFind::notify(); - -}/* CVC4::theory::uf::morgan namespace */ -}/* CVC4::theory::uf namespace */ -}/* CVC4::theory namespace */ -}/* CVC4 namespace */ diff --git a/src/theory/uf/morgan/union_find.h b/src/theory/uf/morgan/union_find.h deleted file mode 100644 index 794d7452c..000000000 --- a/src/theory/uf/morgan/union_find.h +++ /dev/null @@ -1,148 +0,0 @@ -/********************* */ -/*! \file union_find.h - ** \verbatim - ** Original author: mdeters - ** Major contributors: none - ** Minor contributors (to current version): none - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 Path-compressing, backtrackable union-find using an undo - ** stack - ** - ** Path-compressing, backtrackable union-find using an undo stack - ** rather than storing items in a CDMap<>. - **/ - -#include "cvc4_private.h" - -#ifndef __CVC4__THEORY__UF__MORGAN__UNION_FIND_H -#define __CVC4__THEORY__UF__MORGAN__UNION_FIND_H - -#include -#include -#include - -#include "expr/node.h" -#include "context/cdo.h" - -namespace CVC4 { - -namespace context { - class Context; -}/* CVC4::context namespace */ - -namespace theory { -namespace uf { -namespace morgan { - -// NodeType \in { Node, TNode } -template -class UnionFind : context::ContextNotifyObj { - /** Our underlying map type. */ - typedef __gnu_cxx::hash_map MapType; - - /** - * Our map of Nodes to their canonical representatives. - * If a Node is not present in the map, it is its own - * representative. - */ - MapType d_map; - - /** Our undo stack for changes made to d_map. */ - std::vector > d_trace; - - /** Our current offset in the d_trace stack (context-dependent). */ - context::CDO d_offset; - -public: - UnionFind(context::Context* ctxt) : - context::ContextNotifyObj(ctxt), - d_offset(ctxt, 0) { - } - - ~UnionFind() throw() { } - - /** - * Return a Node's union-find representative, doing path compression. - */ - inline TNode find(TNode n); - - /** - * Return a Node's union-find representative, NOT doing path compression. - * This is useful for Assert() statements, debug checking, and similar - * things that you do NOT want to mutate the structure. - */ - inline TNode debugFind(TNode n) const; - - /** - * Set the canonical representative of n to newParent. They should BOTH - * be their own canonical representatives on entry to this funciton. - */ - inline void setCanon(TNode n, TNode newParent); - - /** - * Called by the Context when a pop occurs. Cancels everything to the - * current context level. Overrides ContextNotifyObj::notify(). - */ - void notify(); - -};/* class UnionFind<> */ - -template -inline TNode UnionFind::debugFind(TNode n) const { - typename MapType::const_iterator i = d_map.find(n); - if(i == d_map.end()) { - return n; - } else { - return debugFind((*i).second); - } -} - -template -inline TNode UnionFind::find(TNode n) { - Trace("ufuf") << "UFUF find of " << n << std::endl; - typename MapType::iterator i = d_map.find(n); - if(i == d_map.end()) { - Trace("ufuf") << "UFUF it is rep" << std::endl; - return n; - } else { - Trace("ufuf") << "UFUF not rep: par is " << (*i).second << std::endl; - std::pair pr = *i; - // our iterator is invalidated by the recursive call to find(), - // since it mutates the map - TNode p = find(pr.second); - if(p == pr.second) { - return p; - } - d_trace.push_back(std::make_pair(n, pr.second)); - d_offset = d_trace.size(); - Trace("ufuf") << "UFUF setting canon of " << n << " : " << p << " @ " << d_trace.size() << std::endl; - pr.second = p; - d_map.insert(pr); - return p; - } -} - -template -inline void UnionFind::setCanon(TNode n, TNode newParent) { - Assert(d_map.find(n) == d_map.end()); - Assert(d_map.find(newParent) == d_map.end()); - if(n != newParent) { - Trace("ufuf") << "UFUF setting canon of " << n << " : " << newParent << " @ " << d_trace.size() << std::endl; - d_map[n] = newParent; - d_trace.push_back(std::make_pair(n, TNode::null())); - d_offset = d_trace.size(); - } -} - -}/* CVC4::theory::uf::morgan namespace */ -}/* CVC4::theory::uf namespace */ -}/* CVC4::theory namespace */ -}/* CVC4 namespace */ - -#endif /*__CVC4__THEORY__UF__MORGAN__UNION_FIND_H */ diff --git a/src/theory/uf/theory_uf.cpp b/src/theory/uf/theory_uf.cpp index 3c8d59d08..401c18203 100644 --- a/src/theory/uf/theory_uf.cpp +++ b/src/theory/uf/theory_uf.cpp @@ -2,10 +2,10 @@ /*! \file theory_uf.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/uf/theory_uf.h b/src/theory/uf/theory_uf.h index de8e70a49..1f4c2372f 100644 --- a/src/theory/uf/theory_uf.h +++ b/src/theory/uf/theory_uf.h @@ -1,11 +1,11 @@ /********************* */ /*! \file theory_uf.h ** \verbatim - ** Original author: dejan - ** Major contributors: none + ** Original author: mdeters + ** Major contributors: dejan ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/uf/theory_uf_rewriter.h b/src/theory/uf/theory_uf_rewriter.h index ee88df126..e1aba2c95 100644 --- a/src/theory/uf/theory_uf_rewriter.h +++ b/src/theory/uf/theory_uf_rewriter.h @@ -2,7 +2,7 @@ /*! \file theory_uf_rewriter.h ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/theory/uf/theory_uf_type_rules.h b/src/theory/uf/theory_uf_type_rules.h index 7a4bf721f..927a31e01 100644 --- a/src/theory/uf/theory_uf_type_rules.h +++ b/src/theory/uf/theory_uf_type_rules.h @@ -5,7 +5,7 @@ ** Major contributors: cconway, mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/theory/uf/tim/Makefile b/src/theory/uf/tim/Makefile deleted file mode 100644 index e1db2cbf9..000000000 --- a/src/theory/uf/tim/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -topdir = ../../../.. -srcdir = src/theory/uf/tim - -include $(topdir)/Makefile.subdir diff --git a/src/theory/uf/tim/Makefile.am b/src/theory/uf/tim/Makefile.am deleted file mode 100644 index 647783885..000000000 --- a/src/theory/uf/tim/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -AM_CPPFLAGS = \ - -D__BUILDING_CVC4LIB \ - -I@srcdir@/../../../include -I@srcdir@/../../.. -I@builddir@/../../.. -AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) - -noinst_LTLIBRARIES = libuftim.la - -libuftim_la_SOURCES = \ - ecdata.h \ - ecdata.cpp \ - theory_uf_tim.h \ - theory_uf_tim.cpp - -EXTRA_DIST = diff --git a/src/theory/uf/tim/ecdata.cpp b/src/theory/uf/tim/ecdata.cpp deleted file mode 100644 index 52a110ff2..000000000 --- a/src/theory/uf/tim/ecdata.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/********************* */ -/*! \file ecdata.cpp - ** \verbatim - ** Original author: taking - ** Major contributors: mdeters - ** Minor contributors (to current version): none - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 Implementation of equivalence class data for UF theory. - ** - ** Implementation of equivalence class data for UF theory. This is a - ** context-dependent object. - **/ - -#include "theory/uf/tim/ecdata.h" - -using namespace CVC4; -using namespace CVC4::context; -using namespace CVC4::theory; -using namespace CVC4::theory::uf; -using namespace CVC4::theory::uf::tim; - -ECData::ECData(Context * context, TNode n) : - ContextObj(context), - d_find(this), - d_rep(n), - d_watchListSize(0), - d_first(NULL), - d_last(NULL) { -} - -bool ECData::isClassRep() { - return this == this->d_find; -} - -void ECData::addPredecessor(TNode n) { - Assert(isClassRep()); - - makeCurrent(); - - Link * newPred = new(getCMM()) Link(getContext(), n, d_first); - d_first = newPred; - if(d_last == NULL) { - d_last = newPred; - } - - ++d_watchListSize; -} - -ContextObj* ECData::save(ContextMemoryManager* pCMM) { - return new(pCMM) ECData(*this); -} - -void ECData::restore(ContextObj* pContextObj) { - ECData* data = (ECData*)pContextObj; - d_find = data->d_find; - d_first = data->d_first; - d_last = data->d_last; - d_rep = data->d_rep; - d_watchListSize = data->d_watchListSize; -} - -Node ECData::getRep() { - return d_rep; -} - -unsigned ECData::getWatchListSize() { - return d_watchListSize; -} - -void ECData::setFind(ECData * ec) { - makeCurrent(); - d_find = ec; -} - -ECData* ECData::getFind() { - return d_find; -} - -Link* ECData::getFirst() { - return d_first; -} - -void ECData::takeOverDescendantWatchList(ECData* nslave, ECData* nmaster) { - Assert(nslave != nmaster); - Assert(nslave->getFind() == nmaster); - - nmaster->makeCurrent(); - - nmaster->d_watchListSize += nslave->d_watchListSize; - - if(nmaster->d_first == NULL) { - nmaster->d_first = nslave->d_first; - nmaster->d_last = nslave->d_last; - } else if(nslave->d_first != NULL) { - Link* currLast = nmaster->d_last; - currLast->d_next = nslave->d_first; - nmaster->d_last = nslave->d_last; - } -} diff --git a/src/theory/uf/tim/ecdata.h b/src/theory/uf/tim/ecdata.h deleted file mode 100644 index 5e72f0042..000000000 --- a/src/theory/uf/tim/ecdata.h +++ /dev/null @@ -1,261 +0,0 @@ -/********************* */ -/*! \file ecdata.h - ** \verbatim - ** Original author: taking - ** Major contributors: mdeters - ** Minor contributors (to current version): none - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 Context dependent equivalence class datastructure for nodes. - ** - ** Context dependent equivalence class datastructure for nodes. - ** Currently keeps a context dependent watch list. - **/ - -#include "cvc4_private.h" - -#ifndef __CVC4__THEORY__UF__TIM__ECDATA_H -#define __CVC4__THEORY__UF__TIM__ECDATA_H - -#include "expr/node.h" -#include "context/context.h" -#include "context/cdo.h" -#include "context/context_mm.h" - -namespace CVC4 { -namespace theory { -namespace uf { -namespace tim { - -/** - * Link is a context dependent linked list of nodes. - * Link is intended to be allocated in a Context's memory manager. - * The next pointer of the list is context dependent, but the node being - * pointed to is fixed for the life of the Link. - * - * Clients of Link are intended not to modify the node that is being pointed - * to in good faith. This may change in the future. - */ -struct Link { - /** - * Pointer to the next element in linked list. - * This is context dependent. - */ - context::CDO d_next; - - /** - * Link is supposed to be allocated in a region of a - * ContextMemoryManager. In order to avoid having to decrement the - * ref count at deletion time, it is preferrable for the user of - * Link to maintain the invariant that data will survival for the - * entire scope of the TNode. - */ - TNode d_data; - - /** - * Creates a new Link w.r.t. a context for the node n. - * An optional parameter is to specify the next element in the link. - */ - Link(context::Context* context, TNode n, Link* l = NULL) : - d_next(true, context, l), - d_data(n) { - Debug("context") << "Link: " << this - << " so cdo is " << &d_next << std::endl; - } - - /** - * Allocates a new Link in the region for the provided ContextMemoryManager. - * This allows for cheap cleanup on pop. - */ - static void* operator new(size_t size, context::ContextMemoryManager* pCMM) { - return pCMM->newData(size); - } - -private: - - /** - * The destructor isn't actually defined. This declaration keeps - * the compiler from creating (wastefully) a default definition, and - * ensures that we get a link error if someone uses Link in a way - * that requires destruction. Objects of class Link should always - * be allocated in a ContextMemoryManager, which doesn't call - * destructors. - */ - ~Link() throw(); - - /** - * Just like the destructor, this is not defined. This ensures no - * one tries to create a Link on the heap. - */ - static void* operator new(size_t size); - -};/* struct Link */ - - -/** - * ECData is a equivalence class object that is context dependent. - * It is developed in order to support the congruence closure algorithm - * in TheoryUF, and is not intended to be used outside of that package. - * - * ECData maintains: - * - find pointer for the equivalence class (disjoint set forest) - * - the node that represents the equivalence class. - * - maintains a predecessorlist/watchlist - * - * ECData does not have support for the canonical find and union operators - * for disjoint set forests. Instead it only provides access to the find - * pointer. The implementation of find is ccFind in TheoryUF. - * union is broken into 2 phases: - * 1) setting the find point with setFind - * 2) taking over the watch list of the other node. - * This is a technical requirement for the implementation of TheoryUF. - * (See ccUnion in TheoryUF for more information.) - * - * The intended paradigm for iterating over the watch list of ec is: - * for(Link* i = ec->getFirst(); i != NULL; i = i->next ); - * - * See also ECAttr() in theory_uf.h, and theory_uf.cpp where the codde that uses - * ECData lives. - */ -class ECData : public context::ContextObj { -private: - /** - * This is the standard disjoint set forest find pointer. - * - * Why an ECData pointer instead of a node? - * This was chosen to be a ECData pointer in order to shortcut at least one - * table every time the find pointer is examined. - */ - ECData* d_find; - - /** - * This is pointer back to the node that represents this equivalence class. - * - * The following invariant should be maintained: - * (n.getAttribute(ECAttr()))->rep == n - * i.e. rep is equal to the node that maps to the ECData using ECAttr. - * - * Tricky part: This needs to be a TNode, not a Node. - * Suppose that rep were a hard link. - * When a node n maps to an ECData via the ECAttr() there will be a hard - * link back to n in the ECData. The attribute does not do garbage collection - * until the node gets garbage collected, which does not happen until its - * ref count drops to 0. So because of this cycle neither the node and - * the ECData will never get garbage collected. - * So this needs to be a soft link. - */ - TNode d_rep; - - // Watch list data structures follow - - /** - * Maintains watch list size for more efficient merging. - */ - unsigned d_watchListSize; - - /** - * Pointer to the beginning of the watchlist. - * This value is NULL iff the watch list is empty. - */ - Link* d_first; - - /** - * Pointer to the end of the watch-list. - * This is maintained in order to constant time list merging. - * (This does not give any asymptotic improve as this is currently always - * preceeded by an O(|watchlist|) operation.) - * This value is NULL iff the watch list is empty. - */ - Link* d_last; - - /** Context-dependent operation: save this ECData */ - context::ContextObj* save(context::ContextMemoryManager* pCMM); - - /** Context-dependent operation: restore this ECData */ - void restore(context::ContextObj* pContextObj); - -public: - /** - * Returns true if this ECData object is the current representative of - * the equivalence class. - */ - bool isClassRep(); - - /** - * Adds a node to the watch list of the equivalence class. Does - * context-dependent memory allocation in the Context with which - * this ECData was created. - * - * @param n the node to be added. - * @pre isClassRep() == true - */ - void addPredecessor(TNode n); - - /** - * Creates a EQ with the representative n - * @param context the context to associate with this ecdata. - * This is required as ECData is context dependent - * @param n the node that corresponds to this ECData - */ - ECData(context::Context* context, TNode n); - - /** Destructor for ECDatas */ - ~ECData() { - Debug("ufgc") << "Calling ECData destructor" << std::endl; - destroy(); - } - - /** - * An ECData takes over the watch list of another ECData. - * This is the second step in the union operator for ECData. - * This should be called after nslave->setFind(nmaster); - * After this is done nslave's watch list should never be accessed by - * getLast() or getFirst() - */ - static void takeOverDescendantWatchList(ECData * nslave, ECData * nmaster); - - /** - * Returns the representative of this ECData. - */ - Node getRep(); - - /** - * Returns the size of the equivalence class. - */ - unsigned getWatchListSize(); - - /** - * Returns a pointer the first member of the watch list. - */ - Link* getFirst(); - - - /** - * Returns the find pointer of the ECData. - * If isClassRep(), then getFind() == this - */ - ECData* getFind(); - - /** - * Sets the find pointer of the equivalence class to be another ECData object. - * - * @pre isClassRep() == true - * @pre ec->isClassRep() == true - * @post isClassRep() == false - * @post ec->isClassRep() == true - */ - void setFind(ECData * ec); - -};/* class ECData */ - -}/* CVC4::theory::uf::tim namespace */ -}/* CVC4::theory::uf namespace */ -}/* CVC4::theory namespace */ -}/* CVC4 namespace */ - -#endif /* __CVC4__THEORY__UF__TIM__ECDATA_H */ diff --git a/src/theory/uf/tim/theory_uf_tim.cpp b/src/theory/uf/tim/theory_uf_tim.cpp deleted file mode 100644 index ae37dfe99..000000000 --- a/src/theory/uf/tim/theory_uf_tim.cpp +++ /dev/null @@ -1,325 +0,0 @@ -/********************* */ -/*! \file theory_uf_tim.cpp - ** \verbatim - ** Original author: taking - ** Major contributors: mdeters - ** Minor contributors (to current version): dejan - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 Implementation of the theory of uninterpreted functions. - ** - ** Implementation of the theory of uninterpreted functions. - **/ - -#include "theory/uf/tim/theory_uf_tim.h" -#include "theory/uf/tim/ecdata.h" -#include "expr/kind.h" - -using namespace CVC4; -using namespace CVC4::kind; -using namespace CVC4::context; -using namespace CVC4::theory; -using namespace CVC4::theory::uf; -using namespace CVC4::theory::uf::tim; - -TheoryUFTim::TheoryUFTim(Context* c, OutputChannel& out, Valuation valuation) : - TheoryUF(c, out, valuation), - d_assertions(c), - d_pending(c), - d_currentPendingIdx(c,0), - d_disequality(c), - d_registered(c) { - Warning() << "NOTE:" << std::endl - << "NOTE: currently the 'Tim' UF solver is broken," << std::endl - << "NOTE: since its registerTerm() function is never" << std::endl - << "NOTE: called." << std::endl - << "NOTE:" << std::endl; -} - -TheoryUFTim::~TheoryUFTim() { -} - -void TheoryUFTim::preRegisterTerm(TNode n) { - Debug("uf") << "uf: begin preRegisterTerm(" << n << ")" << std::endl; - Debug("uf") << "uf: end preRegisterTerm(" << n << ")" << std::endl; -} - -void TheoryUFTim::registerTerm(TNode n) { - - Debug("uf") << "uf: begin registerTerm(" << n << ")" << std::endl; - - d_registered.push_back(n); - - ECData* ecN; - - if(n.getAttribute(ECAttr(), ecN)) { - /* registerTerm(n) is only called when a node has not been seen in the - * current context. ECAttr() is not a context-dependent attribute. - * When n.hasAttribute(ECAttr(),...) is true on a registerTerm(n) call, - * then it must be the case that this attribute was created in a previous - * and no longer valid context. Because of this we have to reregister the - * predecessors lists. - * Also we do not have to worry about duplicates because all of the Link* - * setup before are removed when the context n was setup in was popped out - * of. All we are going to do here are sanity checks. - */ - - /* - * Consider the following chain of events: - * 1) registerTerm(n) is called on node n where n : f(m) in context level X, - * 2) A new ECData is created on the heap, ecN, - * 3) n is added to the predessecor list of m in context level X, - * 4) We pop out of X, - * 5) n is removed from the predessecor list of m because this is context - * dependent, the Link* will be destroyed and pointers to the Link - * structs in the ECData objects will be updated. - * 6) registerTerm(n) is called on node n in context level Y, - * 7) If n.hasAttribute(ECAttr(), &ecN), then ecN is still around, - * but the predecessor list is not - * - * The above assumes that the code is working correctly. - */ - Assert(ecN->getFirst() == NULL, - "Equivalence class data exists for the node being registered. " - "Expected getFirst() == NULL. " - "This data is either already in use or was not properly maintained " - "during backtracking"); - /*Assert(ecN->getLast() == NULL, - "Equivalence class data exists for the node being registered. " - "Expected getLast() == NULL. " - "This data is either already in use or was not properly maintained " - "during backtracking.");*/ - Assert(ecN->isClassRep(), - "Equivalence class data exists for the node being registered. " - "Expected isClassRep() to be true. " - "This data is either already in use or was not properly maintained " - "during backtracking"); - Assert(ecN->getWatchListSize() == 0, - "Equivalence class data exists for the node being registered. " - "Expected getWatchListSize() == 0. " - "This data is either already in use or was not properly maintained " - "during backtracking"); - } else { - //The attribute does not exist, so it is created and set - ecN = new (true) ECData(getContext(), n); - n.setAttribute(ECAttr(), ecN); - } - - /* If the node is an APPLY_UF, we need to add it to the predecessor list - * of its children. - */ - if(n.getKind() == APPLY_UF) { - TNode::iterator cIter = n.begin(); - - for(; cIter != n.end(); ++cIter) { - TNode child = *cIter; - - /* Because this can be called after nodes have been merged, we need - * to lookup the representative in the UnionFind datastructure. - */ - ECData* ecChild = ccFind(child.getAttribute(ECAttr())); - - /* Because this can be called after nodes have been merged we may need - * to be merged with other predecessors of the equivalence class. - */ - for(Link* Px = ecChild->getFirst(); Px != NULL; Px = Px->d_next ) { - if(equiv(n, Px->d_data)) { - Node pend = n.eqNode(Px->d_data); - d_pending.push_back(pend); - } - } - - ecChild->addPredecessor(n); - } - } - Debug("uf") << "uf: end registerTerm(" << n << ")" << std::endl; - -} - -bool TheoryUFTim::sameCongruenceClass(TNode x, TNode y) { - return - ccFind(x.getAttribute(ECAttr())) == - ccFind(y.getAttribute(ECAttr())); -} - -bool TheoryUFTim::equiv(TNode x, TNode y) { - Assert(x.getKind() == kind::APPLY_UF); - Assert(y.getKind() == kind::APPLY_UF); - - if(x.getNumChildren() != y.getNumChildren()) { - return false; - } - - if(x.getOperator() != y.getOperator()) { - return false; - } - - // intentionally don't look at operator - - TNode::iterator xIter = x.begin(); - TNode::iterator yIter = y.begin(); - - while(xIter != x.end()) { - - if(!sameCongruenceClass(*xIter, *yIter)) { - return false; - } - - ++xIter; - ++yIter; - } - return true; -} - -/* This is a very basic, but *obviously correct* find implementation - * of the classic find algorithm. - * TODO after we have done some more testing: - * 1) Add path compression. This is dependent on changes to ccUnion as - * many better algorithms use eager path compression. - * 2) Elminate recursion. - */ -ECData* TheoryUFTim::ccFind(ECData * x) { - if(x->getFind() == x) { - return x; - } else { - return ccFind(x->getFind()); - } - /* Slightly better Find w/ path compression and no recursion*/ - /* - ECData* start; - ECData* next = x; - while(x != x->getFind()) x=x->getRep(); - while( (start = next) != x) { - next = start->getFind(); - start->setFind(x); - } - return x; - */ -} - -void TheoryUFTim::ccUnion(ECData* ecX, ECData* ecY) { - ECData* nslave; - ECData* nmaster; - - if(ecX->getWatchListSize() <= ecY->getWatchListSize()) { - nslave = ecX; - nmaster = ecY; - } else { - nslave = ecY; - nmaster = ecX; - } - - nslave->setFind(nmaster); - - for(Link* Px = nmaster->getFirst(); Px != NULL; Px = Px->d_next ) { - for(Link* Py = nslave->getFirst(); Py != NULL; Py = Py->d_next ) { - if(equiv(Px->d_data,Py->d_data)) { - Node pendingEq = (Px->d_data).eqNode(Py->d_data); - d_pending.push_back(pendingEq); - } - } - } - - ECData::takeOverDescendantWatchList(nslave, nmaster); -} - -void TheoryUFTim::merge() { - while(d_currentPendingIdx < d_pending.size() ) { - Node assertion = d_pending[d_currentPendingIdx]; - d_currentPendingIdx = d_currentPendingIdx + 1; - - TNode x = assertion[0]; - TNode y = assertion[1]; - - ECData* tmpX = x.getAttribute(ECAttr()); - ECData* tmpY = y.getAttribute(ECAttr()); - - ECData* ecX = ccFind(tmpX); - ECData* ecY = ccFind(tmpY); - if(ecX == ecY) - continue; - - Debug("uf") << "merging equivalence classes for " << std::endl; - Debug("uf") << "left equivalence class :" << (ecX->getRep()) << std::endl; - Debug("uf") << "right equivalence class :" << (ecY->getRep()) << std::endl; - Debug("uf") << std::endl; - - ccUnion(ecX, ecY); - } -} - -Node TheoryUFTim::constructConflict(TNode diseq) { - Debug("uf") << "uf: begin constructConflict()" << std::endl; - - NodeBuilder<> nb(kind::AND); - nb << diseq; - for(unsigned i = 0; i < d_assertions.size(); ++i) { - nb << d_assertions[i]; - } - - Assert(nb.getNumChildren() > 0); - Node conflict = nb.getNumChildren() == 1 ? nb[0] : nb; - - Debug("uf") << "conflict constructed : " << conflict << std::endl; - - Debug("uf") << "uf: ending constructConflict()" << std::endl; - - return conflict; -} - -void TheoryUFTim::check(Effort level) { - - Debug("uf") << "uf: begin check(" << level << ")" << std::endl; - - while(!done()) { - Node assertion = get(); - Debug("uf") << "TheoryUFTim::check(): " << assertion << std::endl; - - switch(assertion.getKind()) { - case EQUAL: - d_assertions.push_back(assertion); - d_pending.push_back(assertion); - merge(); - break; - case NOT: - Assert(assertion[0].getKind() == EQUAL, - "predicates not supported in this UF implementation"); - d_disequality.push_back(assertion[0]); - break; - case APPLY_UF: - Unhandled("predicates not supported in this UF implementation"); - default: - Unhandled(assertion.getKind()); - } - - Debug("uf") << "TheoryUFTim::check(): done = " << (done() ? "true" : "false") << std::endl; - } - - //Make sure all outstanding merges are completed. - if(d_currentPendingIdx < d_pending.size()) { - merge(); - } - - if(standardEffortOrMore(level)) { - for(CDList::const_iterator diseqIter = d_disequality.begin(); - diseqIter != d_disequality.end(); - ++diseqIter) { - - TNode left = (*diseqIter)[0]; - TNode right = (*diseqIter)[1]; - if(sameCongruenceClass(left, right)) { - Node remakeNeq = (*diseqIter).notNode(); - Node conflict = constructConflict(remakeNeq); - d_out->conflict(conflict, false); - return; - } - } - } - - Debug("uf") << "uf: end check(" << level << ")" << std::endl; -} diff --git a/src/theory/uf/tim/theory_uf_tim.h b/src/theory/uf/tim/theory_uf_tim.h deleted file mode 100644 index 70c60728f..000000000 --- a/src/theory/uf/tim/theory_uf_tim.h +++ /dev/null @@ -1,225 +0,0 @@ -/********************* */ -/*! \file theory_uf_tim.h - ** \verbatim - ** Original author: taking - ** Major contributors: mdeters - ** Minor contributors (to current version): none - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 This is a basic implementation of the Theory of Uninterpreted Functions - ** with Equality. - ** - ** This is a basic implementation of the Theory of Uninterpreted Functions - ** with Equality. It is based on the Nelson-Oppen algorithm given in - ** "Fast Decision Procedures Based on Congruence Closure" - ** (http://portal.acm.org/ft_gateway.cfm?id=322198&type=pdf) - ** This has been extended to work in a context-dependent way. - ** This interacts heavily with the data-structures given in ecdata.h . - **/ - -#include "cvc4_private.h" - -#ifndef __CVC4__THEORY__UF__TIM__THEORY_UF_TIM_H -#define __CVC4__THEORY__UF__TIM__THEORY_UF_TIM_H - -#include "expr/node.h" -#include "expr/attribute.h" - -#include "theory/theory.h" - -#include "context/context.h" -#include "context/cdo.h" -#include "context/cdlist.h" -#include "theory/uf/theory_uf.h" -#include "theory/uf/tim/ecdata.h" - -namespace CVC4 { -namespace theory { -namespace uf { -namespace tim { - -class TheoryUFTim : public TheoryUF { - -private: - - /** - * List of all of the non-negated literals from the assertion queue. - * This is used only for conflict generation. - * This differs from pending as the program generates new equalities that - * are not in this list. - * This will probably be phased out in future version. - */ - context::CDList d_assertions; - - /** - * List of pending equivalence class merges. - * - * Tricky part: - * Must keep a hard link because new equality terms are created and appended - * to this list. - */ - context::CDList d_pending; - - /** Index of the next pending equality to merge. */ - context::CDO d_currentPendingIdx; - - /** List of all disequalities this theory has seen. */ - context::CDList d_disequality; - - /** - * List of all of the terms that are registered in the current context. - * When registerTerm is called on a term we want to guarentee that there - * is a hard link to the term for the duration of the context in which - * register term is called. - * This invariant is enough for us to use soft links where we want is the - * current implementation as well as making ECAttr() not context dependent. - * Soft links used both in ECData, and Link. - */ - context::CDList d_registered; - -public: - - /** Constructs a new instance of TheoryUF w.r.t. the provided context.*/ - TheoryUFTim(context::Context* c, OutputChannel& out, Valuation valuation); - - /** Destructor for the TheoryUF object. */ - ~TheoryUFTim(); - - /** - * Registers a previously unseen [in this context] node n. - * For TheoryUF, this sets up and maintains invaraints about - * equivalence class data-structures. - * - * Overloads a void registerTerm(TNode n); from theory.h. - * See theory/theory.h for more information about this method. - */ - void registerTerm(TNode n); - - /** - * Currently this does nothing. - * - * Overloads a void preRegisterTerm(TNode n); from theory.h. - * See theory/theory.h for more information about this method. - */ - void preRegisterTerm(TNode n); - - /** - * Checks whether the set of literals provided to the theory is consistent. - * - * If this is called at any effort level, it computes the congruence closure - * of all of the positive literals in the context. - * - * If this is called at full effort it checks if any of the negative literals - * are inconsistent with the congruence closure. - * - * Overloads void check(Effort level); from theory.h. - * See theory/theory.h for more information about this method. - */ - void check(Effort level); - - void presolve() { - // do nothing - } - - /** - * Propagates theory literals. Currently does nothing. - * - * Overloads void propagate(Effort level); from theory.h. - * See theory/theory.h for more information about this method. - */ - void propagate(Effort level) {} - - /** - * Explains a previously reported conflict. Currently does nothing. - * - * Overloads void explain(TNode n, Effort level); from theory.h. - * See theory/theory.h for more information about this method. - */ - void explain(TNode n) {} - - /** - * Get a theory value. - * - * Overloads Node getValue(TNode n); from theory.h. - * See theory/theory.h for more information about this method. - */ - Node getValue(TNode n) { - Unimplemented("TheoryUFTim doesn't support model generation"); - } - - std::string identify() const { return std::string("TheoryUFTim"); } - -private: - /** - * Checks whether 2 nodes are already in the same equivalence class tree. - * This should only be used internally, and it should only be called when - * the only thing done with the equivalence classes is an equality check. - * - * @returns true iff ccFind(x) == ccFind(y); - */ - bool sameCongruenceClass(TNode x, TNode y); - - /** - * Checks whether Node x and Node y are currently congruent - * using the equivalence class data structures. - * @returns true iff - * |x| = n = |y| and - * x.getOperator() == y.getOperator() and - * forall 1 <= i < n : ccFind(x[i]) == ccFind(y[i]) - */ - bool equiv(TNode x, TNode y); - - /** - * Merges 2 equivalence classes, checks wether any predecessors need to - * be set equal to complete congruence closure. - * The class with the smaller class size will be merged. - * @pre ecX->isClassRep() - * @pre ecY->isClassRep() - */ - void ccUnion(ECData* ecX, ECData* ecY); - - /** - * Returns the representative of the equivalence class. - * May modify the find pointers associated with equivalence classes. - */ - ECData* ccFind(ECData* x); - - /** Performs Congruence Closure to reflect the new additions to d_pending. */ - void merge(); - - /** Constructs a conflict from an inconsistent disequality. */ - Node constructConflict(TNode diseq); - -};/* class TheoryUFTim */ - - -/** - * Cleanup function for ECData. This will be used for called whenever - * a ECAttr is being destructed. - */ -struct ECCleanupStrategy { - static void cleanup(ECData* ec) { - Debug("ufgc") << "cleaning up ECData " << ec << "\n"; - ec->deleteSelf(); - } -};/* struct ECCleanupStrategy */ - -/** Unique name to use for constructing ECAttr. */ -struct ECAttrTag {}; - -/** - * ECAttr is the attribute that maps a node to an equivalence class. - */ -typedef expr::Attribute ECAttr; - -}/* CVC4::theory::uf::tim namespace */ -}/* CVC4::theory::uf namespace */ -}/* CVC4::theory namespace */ -}/* CVC4 namespace */ - -#endif /* __CVC4__THEORY__UF__TIM__THEORY_UF_TIM_H */ diff --git a/src/theory/valuation.cpp b/src/theory/valuation.cpp index 5002c8a59..9375998f9 100644 --- a/src/theory/valuation.cpp +++ b/src/theory/valuation.cpp @@ -2,8 +2,8 @@ /*! \file valuation.cpp ** \verbatim ** Original author: mdeters - ** Major contributors: none - ** Minor contributors (to current version): none + ** Major contributors: taking + ** Minor contributors (to current version): barrett, dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -31,16 +31,12 @@ bool Valuation::isSatLiteral(TNode n) const { return d_engine->getPropEngine()->isSatLiteral(n); } -bool Valuation::hasSatValue(TNode n, bool& value) const { - return d_engine->getPropEngine()->hasValue(n, value); -} - -Node Valuation::getSatValue(TNode n) const{ +Node Valuation::getSatValue(TNode n) const { if(n.getKind() == kind::NOT) { Node atomRes = d_engine->getPropEngine()->getValue(n[0]); - if(atomRes.getKind() == kind::CONST_BOOLEAN){ + if(atomRes.getKind() == kind::CONST_BOOLEAN) { return NodeManager::currentNM()->mkConst(!atomRes.getConst()); - }else{ + } else { Assert(atomRes.isNull()); return atomRes; } @@ -49,5 +45,9 @@ Node Valuation::getSatValue(TNode n) const{ } } +bool Valuation::hasSatValue(TNode n, bool& value) const { + return d_engine->getPropEngine()->hasValue(n, value); +} + }/* CVC4::theory namespace */ }/* CVC4 namespace */ diff --git a/src/theory/valuation.h b/src/theory/valuation.h index 58615f481..f819eff9d 100644 --- a/src/theory/valuation.h +++ b/src/theory/valuation.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: mdeters ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): taking, barrett, dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -57,7 +57,15 @@ public: Node getSatValue(TNode n) const; /** - * Returns true if the node has a sat value. If yes value is set to it's value. + * Returns true if the node has a current SAT assignment. If yes, the + * argument "value" is set to its value. + * + * This is only permitted if n is a theory atom that has an associated + * SAT literal. + * + * @return true if the literal has a current assignment, and returns the + * value in the "value" argument; otherwise false and the "value" + * argument is unmodified. */ bool hasSatValue(TNode n, bool& value) const; diff --git a/src/util/Assert.cpp b/src/util/Assert.cpp index ea0b26248..54d95ced0 100644 --- a/src/util/Assert.cpp +++ b/src/util/Assert.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): acsys ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/Assert.h b/src/util/Assert.h index e38a3f9cf..3334de4a0 100644 --- a/src/util/Assert.h +++ b/src/util/Assert.h @@ -235,9 +235,7 @@ public: #ifdef CVC4_DEBUG -#ifdef CVC4_DEBUG extern CVC4_THREADLOCAL_PUBLIC(const char*) s_debugLastException; -#endif /* CVC4_DEBUG */ /** * Special assertion failure handling in debug mode; in non-debug @@ -259,9 +257,9 @@ void debugAssertionFailed(const AssertionException& thisException, do { \ if(EXPECT_FALSE( ! (cond) )) { \ /* save the last assertion failure */ \ - const char* lastException = s_debugLastException; \ - CVC4::AssertionException exception(#cond, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg); \ - CVC4::debugAssertionFailed(exception, lastException); \ + const char* lastException = ::CVC4::s_debugLastException; \ + ::CVC4::AssertionException exception(#cond, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg); \ + ::CVC4::debugAssertionFailed(exception, lastException); \ } \ } while(0) @@ -271,27 +269,27 @@ void debugAssertionFailed(const AssertionException& thisException, # define AlwaysAssert(cond, msg...) \ do { \ if(EXPECT_FALSE( ! (cond) )) { \ - throw CVC4::AssertionException(#cond, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg); \ + throw ::CVC4::AssertionException(#cond, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg); \ } \ } while(0) #endif /* CVC4_DEBUG */ #define Unreachable(msg...) \ - throw CVC4::UnreachableCodeException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) + throw ::CVC4::UnreachableCodeException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) #define Unhandled(msg...) \ - throw CVC4::UnhandledCaseException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) + throw ::CVC4::UnhandledCaseException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) #define Unimplemented(msg...) \ - throw CVC4::UnimplementedOperationException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) + throw ::CVC4::UnimplementedOperationException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) #define InternalError(msg...) \ - throw CVC4::InternalErrorException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) + throw ::CVC4::InternalErrorException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) #define IllegalArgument(arg, msg...) \ - throw CVC4::IllegalArgumentException(#arg, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) + throw ::CVC4::IllegalArgumentException(#arg, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) #define CheckArgument(cond, arg, msg...) \ AlwaysAssertArgument(cond, arg, ## msg) #define AlwaysAssertArgument(cond, arg, msg...) \ do { \ if(EXPECT_FALSE( ! (cond) )) { \ - throw CVC4::IllegalArgumentException(#cond, #arg, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg); \ + throw ::CVC4::IllegalArgumentException(#cond, #arg, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg); \ } \ } while(0) diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 61ff27c08..f371a4d72 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -8,7 +8,7 @@ noinst_LTLIBRARIES = libutil.la libutilcudd.la # libutilcudd.la is a separate library so that we can pass separate # compiler flags libutilcudd_la_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) @CUDD_CPPFLAGS@ -libutilcudd_la_LIBADD = @CUDD_LDFLAGS@ +libutilcudd_la_LIBADD = @CUDD_LDFLAGS@ @CUDD_LIBS@ # Do not list built sources (like integer.h, rational.h, and tls.h) here! # Rather, list them under BUILT_SOURCES, and their .in versions under diff --git a/src/util/array.h b/src/util/array.h index c00cfdaa3..22605922b 100644 --- a/src/util/array.h +++ b/src/util/array.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/backtrackable.h b/src/util/backtrackable.h index 418172235..c5c6b1399 100644 --- a/src/util/backtrackable.h +++ b/src/util/backtrackable.h @@ -2,10 +2,10 @@ /*! \file backtrackable.h ** \verbatim ** Original author: lianah - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/bitvector.h b/src/util/bitvector.h index ade08164b..f05ebaf17 100644 --- a/src/util/bitvector.h +++ b/src/util/bitvector.h @@ -2,7 +2,7 @@ /*! \file bitvector.h ** \verbatim ** Original author: dejan - ** Major contributors: mdeters, cconway + ** Major contributors: cconway, mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/util/bool.h b/src/util/bool.h index d2a29c8d5..15d46b5d1 100644 --- a/src/util/bool.h +++ b/src/util/bool.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/boolean_simplification.cpp b/src/util/boolean_simplification.cpp index 92534bfd4..862f1e5fc 100644 --- a/src/util/boolean_simplification.cpp +++ b/src/util/boolean_simplification.cpp @@ -1,7 +1,7 @@ /********************* */ /*! \file boolean_simplification.cpp ** \verbatim - ** Original author: taking + ** Original author: mdeters ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. diff --git a/src/util/boolean_simplification.h b/src/util/boolean_simplification.h index c2da8af5b..b3dffa475 100644 --- a/src/util/boolean_simplification.h +++ b/src/util/boolean_simplification.h @@ -2,7 +2,7 @@ /*! \file boolean_simplification.h ** \verbatim ** Original author: taking - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) @@ -197,6 +197,16 @@ public: } } + /** + * Negates an Expr, doing all the double-negation elimination that's + * possible. + * + * @param e the Expr to negate (cannot be the null Expr) + */ + static Expr negate(Expr e) throw(AssertionException) { + return negate(Node::fromExpr(e)).toExpr(); + } + /** * Simplify an OR, AND, or IMPLIES. This function is the identity * for all other kinds. diff --git a/src/util/cardinality.h b/src/util/cardinality.h index e7f86c80e..6985ae38e 100644 --- a/src/util/cardinality.h +++ b/src/util/cardinality.h @@ -22,6 +22,11 @@ #ifndef __CVC4__CARDINALITY_H #define __CVC4__CARDINALITY_H +#if SWIG +%include "util/integer.h" +%include "util/Assert.h" +#endif /* SWIG */ + #include #include @@ -140,6 +145,11 @@ public: return d_card > 0; } + /** Returns true iff this cardinality is infinite. */ + bool isInfinite() const throw() { + return d_card < 0; + } + /** * Returns true iff this cardinality is finite or countably * infinite. diff --git a/src/util/configuration.cpp b/src/util/configuration.cpp index aa3e6bf6b..c13b63e3f 100644 --- a/src/util/configuration.cpp +++ b/src/util/configuration.cpp @@ -49,6 +49,10 @@ bool Configuration::isTracingBuild() { return IS_TRACING_BUILD; } +bool Configuration::isDumpingBuild() { + return IS_DUMPING_BUILD; +} + bool Configuration::isMuzzledBuild() { return IS_MUZZLED_BUILD; } @@ -89,7 +93,11 @@ unsigned Configuration::getVersionRelease() { return CVC4_RELEASE; } -string Configuration::about() { +std::string Configuration::getVersionExtra() { + return CVC4_EXTRAVERSION; +} + +std::string Configuration::about() { return CVC4_ABOUT_STRING; } diff --git a/src/util/configuration.h b/src/util/configuration.h index 31a2ca3d4..cb207298c 100644 --- a/src/util/configuration.h +++ b/src/util/configuration.h @@ -53,6 +53,8 @@ public: static bool isTracingBuild(); + static bool isDumpingBuild(); + static bool isMuzzledBuild(); static bool isAssertionBuild(); @@ -73,6 +75,8 @@ public: static unsigned getVersionRelease(); + static std::string getVersionExtra(); + static std::string about(); static bool isBuiltWithGmp(); diff --git a/src/util/configuration_private.h b/src/util/configuration_private.h index 0421273ca..13347d970 100644 --- a/src/util/configuration_private.h +++ b/src/util/configuration_private.h @@ -49,6 +49,12 @@ namespace CVC4 { # define IS_TRACING_BUILD false #endif /* CVC4_TRACING */ +#ifdef CVC4_DUMPING +# define IS_DUMPING_BUILD true +#else /* CVC4_DUMPING */ +# define IS_DUMPING_BUILD false +#endif /* CVC4_DUMPING */ + #ifdef CVC4_MUZZLE # define IS_MUZZLED_BUILD true #else /* CVC4_MUZZLE */ diff --git a/src/util/congruence_closure.cpp b/src/util/congruence_closure.cpp index 9ce902b2a..14315ac5a 100644 --- a/src/util/congruence_closure.cpp +++ b/src/util/congruence_closure.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/congruence_closure.h b/src/util/congruence_closure.h index 83f6d15c0..4e690ec16 100644 --- a/src/util/congruence_closure.h +++ b/src/util/congruence_closure.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -34,7 +34,7 @@ #include "context/cdset.h" #include "context/cdlist_context_memory.h" #include "util/exception.h" -#include "theory/uf/morgan/stacking_map.h" +#include "context/stacking_map.h" #include "util/stats.h" namespace CVC4 { @@ -66,11 +66,11 @@ struct CongruenceOperator { typedef Tail_ Tail; };/* class CongruenceOperator<> */ -#define CONGRUENCE_OPERATORS_1(kind1) CongruenceOperator -#define CONGRUENCE_OPERATORS_2(kind1, kind2) CongruenceOperator -#define CONGRUENCE_OPERATORS_3(kind1, kind2, kind3) CongruenceOperator -#define CONGRUENCE_OPERATORS_4(kind1, kind2, kind3, kind4) CongruenceOperator -#define CONGRUENCE_OPERATORS_5(kind1, kind2, kind3, kind4, kind5) CongruenceOperator +#define CONGRUENCE_OPERATORS_1(kind1) ::CVC4::CongruenceOperator +#define CONGRUENCE_OPERATORS_2(kind1, kind2) ::CVC4::CongruenceOperator +#define CONGRUENCE_OPERATORS_3(kind1, kind2, kind3) ::CVC4::CongruenceOperator +#define CONGRUENCE_OPERATORS_4(kind1, kind2, kind3, kind4) ::CVC4::CongruenceOperator +#define CONGRUENCE_OPERATORS_5(kind1, kind2, kind3, kind4, kind5) ::CVC4::CongruenceOperator /** * Returns true if the kind k is registered as a congruence operator @@ -139,7 +139,7 @@ class CongruenceClosure { OutputChannel* d_out; // typedef all of these so that iterators are easy to define - typedef theory::uf::morgan::StackingMap RepresentativeMap; + typedef context::StackingMap RepresentativeMap; typedef context::CDList > ClassList; typedef context::CDMap ClassLists; typedef context::CDList > UseList; @@ -270,6 +270,7 @@ private: if(i == d_eqMap.end()) { ++d_newSkolemVars; Node v = NodeManager::currentNM()->mkSkolem(t.getType()); + Debug("cc") << "CC made skolem " << v << std::endl; addEq(NodeManager::currentNM()->mkNode(t.getType().isBoolean() ? kind::IFF : kind::EQUAL, t, v), TNode::null()); d_added.insert(v); d_eqMap[t] = v; @@ -333,7 +334,7 @@ private: * Find the EC representative for a term t in the current context. */ inline TNode find(TNode t) const throw(AssertionException) { - TNode rep1 = d_representative.find(t); + TNode rep1 = d_representative[t]; return rep1.isNull() ? t : rep1; } @@ -1088,7 +1089,6 @@ std::ostream& operator<<(std::ostream& out, return out; } - }/* CVC4 namespace */ #endif /* __CVC4__UTIL__CONGRUENCE_CLOSURE_H */ diff --git a/src/util/datatype.cpp b/src/util/datatype.cpp index 926f31847..93651f1a9 100644 --- a/src/util/datatype.cpp +++ b/src/util/datatype.cpp @@ -2,7 +2,7 @@ /*! \file datatype.cpp ** \verbatim ** Original author: mdeters - ** Major contributors: none + ** Major contributors: ajreynol ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/util/datatype.h b/src/util/datatype.h index 477b16f66..c64f420dd 100644 --- a/src/util/datatype.h +++ b/src/util/datatype.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: mdeters ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/src/util/debug.h b/src/util/debug.h index 402c5bed4..ad2dbc2dd 100644 --- a/src/util/debug.h +++ b/src/util/debug.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/decision_engine.cpp b/src/util/decision_engine.cpp index 7641472f8..46807b1f9 100644 --- a/src/util/decision_engine.cpp +++ b/src/util/decision_engine.cpp @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/decision_engine.h b/src/util/decision_engine.h index 3eee8aeb6..1c2bd3ef7 100644 --- a/src/util/decision_engine.h +++ b/src/util/decision_engine.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/dynamic_array.h b/src/util/dynamic_array.h index c0a8cf260..2c8b842e4 100644 --- a/src/util/dynamic_array.h +++ b/src/util/dynamic_array.h @@ -2,10 +2,10 @@ /*! \file dynamic_array.h ** \verbatim ** Original author: taking - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -17,11 +17,10 @@ ** \todo document this file **/ - #include "cvc4_private.h" -#ifndef __CVC4__UTIL__DYNAMICARRAY_H -#define __CVC4__UTIL__DYNAMICARRAY_H +#ifndef __CVC4__UTIL__DYNAMIC_ARRAY_H +#define __CVC4__UTIL__DYNAMIC_ARRAY_H #include "util/Assert.h" @@ -29,14 +28,14 @@ namespace CVC4 { template class DynamicArray { -private: +protected: T* d_arr; unsigned d_size; unsigned d_allocated; bool d_callDestructor; - void grow(){ + void grow() { bool empty = (d_arr == NULL); d_allocated = empty ? 15 : d_allocated * 2 + 1; unsigned allocSize = sizeof(T) * d_allocated; @@ -48,14 +47,14 @@ private: } public: - DynamicArray(bool deallocate = false): + DynamicArray(bool callDestructor = false) : d_arr(NULL), d_size(0), d_allocated(0), - d_callDestructor(deallocate){ + d_callDestructor(callDestructor) { } - ~DynamicArray(){ + virtual ~DynamicArray() { if(d_callDestructor) { for(unsigned i = 0; i < d_size; ++i) { d_arr[i].~T(); @@ -83,12 +82,17 @@ public: ++d_size; } + const T& operator[](unsigned i) const { + Assert(i < d_size, "index out of bounds in DynamicArray::operator[]"); + return d_arr[i]; + } + T& operator[](unsigned i) { Assert(i < d_size, "index out of bounds in DynamicArray::operator[]"); return d_arr[i]; } - const T& back() const{ + const T& back() const { Assert(d_size > 0, "DynamicArray::back() called on empty list"); return d_arr[d_size - 1]; } @@ -96,12 +100,53 @@ public: void pop_back() { Assert(d_size > 0, "DynamicArray::back() called on empty list"); --d_size; - if(d_callDestructor){ - d_arr[d_size].~T();; + if(d_callDestructor) { + d_arr[d_size].~T(); + } + } + + typedef T* iterator; + typedef const T* const_iterator; + + iterator begin() { return d_arr; } + iterator end() { return d_arr + d_size; } + const_iterator begin() const { return d_arr; } + const_iterator end() const { return d_arr + d_size; } + +};/* class DynamicArray */ + +template +class DynamicGrowingArray : public DynamicArray { + Ctor d_ctor; + +public: + DynamicGrowingArray(bool callDestructor, const Ctor& c) : + DynamicArray(callDestructor), + d_ctor(c) { + } + + DynamicGrowingArray(bool callDestructor = false) : + DynamicArray(callDestructor), + d_ctor() { + } + + T& operator[](unsigned i) { + while(this->d_allocated <= i) { + this->grow(); + } + while(this->d_size <= i) { + ::new((void*)(this->d_arr + this->d_size)) T(d_ctor); + ++this->d_size; } + return this->d_arr[i]; + } + + const T& operator[](unsigned i) const { + Assert(this->d_size > i); + return this->d_arr[i]; } -};/* CVC4::DynamicArray */ +};/* CVC4::DynamicGrowingArray */ }/* CVC4 namespace */ -#endif /* __CVC4__UTIL__DYNAMICARRAY_H */ +#endif /* __CVC4__UTIL__DYNAMIC_ARRAY_H */ diff --git a/src/util/gmp_util.h b/src/util/gmp_util.h index 87102e644..7d2badbfe 100644 --- a/src/util/gmp_util.h +++ b/src/util/gmp_util.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): taking ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/hash.h b/src/util/hash.h index cca60ce76..10211970f 100644 --- a/src/util/hash.h +++ b/src/util/hash.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): taking ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/integer.h.in b/src/util/integer.h.in index 7e1b9a1aa..b2973081d 100644 --- a/src/util/integer.h.in +++ b/src/util/integer.h.in @@ -11,7 +11,7 @@ ** See the file COPYING in the top-level source directory for licensing ** information.\endverbatim ** - ** \brief A multiprecision integer constant. + ** \brief A multiprecision integer constant ** ** A multiprecision integer constant. **/ @@ -26,8 +26,14 @@ #ifdef CVC4_CLN_IMP # include "util/integer_cln_imp.h" +# if SWIG + %include "util/integer_cln_imp.h" +# endif /* SWIG */ #endif /* CVC4_CLN_IMP */ #ifdef CVC4_GMP_IMP # include "util/integer_gmp_imp.h" +# if SWIG + %include "util/integer_gmp_imp.h" +# endif /* SWIG */ #endif /* CVC4_GMP_IMP */ diff --git a/src/util/integer_cln_imp.h b/src/util/integer_cln_imp.h index 664027cdc..a7de8c75e 100644 --- a/src/util/integer_cln_imp.h +++ b/src/util/integer_cln_imp.h @@ -2,10 +2,10 @@ /*! \file integer_cln_imp.h ** \verbatim ** Original author: taking - ** Major contributors: none - ** Minor contributors (to current version): mdeters, dejan + ** Major contributors: mdeters + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h index 60cee3937..237114d24 100644 --- a/src/util/integer_gmp_imp.h +++ b/src/util/integer_gmp_imp.h @@ -2,10 +2,10 @@ /*! \file integer_gmp_imp.h ** \verbatim ** Original author: taking - ** Major contributors: none - ** Minor contributors (to current version): dejan, mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/ite_removal.cpp b/src/util/ite_removal.cpp index e9c5122b3..bd5048040 100644 --- a/src/util/ite_removal.cpp +++ b/src/util/ite_removal.cpp @@ -2,7 +2,7 @@ /*! \file ite_removal.cpp ** \verbatim ** Original author: dejan - ** Major contributors: none + ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) @@ -11,20 +11,22 @@ ** See the file COPYING in the top-level source directory for licensing ** information.\endverbatim ** - ** \brief Representation of cardinality + ** \brief Removal of term ITEs ** - ** Simple class to represent a cardinality; used by the CVC4 type system - ** give the cardinality of sorts. + ** Removal of term ITEs. **/ #include #include "util/ite_removal.h" #include "theory/rewriter.h" +#include "expr/command.h" using namespace CVC4; using namespace std; +namespace CVC4 { + struct IteRewriteAttrTag {}; typedef expr::Attribute IteRewriteAttr; @@ -34,8 +36,7 @@ void RemoveITE::run(std::vector& output) { } } -Node RemoveITE::run(TNode node, std::vector& output) -{ +Node RemoveITE::run(TNode node, std::vector& output) { // Current node Debug("ite") << "removeITEs(" << node << ")" << endl; @@ -54,8 +55,18 @@ Node RemoveITE::run(TNode node, std::vector& output) // Make the skolem to represent the ITE Node skolem = nodeManager->mkVar(nodeType); + if(Dump.isOn("declarations")) { + stringstream kss; + kss << Expr::setlanguage(Expr::setlanguage::getLanguage(Dump("declarations"))) << skolem; + string ks = kss.str(); + Dump("declarations") << CommentCommand(ks + " is a variable introduced due to term-level ITE removal") << endl + << DeclareFunctionCommand(ks, nodeType.toType()) << endl; + } + // The new assertion - Node newAssertion = nodeManager->mkNode(kind::ITE, node[0], skolem.eqNode(node[1]), skolem.eqNode(node[2])); + Node newAssertion = + nodeManager->mkNode(kind::ITE, node[0], skolem.eqNode(node[1]), + skolem.eqNode(node[2])); Debug("ite") << "removeITEs(" << node << ") => " << newAssertion << endl; // Attach the skolem @@ -91,4 +102,6 @@ Node RemoveITE::run(TNode node, std::vector& output) nodeManager->setAttribute(node, IteRewriteAttr(), Node::null()); return node; } -}; +} + +}/* CVC4 namespace */ diff --git a/src/util/ite_removal.h b/src/util/ite_removal.h index b286665cc..d68c6d933 100644 --- a/src/util/ite_removal.h +++ b/src/util/ite_removal.h @@ -1,9 +1,9 @@ /********************* */ /*! \file ite_removal.h ** \verbatim - ** Original author: mdeters + ** Original author: dejan ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -11,10 +11,9 @@ ** See the file COPYING in the top-level source directory for licensing ** information.\endverbatim ** - ** \brief Representation of cardinality + ** \brief Removal of term ITEs ** - ** Simple class to represent a cardinality; used by the CVC4 type system - ** give the cardinality of sorts. + ** Removal of term ITEs. **/ #pragma once @@ -38,7 +37,6 @@ public: */ static Node run(TNode node, std::vector& additionalAssertions); -}; +};/* class RemoveTTE */ - -} +}/* CVC4 namespace */ diff --git a/src/util/language.h b/src/util/language.h index dbda6a315..d3405e35b 100644 --- a/src/util/language.h +++ b/src/util/language.h @@ -86,6 +86,9 @@ namespace output { enum CVC4_PUBLIC Language { // SPECIAL "NON-LANGUAGE" LANGUAGES HAVE ENUM VALUE < 0 + /** Match the output language to the input language */ + LANG_AUTO = -1, + // COMMON INPUT AND OUTPUT LANGUAGES HAVE ENUM VALUES IN [0,9] // AND SHOULD CORRESPOND IN PLACEMENT WITH INPUTLANGUAGE // diff --git a/src/util/matcher.h b/src/util/matcher.h index 5dc511bc2..6daceb8fd 100644 --- a/src/util/matcher.h +++ b/src/util/matcher.h @@ -1,8 +1,8 @@ /********************* */ /*! \file matcher.h ** \verbatim - ** Original author: ajreynol - ** Major contributors: none + ** Original author: mdeters + ** Major contributors: ajreynol ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) diff --git a/src/util/ntuple.h b/src/util/ntuple.h index 4c9a033a1..4f8b73945 100644 --- a/src/util/ntuple.h +++ b/src/util/ntuple.h @@ -30,6 +30,11 @@ public: T1 first; T2 second; T3 third; + triple(const T1& t1, const T2& t2, const T3& t3) : + first(t1), + second(t2), + third(t3) { + } };/* class triple<> */ template @@ -45,9 +50,12 @@ public: T2 second; T3 third; T4 fourth; - quad(const T1& t1, const T2& t2, const T3& t3, const T4& t4) - : first(t1), second(t2), third(t3), fourth(t4) - { } + quad(const T1& t1, const T2& t2, const T3& t3, const T4& t4) : + first(t1), + second(t2), + third(t3), + fourth(t4) { + } };/* class quad<> */ template diff --git a/src/util/options.cpp b/src/util/options.cpp index 9bceee931..7e6011352 100644 --- a/src/util/options.cpp +++ b/src/util/options.cpp @@ -2,7 +2,7 @@ /*! \file options.cpp ** \verbatim ** Original author: mdeters - ** Major contributors: taking, cconway + ** Major contributors: cconway, taking ** Minor contributors (to current version): barrett, dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) @@ -62,15 +62,16 @@ Options::Options() : err(&std::cerr), verbosity(0), inputLanguage(language::input::LANG_AUTO), - uf_implementation(MORGAN), + outputLanguage(language::output::LANG_AUTO), parseOnly(false), + preprocessOnly(false), semanticChecks(DO_SEMANTIC_CHECKS_BY_DEFAULT), theoryRegistration(true), memoryMap(false), strictParsing(false), lazyDefinitionExpansion(false), simplificationMode(SIMPLIFICATION_MODE_BATCH), - simplificationStyle(NO_SIMPLIFICATION_STYLE), + doStaticLearning(true), interactive(false), interactiveSetByUser(false), segvNoSpin(false), @@ -95,10 +96,13 @@ Options::Options() : static const string optionsDescription = "\ --lang | -L force input language (default is `auto'; see --lang help)\n\ + --output-lang force output language (default is `auto'; see --lang help)\n\ --version | -V identify this CVC4 binary\n\ --help | -h this command line reference\n\ --parse-only exit after parsing input\n\ - --preprocess-only exit after parsing preprocessing input (and dump preprocessed assertions, unless -q)\n\ + --preprocess-only exit after preprocessing (useful with --stats or --dump)\n\ + --dump=MODE dump preprocessed assertions, T-propagations, etc., see --dump=help\n\ + --dump-to=FILE all dumping goes to FILE (instead of stdout)\n\ --mmap memory map file input\n\ --show-config show CVC4 static configuration\n\ --segv-nospin don't spin on segfault waiting for gdb\n\ @@ -115,13 +119,13 @@ static const string optionsDescription = "\ --stats give statistics on exit\n\ --default-expr-depth=N print exprs to depth N (0 == default, -1 == no limit)\n\ --print-expr-types print types with variables when printing exprs\n\ - --uf=morgan|tim select uninterpreted function theory implementation\n\ --interactive run interactively\n\ --no-interactive do not run interactively\n\ --produce-models support the get-value command\n\ --produce-assignments support the get-assignment command\n\ --lazy-definition-expansion expand define-fun lazily\n\ --simplification=MODE choose simplification mode, see --simplification=help\n\ + --no-static-learning turn off static learning (e.g. diamond-breaking)\n\ --replay=file replay decisions from file\n\ --replay-log=file log decisions and propagations to file\n\ --pivot-rule=RULE change the pivot rule (see --pivot-rule help)\n\ @@ -140,6 +144,13 @@ Languages currently supported as arguments to the -L / --lang option:\n\ pl | cvc4 CVC4 presentation language\n\ smt | smtlib SMT-LIB format 1.2\n\ smt2 | smtlib2 SMT-LIB format 2.0\n\ +\n\ +Languages currently supported as arguments to the --output-lang option:\n\ + auto match the output language to the input language\n\ + pl | cvc4 CVC4 presentation language\n\ + smt | smtlib SMT-LIB format 1.2\n\ + smt2 | smtlib2 SMT-LIB format 2.0\n\ + ast internal format (simple syntax-tree language)\n\ "; static const string simplificationHelp = "\ @@ -154,18 +165,74 @@ incremental\n\ + run nonclausal simplification and clausal propagation at each ASSERT\n\ (and at CHECKSAT/QUERY/SUBTYPE)\n\ \n\ -You can also specify the level of aggressiveness for the simplification\n\ -(by repeating the --simplification option):\n\ +none\n\ ++ do not perform nonclausal simplification\n\ +"; + +static const string dumpHelp = "\ +Dump modes currently supported by the --dump option:\n\ \n\ -toplevel (default)\n\ -+ apply toplevel simplifications (things known true/false at outer level\n\ - only)\n\ +benchmark\n\ ++ Dump the benchmark structure (set-logic, push/pop, queries, etc.), but\n\ + does not include any declarations or assertions. Implied by all following\n\ + modes.\n\ \n\ -aggressive\n\ -+ do aggressive, local simplification across the entire formula\n\ +declarations\n\ ++ Dump declarations. Implied by all following modes.\n\ \n\ -none\n\ -+ do not perform nonclausal simplification\n\ +assertions\n\ ++ Output the assertions after non-clausal simplification and static\n\ + learning phases, but before presolve-time T-lemmas arrive. If\n\ + non-clausal simplification and static learning are off\n\ + (--simplification=none --no-static-learning), the output\n\ + will closely resemble the input (with term-level ITEs removed).\n\ +\n\ +learned\n\ ++ Output the assertions after non-clausal simplification, static\n\ + learning, and presolve-time T-lemmas. This should include all eager\n\ + T-lemmas (in the form provided by the theory, which my or may not be\n\ + clausal). Also includes level-0 BCP done by Minisat.\n\ +\n\ +clauses\n\ ++ Do all the preprocessing outlined above, and dump the CNF-converted\n\ + output\n\ +\n\ +state\n\ ++ Dump all contextual assertions (e.g., SAT decisions, propagations..).\n\ + Implied by all \"stateful\" modes below and conflicts with all\n\ + non-stateful modes below.\n\ +\n\ +t-conflicts [non-stateful]\n\ ++ Output correctness queries for all theory conflicts\n\ +\n\ +missed-t-conflicts [stateful]\n\ ++ Output completeness queries for theory conflicts\n\ +\n\ +t-propagations [stateful]\n\ ++ Output correctness queries for all theory propagations\n\ +\n\ +missed-t-propagations [stateful]\n\ ++ Output completeness queries for theory propagations (LARGE and EXPENSIVE)\n\ +\n\ +t-lemmas [non-stateful]\n\ ++ Output correctness queries for all theory lemmas\n\ +\n\ +t-explanations [non-stateful]\n\ ++ Output correctness queries for all theory explanations\n\ +\n\ +Dump modes can be combined with multiple uses of --dump. Generally you want\n\ +one from the assertions category (either asertions, learned, or clauses), and\n\ +perhaps one or more stateful or non-stateful modes for checking correctness\n\ +and completeness of decision procedure implementations. Stateful modes dump\n\ +the contextual assertions made by the core solver (all decisions and propagations\n\ +as assertions; that affects the validity of the resulting correctness and\n\ +completeness queries, so of course stateful and non-stateful modes cannot\n\ +be mixed in the same run.\n\ +\n\ +The --output-language option controls the language used for dumping, and\n\ +this allows you to connect CVC4 to another solver implementation via a UNIX\n\ +pipe to perform on-line checking. The --dump-to option can be used to dump\n\ +to a file.\n\ "; string Options::getDescription() const { @@ -192,8 +259,11 @@ enum OptionValue { SMTCOMP = 256, /* avoid clashing with char options */ STATS, SEGV_NOSPIN, + OUTPUT_LANGUAGE, PARSE_ONLY, PREPROCESS_ONLY, + DUMP, + DUMP_TO, NO_CHECKING, NO_THEORY_REGISTRATION, USE_MMAP, @@ -204,6 +274,7 @@ enum OptionValue { UF_THEORY, LAZY_DEFINITION_EXPANSION, SIMPLIFICATION_MODE, + NO_STATIC_LEARNING, INTERACTIVE, NO_INTERACTIVE, PRODUCE_MODELS, @@ -263,8 +334,11 @@ static struct option cmdlineOptions[] = { { "version" , no_argument , NULL, 'V' }, { "about" , no_argument , NULL, 'V' }, { "lang" , required_argument, NULL, 'L' }, + { "output-lang", required_argument, NULL, OUTPUT_LANGUAGE }, { "parse-only" , no_argument , NULL, PARSE_ONLY }, - { "preprocess-only", no_argument , NULL, PREPROCESS_ONLY }, + { "preprocess-only", no_argument , NULL, PREPROCESS_ONLY }, + { "dump" , required_argument, NULL, DUMP }, + { "dump-to" , required_argument, NULL, DUMP_TO }, { "mmap" , no_argument , NULL, USE_MMAP }, { "strict-parsing", no_argument , NULL, STRICT_PARSING }, { "default-expr-depth", required_argument, NULL, DEFAULT_EXPR_DEPTH }, @@ -272,6 +346,7 @@ static struct option cmdlineOptions[] = { { "uf" , required_argument, NULL, UF_THEORY }, { "lazy-definition-expansion", no_argument, NULL, LAZY_DEFINITION_EXPANSION }, { "simplification", required_argument, NULL, SIMPLIFICATION_MODE }, + { "no-static-learning", no_argument, NULL, NO_STATIC_LEARNING }, { "interactive", no_argument , NULL, INTERACTIVE }, { "no-interactive", no_argument , NULL, NO_INTERACTIVE }, { "produce-models", no_argument , NULL, PRODUCE_MODELS }, @@ -371,6 +446,32 @@ throw(OptionException) { languageHelp = true; break; + case OUTPUT_LANGUAGE: + if(!strcmp(optarg, "cvc4") || !strcmp(optarg, "pl")) { + outputLanguage = language::output::LANG_CVC4; + break; + } else if(!strcmp(optarg, "smtlib") || !strcmp(optarg, "smt")) { + outputLanguage = language::output::LANG_SMTLIB; + break; + } else if(!strcmp(optarg, "smtlib2") || !strcmp(optarg, "smt2")) { + outputLanguage = language::output::LANG_SMTLIB_V2; + break; + } else if(!strcmp(optarg, "ast")) { + outputLanguage = language::output::LANG_AST; + break; + } else if(!strcmp(optarg, "auto")) { + outputLanguage = language::output::LANG_AUTO; + break; + } + + if(strcmp(optarg, "help")) { + throw OptionException(string("unknown language for --output-lang: `") + + optarg + "'. Try --output-lang help."); + } + + languageHelp = true; + break; + case 't': Trace.on(optarg); break; @@ -396,6 +497,87 @@ throw(OptionException) { preprocessOnly = true; break; + case DUMP: { +#ifdef CVC4_DUMPING + char* tokstr = optarg; + char* toksave; + while((optarg = strtok_r(tokstr, ",", &toksave)) != NULL) { + tokstr = NULL; + if(!strcmp(optarg, "benchmark")) { + } else if(!strcmp(optarg, "declarations")) { + } else if(!strcmp(optarg, "assertions")) { + } else if(!strcmp(optarg, "learned")) { + } else if(!strcmp(optarg, "clauses")) { + } else if(!strcmp(optarg, "t-conflicts") || + !strcmp(optarg, "t-lemmas") || + !strcmp(optarg, "t-explanations")) { + // These are "non-state-dumping" modes. If state (SAT decisions, + // propagations, etc.) is dumped, it will interfere with the validity + // of these generated queries. + if(Dump.isOn("state")) { + throw OptionException(string("dump option `") + optarg + + "' conflicts with a previous, " + "state-dumping dump option. You cannot " + "mix stateful and non-stateful dumping modes; " + "see --dump help."); + } else { + Dump.on("no-permit-state"); + } + } else if(!strcmp(optarg, "state") || + !strcmp(optarg, "missed-t-conflicts") || + !strcmp(optarg, "t-propagations") || + !strcmp(optarg, "missed-t-propagations")) { + // These are "state-dumping" modes. If state (SAT decisions, + // propagations, etc.) is not dumped, it will interfere with the + // validity of these generated queries. + if(Dump.isOn("no-permit-state")) { + throw OptionException(string("dump option `") + optarg + + "' conflicts with a previous, " + "non-state-dumping dump option. You cannot " + "mix stateful and non-stateful dumping modes; " + "see --dump help."); + } else { + Dump.on("state"); + } + } else if(!strcmp(optarg, "help")) { + puts(dumpHelp.c_str()); + exit(1); + } else { + throw OptionException(string("unknown option for --dump: `") + + optarg + "'. Try --dump help."); + } + + Dump.on(optarg); + Dump.on("benchmark"); + if(strcmp(optarg, "benchmark")) { + Dump.on("declarations"); + } + } +#else /* CVC4_DUMPING */ + throw OptionException("The dumping feature was disabled in this build of CVC4."); +#endif /* CVC4_DUMPING */ + break; + } + + case DUMP_TO: { +#ifdef CVC4_DUMPING + if(optarg == NULL || *optarg == '\0') { + throw OptionException(string("Bad file name for --dump-to")); + } else if(!strcmp(optarg, "-")) { + Dump.setStream(DumpC::dump_cout); + } else { + ostream* dumpTo = new ofstream(optarg, ofstream::out | ofstream::trunc); + if(!*dumpTo) { + throw OptionException(string("Cannot open dump-to file (maybe it exists): `") + optarg + "'"); + } + Dump.setStream(*dumpTo); + } +#else /* CVC4_DUMPING */ + throw OptionException("The dumping feature was disabled in this build of CVC4."); +#endif /* CVC4_DUMPING */ + } + break; + case NO_THEORY_REGISTRATION: theoryRegistration = false; break; @@ -437,24 +619,6 @@ throw(OptionException) { } break; - case UF_THEORY: - { - if(!strcmp(optarg, "tim")) { - uf_implementation = Options::TIM; - } else if(!strcmp(optarg, "morgan")) { - uf_implementation = Options::MORGAN; - } else if(!strcmp(optarg, "help")) { - printf("UF implementations available:\n"); - printf(" tim\n"); - printf(" morgan\n"); - exit(1); - } else { - throw OptionException(string("unknown option for --uf: `") + - optarg + "'. Try --uf help."); - } - } - break; - case LAZY_DEFINITION_EXPANSION: lazyDefinitionExpansion = true; break; @@ -464,12 +628,8 @@ throw(OptionException) { simplificationMode = SIMPLIFICATION_MODE_BATCH; } else if(!strcmp(optarg, "incremental")) { simplificationMode = SIMPLIFICATION_MODE_INCREMENTAL; - } else if(!strcmp(optarg, "aggressive")) { - simplificationStyle = AGGRESSIVE_SIMPLIFICATION_STYLE; - } else if(!strcmp(optarg, "toplevel")) { - simplificationStyle = TOPLEVEL_SIMPLIFICATION_STYLE; } else if(!strcmp(optarg, "none")) { - simplificationStyle = NO_SIMPLIFICATION_STYLE; + simplificationMode = SIMPLIFICATION_MODE_NONE; } else if(!strcmp(optarg, "help")) { puts(simplificationHelp.c_str()); exit(1); @@ -479,6 +639,10 @@ throw(OptionException) { } break; + case NO_STATIC_LEARNING: + doStaticLearning = false; + break; + case INTERACTIVE: interactive = true; interactiveSetByUser = true; @@ -622,6 +786,7 @@ throw(OptionException) { printf("statistics : %s\n", Configuration::isStatisticsBuild() ? "yes" : "no"); printf("replay : %s\n", Configuration::isReplayBuild() ? "yes" : "no"); printf("tracing : %s\n", Configuration::isTracingBuild() ? "yes" : "no"); + printf("dumping : %s\n", Configuration::isDumpingBuild() ? "yes" : "no"); printf("muzzled : %s\n", Configuration::isMuzzledBuild() ? "yes" : "no"); printf("assertions : %s\n", Configuration::isAssertionBuild() ? "yes" : "no"); printf("coverage : %s\n", Configuration::isCoverageBuild() ? "yes" : "no"); diff --git a/src/util/options.h b/src/util/options.h index ce2bc71e7..c4e115b08 100644 --- a/src/util/options.h +++ b/src/util/options.h @@ -2,8 +2,8 @@ /*! \file options.h ** \verbatim ** Original author: mdeters - ** Major contributors: cconway - ** Minor contributors (to current version): dejan, taking + ** Major contributors: taking, cconway + ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -71,11 +71,8 @@ struct CVC4_PUBLIC Options { /** The input language */ InputLanguage inputLanguage; - /** Enumeration of UF implementation choices */ - typedef enum { TIM, MORGAN } UfImplementation; - - /** Which implementation of uninterpreted function theory to use */ - UfImplementation uf_implementation; + /** The output language */ + OutputLanguage outputLanguage; /** Should we print the help message? */ bool help; @@ -112,21 +109,16 @@ struct CVC4_PUBLIC Options { /** Simplify the assertions as they come in */ SIMPLIFICATION_MODE_INCREMENTAL, /** Simplify the assertions all together once a check is requested */ - SIMPLIFICATION_MODE_BATCH + SIMPLIFICATION_MODE_BATCH, + /** Don't do simplification */ + SIMPLIFICATION_MODE_NONE } SimplificationMode; - /** When to perform nonclausal simplifications. */ + /** When/whether to perform nonclausal simplifications. */ SimplificationMode simplificationMode; - /** Enumeration of simplification styles (how much to simplify). */ - typedef enum { - AGGRESSIVE_SIMPLIFICATION_STYLE, - TOPLEVEL_SIMPLIFICATION_STYLE, - NO_SIMPLIFICATION_STYLE - } SimplificationStyle; - - /** Style of nonclausal simplifications to perform. */ - SimplificationStyle simplificationStyle; + /** Whether to perform the static learning pass. */ + bool doStaticLearning; /** Whether we're in interactive mode or not */ bool interactive; @@ -228,35 +220,19 @@ struct CVC4_PUBLIC Options { throw(OptionException); };/* struct Options */ -inline std::ostream& operator<<(std::ostream& out, - Options::UfImplementation uf) CVC4_PUBLIC; - -inline std::ostream& operator<<(std::ostream& out, - Options::UfImplementation uf) { - switch(uf) { - case Options::TIM: - out << "TIM"; - break; - case Options::MORGAN: - out << "MORGAN"; - break; - default: - out << "UfImplementation:UNKNOWN![" << unsigned(uf) << "]"; - } - - return out; -} - inline std::ostream& operator<<(std::ostream& out, Options::SimplificationMode mode) CVC4_PUBLIC; inline std::ostream& operator<<(std::ostream& out, Options::SimplificationMode mode) { switch(mode) { + case Options::SIMPLIFICATION_MODE_INCREMENTAL: + out << "SIMPLIFICATION_MODE_INCREMENTAL"; + break; case Options::SIMPLIFICATION_MODE_BATCH: out << "SIMPLIFICATION_MODE_BATCH"; break; - case Options::SIMPLIFICATION_MODE_INCREMENTAL: - out << "SIMPLIFICATION_MODE_INCREMENTAL"; + case Options::SIMPLIFICATION_MODE_NONE: + out << "SIMPLIFICATION_MODE_NONE"; break; default: out << "SimplificationMode:UNKNOWN![" << unsigned(mode) << "]"; diff --git a/src/util/output.cpp b/src/util/output.cpp index 29de4c360..3823f7be6 100644 --- a/src/util/output.cpp +++ b/src/util/output.cpp @@ -40,6 +40,8 @@ MessageC MessageChannel CVC4_PUBLIC (&cout); NoticeC NoticeChannel CVC4_PUBLIC (&cout); ChatC ChatChannel CVC4_PUBLIC (&cout); TraceC TraceChannel CVC4_PUBLIC (&cout); +std::ostream DumpC::dump_cout(cout.rdbuf());// copy cout stream buffer +DumpC DumpChannel CVC4_PUBLIC (&DumpC::dump_cout); #ifndef CVC4_MUZZLE @@ -155,6 +157,40 @@ int TraceC::printf(std::string tag, const char* fmt, ...) { # endif /* CVC4_TRACING */ +# ifdef CVC4_DUMPING + +int DumpC::printf(const char* tag, const char* fmt, ...) { + if(d_tags.find(string(tag)) == d_tags.end()) { + return 0; + } + + // chop off output after 1024 bytes + char buf[1024]; + va_list vl; + va_start(vl, fmt); + int retval = vsnprintf(buf, sizeof(buf), fmt, vl); + va_end(vl); + *d_os << buf; + return retval; +} + +int DumpC::printf(std::string tag, const char* fmt, ...) { + if(d_tags.find(tag) == d_tags.end()) { + return 0; + } + + // chop off output after 1024 bytes + char buf[1024]; + va_list vl; + va_start(vl, fmt); + int retval = vsnprintf(buf, sizeof(buf), fmt, vl); + va_end(vl); + *d_os << buf; + return retval; +} + +# endif /* CVC4_DUMPING */ + #endif /* ! CVC4_MUZZLE */ }/* CVC4 namespace */ diff --git a/src/util/output.h b/src/util/output.h index 6d0f27f2a..e096ff028 100644 --- a/src/util/output.h +++ b/src/util/output.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: mdeters ** Major contributors: none - ** Minor contributors (to current version): cconway, taking, dejan + ** Minor contributors (to current version): taking, dejan ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences @@ -190,6 +190,7 @@ public: bool on (std::string tag) { d_tags.insert(tag); return true; } bool off(const char* tag) { d_tags.erase (std::string(tag)); return false; } bool off(std::string tag) { d_tags.erase (tag); return false; } + bool off() { d_tags.clear(); return false; } bool isOn(const char* tag) { return d_tags.find(std::string(tag)) != d_tags.end(); } bool isOn(std::string tag) { return d_tags.find(tag) != d_tags.end(); } @@ -297,6 +298,7 @@ public: bool on (std::string tag) { d_tags.insert(tag); return true; } bool off(const char* tag) { d_tags.erase (std::string(tag)); return false; } bool off(std::string tag) { d_tags.erase (tag); return false; } + bool off() { d_tags.clear(); return false; } bool isOn(const char* tag) { return d_tags.find(std::string(tag)) != d_tags.end(); } bool isOn(std::string tag) { return d_tags.find(tag) != d_tags.end(); } @@ -305,6 +307,51 @@ public: std::ostream& getStream() { return *d_os; } };/* class TraceC */ +/** The dump output class */ +class CVC4_PUBLIC DumpC { + std::set d_tags; + std::ostream* d_os; + +public: + /** + * A copy of cout for use by the dumper. This is important because + * it has different settings (e.g., the expr printing depth is always + * unlimited). */ + static std::ostream dump_cout; + + explicit DumpC(std::ostream* os) : d_os(os) {} + + int printf(const char* tag, const char* fmt, ...) __attribute__ ((format(printf, 3, 4))); + int printf(std::string tag, const char* fmt, ...) __attribute__ ((format(printf, 3, 4))); + + CVC4ostream operator()(const char* tag) { + if(!d_tags.empty() && d_tags.find(std::string(tag)) != d_tags.end()) { + return CVC4ostream(d_os); + } else { + return CVC4ostream(); + } + } + CVC4ostream operator()(std::string tag) { + if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) { + return CVC4ostream(d_os); + } else { + return CVC4ostream(); + } + } + + bool on (const char* tag) { d_tags.insert(std::string(tag)); return true; } + bool on (std::string tag) { d_tags.insert(tag); return true; } + bool off(const char* tag) { d_tags.erase (std::string(tag)); return false; } + bool off(std::string tag) { d_tags.erase (tag); return false; } + bool off() { d_tags.clear(); return false; } + + bool isOn(const char* tag) { return d_tags.find(std::string(tag)) != d_tags.end(); } + bool isOn(std::string tag) { return d_tags.find(tag) != d_tags.end(); } + + std::ostream& setStream(std::ostream& os) { d_os = &os; return os; } + std::ostream& getStream() { return *d_os; } +};/* class DumpC */ + /** The debug output singleton */ extern DebugC DebugChannel CVC4_PUBLIC; /** The warning output singleton */ @@ -317,6 +364,8 @@ extern NoticeC NoticeChannel CVC4_PUBLIC; extern ChatC ChatChannel CVC4_PUBLIC; /** The trace output singleton */ extern TraceC TraceChannel CVC4_PUBLIC; +/** The dump output singleton */ +extern DumpC DumpChannel CVC4_PUBLIC; #ifdef CVC4_MUZZLE @@ -326,6 +375,7 @@ extern TraceC TraceChannel CVC4_PUBLIC; # define Notice ::CVC4::__cvc4_true() ? ::CVC4::nullCvc4Stream : ::CVC4::NoticeChannel # define Chat ::CVC4::__cvc4_true() ? ::CVC4::nullCvc4Stream : ::CVC4::ChatChannel # define Trace ::CVC4::__cvc4_true() ? ::CVC4::nullCvc4Stream : ::CVC4::TraceChannel +# define Dump ::CVC4::__cvc4_true() ? ::CVC4::nullCvc4Stream : ::CVC4::DumpChannel inline int DebugC::printf(const char* tag, const char* fmt, ...) { return 0; } inline int DebugC::printf(std::string tag, const char* fmt, ...) { return 0; } @@ -335,6 +385,8 @@ inline int NoticeC::printf(const char* fmt, ...) { return 0; } inline int ChatC::printf(const char* fmt, ...) { return 0; } inline int TraceC::printf(const char* tag, const char* fmt, ...) { return 0; } inline int TraceC::printf(std::string tag, const char* fmt, ...) { return 0; } +inline int DumpC::printf(const char* tag, const char* fmt, ...) { return 0; } +inline int DumpC::printf(std::string tag, const char* fmt, ...) { return 0; } #else /* CVC4_MUZZLE */ @@ -356,6 +408,13 @@ inline int DebugC::printf(std::string tag, const char* fmt, ...) { return 0; } inline int TraceC::printf(const char* tag, const char* fmt, ...) { return 0; } inline int TraceC::printf(std::string tag, const char* fmt, ...) { return 0; } # endif /* CVC4_TRACING */ +# ifdef CVC4_DUMPING +# define Dump ::CVC4::DumpChannel +# else /* CVC4_DUMPING */ +# define Dump ::CVC4::__cvc4_true() ? ::CVC4::nullCvc4Stream : ::CVC4::DumpChannel +inline int DumpC::printf(const char* tag, const char* fmt, ...) { return 0; } +inline int DumpC::printf(std::string tag, const char* fmt, ...) { return 0; } +# endif /* CVC4_DUMPING */ #endif /* CVC4_MUZZLE */ diff --git a/src/util/rational.h.in b/src/util/rational.h.in index 88c488290..17c1e31fc 100644 --- a/src/util/rational.h.in +++ b/src/util/rational.h.in @@ -11,9 +11,9 @@ ** See the file COPYING in the top-level source directory for licensing ** information.\endverbatim ** - ** \brief Multi-precision rational constants. + ** \brief A multi-precision rational constant ** - ** Multi-precision rational constants. + ** A multi-precision rational constant. **/ // this is used to avoid a public header dependence on cvc4autoconfig.h @@ -26,8 +26,14 @@ #ifdef CVC4_CLN_IMP # include "util/rational_cln_imp.h" +# if SWIG + %include "util/rational_cln_imp.h" +# endif /* SWIG */ #endif /* CVC4_CLN_IMP */ #ifdef CVC4_GMP_IMP # include "util/rational_gmp_imp.h" +# if SWIG + %include "util/rational_gmp_imp.h" +# endif /* SWIG */ #endif /* CVC4_GMP_IMP */ diff --git a/src/util/rational_cln_imp.cpp b/src/util/rational_cln_imp.cpp index 057100d10..22e3a7ad1 100644 --- a/src/util/rational_cln_imp.cpp +++ b/src/util/rational_cln_imp.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/rational_cln_imp.h b/src/util/rational_cln_imp.h index b97484ff1..a883500f9 100644 --- a/src/util/rational_cln_imp.h +++ b/src/util/rational_cln_imp.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/rational_gmp_imp.cpp b/src/util/rational_gmp_imp.cpp index 5921b8fd3..b26172d66 100644 --- a/src/util/rational_gmp_imp.cpp +++ b/src/util/rational_gmp_imp.cpp @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/rational_gmp_imp.h b/src/util/rational_gmp_imp.h index 167e0fc22..b97965169 100644 --- a/src/util/rational_gmp_imp.h +++ b/src/util/rational_gmp_imp.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/result.cpp b/src/util/result.cpp index 8e1db27c4..8a2bcf3b2 100644 --- a/src/util/result.cpp +++ b/src/util/result.cpp @@ -1,11 +1,11 @@ /********************* */ -/*! \file result.h +/*! \file result.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, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/result.h b/src/util/result.h index 7da1dc0b7..c4733eab9 100644 --- a/src/util/result.h +++ b/src/util/result.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/sexpr.h b/src/util/sexpr.h index 376a8a224..63ce23874 100644 --- a/src/util/sexpr.h +++ b/src/util/sexpr.h @@ -2,10 +2,10 @@ /*! \file sexpr.h ** \verbatim ** Original author: cconway - ** Major contributors: none - ** Minor contributors (to current version): mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/stats.cpp b/src/util/stats.cpp index 70d486ff6..474d8fa7a 100644 --- a/src/util/stats.cpp +++ b/src/util/stats.cpp @@ -2,10 +2,10 @@ /*! \file stats.cpp ** \verbatim ** Original author: taking - ** Major contributors: none - ** Minor contributors (to current version): mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -20,6 +20,13 @@ #include "util/stats.h" #include "expr/node_manager.h" #include "expr/expr_manager_scope.h" +#include "lib/clock_gettime.h" + +#ifdef CVC4_STATISTICS_ON +# define __CVC4_USE_STATISTICS true +#else +# define __CVC4_USE_STATISTICS false +#endif using namespace CVC4; @@ -67,6 +74,24 @@ StatisticsRegistry::const_iterator StatisticsRegistry::end() { return NodeManager::currentNM()->getStatisticsRegistry()->d_registeredStats.end(); }/* StatisticsRegistry::end() */ +void TimerStat::start() { + if(__CVC4_USE_STATISTICS) { + AlwaysAssert(!d_running); + clock_gettime(CLOCK_MONOTONIC, &d_start); + d_running = true; + } +}/* TimerStat::start() */ + +void TimerStat::stop() { + if(__CVC4_USE_STATISTICS) { + AlwaysAssert(d_running); + ::timespec end; + clock_gettime(CLOCK_MONOTONIC, &end); + d_data += end - d_start; + d_running = false; + } +}/* TimerStat::stop() */ + RegisterStatistic::RegisterStatistic(ExprManager& em, Stat* stat) : d_em(&em), d_stat(stat) { ExprManagerScope ems(*d_em); diff --git a/src/util/stats.h b/src/util/stats.h index a94733595..7d3e33a6f 100644 --- a/src/util/stats.h +++ b/src/util/stats.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 @@ -32,7 +32,6 @@ #include #include "util/Assert.h" -#include "lib/clock_gettime.h" namespace CVC4 { @@ -702,27 +701,13 @@ public: } /** Start the timer. */ - void start() { - if(__CVC4_USE_STATISTICS) { - AlwaysAssert(!d_running); - clock_gettime(CLOCK_MONOTONIC, &d_start); - d_running = true; - } - } + void start(); /** * Stop the timer and update the statistic value with the * accumulated time. */ - void stop() { - if(__CVC4_USE_STATISTICS) { - AlwaysAssert(d_running); - ::timespec end; - clock_gettime(CLOCK_MONOTONIC, &end); - d_data += end - d_start; - d_running = false; - } - } + void stop(); };/* class TimerStat */ diff --git a/src/util/trans_closure.cpp b/src/util/trans_closure.cpp index 61c48fa8d..5d772b576 100644 --- a/src/util/trans_closure.cpp +++ b/src/util/trans_closure.cpp @@ -2,10 +2,10 @@ /*! \file trans_closure.cpp ** \verbatim ** Original author: barrett - ** Major contributors: none + ** Major contributors: ajreynol ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/src/util/trans_closure.h b/src/util/trans_closure.h index 951a32a63..ef04d7af5 100644 --- a/src/util/trans_closure.h +++ b/src/util/trans_closure.h @@ -2,8 +2,8 @@ /*! \file trans_closure.h ** \verbatim ** Original author: barrett - ** Major contributors: none - ** Minor contributors (to current version): none + ** Major contributors: ajreynol + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/test/Makefile.am b/test/Makefile.am index a0d2e8049..4f7818ade 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -26,7 +26,27 @@ test "X$(AM_COLOR_TESTS)" != Xno \ blu=''; \ std=''; \ } -subdirs_to_check = unit system regress/regress0 regress/regress0/arith regress/regress0/arith/integers regress/regress0/uf regress/regress0/bv regress/regress0/bv/core regress/regress0/arrays regress/regress0/datatypes regress/regress0/lemmas regress/regress0/push-pop regress/regress0/precedence regress/regress1 regress/regress2 regress/regress3 + +subdirs_to_check = \ + unit \ + system \ + regress/regress0 \ + regress/regress0/arith \ + regress/regress0/arith/integers \ + regress/regress0/uf \ + regress/regress0/uflra \ + regress/regress0/bv \ + regress/regress0/bv/core \ + regress/regress0/arrays \ + regress/regress0/datatypes \ + regress/regress0/lemmas \ + regress/regress0/push-pop \ + regress/regress0/precedence \ + regress/regress0/preprocess \ + regress/regress1 \ + regress/regress2 \ + regress/regress3 + check-recursive: check-pre .PHONY: check-pre check-pre: diff --git a/test/regress/regress0/uf/Makefile.am b/test/regress/regress0/uf/Makefile.am index fd770e9f9..ca2b19a96 100644 --- a/test/regress/regress0/uf/Makefile.am +++ b/test/regress/regress0/uf/Makefile.am @@ -22,6 +22,7 @@ TESTS = \ eq_diamond23.smt \ NEQ016_size5_reduced2a.smt \ NEQ016_size5_reduced2b.smt \ + ccredesign-fuzz.smt \ dead_dnd002.smt \ iso_brn001.smt \ gensys_brn001.smt2 \ @@ -31,7 +32,6 @@ TESTS = \ simple.04.cvc EXTRA_DIST = $(TESTS) \ - euf_simp09.tim.smt \ mkpidgeon #if CVC4_BUILD_PROFILE_COMPETITION diff --git a/test/regress/regress0/uf/ccredesign-fuzz.smt b/test/regress/regress0/uf/ccredesign-fuzz.smt new file mode 100644 index 000000000..d7a658600 --- /dev/null +++ b/test/regress/regress0/uf/ccredesign-fuzz.smt @@ -0,0 +1,32 @@ +(benchmark fuzzsmt +:logic QF_UF +:status sat +:extrasorts (S1) +:extrasorts (S0) +:extrafuns ((v0 S0)) +:extrafuns ((v1 S0)) +:extrafuns ((f4 S1 S1)) +:extrafuns ((v2 S1)) +:extrafuns ((v3 S1)) +:extrapreds ((p3 S0 S0 S1)) +:extrafuns ((f0 S0 S0 S1 S0)) +:extrapreds ((p1 S0 S1 S1)) +:extrapreds ((p4 S1)) +:formula +(flet ($n1 (p4 v3)) +(let (?n2 (f4 v2)) +(flet ($n3 (p4 ?n2)) +(flet ($n4 (p1 v0 ?n2 ?n2)) +(let (?n5 (f0 v1 v1 v2)) +(let (?n6 (ite $n4 ?n5 v0)) +(flet ($n7 (p3 ?n6 v0 ?n2)) +(flet ($n8 (iff $n3 $n7)) +(flet ($n9 (= v3 ?n2)) +(let (?n10 (ite $n9 v1 v0)) +(flet ($n11 (distinct ?n10 ?n10)) +(flet ($n12 false) +(flet ($n13 (implies $n11 $n12)) +(flet ($n14 (implies $n13 $n12)) +(flet ($n15 (if_then_else $n1 $n8 $n14)) +$n15 +)))))))))))))))) diff --git a/test/regress/regress0/uf/euf_simp09.tim.smt b/test/regress/regress0/uf/euf_simp09.tim.smt deleted file mode 100644 index 309090507..000000000 --- a/test/regress/regress0/uf/euf_simp09.tim.smt +++ /dev/null @@ -1,14 +0,0 @@ -% COMMAND-LINE: --uf tim -% EXPECT: unsat -% EXIT: 20 -(benchmark euf_simp9.smt - - :status unsat - :difficulty { unknown } - :category { crafted } - :logic QF_UF - :extrasorts (A) - :extrafuns ((x A)) - :extrafuns ((f A A)) - :formula (let (?cvc_1 (f (f x))) (let (?cvc_0 (f (f ?cvc_1))) (not (implies (and (= ?cvc_0 x) (= (f (f ?cvc_0)) x)) (= ?cvc_1 x))))) -) diff --git a/test/system/Makefile.am b/test/system/Makefile.am index 40c045a74..66e2bd251 100644 --- a/test/system/Makefile.am +++ b/test/system/Makefile.am @@ -2,10 +2,14 @@ TESTS_ENVIRONMENT = TESTS = \ boilerplate \ ouroborous +# cvc3_main.cpp # Things that aren't tests but that tests rely on and need to # go into the distribution -TEST_DEPS_DIST = +TEST_DEPS_DIST = \ + cvc3_main.cpp \ + cvc3_george.h \ + cvc3_george.cpp # Make-level dependencies; these don't go in the source distribution # but should trigger a re-compile of all unit tests. Libraries are @@ -15,7 +19,9 @@ TEST_DEPS_DIST = # changes made in the header files. TEST_DEPS_NODIST = \ $(abs_top_builddir)/src/libcvc4.la \ - $(abs_top_builddir)/src/parser/libcvc4parser.la + $(abs_top_builddir)/src/parser/libcvc4parser.la \ + $(abs_top_builddir)/src/compat/libcvc4compat.la \ + cvc3_george.lo TEST_DEPS = \ $(TEST_DEPS_DIST) \ @@ -43,6 +49,7 @@ AM_CPPFLAGS = \ -D __BUILDING_CVC4_SYSTEM_TEST \ $(TEST_CPPFLAGS) LIBADD = \ + @abs_top_builddir@/src/compat/libcvc4compat.la \ @abs_top_builddir@/src/parser/libcvc4parser.la \ @abs_top_builddir@/src/libcvc4.la @@ -51,6 +58,8 @@ $(TESTS:%=%.lo): %.lo: %.cpp $(AM_V_CXX)$(LTCXXCOMPILE) $(AM_CXXFLAGS) -c -o $@ $+ $(TESTS): %: %.lo $(LIBADD) $(AM_V_CXXLD)$(system_LINK) $(LIBADD) $(AM_LDFLAGS) $< +cvc3_main: cvc3_george.lo $(LIBADD) + $(AM_V_CXXLD)$(system_LINK) $(LIBADD) $(AM_LDFLAGS) $+ # trick automake into setting LTCXXCOMPILE, CXXLINK, etc. if CVC4_FALSE diff --git a/test/system/cvc3_george.cpp b/test/system/cvc3_george.cpp new file mode 100644 index 000000000..b39477625 --- /dev/null +++ b/test/system/cvc3_george.cpp @@ -0,0 +1,12558 @@ +/********************* */ +/*! \file cvc3_main.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, 2010, 2011 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 Test of CVC3 compatibility interface + ** + ** This is part of a test of the CVC3 compatibility interface present in + ** CVC4. It is a test copied from CVC3's "test" directory. Only #includes + ** were changed to support this test in CVC4. + **/ + +#include "compat/cvc3_compat.h" +//#include "vc.h" +#include +//#include "exception.h" +//#include "command_line_flags.h" + + +using namespace std; +using namespace CVC3; + + +extern int exitStatus; + + +void testgeorge1() { + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("arith3", true); + ValidityChecker *vc = ValidityChecker::create(flags); + try { +/*************/ +vector inconsistency; +/*************/ +Type id9 = vc->realType(); +Type id7 = vc->intType(); +Type id11 = vc->boolType(); +vc->push(); +Expr id13=vc->trueExpr(); +Expr id12=vc->notExpr(vc->trueExpr()); +Type id19=vc->arrayType(id7,id7); +Type id21=vc->arrayType(id7,id9); +Type id23=vc->arrayType(id9,id7); +Type id25=vc->arrayType(id9,id9); +Type id27=vc->tupleType(id19,id7,id7); +Type id29=vc->funType(id27,id19); +Op id31=vc->createOp(".Int_Int_store",id29); +Type id33=vc->tupleType(id21,id7); +Type id35=vc->funType(id33,id9); +Op id37=vc->createOp(".Int_Real_select",id35); +Type id39=vc->tupleType(id21,id7,id9); +Type id41=vc->funType(id39,id21); +Op id43=vc->createOp(".Int_Real_store",id41); +Type id45=vc->tupleType(id19,id7); +Type id47=vc->funType(id45,id7); +Op id49=vc->createOp(".Int_Int_select",id47); +Type id51=vc->tupleType(id23,id9,id7); +Type id53=vc->funType(id51,id23); +Op id55=vc->createOp(".Real_Int_store",id53); +Type id57=vc->tupleType(id25,id9,id9); +Type id59=vc->funType(id57,id25); +Op id61=vc->createOp(".Real_Real_store",id59); +Type id63=vc->tupleType(id23,id9); +Type id65=vc->funType(id63,id7); +Op id67=vc->createOp(".Real_Int_select",id65); +Type id69=vc->tupleType(id25,id9); +Type id71=vc->funType(id69,id9); +Op id73=vc->createOp(".Real_Real_select",id71); +Type id75=vc->createType("ANY"); +Expr id89=vc->varExpr("x_6",id9); +Expr id91=vc->varExpr("x_7",id9); +Expr id93=vc->varExpr("x_8",id9); +Expr id95=vc->varExpr("x_9",id9); +Expr id97=vc->varExpr("x_10",id9); +Expr id99=vc->varExpr("x_11",id9); +Expr id101=vc->varExpr("x_12",id9); +Expr id103=vc->varExpr("x_13",id9); +Expr id105=vc->varExpr("x_14",id9); +Expr id107=vc->varExpr("x_15",id9); +Expr id109=vc->varExpr("x_16",id9); +Expr id111=vc->varExpr("x_17",id9); +Expr id113=vc->varExpr("x_18",id9); +Expr id115=vc->varExpr("x_19",id9); +Expr id117=vc->varExpr("x_20",id9); +Expr id119=vc->varExpr("x_21",id9); +Expr id121=vc->varExpr("x_22",id9); +Expr id123=vc->varExpr("x_23",id9); +Expr id125=vc->varExpr("x_24",id9); +Expr id127=vc->varExpr("x_25",id9); +Expr id129=vc->varExpr("x_26",id9); +Expr id131=vc->varExpr("x_27",id9); +Expr id133=vc->varExpr("x_28",id9); +Expr id139=vc->varExpr("x_31",id9); +Expr id155=vc->varExpr("x_39",id9); +Expr id161=vc->varExpr("x_42",id9); +Expr id163=vc->varExpr("x_43",id9); +Expr id165=vc->varExpr("x_44",id9); +Expr id171=vc->varExpr("x_47",id9); +Expr id177=vc->varExpr("x_50",id9); +Expr id179=vc->varExpr("x_51",id9); +Expr id185=vc->varExpr("x_54",id9); +Expr id199=vc->varExpr("x_61",id9); +Expr id205=vc->varExpr("x_64",id9); +Expr id207=vc->varExpr("x_65",id9); +Expr id209=vc->varExpr("x_66",id9); +Expr id211=vc->varExpr("x_67",id9); +Expr id213=vc->varExpr("x_68",id9); +Expr id215=vc->varExpr("x_69",id9); +Expr id221=vc->varExpr("x_72",id9); +Expr id235=vc->varExpr("x_79",id9); +Expr id241=vc->varExpr("x_82",id9); +Expr id243=vc->varExpr("x_83",id9); +Expr id245=vc->varExpr("x_84",id9); +Expr id247=vc->varExpr("x_85",id9); +Expr id249=vc->varExpr("x_86",id9); +Expr id251=vc->varExpr("x_87",id9); +Expr id257=vc->varExpr("x_90",id9); +Expr id271=vc->varExpr("x_97",id9); +Expr id277=vc->varExpr("x_100",id9); +Expr id279=vc->varExpr("x_101",id9); +Expr id281=vc->varExpr("x_102",id9); +Expr id283=vc->varExpr("x_103",id9); +Expr id285=vc->varExpr("x_104",id9); +Expr id287=vc->varExpr("x_105",id9); +Expr id293=vc->varExpr("x_108",id9); +Expr id307=vc->varExpr("x_115",id9); +Expr id313=vc->varExpr("x_118",id9); +Expr id315=vc->varExpr("x_119",id9); +Expr id317=vc->varExpr("x_120",id9); +Expr id319=vc->varExpr("x_121",id9); +Expr id321=vc->varExpr("x_122",id9); +Expr id323=vc->varExpr("x_123",id9); +Expr id329=vc->varExpr("x_126",id9); +Expr id343=vc->varExpr("x_133",id9); +Expr id349=vc->varExpr("x_136",id9); +Expr id351=vc->varExpr("x_137",id9); +Expr id353=vc->varExpr("x_138",id9); +Expr id355=vc->varExpr("x_139",id9); +Expr id357=vc->varExpr("x_140",id9); +Expr id359=vc->varExpr("x_141",id9); +Expr id365=vc->varExpr("x_144",id9); +Expr id379=vc->varExpr("x_151",id9); +Expr id385=vc->varExpr("x_154",id9); +Expr id387=vc->varExpr("x_155",id9); +Expr id389=vc->varExpr("x_156",id9); +Expr id391=vc->varExpr("x_157",id9); +Expr id393=vc->varExpr("x_158",id9); +Expr id395=vc->varExpr("x_159",id9); +Expr id401=vc->varExpr("x_162",id9); +Expr id415=vc->varExpr("x_169",id9); +Expr id421=vc->varExpr("x_172",id9); +Expr id423=vc->varExpr("x_173",id9); +Expr id425=vc->varExpr("x_174",id9); +Expr id427=vc->varExpr("x_175",id9); +Expr id429=vc->varExpr("x_176",id9); +Expr id431=vc->varExpr("x_177",id9); +Expr id437=vc->varExpr("x_180",id9); +Expr id451=vc->varExpr("x_187",id9); +Expr id457=vc->varExpr("x_190",id9); +Expr id459=vc->varExpr("x_191",id9); +Expr id461=vc->varExpr("x_192",id9); +Expr id463=vc->varExpr("x_193",id9); +Expr id465=vc->varExpr("x_194",id9); +Expr id467=vc->varExpr("x_195",id9); +Expr id473=vc->varExpr("x_198",id9); +Expr id487=vc->varExpr("x_205",id9); +Expr id493=vc->varExpr("x_208",id9); +Expr id495=vc->varExpr("x_209",id9); +Expr id497=vc->varExpr("x_210",id9); +Expr id499=vc->varExpr("x_211",id9); +Expr id501=vc->varExpr("x_212",id9); +Expr id503=vc->varExpr("x_213",id9); +Expr id509=vc->varExpr("x_216",id9); +Expr id523=vc->varExpr("x_223",id9); +Expr id529=vc->varExpr("x_226",id9); +Expr id531=vc->varExpr("x_227",id9); +Expr id533=vc->varExpr("x_228",id9); +Expr id535=vc->varExpr("x_229",id9); +Expr id537=vc->varExpr("x_230",id9); +Expr id539=vc->varExpr("x_231",id9); +Expr id545=vc->varExpr("x_234",id9); +Expr id559=vc->varExpr("x_241",id9); +Expr id565=vc->varExpr("x_244",id9); +Expr id567=vc->varExpr("x_245",id9); +Expr id569=vc->varExpr("x_246",id9); +Expr id571=vc->varExpr("x_247",id9); +Expr id573=vc->varExpr("x_248",id9); +Expr id575=vc->varExpr("x_249",id9); +Expr id581=vc->varExpr("x_252",id9); +Expr id595=vc->varExpr("x_259",id9); +Expr id601=vc->varExpr("x_262",id9); +Expr id603=vc->varExpr("x_263",id9); +Expr id605=vc->varExpr("x_264",id9); +Expr id607=vc->varExpr("x_265",id9); +Expr id609=vc->varExpr("x_266",id9); +Expr id611=vc->varExpr("x_267",id9); +Expr id617=vc->varExpr("x_270",id9); +Expr id631=vc->varExpr("x_277",id9); +Expr id637=vc->varExpr("x_280",id9); +Expr id639=vc->varExpr("x_281",id9); +Expr id641=vc->varExpr("x_282",id9); +Expr id643=vc->varExpr("x_283",id9); +Expr id645=vc->varExpr("x_284",id9); +Expr id647=vc->varExpr("x_285",id9); +Expr id653=vc->varExpr("x_288",id9); +Expr id667=vc->varExpr("x_295",id9); +Expr id673=vc->varExpr("x_298",id9); +Expr id675=vc->varExpr("x_299",id9); +Expr id677=vc->varExpr("x_300",id9); +Expr id679=vc->varExpr("x_301",id9); +Expr id681=vc->varExpr("x_302",id9); +Expr id683=vc->varExpr("x_303",id9); +Expr id689=vc->varExpr("x_306",id9); +Expr id703=vc->varExpr("x_313",id9); +Expr id709=vc->varExpr("x_316",id9); +Expr id711=vc->varExpr("x_317",id9); +Expr id713=vc->varExpr("x_318",id9); +Expr id715=vc->varExpr("x_319",id9); +Expr id717=vc->varExpr("x_320",id9); +Expr id719=vc->varExpr("x_321",id9); +Expr id725=vc->varExpr("x_324",id9); +Expr id739=vc->varExpr("x_331",id9); +Expr id745=vc->varExpr("x_334",id9); +Expr id747=vc->varExpr("x_335",id9); +Expr id749=vc->varExpr("x_336",id9); +Expr id751=vc->varExpr("x_337",id9); +Expr id753=vc->varExpr("x_338",id9); +Expr id755=vc->varExpr("x_339",id9); +Expr id761=vc->varExpr("x_342",id9); +Expr id775=vc->varExpr("x_349",id9); +Expr id781=vc->varExpr("x_352",id9); +Expr id783=vc->varExpr("x_353",id9); +Expr id785=vc->varExpr("x_354",id9); +Expr id787=vc->varExpr("x_355",id9); +Expr id789=vc->varExpr("x_356",id9); +Expr id791=vc->varExpr("x_357",id9); +Expr id797=vc->varExpr("x_360",id9); +Expr id811=vc->varExpr("x_367",id9); +Expr id817=vc->varExpr("x_370",id9); +Expr id819=vc->varExpr("x_371",id9); +Expr id821=vc->varExpr("x_372",id9); +Expr id823=vc->varExpr("x_373",id9); +Expr id825=vc->varExpr("x_374",id9); +Expr id827=vc->varExpr("x_375",id9); +Expr id833=vc->varExpr("x_378",id9); +Expr id847=vc->varExpr("x_385",id9); +Expr id853=vc->varExpr("x_388",id9); +Expr id855=vc->varExpr("x_389",id9); +Expr id857=vc->varExpr("x_390",id9); +Expr id859=vc->varExpr("x_391",id9); +Expr id861=vc->varExpr("x_392",id9); +Expr id863=vc->eqExpr(id791,id827); +Expr id862=vc->notExpr(id863); +vc->registerAtom(id863); +Expr id867=vc->eqExpr(id797,id833); +Expr id866=vc->notExpr(id867); +vc->registerAtom(id867); +Expr id875=vc->ratExpr(1,1); +Expr id877=vc->eqExpr(id875,id819); +Expr id876=vc->notExpr(id877); +vc->registerAtom(id877); +Expr id891=vc->eqExpr(id811,id847); +Expr id890=vc->notExpr(id891); +vc->registerAtom(id891); +Expr id895=vc->ratExpr(0,1); +Expr id897=vc->eqExpr(id895,id853); +Expr id896=vc->notExpr(id897); +vc->registerAtom(id897); +Expr id899=vc->eqExpr(id817,id853); +Expr id898=vc->notExpr(id899); +vc->registerAtom(id899); +Expr id901=vc->eqExpr(id895,id819); +Expr id900=vc->notExpr(id901); +vc->registerAtom(id901); +Expr id903=vc->eqExpr(id895,id833); +Expr id902=vc->notExpr(id903); +vc->registerAtom(id903); +Expr id905=vc->eqExpr(id755,id791); +Expr id904=vc->notExpr(id905); +vc->registerAtom(id905); +Expr id909=vc->eqExpr(id761,id797); +Expr id908=vc->notExpr(id909); +vc->registerAtom(id909); +Expr id917=vc->eqExpr(id875,id783); +Expr id916=vc->notExpr(id917); +vc->registerAtom(id917); +Expr id931=vc->eqExpr(id775,id811); +Expr id930=vc->notExpr(id931); +vc->registerAtom(id931); +Expr id935=vc->eqExpr(id895,id817); +Expr id934=vc->notExpr(id935); +vc->registerAtom(id935); +Expr id937=vc->eqExpr(id781,id817); +Expr id936=vc->notExpr(id937); +vc->registerAtom(id937); +Expr id939=vc->eqExpr(id895,id783); +Expr id938=vc->notExpr(id939); +vc->registerAtom(id939); +Expr id941=vc->eqExpr(id895,id797); +Expr id940=vc->notExpr(id941); +vc->registerAtom(id941); +Expr id943=vc->eqExpr(id719,id755); +Expr id942=vc->notExpr(id943); +vc->registerAtom(id943); +Expr id947=vc->eqExpr(id725,id761); +Expr id946=vc->notExpr(id947); +vc->registerAtom(id947); +Expr id955=vc->eqExpr(id875,id747); +Expr id954=vc->notExpr(id955); +vc->registerAtom(id955); +Expr id969=vc->eqExpr(id739,id775); +Expr id968=vc->notExpr(id969); +vc->registerAtom(id969); +Expr id973=vc->eqExpr(id895,id781); +Expr id972=vc->notExpr(id973); +vc->registerAtom(id973); +Expr id975=vc->eqExpr(id745,id781); +Expr id974=vc->notExpr(id975); +vc->registerAtom(id975); +Expr id977=vc->eqExpr(id895,id747); +Expr id976=vc->notExpr(id977); +vc->registerAtom(id977); +Expr id979=vc->eqExpr(id895,id761); +Expr id978=vc->notExpr(id979); +vc->registerAtom(id979); +Expr id981=vc->eqExpr(id683,id719); +Expr id980=vc->notExpr(id981); +vc->registerAtom(id981); +Expr id985=vc->eqExpr(id689,id725); +Expr id984=vc->notExpr(id985); +vc->registerAtom(id985); +Expr id993=vc->eqExpr(id875,id711); +Expr id992=vc->notExpr(id993); +vc->registerAtom(id993); +Expr id1007=vc->eqExpr(id703,id739); +Expr id1006=vc->notExpr(id1007); +vc->registerAtom(id1007); +Expr id1011=vc->eqExpr(id895,id745); +Expr id1010=vc->notExpr(id1011); +vc->registerAtom(id1011); +Expr id1013=vc->eqExpr(id709,id745); +Expr id1012=vc->notExpr(id1013); +vc->registerAtom(id1013); +Expr id1015=vc->eqExpr(id895,id711); +Expr id1014=vc->notExpr(id1015); +vc->registerAtom(id1015); +Expr id1017=vc->eqExpr(id895,id725); +Expr id1016=vc->notExpr(id1017); +vc->registerAtom(id1017); +Expr id1019=vc->eqExpr(id647,id683); +Expr id1018=vc->notExpr(id1019); +vc->registerAtom(id1019); +Expr id1023=vc->eqExpr(id653,id689); +Expr id1022=vc->notExpr(id1023); +vc->registerAtom(id1023); +Expr id1031=vc->eqExpr(id875,id675); +Expr id1030=vc->notExpr(id1031); +vc->registerAtom(id1031); +Expr id1045=vc->eqExpr(id667,id703); +Expr id1044=vc->notExpr(id1045); +vc->registerAtom(id1045); +Expr id1049=vc->eqExpr(id895,id709); +Expr id1048=vc->notExpr(id1049); +vc->registerAtom(id1049); +Expr id1051=vc->eqExpr(id673,id709); +Expr id1050=vc->notExpr(id1051); +vc->registerAtom(id1051); +Expr id1053=vc->eqExpr(id895,id675); +Expr id1052=vc->notExpr(id1053); +vc->registerAtom(id1053); +Expr id1055=vc->eqExpr(id895,id689); +Expr id1054=vc->notExpr(id1055); +vc->registerAtom(id1055); +Expr id1057=vc->eqExpr(id611,id647); +Expr id1056=vc->notExpr(id1057); +vc->registerAtom(id1057); +Expr id1061=vc->eqExpr(id617,id653); +Expr id1060=vc->notExpr(id1061); +vc->registerAtom(id1061); +Expr id1069=vc->eqExpr(id875,id639); +Expr id1068=vc->notExpr(id1069); +vc->registerAtom(id1069); +Expr id1083=vc->eqExpr(id631,id667); +Expr id1082=vc->notExpr(id1083); +vc->registerAtom(id1083); +Expr id1087=vc->eqExpr(id895,id673); +Expr id1086=vc->notExpr(id1087); +vc->registerAtom(id1087); +Expr id1089=vc->eqExpr(id637,id673); +Expr id1088=vc->notExpr(id1089); +vc->registerAtom(id1089); +Expr id1091=vc->eqExpr(id895,id639); +Expr id1090=vc->notExpr(id1091); +vc->registerAtom(id1091); +Expr id1093=vc->eqExpr(id895,id653); +Expr id1092=vc->notExpr(id1093); +vc->registerAtom(id1093); +Expr id1095=vc->eqExpr(id575,id611); +Expr id1094=vc->notExpr(id1095); +vc->registerAtom(id1095); +Expr id1099=vc->eqExpr(id581,id617); +Expr id1098=vc->notExpr(id1099); +vc->registerAtom(id1099); +Expr id1107=vc->eqExpr(id875,id603); +Expr id1106=vc->notExpr(id1107); +vc->registerAtom(id1107); +Expr id1121=vc->eqExpr(id595,id631); +Expr id1120=vc->notExpr(id1121); +vc->registerAtom(id1121); +Expr id1125=vc->eqExpr(id895,id637); +Expr id1124=vc->notExpr(id1125); +vc->registerAtom(id1125); +Expr id1127=vc->eqExpr(id601,id637); +Expr id1126=vc->notExpr(id1127); +vc->registerAtom(id1127); +Expr id1129=vc->eqExpr(id895,id603); +Expr id1128=vc->notExpr(id1129); +vc->registerAtom(id1129); +Expr id1131=vc->eqExpr(id895,id617); +Expr id1130=vc->notExpr(id1131); +vc->registerAtom(id1131); +Expr id1133=vc->eqExpr(id539,id575); +Expr id1132=vc->notExpr(id1133); +vc->registerAtom(id1133); +Expr id1137=vc->eqExpr(id545,id581); +Expr id1136=vc->notExpr(id1137); +vc->registerAtom(id1137); +Expr id1145=vc->eqExpr(id875,id567); +Expr id1144=vc->notExpr(id1145); +vc->registerAtom(id1145); +Expr id1159=vc->eqExpr(id559,id595); +Expr id1158=vc->notExpr(id1159); +vc->registerAtom(id1159); +Expr id1163=vc->eqExpr(id895,id601); +Expr id1162=vc->notExpr(id1163); +vc->registerAtom(id1163); +Expr id1165=vc->eqExpr(id565,id601); +Expr id1164=vc->notExpr(id1165); +vc->registerAtom(id1165); +Expr id1167=vc->eqExpr(id895,id567); +Expr id1166=vc->notExpr(id1167); +vc->registerAtom(id1167); +Expr id1169=vc->eqExpr(id895,id581); +Expr id1168=vc->notExpr(id1169); +vc->registerAtom(id1169); +Expr id1171=vc->eqExpr(id503,id539); +Expr id1170=vc->notExpr(id1171); +vc->registerAtom(id1171); +Expr id1175=vc->eqExpr(id509,id545); +Expr id1174=vc->notExpr(id1175); +vc->registerAtom(id1175); +Expr id1183=vc->eqExpr(id875,id531); +Expr id1182=vc->notExpr(id1183); +vc->registerAtom(id1183); +Expr id1197=vc->eqExpr(id523,id559); +Expr id1196=vc->notExpr(id1197); +vc->registerAtom(id1197); +Expr id1201=vc->eqExpr(id895,id565); +Expr id1200=vc->notExpr(id1201); +vc->registerAtom(id1201); +Expr id1203=vc->eqExpr(id529,id565); +Expr id1202=vc->notExpr(id1203); +vc->registerAtom(id1203); +Expr id1205=vc->eqExpr(id895,id531); +Expr id1204=vc->notExpr(id1205); +vc->registerAtom(id1205); +Expr id1207=vc->eqExpr(id895,id545); +Expr id1206=vc->notExpr(id1207); +vc->registerAtom(id1207); +Expr id1209=vc->eqExpr(id467,id503); +Expr id1208=vc->notExpr(id1209); +vc->registerAtom(id1209); +Expr id1213=vc->eqExpr(id473,id509); +Expr id1212=vc->notExpr(id1213); +vc->registerAtom(id1213); +Expr id1221=vc->eqExpr(id875,id495); +Expr id1220=vc->notExpr(id1221); +vc->registerAtom(id1221); +Expr id1235=vc->eqExpr(id487,id523); +Expr id1234=vc->notExpr(id1235); +vc->registerAtom(id1235); +Expr id1239=vc->eqExpr(id895,id529); +Expr id1238=vc->notExpr(id1239); +vc->registerAtom(id1239); +Expr id1241=vc->eqExpr(id493,id529); +Expr id1240=vc->notExpr(id1241); +vc->registerAtom(id1241); +Expr id1243=vc->eqExpr(id895,id495); +Expr id1242=vc->notExpr(id1243); +vc->registerAtom(id1243); +Expr id1245=vc->eqExpr(id895,id509); +Expr id1244=vc->notExpr(id1245); +vc->registerAtom(id1245); +Expr id1247=vc->eqExpr(id431,id467); +Expr id1246=vc->notExpr(id1247); +vc->registerAtom(id1247); +Expr id1251=vc->eqExpr(id437,id473); +Expr id1250=vc->notExpr(id1251); +vc->registerAtom(id1251); +Expr id1259=vc->eqExpr(id875,id459); +Expr id1258=vc->notExpr(id1259); +vc->registerAtom(id1259); +Expr id1273=vc->eqExpr(id451,id487); +Expr id1272=vc->notExpr(id1273); +vc->registerAtom(id1273); +Expr id1277=vc->eqExpr(id895,id493); +Expr id1276=vc->notExpr(id1277); +vc->registerAtom(id1277); +Expr id1279=vc->eqExpr(id457,id493); +Expr id1278=vc->notExpr(id1279); +vc->registerAtom(id1279); +Expr id1281=vc->eqExpr(id895,id459); +Expr id1280=vc->notExpr(id1281); +vc->registerAtom(id1281); +Expr id1283=vc->eqExpr(id895,id473); +Expr id1282=vc->notExpr(id1283); +vc->registerAtom(id1283); +Expr id1285=vc->eqExpr(id395,id431); +Expr id1284=vc->notExpr(id1285); +vc->registerAtom(id1285); +Expr id1289=vc->eqExpr(id401,id437); +Expr id1288=vc->notExpr(id1289); +vc->registerAtom(id1289); +Expr id1297=vc->eqExpr(id875,id423); +Expr id1296=vc->notExpr(id1297); +vc->registerAtom(id1297); +Expr id1311=vc->eqExpr(id415,id451); +Expr id1310=vc->notExpr(id1311); +vc->registerAtom(id1311); +Expr id1315=vc->eqExpr(id895,id457); +Expr id1314=vc->notExpr(id1315); +vc->registerAtom(id1315); +Expr id1317=vc->eqExpr(id421,id457); +Expr id1316=vc->notExpr(id1317); +vc->registerAtom(id1317); +Expr id1319=vc->eqExpr(id895,id423); +Expr id1318=vc->notExpr(id1319); +vc->registerAtom(id1319); +Expr id1321=vc->eqExpr(id895,id437); +Expr id1320=vc->notExpr(id1321); +vc->registerAtom(id1321); +Expr id1323=vc->eqExpr(id359,id395); +Expr id1322=vc->notExpr(id1323); +vc->registerAtom(id1323); +Expr id1327=vc->eqExpr(id365,id401); +Expr id1326=vc->notExpr(id1327); +vc->registerAtom(id1327); +Expr id1335=vc->eqExpr(id875,id387); +Expr id1334=vc->notExpr(id1335); +vc->registerAtom(id1335); +Expr id1349=vc->eqExpr(id379,id415); +Expr id1348=vc->notExpr(id1349); +vc->registerAtom(id1349); +Expr id1353=vc->eqExpr(id895,id421); +Expr id1352=vc->notExpr(id1353); +vc->registerAtom(id1353); +Expr id1355=vc->eqExpr(id385,id421); +Expr id1354=vc->notExpr(id1355); +vc->registerAtom(id1355); +Expr id1357=vc->eqExpr(id895,id387); +Expr id1356=vc->notExpr(id1357); +vc->registerAtom(id1357); +Expr id1359=vc->eqExpr(id895,id401); +Expr id1358=vc->notExpr(id1359); +vc->registerAtom(id1359); +Expr id1361=vc->eqExpr(id323,id359); +Expr id1360=vc->notExpr(id1361); +vc->registerAtom(id1361); +Expr id1365=vc->eqExpr(id329,id365); +Expr id1364=vc->notExpr(id1365); +vc->registerAtom(id1365); +Expr id1373=vc->eqExpr(id875,id351); +Expr id1372=vc->notExpr(id1373); +vc->registerAtom(id1373); +Expr id1387=vc->eqExpr(id343,id379); +Expr id1386=vc->notExpr(id1387); +vc->registerAtom(id1387); +Expr id1391=vc->eqExpr(id895,id385); +Expr id1390=vc->notExpr(id1391); +vc->registerAtom(id1391); +Expr id1393=vc->eqExpr(id349,id385); +Expr id1392=vc->notExpr(id1393); +vc->registerAtom(id1393); +Expr id1395=vc->eqExpr(id895,id351); +Expr id1394=vc->notExpr(id1395); +vc->registerAtom(id1395); +Expr id1397=vc->eqExpr(id895,id365); +Expr id1396=vc->notExpr(id1397); +vc->registerAtom(id1397); +Expr id1399=vc->eqExpr(id287,id323); +Expr id1398=vc->notExpr(id1399); +vc->registerAtom(id1399); +Expr id1403=vc->eqExpr(id293,id329); +Expr id1402=vc->notExpr(id1403); +vc->registerAtom(id1403); +Expr id1411=vc->eqExpr(id875,id315); +Expr id1410=vc->notExpr(id1411); +vc->registerAtom(id1411); +Expr id1425=vc->eqExpr(id307,id343); +Expr id1424=vc->notExpr(id1425); +vc->registerAtom(id1425); +Expr id1429=vc->eqExpr(id895,id349); +Expr id1428=vc->notExpr(id1429); +vc->registerAtom(id1429); +Expr id1431=vc->eqExpr(id313,id349); +Expr id1430=vc->notExpr(id1431); +vc->registerAtom(id1431); +Expr id1433=vc->eqExpr(id895,id315); +Expr id1432=vc->notExpr(id1433); +vc->registerAtom(id1433); +Expr id1435=vc->eqExpr(id895,id329); +Expr id1434=vc->notExpr(id1435); +vc->registerAtom(id1435); +Expr id1437=vc->eqExpr(id251,id287); +Expr id1436=vc->notExpr(id1437); +vc->registerAtom(id1437); +Expr id1441=vc->eqExpr(id257,id293); +Expr id1440=vc->notExpr(id1441); +vc->registerAtom(id1441); +Expr id1449=vc->eqExpr(id875,id279); +Expr id1448=vc->notExpr(id1449); +vc->registerAtom(id1449); +Expr id1463=vc->eqExpr(id271,id307); +Expr id1462=vc->notExpr(id1463); +vc->registerAtom(id1463); +Expr id1467=vc->eqExpr(id895,id313); +Expr id1466=vc->notExpr(id1467); +vc->registerAtom(id1467); +Expr id1469=vc->eqExpr(id277,id313); +Expr id1468=vc->notExpr(id1469); +vc->registerAtom(id1469); +Expr id1471=vc->eqExpr(id895,id279); +Expr id1470=vc->notExpr(id1471); +vc->registerAtom(id1471); +Expr id1473=vc->eqExpr(id895,id293); +Expr id1472=vc->notExpr(id1473); +vc->registerAtom(id1473); +Expr id1475=vc->eqExpr(id215,id251); +Expr id1474=vc->notExpr(id1475); +vc->registerAtom(id1475); +Expr id1479=vc->eqExpr(id221,id257); +Expr id1478=vc->notExpr(id1479); +vc->registerAtom(id1479); +Expr id1487=vc->eqExpr(id875,id243); +Expr id1486=vc->notExpr(id1487); +vc->registerAtom(id1487); +Expr id1501=vc->eqExpr(id235,id271); +Expr id1500=vc->notExpr(id1501); +vc->registerAtom(id1501); +Expr id1505=vc->eqExpr(id895,id277); +Expr id1504=vc->notExpr(id1505); +vc->registerAtom(id1505); +Expr id1507=vc->eqExpr(id241,id277); +Expr id1506=vc->notExpr(id1507); +vc->registerAtom(id1507); +Expr id1509=vc->eqExpr(id895,id243); +Expr id1508=vc->notExpr(id1509); +vc->registerAtom(id1509); +Expr id1511=vc->eqExpr(id895,id257); +Expr id1510=vc->notExpr(id1511); +vc->registerAtom(id1511); +Expr id1513=vc->eqExpr(id179,id215); +Expr id1512=vc->notExpr(id1513); +vc->registerAtom(id1513); +Expr id1517=vc->eqExpr(id185,id221); +Expr id1516=vc->notExpr(id1517); +vc->registerAtom(id1517); +Expr id1525=vc->eqExpr(id875,id207); +Expr id1524=vc->notExpr(id1525); +vc->registerAtom(id1525); +Expr id1539=vc->eqExpr(id199,id235); +Expr id1538=vc->notExpr(id1539); +vc->registerAtom(id1539); +Expr id1543=vc->eqExpr(id895,id241); +Expr id1542=vc->notExpr(id1543); +vc->registerAtom(id1543); +Expr id1545=vc->eqExpr(id205,id241); +Expr id1544=vc->notExpr(id1545); +vc->registerAtom(id1545); +Expr id1547=vc->eqExpr(id895,id207); +Expr id1546=vc->notExpr(id1547); +vc->registerAtom(id1547); +Expr id1549=vc->eqExpr(id895,id221); +Expr id1548=vc->notExpr(id1549); +vc->registerAtom(id1549); +Expr id1551=vc->eqExpr(id131,id179); +Expr id1550=vc->notExpr(id1551); +vc->registerAtom(id1551); +Expr id1555=vc->eqExpr(id139,id185); +Expr id1554=vc->notExpr(id1555); +vc->registerAtom(id1555); +Expr id1563=vc->eqExpr(id875,id163); +Expr id1562=vc->notExpr(id1563); +vc->registerAtom(id1563); +Expr id1577=vc->eqExpr(id155,id199); +Expr id1576=vc->notExpr(id1577); +vc->registerAtom(id1577); +Expr id1581=vc->eqExpr(id895,id205); +Expr id1580=vc->notExpr(id1581); +vc->registerAtom(id1581); +Expr id1583=vc->eqExpr(id161,id205); +Expr id1582=vc->notExpr(id1583); +vc->registerAtom(id1583); +Expr id1585=vc->eqExpr(id895,id163); +Expr id1584=vc->notExpr(id1585); +vc->registerAtom(id1585); +Expr id1587=vc->eqExpr(id895,id185); +Expr id1586=vc->notExpr(id1587); +vc->registerAtom(id1587); +Expr id1589=vc->eqExpr(id133,id131); +Expr id1588=vc->notExpr(id1589); +vc->registerAtom(id1589); +Expr id1613=vc->eqExpr(id895,id161); +Expr id1612=vc->notExpr(id1613); +vc->registerAtom(id1613); +Expr id1615=vc->eqExpr(id895,id139); +Expr id1614=vc->notExpr(id1615); +vc->registerAtom(id1615); +Expr id1617=vc->eqExpr(id895,id155); +Expr id1616=vc->notExpr(id1617); +vc->registerAtom(id1617); +Expr id1619=vc->plusExpr(id811,id127); +Expr id1621=vc->ratExpr(5,1); +Expr id1623=vc->leExpr(id1619,id1621); +Expr id1622=vc->notExpr(id1623); +vc->registerAtom(id1623); +Expr id1625=vc->plusExpr(id817,id127); +Expr id1627=vc->leExpr(id1625,id875); +Expr id1626=vc->notExpr(id1627); +vc->registerAtom(id1627); +Expr id1629=vc->plusExpr(id775,id125); +Expr id1631=vc->leExpr(id1629,id1621); +Expr id1630=vc->notExpr(id1631); +vc->registerAtom(id1631); +Expr id1633=vc->plusExpr(id781,id125); +Expr id1635=vc->leExpr(id1633,id875); +Expr id1634=vc->notExpr(id1635); +vc->registerAtom(id1635); +Expr id1637=vc->plusExpr(id739,id123); +Expr id1639=vc->leExpr(id1637,id1621); +Expr id1638=vc->notExpr(id1639); +vc->registerAtom(id1639); +Expr id1641=vc->plusExpr(id745,id123); +Expr id1643=vc->leExpr(id1641,id875); +Expr id1642=vc->notExpr(id1643); +vc->registerAtom(id1643); +Expr id1645=vc->plusExpr(id703,id121); +Expr id1647=vc->leExpr(id1645,id1621); +Expr id1646=vc->notExpr(id1647); +vc->registerAtom(id1647); +Expr id1649=vc->plusExpr(id709,id121); +Expr id1651=vc->leExpr(id1649,id875); +Expr id1650=vc->notExpr(id1651); +vc->registerAtom(id1651); +Expr id1653=vc->plusExpr(id667,id119); +Expr id1655=vc->leExpr(id1653,id1621); +Expr id1654=vc->notExpr(id1655); +vc->registerAtom(id1655); +Expr id1657=vc->plusExpr(id673,id119); +Expr id1659=vc->leExpr(id1657,id875); +Expr id1658=vc->notExpr(id1659); +vc->registerAtom(id1659); +Expr id1661=vc->plusExpr(id631,id117); +Expr id1663=vc->leExpr(id1661,id1621); +Expr id1662=vc->notExpr(id1663); +vc->registerAtom(id1663); +Expr id1665=vc->plusExpr(id637,id117); +Expr id1667=vc->leExpr(id1665,id875); +Expr id1666=vc->notExpr(id1667); +vc->registerAtom(id1667); +Expr id1669=vc->plusExpr(id595,id115); +Expr id1671=vc->leExpr(id1669,id1621); +Expr id1670=vc->notExpr(id1671); +vc->registerAtom(id1671); +Expr id1673=vc->plusExpr(id601,id115); +Expr id1675=vc->leExpr(id1673,id875); +Expr id1674=vc->notExpr(id1675); +vc->registerAtom(id1675); +Expr id1677=vc->plusExpr(id559,id113); +Expr id1679=vc->leExpr(id1677,id1621); +Expr id1678=vc->notExpr(id1679); +vc->registerAtom(id1679); +Expr id1681=vc->plusExpr(id565,id113); +Expr id1683=vc->leExpr(id1681,id875); +Expr id1682=vc->notExpr(id1683); +vc->registerAtom(id1683); +Expr id1685=vc->plusExpr(id523,id111); +Expr id1687=vc->leExpr(id1685,id1621); +Expr id1686=vc->notExpr(id1687); +vc->registerAtom(id1687); +Expr id1689=vc->plusExpr(id529,id111); +Expr id1691=vc->leExpr(id1689,id875); +Expr id1690=vc->notExpr(id1691); +vc->registerAtom(id1691); +Expr id1693=vc->plusExpr(id487,id109); +Expr id1695=vc->leExpr(id1693,id1621); +Expr id1694=vc->notExpr(id1695); +vc->registerAtom(id1695); +Expr id1697=vc->plusExpr(id493,id109); +Expr id1699=vc->leExpr(id1697,id875); +Expr id1698=vc->notExpr(id1699); +vc->registerAtom(id1699); +Expr id1701=vc->plusExpr(id451,id107); +Expr id1703=vc->leExpr(id1701,id1621); +Expr id1702=vc->notExpr(id1703); +vc->registerAtom(id1703); +Expr id1705=vc->plusExpr(id457,id107); +Expr id1707=vc->leExpr(id1705,id875); +Expr id1706=vc->notExpr(id1707); +vc->registerAtom(id1707); +Expr id1709=vc->plusExpr(id415,id105); +Expr id1711=vc->leExpr(id1709,id1621); +Expr id1710=vc->notExpr(id1711); +vc->registerAtom(id1711); +Expr id1713=vc->plusExpr(id421,id105); +Expr id1715=vc->leExpr(id1713,id875); +Expr id1714=vc->notExpr(id1715); +vc->registerAtom(id1715); +Expr id1717=vc->plusExpr(id379,id103); +Expr id1719=vc->leExpr(id1717,id1621); +Expr id1718=vc->notExpr(id1719); +vc->registerAtom(id1719); +Expr id1721=vc->plusExpr(id385,id103); +Expr id1723=vc->leExpr(id1721,id875); +Expr id1722=vc->notExpr(id1723); +vc->registerAtom(id1723); +Expr id1725=vc->plusExpr(id343,id101); +Expr id1727=vc->leExpr(id1725,id1621); +Expr id1726=vc->notExpr(id1727); +vc->registerAtom(id1727); +Expr id1729=vc->plusExpr(id349,id101); +Expr id1731=vc->leExpr(id1729,id875); +Expr id1730=vc->notExpr(id1731); +vc->registerAtom(id1731); +Expr id1733=vc->plusExpr(id307,id99); +Expr id1735=vc->leExpr(id1733,id1621); +Expr id1734=vc->notExpr(id1735); +vc->registerAtom(id1735); +Expr id1737=vc->plusExpr(id313,id99); +Expr id1739=vc->leExpr(id1737,id875); +Expr id1738=vc->notExpr(id1739); +vc->registerAtom(id1739); +Expr id1741=vc->plusExpr(id271,id97); +Expr id1743=vc->leExpr(id1741,id1621); +Expr id1742=vc->notExpr(id1743); +vc->registerAtom(id1743); +Expr id1745=vc->plusExpr(id277,id97); +Expr id1747=vc->leExpr(id1745,id875); +Expr id1746=vc->notExpr(id1747); +vc->registerAtom(id1747); +Expr id1749=vc->plusExpr(id235,id95); +Expr id1751=vc->leExpr(id1749,id1621); +Expr id1750=vc->notExpr(id1751); +vc->registerAtom(id1751); +Expr id1753=vc->plusExpr(id241,id95); +Expr id1755=vc->leExpr(id1753,id875); +Expr id1754=vc->notExpr(id1755); +vc->registerAtom(id1755); +Expr id1757=vc->plusExpr(id199,id93); +Expr id1759=vc->leExpr(id1757,id1621); +Expr id1758=vc->notExpr(id1759); +vc->registerAtom(id1759); +Expr id1761=vc->plusExpr(id205,id93); +Expr id1763=vc->leExpr(id1761,id875); +Expr id1762=vc->notExpr(id1763); +vc->registerAtom(id1763); +Expr id1765=vc->plusExpr(id155,id91); +Expr id1767=vc->leExpr(id1765,id1621); +Expr id1766=vc->notExpr(id1767); +vc->registerAtom(id1767); +Expr id1769=vc->plusExpr(id161,id91); +Expr id1771=vc->leExpr(id1769,id875); +Expr id1770=vc->notExpr(id1771); +vc->registerAtom(id1771); +Expr id1773=vc->plusExpr(id895,id89); +Expr id1775=vc->leExpr(id1773,id1621); +Expr id1774=vc->notExpr(id1775); +vc->registerAtom(id1775); +Expr id1777=vc->leExpr(id1773,id875); +Expr id1776=vc->notExpr(id1777); +vc->registerAtom(id1777); +Expr id1779=vc->leExpr(id855,id875); +Expr id1778=vc->notExpr(id1779); +vc->registerAtom(id1779); +Expr id1781=vc->geExpr(id855,id895); +Expr id1780=vc->notExpr(id1781); +vc->registerAtom(id1781); +Expr id1785=vc->leExpr(id819,id875); +Expr id1784=vc->notExpr(id1785); +vc->registerAtom(id1785); +Expr id1789=vc->geExpr(id819,id895); +Expr id1788=vc->notExpr(id1789); +vc->registerAtom(id1789); +Expr id1793=vc->leExpr(id783,id875); +Expr id1792=vc->notExpr(id1793); +vc->registerAtom(id1793); +Expr id1797=vc->geExpr(id783,id895); +Expr id1796=vc->notExpr(id1797); +vc->registerAtom(id1797); +Expr id1801=vc->leExpr(id747,id875); +Expr id1800=vc->notExpr(id1801); +vc->registerAtom(id1801); +Expr id1805=vc->geExpr(id747,id895); +Expr id1804=vc->notExpr(id1805); +vc->registerAtom(id1805); +Expr id1809=vc->leExpr(id711,id875); +Expr id1808=vc->notExpr(id1809); +vc->registerAtom(id1809); +Expr id1813=vc->geExpr(id711,id895); +Expr id1812=vc->notExpr(id1813); +vc->registerAtom(id1813); +Expr id1817=vc->leExpr(id675,id875); +Expr id1816=vc->notExpr(id1817); +vc->registerAtom(id1817); +Expr id1821=vc->geExpr(id675,id895); +Expr id1820=vc->notExpr(id1821); +vc->registerAtom(id1821); +Expr id1825=vc->leExpr(id639,id875); +Expr id1824=vc->notExpr(id1825); +vc->registerAtom(id1825); +Expr id1829=vc->geExpr(id639,id895); +Expr id1828=vc->notExpr(id1829); +vc->registerAtom(id1829); +Expr id1833=vc->leExpr(id603,id875); +Expr id1832=vc->notExpr(id1833); +vc->registerAtom(id1833); +Expr id1837=vc->geExpr(id603,id895); +Expr id1836=vc->notExpr(id1837); +vc->registerAtom(id1837); +Expr id1841=vc->leExpr(id567,id875); +Expr id1840=vc->notExpr(id1841); +vc->registerAtom(id1841); +Expr id1845=vc->geExpr(id567,id895); +Expr id1844=vc->notExpr(id1845); +vc->registerAtom(id1845); +Expr id1849=vc->leExpr(id531,id875); +Expr id1848=vc->notExpr(id1849); +vc->registerAtom(id1849); +Expr id1853=vc->geExpr(id531,id895); +Expr id1852=vc->notExpr(id1853); +vc->registerAtom(id1853); +Expr id1857=vc->leExpr(id495,id875); +Expr id1856=vc->notExpr(id1857); +vc->registerAtom(id1857); +Expr id1861=vc->geExpr(id495,id895); +Expr id1860=vc->notExpr(id1861); +vc->registerAtom(id1861); +Expr id1865=vc->leExpr(id459,id875); +Expr id1864=vc->notExpr(id1865); +vc->registerAtom(id1865); +Expr id1869=vc->geExpr(id459,id895); +Expr id1868=vc->notExpr(id1869); +vc->registerAtom(id1869); +Expr id1873=vc->leExpr(id423,id875); +Expr id1872=vc->notExpr(id1873); +vc->registerAtom(id1873); +Expr id1877=vc->geExpr(id423,id895); +Expr id1876=vc->notExpr(id1877); +vc->registerAtom(id1877); +Expr id1881=vc->leExpr(id387,id875); +Expr id1880=vc->notExpr(id1881); +vc->registerAtom(id1881); +Expr id1885=vc->geExpr(id387,id895); +Expr id1884=vc->notExpr(id1885); +vc->registerAtom(id1885); +Expr id1889=vc->leExpr(id351,id875); +Expr id1888=vc->notExpr(id1889); +vc->registerAtom(id1889); +Expr id1893=vc->geExpr(id351,id895); +Expr id1892=vc->notExpr(id1893); +vc->registerAtom(id1893); +Expr id1897=vc->leExpr(id315,id875); +Expr id1896=vc->notExpr(id1897); +vc->registerAtom(id1897); +Expr id1901=vc->geExpr(id315,id895); +Expr id1900=vc->notExpr(id1901); +vc->registerAtom(id1901); +Expr id1905=vc->leExpr(id279,id875); +Expr id1904=vc->notExpr(id1905); +vc->registerAtom(id1905); +Expr id1909=vc->geExpr(id279,id895); +Expr id1908=vc->notExpr(id1909); +vc->registerAtom(id1909); +Expr id1913=vc->leExpr(id243,id875); +Expr id1912=vc->notExpr(id1913); +vc->registerAtom(id1913); +Expr id1917=vc->geExpr(id243,id895); +Expr id1916=vc->notExpr(id1917); +vc->registerAtom(id1917); +Expr id1921=vc->leExpr(id207,id875); +Expr id1920=vc->notExpr(id1921); +vc->registerAtom(id1921); +Expr id1925=vc->geExpr(id207,id895); +Expr id1924=vc->notExpr(id1925); +vc->registerAtom(id1925); +Expr id1929=vc->leExpr(id163,id875); +Expr id1928=vc->notExpr(id1929); +vc->registerAtom(id1929); +Expr id1933=vc->geExpr(id163,id895); +Expr id1932=vc->notExpr(id1933); +vc->registerAtom(id1933); +Expr id1949=vc->ltExpr(id129,id895); +Expr id1948=vc->notExpr(id1949); +vc->registerAtom(id1949); +Expr id1955=vc->ltExpr(id127,id895); +Expr id1954=vc->notExpr(id1955); +vc->registerAtom(id1955); +Expr id1961=vc->ltExpr(id125,id895); +Expr id1960=vc->notExpr(id1961); +vc->registerAtom(id1961); +Expr id1967=vc->ltExpr(id123,id895); +Expr id1966=vc->notExpr(id1967); +vc->registerAtom(id1967); +Expr id1973=vc->ltExpr(id121,id895); +Expr id1972=vc->notExpr(id1973); +vc->registerAtom(id1973); +Expr id1979=vc->ltExpr(id119,id895); +Expr id1978=vc->notExpr(id1979); +vc->registerAtom(id1979); +Expr id1985=vc->ltExpr(id117,id895); +Expr id1984=vc->notExpr(id1985); +vc->registerAtom(id1985); +Expr id1991=vc->ltExpr(id115,id895); +Expr id1990=vc->notExpr(id1991); +vc->registerAtom(id1991); +Expr id1997=vc->ltExpr(id113,id895); +Expr id1996=vc->notExpr(id1997); +vc->registerAtom(id1997); +Expr id2003=vc->ltExpr(id111,id895); +Expr id2002=vc->notExpr(id2003); +vc->registerAtom(id2003); +Expr id2009=vc->ltExpr(id109,id895); +Expr id2008=vc->notExpr(id2009); +vc->registerAtom(id2009); +Expr id2015=vc->ltExpr(id107,id895); +Expr id2014=vc->notExpr(id2015); +vc->registerAtom(id2015); +Expr id2021=vc->ltExpr(id105,id895); +Expr id2020=vc->notExpr(id2021); +vc->registerAtom(id2021); +Expr id2027=vc->ltExpr(id103,id895); +Expr id2026=vc->notExpr(id2027); +vc->registerAtom(id2027); +Expr id2033=vc->ltExpr(id101,id895); +Expr id2032=vc->notExpr(id2033); +vc->registerAtom(id2033); +Expr id2039=vc->ltExpr(id99,id895); +Expr id2038=vc->notExpr(id2039); +vc->registerAtom(id2039); +Expr id2045=vc->ltExpr(id97,id895); +Expr id2044=vc->notExpr(id2045); +vc->registerAtom(id2045); +Expr id2051=vc->ltExpr(id95,id895); +Expr id2050=vc->notExpr(id2051); +vc->registerAtom(id2051); +Expr id2057=vc->ltExpr(id93,id895); +Expr id2056=vc->notExpr(id2057); +vc->registerAtom(id2057); +Expr id2063=vc->ltExpr(id91,id895); +Expr id2062=vc->notExpr(id2063); +vc->registerAtom(id2063); +Expr id2069=vc->ltExpr(id89,id895); +Expr id2068=vc->notExpr(id2069); +vc->registerAtom(id2069); +Expr id2077=vc->varExpr("2075_c",id9); +Expr id2079=vc->eqExpr(id2077,id895); +Expr id2078=vc->notExpr(id2079); +vc->registerAtom(id2079); +Expr id2081=vc->eqExpr(id2077,id875); +Expr id2080=vc->notExpr(id2081); +vc->registerAtom(id2081); +Expr id2093=vc->eqExpr(id2077,id855); +Expr id2092=vc->notExpr(id2093); +vc->registerAtom(id2093); +Expr id2099=vc->eqExpr(id895,id857); +Expr id2098=vc->notExpr(id2099); +vc->registerAtom(id2099); +Expr id2115=vc->eqExpr(id895,id847); +Expr id2114=vc->notExpr(id2115); +vc->registerAtom(id2115); +Expr id2119=vc->eqExpr(id875,id857); +Expr id2118=vc->notExpr(id2119); +vc->registerAtom(id2119); +Expr id2127=vc->ratExpr(2,1); +Expr id2129=vc->leExpr(id811,id2127); +Expr id2128=vc->notExpr(id2129); +vc->registerAtom(id2129); +Expr id2145=vc->eqExpr(id2127,id857); +Expr id2144=vc->notExpr(id2145); +vc->registerAtom(id2145); +Expr id2163=vc->ratExpr(3,1); +Expr id2165=vc->eqExpr(id2163,id857); +Expr id2164=vc->notExpr(id2165); +vc->registerAtom(id2165); +Expr id2185=vc->ratExpr(4,1); +Expr id2187=vc->eqExpr(id2185,id857); +Expr id2186=vc->notExpr(id2187); +vc->registerAtom(id2187); +Expr id2209=vc->eqExpr(id1619,id847); +Expr id2208=vc->notExpr(id2209); +vc->registerAtom(id2209); +Expr id2225=vc->eqExpr(id1621,id857); +Expr id2224=vc->notExpr(id2225); +vc->registerAtom(id2225); +Expr id2239=vc->eqExpr(id895,id859); +Expr id2238=vc->notExpr(id2239); +vc->registerAtom(id2239); +Expr id2259=vc->eqExpr(id875,id859); +Expr id2258=vc->notExpr(id2259); +vc->registerAtom(id2259); +Expr id2267=vc->eqExpr(id875,id817); +Expr id2266=vc->notExpr(id2267); +vc->registerAtom(id2267); +Expr id2283=vc->eqExpr(id2127,id859); +Expr id2282=vc->notExpr(id2283); +vc->registerAtom(id2283); +Expr id2305=vc->eqExpr(id2163,id859); +Expr id2304=vc->notExpr(id2305); +vc->registerAtom(id2305); +Expr id2325=vc->eqExpr(id2185,id859); +Expr id2324=vc->notExpr(id2325); +vc->registerAtom(id2325); +Expr id2341=vc->eqExpr(id1625,id853); +Expr id2340=vc->notExpr(id2341); +vc->registerAtom(id2341); +Expr id2357=vc->eqExpr(id1621,id859); +Expr id2356=vc->notExpr(id2357); +vc->registerAtom(id2357); +Expr id2375=vc->eqExpr(id895,id861); +Expr id2374=vc->notExpr(id2375); +vc->registerAtom(id2375); +Expr id2395=vc->eqExpr(id875,id861); +Expr id2394=vc->notExpr(id2395); +vc->registerAtom(id2395); +Expr id2413=vc->eqExpr(id2127,id861); +Expr id2412=vc->notExpr(id2413); +vc->registerAtom(id2413); +Expr id2435=vc->eqExpr(id2163,id861); +Expr id2434=vc->notExpr(id2435); +vc->registerAtom(id2435); +Expr id2443=vc->ltExpr(id797,id875); +Expr id2442=vc->notExpr(id2443); +vc->registerAtom(id2443); +Expr id2459=vc->eqExpr(id2185,id861); +Expr id2458=vc->notExpr(id2459); +vc->registerAtom(id2459); +Expr id2465=vc->plusExpr(id797,id127); +Expr id2467=vc->leExpr(id2465,id875); +Expr id2466=vc->notExpr(id2467); +vc->registerAtom(id2467); +Expr id2475=vc->leExpr(id2465,id2127); +Expr id2474=vc->notExpr(id2475); +vc->registerAtom(id2475); +Expr id2481=vc->eqExpr(id2465,id833); +Expr id2480=vc->notExpr(id2481); +vc->registerAtom(id2481); +Expr id2491=vc->eqExpr(id1621,id861); +Expr id2490=vc->notExpr(id2491); +vc->registerAtom(id2491); +Expr id2511=vc->varExpr("2509_c",id9); +Expr id2513=vc->eqExpr(id2511,id895); +Expr id2512=vc->notExpr(id2513); +vc->registerAtom(id2513); +Expr id2515=vc->eqExpr(id2511,id875); +Expr id2514=vc->notExpr(id2515); +vc->registerAtom(id2515); +Expr id2527=vc->eqExpr(id2511,id819); +Expr id2526=vc->notExpr(id2527); +vc->registerAtom(id2527); +Expr id2533=vc->eqExpr(id895,id821); +Expr id2532=vc->notExpr(id2533); +vc->registerAtom(id2533); +Expr id2549=vc->eqExpr(id895,id811); +Expr id2548=vc->notExpr(id2549); +vc->registerAtom(id2549); +Expr id2553=vc->eqExpr(id875,id821); +Expr id2552=vc->notExpr(id2553); +vc->registerAtom(id2553); +Expr id2561=vc->leExpr(id775,id2127); +Expr id2560=vc->notExpr(id2561); +vc->registerAtom(id2561); +Expr id2577=vc->eqExpr(id2127,id821); +Expr id2576=vc->notExpr(id2577); +vc->registerAtom(id2577); +Expr id2595=vc->eqExpr(id2163,id821); +Expr id2594=vc->notExpr(id2595); +vc->registerAtom(id2595); +Expr id2615=vc->eqExpr(id2185,id821); +Expr id2614=vc->notExpr(id2615); +vc->registerAtom(id2615); +Expr id2637=vc->eqExpr(id1629,id811); +Expr id2636=vc->notExpr(id2637); +vc->registerAtom(id2637); +Expr id2653=vc->eqExpr(id1621,id821); +Expr id2652=vc->notExpr(id2653); +vc->registerAtom(id2653); +Expr id2667=vc->eqExpr(id895,id823); +Expr id2666=vc->notExpr(id2667); +vc->registerAtom(id2667); +Expr id2687=vc->eqExpr(id875,id823); +Expr id2686=vc->notExpr(id2687); +vc->registerAtom(id2687); +Expr id2695=vc->eqExpr(id875,id781); +Expr id2694=vc->notExpr(id2695); +vc->registerAtom(id2695); +Expr id2711=vc->eqExpr(id2127,id823); +Expr id2710=vc->notExpr(id2711); +vc->registerAtom(id2711); +Expr id2733=vc->eqExpr(id2163,id823); +Expr id2732=vc->notExpr(id2733); +vc->registerAtom(id2733); +Expr id2753=vc->eqExpr(id2185,id823); +Expr id2752=vc->notExpr(id2753); +vc->registerAtom(id2753); +Expr id2769=vc->eqExpr(id1633,id817); +Expr id2768=vc->notExpr(id2769); +vc->registerAtom(id2769); +Expr id2785=vc->eqExpr(id1621,id823); +Expr id2784=vc->notExpr(id2785); +vc->registerAtom(id2785); +Expr id2803=vc->eqExpr(id895,id825); +Expr id2802=vc->notExpr(id2803); +vc->registerAtom(id2803); +Expr id2823=vc->eqExpr(id875,id825); +Expr id2822=vc->notExpr(id2823); +vc->registerAtom(id2823); +Expr id2841=vc->eqExpr(id2127,id825); +Expr id2840=vc->notExpr(id2841); +vc->registerAtom(id2841); +Expr id2863=vc->eqExpr(id2163,id825); +Expr id2862=vc->notExpr(id2863); +vc->registerAtom(id2863); +Expr id2871=vc->ltExpr(id761,id875); +Expr id2870=vc->notExpr(id2871); +vc->registerAtom(id2871); +Expr id2887=vc->eqExpr(id2185,id825); +Expr id2886=vc->notExpr(id2887); +vc->registerAtom(id2887); +Expr id2893=vc->plusExpr(id761,id125); +Expr id2895=vc->leExpr(id2893,id875); +Expr id2894=vc->notExpr(id2895); +vc->registerAtom(id2895); +Expr id2903=vc->leExpr(id2893,id2127); +Expr id2902=vc->notExpr(id2903); +vc->registerAtom(id2903); +Expr id2909=vc->eqExpr(id2893,id797); +Expr id2908=vc->notExpr(id2909); +vc->registerAtom(id2909); +Expr id2919=vc->eqExpr(id1621,id825); +Expr id2918=vc->notExpr(id2919); +vc->registerAtom(id2919); +Expr id2939=vc->varExpr("2937_c",id9); +Expr id2941=vc->eqExpr(id2939,id895); +Expr id2940=vc->notExpr(id2941); +vc->registerAtom(id2941); +Expr id2943=vc->eqExpr(id2939,id875); +Expr id2942=vc->notExpr(id2943); +vc->registerAtom(id2943); +Expr id2955=vc->eqExpr(id2939,id783); +Expr id2954=vc->notExpr(id2955); +vc->registerAtom(id2955); +Expr id2961=vc->eqExpr(id895,id785); +Expr id2960=vc->notExpr(id2961); +vc->registerAtom(id2961); +Expr id2977=vc->eqExpr(id895,id775); +Expr id2976=vc->notExpr(id2977); +vc->registerAtom(id2977); +Expr id2981=vc->eqExpr(id875,id785); +Expr id2980=vc->notExpr(id2981); +vc->registerAtom(id2981); +Expr id2989=vc->leExpr(id739,id2127); +Expr id2988=vc->notExpr(id2989); +vc->registerAtom(id2989); +Expr id3005=vc->eqExpr(id2127,id785); +Expr id3004=vc->notExpr(id3005); +vc->registerAtom(id3005); +Expr id3023=vc->eqExpr(id2163,id785); +Expr id3022=vc->notExpr(id3023); +vc->registerAtom(id3023); +Expr id3043=vc->eqExpr(id2185,id785); +Expr id3042=vc->notExpr(id3043); +vc->registerAtom(id3043); +Expr id3065=vc->eqExpr(id1637,id775); +Expr id3064=vc->notExpr(id3065); +vc->registerAtom(id3065); +Expr id3081=vc->eqExpr(id1621,id785); +Expr id3080=vc->notExpr(id3081); +vc->registerAtom(id3081); +Expr id3095=vc->eqExpr(id895,id787); +Expr id3094=vc->notExpr(id3095); +vc->registerAtom(id3095); +Expr id3115=vc->eqExpr(id875,id787); +Expr id3114=vc->notExpr(id3115); +vc->registerAtom(id3115); +Expr id3123=vc->eqExpr(id875,id745); +Expr id3122=vc->notExpr(id3123); +vc->registerAtom(id3123); +Expr id3139=vc->eqExpr(id2127,id787); +Expr id3138=vc->notExpr(id3139); +vc->registerAtom(id3139); +Expr id3161=vc->eqExpr(id2163,id787); +Expr id3160=vc->notExpr(id3161); +vc->registerAtom(id3161); +Expr id3181=vc->eqExpr(id2185,id787); +Expr id3180=vc->notExpr(id3181); +vc->registerAtom(id3181); +Expr id3197=vc->eqExpr(id1641,id781); +Expr id3196=vc->notExpr(id3197); +vc->registerAtom(id3197); +Expr id3213=vc->eqExpr(id1621,id787); +Expr id3212=vc->notExpr(id3213); +vc->registerAtom(id3213); +Expr id3231=vc->eqExpr(id895,id789); +Expr id3230=vc->notExpr(id3231); +vc->registerAtom(id3231); +Expr id3251=vc->eqExpr(id875,id789); +Expr id3250=vc->notExpr(id3251); +vc->registerAtom(id3251); +Expr id3269=vc->eqExpr(id2127,id789); +Expr id3268=vc->notExpr(id3269); +vc->registerAtom(id3269); +Expr id3291=vc->eqExpr(id2163,id789); +Expr id3290=vc->notExpr(id3291); +vc->registerAtom(id3291); +Expr id3299=vc->ltExpr(id725,id875); +Expr id3298=vc->notExpr(id3299); +vc->registerAtom(id3299); +Expr id3315=vc->eqExpr(id2185,id789); +Expr id3314=vc->notExpr(id3315); +vc->registerAtom(id3315); +Expr id3321=vc->plusExpr(id725,id123); +Expr id3323=vc->leExpr(id3321,id875); +Expr id3322=vc->notExpr(id3323); +vc->registerAtom(id3323); +Expr id3331=vc->leExpr(id3321,id2127); +Expr id3330=vc->notExpr(id3331); +vc->registerAtom(id3331); +Expr id3337=vc->eqExpr(id3321,id761); +Expr id3336=vc->notExpr(id3337); +vc->registerAtom(id3337); +Expr id3347=vc->eqExpr(id1621,id789); +Expr id3346=vc->notExpr(id3347); +vc->registerAtom(id3347); +Expr id3367=vc->varExpr("3365_c",id9); +Expr id3369=vc->eqExpr(id3367,id895); +Expr id3368=vc->notExpr(id3369); +vc->registerAtom(id3369); +Expr id3371=vc->eqExpr(id3367,id875); +Expr id3370=vc->notExpr(id3371); +vc->registerAtom(id3371); +Expr id3383=vc->eqExpr(id3367,id747); +Expr id3382=vc->notExpr(id3383); +vc->registerAtom(id3383); +Expr id3389=vc->eqExpr(id895,id749); +Expr id3388=vc->notExpr(id3389); +vc->registerAtom(id3389); +Expr id3405=vc->eqExpr(id895,id739); +Expr id3404=vc->notExpr(id3405); +vc->registerAtom(id3405); +Expr id3409=vc->eqExpr(id875,id749); +Expr id3408=vc->notExpr(id3409); +vc->registerAtom(id3409); +Expr id3417=vc->leExpr(id703,id2127); +Expr id3416=vc->notExpr(id3417); +vc->registerAtom(id3417); +Expr id3433=vc->eqExpr(id2127,id749); +Expr id3432=vc->notExpr(id3433); +vc->registerAtom(id3433); +Expr id3451=vc->eqExpr(id2163,id749); +Expr id3450=vc->notExpr(id3451); +vc->registerAtom(id3451); +Expr id3471=vc->eqExpr(id2185,id749); +Expr id3470=vc->notExpr(id3471); +vc->registerAtom(id3471); +Expr id3493=vc->eqExpr(id1645,id739); +Expr id3492=vc->notExpr(id3493); +vc->registerAtom(id3493); +Expr id3509=vc->eqExpr(id1621,id749); +Expr id3508=vc->notExpr(id3509); +vc->registerAtom(id3509); +Expr id3523=vc->eqExpr(id895,id751); +Expr id3522=vc->notExpr(id3523); +vc->registerAtom(id3523); +Expr id3543=vc->eqExpr(id875,id751); +Expr id3542=vc->notExpr(id3543); +vc->registerAtom(id3543); +Expr id3551=vc->eqExpr(id875,id709); +Expr id3550=vc->notExpr(id3551); +vc->registerAtom(id3551); +Expr id3567=vc->eqExpr(id2127,id751); +Expr id3566=vc->notExpr(id3567); +vc->registerAtom(id3567); +Expr id3589=vc->eqExpr(id2163,id751); +Expr id3588=vc->notExpr(id3589); +vc->registerAtom(id3589); +Expr id3609=vc->eqExpr(id2185,id751); +Expr id3608=vc->notExpr(id3609); +vc->registerAtom(id3609); +Expr id3625=vc->eqExpr(id1649,id745); +Expr id3624=vc->notExpr(id3625); +vc->registerAtom(id3625); +Expr id3641=vc->eqExpr(id1621,id751); +Expr id3640=vc->notExpr(id3641); +vc->registerAtom(id3641); +Expr id3659=vc->eqExpr(id895,id753); +Expr id3658=vc->notExpr(id3659); +vc->registerAtom(id3659); +Expr id3679=vc->eqExpr(id875,id753); +Expr id3678=vc->notExpr(id3679); +vc->registerAtom(id3679); +Expr id3697=vc->eqExpr(id2127,id753); +Expr id3696=vc->notExpr(id3697); +vc->registerAtom(id3697); +Expr id3719=vc->eqExpr(id2163,id753); +Expr id3718=vc->notExpr(id3719); +vc->registerAtom(id3719); +Expr id3727=vc->ltExpr(id689,id875); +Expr id3726=vc->notExpr(id3727); +vc->registerAtom(id3727); +Expr id3743=vc->eqExpr(id2185,id753); +Expr id3742=vc->notExpr(id3743); +vc->registerAtom(id3743); +Expr id3749=vc->plusExpr(id689,id121); +Expr id3751=vc->leExpr(id3749,id875); +Expr id3750=vc->notExpr(id3751); +vc->registerAtom(id3751); +Expr id3759=vc->leExpr(id3749,id2127); +Expr id3758=vc->notExpr(id3759); +vc->registerAtom(id3759); +Expr id3765=vc->eqExpr(id3749,id725); +Expr id3764=vc->notExpr(id3765); +vc->registerAtom(id3765); +Expr id3775=vc->eqExpr(id1621,id753); +Expr id3774=vc->notExpr(id3775); +vc->registerAtom(id3775); +Expr id3795=vc->varExpr("3793_c",id9); +Expr id3797=vc->eqExpr(id3795,id895); +Expr id3796=vc->notExpr(id3797); +vc->registerAtom(id3797); +Expr id3799=vc->eqExpr(id3795,id875); +Expr id3798=vc->notExpr(id3799); +vc->registerAtom(id3799); +Expr id3811=vc->eqExpr(id3795,id711); +Expr id3810=vc->notExpr(id3811); +vc->registerAtom(id3811); +Expr id3817=vc->eqExpr(id895,id713); +Expr id3816=vc->notExpr(id3817); +vc->registerAtom(id3817); +Expr id3833=vc->eqExpr(id895,id703); +Expr id3832=vc->notExpr(id3833); +vc->registerAtom(id3833); +Expr id3837=vc->eqExpr(id875,id713); +Expr id3836=vc->notExpr(id3837); +vc->registerAtom(id3837); +Expr id3845=vc->leExpr(id667,id2127); +Expr id3844=vc->notExpr(id3845); +vc->registerAtom(id3845); +Expr id3861=vc->eqExpr(id2127,id713); +Expr id3860=vc->notExpr(id3861); +vc->registerAtom(id3861); +Expr id3879=vc->eqExpr(id2163,id713); +Expr id3878=vc->notExpr(id3879); +vc->registerAtom(id3879); +Expr id3899=vc->eqExpr(id2185,id713); +Expr id3898=vc->notExpr(id3899); +vc->registerAtom(id3899); +Expr id3921=vc->eqExpr(id1653,id703); +Expr id3920=vc->notExpr(id3921); +vc->registerAtom(id3921); +Expr id3937=vc->eqExpr(id1621,id713); +Expr id3936=vc->notExpr(id3937); +vc->registerAtom(id3937); +Expr id3951=vc->eqExpr(id895,id715); +Expr id3950=vc->notExpr(id3951); +vc->registerAtom(id3951); +Expr id3971=vc->eqExpr(id875,id715); +Expr id3970=vc->notExpr(id3971); +vc->registerAtom(id3971); +Expr id3979=vc->eqExpr(id875,id673); +Expr id3978=vc->notExpr(id3979); +vc->registerAtom(id3979); +Expr id3995=vc->eqExpr(id2127,id715); +Expr id3994=vc->notExpr(id3995); +vc->registerAtom(id3995); +Expr id4017=vc->eqExpr(id2163,id715); +Expr id4016=vc->notExpr(id4017); +vc->registerAtom(id4017); +Expr id4037=vc->eqExpr(id2185,id715); +Expr id4036=vc->notExpr(id4037); +vc->registerAtom(id4037); +Expr id4053=vc->eqExpr(id1657,id709); +Expr id4052=vc->notExpr(id4053); +vc->registerAtom(id4053); +Expr id4069=vc->eqExpr(id1621,id715); +Expr id4068=vc->notExpr(id4069); +vc->registerAtom(id4069); +Expr id4087=vc->eqExpr(id895,id717); +Expr id4086=vc->notExpr(id4087); +vc->registerAtom(id4087); +Expr id4107=vc->eqExpr(id875,id717); +Expr id4106=vc->notExpr(id4107); +vc->registerAtom(id4107); +Expr id4125=vc->eqExpr(id2127,id717); +Expr id4124=vc->notExpr(id4125); +vc->registerAtom(id4125); +Expr id4147=vc->eqExpr(id2163,id717); +Expr id4146=vc->notExpr(id4147); +vc->registerAtom(id4147); +Expr id4155=vc->ltExpr(id653,id875); +Expr id4154=vc->notExpr(id4155); +vc->registerAtom(id4155); +Expr id4171=vc->eqExpr(id2185,id717); +Expr id4170=vc->notExpr(id4171); +vc->registerAtom(id4171); +Expr id4177=vc->plusExpr(id653,id119); +Expr id4179=vc->leExpr(id4177,id875); +Expr id4178=vc->notExpr(id4179); +vc->registerAtom(id4179); +Expr id4187=vc->leExpr(id4177,id2127); +Expr id4186=vc->notExpr(id4187); +vc->registerAtom(id4187); +Expr id4193=vc->eqExpr(id4177,id689); +Expr id4192=vc->notExpr(id4193); +vc->registerAtom(id4193); +Expr id4203=vc->eqExpr(id1621,id717); +Expr id4202=vc->notExpr(id4203); +vc->registerAtom(id4203); +Expr id4223=vc->varExpr("4221_c",id9); +Expr id4225=vc->eqExpr(id4223,id895); +Expr id4224=vc->notExpr(id4225); +vc->registerAtom(id4225); +Expr id4227=vc->eqExpr(id4223,id875); +Expr id4226=vc->notExpr(id4227); +vc->registerAtom(id4227); +Expr id4239=vc->eqExpr(id4223,id675); +Expr id4238=vc->notExpr(id4239); +vc->registerAtom(id4239); +Expr id4245=vc->eqExpr(id895,id677); +Expr id4244=vc->notExpr(id4245); +vc->registerAtom(id4245); +Expr id4261=vc->eqExpr(id895,id667); +Expr id4260=vc->notExpr(id4261); +vc->registerAtom(id4261); +Expr id4265=vc->eqExpr(id875,id677); +Expr id4264=vc->notExpr(id4265); +vc->registerAtom(id4265); +Expr id4273=vc->leExpr(id631,id2127); +Expr id4272=vc->notExpr(id4273); +vc->registerAtom(id4273); +Expr id4289=vc->eqExpr(id2127,id677); +Expr id4288=vc->notExpr(id4289); +vc->registerAtom(id4289); +Expr id4307=vc->eqExpr(id2163,id677); +Expr id4306=vc->notExpr(id4307); +vc->registerAtom(id4307); +Expr id4327=vc->eqExpr(id2185,id677); +Expr id4326=vc->notExpr(id4327); +vc->registerAtom(id4327); +Expr id4349=vc->eqExpr(id1661,id667); +Expr id4348=vc->notExpr(id4349); +vc->registerAtom(id4349); +Expr id4365=vc->eqExpr(id1621,id677); +Expr id4364=vc->notExpr(id4365); +vc->registerAtom(id4365); +Expr id4379=vc->eqExpr(id895,id679); +Expr id4378=vc->notExpr(id4379); +vc->registerAtom(id4379); +Expr id4399=vc->eqExpr(id875,id679); +Expr id4398=vc->notExpr(id4399); +vc->registerAtom(id4399); +Expr id4407=vc->eqExpr(id875,id637); +Expr id4406=vc->notExpr(id4407); +vc->registerAtom(id4407); +Expr id4423=vc->eqExpr(id2127,id679); +Expr id4422=vc->notExpr(id4423); +vc->registerAtom(id4423); +Expr id4445=vc->eqExpr(id2163,id679); +Expr id4444=vc->notExpr(id4445); +vc->registerAtom(id4445); +Expr id4465=vc->eqExpr(id2185,id679); +Expr id4464=vc->notExpr(id4465); +vc->registerAtom(id4465); +Expr id4481=vc->eqExpr(id1665,id673); +Expr id4480=vc->notExpr(id4481); +vc->registerAtom(id4481); +Expr id4497=vc->eqExpr(id1621,id679); +Expr id4496=vc->notExpr(id4497); +vc->registerAtom(id4497); +Expr id4515=vc->eqExpr(id895,id681); +Expr id4514=vc->notExpr(id4515); +vc->registerAtom(id4515); +Expr id4535=vc->eqExpr(id875,id681); +Expr id4534=vc->notExpr(id4535); +vc->registerAtom(id4535); +Expr id4553=vc->eqExpr(id2127,id681); +Expr id4552=vc->notExpr(id4553); +vc->registerAtom(id4553); +Expr id4575=vc->eqExpr(id2163,id681); +Expr id4574=vc->notExpr(id4575); +vc->registerAtom(id4575); +Expr id4583=vc->ltExpr(id617,id875); +Expr id4582=vc->notExpr(id4583); +vc->registerAtom(id4583); +Expr id4599=vc->eqExpr(id2185,id681); +Expr id4598=vc->notExpr(id4599); +vc->registerAtom(id4599); +Expr id4605=vc->plusExpr(id617,id117); +Expr id4607=vc->leExpr(id4605,id875); +Expr id4606=vc->notExpr(id4607); +vc->registerAtom(id4607); +Expr id4615=vc->leExpr(id4605,id2127); +Expr id4614=vc->notExpr(id4615); +vc->registerAtom(id4615); +Expr id4621=vc->eqExpr(id4605,id653); +Expr id4620=vc->notExpr(id4621); +vc->registerAtom(id4621); +Expr id4631=vc->eqExpr(id1621,id681); +Expr id4630=vc->notExpr(id4631); +vc->registerAtom(id4631); +Expr id4651=vc->varExpr("4649_c",id9); +Expr id4653=vc->eqExpr(id4651,id895); +Expr id4652=vc->notExpr(id4653); +vc->registerAtom(id4653); +Expr id4655=vc->eqExpr(id4651,id875); +Expr id4654=vc->notExpr(id4655); +vc->registerAtom(id4655); +Expr id4667=vc->eqExpr(id4651,id639); +Expr id4666=vc->notExpr(id4667); +vc->registerAtom(id4667); +Expr id4673=vc->eqExpr(id895,id641); +Expr id4672=vc->notExpr(id4673); +vc->registerAtom(id4673); +Expr id4689=vc->eqExpr(id895,id631); +Expr id4688=vc->notExpr(id4689); +vc->registerAtom(id4689); +Expr id4693=vc->eqExpr(id875,id641); +Expr id4692=vc->notExpr(id4693); +vc->registerAtom(id4693); +Expr id4701=vc->leExpr(id595,id2127); +Expr id4700=vc->notExpr(id4701); +vc->registerAtom(id4701); +Expr id4717=vc->eqExpr(id2127,id641); +Expr id4716=vc->notExpr(id4717); +vc->registerAtom(id4717); +Expr id4735=vc->eqExpr(id2163,id641); +Expr id4734=vc->notExpr(id4735); +vc->registerAtom(id4735); +Expr id4755=vc->eqExpr(id2185,id641); +Expr id4754=vc->notExpr(id4755); +vc->registerAtom(id4755); +Expr id4777=vc->eqExpr(id1669,id631); +Expr id4776=vc->notExpr(id4777); +vc->registerAtom(id4777); +Expr id4793=vc->eqExpr(id1621,id641); +Expr id4792=vc->notExpr(id4793); +vc->registerAtom(id4793); +Expr id4807=vc->eqExpr(id895,id643); +Expr id4806=vc->notExpr(id4807); +vc->registerAtom(id4807); +Expr id4827=vc->eqExpr(id875,id643); +Expr id4826=vc->notExpr(id4827); +vc->registerAtom(id4827); +Expr id4835=vc->eqExpr(id875,id601); +Expr id4834=vc->notExpr(id4835); +vc->registerAtom(id4835); +Expr id4851=vc->eqExpr(id2127,id643); +Expr id4850=vc->notExpr(id4851); +vc->registerAtom(id4851); +Expr id4873=vc->eqExpr(id2163,id643); +Expr id4872=vc->notExpr(id4873); +vc->registerAtom(id4873); +Expr id4893=vc->eqExpr(id2185,id643); +Expr id4892=vc->notExpr(id4893); +vc->registerAtom(id4893); +Expr id4909=vc->eqExpr(id1673,id637); +Expr id4908=vc->notExpr(id4909); +vc->registerAtom(id4909); +Expr id4925=vc->eqExpr(id1621,id643); +Expr id4924=vc->notExpr(id4925); +vc->registerAtom(id4925); +Expr id4943=vc->eqExpr(id895,id645); +Expr id4942=vc->notExpr(id4943); +vc->registerAtom(id4943); +Expr id4963=vc->eqExpr(id875,id645); +Expr id4962=vc->notExpr(id4963); +vc->registerAtom(id4963); +Expr id4981=vc->eqExpr(id2127,id645); +Expr id4980=vc->notExpr(id4981); +vc->registerAtom(id4981); +Expr id5003=vc->eqExpr(id2163,id645); +Expr id5002=vc->notExpr(id5003); +vc->registerAtom(id5003); +Expr id5011=vc->ltExpr(id581,id875); +Expr id5010=vc->notExpr(id5011); +vc->registerAtom(id5011); +Expr id5027=vc->eqExpr(id2185,id645); +Expr id5026=vc->notExpr(id5027); +vc->registerAtom(id5027); +Expr id5033=vc->plusExpr(id581,id115); +Expr id5035=vc->leExpr(id5033,id875); +Expr id5034=vc->notExpr(id5035); +vc->registerAtom(id5035); +Expr id5043=vc->leExpr(id5033,id2127); +Expr id5042=vc->notExpr(id5043); +vc->registerAtom(id5043); +Expr id5049=vc->eqExpr(id5033,id617); +Expr id5048=vc->notExpr(id5049); +vc->registerAtom(id5049); +Expr id5059=vc->eqExpr(id1621,id645); +Expr id5058=vc->notExpr(id5059); +vc->registerAtom(id5059); +Expr id5079=vc->varExpr("5077_c",id9); +Expr id5081=vc->eqExpr(id5079,id895); +Expr id5080=vc->notExpr(id5081); +vc->registerAtom(id5081); +Expr id5083=vc->eqExpr(id5079,id875); +Expr id5082=vc->notExpr(id5083); +vc->registerAtom(id5083); +Expr id5095=vc->eqExpr(id5079,id603); +Expr id5094=vc->notExpr(id5095); +vc->registerAtom(id5095); +Expr id5101=vc->eqExpr(id895,id605); +Expr id5100=vc->notExpr(id5101); +vc->registerAtom(id5101); +Expr id5117=vc->eqExpr(id895,id595); +Expr id5116=vc->notExpr(id5117); +vc->registerAtom(id5117); +Expr id5121=vc->eqExpr(id875,id605); +Expr id5120=vc->notExpr(id5121); +vc->registerAtom(id5121); +Expr id5129=vc->leExpr(id559,id2127); +Expr id5128=vc->notExpr(id5129); +vc->registerAtom(id5129); +Expr id5145=vc->eqExpr(id2127,id605); +Expr id5144=vc->notExpr(id5145); +vc->registerAtom(id5145); +Expr id5163=vc->eqExpr(id2163,id605); +Expr id5162=vc->notExpr(id5163); +vc->registerAtom(id5163); +Expr id5183=vc->eqExpr(id2185,id605); +Expr id5182=vc->notExpr(id5183); +vc->registerAtom(id5183); +Expr id5205=vc->eqExpr(id1677,id595); +Expr id5204=vc->notExpr(id5205); +vc->registerAtom(id5205); +Expr id5221=vc->eqExpr(id1621,id605); +Expr id5220=vc->notExpr(id5221); +vc->registerAtom(id5221); +Expr id5235=vc->eqExpr(id895,id607); +Expr id5234=vc->notExpr(id5235); +vc->registerAtom(id5235); +Expr id5255=vc->eqExpr(id875,id607); +Expr id5254=vc->notExpr(id5255); +vc->registerAtom(id5255); +Expr id5263=vc->eqExpr(id875,id565); +Expr id5262=vc->notExpr(id5263); +vc->registerAtom(id5263); +Expr id5279=vc->eqExpr(id2127,id607); +Expr id5278=vc->notExpr(id5279); +vc->registerAtom(id5279); +Expr id5301=vc->eqExpr(id2163,id607); +Expr id5300=vc->notExpr(id5301); +vc->registerAtom(id5301); +Expr id5321=vc->eqExpr(id2185,id607); +Expr id5320=vc->notExpr(id5321); +vc->registerAtom(id5321); +Expr id5337=vc->eqExpr(id1681,id601); +Expr id5336=vc->notExpr(id5337); +vc->registerAtom(id5337); +Expr id5353=vc->eqExpr(id1621,id607); +Expr id5352=vc->notExpr(id5353); +vc->registerAtom(id5353); +Expr id5371=vc->eqExpr(id895,id609); +Expr id5370=vc->notExpr(id5371); +vc->registerAtom(id5371); +Expr id5391=vc->eqExpr(id875,id609); +Expr id5390=vc->notExpr(id5391); +vc->registerAtom(id5391); +Expr id5409=vc->eqExpr(id2127,id609); +Expr id5408=vc->notExpr(id5409); +vc->registerAtom(id5409); +Expr id5431=vc->eqExpr(id2163,id609); +Expr id5430=vc->notExpr(id5431); +vc->registerAtom(id5431); +Expr id5439=vc->ltExpr(id545,id875); +Expr id5438=vc->notExpr(id5439); +vc->registerAtom(id5439); +Expr id5455=vc->eqExpr(id2185,id609); +Expr id5454=vc->notExpr(id5455); +vc->registerAtom(id5455); +Expr id5461=vc->plusExpr(id545,id113); +Expr id5463=vc->leExpr(id5461,id875); +Expr id5462=vc->notExpr(id5463); +vc->registerAtom(id5463); +Expr id5471=vc->leExpr(id5461,id2127); +Expr id5470=vc->notExpr(id5471); +vc->registerAtom(id5471); +Expr id5477=vc->eqExpr(id5461,id581); +Expr id5476=vc->notExpr(id5477); +vc->registerAtom(id5477); +Expr id5487=vc->eqExpr(id1621,id609); +Expr id5486=vc->notExpr(id5487); +vc->registerAtom(id5487); +Expr id5507=vc->varExpr("5505_c",id9); +Expr id5509=vc->eqExpr(id5507,id895); +Expr id5508=vc->notExpr(id5509); +vc->registerAtom(id5509); +Expr id5511=vc->eqExpr(id5507,id875); +Expr id5510=vc->notExpr(id5511); +vc->registerAtom(id5511); +Expr id5523=vc->eqExpr(id5507,id567); +Expr id5522=vc->notExpr(id5523); +vc->registerAtom(id5523); +Expr id5529=vc->eqExpr(id895,id569); +Expr id5528=vc->notExpr(id5529); +vc->registerAtom(id5529); +Expr id5545=vc->eqExpr(id895,id559); +Expr id5544=vc->notExpr(id5545); +vc->registerAtom(id5545); +Expr id5549=vc->eqExpr(id875,id569); +Expr id5548=vc->notExpr(id5549); +vc->registerAtom(id5549); +Expr id5557=vc->leExpr(id523,id2127); +Expr id5556=vc->notExpr(id5557); +vc->registerAtom(id5557); +Expr id5573=vc->eqExpr(id2127,id569); +Expr id5572=vc->notExpr(id5573); +vc->registerAtom(id5573); +Expr id5591=vc->eqExpr(id2163,id569); +Expr id5590=vc->notExpr(id5591); +vc->registerAtom(id5591); +Expr id5611=vc->eqExpr(id2185,id569); +Expr id5610=vc->notExpr(id5611); +vc->registerAtom(id5611); +Expr id5633=vc->eqExpr(id1685,id559); +Expr id5632=vc->notExpr(id5633); +vc->registerAtom(id5633); +Expr id5649=vc->eqExpr(id1621,id569); +Expr id5648=vc->notExpr(id5649); +vc->registerAtom(id5649); +Expr id5663=vc->eqExpr(id895,id571); +Expr id5662=vc->notExpr(id5663); +vc->registerAtom(id5663); +Expr id5683=vc->eqExpr(id875,id571); +Expr id5682=vc->notExpr(id5683); +vc->registerAtom(id5683); +Expr id5691=vc->eqExpr(id875,id529); +Expr id5690=vc->notExpr(id5691); +vc->registerAtom(id5691); +Expr id5707=vc->eqExpr(id2127,id571); +Expr id5706=vc->notExpr(id5707); +vc->registerAtom(id5707); +Expr id5729=vc->eqExpr(id2163,id571); +Expr id5728=vc->notExpr(id5729); +vc->registerAtom(id5729); +Expr id5749=vc->eqExpr(id2185,id571); +Expr id5748=vc->notExpr(id5749); +vc->registerAtom(id5749); +Expr id5765=vc->eqExpr(id1689,id565); +Expr id5764=vc->notExpr(id5765); +vc->registerAtom(id5765); +Expr id5781=vc->eqExpr(id1621,id571); +Expr id5780=vc->notExpr(id5781); +vc->registerAtom(id5781); +Expr id5799=vc->eqExpr(id895,id573); +Expr id5798=vc->notExpr(id5799); +vc->registerAtom(id5799); +Expr id5819=vc->eqExpr(id875,id573); +Expr id5818=vc->notExpr(id5819); +vc->registerAtom(id5819); +Expr id5837=vc->eqExpr(id2127,id573); +Expr id5836=vc->notExpr(id5837); +vc->registerAtom(id5837); +Expr id5859=vc->eqExpr(id2163,id573); +Expr id5858=vc->notExpr(id5859); +vc->registerAtom(id5859); +Expr id5867=vc->ltExpr(id509,id875); +Expr id5866=vc->notExpr(id5867); +vc->registerAtom(id5867); +Expr id5883=vc->eqExpr(id2185,id573); +Expr id5882=vc->notExpr(id5883); +vc->registerAtom(id5883); +Expr id5889=vc->plusExpr(id509,id111); +Expr id5891=vc->leExpr(id5889,id875); +Expr id5890=vc->notExpr(id5891); +vc->registerAtom(id5891); +Expr id5899=vc->leExpr(id5889,id2127); +Expr id5898=vc->notExpr(id5899); +vc->registerAtom(id5899); +Expr id5905=vc->eqExpr(id5889,id545); +Expr id5904=vc->notExpr(id5905); +vc->registerAtom(id5905); +Expr id5915=vc->eqExpr(id1621,id573); +Expr id5914=vc->notExpr(id5915); +vc->registerAtom(id5915); +Expr id5935=vc->varExpr("5933_c",id9); +Expr id5937=vc->eqExpr(id5935,id895); +Expr id5936=vc->notExpr(id5937); +vc->registerAtom(id5937); +Expr id5939=vc->eqExpr(id5935,id875); +Expr id5938=vc->notExpr(id5939); +vc->registerAtom(id5939); +Expr id5951=vc->eqExpr(id5935,id531); +Expr id5950=vc->notExpr(id5951); +vc->registerAtom(id5951); +Expr id5957=vc->eqExpr(id895,id533); +Expr id5956=vc->notExpr(id5957); +vc->registerAtom(id5957); +Expr id5973=vc->eqExpr(id895,id523); +Expr id5972=vc->notExpr(id5973); +vc->registerAtom(id5973); +Expr id5977=vc->eqExpr(id875,id533); +Expr id5976=vc->notExpr(id5977); +vc->registerAtom(id5977); +Expr id5985=vc->leExpr(id487,id2127); +Expr id5984=vc->notExpr(id5985); +vc->registerAtom(id5985); +Expr id6001=vc->eqExpr(id2127,id533); +Expr id6000=vc->notExpr(id6001); +vc->registerAtom(id6001); +Expr id6019=vc->eqExpr(id2163,id533); +Expr id6018=vc->notExpr(id6019); +vc->registerAtom(id6019); +Expr id6039=vc->eqExpr(id2185,id533); +Expr id6038=vc->notExpr(id6039); +vc->registerAtom(id6039); +Expr id6061=vc->eqExpr(id1693,id523); +Expr id6060=vc->notExpr(id6061); +vc->registerAtom(id6061); +Expr id6077=vc->eqExpr(id1621,id533); +Expr id6076=vc->notExpr(id6077); +vc->registerAtom(id6077); +Expr id6091=vc->eqExpr(id895,id535); +Expr id6090=vc->notExpr(id6091); +vc->registerAtom(id6091); +Expr id6111=vc->eqExpr(id875,id535); +Expr id6110=vc->notExpr(id6111); +vc->registerAtom(id6111); +Expr id6119=vc->eqExpr(id875,id493); +Expr id6118=vc->notExpr(id6119); +vc->registerAtom(id6119); +Expr id6135=vc->eqExpr(id2127,id535); +Expr id6134=vc->notExpr(id6135); +vc->registerAtom(id6135); +Expr id6157=vc->eqExpr(id2163,id535); +Expr id6156=vc->notExpr(id6157); +vc->registerAtom(id6157); +Expr id6177=vc->eqExpr(id2185,id535); +Expr id6176=vc->notExpr(id6177); +vc->registerAtom(id6177); +Expr id6193=vc->eqExpr(id1697,id529); +Expr id6192=vc->notExpr(id6193); +vc->registerAtom(id6193); +Expr id6209=vc->eqExpr(id1621,id535); +Expr id6208=vc->notExpr(id6209); +vc->registerAtom(id6209); +Expr id6227=vc->eqExpr(id895,id537); +Expr id6226=vc->notExpr(id6227); +vc->registerAtom(id6227); +Expr id6247=vc->eqExpr(id875,id537); +Expr id6246=vc->notExpr(id6247); +vc->registerAtom(id6247); +Expr id6265=vc->eqExpr(id2127,id537); +Expr id6264=vc->notExpr(id6265); +vc->registerAtom(id6265); +Expr id6287=vc->eqExpr(id2163,id537); +Expr id6286=vc->notExpr(id6287); +vc->registerAtom(id6287); +Expr id6295=vc->ltExpr(id473,id875); +Expr id6294=vc->notExpr(id6295); +vc->registerAtom(id6295); +Expr id6311=vc->eqExpr(id2185,id537); +Expr id6310=vc->notExpr(id6311); +vc->registerAtom(id6311); +Expr id6317=vc->plusExpr(id473,id109); +Expr id6319=vc->leExpr(id6317,id875); +Expr id6318=vc->notExpr(id6319); +vc->registerAtom(id6319); +Expr id6327=vc->leExpr(id6317,id2127); +Expr id6326=vc->notExpr(id6327); +vc->registerAtom(id6327); +Expr id6333=vc->eqExpr(id6317,id509); +Expr id6332=vc->notExpr(id6333); +vc->registerAtom(id6333); +Expr id6343=vc->eqExpr(id1621,id537); +Expr id6342=vc->notExpr(id6343); +vc->registerAtom(id6343); +Expr id6363=vc->varExpr("6361_c",id9); +Expr id6365=vc->eqExpr(id6363,id895); +Expr id6364=vc->notExpr(id6365); +vc->registerAtom(id6365); +Expr id6367=vc->eqExpr(id6363,id875); +Expr id6366=vc->notExpr(id6367); +vc->registerAtom(id6367); +Expr id6379=vc->eqExpr(id6363,id495); +Expr id6378=vc->notExpr(id6379); +vc->registerAtom(id6379); +Expr id6385=vc->eqExpr(id895,id497); +Expr id6384=vc->notExpr(id6385); +vc->registerAtom(id6385); +Expr id6401=vc->eqExpr(id895,id487); +Expr id6400=vc->notExpr(id6401); +vc->registerAtom(id6401); +Expr id6405=vc->eqExpr(id875,id497); +Expr id6404=vc->notExpr(id6405); +vc->registerAtom(id6405); +Expr id6413=vc->leExpr(id451,id2127); +Expr id6412=vc->notExpr(id6413); +vc->registerAtom(id6413); +Expr id6429=vc->eqExpr(id2127,id497); +Expr id6428=vc->notExpr(id6429); +vc->registerAtom(id6429); +Expr id6447=vc->eqExpr(id2163,id497); +Expr id6446=vc->notExpr(id6447); +vc->registerAtom(id6447); +Expr id6467=vc->eqExpr(id2185,id497); +Expr id6466=vc->notExpr(id6467); +vc->registerAtom(id6467); +Expr id6489=vc->eqExpr(id1701,id487); +Expr id6488=vc->notExpr(id6489); +vc->registerAtom(id6489); +Expr id6505=vc->eqExpr(id1621,id497); +Expr id6504=vc->notExpr(id6505); +vc->registerAtom(id6505); +Expr id6519=vc->eqExpr(id895,id499); +Expr id6518=vc->notExpr(id6519); +vc->registerAtom(id6519); +Expr id6539=vc->eqExpr(id875,id499); +Expr id6538=vc->notExpr(id6539); +vc->registerAtom(id6539); +Expr id6547=vc->eqExpr(id875,id457); +Expr id6546=vc->notExpr(id6547); +vc->registerAtom(id6547); +Expr id6563=vc->eqExpr(id2127,id499); +Expr id6562=vc->notExpr(id6563); +vc->registerAtom(id6563); +Expr id6585=vc->eqExpr(id2163,id499); +Expr id6584=vc->notExpr(id6585); +vc->registerAtom(id6585); +Expr id6605=vc->eqExpr(id2185,id499); +Expr id6604=vc->notExpr(id6605); +vc->registerAtom(id6605); +Expr id6621=vc->eqExpr(id1705,id493); +Expr id6620=vc->notExpr(id6621); +vc->registerAtom(id6621); +Expr id6637=vc->eqExpr(id1621,id499); +Expr id6636=vc->notExpr(id6637); +vc->registerAtom(id6637); +Expr id6655=vc->eqExpr(id895,id501); +Expr id6654=vc->notExpr(id6655); +vc->registerAtom(id6655); +Expr id6675=vc->eqExpr(id875,id501); +Expr id6674=vc->notExpr(id6675); +vc->registerAtom(id6675); +Expr id6693=vc->eqExpr(id2127,id501); +Expr id6692=vc->notExpr(id6693); +vc->registerAtom(id6693); +Expr id6715=vc->eqExpr(id2163,id501); +Expr id6714=vc->notExpr(id6715); +vc->registerAtom(id6715); +Expr id6723=vc->ltExpr(id437,id875); +Expr id6722=vc->notExpr(id6723); +vc->registerAtom(id6723); +Expr id6739=vc->eqExpr(id2185,id501); +Expr id6738=vc->notExpr(id6739); +vc->registerAtom(id6739); +Expr id6745=vc->plusExpr(id437,id107); +Expr id6747=vc->leExpr(id6745,id875); +Expr id6746=vc->notExpr(id6747); +vc->registerAtom(id6747); +Expr id6755=vc->leExpr(id6745,id2127); +Expr id6754=vc->notExpr(id6755); +vc->registerAtom(id6755); +Expr id6761=vc->eqExpr(id6745,id473); +Expr id6760=vc->notExpr(id6761); +vc->registerAtom(id6761); +Expr id6771=vc->eqExpr(id1621,id501); +Expr id6770=vc->notExpr(id6771); +vc->registerAtom(id6771); +Expr id6791=vc->varExpr("6789_c",id9); +Expr id6793=vc->eqExpr(id6791,id895); +Expr id6792=vc->notExpr(id6793); +vc->registerAtom(id6793); +Expr id6795=vc->eqExpr(id6791,id875); +Expr id6794=vc->notExpr(id6795); +vc->registerAtom(id6795); +Expr id6807=vc->eqExpr(id6791,id459); +Expr id6806=vc->notExpr(id6807); +vc->registerAtom(id6807); +Expr id6813=vc->eqExpr(id895,id461); +Expr id6812=vc->notExpr(id6813); +vc->registerAtom(id6813); +Expr id6829=vc->eqExpr(id895,id451); +Expr id6828=vc->notExpr(id6829); +vc->registerAtom(id6829); +Expr id6833=vc->eqExpr(id875,id461); +Expr id6832=vc->notExpr(id6833); +vc->registerAtom(id6833); +Expr id6841=vc->leExpr(id415,id2127); +Expr id6840=vc->notExpr(id6841); +vc->registerAtom(id6841); +Expr id6857=vc->eqExpr(id2127,id461); +Expr id6856=vc->notExpr(id6857); +vc->registerAtom(id6857); +Expr id6875=vc->eqExpr(id2163,id461); +Expr id6874=vc->notExpr(id6875); +vc->registerAtom(id6875); +Expr id6895=vc->eqExpr(id2185,id461); +Expr id6894=vc->notExpr(id6895); +vc->registerAtom(id6895); +Expr id6917=vc->eqExpr(id1709,id451); +Expr id6916=vc->notExpr(id6917); +vc->registerAtom(id6917); +Expr id6933=vc->eqExpr(id1621,id461); +Expr id6932=vc->notExpr(id6933); +vc->registerAtom(id6933); +Expr id6947=vc->eqExpr(id895,id463); +Expr id6946=vc->notExpr(id6947); +vc->registerAtom(id6947); +Expr id6967=vc->eqExpr(id875,id463); +Expr id6966=vc->notExpr(id6967); +vc->registerAtom(id6967); +Expr id6975=vc->eqExpr(id875,id421); +Expr id6974=vc->notExpr(id6975); +vc->registerAtom(id6975); +Expr id6991=vc->eqExpr(id2127,id463); +Expr id6990=vc->notExpr(id6991); +vc->registerAtom(id6991); +Expr id7013=vc->eqExpr(id2163,id463); +Expr id7012=vc->notExpr(id7013); +vc->registerAtom(id7013); +Expr id7033=vc->eqExpr(id2185,id463); +Expr id7032=vc->notExpr(id7033); +vc->registerAtom(id7033); +Expr id7049=vc->eqExpr(id1713,id457); +Expr id7048=vc->notExpr(id7049); +vc->registerAtom(id7049); +Expr id7065=vc->eqExpr(id1621,id463); +Expr id7064=vc->notExpr(id7065); +vc->registerAtom(id7065); +Expr id7083=vc->eqExpr(id895,id465); +Expr id7082=vc->notExpr(id7083); +vc->registerAtom(id7083); +Expr id7103=vc->eqExpr(id875,id465); +Expr id7102=vc->notExpr(id7103); +vc->registerAtom(id7103); +Expr id7121=vc->eqExpr(id2127,id465); +Expr id7120=vc->notExpr(id7121); +vc->registerAtom(id7121); +Expr id7143=vc->eqExpr(id2163,id465); +Expr id7142=vc->notExpr(id7143); +vc->registerAtom(id7143); +Expr id7151=vc->ltExpr(id401,id875); +Expr id7150=vc->notExpr(id7151); +vc->registerAtom(id7151); +Expr id7167=vc->eqExpr(id2185,id465); +Expr id7166=vc->notExpr(id7167); +vc->registerAtom(id7167); +Expr id7173=vc->plusExpr(id401,id105); +Expr id7175=vc->leExpr(id7173,id875); +Expr id7174=vc->notExpr(id7175); +vc->registerAtom(id7175); +Expr id7183=vc->leExpr(id7173,id2127); +Expr id7182=vc->notExpr(id7183); +vc->registerAtom(id7183); +Expr id7189=vc->eqExpr(id7173,id437); +Expr id7188=vc->notExpr(id7189); +vc->registerAtom(id7189); +Expr id7199=vc->eqExpr(id1621,id465); +Expr id7198=vc->notExpr(id7199); +vc->registerAtom(id7199); +Expr id7219=vc->varExpr("7217_c",id9); +Expr id7221=vc->eqExpr(id7219,id895); +Expr id7220=vc->notExpr(id7221); +vc->registerAtom(id7221); +Expr id7223=vc->eqExpr(id7219,id875); +Expr id7222=vc->notExpr(id7223); +vc->registerAtom(id7223); +Expr id7235=vc->eqExpr(id7219,id423); +Expr id7234=vc->notExpr(id7235); +vc->registerAtom(id7235); +Expr id7241=vc->eqExpr(id895,id425); +Expr id7240=vc->notExpr(id7241); +vc->registerAtom(id7241); +Expr id7257=vc->eqExpr(id895,id415); +Expr id7256=vc->notExpr(id7257); +vc->registerAtom(id7257); +Expr id7261=vc->eqExpr(id875,id425); +Expr id7260=vc->notExpr(id7261); +vc->registerAtom(id7261); +Expr id7269=vc->leExpr(id379,id2127); +Expr id7268=vc->notExpr(id7269); +vc->registerAtom(id7269); +Expr id7285=vc->eqExpr(id2127,id425); +Expr id7284=vc->notExpr(id7285); +vc->registerAtom(id7285); +Expr id7303=vc->eqExpr(id2163,id425); +Expr id7302=vc->notExpr(id7303); +vc->registerAtom(id7303); +Expr id7323=vc->eqExpr(id2185,id425); +Expr id7322=vc->notExpr(id7323); +vc->registerAtom(id7323); +Expr id7345=vc->eqExpr(id1717,id415); +Expr id7344=vc->notExpr(id7345); +vc->registerAtom(id7345); +Expr id7361=vc->eqExpr(id1621,id425); +Expr id7360=vc->notExpr(id7361); +vc->registerAtom(id7361); +Expr id7375=vc->eqExpr(id895,id427); +Expr id7374=vc->notExpr(id7375); +vc->registerAtom(id7375); +Expr id7395=vc->eqExpr(id875,id427); +Expr id7394=vc->notExpr(id7395); +vc->registerAtom(id7395); +Expr id7403=vc->eqExpr(id875,id385); +Expr id7402=vc->notExpr(id7403); +vc->registerAtom(id7403); +Expr id7419=vc->eqExpr(id2127,id427); +Expr id7418=vc->notExpr(id7419); +vc->registerAtom(id7419); +Expr id7441=vc->eqExpr(id2163,id427); +Expr id7440=vc->notExpr(id7441); +vc->registerAtom(id7441); +Expr id7461=vc->eqExpr(id2185,id427); +Expr id7460=vc->notExpr(id7461); +vc->registerAtom(id7461); +Expr id7477=vc->eqExpr(id1721,id421); +Expr id7476=vc->notExpr(id7477); +vc->registerAtom(id7477); +Expr id7493=vc->eqExpr(id1621,id427); +Expr id7492=vc->notExpr(id7493); +vc->registerAtom(id7493); +Expr id7511=vc->eqExpr(id895,id429); +Expr id7510=vc->notExpr(id7511); +vc->registerAtom(id7511); +Expr id7531=vc->eqExpr(id875,id429); +Expr id7530=vc->notExpr(id7531); +vc->registerAtom(id7531); +Expr id7549=vc->eqExpr(id2127,id429); +Expr id7548=vc->notExpr(id7549); +vc->registerAtom(id7549); +Expr id7571=vc->eqExpr(id2163,id429); +Expr id7570=vc->notExpr(id7571); +vc->registerAtom(id7571); +Expr id7579=vc->ltExpr(id365,id875); +Expr id7578=vc->notExpr(id7579); +vc->registerAtom(id7579); +Expr id7595=vc->eqExpr(id2185,id429); +Expr id7594=vc->notExpr(id7595); +vc->registerAtom(id7595); +Expr id7601=vc->plusExpr(id365,id103); +Expr id7603=vc->leExpr(id7601,id875); +Expr id7602=vc->notExpr(id7603); +vc->registerAtom(id7603); +Expr id7611=vc->leExpr(id7601,id2127); +Expr id7610=vc->notExpr(id7611); +vc->registerAtom(id7611); +Expr id7617=vc->eqExpr(id7601,id401); +Expr id7616=vc->notExpr(id7617); +vc->registerAtom(id7617); +Expr id7627=vc->eqExpr(id1621,id429); +Expr id7626=vc->notExpr(id7627); +vc->registerAtom(id7627); +Expr id7647=vc->varExpr("7645_c",id9); +Expr id7649=vc->eqExpr(id7647,id895); +Expr id7648=vc->notExpr(id7649); +vc->registerAtom(id7649); +Expr id7651=vc->eqExpr(id7647,id875); +Expr id7650=vc->notExpr(id7651); +vc->registerAtom(id7651); +Expr id7663=vc->eqExpr(id7647,id387); +Expr id7662=vc->notExpr(id7663); +vc->registerAtom(id7663); +Expr id7669=vc->eqExpr(id895,id389); +Expr id7668=vc->notExpr(id7669); +vc->registerAtom(id7669); +Expr id7685=vc->eqExpr(id895,id379); +Expr id7684=vc->notExpr(id7685); +vc->registerAtom(id7685); +Expr id7689=vc->eqExpr(id875,id389); +Expr id7688=vc->notExpr(id7689); +vc->registerAtom(id7689); +Expr id7697=vc->leExpr(id343,id2127); +Expr id7696=vc->notExpr(id7697); +vc->registerAtom(id7697); +Expr id7713=vc->eqExpr(id2127,id389); +Expr id7712=vc->notExpr(id7713); +vc->registerAtom(id7713); +Expr id7731=vc->eqExpr(id2163,id389); +Expr id7730=vc->notExpr(id7731); +vc->registerAtom(id7731); +Expr id7751=vc->eqExpr(id2185,id389); +Expr id7750=vc->notExpr(id7751); +vc->registerAtom(id7751); +Expr id7773=vc->eqExpr(id1725,id379); +Expr id7772=vc->notExpr(id7773); +vc->registerAtom(id7773); +Expr id7789=vc->eqExpr(id1621,id389); +Expr id7788=vc->notExpr(id7789); +vc->registerAtom(id7789); +Expr id7803=vc->eqExpr(id895,id391); +Expr id7802=vc->notExpr(id7803); +vc->registerAtom(id7803); +Expr id7823=vc->eqExpr(id875,id391); +Expr id7822=vc->notExpr(id7823); +vc->registerAtom(id7823); +Expr id7831=vc->eqExpr(id875,id349); +Expr id7830=vc->notExpr(id7831); +vc->registerAtom(id7831); +Expr id7847=vc->eqExpr(id2127,id391); +Expr id7846=vc->notExpr(id7847); +vc->registerAtom(id7847); +Expr id7869=vc->eqExpr(id2163,id391); +Expr id7868=vc->notExpr(id7869); +vc->registerAtom(id7869); +Expr id7889=vc->eqExpr(id2185,id391); +Expr id7888=vc->notExpr(id7889); +vc->registerAtom(id7889); +Expr id7905=vc->eqExpr(id1729,id385); +Expr id7904=vc->notExpr(id7905); +vc->registerAtom(id7905); +Expr id7921=vc->eqExpr(id1621,id391); +Expr id7920=vc->notExpr(id7921); +vc->registerAtom(id7921); +Expr id7939=vc->eqExpr(id895,id393); +Expr id7938=vc->notExpr(id7939); +vc->registerAtom(id7939); +Expr id7959=vc->eqExpr(id875,id393); +Expr id7958=vc->notExpr(id7959); +vc->registerAtom(id7959); +Expr id7977=vc->eqExpr(id2127,id393); +Expr id7976=vc->notExpr(id7977); +vc->registerAtom(id7977); +Expr id7999=vc->eqExpr(id2163,id393); +Expr id7998=vc->notExpr(id7999); +vc->registerAtom(id7999); +Expr id8007=vc->ltExpr(id329,id875); +Expr id8006=vc->notExpr(id8007); +vc->registerAtom(id8007); +Expr id8023=vc->eqExpr(id2185,id393); +Expr id8022=vc->notExpr(id8023); +vc->registerAtom(id8023); +Expr id8029=vc->plusExpr(id329,id101); +Expr id8031=vc->leExpr(id8029,id875); +Expr id8030=vc->notExpr(id8031); +vc->registerAtom(id8031); +Expr id8039=vc->leExpr(id8029,id2127); +Expr id8038=vc->notExpr(id8039); +vc->registerAtom(id8039); +Expr id8045=vc->eqExpr(id8029,id365); +Expr id8044=vc->notExpr(id8045); +vc->registerAtom(id8045); +Expr id8055=vc->eqExpr(id1621,id393); +Expr id8054=vc->notExpr(id8055); +vc->registerAtom(id8055); +Expr id8075=vc->varExpr("8073_c",id9); +Expr id8077=vc->eqExpr(id8075,id895); +Expr id8076=vc->notExpr(id8077); +vc->registerAtom(id8077); +Expr id8079=vc->eqExpr(id8075,id875); +Expr id8078=vc->notExpr(id8079); +vc->registerAtom(id8079); +Expr id8091=vc->eqExpr(id8075,id351); +Expr id8090=vc->notExpr(id8091); +vc->registerAtom(id8091); +Expr id8097=vc->eqExpr(id895,id353); +Expr id8096=vc->notExpr(id8097); +vc->registerAtom(id8097); +Expr id8113=vc->eqExpr(id895,id343); +Expr id8112=vc->notExpr(id8113); +vc->registerAtom(id8113); +Expr id8117=vc->eqExpr(id875,id353); +Expr id8116=vc->notExpr(id8117); +vc->registerAtom(id8117); +Expr id8125=vc->leExpr(id307,id2127); +Expr id8124=vc->notExpr(id8125); +vc->registerAtom(id8125); +Expr id8141=vc->eqExpr(id2127,id353); +Expr id8140=vc->notExpr(id8141); +vc->registerAtom(id8141); +Expr id8159=vc->eqExpr(id2163,id353); +Expr id8158=vc->notExpr(id8159); +vc->registerAtom(id8159); +Expr id8179=vc->eqExpr(id2185,id353); +Expr id8178=vc->notExpr(id8179); +vc->registerAtom(id8179); +Expr id8201=vc->eqExpr(id1733,id343); +Expr id8200=vc->notExpr(id8201); +vc->registerAtom(id8201); +Expr id8217=vc->eqExpr(id1621,id353); +Expr id8216=vc->notExpr(id8217); +vc->registerAtom(id8217); +Expr id8231=vc->eqExpr(id895,id355); +Expr id8230=vc->notExpr(id8231); +vc->registerAtom(id8231); +Expr id8251=vc->eqExpr(id875,id355); +Expr id8250=vc->notExpr(id8251); +vc->registerAtom(id8251); +Expr id8259=vc->eqExpr(id875,id313); +Expr id8258=vc->notExpr(id8259); +vc->registerAtom(id8259); +Expr id8275=vc->eqExpr(id2127,id355); +Expr id8274=vc->notExpr(id8275); +vc->registerAtom(id8275); +Expr id8297=vc->eqExpr(id2163,id355); +Expr id8296=vc->notExpr(id8297); +vc->registerAtom(id8297); +Expr id8317=vc->eqExpr(id2185,id355); +Expr id8316=vc->notExpr(id8317); +vc->registerAtom(id8317); +Expr id8333=vc->eqExpr(id1737,id349); +Expr id8332=vc->notExpr(id8333); +vc->registerAtom(id8333); +Expr id8349=vc->eqExpr(id1621,id355); +Expr id8348=vc->notExpr(id8349); +vc->registerAtom(id8349); +Expr id8367=vc->eqExpr(id895,id357); +Expr id8366=vc->notExpr(id8367); +vc->registerAtom(id8367); +Expr id8387=vc->eqExpr(id875,id357); +Expr id8386=vc->notExpr(id8387); +vc->registerAtom(id8387); +Expr id8405=vc->eqExpr(id2127,id357); +Expr id8404=vc->notExpr(id8405); +vc->registerAtom(id8405); +Expr id8427=vc->eqExpr(id2163,id357); +Expr id8426=vc->notExpr(id8427); +vc->registerAtom(id8427); +Expr id8435=vc->ltExpr(id293,id875); +Expr id8434=vc->notExpr(id8435); +vc->registerAtom(id8435); +Expr id8451=vc->eqExpr(id2185,id357); +Expr id8450=vc->notExpr(id8451); +vc->registerAtom(id8451); +Expr id8457=vc->plusExpr(id293,id99); +Expr id8459=vc->leExpr(id8457,id875); +Expr id8458=vc->notExpr(id8459); +vc->registerAtom(id8459); +Expr id8467=vc->leExpr(id8457,id2127); +Expr id8466=vc->notExpr(id8467); +vc->registerAtom(id8467); +Expr id8473=vc->eqExpr(id8457,id329); +Expr id8472=vc->notExpr(id8473); +vc->registerAtom(id8473); +Expr id8483=vc->eqExpr(id1621,id357); +Expr id8482=vc->notExpr(id8483); +vc->registerAtom(id8483); +Expr id8503=vc->varExpr("8501_c",id9); +Expr id8505=vc->eqExpr(id8503,id895); +Expr id8504=vc->notExpr(id8505); +vc->registerAtom(id8505); +Expr id8507=vc->eqExpr(id8503,id875); +Expr id8506=vc->notExpr(id8507); +vc->registerAtom(id8507); +Expr id8519=vc->eqExpr(id8503,id315); +Expr id8518=vc->notExpr(id8519); +vc->registerAtom(id8519); +Expr id8525=vc->eqExpr(id895,id317); +Expr id8524=vc->notExpr(id8525); +vc->registerAtom(id8525); +Expr id8541=vc->eqExpr(id895,id307); +Expr id8540=vc->notExpr(id8541); +vc->registerAtom(id8541); +Expr id8545=vc->eqExpr(id875,id317); +Expr id8544=vc->notExpr(id8545); +vc->registerAtom(id8545); +Expr id8553=vc->leExpr(id271,id2127); +Expr id8552=vc->notExpr(id8553); +vc->registerAtom(id8553); +Expr id8569=vc->eqExpr(id2127,id317); +Expr id8568=vc->notExpr(id8569); +vc->registerAtom(id8569); +Expr id8587=vc->eqExpr(id2163,id317); +Expr id8586=vc->notExpr(id8587); +vc->registerAtom(id8587); +Expr id8607=vc->eqExpr(id2185,id317); +Expr id8606=vc->notExpr(id8607); +vc->registerAtom(id8607); +Expr id8629=vc->eqExpr(id1741,id307); +Expr id8628=vc->notExpr(id8629); +vc->registerAtom(id8629); +Expr id8645=vc->eqExpr(id1621,id317); +Expr id8644=vc->notExpr(id8645); +vc->registerAtom(id8645); +Expr id8659=vc->eqExpr(id895,id319); +Expr id8658=vc->notExpr(id8659); +vc->registerAtom(id8659); +Expr id8679=vc->eqExpr(id875,id319); +Expr id8678=vc->notExpr(id8679); +vc->registerAtom(id8679); +Expr id8687=vc->eqExpr(id875,id277); +Expr id8686=vc->notExpr(id8687); +vc->registerAtom(id8687); +Expr id8703=vc->eqExpr(id2127,id319); +Expr id8702=vc->notExpr(id8703); +vc->registerAtom(id8703); +Expr id8725=vc->eqExpr(id2163,id319); +Expr id8724=vc->notExpr(id8725); +vc->registerAtom(id8725); +Expr id8745=vc->eqExpr(id2185,id319); +Expr id8744=vc->notExpr(id8745); +vc->registerAtom(id8745); +Expr id8761=vc->eqExpr(id1745,id313); +Expr id8760=vc->notExpr(id8761); +vc->registerAtom(id8761); +Expr id8777=vc->eqExpr(id1621,id319); +Expr id8776=vc->notExpr(id8777); +vc->registerAtom(id8777); +Expr id8795=vc->eqExpr(id895,id321); +Expr id8794=vc->notExpr(id8795); +vc->registerAtom(id8795); +Expr id8815=vc->eqExpr(id875,id321); +Expr id8814=vc->notExpr(id8815); +vc->registerAtom(id8815); +Expr id8833=vc->eqExpr(id2127,id321); +Expr id8832=vc->notExpr(id8833); +vc->registerAtom(id8833); +Expr id8855=vc->eqExpr(id2163,id321); +Expr id8854=vc->notExpr(id8855); +vc->registerAtom(id8855); +Expr id8863=vc->ltExpr(id257,id875); +Expr id8862=vc->notExpr(id8863); +vc->registerAtom(id8863); +Expr id8879=vc->eqExpr(id2185,id321); +Expr id8878=vc->notExpr(id8879); +vc->registerAtom(id8879); +Expr id8885=vc->plusExpr(id257,id97); +Expr id8887=vc->leExpr(id8885,id875); +Expr id8886=vc->notExpr(id8887); +vc->registerAtom(id8887); +Expr id8895=vc->leExpr(id8885,id2127); +Expr id8894=vc->notExpr(id8895); +vc->registerAtom(id8895); +Expr id8901=vc->eqExpr(id8885,id293); +Expr id8900=vc->notExpr(id8901); +vc->registerAtom(id8901); +Expr id8911=vc->eqExpr(id1621,id321); +Expr id8910=vc->notExpr(id8911); +vc->registerAtom(id8911); +Expr id8931=vc->varExpr("8929_c",id9); +Expr id8933=vc->eqExpr(id8931,id895); +Expr id8932=vc->notExpr(id8933); +vc->registerAtom(id8933); +Expr id8935=vc->eqExpr(id8931,id875); +Expr id8934=vc->notExpr(id8935); +vc->registerAtom(id8935); +Expr id8947=vc->eqExpr(id8931,id279); +Expr id8946=vc->notExpr(id8947); +vc->registerAtom(id8947); +Expr id8953=vc->eqExpr(id895,id281); +Expr id8952=vc->notExpr(id8953); +vc->registerAtom(id8953); +Expr id8969=vc->eqExpr(id895,id271); +Expr id8968=vc->notExpr(id8969); +vc->registerAtom(id8969); +Expr id8973=vc->eqExpr(id875,id281); +Expr id8972=vc->notExpr(id8973); +vc->registerAtom(id8973); +Expr id8981=vc->leExpr(id235,id2127); +Expr id8980=vc->notExpr(id8981); +vc->registerAtom(id8981); +Expr id8997=vc->eqExpr(id2127,id281); +Expr id8996=vc->notExpr(id8997); +vc->registerAtom(id8997); +Expr id9015=vc->eqExpr(id2163,id281); +Expr id9014=vc->notExpr(id9015); +vc->registerAtom(id9015); +Expr id9035=vc->eqExpr(id2185,id281); +Expr id9034=vc->notExpr(id9035); +vc->registerAtom(id9035); +Expr id9057=vc->eqExpr(id1749,id271); +Expr id9056=vc->notExpr(id9057); +vc->registerAtom(id9057); +Expr id9073=vc->eqExpr(id1621,id281); +Expr id9072=vc->notExpr(id9073); +vc->registerAtom(id9073); +Expr id9087=vc->eqExpr(id895,id283); +Expr id9086=vc->notExpr(id9087); +vc->registerAtom(id9087); +Expr id9107=vc->eqExpr(id875,id283); +Expr id9106=vc->notExpr(id9107); +vc->registerAtom(id9107); +Expr id9115=vc->eqExpr(id875,id241); +Expr id9114=vc->notExpr(id9115); +vc->registerAtom(id9115); +Expr id9131=vc->eqExpr(id2127,id283); +Expr id9130=vc->notExpr(id9131); +vc->registerAtom(id9131); +Expr id9153=vc->eqExpr(id2163,id283); +Expr id9152=vc->notExpr(id9153); +vc->registerAtom(id9153); +Expr id9173=vc->eqExpr(id2185,id283); +Expr id9172=vc->notExpr(id9173); +vc->registerAtom(id9173); +Expr id9189=vc->eqExpr(id1753,id277); +Expr id9188=vc->notExpr(id9189); +vc->registerAtom(id9189); +Expr id9205=vc->eqExpr(id1621,id283); +Expr id9204=vc->notExpr(id9205); +vc->registerAtom(id9205); +Expr id9223=vc->eqExpr(id895,id285); +Expr id9222=vc->notExpr(id9223); +vc->registerAtom(id9223); +Expr id9243=vc->eqExpr(id875,id285); +Expr id9242=vc->notExpr(id9243); +vc->registerAtom(id9243); +Expr id9261=vc->eqExpr(id2127,id285); +Expr id9260=vc->notExpr(id9261); +vc->registerAtom(id9261); +Expr id9283=vc->eqExpr(id2163,id285); +Expr id9282=vc->notExpr(id9283); +vc->registerAtom(id9283); +Expr id9291=vc->ltExpr(id221,id875); +Expr id9290=vc->notExpr(id9291); +vc->registerAtom(id9291); +Expr id9307=vc->eqExpr(id2185,id285); +Expr id9306=vc->notExpr(id9307); +vc->registerAtom(id9307); +Expr id9313=vc->plusExpr(id221,id95); +Expr id9315=vc->leExpr(id9313,id875); +Expr id9314=vc->notExpr(id9315); +vc->registerAtom(id9315); +Expr id9323=vc->leExpr(id9313,id2127); +Expr id9322=vc->notExpr(id9323); +vc->registerAtom(id9323); +Expr id9329=vc->eqExpr(id9313,id257); +Expr id9328=vc->notExpr(id9329); +vc->registerAtom(id9329); +Expr id9339=vc->eqExpr(id1621,id285); +Expr id9338=vc->notExpr(id9339); +vc->registerAtom(id9339); +Expr id9359=vc->varExpr("9357_c",id9); +Expr id9361=vc->eqExpr(id9359,id895); +Expr id9360=vc->notExpr(id9361); +vc->registerAtom(id9361); +Expr id9363=vc->eqExpr(id9359,id875); +Expr id9362=vc->notExpr(id9363); +vc->registerAtom(id9363); +Expr id9375=vc->eqExpr(id9359,id243); +Expr id9374=vc->notExpr(id9375); +vc->registerAtom(id9375); +Expr id9381=vc->eqExpr(id895,id245); +Expr id9380=vc->notExpr(id9381); +vc->registerAtom(id9381); +Expr id9397=vc->eqExpr(id895,id235); +Expr id9396=vc->notExpr(id9397); +vc->registerAtom(id9397); +Expr id9401=vc->eqExpr(id875,id245); +Expr id9400=vc->notExpr(id9401); +vc->registerAtom(id9401); +Expr id9409=vc->leExpr(id199,id2127); +Expr id9408=vc->notExpr(id9409); +vc->registerAtom(id9409); +Expr id9425=vc->eqExpr(id2127,id245); +Expr id9424=vc->notExpr(id9425); +vc->registerAtom(id9425); +Expr id9443=vc->eqExpr(id2163,id245); +Expr id9442=vc->notExpr(id9443); +vc->registerAtom(id9443); +Expr id9463=vc->eqExpr(id2185,id245); +Expr id9462=vc->notExpr(id9463); +vc->registerAtom(id9463); +Expr id9485=vc->eqExpr(id1757,id235); +Expr id9484=vc->notExpr(id9485); +vc->registerAtom(id9485); +Expr id9501=vc->eqExpr(id1621,id245); +Expr id9500=vc->notExpr(id9501); +vc->registerAtom(id9501); +Expr id9515=vc->eqExpr(id895,id247); +Expr id9514=vc->notExpr(id9515); +vc->registerAtom(id9515); +Expr id9535=vc->eqExpr(id875,id247); +Expr id9534=vc->notExpr(id9535); +vc->registerAtom(id9535); +Expr id9543=vc->eqExpr(id875,id205); +Expr id9542=vc->notExpr(id9543); +vc->registerAtom(id9543); +Expr id9559=vc->eqExpr(id2127,id247); +Expr id9558=vc->notExpr(id9559); +vc->registerAtom(id9559); +Expr id9581=vc->eqExpr(id2163,id247); +Expr id9580=vc->notExpr(id9581); +vc->registerAtom(id9581); +Expr id9601=vc->eqExpr(id2185,id247); +Expr id9600=vc->notExpr(id9601); +vc->registerAtom(id9601); +Expr id9617=vc->eqExpr(id1761,id241); +Expr id9616=vc->notExpr(id9617); +vc->registerAtom(id9617); +Expr id9633=vc->eqExpr(id1621,id247); +Expr id9632=vc->notExpr(id9633); +vc->registerAtom(id9633); +Expr id9651=vc->eqExpr(id895,id249); +Expr id9650=vc->notExpr(id9651); +vc->registerAtom(id9651); +Expr id9671=vc->eqExpr(id875,id249); +Expr id9670=vc->notExpr(id9671); +vc->registerAtom(id9671); +Expr id9689=vc->eqExpr(id2127,id249); +Expr id9688=vc->notExpr(id9689); +vc->registerAtom(id9689); +Expr id9711=vc->eqExpr(id2163,id249); +Expr id9710=vc->notExpr(id9711); +vc->registerAtom(id9711); +Expr id9719=vc->ltExpr(id185,id875); +Expr id9718=vc->notExpr(id9719); +vc->registerAtom(id9719); +Expr id9735=vc->eqExpr(id2185,id249); +Expr id9734=vc->notExpr(id9735); +vc->registerAtom(id9735); +Expr id9741=vc->plusExpr(id185,id93); +Expr id9743=vc->leExpr(id9741,id875); +Expr id9742=vc->notExpr(id9743); +vc->registerAtom(id9743); +Expr id9751=vc->leExpr(id9741,id2127); +Expr id9750=vc->notExpr(id9751); +vc->registerAtom(id9751); +Expr id9757=vc->eqExpr(id9741,id221); +Expr id9756=vc->notExpr(id9757); +vc->registerAtom(id9757); +Expr id9767=vc->eqExpr(id1621,id249); +Expr id9766=vc->notExpr(id9767); +vc->registerAtom(id9767); +Expr id9787=vc->varExpr("9785_c",id9); +Expr id9789=vc->eqExpr(id9787,id895); +Expr id9788=vc->notExpr(id9789); +vc->registerAtom(id9789); +Expr id9791=vc->eqExpr(id9787,id875); +Expr id9790=vc->notExpr(id9791); +vc->registerAtom(id9791); +Expr id9803=vc->eqExpr(id9787,id207); +Expr id9802=vc->notExpr(id9803); +vc->registerAtom(id9803); +Expr id9809=vc->eqExpr(id895,id209); +Expr id9808=vc->notExpr(id9809); +vc->registerAtom(id9809); +Expr id9825=vc->eqExpr(id895,id199); +Expr id9824=vc->notExpr(id9825); +vc->registerAtom(id9825); +Expr id9829=vc->eqExpr(id875,id209); +Expr id9828=vc->notExpr(id9829); +vc->registerAtom(id9829); +Expr id9837=vc->leExpr(id155,id2127); +Expr id9836=vc->notExpr(id9837); +vc->registerAtom(id9837); +Expr id9853=vc->eqExpr(id2127,id209); +Expr id9852=vc->notExpr(id9853); +vc->registerAtom(id9853); +Expr id9871=vc->eqExpr(id2163,id209); +Expr id9870=vc->notExpr(id9871); +vc->registerAtom(id9871); +Expr id9891=vc->eqExpr(id2185,id209); +Expr id9890=vc->notExpr(id9891); +vc->registerAtom(id9891); +Expr id9913=vc->eqExpr(id1765,id199); +Expr id9912=vc->notExpr(id9913); +vc->registerAtom(id9913); +Expr id9929=vc->eqExpr(id1621,id209); +Expr id9928=vc->notExpr(id9929); +vc->registerAtom(id9929); +Expr id9943=vc->eqExpr(id895,id211); +Expr id9942=vc->notExpr(id9943); +vc->registerAtom(id9943); +Expr id9963=vc->eqExpr(id875,id211); +Expr id9962=vc->notExpr(id9963); +vc->registerAtom(id9963); +Expr id9971=vc->eqExpr(id875,id161); +Expr id9970=vc->notExpr(id9971); +vc->registerAtom(id9971); +Expr id9987=vc->eqExpr(id2127,id211); +Expr id9986=vc->notExpr(id9987); +vc->registerAtom(id9987); +Expr id10009=vc->eqExpr(id2163,id211); +Expr id10008=vc->notExpr(id10009); +vc->registerAtom(id10009); +Expr id10029=vc->eqExpr(id2185,id211); +Expr id10028=vc->notExpr(id10029); +vc->registerAtom(id10029); +Expr id10045=vc->eqExpr(id1769,id205); +Expr id10044=vc->notExpr(id10045); +vc->registerAtom(id10045); +Expr id10061=vc->eqExpr(id1621,id211); +Expr id10060=vc->notExpr(id10061); +vc->registerAtom(id10061); +Expr id10079=vc->eqExpr(id895,id213); +Expr id10078=vc->notExpr(id10079); +vc->registerAtom(id10079); +Expr id10099=vc->eqExpr(id875,id213); +Expr id10098=vc->notExpr(id10099); +vc->registerAtom(id10099); +Expr id10117=vc->eqExpr(id2127,id213); +Expr id10116=vc->notExpr(id10117); +vc->registerAtom(id10117); +Expr id10139=vc->eqExpr(id2163,id213); +Expr id10138=vc->notExpr(id10139); +vc->registerAtom(id10139); +Expr id10147=vc->ltExpr(id139,id875); +Expr id10146=vc->notExpr(id10147); +vc->registerAtom(id10147); +Expr id10163=vc->eqExpr(id2185,id213); +Expr id10162=vc->notExpr(id10163); +vc->registerAtom(id10163); +Expr id10169=vc->plusExpr(id139,id91); +Expr id10171=vc->leExpr(id10169,id875); +Expr id10170=vc->notExpr(id10171); +vc->registerAtom(id10171); +Expr id10179=vc->leExpr(id10169,id2127); +Expr id10178=vc->notExpr(id10179); +vc->registerAtom(id10179); +Expr id10185=vc->eqExpr(id10169,id185); +Expr id10184=vc->notExpr(id10185); +vc->registerAtom(id10185); +Expr id10195=vc->eqExpr(id1621,id213); +Expr id10194=vc->notExpr(id10195); +vc->registerAtom(id10195); +Expr id10215=vc->varExpr("10213_c",id9); +Expr id10217=vc->eqExpr(id10215,id895); +Expr id10216=vc->notExpr(id10217); +vc->registerAtom(id10217); +Expr id10219=vc->eqExpr(id10215,id875); +Expr id10218=vc->notExpr(id10219); +vc->registerAtom(id10219); +Expr id10225=vc->eqExpr(id10215,id163); +Expr id10224=vc->notExpr(id10225); +vc->registerAtom(id10225); +Expr id10231=vc->eqExpr(id895,id165); +Expr id10230=vc->notExpr(id10231); +vc->registerAtom(id10231); +Expr id10249=vc->eqExpr(id875,id165); +Expr id10248=vc->notExpr(id10249); +vc->registerAtom(id10249); +Expr id10257=vc->geExpr(id2127,id895); +Expr id10256=vc->notExpr(id10257); +vc->registerAtom(id10257); +Expr id10273=vc->eqExpr(id2127,id165); +Expr id10272=vc->notExpr(id10273); +vc->registerAtom(id10273); +Expr id10291=vc->eqExpr(id2163,id165); +Expr id10290=vc->notExpr(id10291); +vc->registerAtom(id10291); +Expr id10311=vc->eqExpr(id2185,id165); +Expr id10310=vc->notExpr(id10311); +vc->registerAtom(id10311); +Expr id10333=vc->eqExpr(id1773,id155); +Expr id10332=vc->notExpr(id10333); +vc->registerAtom(id10333); +Expr id10349=vc->eqExpr(id1621,id165); +Expr id10348=vc->notExpr(id10349); +vc->registerAtom(id10349); +Expr id10363=vc->eqExpr(id895,id171); +Expr id10362=vc->notExpr(id10363); +vc->registerAtom(id10363); +Expr id10383=vc->eqExpr(id875,id171); +Expr id10382=vc->notExpr(id10383); +vc->registerAtom(id10383); +Expr id10391=vc->eqExpr(id875,id895); +Expr id10390=vc->notExpr(id10391); +vc->registerAtom(id10391); +Expr id10407=vc->eqExpr(id2127,id171); +Expr id10406=vc->notExpr(id10407); +vc->registerAtom(id10407); +Expr id10429=vc->eqExpr(id2163,id171); +Expr id10428=vc->notExpr(id10429); +vc->registerAtom(id10429); +Expr id10449=vc->eqExpr(id2185,id171); +Expr id10448=vc->notExpr(id10449); +vc->registerAtom(id10449); +Expr id10465=vc->eqExpr(id1773,id161); +Expr id10464=vc->notExpr(id10465); +vc->registerAtom(id10465); +Expr id10481=vc->eqExpr(id1621,id171); +Expr id10480=vc->notExpr(id10481); +vc->registerAtom(id10481); +Expr id10499=vc->eqExpr(id895,id177); +Expr id10498=vc->notExpr(id10499); +vc->registerAtom(id10499); +Expr id10519=vc->eqExpr(id875,id177); +Expr id10518=vc->notExpr(id10519); +vc->registerAtom(id10519); +Expr id10537=vc->eqExpr(id2127,id177); +Expr id10536=vc->notExpr(id10537); +vc->registerAtom(id10537); +Expr id10559=vc->eqExpr(id2163,id177); +Expr id10558=vc->notExpr(id10559); +vc->registerAtom(id10559); +Expr id10567=vc->gtExpr(id875,id895); +Expr id10566=vc->notExpr(id10567); +vc->registerAtom(id10567); +Expr id10583=vc->eqExpr(id2185,id177); +Expr id10582=vc->notExpr(id10583); +vc->registerAtom(id10583); +Expr id10595=vc->leExpr(id1773,id2127); +Expr id10594=vc->notExpr(id10595); +vc->registerAtom(id10595); +Expr id10601=vc->eqExpr(id1773,id139); +Expr id10600=vc->notExpr(id10601); +vc->registerAtom(id10601); +Expr id10611=vc->eqExpr(id1621,id177); +Expr id10610=vc->notExpr(id10611); +vc->registerAtom(id10611); +vc->push(); +vc->query(id12); +vc->inconsistent(inconsistency); +vc->pop(); +vc->push(); +vc->query(id10224); +vc->popto(1); +vc->push(); +vc->query(id10225); +vc->popto(1); +vc->push(); +vc->assertFormula(id10225); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id9802); +vc->popto(2); +vc->push(); +vc->query(id9803); +vc->popto(2); +vc->push(); +vc->assertFormula(id9803); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id9374); +vc->popto(3); +vc->push(); +vc->query(id9375); +vc->popto(3); +vc->push(); +vc->assertFormula(id9375); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id8946); +vc->popto(4); +vc->push(); +vc->query(id8947); +vc->popto(4); +vc->push(); +vc->assertFormula(id8947); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id8518); +vc->popto(5); +vc->push(); +vc->query(id8519); +vc->popto(5); +vc->push(); +vc->assertFormula(id8519); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id8090); +vc->popto(6); +vc->push(); +vc->query(id8091); +vc->popto(6); +vc->push(); +vc->assertFormula(id8091); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id7662); +vc->popto(7); +vc->push(); +vc->query(id7663); +vc->popto(7); +vc->push(); +vc->assertFormula(id7663); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id7234); +vc->popto(8); +vc->push(); +vc->query(id7235); +vc->popto(8); +vc->push(); +vc->assertFormula(id7235); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id6806); +vc->popto(9); +vc->push(); +vc->query(id6807); +vc->popto(9); +vc->push(); +vc->assertFormula(id6807); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id6378); +vc->popto(10); +vc->push(); +vc->query(id6379); +vc->popto(10); +vc->push(); +vc->assertFormula(id6379); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id5950); +vc->popto(11); +vc->push(); +vc->query(id5951); +vc->popto(11); +vc->push(); +vc->assertFormula(id5951); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id5522); +vc->popto(12); +vc->push(); +vc->query(id5523); +vc->popto(12); +vc->push(); +vc->assertFormula(id5523); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id5094); +vc->popto(13); +vc->push(); +vc->query(id5095); +vc->popto(13); +vc->push(); +vc->assertFormula(id5095); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id4666); +vc->popto(14); +vc->push(); +vc->query(id4667); +vc->popto(14); +vc->push(); +vc->assertFormula(id4667); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id4238); +vc->popto(15); +vc->push(); +vc->query(id4239); +vc->popto(15); +vc->push(); +vc->assertFormula(id4239); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3810); +vc->popto(16); +vc->push(); +vc->query(id3811); +vc->popto(16); +vc->push(); +vc->assertFormula(id3811); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3382); +vc->popto(17); +vc->push(); +vc->query(id3383); +vc->popto(17); +vc->push(); +vc->assertFormula(id3383); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2954); +vc->popto(18); +vc->push(); +vc->query(id2955); +vc->popto(18); +vc->push(); +vc->assertFormula(id2955); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2526); +vc->popto(19); +vc->push(); +vc->query(id2527); +vc->popto(19); +vc->push(); +vc->assertFormula(id2527); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2092); +vc->popto(20); +vc->push(); +vc->query(id2093); +vc->popto(20); +vc->push(); +vc->assertFormula(id2093); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2069); +vc->popto(21); +vc->push(); +vc->query(id2068); +vc->popto(21); +vc->push(); +vc->assertFormula(id2068); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2063); +vc->popto(22); +vc->push(); +vc->query(id2062); +vc->popto(22); +vc->push(); +vc->assertFormula(id2062); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2057); +vc->popto(23); +vc->push(); +vc->query(id2056); +vc->popto(23); +vc->push(); +vc->assertFormula(id2056); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2051); +vc->popto(24); +vc->push(); +vc->query(id2050); +vc->popto(24); +vc->push(); +vc->assertFormula(id2050); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2045); +vc->popto(25); +vc->push(); +vc->query(id2044); +vc->popto(25); +vc->push(); +vc->assertFormula(id2044); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2039); +vc->popto(26); +vc->push(); +vc->query(id2038); +vc->popto(26); +vc->push(); +vc->assertFormula(id2038); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2033); +vc->popto(27); +vc->push(); +vc->query(id2032); +vc->popto(27); +vc->push(); +vc->assertFormula(id2032); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2027); +vc->popto(28); +vc->push(); +vc->query(id2026); +vc->popto(28); +vc->push(); +vc->assertFormula(id2026); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2021); +vc->popto(29); +vc->push(); +vc->query(id2020); +vc->popto(29); +vc->push(); +vc->assertFormula(id2020); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2015); +vc->popto(30); +vc->push(); +vc->query(id2014); +vc->popto(30); +vc->push(); +vc->assertFormula(id2014); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2009); +vc->popto(31); +vc->push(); +vc->query(id2008); +vc->popto(31); +vc->push(); +vc->assertFormula(id2008); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2003); +vc->popto(32); +vc->push(); +vc->query(id2002); +vc->popto(32); +vc->push(); +vc->assertFormula(id2002); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1997); +vc->popto(33); +vc->push(); +vc->query(id1996); +vc->popto(33); +vc->push(); +vc->assertFormula(id1996); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1991); +vc->popto(34); +vc->push(); +vc->query(id1990); +vc->popto(34); +vc->push(); +vc->assertFormula(id1990); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1985); +vc->popto(35); +vc->push(); +vc->query(id1984); +vc->popto(35); +vc->push(); +vc->assertFormula(id1984); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1979); +vc->popto(36); +vc->push(); +vc->query(id1978); +vc->popto(36); +vc->push(); +vc->assertFormula(id1978); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1973); +vc->popto(37); +vc->push(); +vc->query(id1972); +vc->popto(37); +vc->push(); +vc->assertFormula(id1972); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1967); +vc->popto(38); +vc->push(); +vc->query(id1966); +vc->popto(38); +vc->push(); +vc->assertFormula(id1966); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1961); +vc->popto(39); +vc->push(); +vc->query(id1960); +vc->popto(39); +vc->push(); +vc->assertFormula(id1960); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1955); +vc->popto(40); +vc->push(); +vc->query(id1954); +vc->popto(40); +vc->push(); +vc->assertFormula(id1954); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1949); +vc->popto(41); +vc->push(); +vc->query(id1948); +vc->popto(41); +vc->push(); +vc->assertFormula(id1948); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1932); +vc->popto(42); +vc->push(); +vc->query(id1933); +vc->popto(42); +vc->push(); +vc->assertFormula(id1933); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1928); +vc->popto(43); +vc->push(); +vc->query(id1929); +vc->popto(43); +vc->push(); +vc->assertFormula(id1929); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1924); +vc->popto(44); +vc->push(); +vc->query(id1925); +vc->popto(44); +vc->push(); +vc->assertFormula(id1925); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1920); +vc->popto(45); +vc->push(); +vc->query(id1921); +vc->popto(45); +vc->push(); +vc->assertFormula(id1921); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1916); +vc->popto(46); +vc->push(); +vc->query(id1917); +vc->popto(46); +vc->push(); +vc->assertFormula(id1917); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1912); +vc->popto(47); +vc->push(); +vc->query(id1913); +vc->popto(47); +vc->push(); +vc->assertFormula(id1913); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1908); +vc->popto(48); +vc->push(); +vc->query(id1909); +vc->popto(48); +vc->push(); +vc->assertFormula(id1909); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1904); +vc->popto(49); +vc->push(); +vc->query(id1905); +vc->popto(49); +vc->push(); +vc->assertFormula(id1905); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1900); +vc->popto(50); +vc->push(); +vc->query(id1901); +vc->popto(50); +vc->push(); +vc->assertFormula(id1901); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1896); +vc->popto(51); +vc->push(); +vc->query(id1897); +vc->popto(51); +vc->push(); +vc->assertFormula(id1897); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1892); +vc->popto(52); +vc->push(); +vc->query(id1893); +vc->popto(52); +vc->push(); +vc->assertFormula(id1893); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1888); +vc->popto(53); +vc->push(); +vc->query(id1889); +vc->popto(53); +vc->push(); +vc->assertFormula(id1889); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1884); +vc->popto(54); +vc->push(); +vc->query(id1885); +vc->popto(54); +vc->push(); +vc->assertFormula(id1885); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1880); +vc->popto(55); +vc->push(); +vc->query(id1881); +vc->popto(55); +vc->push(); +vc->assertFormula(id1881); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1876); +vc->popto(56); +vc->push(); +vc->query(id1877); +vc->popto(56); +vc->push(); +vc->assertFormula(id1877); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1872); +vc->popto(57); +vc->push(); +vc->query(id1873); +vc->popto(57); +vc->push(); +vc->assertFormula(id1873); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1868); +vc->popto(58); +vc->push(); +vc->query(id1869); +vc->popto(58); +vc->push(); +vc->assertFormula(id1869); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1864); +vc->popto(59); +vc->push(); +vc->query(id1865); +vc->popto(59); +vc->push(); +vc->assertFormula(id1865); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1860); +vc->popto(60); +vc->push(); +vc->query(id1861); +vc->popto(60); +vc->push(); +vc->assertFormula(id1861); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1856); +vc->popto(61); +vc->push(); +vc->query(id1857); +vc->popto(61); +vc->push(); +vc->assertFormula(id1857); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1852); +vc->popto(62); +vc->push(); +vc->query(id1853); +vc->popto(62); +vc->push(); +vc->assertFormula(id1853); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1848); +vc->popto(63); +vc->push(); +vc->query(id1849); +vc->popto(63); +vc->push(); +vc->assertFormula(id1849); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1844); +vc->popto(64); +vc->push(); +vc->query(id1845); +vc->popto(64); +vc->push(); +vc->assertFormula(id1845); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1840); +vc->popto(65); +vc->push(); +vc->query(id1841); +vc->popto(65); +vc->push(); +vc->assertFormula(id1841); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1836); +vc->popto(66); +vc->push(); +vc->query(id1837); +vc->popto(66); +vc->push(); +vc->assertFormula(id1837); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1832); +vc->popto(67); +vc->push(); +vc->query(id1833); +vc->popto(67); +vc->push(); +vc->assertFormula(id1833); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1828); +vc->popto(68); +vc->push(); +vc->query(id1829); +vc->popto(68); +vc->push(); +vc->assertFormula(id1829); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1824); +vc->popto(69); +vc->push(); +vc->query(id1825); +vc->popto(69); +vc->push(); +vc->assertFormula(id1825); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1820); +vc->popto(70); +vc->push(); +vc->query(id1821); +vc->popto(70); +vc->push(); +vc->assertFormula(id1821); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1816); +vc->popto(71); +vc->push(); +vc->query(id1817); +vc->popto(71); +vc->push(); +vc->assertFormula(id1817); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1812); +vc->popto(72); +vc->push(); +vc->query(id1813); +vc->popto(72); +vc->push(); +vc->assertFormula(id1813); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1808); +vc->popto(73); +vc->push(); +vc->query(id1809); +vc->popto(73); +vc->push(); +vc->assertFormula(id1809); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1804); +vc->popto(74); +vc->push(); +vc->query(id1805); +vc->popto(74); +vc->push(); +vc->assertFormula(id1805); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1800); +vc->popto(75); +vc->push(); +vc->query(id1801); +vc->popto(75); +vc->push(); +vc->assertFormula(id1801); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1796); +vc->popto(76); +vc->push(); +vc->query(id1797); +vc->popto(76); +vc->push(); +vc->assertFormula(id1797); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1792); +vc->popto(77); +vc->push(); +vc->query(id1793); +vc->popto(77); +vc->push(); +vc->assertFormula(id1793); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1788); +vc->popto(78); +vc->push(); +vc->query(id1789); +vc->popto(78); +vc->push(); +vc->assertFormula(id1789); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1784); +vc->popto(79); +vc->push(); +vc->query(id1785); +vc->popto(79); +vc->push(); +vc->assertFormula(id1785); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1780); +vc->popto(80); +vc->push(); +vc->query(id1781); +vc->popto(80); +vc->push(); +vc->assertFormula(id1781); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1778); +vc->popto(81); +vc->push(); +vc->query(id1779); +vc->popto(81); +vc->push(); +vc->assertFormula(id1779); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id10566); +vc->popto(82); +vc->push(); +vc->query(id10567); +vc->popto(82); +vc->push(); +vc->query(id10391); +vc->popto(82); +vc->push(); +vc->query(id10390); +vc->popto(82); +vc->push(); +vc->query(id10256); +vc->popto(82); +vc->push(); +vc->query(id10257); +vc->popto(82); +vc->push(); +vc->query(id10218); +vc->popto(82); +vc->push(); +vc->query(id10219); +vc->popto(82); +vc->push(); +vc->assertFormula(id10219); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1562); +vc->popto(83); +vc->push(); +vc->query(id1563); +vc->popto(83); +vc->push(); +vc->query(id10217); +vc->popto(83); +vc->push(); +vc->query(id10216); +vc->popto(83); +vc->push(); +vc->query(id1585); +vc->popto(83); +vc->push(); +vc->query(id1584); +vc->popto(83); +vc->push(); +vc->query(id9788); +vc->popto(83); +vc->push(); +vc->query(id9789); +vc->popto(83); +vc->push(); +vc->assertFormula(id9789); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1550); +vc->popto(84); +vc->push(); +vc->query(id1551); +vc->popto(84); +vc->push(); +vc->assertFormula(id1551); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id9912); +vc->popto(85); +vc->push(); +vc->query(id9913); +vc->popto(85); +vc->push(); +vc->assertFormula(id9913); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id10184); +vc->popto(86); +vc->push(); +vc->query(id10185); +vc->popto(86); +vc->push(); +vc->assertFormula(id10185); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id10044); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in testgeorge1(): \n" << e << endl; + } + delete vc; +} + + +void testgeorge2() { + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("arith3", true); + ValidityChecker *vc = ValidityChecker::create(flags); + try { +/*************/ +vector inconsistency; +/*************/ +Type id9 = vc->realType(); +Type id7 = vc->intType(); +Type id11 = vc->boolType(); +vc->push(); +Expr id13=vc->trueExpr(); +Expr id12=vc->notExpr(vc->trueExpr()); +Type id19=vc->arrayType(id7,id7); +Type id21=vc->arrayType(id7,id9); +Type id23=vc->arrayType(id9,id7); +Type id25=vc->arrayType(id9,id9); +Type id27=vc->tupleType(id19,id7,id7); +Type id29=vc->funType(id27,id19); +Op id31=vc->createOp(".Int_Int_store",id29); +Type id33=vc->tupleType(id21,id7); +Type id35=vc->funType(id33,id9); +Op id37=vc->createOp(".Int_Real_select",id35); +Type id39=vc->tupleType(id21,id7,id9); +Type id41=vc->funType(id39,id21); +Op id43=vc->createOp(".Int_Real_store",id41); +Type id45=vc->tupleType(id19,id7); +Type id47=vc->funType(id45,id7); +Op id49=vc->createOp(".Int_Int_select",id47); +Type id51=vc->tupleType(id23,id9,id7); +Type id53=vc->funType(id51,id23); +Op id55=vc->createOp(".Real_Int_store",id53); +Type id57=vc->tupleType(id25,id9,id9); +Type id59=vc->funType(id57,id25); +Op id61=vc->createOp(".Real_Real_store",id59); +Type id63=vc->tupleType(id23,id9); +Type id65=vc->funType(id63,id7); +Op id67=vc->createOp(".Real_Int_select",id65); +Type id69=vc->tupleType(id25,id9); +Type id71=vc->funType(id69,id9); +Op id73=vc->createOp(".Real_Real_select",id71); +Expr id75=vc->varExpr("x_0",id7); +Expr id77=vc->varExpr("x_1",id7); +Expr id79=vc->varExpr("x_2",id7); +Expr id81=vc->varExpr("x_3",id7); +Expr id83=vc->varExpr("x_4",id19); +Expr id85=vc->varExpr("x_5",id7); +Expr id87=vc->varExpr("x_6",id7); +Expr id89=vc->varExpr("x_7",id7); +Expr id91=vc->varExpr("x_8",id7); +Expr id93=vc->varExpr("x_9",id7); +Expr id95=vc->varExpr("x_10",id19); +Expr id97=vc->varExpr("x_11",id19); +Expr id99=vc->varExpr("x_12",id7); +Expr id101=vc->varExpr("x_13",id7); +Expr id103=vc->varExpr("x_14",id7); +Expr id105=vc->varExpr("x_15",id7); +Expr id107=vc->varExpr("x_16",id19); +Expr id109=vc->varExpr("x_17",id7); +Expr id111=vc->varExpr("x_18",id7); +Expr id113=vc->varExpr("x_19",id7); +Expr id115=vc->varExpr("x_20",id7); +Expr id117=vc->varExpr("x_21",id7); +Expr id119=vc->varExpr("x_22",id7); +Expr id121=vc->varExpr("x_23",id7); +Expr id123=vc->varExpr("x_24",id19); +Expr id125=vc->varExpr("x_25",id7); +Expr id127=vc->varExpr("x_26",id7); +Expr id129=vc->varExpr("x_27",id7); +Expr id131=vc->varExpr("x_28",id19); +Expr id133=vc->varExpr("x_29",id7); +Expr id135=vc->varExpr("x_30",id7); +Expr id137=vc->varExpr("x_31",id7); +Expr id139=vc->varExpr("x_32",id7); +Expr id141=vc->varExpr("x_33",id7); +Expr id143=vc->varExpr("x_34",id7); +Expr id145=vc->varExpr("x_35",id19); +Expr id147=vc->varExpr("x_36",id7); +Expr id149=vc->varExpr("x_37",id7); +Expr id151=vc->varExpr("x_38",id7); +Expr id153=vc->varExpr("x_39",id19); +Expr id155=vc->varExpr("x_40",id7); +Expr id157=vc->varExpr("x_41",id7); +Expr id159=vc->varExpr("x_42",id7); +Expr id161=vc->varExpr("x_43",id7); +Expr id163=vc->varExpr("x_44",id7); +Expr id165=vc->varExpr("x_45",id7); +Expr id167=vc->varExpr("x_46",id19); +Expr id169=vc->varExpr("x_47",id7); +Expr id171=vc->varExpr("x_48",id7); +Expr id173=vc->varExpr("x_49",id7); +Expr id175=vc->varExpr("x_50",id19); +Expr id177=vc->varExpr("x_51",id7); +Expr id179=vc->varExpr("x_52",id7); +Expr id181=vc->varExpr("x_53",id7); +Expr id183=vc->varExpr("x_54",id7); +Expr id185=vc->varExpr("x_55",id7); +Expr id187=vc->varExpr("x_56",id7); +Expr id189=vc->varExpr("x_57",id19); +Expr id191=vc->varExpr("x_58",id7); +Expr id193=vc->varExpr("x_59",id7); +Expr id195=vc->varExpr("x_60",id7); +Expr id197=vc->varExpr("x_61",id19); +Expr id199=vc->varExpr("x_62",id7); +Expr id201=vc->varExpr("x_63",id7); +Expr id203=vc->varExpr("x_64",id7); +Expr id205=vc->varExpr("x_65",id7); +Expr id207=vc->varExpr("x_66",id7); +Expr id209=vc->varExpr("x_67",id7); +Expr id211=vc->varExpr("x_68",id19); +Expr id213=vc->varExpr("x_69",id7); +Expr id215=vc->varExpr("x_70",id7); +Expr id217=vc->varExpr("x_71",id7); +Expr id219=vc->varExpr("x_72",id19); +Expr id221=vc->varExpr("x_73",id7); +Expr id223=vc->varExpr("x_74",id7); +Expr id225=vc->varExpr("x_75",id7); +Expr id227=vc->varExpr("x_76",id7); +Expr id229=vc->varExpr("x_77",id7); +Expr id231=vc->varExpr("x_78",id7); +Expr id233=vc->varExpr("x_79",id19); +Expr id235=vc->varExpr("x_80",id7); +Expr id237=vc->varExpr("x_81",id7); +Expr id239=vc->varExpr("x_82",id7); +Expr id241=vc->varExpr("x_83",id19); +Expr id243=vc->varExpr("x_84",id7); +Expr id245=vc->varExpr("x_85",id7); +Expr id247=vc->varExpr("x_86",id7); +Expr id249=vc->varExpr("x_87",id7); +Expr id251=vc->varExpr("x_88",id7); +Expr id253=vc->varExpr("x_89",id7); +Expr id255=vc->varExpr("x_90",id19); +Expr id257=vc->varExpr("x_91",id7); +Expr id259=vc->varExpr("x_92",id7); +Expr id261=vc->varExpr("x_93",id7); +Expr id263=vc->varExpr("x_94",id19); +Expr id265=vc->varExpr("x_95",id7); +Expr id267=vc->varExpr("x_96",id7); +Expr id269=vc->varExpr("x_97",id7); +Expr id271=vc->varExpr("x_98",id7); +Expr id273=vc->varExpr("x_99",id7); +Expr id275=vc->varExpr("x_100",id7); +Expr id277=vc->varExpr("x_101",id19); +Expr id279=vc->varExpr("x_102",id7); +Expr id281=vc->varExpr("x_103",id7); +Expr id283=vc->varExpr("x_104",id7); +Expr id285=vc->varExpr("x_105",id19); +Expr id287=vc->varExpr("x_106",id7); +Expr id289=vc->varExpr("x_107",id7); +Expr id291=vc->varExpr("x_108",id7); +Expr id293=vc->varExpr("x_109",id7); +Expr id295=vc->varExpr("x_110",id7); +Expr id297=vc->varExpr("x_111",id7); +Expr id299=vc->varExpr("x_112",id19); +Expr id301=vc->varExpr("x_113",id7); +Expr id303=vc->varExpr("x_114",id7); +Expr id305=vc->varExpr("x_115",id7); +Expr id307=vc->varExpr("x_116",id19); +Expr id309=vc->varExpr("x_117",id7); +Expr id311=vc->varExpr("x_118",id7); +Expr id313=vc->varExpr("x_119",id7); +Expr id315=vc->varExpr("x_120",id7); +Expr id317=vc->varExpr("x_121",id7); +Expr id319=vc->varExpr("x_122",id7); +Expr id321=vc->varExpr("x_123",id7); +Expr id323=vc->varExpr("x_124",id7); +Expr id325=vc->varExpr("x_125",id7); +Expr id327=vc->varExpr("x_126",id7); +Expr id329=vc->varExpr("x_127",id7); +Expr id331=vc->varExpr("x_128",id7); +Expr id333=vc->ratExpr(1,1); +Expr id335=vc->plusExpr(id75,id333); +Expr id337=vc->eqExpr(id335,id87); +Expr id336=vc->notExpr(id337); +vc->registerAtom(id337); +Expr id339=vc->eqExpr(id79,id93); +Expr id338=vc->notExpr(id339); +vc->registerAtom(id339); +Expr id341=vc->eqExpr(id97,id95); +Expr id340=vc->notExpr(id341); +vc->registerAtom(id341); +Expr id343=vc->eqExpr(id101,id99); +Expr id342=vc->notExpr(id343); +vc->registerAtom(id343); +Expr id345=vc->eqExpr(id77,id103); +Expr id344=vc->notExpr(id345); +vc->registerAtom(id345); +Expr id347=vc->eqExpr(id81,id105); +Expr id346=vc->notExpr(id347); +vc->registerAtom(id347); +Expr id349=vc->eqExpr(id83,id107); +Expr id348=vc->notExpr(id349); +vc->registerAtom(id349); +Expr id351=vc->eqExpr(id111,id109); +Expr id350=vc->notExpr(id351); +vc->registerAtom(id351); +Expr id353=vc->plusExpr(id87,id333); +Expr id355=vc->eqExpr(id353,id117); +Expr id354=vc->notExpr(id355); +vc->registerAtom(id355); +Expr id357=vc->eqExpr(id93,id121); +Expr id356=vc->notExpr(id357); +vc->registerAtom(id357); +Expr id359=vc->eqExpr(id95,id123); +Expr id358=vc->notExpr(id359); +vc->registerAtom(id359); +Expr id361=vc->eqExpr(id99,id125); +Expr id360=vc->notExpr(id361); +vc->registerAtom(id361); +Expr id363=vc->eqExpr(id103,id127); +Expr id362=vc->notExpr(id363); +vc->registerAtom(id363); +Expr id365=vc->eqExpr(id105,id129); +Expr id364=vc->notExpr(id365); +vc->registerAtom(id365); +Expr id367=vc->eqExpr(id107,id131); +Expr id366=vc->notExpr(id367); +vc->registerAtom(id367); +Expr id369=vc->eqExpr(id109,id133); +Expr id368=vc->notExpr(id369); +vc->registerAtom(id369); +Expr id371=vc->plusExpr(id117,id333); +Expr id373=vc->eqExpr(id371,id139); +Expr id372=vc->notExpr(id373); +vc->registerAtom(id373); +Expr id375=vc->eqExpr(id121,id143); +Expr id374=vc->notExpr(id375); +vc->registerAtom(id375); +Expr id377=vc->eqExpr(id123,id145); +Expr id376=vc->notExpr(id377); +vc->registerAtom(id377); +Expr id379=vc->eqExpr(id125,id147); +Expr id378=vc->notExpr(id379); +vc->registerAtom(id379); +Expr id381=vc->eqExpr(id127,id149); +Expr id380=vc->notExpr(id381); +vc->registerAtom(id381); +Expr id383=vc->eqExpr(id129,id151); +Expr id382=vc->notExpr(id383); +vc->registerAtom(id383); +Expr id385=vc->eqExpr(id131,id153); +Expr id384=vc->notExpr(id385); +vc->registerAtom(id385); +Expr id387=vc->eqExpr(id133,id155); +Expr id386=vc->notExpr(id387); +vc->registerAtom(id387); +Expr id389=vc->plusExpr(id139,id333); +Expr id391=vc->eqExpr(id389,id161); +Expr id390=vc->notExpr(id391); +vc->registerAtom(id391); +Expr id393=vc->eqExpr(id143,id165); +Expr id392=vc->notExpr(id393); +vc->registerAtom(id393); +Expr id395=vc->eqExpr(id145,id167); +Expr id394=vc->notExpr(id395); +vc->registerAtom(id395); +Expr id397=vc->eqExpr(id147,id169); +Expr id396=vc->notExpr(id397); +vc->registerAtom(id397); +Expr id399=vc->eqExpr(id149,id171); +Expr id398=vc->notExpr(id399); +vc->registerAtom(id399); +Expr id401=vc->eqExpr(id151,id173); +Expr id400=vc->notExpr(id401); +vc->registerAtom(id401); +Expr id403=vc->eqExpr(id153,id175); +Expr id402=vc->notExpr(id403); +vc->registerAtom(id403); +Expr id405=vc->eqExpr(id155,id177); +Expr id404=vc->notExpr(id405); +vc->registerAtom(id405); +Expr id407=vc->plusExpr(id161,id333); +Expr id409=vc->eqExpr(id407,id183); +Expr id408=vc->notExpr(id409); +vc->registerAtom(id409); +Expr id411=vc->eqExpr(id165,id187); +Expr id410=vc->notExpr(id411); +vc->registerAtom(id411); +Expr id413=vc->eqExpr(id167,id189); +Expr id412=vc->notExpr(id413); +vc->registerAtom(id413); +Expr id415=vc->eqExpr(id169,id191); +Expr id414=vc->notExpr(id415); +vc->registerAtom(id415); +Expr id417=vc->eqExpr(id171,id193); +Expr id416=vc->notExpr(id417); +vc->registerAtom(id417); +Expr id419=vc->eqExpr(id173,id195); +Expr id418=vc->notExpr(id419); +vc->registerAtom(id419); +Expr id421=vc->eqExpr(id175,id197); +Expr id420=vc->notExpr(id421); +vc->registerAtom(id421); +Expr id423=vc->eqExpr(id177,id199); +Expr id422=vc->notExpr(id423); +vc->registerAtom(id423); +Expr id425=vc->plusExpr(id183,id333); +Expr id427=vc->eqExpr(id425,id205); +Expr id426=vc->notExpr(id427); +vc->registerAtom(id427); +Expr id429=vc->eqExpr(id187,id209); +Expr id428=vc->notExpr(id429); +vc->registerAtom(id429); +Expr id431=vc->eqExpr(id189,id211); +Expr id430=vc->notExpr(id431); +vc->registerAtom(id431); +Expr id433=vc->eqExpr(id191,id213); +Expr id432=vc->notExpr(id433); +vc->registerAtom(id433); +Expr id435=vc->eqExpr(id193,id215); +Expr id434=vc->notExpr(id435); +vc->registerAtom(id435); +Expr id437=vc->eqExpr(id195,id217); +Expr id436=vc->notExpr(id437); +vc->registerAtom(id437); +Expr id439=vc->eqExpr(id197,id219); +Expr id438=vc->notExpr(id439); +vc->registerAtom(id439); +Expr id441=vc->eqExpr(id199,id221); +Expr id440=vc->notExpr(id441); +vc->registerAtom(id441); +Expr id443=vc->plusExpr(id205,id333); +Expr id445=vc->eqExpr(id443,id227); +Expr id444=vc->notExpr(id445); +vc->registerAtom(id445); +Expr id447=vc->eqExpr(id209,id231); +Expr id446=vc->notExpr(id447); +vc->registerAtom(id447); +Expr id449=vc->eqExpr(id211,id233); +Expr id448=vc->notExpr(id449); +vc->registerAtom(id449); +Expr id451=vc->eqExpr(id213,id235); +Expr id450=vc->notExpr(id451); +vc->registerAtom(id451); +Expr id453=vc->eqExpr(id215,id237); +Expr id452=vc->notExpr(id453); +vc->registerAtom(id453); +Expr id455=vc->eqExpr(id217,id239); +Expr id454=vc->notExpr(id455); +vc->registerAtom(id455); +Expr id457=vc->eqExpr(id219,id241); +Expr id456=vc->notExpr(id457); +vc->registerAtom(id457); +Expr id459=vc->eqExpr(id221,id243); +Expr id458=vc->notExpr(id459); +vc->registerAtom(id459); +Expr id461=vc->plusExpr(id227,id333); +Expr id463=vc->eqExpr(id461,id249); +Expr id462=vc->notExpr(id463); +vc->registerAtom(id463); +Expr id465=vc->eqExpr(id231,id253); +Expr id464=vc->notExpr(id465); +vc->registerAtom(id465); +Expr id467=vc->eqExpr(id233,id255); +Expr id466=vc->notExpr(id467); +vc->registerAtom(id467); +Expr id469=vc->eqExpr(id235,id257); +Expr id468=vc->notExpr(id469); +vc->registerAtom(id469); +Expr id471=vc->eqExpr(id237,id259); +Expr id470=vc->notExpr(id471); +vc->registerAtom(id471); +Expr id473=vc->eqExpr(id239,id261); +Expr id472=vc->notExpr(id473); +vc->registerAtom(id473); +Expr id475=vc->eqExpr(id241,id263); +Expr id474=vc->notExpr(id475); +vc->registerAtom(id475); +Expr id477=vc->eqExpr(id243,id265); +Expr id476=vc->notExpr(id477); +vc->registerAtom(id477); +Expr id479=vc->plusExpr(id249,id333); +Expr id481=vc->eqExpr(id479,id271); +Expr id480=vc->notExpr(id481); +vc->registerAtom(id481); +Expr id483=vc->eqExpr(id253,id275); +Expr id482=vc->notExpr(id483); +vc->registerAtom(id483); +Expr id485=vc->eqExpr(id255,id277); +Expr id484=vc->notExpr(id485); +vc->registerAtom(id485); +Expr id487=vc->eqExpr(id257,id279); +Expr id486=vc->notExpr(id487); +vc->registerAtom(id487); +Expr id489=vc->eqExpr(id259,id281); +Expr id488=vc->notExpr(id489); +vc->registerAtom(id489); +Expr id491=vc->eqExpr(id261,id283); +Expr id490=vc->notExpr(id491); +vc->registerAtom(id491); +Expr id493=vc->eqExpr(id263,id285); +Expr id492=vc->notExpr(id493); +vc->registerAtom(id493); +Expr id495=vc->eqExpr(id265,id287); +Expr id494=vc->notExpr(id495); +vc->registerAtom(id495); +Expr id497=vc->plusExpr(id271,id333); +Expr id499=vc->eqExpr(id497,id293); +Expr id498=vc->notExpr(id499); +vc->registerAtom(id499); +Expr id501=vc->eqExpr(id275,id297); +Expr id500=vc->notExpr(id501); +vc->registerAtom(id501); +Expr id503=vc->eqExpr(id277,id299); +Expr id502=vc->notExpr(id503); +vc->registerAtom(id503); +Expr id505=vc->eqExpr(id279,id301); +Expr id504=vc->notExpr(id505); +vc->registerAtom(id505); +Expr id507=vc->eqExpr(id281,id303); +Expr id506=vc->notExpr(id507); +vc->registerAtom(id507); +Expr id509=vc->eqExpr(id283,id305); +Expr id508=vc->notExpr(id509); +vc->registerAtom(id509); +Expr id511=vc->eqExpr(id285,id307); +Expr id510=vc->notExpr(id511); +vc->registerAtom(id511); +Expr id513=vc->eqExpr(id287,id309); +Expr id512=vc->notExpr(id513); +vc->registerAtom(id513); +Expr id515=vc->uminusExpr(id333); +Expr id517=vc->eqExpr(id515,id79); +Expr id516=vc->notExpr(id517); +vc->registerAtom(id517); +Expr id519=vc->eqExpr(id515,id275); +Expr id518=vc->notExpr(id519); +vc->registerAtom(id519); +Expr id521=vc->eqExpr(id515,id253); +Expr id520=vc->notExpr(id521); +vc->registerAtom(id521); +Expr id523=vc->eqExpr(id515,id231); +Expr id522=vc->notExpr(id523); +vc->registerAtom(id523); +Expr id525=vc->eqExpr(id515,id209); +Expr id524=vc->notExpr(id525); +vc->registerAtom(id525); +Expr id527=vc->eqExpr(id515,id187); +Expr id526=vc->notExpr(id527); +vc->registerAtom(id527); +Expr id529=vc->eqExpr(id515,id165); +Expr id528=vc->notExpr(id529); +vc->registerAtom(id529); +Expr id531=vc->eqExpr(id515,id143); +Expr id530=vc->notExpr(id531); +vc->registerAtom(id531); +Expr id533=vc->eqExpr(id515,id121); +Expr id532=vc->notExpr(id533); +vc->registerAtom(id533); +Expr id535=vc->eqExpr(id515,id93); +Expr id534=vc->notExpr(id535); +vc->registerAtom(id535); +Expr id537=vc->ratExpr(0,1); +Expr id539=vc->leExpr(id89,id537); +Expr id538=vc->notExpr(id539); +vc->registerAtom(id539); +Expr id543=vc->eqExpr(id537,id75); +Expr id542=vc->notExpr(id543); +vc->registerAtom(id543); +Expr id547=vc->eqExpr(id537,id77); +Expr id546=vc->notExpr(id547); +vc->registerAtom(id547); +Expr id553=vc->eqExpr(id537,id81); +Expr id552=vc->notExpr(id553); +vc->registerAtom(id553); +Expr id557=vc->readExpr(id83,id79); +Expr id559=vc->eqExpr(id557,id313); +Expr id558=vc->notExpr(id559); +vc->registerAtom(id559); +Expr id563=vc->eqExpr(id313,id85); +Expr id562=vc->notExpr(id563); +vc->registerAtom(id563); +Expr id567=vc->ratExpr(2,1); +Expr id569=vc->plusExpr(id89,id567); +Expr id571=vc->eqExpr(id569,id91); +Expr id570=vc->notExpr(id571); +vc->registerAtom(id571); +Expr id575=vc->readExpr(id107,id93); +Expr id577=vc->eqExpr(id575,id315); +Expr id576=vc->notExpr(id577); +vc->registerAtom(id577); +Expr id581=vc->eqExpr(id315,id115); +Expr id580=vc->notExpr(id581); +vc->registerAtom(id581); +Expr id585=vc->eqExpr(id569,id119); +Expr id584=vc->notExpr(id585); +vc->registerAtom(id585); +Expr id589=vc->readExpr(id131,id121); +Expr id591=vc->eqExpr(id589,id317); +Expr id590=vc->notExpr(id591); +vc->registerAtom(id591); +Expr id595=vc->eqExpr(id317,id137); +Expr id594=vc->notExpr(id595); +vc->registerAtom(id595); +Expr id599=vc->eqExpr(id569,id141); +Expr id598=vc->notExpr(id599); +vc->registerAtom(id599); +Expr id603=vc->readExpr(id153,id143); +Expr id605=vc->eqExpr(id603,id319); +Expr id604=vc->notExpr(id605); +vc->registerAtom(id605); +Expr id609=vc->eqExpr(id319,id159); +Expr id608=vc->notExpr(id609); +vc->registerAtom(id609); +Expr id613=vc->eqExpr(id569,id163); +Expr id612=vc->notExpr(id613); +vc->registerAtom(id613); +Expr id617=vc->readExpr(id175,id165); +Expr id619=vc->eqExpr(id617,id321); +Expr id618=vc->notExpr(id619); +vc->registerAtom(id619); +Expr id623=vc->eqExpr(id321,id181); +Expr id622=vc->notExpr(id623); +vc->registerAtom(id623); +Expr id627=vc->eqExpr(id569,id185); +Expr id626=vc->notExpr(id627); +vc->registerAtom(id627); +Expr id631=vc->readExpr(id197,id187); +Expr id633=vc->eqExpr(id631,id323); +Expr id632=vc->notExpr(id633); +vc->registerAtom(id633); +Expr id637=vc->eqExpr(id323,id203); +Expr id636=vc->notExpr(id637); +vc->registerAtom(id637); +Expr id641=vc->eqExpr(id569,id207); +Expr id640=vc->notExpr(id641); +vc->registerAtom(id641); +Expr id645=vc->readExpr(id219,id209); +Expr id647=vc->eqExpr(id645,id325); +Expr id646=vc->notExpr(id647); +vc->registerAtom(id647); +Expr id651=vc->eqExpr(id325,id225); +Expr id650=vc->notExpr(id651); +vc->registerAtom(id651); +Expr id655=vc->eqExpr(id569,id229); +Expr id654=vc->notExpr(id655); +vc->registerAtom(id655); +Expr id659=vc->readExpr(id241,id231); +Expr id661=vc->eqExpr(id659,id327); +Expr id660=vc->notExpr(id661); +vc->registerAtom(id661); +Expr id665=vc->eqExpr(id327,id247); +Expr id664=vc->notExpr(id665); +vc->registerAtom(id665); +Expr id669=vc->eqExpr(id569,id251); +Expr id668=vc->notExpr(id669); +vc->registerAtom(id669); +Expr id673=vc->readExpr(id263,id253); +Expr id675=vc->eqExpr(id673,id329); +Expr id674=vc->notExpr(id675); +vc->registerAtom(id675); +Expr id679=vc->eqExpr(id329,id269); +Expr id678=vc->notExpr(id679); +vc->registerAtom(id679); +Expr id683=vc->eqExpr(id569,id273); +Expr id682=vc->notExpr(id683); +vc->registerAtom(id683); +Expr id687=vc->readExpr(id285,id275); +Expr id689=vc->eqExpr(id687,id331); +Expr id688=vc->notExpr(id689); +vc->registerAtom(id689); +Expr id693=vc->eqExpr(id331,id291); +Expr id692=vc->notExpr(id693); +vc->registerAtom(id693); +Expr id697=vc->eqExpr(id569,id295); +Expr id696=vc->notExpr(id697); +vc->registerAtom(id697); +Expr id701=vc->eqExpr(id537,id311); +Expr id700=vc->notExpr(id701); +vc->registerAtom(id701); +Expr id703=vc->ltExpr(id271,id89); +Expr id702=vc->notExpr(id703); +vc->registerAtom(id703); +Expr id709=vc->plusExpr(id283,id333); +Expr id711=vc->eqExpr(id709,id305); +Expr id710=vc->notExpr(id711); +vc->registerAtom(id711); +Expr id715=vc->eqExpr(id281,id297); +Expr id714=vc->notExpr(id715); +vc->registerAtom(id715); +Expr id719=vc->plusExpr(id281,id333); +Expr id721=vc->eqExpr(id719,id303); +Expr id720=vc->notExpr(id721); +vc->registerAtom(id721); +Expr id725=vc->writeExpr(id277,id281,id271); +Expr id727=vc->eqExpr(id725,id299); +Expr id726=vc->notExpr(id727); +vc->registerAtom(id727); +Expr id733=vc->writeExpr(id285,id281,id275); +Expr id735=vc->eqExpr(id733,id307); +Expr id734=vc->notExpr(id735); +vc->registerAtom(id735); +Expr id741=vc->eqExpr(id333,id311); +Expr id740=vc->notExpr(id741); +vc->registerAtom(id741); +Expr id743=vc->eqExpr(id89,id271); +Expr id742=vc->notExpr(id743); +vc->registerAtom(id743); +Expr id751=vc->eqExpr(id275,id309); +Expr id750=vc->notExpr(id751); +vc->registerAtom(id751); +Expr id755=vc->eqExpr(id291,id297); +Expr id754=vc->notExpr(id755); +vc->registerAtom(id755); +Expr id773=vc->eqExpr(id567,id311); +Expr id772=vc->notExpr(id773); +vc->registerAtom(id773); +Expr id775=vc->plusExpr(id89,id333); +Expr id777=vc->eqExpr(id775,id271); +Expr id776=vc->notExpr(id777); +vc->registerAtom(id777); +Expr id793=vc->writeExpr(id285,id287,id291); +Expr id795=vc->eqExpr(id793,id307); +Expr id794=vc->notExpr(id795); +vc->registerAtom(id795); +Expr id803=vc->ratExpr(3,1); +Expr id805=vc->eqExpr(id803,id311); +Expr id804=vc->notExpr(id805); +vc->registerAtom(id805); +Expr id807=vc->eqExpr(id295,id271); +Expr id806=vc->notExpr(id807); +vc->registerAtom(id807); +Expr id823=vc->writeExpr(id285,id275,id287); +Expr id825=vc->eqExpr(id823,id307); +Expr id824=vc->notExpr(id825); +vc->registerAtom(id825); +Expr id833=vc->ratExpr(4,1); +Expr id835=vc->eqExpr(id833,id311); +Expr id834=vc->notExpr(id835); +vc->registerAtom(id835); +Expr id837=vc->leExpr(id271,id295); +Expr id836=vc->notExpr(id837); +vc->registerAtom(id837); +Expr id857=vc->eqExpr(id271,id293); +Expr id856=vc->notExpr(id857); +vc->registerAtom(id857); +Expr id865=vc->eqExpr(id537,id289); +Expr id864=vc->notExpr(id865); +vc->registerAtom(id865); +Expr id867=vc->ltExpr(id249,id89); +Expr id866=vc->notExpr(id867); +vc->registerAtom(id867); +Expr id873=vc->plusExpr(id261,id333); +Expr id875=vc->eqExpr(id873,id283); +Expr id874=vc->notExpr(id875); +vc->registerAtom(id875); +Expr id879=vc->eqExpr(id259,id275); +Expr id878=vc->notExpr(id879); +vc->registerAtom(id879); +Expr id883=vc->plusExpr(id259,id333); +Expr id885=vc->eqExpr(id883,id281); +Expr id884=vc->notExpr(id885); +vc->registerAtom(id885); +Expr id889=vc->writeExpr(id255,id259,id249); +Expr id891=vc->eqExpr(id889,id277); +Expr id890=vc->notExpr(id891); +vc->registerAtom(id891); +Expr id897=vc->writeExpr(id263,id259,id253); +Expr id899=vc->eqExpr(id897,id285); +Expr id898=vc->notExpr(id899); +vc->registerAtom(id899); +Expr id905=vc->eqExpr(id333,id289); +Expr id904=vc->notExpr(id905); +vc->registerAtom(id905); +Expr id907=vc->eqExpr(id89,id249); +Expr id906=vc->notExpr(id907); +vc->registerAtom(id907); +Expr id915=vc->eqExpr(id253,id287); +Expr id914=vc->notExpr(id915); +vc->registerAtom(id915); +Expr id919=vc->eqExpr(id269,id275); +Expr id918=vc->notExpr(id919); +vc->registerAtom(id919); +Expr id937=vc->eqExpr(id567,id289); +Expr id936=vc->notExpr(id937); +vc->registerAtom(id937); +Expr id939=vc->eqExpr(id775,id249); +Expr id938=vc->notExpr(id939); +vc->registerAtom(id939); +Expr id955=vc->writeExpr(id263,id265,id269); +Expr id957=vc->eqExpr(id955,id285); +Expr id956=vc->notExpr(id957); +vc->registerAtom(id957); +Expr id965=vc->eqExpr(id803,id289); +Expr id964=vc->notExpr(id965); +vc->registerAtom(id965); +Expr id967=vc->eqExpr(id273,id249); +Expr id966=vc->notExpr(id967); +vc->registerAtom(id967); +Expr id983=vc->writeExpr(id263,id253,id265); +Expr id985=vc->eqExpr(id983,id285); +Expr id984=vc->notExpr(id985); +vc->registerAtom(id985); +Expr id993=vc->eqExpr(id833,id289); +Expr id992=vc->notExpr(id993); +vc->registerAtom(id993); +Expr id995=vc->leExpr(id249,id273); +Expr id994=vc->notExpr(id995); +vc->registerAtom(id995); +Expr id1015=vc->eqExpr(id249,id271); +Expr id1014=vc->notExpr(id1015); +vc->registerAtom(id1015); +Expr id1023=vc->eqExpr(id537,id267); +Expr id1022=vc->notExpr(id1023); +vc->registerAtom(id1023); +Expr id1025=vc->ltExpr(id227,id89); +Expr id1024=vc->notExpr(id1025); +vc->registerAtom(id1025); +Expr id1031=vc->plusExpr(id239,id333); +Expr id1033=vc->eqExpr(id1031,id261); +Expr id1032=vc->notExpr(id1033); +vc->registerAtom(id1033); +Expr id1037=vc->eqExpr(id237,id253); +Expr id1036=vc->notExpr(id1037); +vc->registerAtom(id1037); +Expr id1041=vc->plusExpr(id237,id333); +Expr id1043=vc->eqExpr(id1041,id259); +Expr id1042=vc->notExpr(id1043); +vc->registerAtom(id1043); +Expr id1047=vc->writeExpr(id233,id237,id227); +Expr id1049=vc->eqExpr(id1047,id255); +Expr id1048=vc->notExpr(id1049); +vc->registerAtom(id1049); +Expr id1055=vc->writeExpr(id241,id237,id231); +Expr id1057=vc->eqExpr(id1055,id263); +Expr id1056=vc->notExpr(id1057); +vc->registerAtom(id1057); +Expr id1063=vc->eqExpr(id333,id267); +Expr id1062=vc->notExpr(id1063); +vc->registerAtom(id1063); +Expr id1065=vc->eqExpr(id89,id227); +Expr id1064=vc->notExpr(id1065); +vc->registerAtom(id1065); +Expr id1073=vc->eqExpr(id231,id265); +Expr id1072=vc->notExpr(id1073); +vc->registerAtom(id1073); +Expr id1077=vc->eqExpr(id247,id253); +Expr id1076=vc->notExpr(id1077); +vc->registerAtom(id1077); +Expr id1095=vc->eqExpr(id567,id267); +Expr id1094=vc->notExpr(id1095); +vc->registerAtom(id1095); +Expr id1097=vc->eqExpr(id775,id227); +Expr id1096=vc->notExpr(id1097); +vc->registerAtom(id1097); +Expr id1113=vc->writeExpr(id241,id243,id247); +Expr id1115=vc->eqExpr(id1113,id263); +Expr id1114=vc->notExpr(id1115); +vc->registerAtom(id1115); +Expr id1123=vc->eqExpr(id803,id267); +Expr id1122=vc->notExpr(id1123); +vc->registerAtom(id1123); +Expr id1125=vc->eqExpr(id251,id227); +Expr id1124=vc->notExpr(id1125); +vc->registerAtom(id1125); +Expr id1141=vc->writeExpr(id241,id231,id243); +Expr id1143=vc->eqExpr(id1141,id263); +Expr id1142=vc->notExpr(id1143); +vc->registerAtom(id1143); +Expr id1151=vc->eqExpr(id833,id267); +Expr id1150=vc->notExpr(id1151); +vc->registerAtom(id1151); +Expr id1153=vc->leExpr(id227,id251); +Expr id1152=vc->notExpr(id1153); +vc->registerAtom(id1153); +Expr id1173=vc->eqExpr(id227,id249); +Expr id1172=vc->notExpr(id1173); +vc->registerAtom(id1173); +Expr id1181=vc->eqExpr(id537,id245); +Expr id1180=vc->notExpr(id1181); +vc->registerAtom(id1181); +Expr id1183=vc->ltExpr(id205,id89); +Expr id1182=vc->notExpr(id1183); +vc->registerAtom(id1183); +Expr id1189=vc->plusExpr(id217,id333); +Expr id1191=vc->eqExpr(id1189,id239); +Expr id1190=vc->notExpr(id1191); +vc->registerAtom(id1191); +Expr id1195=vc->eqExpr(id215,id231); +Expr id1194=vc->notExpr(id1195); +vc->registerAtom(id1195); +Expr id1199=vc->plusExpr(id215,id333); +Expr id1201=vc->eqExpr(id1199,id237); +Expr id1200=vc->notExpr(id1201); +vc->registerAtom(id1201); +Expr id1205=vc->writeExpr(id211,id215,id205); +Expr id1207=vc->eqExpr(id1205,id233); +Expr id1206=vc->notExpr(id1207); +vc->registerAtom(id1207); +Expr id1213=vc->writeExpr(id219,id215,id209); +Expr id1215=vc->eqExpr(id1213,id241); +Expr id1214=vc->notExpr(id1215); +vc->registerAtom(id1215); +Expr id1221=vc->eqExpr(id333,id245); +Expr id1220=vc->notExpr(id1221); +vc->registerAtom(id1221); +Expr id1223=vc->eqExpr(id89,id205); +Expr id1222=vc->notExpr(id1223); +vc->registerAtom(id1223); +Expr id1231=vc->eqExpr(id209,id243); +Expr id1230=vc->notExpr(id1231); +vc->registerAtom(id1231); +Expr id1235=vc->eqExpr(id225,id231); +Expr id1234=vc->notExpr(id1235); +vc->registerAtom(id1235); +Expr id1253=vc->eqExpr(id567,id245); +Expr id1252=vc->notExpr(id1253); +vc->registerAtom(id1253); +Expr id1255=vc->eqExpr(id775,id205); +Expr id1254=vc->notExpr(id1255); +vc->registerAtom(id1255); +Expr id1271=vc->writeExpr(id219,id221,id225); +Expr id1273=vc->eqExpr(id1271,id241); +Expr id1272=vc->notExpr(id1273); +vc->registerAtom(id1273); +Expr id1281=vc->eqExpr(id803,id245); +Expr id1280=vc->notExpr(id1281); +vc->registerAtom(id1281); +Expr id1283=vc->eqExpr(id229,id205); +Expr id1282=vc->notExpr(id1283); +vc->registerAtom(id1283); +Expr id1299=vc->writeExpr(id219,id209,id221); +Expr id1301=vc->eqExpr(id1299,id241); +Expr id1300=vc->notExpr(id1301); +vc->registerAtom(id1301); +Expr id1309=vc->eqExpr(id833,id245); +Expr id1308=vc->notExpr(id1309); +vc->registerAtom(id1309); +Expr id1311=vc->leExpr(id205,id229); +Expr id1310=vc->notExpr(id1311); +vc->registerAtom(id1311); +Expr id1331=vc->eqExpr(id205,id227); +Expr id1330=vc->notExpr(id1331); +vc->registerAtom(id1331); +Expr id1339=vc->eqExpr(id537,id223); +Expr id1338=vc->notExpr(id1339); +vc->registerAtom(id1339); +Expr id1341=vc->ltExpr(id183,id89); +Expr id1340=vc->notExpr(id1341); +vc->registerAtom(id1341); +Expr id1347=vc->plusExpr(id195,id333); +Expr id1349=vc->eqExpr(id1347,id217); +Expr id1348=vc->notExpr(id1349); +vc->registerAtom(id1349); +Expr id1353=vc->eqExpr(id193,id209); +Expr id1352=vc->notExpr(id1353); +vc->registerAtom(id1353); +Expr id1357=vc->plusExpr(id193,id333); +Expr id1359=vc->eqExpr(id1357,id215); +Expr id1358=vc->notExpr(id1359); +vc->registerAtom(id1359); +Expr id1363=vc->writeExpr(id189,id193,id183); +Expr id1365=vc->eqExpr(id1363,id211); +Expr id1364=vc->notExpr(id1365); +vc->registerAtom(id1365); +Expr id1371=vc->writeExpr(id197,id193,id187); +Expr id1373=vc->eqExpr(id1371,id219); +Expr id1372=vc->notExpr(id1373); +vc->registerAtom(id1373); +Expr id1379=vc->eqExpr(id333,id223); +Expr id1378=vc->notExpr(id1379); +vc->registerAtom(id1379); +Expr id1381=vc->eqExpr(id89,id183); +Expr id1380=vc->notExpr(id1381); +vc->registerAtom(id1381); +Expr id1389=vc->eqExpr(id187,id221); +Expr id1388=vc->notExpr(id1389); +vc->registerAtom(id1389); +Expr id1393=vc->eqExpr(id203,id209); +Expr id1392=vc->notExpr(id1393); +vc->registerAtom(id1393); +Expr id1411=vc->eqExpr(id567,id223); +Expr id1410=vc->notExpr(id1411); +vc->registerAtom(id1411); +Expr id1413=vc->eqExpr(id775,id183); +Expr id1412=vc->notExpr(id1413); +vc->registerAtom(id1413); +Expr id1429=vc->writeExpr(id197,id199,id203); +Expr id1431=vc->eqExpr(id1429,id219); +Expr id1430=vc->notExpr(id1431); +vc->registerAtom(id1431); +Expr id1439=vc->eqExpr(id803,id223); +Expr id1438=vc->notExpr(id1439); +vc->registerAtom(id1439); +Expr id1441=vc->eqExpr(id207,id183); +Expr id1440=vc->notExpr(id1441); +vc->registerAtom(id1441); +Expr id1457=vc->writeExpr(id197,id187,id199); +Expr id1459=vc->eqExpr(id1457,id219); +Expr id1458=vc->notExpr(id1459); +vc->registerAtom(id1459); +Expr id1467=vc->eqExpr(id833,id223); +Expr id1466=vc->notExpr(id1467); +vc->registerAtom(id1467); +Expr id1469=vc->leExpr(id183,id207); +Expr id1468=vc->notExpr(id1469); +vc->registerAtom(id1469); +Expr id1489=vc->eqExpr(id183,id205); +Expr id1488=vc->notExpr(id1489); +vc->registerAtom(id1489); +Expr id1497=vc->eqExpr(id537,id201); +Expr id1496=vc->notExpr(id1497); +vc->registerAtom(id1497); +Expr id1499=vc->ltExpr(id161,id89); +Expr id1498=vc->notExpr(id1499); +vc->registerAtom(id1499); +Expr id1505=vc->plusExpr(id173,id333); +Expr id1507=vc->eqExpr(id1505,id195); +Expr id1506=vc->notExpr(id1507); +vc->registerAtom(id1507); +Expr id1511=vc->eqExpr(id171,id187); +Expr id1510=vc->notExpr(id1511); +vc->registerAtom(id1511); +Expr id1515=vc->plusExpr(id171,id333); +Expr id1517=vc->eqExpr(id1515,id193); +Expr id1516=vc->notExpr(id1517); +vc->registerAtom(id1517); +Expr id1521=vc->writeExpr(id167,id171,id161); +Expr id1523=vc->eqExpr(id1521,id189); +Expr id1522=vc->notExpr(id1523); +vc->registerAtom(id1523); +Expr id1529=vc->writeExpr(id175,id171,id165); +Expr id1531=vc->eqExpr(id1529,id197); +Expr id1530=vc->notExpr(id1531); +vc->registerAtom(id1531); +Expr id1537=vc->eqExpr(id333,id201); +Expr id1536=vc->notExpr(id1537); +vc->registerAtom(id1537); +Expr id1539=vc->eqExpr(id89,id161); +Expr id1538=vc->notExpr(id1539); +vc->registerAtom(id1539); +Expr id1547=vc->eqExpr(id165,id199); +Expr id1546=vc->notExpr(id1547); +vc->registerAtom(id1547); +Expr id1551=vc->eqExpr(id181,id187); +Expr id1550=vc->notExpr(id1551); +vc->registerAtom(id1551); +Expr id1569=vc->eqExpr(id567,id201); +Expr id1568=vc->notExpr(id1569); +vc->registerAtom(id1569); +Expr id1571=vc->eqExpr(id775,id161); +Expr id1570=vc->notExpr(id1571); +vc->registerAtom(id1571); +Expr id1587=vc->writeExpr(id175,id177,id181); +Expr id1589=vc->eqExpr(id1587,id197); +Expr id1588=vc->notExpr(id1589); +vc->registerAtom(id1589); +Expr id1597=vc->eqExpr(id803,id201); +Expr id1596=vc->notExpr(id1597); +vc->registerAtom(id1597); +Expr id1599=vc->eqExpr(id185,id161); +Expr id1598=vc->notExpr(id1599); +vc->registerAtom(id1599); +Expr id1615=vc->writeExpr(id175,id165,id177); +Expr id1617=vc->eqExpr(id1615,id197); +Expr id1616=vc->notExpr(id1617); +vc->registerAtom(id1617); +Expr id1625=vc->eqExpr(id833,id201); +Expr id1624=vc->notExpr(id1625); +vc->registerAtom(id1625); +Expr id1627=vc->leExpr(id161,id185); +Expr id1626=vc->notExpr(id1627); +vc->registerAtom(id1627); +Expr id1647=vc->eqExpr(id161,id183); +Expr id1646=vc->notExpr(id1647); +vc->registerAtom(id1647); +Expr id1655=vc->eqExpr(id537,id179); +Expr id1654=vc->notExpr(id1655); +vc->registerAtom(id1655); +Expr id1657=vc->ltExpr(id139,id89); +Expr id1656=vc->notExpr(id1657); +vc->registerAtom(id1657); +Expr id1663=vc->plusExpr(id151,id333); +Expr id1665=vc->eqExpr(id1663,id173); +Expr id1664=vc->notExpr(id1665); +vc->registerAtom(id1665); +Expr id1669=vc->eqExpr(id149,id165); +Expr id1668=vc->notExpr(id1669); +vc->registerAtom(id1669); +Expr id1673=vc->plusExpr(id149,id333); +Expr id1675=vc->eqExpr(id1673,id171); +Expr id1674=vc->notExpr(id1675); +vc->registerAtom(id1675); +Expr id1679=vc->writeExpr(id145,id149,id139); +Expr id1681=vc->eqExpr(id1679,id167); +Expr id1680=vc->notExpr(id1681); +vc->registerAtom(id1681); +Expr id1687=vc->writeExpr(id153,id149,id143); +Expr id1689=vc->eqExpr(id1687,id175); +Expr id1688=vc->notExpr(id1689); +vc->registerAtom(id1689); +Expr id1695=vc->eqExpr(id333,id179); +Expr id1694=vc->notExpr(id1695); +vc->registerAtom(id1695); +Expr id1697=vc->eqExpr(id89,id139); +Expr id1696=vc->notExpr(id1697); +vc->registerAtom(id1697); +Expr id1705=vc->eqExpr(id143,id177); +Expr id1704=vc->notExpr(id1705); +vc->registerAtom(id1705); +Expr id1709=vc->eqExpr(id159,id165); +Expr id1708=vc->notExpr(id1709); +vc->registerAtom(id1709); +Expr id1727=vc->eqExpr(id567,id179); +Expr id1726=vc->notExpr(id1727); +vc->registerAtom(id1727); +Expr id1729=vc->eqExpr(id775,id139); +Expr id1728=vc->notExpr(id1729); +vc->registerAtom(id1729); +Expr id1745=vc->writeExpr(id153,id155,id159); +Expr id1747=vc->eqExpr(id1745,id175); +Expr id1746=vc->notExpr(id1747); +vc->registerAtom(id1747); +Expr id1755=vc->eqExpr(id803,id179); +Expr id1754=vc->notExpr(id1755); +vc->registerAtom(id1755); +Expr id1757=vc->eqExpr(id163,id139); +Expr id1756=vc->notExpr(id1757); +vc->registerAtom(id1757); +Expr id1773=vc->writeExpr(id153,id143,id155); +Expr id1775=vc->eqExpr(id1773,id175); +Expr id1774=vc->notExpr(id1775); +vc->registerAtom(id1775); +Expr id1783=vc->eqExpr(id833,id179); +Expr id1782=vc->notExpr(id1783); +vc->registerAtom(id1783); +Expr id1785=vc->leExpr(id139,id163); +Expr id1784=vc->notExpr(id1785); +vc->registerAtom(id1785); +Expr id1805=vc->eqExpr(id139,id161); +Expr id1804=vc->notExpr(id1805); +vc->registerAtom(id1805); +Expr id1813=vc->eqExpr(id537,id157); +Expr id1812=vc->notExpr(id1813); +vc->registerAtom(id1813); +Expr id1815=vc->ltExpr(id117,id89); +Expr id1814=vc->notExpr(id1815); +vc->registerAtom(id1815); +Expr id1821=vc->plusExpr(id129,id333); +Expr id1823=vc->eqExpr(id1821,id151); +Expr id1822=vc->notExpr(id1823); +vc->registerAtom(id1823); +Expr id1827=vc->eqExpr(id127,id143); +Expr id1826=vc->notExpr(id1827); +vc->registerAtom(id1827); +Expr id1831=vc->plusExpr(id127,id333); +Expr id1833=vc->eqExpr(id1831,id149); +Expr id1832=vc->notExpr(id1833); +vc->registerAtom(id1833); +Expr id1837=vc->writeExpr(id123,id127,id117); +Expr id1839=vc->eqExpr(id1837,id145); +Expr id1838=vc->notExpr(id1839); +vc->registerAtom(id1839); +Expr id1845=vc->writeExpr(id131,id127,id121); +Expr id1847=vc->eqExpr(id1845,id153); +Expr id1846=vc->notExpr(id1847); +vc->registerAtom(id1847); +Expr id1853=vc->eqExpr(id333,id157); +Expr id1852=vc->notExpr(id1853); +vc->registerAtom(id1853); +Expr id1855=vc->eqExpr(id89,id117); +Expr id1854=vc->notExpr(id1855); +vc->registerAtom(id1855); +Expr id1863=vc->eqExpr(id121,id155); +Expr id1862=vc->notExpr(id1863); +vc->registerAtom(id1863); +Expr id1867=vc->eqExpr(id137,id143); +Expr id1866=vc->notExpr(id1867); +vc->registerAtom(id1867); +Expr id1885=vc->eqExpr(id567,id157); +Expr id1884=vc->notExpr(id1885); +vc->registerAtom(id1885); +Expr id1887=vc->eqExpr(id775,id117); +Expr id1886=vc->notExpr(id1887); +vc->registerAtom(id1887); +Expr id1903=vc->writeExpr(id131,id133,id137); +Expr id1905=vc->eqExpr(id1903,id153); +Expr id1904=vc->notExpr(id1905); +vc->registerAtom(id1905); +Expr id1913=vc->eqExpr(id803,id157); +Expr id1912=vc->notExpr(id1913); +vc->registerAtom(id1913); +Expr id1915=vc->eqExpr(id141,id117); +Expr id1914=vc->notExpr(id1915); +vc->registerAtom(id1915); +Expr id1931=vc->writeExpr(id131,id121,id133); +Expr id1933=vc->eqExpr(id1931,id153); +Expr id1932=vc->notExpr(id1933); +vc->registerAtom(id1933); +Expr id1941=vc->eqExpr(id833,id157); +Expr id1940=vc->notExpr(id1941); +vc->registerAtom(id1941); +Expr id1943=vc->leExpr(id117,id141); +Expr id1942=vc->notExpr(id1943); +vc->registerAtom(id1943); +Expr id1963=vc->eqExpr(id117,id139); +Expr id1962=vc->notExpr(id1963); +vc->registerAtom(id1963); +Expr id1971=vc->eqExpr(id537,id135); +Expr id1970=vc->notExpr(id1971); +vc->registerAtom(id1971); +Expr id1973=vc->ltExpr(id87,id89); +Expr id1972=vc->notExpr(id1973); +vc->registerAtom(id1973); +Expr id1979=vc->plusExpr(id105,id333); +Expr id1981=vc->eqExpr(id1979,id129); +Expr id1980=vc->notExpr(id1981); +vc->registerAtom(id1981); +Expr id1985=vc->eqExpr(id103,id121); +Expr id1984=vc->notExpr(id1985); +vc->registerAtom(id1985); +Expr id1989=vc->plusExpr(id103,id333); +Expr id1991=vc->eqExpr(id1989,id127); +Expr id1990=vc->notExpr(id1991); +vc->registerAtom(id1991); +Expr id1995=vc->writeExpr(id95,id103,id87); +Expr id1997=vc->eqExpr(id1995,id123); +Expr id1996=vc->notExpr(id1997); +vc->registerAtom(id1997); +Expr id2003=vc->writeExpr(id107,id103,id93); +Expr id2005=vc->eqExpr(id2003,id131); +Expr id2004=vc->notExpr(id2005); +vc->registerAtom(id2005); +Expr id2011=vc->eqExpr(id333,id135); +Expr id2010=vc->notExpr(id2011); +vc->registerAtom(id2011); +Expr id2013=vc->eqExpr(id89,id87); +Expr id2012=vc->notExpr(id2013); +vc->registerAtom(id2013); +Expr id2021=vc->eqExpr(id93,id133); +Expr id2020=vc->notExpr(id2021); +vc->registerAtom(id2021); +Expr id2025=vc->eqExpr(id115,id121); +Expr id2024=vc->notExpr(id2025); +vc->registerAtom(id2025); +Expr id2043=vc->eqExpr(id567,id135); +Expr id2042=vc->notExpr(id2043); +vc->registerAtom(id2043); +Expr id2045=vc->eqExpr(id775,id87); +Expr id2044=vc->notExpr(id2045); +vc->registerAtom(id2045); +Expr id2061=vc->writeExpr(id107,id109,id115); +Expr id2063=vc->eqExpr(id2061,id131); +Expr id2062=vc->notExpr(id2063); +vc->registerAtom(id2063); +Expr id2071=vc->eqExpr(id803,id135); +Expr id2070=vc->notExpr(id2071); +vc->registerAtom(id2071); +Expr id2073=vc->eqExpr(id119,id87); +Expr id2072=vc->notExpr(id2073); +vc->registerAtom(id2073); +Expr id2089=vc->writeExpr(id107,id93,id109); +Expr id2091=vc->eqExpr(id2089,id131); +Expr id2090=vc->notExpr(id2091); +vc->registerAtom(id2091); +Expr id2099=vc->eqExpr(id833,id135); +Expr id2098=vc->notExpr(id2099); +vc->registerAtom(id2099); +Expr id2101=vc->leExpr(id87,id119); +Expr id2100=vc->notExpr(id2101); +vc->registerAtom(id2101); +Expr id2121=vc->eqExpr(id87,id117); +Expr id2120=vc->notExpr(id2121); +vc->registerAtom(id2121); +Expr id2129=vc->eqExpr(id537,id113); +Expr id2128=vc->notExpr(id2129); +vc->registerAtom(id2129); +Expr id2131=vc->ltExpr(id75,id89); +Expr id2130=vc->notExpr(id2131); +vc->registerAtom(id2131); +Expr id2137=vc->plusExpr(id81,id333); +Expr id2139=vc->eqExpr(id2137,id105); +Expr id2138=vc->notExpr(id2139); +vc->registerAtom(id2139); +Expr id2143=vc->eqExpr(id77,id93); +Expr id2142=vc->notExpr(id2143); +vc->registerAtom(id2143); +Expr id2147=vc->plusExpr(id77,id333); +Expr id2149=vc->eqExpr(id2147,id103); +Expr id2148=vc->notExpr(id2149); +vc->registerAtom(id2149); +Expr id2153=vc->writeExpr(id97,id77,id75); +Expr id2155=vc->eqExpr(id2153,id95); +Expr id2154=vc->notExpr(id2155); +vc->registerAtom(id2155); +Expr id2161=vc->writeExpr(id83,id77,id79); +Expr id2163=vc->eqExpr(id2161,id107); +Expr id2162=vc->notExpr(id2163); +vc->registerAtom(id2163); +Expr id2169=vc->eqExpr(id333,id113); +Expr id2168=vc->notExpr(id2169); +vc->registerAtom(id2169); +Expr id2171=vc->eqExpr(id89,id75); +Expr id2170=vc->notExpr(id2171); +vc->registerAtom(id2171); +Expr id2179=vc->eqExpr(id79,id109); +Expr id2178=vc->notExpr(id2179); +vc->registerAtom(id2179); +Expr id2183=vc->eqExpr(id85,id93); +Expr id2182=vc->notExpr(id2183); +vc->registerAtom(id2183); +Expr id2201=vc->eqExpr(id567,id113); +Expr id2200=vc->notExpr(id2201); +vc->registerAtom(id2201); +Expr id2203=vc->eqExpr(id775,id75); +Expr id2202=vc->notExpr(id2203); +vc->registerAtom(id2203); +Expr id2219=vc->writeExpr(id83,id111,id85); +Expr id2221=vc->eqExpr(id2219,id107); +Expr id2220=vc->notExpr(id2221); +vc->registerAtom(id2221); +Expr id2229=vc->eqExpr(id803,id113); +Expr id2228=vc->notExpr(id2229); +vc->registerAtom(id2229); +Expr id2231=vc->eqExpr(id91,id75); +Expr id2230=vc->notExpr(id2231); +vc->registerAtom(id2231); +Expr id2247=vc->writeExpr(id83,id79,id111); +Expr id2249=vc->eqExpr(id2247,id107); +Expr id2248=vc->notExpr(id2249); +vc->registerAtom(id2249); +Expr id2257=vc->eqExpr(id833,id113); +Expr id2256=vc->notExpr(id2257); +vc->registerAtom(id2257); +Expr id2259=vc->leExpr(id75,id91); +Expr id2258=vc->notExpr(id2259); +vc->registerAtom(id2259); +Expr id2279=vc->eqExpr(id75,id87); +Expr id2278=vc->notExpr(id2279); +vc->registerAtom(id2279); +Expr id2287=vc->leExpr(id293,id537); +Expr id2286=vc->notExpr(id2287); +vc->registerAtom(id2287); +Expr id2291=vc->eqExpr(id515,id297); +Expr id2290=vc->notExpr(id2291); +vc->registerAtom(id2291); +Expr id2295=vc->leExpr(id271,id537); +Expr id2294=vc->notExpr(id2295); +vc->registerAtom(id2295); +Expr id2303=vc->leExpr(id249,id537); +Expr id2302=vc->notExpr(id2303); +vc->registerAtom(id2303); +Expr id2311=vc->leExpr(id227,id537); +Expr id2310=vc->notExpr(id2311); +vc->registerAtom(id2311); +Expr id2319=vc->leExpr(id205,id537); +Expr id2318=vc->notExpr(id2319); +vc->registerAtom(id2319); +Expr id2327=vc->leExpr(id183,id537); +Expr id2326=vc->notExpr(id2327); +vc->registerAtom(id2327); +Expr id2335=vc->leExpr(id161,id537); +Expr id2334=vc->notExpr(id2335); +vc->registerAtom(id2335); +Expr id2343=vc->leExpr(id139,id537); +Expr id2342=vc->notExpr(id2343); +vc->registerAtom(id2343); +Expr id2351=vc->leExpr(id117,id537); +Expr id2350=vc->notExpr(id2351); +vc->registerAtom(id2351); +Expr id2359=vc->leExpr(id87,id537); +Expr id2358=vc->notExpr(id2359); +vc->registerAtom(id2359); +Expr id2367=vc->leExpr(id75,id537); +Expr id2366=vc->notExpr(id2367); +vc->registerAtom(id2367); +vc->push(); +vc->query(id12); +vc->inconsistent(inconsistency); +vc->pop(); +vc->push(); +vc->query(id696); +vc->popto(1); +vc->push(); +vc->query(id697); +vc->popto(1); +vc->push(); +vc->assertFormula(id697); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id692); +vc->popto(2); +vc->push(); +vc->query(id693); +vc->popto(2); +vc->push(); +vc->assertFormula(id693); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id688); +vc->popto(3); +vc->push(); +vc->query(id689); +vc->popto(3); +vc->push(); +vc->assertFormula(id689); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id682); +vc->popto(4); +vc->push(); +vc->query(id683); +vc->popto(4); +vc->push(); +vc->assertFormula(id683); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id678); +vc->popto(5); +vc->push(); +vc->query(id679); +vc->popto(5); +vc->push(); +vc->assertFormula(id679); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id674); +vc->popto(6); +vc->push(); +vc->query(id675); +vc->popto(6); +vc->push(); +vc->assertFormula(id675); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id668); +vc->popto(7); +vc->push(); +vc->query(id669); +vc->popto(7); +vc->push(); +vc->assertFormula(id669); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id664); +vc->popto(8); +vc->push(); +vc->query(id665); +vc->popto(8); +vc->push(); +vc->assertFormula(id665); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id660); +vc->popto(9); +vc->push(); +vc->query(id661); +vc->popto(9); +vc->push(); +vc->assertFormula(id661); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id654); +vc->popto(10); +vc->push(); +vc->query(id655); +vc->popto(10); +vc->push(); +vc->assertFormula(id655); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id650); +vc->popto(11); +vc->push(); +vc->query(id651); +vc->popto(11); +vc->push(); +vc->assertFormula(id651); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id646); +vc->popto(12); +vc->push(); +vc->query(id647); +vc->popto(12); +vc->push(); +vc->assertFormula(id647); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id640); +vc->popto(13); +vc->push(); +vc->query(id641); +vc->popto(13); +vc->push(); +vc->assertFormula(id641); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id636); +vc->popto(14); +vc->push(); +vc->query(id637); +vc->popto(14); +vc->push(); +vc->assertFormula(id637); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id632); +vc->popto(15); +vc->push(); +vc->query(id633); +vc->popto(15); +vc->push(); +vc->assertFormula(id633); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id626); +vc->popto(16); +vc->push(); +vc->query(id627); +vc->popto(16); +vc->push(); +vc->assertFormula(id627); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id622); +vc->popto(17); +vc->push(); +vc->query(id623); +vc->popto(17); +vc->push(); +vc->assertFormula(id623); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id618); +vc->popto(18); +vc->push(); +vc->query(id619); +vc->popto(18); +vc->push(); +vc->assertFormula(id619); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id612); +vc->popto(19); +vc->push(); +vc->query(id613); +vc->popto(19); +vc->push(); +vc->assertFormula(id613); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id608); +vc->popto(20); +vc->push(); +vc->query(id609); +vc->popto(20); +vc->push(); +vc->assertFormula(id609); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id604); +vc->popto(21); +vc->push(); +vc->query(id605); +vc->popto(21); +vc->push(); +vc->assertFormula(id605); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id598); +vc->popto(22); +vc->push(); +vc->query(id599); +vc->popto(22); +vc->push(); +vc->assertFormula(id599); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id594); +vc->popto(23); +vc->push(); +vc->query(id595); +vc->popto(23); +vc->push(); +vc->assertFormula(id595); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id590); +vc->popto(24); +vc->push(); +vc->query(id591); +vc->popto(24); +vc->push(); +vc->assertFormula(id591); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id584); +vc->popto(25); +vc->push(); +vc->query(id585); +vc->popto(25); +vc->push(); +vc->assertFormula(id585); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id580); +vc->popto(26); +vc->push(); +vc->query(id581); +vc->popto(26); +vc->push(); +vc->assertFormula(id581); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id576); +vc->popto(27); +vc->push(); +vc->query(id577); +vc->popto(27); +vc->push(); +vc->assertFormula(id577); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id570); +vc->popto(28); +vc->push(); +vc->query(id571); +vc->popto(28); +vc->push(); +vc->assertFormula(id571); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id562); +vc->popto(29); +vc->push(); +vc->query(id563); +vc->popto(29); +vc->push(); +vc->assertFormula(id563); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id558); +vc->popto(30); +vc->push(); +vc->query(id559); +vc->popto(30); +vc->push(); +vc->assertFormula(id559); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id552); +vc->popto(31); +vc->push(); +vc->query(id553); +vc->popto(31); +vc->push(); +vc->assertFormula(id553); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id516); +vc->popto(32); +vc->push(); +vc->query(id517); +vc->popto(32); +vc->push(); +vc->assertFormula(id517); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id546); +vc->popto(33); +vc->push(); +vc->query(id547); +vc->popto(33); +vc->push(); +vc->assertFormula(id547); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id542); +vc->popto(34); +vc->push(); +vc->query(id543); +vc->popto(34); +vc->push(); +vc->assertFormula(id543); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id539); +vc->popto(35); +vc->push(); +vc->query(id538); +vc->popto(35); +vc->push(); +vc->assertFormula(id538); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2366); +vc->popto(36); +vc->push(); +vc->query(id2367); +vc->popto(36); +vc->push(); +vc->query(id2130); +vc->popto(36); +vc->push(); +vc->query(id2131); +vc->popto(36); +vc->push(); +vc->query(id343); +vc->popto(36); +vc->push(); +vc->query(id342); +vc->popto(36); +vc->push(); +vc->query(id342); +vc->popto(36); +vc->push(); +vc->query(id343); +vc->popto(36); +vc->push(); +vc->assertFormula(id343); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id361); +vc->popto(37); +vc->push(); +vc->query(id360); +vc->popto(37); +vc->push(); +vc->query(id360); +vc->popto(37); +vc->push(); +vc->query(id361); +vc->popto(37); +vc->push(); +vc->assertFormula(id361); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id379); +vc->popto(38); +vc->push(); +vc->query(id378); +vc->popto(38); +vc->push(); +vc->query(id378); +vc->popto(38); +vc->push(); +vc->query(id379); +vc->popto(38); +vc->push(); +vc->assertFormula(id379); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id397); +vc->popto(39); +vc->push(); +vc->query(id396); +vc->popto(39); +vc->push(); +vc->query(id396); +vc->popto(39); +vc->push(); +vc->query(id397); +vc->popto(39); +vc->push(); +vc->assertFormula(id397); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id415); +vc->popto(40); +vc->push(); +vc->query(id414); +vc->popto(40); +vc->push(); +vc->query(id414); +vc->popto(40); +vc->push(); +vc->query(id415); +vc->popto(40); +vc->push(); +vc->assertFormula(id415); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id433); +vc->popto(41); +vc->push(); +vc->query(id432); +vc->popto(41); +vc->push(); +vc->query(id432); +vc->popto(41); +vc->push(); +vc->query(id433); +vc->popto(41); +vc->push(); +vc->assertFormula(id433); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id451); +vc->popto(42); +vc->push(); +vc->query(id450); +vc->popto(42); +vc->push(); +vc->query(id450); +vc->popto(42); +vc->push(); +vc->query(id451); +vc->popto(42); +vc->push(); +vc->assertFormula(id451); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id469); +vc->popto(43); +vc->push(); +vc->query(id468); +vc->popto(43); +vc->push(); +vc->query(id468); +vc->popto(43); +vc->push(); +vc->query(id469); +vc->popto(43); +vc->push(); +vc->assertFormula(id469); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id487); +vc->popto(44); +vc->push(); +vc->query(id486); +vc->popto(44); +vc->push(); +vc->query(id486); +vc->popto(44); +vc->push(); +vc->query(id487); +vc->popto(44); +vc->push(); +vc->assertFormula(id487); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id505); +vc->popto(45); +vc->push(); +vc->query(id504); +vc->popto(45); +vc->push(); +vc->query(id504); +vc->popto(45); +vc->push(); +vc->query(id505); +vc->popto(45); +vc->push(); +vc->assertFormula(id505); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id351); +vc->popto(46); +vc->push(); +vc->query(id350); +vc->popto(46); +vc->push(); +vc->query(id350); +vc->popto(46); +vc->push(); +vc->query(id351); +vc->popto(46); +vc->push(); +vc->assertFormula(id351); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id369); +vc->popto(47); +vc->push(); +vc->query(id368); +vc->popto(47); +vc->push(); +vc->query(id368); +vc->popto(47); +vc->push(); +vc->query(id369); +vc->popto(47); +vc->push(); +vc->assertFormula(id369); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id347); +vc->popto(48); +vc->push(); +vc->query(id346); +vc->popto(48); +vc->push(); +vc->query(id346); +vc->popto(48); +vc->push(); +vc->query(id347); +vc->popto(48); +vc->push(); +vc->assertFormula(id347); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2139); +vc->popto(49); +vc->push(); +vc->query(id2138); +vc->popto(49); +vc->push(); +vc->query(id387); +vc->popto(49); +vc->push(); +vc->query(id386); +vc->popto(49); +vc->push(); +vc->query(id386); +vc->popto(49); +vc->push(); +vc->query(id387); +vc->popto(49); +vc->push(); +vc->assertFormula(id387); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id365); +vc->popto(50); +vc->push(); +vc->query(id364); +vc->popto(50); +vc->push(); +vc->query(id364); +vc->popto(50); +vc->push(); +vc->query(id365); +vc->popto(50); +vc->push(); +vc->assertFormula(id365); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1981); +vc->popto(51); +vc->push(); +vc->query(id1980); +vc->popto(51); +vc->push(); +vc->query(id345); +vc->popto(51); +vc->push(); +vc->query(id344); +vc->popto(51); +vc->push(); +vc->query(id344); +vc->popto(51); +vc->push(); +vc->query(id345); +vc->popto(51); +vc->push(); +vc->assertFormula(id345); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2149); +vc->popto(52); +vc->push(); +vc->query(id2148); +vc->popto(52); +vc->push(); +vc->query(id405); +vc->popto(52); +vc->push(); +vc->query(id404); +vc->popto(52); +vc->push(); +vc->query(id404); +vc->popto(52); +vc->push(); +vc->query(id405); +vc->popto(52); +vc->push(); +vc->assertFormula(id405); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id383); +vc->popto(53); +vc->push(); +vc->query(id382); +vc->popto(53); +vc->push(); +vc->query(id382); +vc->popto(53); +vc->push(); +vc->query(id383); +vc->popto(53); +vc->push(); +vc->assertFormula(id383); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1823); +vc->popto(54); +vc->push(); +vc->query(id1822); +vc->popto(54); +vc->push(); +vc->query(id363); +vc->popto(54); +vc->push(); +vc->query(id362); +vc->popto(54); +vc->push(); +vc->query(id362); +vc->popto(54); +vc->push(); +vc->query(id363); +vc->popto(54); +vc->push(); +vc->assertFormula(id363); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1991); +vc->popto(55); +vc->push(); +vc->query(id1990); +vc->popto(55); +vc->push(); +vc->query(id423); +vc->popto(55); +vc->push(); +vc->query(id422); +vc->popto(55); +vc->push(); +vc->query(id422); +vc->popto(55); +vc->push(); +vc->query(id423); +vc->popto(55); +vc->push(); +vc->assertFormula(id423); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id401); +vc->popto(56); +vc->push(); +vc->query(id400); +vc->popto(56); +vc->push(); +vc->query(id400); +vc->popto(56); +vc->push(); +vc->query(id401); +vc->popto(56); +vc->push(); +vc->assertFormula(id401); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1665); +vc->popto(57); +vc->push(); +vc->query(id1664); +vc->popto(57); +vc->push(); +vc->query(id381); +vc->popto(57); +vc->push(); +vc->query(id380); +vc->popto(57); +vc->push(); +vc->query(id380); +vc->popto(57); +vc->push(); +vc->query(id381); +vc->popto(57); +vc->push(); +vc->assertFormula(id381); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1833); +vc->popto(58); +vc->push(); +vc->query(id1832); +vc->popto(58); +vc->push(); +vc->query(id341); +vc->popto(58); +vc->push(); +vc->query(id340); +vc->popto(58); +vc->push(); +vc->query(id340); +vc->popto(58); +vc->push(); +vc->query(id341); +vc->popto(58); +vc->push(); +vc->assertFormula(id341); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id441); +vc->popto(59); +vc->push(); +vc->query(id440); +vc->popto(59); +vc->push(); +vc->query(id440); +vc->popto(59); +vc->push(); +vc->query(id441); +vc->popto(59); +vc->push(); +vc->assertFormula(id441); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id419); +vc->popto(60); +vc->push(); +vc->query(id418); +vc->popto(60); +vc->push(); +vc->query(id418); +vc->popto(60); +vc->push(); +vc->query(id419); +vc->popto(60); +vc->push(); +vc->assertFormula(id419); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1507); +vc->popto(61); +vc->push(); +vc->query(id1506); +vc->popto(61); +vc->push(); +vc->query(id399); +vc->popto(61); +vc->push(); +vc->query(id398); +vc->popto(61); +vc->push(); +vc->query(id398); +vc->popto(61); +vc->push(); +vc->query(id399); +vc->popto(61); +vc->push(); +vc->assertFormula(id399); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1675); +vc->popto(62); +vc->push(); +vc->query(id1674); +vc->popto(62); +vc->push(); +vc->query(id359); +vc->popto(62); +vc->push(); +vc->query(id358); +vc->popto(62); +vc->push(); +vc->query(id358); +vc->popto(62); +vc->push(); +vc->query(id359); +vc->popto(62); +vc->push(); +vc->assertFormula(id359); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id459); +vc->popto(63); +vc->push(); +vc->query(id458); +vc->popto(63); +vc->push(); +vc->query(id458); +vc->popto(63); +vc->push(); +vc->query(id459); +vc->popto(63); +vc->push(); +vc->assertFormula(id459); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id437); +vc->popto(64); +vc->push(); +vc->query(id436); +vc->popto(64); +vc->push(); +vc->query(id436); +vc->popto(64); +vc->push(); +vc->query(id437); +vc->popto(64); +vc->push(); +vc->assertFormula(id437); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1349); +vc->popto(65); +vc->push(); +vc->query(id1348); +vc->popto(65); +vc->push(); +vc->query(id417); +vc->popto(65); +vc->push(); +vc->query(id416); +vc->popto(65); +vc->push(); +vc->query(id416); +vc->popto(65); +vc->push(); +vc->query(id417); +vc->popto(65); +vc->push(); +vc->assertFormula(id417); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1517); +vc->popto(66); +vc->push(); +vc->query(id1516); +vc->popto(66); +vc->push(); +vc->query(id377); +vc->popto(66); +vc->push(); +vc->query(id376); +vc->popto(66); +vc->push(); +vc->query(id376); +vc->popto(66); +vc->push(); +vc->query(id377); +vc->popto(66); +vc->push(); +vc->assertFormula(id377); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id337); +vc->popto(67); +vc->push(); +vc->query(id336); +vc->popto(67); +vc->push(); +vc->query(id336); +vc->popto(67); +vc->push(); +vc->query(id337); +vc->popto(67); +vc->push(); +vc->assertFormula(id337); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2359); +vc->popto(68); +vc->push(); +vc->query(id2358); +vc->popto(68); +vc->push(); +vc->query(id2279); +vc->popto(68); +vc->push(); +vc->query(id2278); +vc->popto(68); +vc->push(); +vc->query(id477); +vc->popto(68); +vc->push(); +vc->query(id476); +vc->popto(68); +vc->push(); +vc->query(id476); +vc->popto(68); +vc->push(); +vc->query(id477); +vc->popto(68); +vc->push(); +vc->assertFormula(id477); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id455); +vc->popto(69); +vc->push(); +vc->query(id454); +vc->popto(69); +vc->push(); +vc->query(id454); +vc->popto(69); +vc->push(); +vc->query(id455); +vc->popto(69); +vc->push(); +vc->assertFormula(id455); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1191); +vc->popto(70); +vc->push(); +vc->query(id1190); +vc->popto(70); +vc->push(); +vc->query(id435); +vc->popto(70); +vc->push(); +vc->query(id434); +vc->popto(70); +vc->push(); +vc->query(id434); +vc->popto(70); +vc->push(); +vc->query(id435); +vc->popto(70); +vc->push(); +vc->assertFormula(id435); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1359); +vc->popto(71); +vc->push(); +vc->query(id1358); +vc->popto(71); +vc->push(); +vc->query(id395); +vc->popto(71); +vc->push(); +vc->query(id394); +vc->popto(71); +vc->push(); +vc->query(id394); +vc->popto(71); +vc->push(); +vc->query(id395); +vc->popto(71); +vc->push(); +vc->assertFormula(id395); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id495); +vc->popto(72); +vc->push(); +vc->query(id494); +vc->popto(72); +vc->push(); +vc->query(id494); +vc->popto(72); +vc->push(); +vc->query(id495); +vc->popto(72); +vc->push(); +vc->assertFormula(id495); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id473); +vc->popto(73); +vc->push(); +vc->query(id472); +vc->popto(73); +vc->push(); +vc->query(id472); +vc->popto(73); +vc->push(); +vc->query(id473); +vc->popto(73); +vc->push(); +vc->assertFormula(id473); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1033); +vc->popto(74); +vc->push(); +vc->query(id1032); +vc->popto(74); +vc->push(); +vc->query(id453); +vc->popto(74); +vc->push(); +vc->query(id452); +vc->popto(74); +vc->push(); +vc->query(id452); +vc->popto(74); +vc->push(); +vc->query(id453); +vc->popto(74); +vc->push(); +vc->assertFormula(id453); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1201); +vc->popto(75); +vc->push(); +vc->query(id1200); +vc->popto(75); +vc->push(); +vc->query(id413); +vc->popto(75); +vc->push(); +vc->query(id412); +vc->popto(75); +vc->push(); +vc->query(id412); +vc->popto(75); +vc->push(); +vc->query(id413); +vc->popto(75); +vc->push(); +vc->assertFormula(id413); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id355); +vc->popto(76); +vc->push(); +vc->query(id354); +vc->popto(76); +vc->push(); +vc->query(id354); +vc->popto(76); +vc->push(); +vc->query(id355); +vc->popto(76); +vc->push(); +vc->assertFormula(id355); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2351); +vc->popto(77); +vc->push(); +vc->query(id2350); +vc->popto(77); +vc->push(); +vc->query(id2121); +vc->popto(77); +vc->push(); +vc->query(id2120); +vc->popto(77); +vc->push(); +vc->query(id513); +vc->popto(77); +vc->push(); +vc->query(id512); +vc->popto(77); +vc->push(); +vc->query(id512); +vc->popto(77); +vc->push(); +vc->query(id513); +vc->popto(77); +vc->push(); +vc->assertFormula(id513); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id491); +vc->popto(78); +vc->push(); +vc->query(id490); +vc->popto(78); +vc->push(); +vc->query(id490); +vc->popto(78); +vc->push(); +vc->query(id491); +vc->popto(78); +vc->push(); +vc->assertFormula(id491); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id875); +vc->popto(79); +vc->push(); +vc->query(id874); +vc->popto(79); +vc->push(); +vc->query(id471); +vc->popto(79); +vc->push(); +vc->query(id470); +vc->popto(79); +vc->push(); +vc->query(id470); +vc->popto(79); +vc->push(); +vc->query(id471); +vc->popto(79); +vc->push(); +vc->assertFormula(id471); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1043); +vc->popto(80); +vc->push(); +vc->query(id1042); +vc->popto(80); +vc->push(); +vc->query(id431); +vc->popto(80); +vc->push(); +vc->query(id430); +vc->popto(80); +vc->push(); +vc->query(id430); +vc->popto(80); +vc->push(); +vc->query(id431); +vc->popto(80); +vc->push(); +vc->assertFormula(id431); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id373); +vc->popto(81); +vc->push(); +vc->query(id372); +vc->popto(81); +vc->push(); +vc->query(id372); +vc->popto(81); +vc->push(); +vc->query(id373); +vc->popto(81); +vc->push(); +vc->assertFormula(id373); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2343); +vc->popto(82); +vc->push(); +vc->query(id2342); +vc->popto(82); +vc->push(); +vc->query(id1963); +vc->popto(82); +vc->push(); +vc->query(id1962); +vc->popto(82); +vc->push(); +vc->query(id509); +vc->popto(82); +vc->push(); +vc->query(id508); +vc->popto(82); +vc->push(); +vc->query(id508); +vc->popto(82); +vc->push(); +vc->query(id509); +vc->popto(82); +vc->push(); +vc->assertFormula(id509); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id711); +vc->popto(83); +vc->push(); +vc->query(id710); +vc->popto(83); +vc->push(); +vc->query(id489); +vc->popto(83); +vc->push(); +vc->query(id488); +vc->popto(83); +vc->push(); +vc->query(id488); +vc->popto(83); +vc->push(); +vc->query(id489); +vc->popto(83); +vc->push(); +vc->assertFormula(id489); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id885); +vc->popto(84); +vc->push(); +vc->query(id884); +vc->popto(84); +vc->push(); +vc->query(id449); +vc->popto(84); +vc->push(); +vc->query(id448); +vc->popto(84); +vc->push(); +vc->query(id448); +vc->popto(84); +vc->push(); +vc->query(id449); +vc->popto(84); +vc->push(); +vc->assertFormula(id449); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id391); +vc->popto(85); +vc->push(); +vc->query(id390); +vc->popto(85); +vc->push(); +vc->query(id390); +vc->popto(85); +vc->push(); +vc->query(id391); +vc->popto(85); +vc->push(); +vc->assertFormula(id391); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2335); +vc->popto(86); +vc->push(); +vc->query(id2334); +vc->popto(86); +vc->push(); +vc->query(id1805); +vc->popto(86); +vc->push(); +vc->query(id1804); +vc->popto(86); +vc->push(); +vc->query(id507); +vc->popto(86); +vc->push(); +vc->query(id506); +vc->popto(86); +vc->push(); +vc->query(id506); +vc->popto(86); +vc->push(); +vc->query(id507); +vc->popto(86); +vc->push(); +vc->assertFormula(id507); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id721); +vc->popto(87); +vc->push(); +vc->query(id720); +vc->popto(87); +vc->push(); +vc->query(id467); +vc->popto(87); +vc->push(); +vc->query(id466); +vc->popto(87); +vc->push(); +vc->query(id466); +vc->popto(87); +vc->push(); +vc->query(id467); +vc->popto(87); +vc->push(); +vc->assertFormula(id467); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id409); +vc->popto(88); +vc->push(); +vc->query(id408); +vc->popto(88); +vc->push(); +vc->query(id408); +vc->popto(88); +vc->push(); +vc->query(id409); +vc->popto(88); +vc->push(); +vc->assertFormula(id409); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2327); +vc->popto(89); +vc->push(); +vc->query(id2326); +vc->popto(89); +vc->push(); +vc->query(id1647); +vc->popto(89); +vc->push(); +vc->query(id1646); +vc->popto(89); +vc->push(); +vc->query(id485); +vc->popto(89); +vc->push(); +vc->query(id484); +vc->popto(89); +vc->push(); +vc->query(id484); +vc->popto(89); +vc->push(); +vc->query(id485); +vc->popto(89); +vc->push(); +vc->assertFormula(id485); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id427); +vc->popto(90); +vc->push(); +vc->query(id426); +vc->popto(90); +vc->push(); +vc->query(id426); +vc->popto(90); +vc->push(); +vc->query(id427); +vc->popto(90); +vc->push(); +vc->assertFormula(id427); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2319); +vc->popto(91); +vc->push(); +vc->query(id2318); +vc->popto(91); +vc->push(); +vc->query(id1489); +vc->popto(91); +vc->push(); +vc->query(id1488); +vc->popto(91); +vc->push(); +vc->query(id503); +vc->popto(91); +vc->push(); +vc->query(id502); +vc->popto(91); +vc->push(); +vc->query(id502); +vc->popto(91); +vc->push(); +vc->query(id503); +vc->popto(91); +vc->push(); +vc->assertFormula(id503); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id445); +vc->popto(92); +vc->push(); +vc->query(id444); +vc->popto(92); +vc->push(); +vc->query(id444); +vc->popto(92); +vc->push(); +vc->query(id445); +vc->popto(92); +vc->push(); +vc->assertFormula(id445); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2311); +vc->popto(93); +vc->push(); +vc->query(id2310); +vc->popto(93); +vc->push(); +vc->query(id1331); +vc->popto(93); +vc->push(); +vc->query(id1330); +vc->popto(93); +vc->push(); +vc->query(id463); +vc->popto(93); +vc->push(); +vc->query(id462); +vc->popto(93); +vc->push(); +vc->query(id462); +vc->popto(93); +vc->push(); +vc->query(id463); +vc->popto(93); +vc->push(); +vc->assertFormula(id463); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2303); +vc->popto(94); +vc->push(); +vc->query(id2302); +vc->popto(94); +vc->push(); +vc->query(id1173); +vc->popto(94); +vc->push(); +vc->query(id1172); +vc->popto(94); +vc->push(); +vc->query(id481); +vc->popto(94); +vc->push(); +vc->query(id480); +vc->popto(94); +vc->push(); +vc->query(id480); +vc->popto(94); +vc->push(); +vc->query(id481); +vc->popto(94); +vc->push(); +vc->assertFormula(id481); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2295); +vc->popto(95); +vc->push(); +vc->query(id2294); +vc->popto(95); +vc->push(); +vc->query(id1015); +vc->popto(95); +vc->push(); +vc->query(id1014); +vc->popto(95); +vc->push(); +vc->query(id499); +vc->popto(95); +vc->push(); +vc->query(id498); +vc->popto(95); +vc->push(); +vc->query(id498); +vc->popto(95); +vc->push(); +vc->query(id499); +vc->popto(95); +vc->push(); +vc->assertFormula(id499); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2287); +vc->popto(96); +vc->push(); +vc->query(id2286); +vc->popto(96); +vc->push(); +vc->query(id857); +vc->popto(96); +vc->push(); +vc->query(id856); +vc->popto(96); +vc->push(); +vc->query(id339); +vc->popto(96); +vc->push(); +vc->query(id338); +vc->popto(96); +vc->push(); +vc->query(id338); +vc->popto(96); +vc->push(); +vc->query(id339); +vc->popto(96); +vc->push(); +vc->assertFormula(id339); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id534); +vc->popto(97); +vc->push(); +vc->query(id535); +vc->popto(97); +vc->push(); +vc->query(id2143); +vc->popto(97); +vc->push(); +vc->query(id2142); +vc->popto(97); +vc->push(); +vc->query(id357); +vc->popto(97); +vc->push(); +vc->query(id356); +vc->popto(97); +vc->push(); +vc->query(id356); +vc->popto(97); +vc->push(); +vc->query(id357); +vc->popto(97); +vc->push(); +vc->assertFormula(id357); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id532); +vc->popto(98); +vc->push(); +vc->query(id533); +vc->popto(98); +vc->push(); +vc->query(id1985); +vc->popto(98); +vc->push(); +vc->query(id1984); +vc->popto(98); +vc->push(); +vc->query(id375); +vc->popto(98); +vc->push(); +vc->query(id374); +vc->popto(98); +vc->push(); +vc->query(id374); +vc->popto(98); +vc->push(); +vc->query(id375); +vc->popto(98); +vc->push(); +vc->assertFormula(id375); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id530); +vc->popto(99); +vc->push(); +vc->query(id531); +vc->popto(99); +vc->push(); +vc->query(id1827); +vc->popto(99); +vc->push(); +vc->query(id1826); +vc->popto(99); +vc->push(); +vc->query(id393); +vc->popto(99); +vc->push(); +vc->query(id392); +vc->popto(99); +vc->push(); +vc->query(id392); +vc->popto(99); +vc->push(); +vc->query(id393); +vc->popto(99); +vc->push(); +vc->assertFormula(id393); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id528); +vc->popto(100); +vc->push(); +vc->query(id529); +vc->popto(100); +vc->push(); +vc->query(id1669); +vc->popto(100); +vc->push(); +vc->query(id1668); +vc->popto(100); +vc->push(); +vc->query(id411); +vc->popto(100); +vc->push(); +vc->query(id410); +vc->popto(100); +vc->push(); +vc->query(id410); +vc->popto(100); +vc->push(); +vc->query(id411); +vc->popto(100); +vc->push(); +vc->assertFormula(id411); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id526); +vc->popto(101); +vc->push(); +vc->query(id527); +vc->popto(101); +vc->push(); +vc->query(id1511); +vc->popto(101); +vc->push(); +vc->query(id1510); +vc->popto(101); +vc->push(); +vc->query(id429); +vc->popto(101); +vc->push(); +vc->query(id428); +vc->popto(101); +vc->push(); +vc->query(id428); +vc->popto(101); +vc->push(); +vc->query(id429); +vc->popto(101); +vc->push(); +vc->assertFormula(id429); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id524); +vc->popto(102); +vc->push(); +vc->query(id525); +vc->popto(102); +vc->push(); +vc->query(id1353); +vc->popto(102); +vc->push(); +vc->query(id1352); +vc->popto(102); +vc->push(); +vc->query(id447); +vc->popto(102); +vc->push(); +vc->query(id446); +vc->popto(102); +vc->push(); +vc->query(id446); +vc->popto(102); +vc->push(); +vc->query(id447); +vc->popto(102); +vc->push(); +vc->assertFormula(id447); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id522); +vc->popto(103); +vc->push(); +vc->query(id523); +vc->popto(103); +vc->push(); +vc->query(id1195); +vc->popto(103); +vc->push(); +vc->query(id1194); +vc->popto(103); +vc->push(); +vc->query(id465); +vc->popto(103); +vc->push(); +vc->query(id464); +vc->popto(103); +vc->push(); +vc->query(id464); +vc->popto(103); +vc->push(); +vc->query(id465); +vc->popto(103); +vc->push(); +vc->assertFormula(id465); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id520); +vc->popto(104); +vc->push(); +vc->query(id521); +vc->popto(104); +vc->push(); +vc->query(id1037); +vc->popto(104); +vc->push(); +vc->query(id1036); +vc->popto(104); +vc->push(); +vc->query(id483); +vc->popto(104); +vc->push(); +vc->query(id482); +vc->popto(104); +vc->push(); +vc->query(id482); +vc->popto(104); +vc->push(); +vc->query(id483); +vc->popto(104); +vc->push(); +vc->assertFormula(id483); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id518); +vc->popto(105); +vc->push(); +vc->query(id519); +vc->popto(105); +vc->push(); +vc->query(id879); +vc->popto(105); +vc->push(); +vc->query(id878); +vc->popto(105); +vc->push(); +vc->query(id501); +vc->popto(105); +vc->push(); +vc->query(id500); +vc->popto(105); +vc->push(); +vc->query(id500); +vc->popto(105); +vc->push(); +vc->query(id501); +vc->popto(105); +vc->push(); +vc->assertFormula(id501); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2290); +vc->popto(106); +vc->push(); +vc->query(id2291); +vc->popto(106); +vc->push(); +vc->query(id715); +vc->popto(106); +vc->push(); +vc->query(id714); +vc->popto(106); +vc->push(); +vc->query(id2220); +vc->popto(106); +vc->push(); +vc->query(id2221); +vc->popto(106); +vc->push(); +vc->assertFormula(id2221); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2202); +vc->popto(107); +vc->popto(106); +vc->push(); +vc->query(id2248); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in testgeorge2(): \n" << e << endl; + } + delete vc; +} + + +void testgeorge3() { + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("arith3", true); + ValidityChecker *vc = ValidityChecker::create(flags); + try { +/*************/ +vector inconsistency; +/*************/ +Type id9 = vc->realType(); +Type id7 = vc->intType(); +Type id11 = vc->boolType(); +vc->push(); +Expr id13=vc->trueExpr(); +Expr id12=vc->notExpr(vc->trueExpr()); +Type id19=vc->arrayType(id7,id7); +Type id21=vc->arrayType(id7,id9); +Type id23=vc->arrayType(id9,id7); +Type id25=vc->arrayType(id9,id9); +Type id27=vc->tupleType(id19,id7,id7); +Type id29=vc->funType(id27,id19); +Op id31=vc->createOp(".Int_Int_store",id29); +Type id33=vc->tupleType(id21,id7); +Type id35=vc->funType(id33,id9); +Op id37=vc->createOp(".Int_Real_select",id35); +Type id39=vc->tupleType(id21,id7,id9); +Type id41=vc->funType(id39,id21); +Op id43=vc->createOp(".Int_Real_store",id41); +Type id45=vc->tupleType(id19,id7); +Type id47=vc->funType(id45,id7); +Op id49=vc->createOp(".Int_Int_select",id47); +Type id51=vc->tupleType(id23,id9,id7); +Type id53=vc->funType(id51,id23); +Op id55=vc->createOp(".Real_Int_store",id53); +Type id57=vc->tupleType(id25,id9,id9); +Type id59=vc->funType(id57,id25); +Op id61=vc->createOp(".Real_Real_store",id59); +Type id63=vc->tupleType(id23,id9); +Type id65=vc->funType(id63,id7); +Op id67=vc->createOp(".Real_Int_select",id65); +Type id69=vc->tupleType(id25,id9); +Type id71=vc->funType(id69,id9); +Op id73=vc->createOp(".Real_Real_select",id71); +Expr id75=vc->varExpr("x_0",id7); +Expr id77=vc->varExpr("x_1",id7); +Expr id79=vc->varExpr("x_2",id7); +Expr id81=vc->varExpr("x_3",id7); +Expr id83=vc->varExpr("x_4",id19); +Expr id85=vc->varExpr("x_5",id7); +Expr id87=vc->varExpr("x_6",id7); +Expr id89=vc->varExpr("x_7",id7); +Expr id91=vc->varExpr("x_8",id7); +Expr id93=vc->varExpr("x_9",id7); +Expr id95=vc->varExpr("x_10",id19); +Expr id97=vc->varExpr("x_11",id19); +Expr id99=vc->varExpr("x_12",id7); +Expr id101=vc->varExpr("x_13",id7); +Expr id103=vc->varExpr("x_14",id7); +Expr id105=vc->varExpr("x_15",id7); +Expr id107=vc->varExpr("x_16",id19); +Expr id109=vc->varExpr("x_17",id7); +Expr id111=vc->varExpr("x_18",id7); +Expr id113=vc->varExpr("x_19",id7); +Expr id115=vc->varExpr("x_20",id7); +Expr id117=vc->varExpr("x_21",id7); +Expr id119=vc->varExpr("x_22",id7); +Expr id121=vc->varExpr("x_23",id7); +Expr id123=vc->varExpr("x_24",id19); +Expr id125=vc->varExpr("x_25",id7); +Expr id127=vc->varExpr("x_26",id7); +Expr id129=vc->varExpr("x_27",id7); +Expr id131=vc->varExpr("x_28",id19); +Expr id133=vc->varExpr("x_29",id7); +Expr id135=vc->varExpr("x_30",id7); +Expr id137=vc->varExpr("x_31",id7); +Expr id139=vc->varExpr("x_32",id7); +Expr id141=vc->varExpr("x_33",id7); +Expr id143=vc->varExpr("x_34",id7); +Expr id145=vc->varExpr("x_35",id19); +Expr id147=vc->varExpr("x_36",id7); +Expr id149=vc->varExpr("x_37",id7); +Expr id151=vc->varExpr("x_38",id7); +Expr id153=vc->varExpr("x_39",id19); +Expr id155=vc->varExpr("x_40",id7); +Expr id157=vc->varExpr("x_41",id7); +Expr id159=vc->varExpr("x_42",id7); +Expr id161=vc->varExpr("x_43",id7); +Expr id163=vc->varExpr("x_44",id7); +Expr id165=vc->varExpr("x_45",id7); +Expr id167=vc->varExpr("x_46",id19); +Expr id169=vc->varExpr("x_47",id7); +Expr id171=vc->varExpr("x_48",id7); +Expr id173=vc->varExpr("x_49",id7); +Expr id175=vc->varExpr("x_50",id19); +Expr id177=vc->varExpr("x_51",id7); +Expr id179=vc->varExpr("x_52",id7); +Expr id181=vc->varExpr("x_53",id7); +Expr id183=vc->varExpr("x_54",id7); +Expr id185=vc->varExpr("x_55",id7); +Expr id187=vc->varExpr("x_56",id7); +Expr id189=vc->varExpr("x_57",id19); +Expr id191=vc->varExpr("x_58",id7); +Expr id193=vc->varExpr("x_59",id7); +Expr id195=vc->varExpr("x_60",id7); +Expr id197=vc->varExpr("x_61",id19); +Expr id199=vc->varExpr("x_62",id7); +Expr id201=vc->varExpr("x_63",id7); +Expr id203=vc->varExpr("x_64",id7); +Expr id205=vc->varExpr("x_65",id7); +Expr id207=vc->varExpr("x_66",id7); +Expr id209=vc->varExpr("x_67",id7); +Expr id211=vc->varExpr("x_68",id19); +Expr id213=vc->varExpr("x_69",id7); +Expr id215=vc->varExpr("x_70",id7); +Expr id217=vc->varExpr("x_71",id7); +Expr id219=vc->varExpr("x_72",id19); +Expr id221=vc->varExpr("x_73",id7); +Expr id223=vc->varExpr("x_74",id7); +Expr id225=vc->varExpr("x_75",id7); +Expr id227=vc->varExpr("x_76",id7); +Expr id229=vc->varExpr("x_77",id7); +Expr id231=vc->varExpr("x_78",id7); +Expr id233=vc->varExpr("x_79",id19); +Expr id235=vc->varExpr("x_80",id7); +Expr id237=vc->varExpr("x_81",id7); +Expr id239=vc->varExpr("x_82",id7); +Expr id241=vc->varExpr("x_83",id19); +Expr id243=vc->varExpr("x_84",id7); +Expr id245=vc->varExpr("x_85",id7); +Expr id247=vc->varExpr("x_86",id7); +Expr id249=vc->varExpr("x_87",id7); +Expr id251=vc->varExpr("x_88",id7); +Expr id253=vc->varExpr("x_89",id7); +Expr id255=vc->varExpr("x_90",id19); +Expr id257=vc->varExpr("x_91",id7); +Expr id259=vc->varExpr("x_92",id7); +Expr id261=vc->varExpr("x_93",id7); +Expr id263=vc->varExpr("x_94",id19); +Expr id265=vc->varExpr("x_95",id7); +Expr id267=vc->varExpr("x_96",id7); +Expr id269=vc->varExpr("x_97",id7); +Expr id271=vc->varExpr("x_98",id7); +Expr id273=vc->varExpr("x_99",id7); +Expr id275=vc->varExpr("x_100",id7); +Expr id277=vc->varExpr("x_101",id19); +Expr id279=vc->varExpr("x_102",id7); +Expr id281=vc->varExpr("x_103",id7); +Expr id283=vc->varExpr("x_104",id7); +Expr id285=vc->varExpr("x_105",id19); +Expr id287=vc->varExpr("x_106",id7); +Expr id289=vc->varExpr("x_107",id7); +Expr id291=vc->varExpr("x_108",id7); +Expr id293=vc->varExpr("x_109",id7); +Expr id295=vc->varExpr("x_110",id7); +Expr id297=vc->varExpr("x_111",id7); +Expr id299=vc->varExpr("x_112",id19); +Expr id301=vc->varExpr("x_113",id7); +Expr id303=vc->varExpr("x_114",id7); +Expr id305=vc->varExpr("x_115",id7); +Expr id307=vc->varExpr("x_116",id19); +Expr id309=vc->varExpr("x_117",id7); +Expr id311=vc->varExpr("x_118",id7); +Expr id313=vc->varExpr("x_119",id7); +Expr id315=vc->varExpr("x_120",id7); +Expr id317=vc->varExpr("x_121",id7); +Expr id319=vc->varExpr("x_122",id7); +Expr id321=vc->varExpr("x_123",id19); +Expr id323=vc->varExpr("x_124",id7); +Expr id325=vc->varExpr("x_125",id7); +Expr id327=vc->varExpr("x_126",id7); +Expr id329=vc->varExpr("x_127",id19); +Expr id331=vc->varExpr("x_128",id7); +Expr id333=vc->varExpr("x_129",id7); +Expr id335=vc->varExpr("x_130",id7); +Expr id337=vc->varExpr("x_131",id7); +Expr id339=vc->varExpr("x_132",id7); +Expr id341=vc->varExpr("x_133",id7); +Expr id343=vc->varExpr("x_134",id19); +Expr id345=vc->varExpr("x_135",id7); +Expr id347=vc->varExpr("x_136",id7); +Expr id349=vc->varExpr("x_137",id7); +Expr id351=vc->varExpr("x_138",id19); +Expr id353=vc->varExpr("x_139",id7); +Expr id355=vc->varExpr("x_140",id7); +Expr id357=vc->varExpr("x_141",id7); +Expr id359=vc->varExpr("x_142",id7); +Expr id361=vc->varExpr("x_143",id7); +Expr id363=vc->varExpr("x_144",id7); +Expr id365=vc->varExpr("x_145",id19); +Expr id367=vc->varExpr("x_146",id7); +Expr id369=vc->varExpr("x_147",id7); +Expr id371=vc->varExpr("x_148",id7); +Expr id373=vc->varExpr("x_149",id19); +Expr id375=vc->varExpr("x_150",id7); +Expr id377=vc->varExpr("x_151",id7); +Expr id379=vc->varExpr("x_152",id7); +Expr id381=vc->varExpr("x_153",id7); +Expr id383=vc->varExpr("x_154",id7); +Expr id385=vc->varExpr("x_155",id7); +Expr id387=vc->varExpr("x_156",id19); +Expr id389=vc->varExpr("x_157",id7); +Expr id391=vc->varExpr("x_158",id7); +Expr id393=vc->varExpr("x_159",id7); +Expr id395=vc->varExpr("x_160",id19); +Expr id397=vc->varExpr("x_161",id7); +Expr id399=vc->varExpr("x_162",id7); +Expr id401=vc->varExpr("x_163",id7); +Expr id403=vc->varExpr("x_164",id7); +Expr id405=vc->varExpr("x_165",id7); +Expr id407=vc->varExpr("x_166",id7); +Expr id409=vc->varExpr("x_167",id19); +Expr id411=vc->varExpr("x_168",id7); +Expr id413=vc->varExpr("x_169",id7); +Expr id415=vc->varExpr("x_170",id7); +Expr id417=vc->varExpr("x_171",id19); +Expr id419=vc->varExpr("x_172",id7); +Expr id421=vc->varExpr("x_173",id7); +Expr id423=vc->varExpr("x_174",id7); +Expr id425=vc->varExpr("x_175",id7); +Expr id427=vc->varExpr("x_176",id7); +Expr id429=vc->varExpr("x_177",id7); +Expr id431=vc->varExpr("x_178",id7); +Expr id433=vc->varExpr("x_179",id7); +Expr id435=vc->varExpr("x_180",id7); +Expr id437=vc->varExpr("x_181",id7); +Expr id439=vc->varExpr("x_182",id7); +Expr id441=vc->varExpr("x_183",id7); +Expr id443=vc->varExpr("x_184",id7); +Expr id445=vc->varExpr("x_185",id7); +Expr id447=vc->varExpr("x_186",id7); +Expr id449=vc->varExpr("x_187",id7); +Expr id451=vc->varExpr("x_188",id7); +Expr id453=vc->ratExpr(1,1); +Expr id455=vc->plusExpr(id75,id453); +Expr id457=vc->eqExpr(id455,id87); +Expr id456=vc->notExpr(id457); +vc->registerAtom(id457); +Expr id459=vc->eqExpr(id79,id93); +Expr id458=vc->notExpr(id459); +vc->registerAtom(id459); +Expr id461=vc->eqExpr(id97,id95); +Expr id460=vc->notExpr(id461); +vc->registerAtom(id461); +Expr id463=vc->eqExpr(id101,id99); +Expr id462=vc->notExpr(id463); +vc->registerAtom(id463); +Expr id465=vc->eqExpr(id77,id103); +Expr id464=vc->notExpr(id465); +vc->registerAtom(id465); +Expr id467=vc->eqExpr(id81,id105); +Expr id466=vc->notExpr(id467); +vc->registerAtom(id467); +Expr id469=vc->eqExpr(id83,id107); +Expr id468=vc->notExpr(id469); +vc->registerAtom(id469); +Expr id471=vc->eqExpr(id111,id109); +Expr id470=vc->notExpr(id471); +vc->registerAtom(id471); +Expr id473=vc->plusExpr(id87,id453); +Expr id475=vc->eqExpr(id473,id117); +Expr id474=vc->notExpr(id475); +vc->registerAtom(id475); +Expr id477=vc->eqExpr(id93,id121); +Expr id476=vc->notExpr(id477); +vc->registerAtom(id477); +Expr id479=vc->eqExpr(id95,id123); +Expr id478=vc->notExpr(id479); +vc->registerAtom(id479); +Expr id481=vc->eqExpr(id99,id125); +Expr id480=vc->notExpr(id481); +vc->registerAtom(id481); +Expr id483=vc->eqExpr(id103,id127); +Expr id482=vc->notExpr(id483); +vc->registerAtom(id483); +Expr id485=vc->eqExpr(id105,id129); +Expr id484=vc->notExpr(id485); +vc->registerAtom(id485); +Expr id487=vc->eqExpr(id107,id131); +Expr id486=vc->notExpr(id487); +vc->registerAtom(id487); +Expr id489=vc->eqExpr(id109,id133); +Expr id488=vc->notExpr(id489); +vc->registerAtom(id489); +Expr id491=vc->plusExpr(id117,id453); +Expr id493=vc->eqExpr(id491,id139); +Expr id492=vc->notExpr(id493); +vc->registerAtom(id493); +Expr id495=vc->eqExpr(id121,id143); +Expr id494=vc->notExpr(id495); +vc->registerAtom(id495); +Expr id497=vc->eqExpr(id123,id145); +Expr id496=vc->notExpr(id497); +vc->registerAtom(id497); +Expr id499=vc->eqExpr(id125,id147); +Expr id498=vc->notExpr(id499); +vc->registerAtom(id499); +Expr id501=vc->eqExpr(id127,id149); +Expr id500=vc->notExpr(id501); +vc->registerAtom(id501); +Expr id503=vc->eqExpr(id129,id151); +Expr id502=vc->notExpr(id503); +vc->registerAtom(id503); +Expr id505=vc->eqExpr(id131,id153); +Expr id504=vc->notExpr(id505); +vc->registerAtom(id505); +Expr id507=vc->eqExpr(id133,id155); +Expr id506=vc->notExpr(id507); +vc->registerAtom(id507); +Expr id509=vc->plusExpr(id139,id453); +Expr id511=vc->eqExpr(id509,id161); +Expr id510=vc->notExpr(id511); +vc->registerAtom(id511); +Expr id513=vc->eqExpr(id143,id165); +Expr id512=vc->notExpr(id513); +vc->registerAtom(id513); +Expr id515=vc->eqExpr(id145,id167); +Expr id514=vc->notExpr(id515); +vc->registerAtom(id515); +Expr id517=vc->eqExpr(id147,id169); +Expr id516=vc->notExpr(id517); +vc->registerAtom(id517); +Expr id519=vc->eqExpr(id149,id171); +Expr id518=vc->notExpr(id519); +vc->registerAtom(id519); +Expr id521=vc->eqExpr(id151,id173); +Expr id520=vc->notExpr(id521); +vc->registerAtom(id521); +Expr id523=vc->eqExpr(id153,id175); +Expr id522=vc->notExpr(id523); +vc->registerAtom(id523); +Expr id525=vc->eqExpr(id155,id177); +Expr id524=vc->notExpr(id525); +vc->registerAtom(id525); +Expr id527=vc->plusExpr(id161,id453); +Expr id529=vc->eqExpr(id527,id183); +Expr id528=vc->notExpr(id529); +vc->registerAtom(id529); +Expr id531=vc->eqExpr(id165,id187); +Expr id530=vc->notExpr(id531); +vc->registerAtom(id531); +Expr id533=vc->eqExpr(id167,id189); +Expr id532=vc->notExpr(id533); +vc->registerAtom(id533); +Expr id535=vc->eqExpr(id169,id191); +Expr id534=vc->notExpr(id535); +vc->registerAtom(id535); +Expr id537=vc->eqExpr(id171,id193); +Expr id536=vc->notExpr(id537); +vc->registerAtom(id537); +Expr id539=vc->eqExpr(id173,id195); +Expr id538=vc->notExpr(id539); +vc->registerAtom(id539); +Expr id541=vc->eqExpr(id175,id197); +Expr id540=vc->notExpr(id541); +vc->registerAtom(id541); +Expr id543=vc->eqExpr(id177,id199); +Expr id542=vc->notExpr(id543); +vc->registerAtom(id543); +Expr id545=vc->plusExpr(id183,id453); +Expr id547=vc->eqExpr(id545,id205); +Expr id546=vc->notExpr(id547); +vc->registerAtom(id547); +Expr id549=vc->eqExpr(id187,id209); +Expr id548=vc->notExpr(id549); +vc->registerAtom(id549); +Expr id551=vc->eqExpr(id189,id211); +Expr id550=vc->notExpr(id551); +vc->registerAtom(id551); +Expr id553=vc->eqExpr(id191,id213); +Expr id552=vc->notExpr(id553); +vc->registerAtom(id553); +Expr id555=vc->eqExpr(id193,id215); +Expr id554=vc->notExpr(id555); +vc->registerAtom(id555); +Expr id557=vc->eqExpr(id195,id217); +Expr id556=vc->notExpr(id557); +vc->registerAtom(id557); +Expr id559=vc->eqExpr(id197,id219); +Expr id558=vc->notExpr(id559); +vc->registerAtom(id559); +Expr id561=vc->eqExpr(id199,id221); +Expr id560=vc->notExpr(id561); +vc->registerAtom(id561); +Expr id563=vc->plusExpr(id205,id453); +Expr id565=vc->eqExpr(id563,id227); +Expr id564=vc->notExpr(id565); +vc->registerAtom(id565); +Expr id567=vc->eqExpr(id209,id231); +Expr id566=vc->notExpr(id567); +vc->registerAtom(id567); +Expr id569=vc->eqExpr(id211,id233); +Expr id568=vc->notExpr(id569); +vc->registerAtom(id569); +Expr id571=vc->eqExpr(id213,id235); +Expr id570=vc->notExpr(id571); +vc->registerAtom(id571); +Expr id573=vc->eqExpr(id215,id237); +Expr id572=vc->notExpr(id573); +vc->registerAtom(id573); +Expr id575=vc->eqExpr(id217,id239); +Expr id574=vc->notExpr(id575); +vc->registerAtom(id575); +Expr id577=vc->eqExpr(id219,id241); +Expr id576=vc->notExpr(id577); +vc->registerAtom(id577); +Expr id579=vc->eqExpr(id221,id243); +Expr id578=vc->notExpr(id579); +vc->registerAtom(id579); +Expr id581=vc->plusExpr(id227,id453); +Expr id583=vc->eqExpr(id581,id249); +Expr id582=vc->notExpr(id583); +vc->registerAtom(id583); +Expr id585=vc->eqExpr(id231,id253); +Expr id584=vc->notExpr(id585); +vc->registerAtom(id585); +Expr id587=vc->eqExpr(id233,id255); +Expr id586=vc->notExpr(id587); +vc->registerAtom(id587); +Expr id589=vc->eqExpr(id235,id257); +Expr id588=vc->notExpr(id589); +vc->registerAtom(id589); +Expr id591=vc->eqExpr(id237,id259); +Expr id590=vc->notExpr(id591); +vc->registerAtom(id591); +Expr id593=vc->eqExpr(id239,id261); +Expr id592=vc->notExpr(id593); +vc->registerAtom(id593); +Expr id595=vc->eqExpr(id241,id263); +Expr id594=vc->notExpr(id595); +vc->registerAtom(id595); +Expr id597=vc->eqExpr(id243,id265); +Expr id596=vc->notExpr(id597); +vc->registerAtom(id597); +Expr id599=vc->plusExpr(id249,id453); +Expr id601=vc->eqExpr(id599,id271); +Expr id600=vc->notExpr(id601); +vc->registerAtom(id601); +Expr id603=vc->eqExpr(id253,id275); +Expr id602=vc->notExpr(id603); +vc->registerAtom(id603); +Expr id605=vc->eqExpr(id255,id277); +Expr id604=vc->notExpr(id605); +vc->registerAtom(id605); +Expr id607=vc->eqExpr(id257,id279); +Expr id606=vc->notExpr(id607); +vc->registerAtom(id607); +Expr id609=vc->eqExpr(id259,id281); +Expr id608=vc->notExpr(id609); +vc->registerAtom(id609); +Expr id611=vc->eqExpr(id261,id283); +Expr id610=vc->notExpr(id611); +vc->registerAtom(id611); +Expr id613=vc->eqExpr(id263,id285); +Expr id612=vc->notExpr(id613); +vc->registerAtom(id613); +Expr id615=vc->eqExpr(id265,id287); +Expr id614=vc->notExpr(id615); +vc->registerAtom(id615); +Expr id617=vc->plusExpr(id271,id453); +Expr id619=vc->eqExpr(id617,id293); +Expr id618=vc->notExpr(id619); +vc->registerAtom(id619); +Expr id621=vc->eqExpr(id275,id297); +Expr id620=vc->notExpr(id621); +vc->registerAtom(id621); +Expr id623=vc->eqExpr(id277,id299); +Expr id622=vc->notExpr(id623); +vc->registerAtom(id623); +Expr id625=vc->eqExpr(id279,id301); +Expr id624=vc->notExpr(id625); +vc->registerAtom(id625); +Expr id627=vc->eqExpr(id281,id303); +Expr id626=vc->notExpr(id627); +vc->registerAtom(id627); +Expr id629=vc->eqExpr(id283,id305); +Expr id628=vc->notExpr(id629); +vc->registerAtom(id629); +Expr id631=vc->eqExpr(id285,id307); +Expr id630=vc->notExpr(id631); +vc->registerAtom(id631); +Expr id633=vc->eqExpr(id287,id309); +Expr id632=vc->notExpr(id633); +vc->registerAtom(id633); +Expr id635=vc->plusExpr(id293,id453); +Expr id637=vc->eqExpr(id635,id315); +Expr id636=vc->notExpr(id637); +vc->registerAtom(id637); +Expr id639=vc->eqExpr(id297,id319); +Expr id638=vc->notExpr(id639); +vc->registerAtom(id639); +Expr id641=vc->eqExpr(id299,id321); +Expr id640=vc->notExpr(id641); +vc->registerAtom(id641); +Expr id643=vc->eqExpr(id301,id323); +Expr id642=vc->notExpr(id643); +vc->registerAtom(id643); +Expr id645=vc->eqExpr(id303,id325); +Expr id644=vc->notExpr(id645); +vc->registerAtom(id645); +Expr id647=vc->eqExpr(id305,id327); +Expr id646=vc->notExpr(id647); +vc->registerAtom(id647); +Expr id649=vc->eqExpr(id307,id329); +Expr id648=vc->notExpr(id649); +vc->registerAtom(id649); +Expr id651=vc->eqExpr(id309,id331); +Expr id650=vc->notExpr(id651); +vc->registerAtom(id651); +Expr id653=vc->plusExpr(id315,id453); +Expr id655=vc->eqExpr(id653,id337); +Expr id654=vc->notExpr(id655); +vc->registerAtom(id655); +Expr id657=vc->eqExpr(id319,id341); +Expr id656=vc->notExpr(id657); +vc->registerAtom(id657); +Expr id659=vc->eqExpr(id321,id343); +Expr id658=vc->notExpr(id659); +vc->registerAtom(id659); +Expr id661=vc->eqExpr(id323,id345); +Expr id660=vc->notExpr(id661); +vc->registerAtom(id661); +Expr id663=vc->eqExpr(id325,id347); +Expr id662=vc->notExpr(id663); +vc->registerAtom(id663); +Expr id665=vc->eqExpr(id327,id349); +Expr id664=vc->notExpr(id665); +vc->registerAtom(id665); +Expr id667=vc->eqExpr(id329,id351); +Expr id666=vc->notExpr(id667); +vc->registerAtom(id667); +Expr id669=vc->eqExpr(id331,id353); +Expr id668=vc->notExpr(id669); +vc->registerAtom(id669); +Expr id671=vc->plusExpr(id337,id453); +Expr id673=vc->eqExpr(id671,id359); +Expr id672=vc->notExpr(id673); +vc->registerAtom(id673); +Expr id675=vc->eqExpr(id341,id363); +Expr id674=vc->notExpr(id675); +vc->registerAtom(id675); +Expr id677=vc->eqExpr(id343,id365); +Expr id676=vc->notExpr(id677); +vc->registerAtom(id677); +Expr id679=vc->eqExpr(id345,id367); +Expr id678=vc->notExpr(id679); +vc->registerAtom(id679); +Expr id681=vc->eqExpr(id347,id369); +Expr id680=vc->notExpr(id681); +vc->registerAtom(id681); +Expr id683=vc->eqExpr(id349,id371); +Expr id682=vc->notExpr(id683); +vc->registerAtom(id683); +Expr id685=vc->eqExpr(id351,id373); +Expr id684=vc->notExpr(id685); +vc->registerAtom(id685); +Expr id687=vc->eqExpr(id353,id375); +Expr id686=vc->notExpr(id687); +vc->registerAtom(id687); +Expr id689=vc->plusExpr(id359,id453); +Expr id691=vc->eqExpr(id689,id381); +Expr id690=vc->notExpr(id691); +vc->registerAtom(id691); +Expr id693=vc->eqExpr(id363,id385); +Expr id692=vc->notExpr(id693); +vc->registerAtom(id693); +Expr id695=vc->eqExpr(id365,id387); +Expr id694=vc->notExpr(id695); +vc->registerAtom(id695); +Expr id697=vc->eqExpr(id367,id389); +Expr id696=vc->notExpr(id697); +vc->registerAtom(id697); +Expr id699=vc->eqExpr(id369,id391); +Expr id698=vc->notExpr(id699); +vc->registerAtom(id699); +Expr id701=vc->eqExpr(id371,id393); +Expr id700=vc->notExpr(id701); +vc->registerAtom(id701); +Expr id703=vc->eqExpr(id373,id395); +Expr id702=vc->notExpr(id703); +vc->registerAtom(id703); +Expr id705=vc->eqExpr(id375,id397); +Expr id704=vc->notExpr(id705); +vc->registerAtom(id705); +Expr id707=vc->plusExpr(id381,id453); +Expr id709=vc->eqExpr(id707,id403); +Expr id708=vc->notExpr(id709); +vc->registerAtom(id709); +Expr id711=vc->eqExpr(id385,id407); +Expr id710=vc->notExpr(id711); +vc->registerAtom(id711); +Expr id713=vc->eqExpr(id387,id409); +Expr id712=vc->notExpr(id713); +vc->registerAtom(id713); +Expr id715=vc->eqExpr(id389,id411); +Expr id714=vc->notExpr(id715); +vc->registerAtom(id715); +Expr id717=vc->eqExpr(id391,id413); +Expr id716=vc->notExpr(id717); +vc->registerAtom(id717); +Expr id719=vc->eqExpr(id393,id415); +Expr id718=vc->notExpr(id719); +vc->registerAtom(id719); +Expr id721=vc->eqExpr(id395,id417); +Expr id720=vc->notExpr(id721); +vc->registerAtom(id721); +Expr id723=vc->eqExpr(id397,id419); +Expr id722=vc->notExpr(id723); +vc->registerAtom(id723); +Expr id725=vc->uminusExpr(id453); +Expr id727=vc->eqExpr(id725,id79); +Expr id726=vc->notExpr(id727); +vc->registerAtom(id727); +Expr id729=vc->eqExpr(id725,id385); +Expr id728=vc->notExpr(id729); +vc->registerAtom(id729); +Expr id731=vc->eqExpr(id725,id363); +Expr id730=vc->notExpr(id731); +vc->registerAtom(id731); +Expr id733=vc->eqExpr(id725,id341); +Expr id732=vc->notExpr(id733); +vc->registerAtom(id733); +Expr id735=vc->eqExpr(id725,id319); +Expr id734=vc->notExpr(id735); +vc->registerAtom(id735); +Expr id737=vc->eqExpr(id725,id297); +Expr id736=vc->notExpr(id737); +vc->registerAtom(id737); +Expr id739=vc->eqExpr(id725,id275); +Expr id738=vc->notExpr(id739); +vc->registerAtom(id739); +Expr id741=vc->eqExpr(id725,id253); +Expr id740=vc->notExpr(id741); +vc->registerAtom(id741); +Expr id743=vc->eqExpr(id725,id231); +Expr id742=vc->notExpr(id743); +vc->registerAtom(id743); +Expr id745=vc->eqExpr(id725,id209); +Expr id744=vc->notExpr(id745); +vc->registerAtom(id745); +Expr id747=vc->eqExpr(id725,id187); +Expr id746=vc->notExpr(id747); +vc->registerAtom(id747); +Expr id749=vc->eqExpr(id725,id165); +Expr id748=vc->notExpr(id749); +vc->registerAtom(id749); +Expr id751=vc->eqExpr(id725,id143); +Expr id750=vc->notExpr(id751); +vc->registerAtom(id751); +Expr id753=vc->eqExpr(id725,id121); +Expr id752=vc->notExpr(id753); +vc->registerAtom(id753); +Expr id755=vc->eqExpr(id725,id93); +Expr id754=vc->notExpr(id755); +vc->registerAtom(id755); +Expr id757=vc->ratExpr(0,1); +Expr id759=vc->leExpr(id89,id757); +Expr id758=vc->notExpr(id759); +vc->registerAtom(id759); +Expr id763=vc->eqExpr(id757,id75); +Expr id762=vc->notExpr(id763); +vc->registerAtom(id763); +Expr id767=vc->eqExpr(id757,id77); +Expr id766=vc->notExpr(id767); +vc->registerAtom(id767); +Expr id773=vc->eqExpr(id757,id81); +Expr id772=vc->notExpr(id773); +vc->registerAtom(id773); +Expr id777=vc->readExpr(id83,id79); +Expr id779=vc->eqExpr(id777,id423); +Expr id778=vc->notExpr(id779); +vc->registerAtom(id779); +Expr id783=vc->eqExpr(id423,id85); +Expr id782=vc->notExpr(id783); +vc->registerAtom(id783); +Expr id787=vc->ratExpr(2,1); +Expr id789=vc->plusExpr(id89,id787); +Expr id791=vc->eqExpr(id789,id91); +Expr id790=vc->notExpr(id791); +vc->registerAtom(id791); +Expr id795=vc->readExpr(id107,id93); +Expr id797=vc->eqExpr(id795,id425); +Expr id796=vc->notExpr(id797); +vc->registerAtom(id797); +Expr id801=vc->eqExpr(id425,id115); +Expr id800=vc->notExpr(id801); +vc->registerAtom(id801); +Expr id805=vc->eqExpr(id789,id119); +Expr id804=vc->notExpr(id805); +vc->registerAtom(id805); +Expr id809=vc->readExpr(id131,id121); +Expr id811=vc->eqExpr(id809,id427); +Expr id810=vc->notExpr(id811); +vc->registerAtom(id811); +Expr id815=vc->eqExpr(id427,id137); +Expr id814=vc->notExpr(id815); +vc->registerAtom(id815); +Expr id819=vc->eqExpr(id789,id141); +Expr id818=vc->notExpr(id819); +vc->registerAtom(id819); +Expr id823=vc->readExpr(id153,id143); +Expr id825=vc->eqExpr(id823,id429); +Expr id824=vc->notExpr(id825); +vc->registerAtom(id825); +Expr id829=vc->eqExpr(id429,id159); +Expr id828=vc->notExpr(id829); +vc->registerAtom(id829); +Expr id833=vc->eqExpr(id789,id163); +Expr id832=vc->notExpr(id833); +vc->registerAtom(id833); +Expr id837=vc->readExpr(id175,id165); +Expr id839=vc->eqExpr(id837,id431); +Expr id838=vc->notExpr(id839); +vc->registerAtom(id839); +Expr id843=vc->eqExpr(id431,id181); +Expr id842=vc->notExpr(id843); +vc->registerAtom(id843); +Expr id847=vc->eqExpr(id789,id185); +Expr id846=vc->notExpr(id847); +vc->registerAtom(id847); +Expr id851=vc->readExpr(id197,id187); +Expr id853=vc->eqExpr(id851,id433); +Expr id852=vc->notExpr(id853); +vc->registerAtom(id853); +Expr id857=vc->eqExpr(id433,id203); +Expr id856=vc->notExpr(id857); +vc->registerAtom(id857); +Expr id861=vc->eqExpr(id789,id207); +Expr id860=vc->notExpr(id861); +vc->registerAtom(id861); +Expr id865=vc->readExpr(id219,id209); +Expr id867=vc->eqExpr(id865,id435); +Expr id866=vc->notExpr(id867); +vc->registerAtom(id867); +Expr id871=vc->eqExpr(id435,id225); +Expr id870=vc->notExpr(id871); +vc->registerAtom(id871); +Expr id875=vc->eqExpr(id789,id229); +Expr id874=vc->notExpr(id875); +vc->registerAtom(id875); +Expr id879=vc->readExpr(id241,id231); +Expr id881=vc->eqExpr(id879,id437); +Expr id880=vc->notExpr(id881); +vc->registerAtom(id881); +Expr id885=vc->eqExpr(id437,id247); +Expr id884=vc->notExpr(id885); +vc->registerAtom(id885); +Expr id889=vc->eqExpr(id789,id251); +Expr id888=vc->notExpr(id889); +vc->registerAtom(id889); +Expr id893=vc->readExpr(id263,id253); +Expr id895=vc->eqExpr(id893,id439); +Expr id894=vc->notExpr(id895); +vc->registerAtom(id895); +Expr id899=vc->eqExpr(id439,id269); +Expr id898=vc->notExpr(id899); +vc->registerAtom(id899); +Expr id903=vc->eqExpr(id789,id273); +Expr id902=vc->notExpr(id903); +vc->registerAtom(id903); +Expr id907=vc->readExpr(id285,id275); +Expr id909=vc->eqExpr(id907,id441); +Expr id908=vc->notExpr(id909); +vc->registerAtom(id909); +Expr id913=vc->eqExpr(id441,id291); +Expr id912=vc->notExpr(id913); +vc->registerAtom(id913); +Expr id917=vc->eqExpr(id789,id295); +Expr id916=vc->notExpr(id917); +vc->registerAtom(id917); +Expr id921=vc->readExpr(id307,id297); +Expr id923=vc->eqExpr(id921,id443); +Expr id922=vc->notExpr(id923); +vc->registerAtom(id923); +Expr id927=vc->eqExpr(id443,id313); +Expr id926=vc->notExpr(id927); +vc->registerAtom(id927); +Expr id931=vc->eqExpr(id789,id317); +Expr id930=vc->notExpr(id931); +vc->registerAtom(id931); +Expr id935=vc->readExpr(id329,id319); +Expr id937=vc->eqExpr(id935,id445); +Expr id936=vc->notExpr(id937); +vc->registerAtom(id937); +Expr id941=vc->eqExpr(id445,id335); +Expr id940=vc->notExpr(id941); +vc->registerAtom(id941); +Expr id945=vc->eqExpr(id789,id339); +Expr id944=vc->notExpr(id945); +vc->registerAtom(id945); +Expr id949=vc->readExpr(id351,id341); +Expr id951=vc->eqExpr(id949,id447); +Expr id950=vc->notExpr(id951); +vc->registerAtom(id951); +Expr id955=vc->eqExpr(id447,id357); +Expr id954=vc->notExpr(id955); +vc->registerAtom(id955); +Expr id959=vc->eqExpr(id789,id361); +Expr id958=vc->notExpr(id959); +vc->registerAtom(id959); +Expr id963=vc->readExpr(id373,id363); +Expr id965=vc->eqExpr(id963,id449); +Expr id964=vc->notExpr(id965); +vc->registerAtom(id965); +Expr id969=vc->eqExpr(id449,id379); +Expr id968=vc->notExpr(id969); +vc->registerAtom(id969); +Expr id973=vc->eqExpr(id789,id383); +Expr id972=vc->notExpr(id973); +vc->registerAtom(id973); +Expr id977=vc->readExpr(id395,id385); +Expr id979=vc->eqExpr(id977,id451); +Expr id978=vc->notExpr(id979); +vc->registerAtom(id979); +Expr id983=vc->eqExpr(id451,id401); +Expr id982=vc->notExpr(id983); +vc->registerAtom(id983); +Expr id987=vc->eqExpr(id789,id405); +Expr id986=vc->notExpr(id987); +vc->registerAtom(id987); +Expr id991=vc->eqExpr(id757,id421); +Expr id990=vc->notExpr(id991); +vc->registerAtom(id991); +Expr id993=vc->ltExpr(id381,id89); +Expr id992=vc->notExpr(id993); +vc->registerAtom(id993); +Expr id999=vc->plusExpr(id393,id453); +Expr id1001=vc->eqExpr(id999,id415); +Expr id1000=vc->notExpr(id1001); +vc->registerAtom(id1001); +Expr id1005=vc->eqExpr(id391,id407); +Expr id1004=vc->notExpr(id1005); +vc->registerAtom(id1005); +Expr id1009=vc->plusExpr(id391,id453); +Expr id1011=vc->eqExpr(id1009,id413); +Expr id1010=vc->notExpr(id1011); +vc->registerAtom(id1011); +Expr id1015=vc->writeExpr(id387,id391,id381); +Expr id1017=vc->eqExpr(id1015,id409); +Expr id1016=vc->notExpr(id1017); +vc->registerAtom(id1017); +Expr id1023=vc->writeExpr(id395,id391,id385); +Expr id1025=vc->eqExpr(id1023,id417); +Expr id1024=vc->notExpr(id1025); +vc->registerAtom(id1025); +Expr id1031=vc->eqExpr(id453,id421); +Expr id1030=vc->notExpr(id1031); +vc->registerAtom(id1031); +Expr id1033=vc->eqExpr(id89,id381); +Expr id1032=vc->notExpr(id1033); +vc->registerAtom(id1033); +Expr id1041=vc->eqExpr(id385,id419); +Expr id1040=vc->notExpr(id1041); +vc->registerAtom(id1041); +Expr id1045=vc->eqExpr(id401,id407); +Expr id1044=vc->notExpr(id1045); +vc->registerAtom(id1045); +Expr id1063=vc->eqExpr(id787,id421); +Expr id1062=vc->notExpr(id1063); +vc->registerAtom(id1063); +Expr id1065=vc->plusExpr(id89,id453); +Expr id1067=vc->eqExpr(id1065,id381); +Expr id1066=vc->notExpr(id1067); +vc->registerAtom(id1067); +Expr id1083=vc->writeExpr(id395,id397,id401); +Expr id1085=vc->eqExpr(id1083,id417); +Expr id1084=vc->notExpr(id1085); +vc->registerAtom(id1085); +Expr id1093=vc->ratExpr(3,1); +Expr id1095=vc->eqExpr(id1093,id421); +Expr id1094=vc->notExpr(id1095); +vc->registerAtom(id1095); +Expr id1097=vc->eqExpr(id405,id381); +Expr id1096=vc->notExpr(id1097); +vc->registerAtom(id1097); +Expr id1113=vc->writeExpr(id395,id385,id397); +Expr id1115=vc->eqExpr(id1113,id417); +Expr id1114=vc->notExpr(id1115); +vc->registerAtom(id1115); +Expr id1123=vc->ratExpr(4,1); +Expr id1125=vc->eqExpr(id1123,id421); +Expr id1124=vc->notExpr(id1125); +vc->registerAtom(id1125); +Expr id1127=vc->leExpr(id381,id405); +Expr id1126=vc->notExpr(id1127); +vc->registerAtom(id1127); +Expr id1147=vc->eqExpr(id381,id403); +Expr id1146=vc->notExpr(id1147); +vc->registerAtom(id1147); +Expr id1155=vc->eqExpr(id757,id399); +Expr id1154=vc->notExpr(id1155); +vc->registerAtom(id1155); +Expr id1157=vc->ltExpr(id359,id89); +Expr id1156=vc->notExpr(id1157); +vc->registerAtom(id1157); +Expr id1163=vc->plusExpr(id371,id453); +Expr id1165=vc->eqExpr(id1163,id393); +Expr id1164=vc->notExpr(id1165); +vc->registerAtom(id1165); +Expr id1169=vc->eqExpr(id369,id385); +Expr id1168=vc->notExpr(id1169); +vc->registerAtom(id1169); +Expr id1173=vc->plusExpr(id369,id453); +Expr id1175=vc->eqExpr(id1173,id391); +Expr id1174=vc->notExpr(id1175); +vc->registerAtom(id1175); +Expr id1179=vc->writeExpr(id365,id369,id359); +Expr id1181=vc->eqExpr(id1179,id387); +Expr id1180=vc->notExpr(id1181); +vc->registerAtom(id1181); +Expr id1187=vc->writeExpr(id373,id369,id363); +Expr id1189=vc->eqExpr(id1187,id395); +Expr id1188=vc->notExpr(id1189); +vc->registerAtom(id1189); +Expr id1195=vc->eqExpr(id453,id399); +Expr id1194=vc->notExpr(id1195); +vc->registerAtom(id1195); +Expr id1197=vc->eqExpr(id89,id359); +Expr id1196=vc->notExpr(id1197); +vc->registerAtom(id1197); +Expr id1205=vc->eqExpr(id363,id397); +Expr id1204=vc->notExpr(id1205); +vc->registerAtom(id1205); +Expr id1209=vc->eqExpr(id379,id385); +Expr id1208=vc->notExpr(id1209); +vc->registerAtom(id1209); +Expr id1227=vc->eqExpr(id787,id399); +Expr id1226=vc->notExpr(id1227); +vc->registerAtom(id1227); +Expr id1229=vc->eqExpr(id1065,id359); +Expr id1228=vc->notExpr(id1229); +vc->registerAtom(id1229); +Expr id1245=vc->writeExpr(id373,id375,id379); +Expr id1247=vc->eqExpr(id1245,id395); +Expr id1246=vc->notExpr(id1247); +vc->registerAtom(id1247); +Expr id1255=vc->eqExpr(id1093,id399); +Expr id1254=vc->notExpr(id1255); +vc->registerAtom(id1255); +Expr id1257=vc->eqExpr(id383,id359); +Expr id1256=vc->notExpr(id1257); +vc->registerAtom(id1257); +Expr id1273=vc->writeExpr(id373,id363,id375); +Expr id1275=vc->eqExpr(id1273,id395); +Expr id1274=vc->notExpr(id1275); +vc->registerAtom(id1275); +Expr id1283=vc->eqExpr(id1123,id399); +Expr id1282=vc->notExpr(id1283); +vc->registerAtom(id1283); +Expr id1285=vc->leExpr(id359,id383); +Expr id1284=vc->notExpr(id1285); +vc->registerAtom(id1285); +Expr id1305=vc->eqExpr(id359,id381); +Expr id1304=vc->notExpr(id1305); +vc->registerAtom(id1305); +Expr id1313=vc->eqExpr(id757,id377); +Expr id1312=vc->notExpr(id1313); +vc->registerAtom(id1313); +Expr id1315=vc->ltExpr(id337,id89); +Expr id1314=vc->notExpr(id1315); +vc->registerAtom(id1315); +Expr id1321=vc->plusExpr(id349,id453); +Expr id1323=vc->eqExpr(id1321,id371); +Expr id1322=vc->notExpr(id1323); +vc->registerAtom(id1323); +Expr id1327=vc->eqExpr(id347,id363); +Expr id1326=vc->notExpr(id1327); +vc->registerAtom(id1327); +Expr id1331=vc->plusExpr(id347,id453); +Expr id1333=vc->eqExpr(id1331,id369); +Expr id1332=vc->notExpr(id1333); +vc->registerAtom(id1333); +Expr id1337=vc->writeExpr(id343,id347,id337); +Expr id1339=vc->eqExpr(id1337,id365); +Expr id1338=vc->notExpr(id1339); +vc->registerAtom(id1339); +Expr id1345=vc->writeExpr(id351,id347,id341); +Expr id1347=vc->eqExpr(id1345,id373); +Expr id1346=vc->notExpr(id1347); +vc->registerAtom(id1347); +Expr id1353=vc->eqExpr(id453,id377); +Expr id1352=vc->notExpr(id1353); +vc->registerAtom(id1353); +Expr id1355=vc->eqExpr(id89,id337); +Expr id1354=vc->notExpr(id1355); +vc->registerAtom(id1355); +Expr id1363=vc->eqExpr(id341,id375); +Expr id1362=vc->notExpr(id1363); +vc->registerAtom(id1363); +Expr id1367=vc->eqExpr(id357,id363); +Expr id1366=vc->notExpr(id1367); +vc->registerAtom(id1367); +Expr id1385=vc->eqExpr(id787,id377); +Expr id1384=vc->notExpr(id1385); +vc->registerAtom(id1385); +Expr id1387=vc->eqExpr(id1065,id337); +Expr id1386=vc->notExpr(id1387); +vc->registerAtom(id1387); +Expr id1403=vc->writeExpr(id351,id353,id357); +Expr id1405=vc->eqExpr(id1403,id373); +Expr id1404=vc->notExpr(id1405); +vc->registerAtom(id1405); +Expr id1413=vc->eqExpr(id1093,id377); +Expr id1412=vc->notExpr(id1413); +vc->registerAtom(id1413); +Expr id1415=vc->eqExpr(id361,id337); +Expr id1414=vc->notExpr(id1415); +vc->registerAtom(id1415); +Expr id1431=vc->writeExpr(id351,id341,id353); +Expr id1433=vc->eqExpr(id1431,id373); +Expr id1432=vc->notExpr(id1433); +vc->registerAtom(id1433); +Expr id1441=vc->eqExpr(id1123,id377); +Expr id1440=vc->notExpr(id1441); +vc->registerAtom(id1441); +Expr id1443=vc->leExpr(id337,id361); +Expr id1442=vc->notExpr(id1443); +vc->registerAtom(id1443); +Expr id1463=vc->eqExpr(id337,id359); +Expr id1462=vc->notExpr(id1463); +vc->registerAtom(id1463); +Expr id1471=vc->eqExpr(id757,id355); +Expr id1470=vc->notExpr(id1471); +vc->registerAtom(id1471); +Expr id1473=vc->ltExpr(id315,id89); +Expr id1472=vc->notExpr(id1473); +vc->registerAtom(id1473); +Expr id1479=vc->plusExpr(id327,id453); +Expr id1481=vc->eqExpr(id1479,id349); +Expr id1480=vc->notExpr(id1481); +vc->registerAtom(id1481); +Expr id1485=vc->eqExpr(id325,id341); +Expr id1484=vc->notExpr(id1485); +vc->registerAtom(id1485); +Expr id1489=vc->plusExpr(id325,id453); +Expr id1491=vc->eqExpr(id1489,id347); +Expr id1490=vc->notExpr(id1491); +vc->registerAtom(id1491); +Expr id1495=vc->writeExpr(id321,id325,id315); +Expr id1497=vc->eqExpr(id1495,id343); +Expr id1496=vc->notExpr(id1497); +vc->registerAtom(id1497); +Expr id1503=vc->writeExpr(id329,id325,id319); +Expr id1505=vc->eqExpr(id1503,id351); +Expr id1504=vc->notExpr(id1505); +vc->registerAtom(id1505); +Expr id1511=vc->eqExpr(id453,id355); +Expr id1510=vc->notExpr(id1511); +vc->registerAtom(id1511); +Expr id1513=vc->eqExpr(id89,id315); +Expr id1512=vc->notExpr(id1513); +vc->registerAtom(id1513); +Expr id1521=vc->eqExpr(id319,id353); +Expr id1520=vc->notExpr(id1521); +vc->registerAtom(id1521); +Expr id1525=vc->eqExpr(id335,id341); +Expr id1524=vc->notExpr(id1525); +vc->registerAtom(id1525); +Expr id1543=vc->eqExpr(id787,id355); +Expr id1542=vc->notExpr(id1543); +vc->registerAtom(id1543); +Expr id1545=vc->eqExpr(id1065,id315); +Expr id1544=vc->notExpr(id1545); +vc->registerAtom(id1545); +Expr id1561=vc->writeExpr(id329,id331,id335); +Expr id1563=vc->eqExpr(id1561,id351); +Expr id1562=vc->notExpr(id1563); +vc->registerAtom(id1563); +Expr id1571=vc->eqExpr(id1093,id355); +Expr id1570=vc->notExpr(id1571); +vc->registerAtom(id1571); +Expr id1573=vc->eqExpr(id339,id315); +Expr id1572=vc->notExpr(id1573); +vc->registerAtom(id1573); +Expr id1589=vc->writeExpr(id329,id319,id331); +Expr id1591=vc->eqExpr(id1589,id351); +Expr id1590=vc->notExpr(id1591); +vc->registerAtom(id1591); +Expr id1599=vc->eqExpr(id1123,id355); +Expr id1598=vc->notExpr(id1599); +vc->registerAtom(id1599); +Expr id1601=vc->leExpr(id315,id339); +Expr id1600=vc->notExpr(id1601); +vc->registerAtom(id1601); +Expr id1621=vc->eqExpr(id315,id337); +Expr id1620=vc->notExpr(id1621); +vc->registerAtom(id1621); +Expr id1629=vc->eqExpr(id757,id333); +Expr id1628=vc->notExpr(id1629); +vc->registerAtom(id1629); +Expr id1631=vc->ltExpr(id293,id89); +Expr id1630=vc->notExpr(id1631); +vc->registerAtom(id1631); +Expr id1637=vc->plusExpr(id305,id453); +Expr id1639=vc->eqExpr(id1637,id327); +Expr id1638=vc->notExpr(id1639); +vc->registerAtom(id1639); +Expr id1643=vc->eqExpr(id303,id319); +Expr id1642=vc->notExpr(id1643); +vc->registerAtom(id1643); +Expr id1647=vc->plusExpr(id303,id453); +Expr id1649=vc->eqExpr(id1647,id325); +Expr id1648=vc->notExpr(id1649); +vc->registerAtom(id1649); +Expr id1653=vc->writeExpr(id299,id303,id293); +Expr id1655=vc->eqExpr(id1653,id321); +Expr id1654=vc->notExpr(id1655); +vc->registerAtom(id1655); +Expr id1661=vc->writeExpr(id307,id303,id297); +Expr id1663=vc->eqExpr(id1661,id329); +Expr id1662=vc->notExpr(id1663); +vc->registerAtom(id1663); +Expr id1669=vc->eqExpr(id453,id333); +Expr id1668=vc->notExpr(id1669); +vc->registerAtom(id1669); +Expr id1671=vc->eqExpr(id89,id293); +Expr id1670=vc->notExpr(id1671); +vc->registerAtom(id1671); +Expr id1679=vc->eqExpr(id297,id331); +Expr id1678=vc->notExpr(id1679); +vc->registerAtom(id1679); +Expr id1683=vc->eqExpr(id313,id319); +Expr id1682=vc->notExpr(id1683); +vc->registerAtom(id1683); +Expr id1701=vc->eqExpr(id787,id333); +Expr id1700=vc->notExpr(id1701); +vc->registerAtom(id1701); +Expr id1703=vc->eqExpr(id1065,id293); +Expr id1702=vc->notExpr(id1703); +vc->registerAtom(id1703); +Expr id1719=vc->writeExpr(id307,id309,id313); +Expr id1721=vc->eqExpr(id1719,id329); +Expr id1720=vc->notExpr(id1721); +vc->registerAtom(id1721); +Expr id1729=vc->eqExpr(id1093,id333); +Expr id1728=vc->notExpr(id1729); +vc->registerAtom(id1729); +Expr id1731=vc->eqExpr(id317,id293); +Expr id1730=vc->notExpr(id1731); +vc->registerAtom(id1731); +Expr id1747=vc->writeExpr(id307,id297,id309); +Expr id1749=vc->eqExpr(id1747,id329); +Expr id1748=vc->notExpr(id1749); +vc->registerAtom(id1749); +Expr id1757=vc->eqExpr(id1123,id333); +Expr id1756=vc->notExpr(id1757); +vc->registerAtom(id1757); +Expr id1759=vc->leExpr(id293,id317); +Expr id1758=vc->notExpr(id1759); +vc->registerAtom(id1759); +Expr id1779=vc->eqExpr(id293,id315); +Expr id1778=vc->notExpr(id1779); +vc->registerAtom(id1779); +Expr id1787=vc->eqExpr(id757,id311); +Expr id1786=vc->notExpr(id1787); +vc->registerAtom(id1787); +Expr id1789=vc->ltExpr(id271,id89); +Expr id1788=vc->notExpr(id1789); +vc->registerAtom(id1789); +Expr id1795=vc->plusExpr(id283,id453); +Expr id1797=vc->eqExpr(id1795,id305); +Expr id1796=vc->notExpr(id1797); +vc->registerAtom(id1797); +Expr id1801=vc->eqExpr(id281,id297); +Expr id1800=vc->notExpr(id1801); +vc->registerAtom(id1801); +Expr id1805=vc->plusExpr(id281,id453); +Expr id1807=vc->eqExpr(id1805,id303); +Expr id1806=vc->notExpr(id1807); +vc->registerAtom(id1807); +Expr id1811=vc->writeExpr(id277,id281,id271); +Expr id1813=vc->eqExpr(id1811,id299); +Expr id1812=vc->notExpr(id1813); +vc->registerAtom(id1813); +Expr id1819=vc->writeExpr(id285,id281,id275); +Expr id1821=vc->eqExpr(id1819,id307); +Expr id1820=vc->notExpr(id1821); +vc->registerAtom(id1821); +Expr id1827=vc->eqExpr(id453,id311); +Expr id1826=vc->notExpr(id1827); +vc->registerAtom(id1827); +Expr id1829=vc->eqExpr(id89,id271); +Expr id1828=vc->notExpr(id1829); +vc->registerAtom(id1829); +Expr id1837=vc->eqExpr(id275,id309); +Expr id1836=vc->notExpr(id1837); +vc->registerAtom(id1837); +Expr id1841=vc->eqExpr(id291,id297); +Expr id1840=vc->notExpr(id1841); +vc->registerAtom(id1841); +Expr id1859=vc->eqExpr(id787,id311); +Expr id1858=vc->notExpr(id1859); +vc->registerAtom(id1859); +Expr id1861=vc->eqExpr(id1065,id271); +Expr id1860=vc->notExpr(id1861); +vc->registerAtom(id1861); +Expr id1877=vc->writeExpr(id285,id287,id291); +Expr id1879=vc->eqExpr(id1877,id307); +Expr id1878=vc->notExpr(id1879); +vc->registerAtom(id1879); +Expr id1887=vc->eqExpr(id1093,id311); +Expr id1886=vc->notExpr(id1887); +vc->registerAtom(id1887); +Expr id1889=vc->eqExpr(id295,id271); +Expr id1888=vc->notExpr(id1889); +vc->registerAtom(id1889); +Expr id1905=vc->writeExpr(id285,id275,id287); +Expr id1907=vc->eqExpr(id1905,id307); +Expr id1906=vc->notExpr(id1907); +vc->registerAtom(id1907); +Expr id1915=vc->eqExpr(id1123,id311); +Expr id1914=vc->notExpr(id1915); +vc->registerAtom(id1915); +Expr id1917=vc->leExpr(id271,id295); +Expr id1916=vc->notExpr(id1917); +vc->registerAtom(id1917); +Expr id1937=vc->eqExpr(id271,id293); +Expr id1936=vc->notExpr(id1937); +vc->registerAtom(id1937); +Expr id1945=vc->eqExpr(id757,id289); +Expr id1944=vc->notExpr(id1945); +vc->registerAtom(id1945); +Expr id1947=vc->ltExpr(id249,id89); +Expr id1946=vc->notExpr(id1947); +vc->registerAtom(id1947); +Expr id1953=vc->plusExpr(id261,id453); +Expr id1955=vc->eqExpr(id1953,id283); +Expr id1954=vc->notExpr(id1955); +vc->registerAtom(id1955); +Expr id1959=vc->eqExpr(id259,id275); +Expr id1958=vc->notExpr(id1959); +vc->registerAtom(id1959); +Expr id1963=vc->plusExpr(id259,id453); +Expr id1965=vc->eqExpr(id1963,id281); +Expr id1964=vc->notExpr(id1965); +vc->registerAtom(id1965); +Expr id1969=vc->writeExpr(id255,id259,id249); +Expr id1971=vc->eqExpr(id1969,id277); +Expr id1970=vc->notExpr(id1971); +vc->registerAtom(id1971); +Expr id1977=vc->writeExpr(id263,id259,id253); +Expr id1979=vc->eqExpr(id1977,id285); +Expr id1978=vc->notExpr(id1979); +vc->registerAtom(id1979); +Expr id1985=vc->eqExpr(id453,id289); +Expr id1984=vc->notExpr(id1985); +vc->registerAtom(id1985); +Expr id1987=vc->eqExpr(id89,id249); +Expr id1986=vc->notExpr(id1987); +vc->registerAtom(id1987); +Expr id1995=vc->eqExpr(id253,id287); +Expr id1994=vc->notExpr(id1995); +vc->registerAtom(id1995); +Expr id1999=vc->eqExpr(id269,id275); +Expr id1998=vc->notExpr(id1999); +vc->registerAtom(id1999); +Expr id2017=vc->eqExpr(id787,id289); +Expr id2016=vc->notExpr(id2017); +vc->registerAtom(id2017); +Expr id2019=vc->eqExpr(id1065,id249); +Expr id2018=vc->notExpr(id2019); +vc->registerAtom(id2019); +Expr id2035=vc->writeExpr(id263,id265,id269); +Expr id2037=vc->eqExpr(id2035,id285); +Expr id2036=vc->notExpr(id2037); +vc->registerAtom(id2037); +Expr id2045=vc->eqExpr(id1093,id289); +Expr id2044=vc->notExpr(id2045); +vc->registerAtom(id2045); +Expr id2047=vc->eqExpr(id273,id249); +Expr id2046=vc->notExpr(id2047); +vc->registerAtom(id2047); +Expr id2063=vc->writeExpr(id263,id253,id265); +Expr id2065=vc->eqExpr(id2063,id285); +Expr id2064=vc->notExpr(id2065); +vc->registerAtom(id2065); +Expr id2073=vc->eqExpr(id1123,id289); +Expr id2072=vc->notExpr(id2073); +vc->registerAtom(id2073); +Expr id2075=vc->leExpr(id249,id273); +Expr id2074=vc->notExpr(id2075); +vc->registerAtom(id2075); +Expr id2095=vc->eqExpr(id249,id271); +Expr id2094=vc->notExpr(id2095); +vc->registerAtom(id2095); +Expr id2103=vc->eqExpr(id757,id267); +Expr id2102=vc->notExpr(id2103); +vc->registerAtom(id2103); +Expr id2105=vc->ltExpr(id227,id89); +Expr id2104=vc->notExpr(id2105); +vc->registerAtom(id2105); +Expr id2111=vc->plusExpr(id239,id453); +Expr id2113=vc->eqExpr(id2111,id261); +Expr id2112=vc->notExpr(id2113); +vc->registerAtom(id2113); +Expr id2117=vc->eqExpr(id237,id253); +Expr id2116=vc->notExpr(id2117); +vc->registerAtom(id2117); +Expr id2121=vc->plusExpr(id237,id453); +Expr id2123=vc->eqExpr(id2121,id259); +Expr id2122=vc->notExpr(id2123); +vc->registerAtom(id2123); +Expr id2127=vc->writeExpr(id233,id237,id227); +Expr id2129=vc->eqExpr(id2127,id255); +Expr id2128=vc->notExpr(id2129); +vc->registerAtom(id2129); +Expr id2135=vc->writeExpr(id241,id237,id231); +Expr id2137=vc->eqExpr(id2135,id263); +Expr id2136=vc->notExpr(id2137); +vc->registerAtom(id2137); +Expr id2143=vc->eqExpr(id453,id267); +Expr id2142=vc->notExpr(id2143); +vc->registerAtom(id2143); +Expr id2145=vc->eqExpr(id89,id227); +Expr id2144=vc->notExpr(id2145); +vc->registerAtom(id2145); +Expr id2153=vc->eqExpr(id231,id265); +Expr id2152=vc->notExpr(id2153); +vc->registerAtom(id2153); +Expr id2157=vc->eqExpr(id247,id253); +Expr id2156=vc->notExpr(id2157); +vc->registerAtom(id2157); +Expr id2175=vc->eqExpr(id787,id267); +Expr id2174=vc->notExpr(id2175); +vc->registerAtom(id2175); +Expr id2177=vc->eqExpr(id1065,id227); +Expr id2176=vc->notExpr(id2177); +vc->registerAtom(id2177); +Expr id2193=vc->writeExpr(id241,id243,id247); +Expr id2195=vc->eqExpr(id2193,id263); +Expr id2194=vc->notExpr(id2195); +vc->registerAtom(id2195); +Expr id2203=vc->eqExpr(id1093,id267); +Expr id2202=vc->notExpr(id2203); +vc->registerAtom(id2203); +Expr id2205=vc->eqExpr(id251,id227); +Expr id2204=vc->notExpr(id2205); +vc->registerAtom(id2205); +Expr id2221=vc->writeExpr(id241,id231,id243); +Expr id2223=vc->eqExpr(id2221,id263); +Expr id2222=vc->notExpr(id2223); +vc->registerAtom(id2223); +Expr id2231=vc->eqExpr(id1123,id267); +Expr id2230=vc->notExpr(id2231); +vc->registerAtom(id2231); +Expr id2233=vc->leExpr(id227,id251); +Expr id2232=vc->notExpr(id2233); +vc->registerAtom(id2233); +Expr id2253=vc->eqExpr(id227,id249); +Expr id2252=vc->notExpr(id2253); +vc->registerAtom(id2253); +Expr id2261=vc->eqExpr(id757,id245); +Expr id2260=vc->notExpr(id2261); +vc->registerAtom(id2261); +Expr id2263=vc->ltExpr(id205,id89); +Expr id2262=vc->notExpr(id2263); +vc->registerAtom(id2263); +Expr id2269=vc->plusExpr(id217,id453); +Expr id2271=vc->eqExpr(id2269,id239); +Expr id2270=vc->notExpr(id2271); +vc->registerAtom(id2271); +Expr id2275=vc->eqExpr(id215,id231); +Expr id2274=vc->notExpr(id2275); +vc->registerAtom(id2275); +Expr id2279=vc->plusExpr(id215,id453); +Expr id2281=vc->eqExpr(id2279,id237); +Expr id2280=vc->notExpr(id2281); +vc->registerAtom(id2281); +Expr id2285=vc->writeExpr(id211,id215,id205); +Expr id2287=vc->eqExpr(id2285,id233); +Expr id2286=vc->notExpr(id2287); +vc->registerAtom(id2287); +Expr id2293=vc->writeExpr(id219,id215,id209); +Expr id2295=vc->eqExpr(id2293,id241); +Expr id2294=vc->notExpr(id2295); +vc->registerAtom(id2295); +Expr id2301=vc->eqExpr(id453,id245); +Expr id2300=vc->notExpr(id2301); +vc->registerAtom(id2301); +Expr id2303=vc->eqExpr(id89,id205); +Expr id2302=vc->notExpr(id2303); +vc->registerAtom(id2303); +Expr id2311=vc->eqExpr(id209,id243); +Expr id2310=vc->notExpr(id2311); +vc->registerAtom(id2311); +Expr id2315=vc->eqExpr(id225,id231); +Expr id2314=vc->notExpr(id2315); +vc->registerAtom(id2315); +Expr id2333=vc->eqExpr(id787,id245); +Expr id2332=vc->notExpr(id2333); +vc->registerAtom(id2333); +Expr id2335=vc->eqExpr(id1065,id205); +Expr id2334=vc->notExpr(id2335); +vc->registerAtom(id2335); +Expr id2351=vc->writeExpr(id219,id221,id225); +Expr id2353=vc->eqExpr(id2351,id241); +Expr id2352=vc->notExpr(id2353); +vc->registerAtom(id2353); +Expr id2361=vc->eqExpr(id1093,id245); +Expr id2360=vc->notExpr(id2361); +vc->registerAtom(id2361); +Expr id2363=vc->eqExpr(id229,id205); +Expr id2362=vc->notExpr(id2363); +vc->registerAtom(id2363); +Expr id2379=vc->writeExpr(id219,id209,id221); +Expr id2381=vc->eqExpr(id2379,id241); +Expr id2380=vc->notExpr(id2381); +vc->registerAtom(id2381); +Expr id2389=vc->eqExpr(id1123,id245); +Expr id2388=vc->notExpr(id2389); +vc->registerAtom(id2389); +Expr id2391=vc->leExpr(id205,id229); +Expr id2390=vc->notExpr(id2391); +vc->registerAtom(id2391); +Expr id2411=vc->eqExpr(id205,id227); +Expr id2410=vc->notExpr(id2411); +vc->registerAtom(id2411); +Expr id2419=vc->eqExpr(id757,id223); +Expr id2418=vc->notExpr(id2419); +vc->registerAtom(id2419); +Expr id2421=vc->ltExpr(id183,id89); +Expr id2420=vc->notExpr(id2421); +vc->registerAtom(id2421); +Expr id2427=vc->plusExpr(id195,id453); +Expr id2429=vc->eqExpr(id2427,id217); +Expr id2428=vc->notExpr(id2429); +vc->registerAtom(id2429); +Expr id2433=vc->eqExpr(id193,id209); +Expr id2432=vc->notExpr(id2433); +vc->registerAtom(id2433); +Expr id2437=vc->plusExpr(id193,id453); +Expr id2439=vc->eqExpr(id2437,id215); +Expr id2438=vc->notExpr(id2439); +vc->registerAtom(id2439); +Expr id2443=vc->writeExpr(id189,id193,id183); +Expr id2445=vc->eqExpr(id2443,id211); +Expr id2444=vc->notExpr(id2445); +vc->registerAtom(id2445); +Expr id2451=vc->writeExpr(id197,id193,id187); +Expr id2453=vc->eqExpr(id2451,id219); +Expr id2452=vc->notExpr(id2453); +vc->registerAtom(id2453); +Expr id2459=vc->eqExpr(id453,id223); +Expr id2458=vc->notExpr(id2459); +vc->registerAtom(id2459); +Expr id2461=vc->eqExpr(id89,id183); +Expr id2460=vc->notExpr(id2461); +vc->registerAtom(id2461); +Expr id2469=vc->eqExpr(id187,id221); +Expr id2468=vc->notExpr(id2469); +vc->registerAtom(id2469); +Expr id2473=vc->eqExpr(id203,id209); +Expr id2472=vc->notExpr(id2473); +vc->registerAtom(id2473); +Expr id2491=vc->eqExpr(id787,id223); +Expr id2490=vc->notExpr(id2491); +vc->registerAtom(id2491); +Expr id2493=vc->eqExpr(id1065,id183); +Expr id2492=vc->notExpr(id2493); +vc->registerAtom(id2493); +Expr id2509=vc->writeExpr(id197,id199,id203); +Expr id2511=vc->eqExpr(id2509,id219); +Expr id2510=vc->notExpr(id2511); +vc->registerAtom(id2511); +Expr id2519=vc->eqExpr(id1093,id223); +Expr id2518=vc->notExpr(id2519); +vc->registerAtom(id2519); +Expr id2521=vc->eqExpr(id207,id183); +Expr id2520=vc->notExpr(id2521); +vc->registerAtom(id2521); +Expr id2537=vc->writeExpr(id197,id187,id199); +Expr id2539=vc->eqExpr(id2537,id219); +Expr id2538=vc->notExpr(id2539); +vc->registerAtom(id2539); +Expr id2547=vc->eqExpr(id1123,id223); +Expr id2546=vc->notExpr(id2547); +vc->registerAtom(id2547); +Expr id2549=vc->leExpr(id183,id207); +Expr id2548=vc->notExpr(id2549); +vc->registerAtom(id2549); +Expr id2569=vc->eqExpr(id183,id205); +Expr id2568=vc->notExpr(id2569); +vc->registerAtom(id2569); +Expr id2577=vc->eqExpr(id757,id201); +Expr id2576=vc->notExpr(id2577); +vc->registerAtom(id2577); +Expr id2579=vc->ltExpr(id161,id89); +Expr id2578=vc->notExpr(id2579); +vc->registerAtom(id2579); +Expr id2585=vc->plusExpr(id173,id453); +Expr id2587=vc->eqExpr(id2585,id195); +Expr id2586=vc->notExpr(id2587); +vc->registerAtom(id2587); +Expr id2591=vc->eqExpr(id171,id187); +Expr id2590=vc->notExpr(id2591); +vc->registerAtom(id2591); +Expr id2595=vc->plusExpr(id171,id453); +Expr id2597=vc->eqExpr(id2595,id193); +Expr id2596=vc->notExpr(id2597); +vc->registerAtom(id2597); +Expr id2601=vc->writeExpr(id167,id171,id161); +Expr id2603=vc->eqExpr(id2601,id189); +Expr id2602=vc->notExpr(id2603); +vc->registerAtom(id2603); +Expr id2609=vc->writeExpr(id175,id171,id165); +Expr id2611=vc->eqExpr(id2609,id197); +Expr id2610=vc->notExpr(id2611); +vc->registerAtom(id2611); +Expr id2617=vc->eqExpr(id453,id201); +Expr id2616=vc->notExpr(id2617); +vc->registerAtom(id2617); +Expr id2619=vc->eqExpr(id89,id161); +Expr id2618=vc->notExpr(id2619); +vc->registerAtom(id2619); +Expr id2627=vc->eqExpr(id165,id199); +Expr id2626=vc->notExpr(id2627); +vc->registerAtom(id2627); +Expr id2631=vc->eqExpr(id181,id187); +Expr id2630=vc->notExpr(id2631); +vc->registerAtom(id2631); +Expr id2649=vc->eqExpr(id787,id201); +Expr id2648=vc->notExpr(id2649); +vc->registerAtom(id2649); +Expr id2651=vc->eqExpr(id1065,id161); +Expr id2650=vc->notExpr(id2651); +vc->registerAtom(id2651); +Expr id2667=vc->writeExpr(id175,id177,id181); +Expr id2669=vc->eqExpr(id2667,id197); +Expr id2668=vc->notExpr(id2669); +vc->registerAtom(id2669); +Expr id2677=vc->eqExpr(id1093,id201); +Expr id2676=vc->notExpr(id2677); +vc->registerAtom(id2677); +Expr id2679=vc->eqExpr(id185,id161); +Expr id2678=vc->notExpr(id2679); +vc->registerAtom(id2679); +Expr id2695=vc->writeExpr(id175,id165,id177); +Expr id2697=vc->eqExpr(id2695,id197); +Expr id2696=vc->notExpr(id2697); +vc->registerAtom(id2697); +Expr id2705=vc->eqExpr(id1123,id201); +Expr id2704=vc->notExpr(id2705); +vc->registerAtom(id2705); +Expr id2707=vc->leExpr(id161,id185); +Expr id2706=vc->notExpr(id2707); +vc->registerAtom(id2707); +Expr id2727=vc->eqExpr(id161,id183); +Expr id2726=vc->notExpr(id2727); +vc->registerAtom(id2727); +Expr id2735=vc->eqExpr(id757,id179); +Expr id2734=vc->notExpr(id2735); +vc->registerAtom(id2735); +Expr id2737=vc->ltExpr(id139,id89); +Expr id2736=vc->notExpr(id2737); +vc->registerAtom(id2737); +Expr id2743=vc->plusExpr(id151,id453); +Expr id2745=vc->eqExpr(id2743,id173); +Expr id2744=vc->notExpr(id2745); +vc->registerAtom(id2745); +Expr id2749=vc->eqExpr(id149,id165); +Expr id2748=vc->notExpr(id2749); +vc->registerAtom(id2749); +Expr id2753=vc->plusExpr(id149,id453); +Expr id2755=vc->eqExpr(id2753,id171); +Expr id2754=vc->notExpr(id2755); +vc->registerAtom(id2755); +Expr id2759=vc->writeExpr(id145,id149,id139); +Expr id2761=vc->eqExpr(id2759,id167); +Expr id2760=vc->notExpr(id2761); +vc->registerAtom(id2761); +Expr id2767=vc->writeExpr(id153,id149,id143); +Expr id2769=vc->eqExpr(id2767,id175); +Expr id2768=vc->notExpr(id2769); +vc->registerAtom(id2769); +Expr id2775=vc->eqExpr(id453,id179); +Expr id2774=vc->notExpr(id2775); +vc->registerAtom(id2775); +Expr id2777=vc->eqExpr(id89,id139); +Expr id2776=vc->notExpr(id2777); +vc->registerAtom(id2777); +Expr id2785=vc->eqExpr(id143,id177); +Expr id2784=vc->notExpr(id2785); +vc->registerAtom(id2785); +Expr id2789=vc->eqExpr(id159,id165); +Expr id2788=vc->notExpr(id2789); +vc->registerAtom(id2789); +Expr id2807=vc->eqExpr(id787,id179); +Expr id2806=vc->notExpr(id2807); +vc->registerAtom(id2807); +Expr id2809=vc->eqExpr(id1065,id139); +Expr id2808=vc->notExpr(id2809); +vc->registerAtom(id2809); +Expr id2825=vc->writeExpr(id153,id155,id159); +Expr id2827=vc->eqExpr(id2825,id175); +Expr id2826=vc->notExpr(id2827); +vc->registerAtom(id2827); +Expr id2835=vc->eqExpr(id1093,id179); +Expr id2834=vc->notExpr(id2835); +vc->registerAtom(id2835); +Expr id2837=vc->eqExpr(id163,id139); +Expr id2836=vc->notExpr(id2837); +vc->registerAtom(id2837); +Expr id2853=vc->writeExpr(id153,id143,id155); +Expr id2855=vc->eqExpr(id2853,id175); +Expr id2854=vc->notExpr(id2855); +vc->registerAtom(id2855); +Expr id2863=vc->eqExpr(id1123,id179); +Expr id2862=vc->notExpr(id2863); +vc->registerAtom(id2863); +Expr id2865=vc->leExpr(id139,id163); +Expr id2864=vc->notExpr(id2865); +vc->registerAtom(id2865); +Expr id2885=vc->eqExpr(id139,id161); +Expr id2884=vc->notExpr(id2885); +vc->registerAtom(id2885); +Expr id2893=vc->eqExpr(id757,id157); +Expr id2892=vc->notExpr(id2893); +vc->registerAtom(id2893); +Expr id2895=vc->ltExpr(id117,id89); +Expr id2894=vc->notExpr(id2895); +vc->registerAtom(id2895); +Expr id2901=vc->plusExpr(id129,id453); +Expr id2903=vc->eqExpr(id2901,id151); +Expr id2902=vc->notExpr(id2903); +vc->registerAtom(id2903); +Expr id2907=vc->eqExpr(id127,id143); +Expr id2906=vc->notExpr(id2907); +vc->registerAtom(id2907); +Expr id2911=vc->plusExpr(id127,id453); +Expr id2913=vc->eqExpr(id2911,id149); +Expr id2912=vc->notExpr(id2913); +vc->registerAtom(id2913); +Expr id2917=vc->writeExpr(id123,id127,id117); +Expr id2919=vc->eqExpr(id2917,id145); +Expr id2918=vc->notExpr(id2919); +vc->registerAtom(id2919); +Expr id2925=vc->writeExpr(id131,id127,id121); +Expr id2927=vc->eqExpr(id2925,id153); +Expr id2926=vc->notExpr(id2927); +vc->registerAtom(id2927); +Expr id2933=vc->eqExpr(id453,id157); +Expr id2932=vc->notExpr(id2933); +vc->registerAtom(id2933); +Expr id2935=vc->eqExpr(id89,id117); +Expr id2934=vc->notExpr(id2935); +vc->registerAtom(id2935); +Expr id2943=vc->eqExpr(id121,id155); +Expr id2942=vc->notExpr(id2943); +vc->registerAtom(id2943); +Expr id2947=vc->eqExpr(id137,id143); +Expr id2946=vc->notExpr(id2947); +vc->registerAtom(id2947); +Expr id2965=vc->eqExpr(id787,id157); +Expr id2964=vc->notExpr(id2965); +vc->registerAtom(id2965); +Expr id2967=vc->eqExpr(id1065,id117); +Expr id2966=vc->notExpr(id2967); +vc->registerAtom(id2967); +Expr id2983=vc->writeExpr(id131,id133,id137); +Expr id2985=vc->eqExpr(id2983,id153); +Expr id2984=vc->notExpr(id2985); +vc->registerAtom(id2985); +Expr id2993=vc->eqExpr(id1093,id157); +Expr id2992=vc->notExpr(id2993); +vc->registerAtom(id2993); +Expr id2995=vc->eqExpr(id141,id117); +Expr id2994=vc->notExpr(id2995); +vc->registerAtom(id2995); +Expr id3011=vc->writeExpr(id131,id121,id133); +Expr id3013=vc->eqExpr(id3011,id153); +Expr id3012=vc->notExpr(id3013); +vc->registerAtom(id3013); +Expr id3021=vc->eqExpr(id1123,id157); +Expr id3020=vc->notExpr(id3021); +vc->registerAtom(id3021); +Expr id3023=vc->leExpr(id117,id141); +Expr id3022=vc->notExpr(id3023); +vc->registerAtom(id3023); +Expr id3043=vc->eqExpr(id117,id139); +Expr id3042=vc->notExpr(id3043); +vc->registerAtom(id3043); +Expr id3051=vc->eqExpr(id757,id135); +Expr id3050=vc->notExpr(id3051); +vc->registerAtom(id3051); +Expr id3053=vc->ltExpr(id87,id89); +Expr id3052=vc->notExpr(id3053); +vc->registerAtom(id3053); +Expr id3059=vc->plusExpr(id105,id453); +Expr id3061=vc->eqExpr(id3059,id129); +Expr id3060=vc->notExpr(id3061); +vc->registerAtom(id3061); +Expr id3065=vc->eqExpr(id103,id121); +Expr id3064=vc->notExpr(id3065); +vc->registerAtom(id3065); +Expr id3069=vc->plusExpr(id103,id453); +Expr id3071=vc->eqExpr(id3069,id127); +Expr id3070=vc->notExpr(id3071); +vc->registerAtom(id3071); +Expr id3075=vc->writeExpr(id95,id103,id87); +Expr id3077=vc->eqExpr(id3075,id123); +Expr id3076=vc->notExpr(id3077); +vc->registerAtom(id3077); +Expr id3083=vc->writeExpr(id107,id103,id93); +Expr id3085=vc->eqExpr(id3083,id131); +Expr id3084=vc->notExpr(id3085); +vc->registerAtom(id3085); +Expr id3091=vc->eqExpr(id453,id135); +Expr id3090=vc->notExpr(id3091); +vc->registerAtom(id3091); +Expr id3093=vc->eqExpr(id89,id87); +Expr id3092=vc->notExpr(id3093); +vc->registerAtom(id3093); +Expr id3101=vc->eqExpr(id93,id133); +Expr id3100=vc->notExpr(id3101); +vc->registerAtom(id3101); +Expr id3105=vc->eqExpr(id115,id121); +Expr id3104=vc->notExpr(id3105); +vc->registerAtom(id3105); +Expr id3123=vc->eqExpr(id787,id135); +Expr id3122=vc->notExpr(id3123); +vc->registerAtom(id3123); +Expr id3125=vc->eqExpr(id1065,id87); +Expr id3124=vc->notExpr(id3125); +vc->registerAtom(id3125); +Expr id3141=vc->writeExpr(id107,id109,id115); +Expr id3143=vc->eqExpr(id3141,id131); +Expr id3142=vc->notExpr(id3143); +vc->registerAtom(id3143); +Expr id3151=vc->eqExpr(id1093,id135); +Expr id3150=vc->notExpr(id3151); +vc->registerAtom(id3151); +Expr id3153=vc->eqExpr(id119,id87); +Expr id3152=vc->notExpr(id3153); +vc->registerAtom(id3153); +Expr id3169=vc->writeExpr(id107,id93,id109); +Expr id3171=vc->eqExpr(id3169,id131); +Expr id3170=vc->notExpr(id3171); +vc->registerAtom(id3171); +Expr id3179=vc->eqExpr(id1123,id135); +Expr id3178=vc->notExpr(id3179); +vc->registerAtom(id3179); +Expr id3181=vc->leExpr(id87,id119); +Expr id3180=vc->notExpr(id3181); +vc->registerAtom(id3181); +Expr id3201=vc->eqExpr(id87,id117); +Expr id3200=vc->notExpr(id3201); +vc->registerAtom(id3201); +Expr id3209=vc->eqExpr(id757,id113); +Expr id3208=vc->notExpr(id3209); +vc->registerAtom(id3209); +Expr id3211=vc->ltExpr(id75,id89); +Expr id3210=vc->notExpr(id3211); +vc->registerAtom(id3211); +Expr id3217=vc->plusExpr(id81,id453); +Expr id3219=vc->eqExpr(id3217,id105); +Expr id3218=vc->notExpr(id3219); +vc->registerAtom(id3219); +Expr id3223=vc->eqExpr(id77,id93); +Expr id3222=vc->notExpr(id3223); +vc->registerAtom(id3223); +Expr id3227=vc->plusExpr(id77,id453); +Expr id3229=vc->eqExpr(id3227,id103); +Expr id3228=vc->notExpr(id3229); +vc->registerAtom(id3229); +Expr id3233=vc->writeExpr(id97,id77,id75); +Expr id3235=vc->eqExpr(id3233,id95); +Expr id3234=vc->notExpr(id3235); +vc->registerAtom(id3235); +Expr id3241=vc->writeExpr(id83,id77,id79); +Expr id3243=vc->eqExpr(id3241,id107); +Expr id3242=vc->notExpr(id3243); +vc->registerAtom(id3243); +Expr id3249=vc->eqExpr(id453,id113); +Expr id3248=vc->notExpr(id3249); +vc->registerAtom(id3249); +Expr id3251=vc->eqExpr(id89,id75); +Expr id3250=vc->notExpr(id3251); +vc->registerAtom(id3251); +Expr id3259=vc->eqExpr(id79,id109); +Expr id3258=vc->notExpr(id3259); +vc->registerAtom(id3259); +Expr id3263=vc->eqExpr(id85,id93); +Expr id3262=vc->notExpr(id3263); +vc->registerAtom(id3263); +Expr id3281=vc->eqExpr(id787,id113); +Expr id3280=vc->notExpr(id3281); +vc->registerAtom(id3281); +Expr id3283=vc->eqExpr(id1065,id75); +Expr id3282=vc->notExpr(id3283); +vc->registerAtom(id3283); +Expr id3299=vc->writeExpr(id83,id111,id85); +Expr id3301=vc->eqExpr(id3299,id107); +Expr id3300=vc->notExpr(id3301); +vc->registerAtom(id3301); +Expr id3309=vc->eqExpr(id1093,id113); +Expr id3308=vc->notExpr(id3309); +vc->registerAtom(id3309); +Expr id3311=vc->eqExpr(id91,id75); +Expr id3310=vc->notExpr(id3311); +vc->registerAtom(id3311); +Expr id3327=vc->writeExpr(id83,id79,id111); +Expr id3329=vc->eqExpr(id3327,id107); +Expr id3328=vc->notExpr(id3329); +vc->registerAtom(id3329); +Expr id3337=vc->eqExpr(id1123,id113); +Expr id3336=vc->notExpr(id3337); +vc->registerAtom(id3337); +Expr id3339=vc->leExpr(id75,id91); +Expr id3338=vc->notExpr(id3339); +vc->registerAtom(id3339); +Expr id3359=vc->eqExpr(id75,id87); +Expr id3358=vc->notExpr(id3359); +vc->registerAtom(id3359); +Expr id3367=vc->leExpr(id403,id757); +Expr id3366=vc->notExpr(id3367); +vc->registerAtom(id3367); +Expr id3371=vc->eqExpr(id725,id407); +Expr id3370=vc->notExpr(id3371); +vc->registerAtom(id3371); +Expr id3375=vc->leExpr(id381,id757); +Expr id3374=vc->notExpr(id3375); +vc->registerAtom(id3375); +Expr id3383=vc->leExpr(id359,id757); +Expr id3382=vc->notExpr(id3383); +vc->registerAtom(id3383); +Expr id3391=vc->leExpr(id337,id757); +Expr id3390=vc->notExpr(id3391); +vc->registerAtom(id3391); +Expr id3399=vc->leExpr(id315,id757); +Expr id3398=vc->notExpr(id3399); +vc->registerAtom(id3399); +Expr id3407=vc->leExpr(id293,id757); +Expr id3406=vc->notExpr(id3407); +vc->registerAtom(id3407); +Expr id3415=vc->leExpr(id271,id757); +Expr id3414=vc->notExpr(id3415); +vc->registerAtom(id3415); +Expr id3423=vc->leExpr(id249,id757); +Expr id3422=vc->notExpr(id3423); +vc->registerAtom(id3423); +Expr id3431=vc->leExpr(id227,id757); +Expr id3430=vc->notExpr(id3431); +vc->registerAtom(id3431); +Expr id3439=vc->leExpr(id205,id757); +Expr id3438=vc->notExpr(id3439); +vc->registerAtom(id3439); +Expr id3447=vc->leExpr(id183,id757); +Expr id3446=vc->notExpr(id3447); +vc->registerAtom(id3447); +Expr id3455=vc->leExpr(id161,id757); +Expr id3454=vc->notExpr(id3455); +vc->registerAtom(id3455); +Expr id3463=vc->leExpr(id139,id757); +Expr id3462=vc->notExpr(id3463); +vc->registerAtom(id3463); +Expr id3471=vc->leExpr(id117,id757); +Expr id3470=vc->notExpr(id3471); +vc->registerAtom(id3471); +Expr id3479=vc->leExpr(id87,id757); +Expr id3478=vc->notExpr(id3479); +vc->registerAtom(id3479); +Expr id3487=vc->leExpr(id75,id757); +Expr id3486=vc->notExpr(id3487); +vc->registerAtom(id3487); +vc->push(); +vc->query(id12); +vc->inconsistent(inconsistency); +vc->pop(); +vc->push(); +vc->query(id986); +vc->popto(1); +vc->push(); +vc->query(id987); +vc->popto(1); +vc->push(); +vc->assertFormula(id987); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id982); +vc->popto(2); +vc->push(); +vc->query(id983); +vc->popto(2); +vc->push(); +vc->assertFormula(id983); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id978); +vc->popto(3); +vc->push(); +vc->query(id979); +vc->popto(3); +vc->push(); +vc->assertFormula(id979); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id972); +vc->popto(4); +vc->push(); +vc->query(id973); +vc->popto(4); +vc->push(); +vc->assertFormula(id973); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id968); +vc->popto(5); +vc->push(); +vc->query(id969); +vc->popto(5); +vc->push(); +vc->assertFormula(id969); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id964); +vc->popto(6); +vc->push(); +vc->query(id965); +vc->popto(6); +vc->push(); +vc->assertFormula(id965); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id958); +vc->popto(7); +vc->push(); +vc->query(id959); +vc->popto(7); +vc->push(); +vc->assertFormula(id959); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id954); +vc->popto(8); +vc->push(); +vc->query(id955); +vc->popto(8); +vc->push(); +vc->assertFormula(id955); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id950); +vc->popto(9); +vc->push(); +vc->query(id951); +vc->popto(9); +vc->push(); +vc->assertFormula(id951); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id944); +vc->popto(10); +vc->push(); +vc->query(id945); +vc->popto(10); +vc->push(); +vc->assertFormula(id945); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id940); +vc->popto(11); +vc->push(); +vc->query(id941); +vc->popto(11); +vc->push(); +vc->assertFormula(id941); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id936); +vc->popto(12); +vc->push(); +vc->query(id937); +vc->popto(12); +vc->push(); +vc->assertFormula(id937); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id930); +vc->popto(13); +vc->push(); +vc->query(id931); +vc->popto(13); +vc->push(); +vc->assertFormula(id931); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id926); +vc->popto(14); +vc->push(); +vc->query(id927); +vc->popto(14); +vc->push(); +vc->assertFormula(id927); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id922); +vc->popto(15); +vc->push(); +vc->query(id923); +vc->popto(15); +vc->push(); +vc->assertFormula(id923); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id916); +vc->popto(16); +vc->push(); +vc->query(id917); +vc->popto(16); +vc->push(); +vc->assertFormula(id917); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id912); +vc->popto(17); +vc->push(); +vc->query(id913); +vc->popto(17); +vc->push(); +vc->assertFormula(id913); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id908); +vc->popto(18); +vc->push(); +vc->query(id909); +vc->popto(18); +vc->push(); +vc->assertFormula(id909); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id902); +vc->popto(19); +vc->push(); +vc->query(id903); +vc->popto(19); +vc->push(); +vc->assertFormula(id903); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id898); +vc->popto(20); +vc->push(); +vc->query(id899); +vc->popto(20); +vc->push(); +vc->assertFormula(id899); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id894); +vc->popto(21); +vc->push(); +vc->query(id895); +vc->popto(21); +vc->push(); +vc->assertFormula(id895); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id888); +vc->popto(22); +vc->push(); +vc->query(id889); +vc->popto(22); +vc->push(); +vc->assertFormula(id889); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id884); +vc->popto(23); +vc->push(); +vc->query(id885); +vc->popto(23); +vc->push(); +vc->assertFormula(id885); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id880); +vc->popto(24); +vc->push(); +vc->query(id881); +vc->popto(24); +vc->push(); +vc->assertFormula(id881); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id874); +vc->popto(25); +vc->push(); +vc->query(id875); +vc->popto(25); +vc->push(); +vc->assertFormula(id875); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id870); +vc->popto(26); +vc->push(); +vc->query(id871); +vc->popto(26); +vc->push(); +vc->assertFormula(id871); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id866); +vc->popto(27); +vc->push(); +vc->query(id867); +vc->popto(27); +vc->push(); +vc->assertFormula(id867); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id860); +vc->popto(28); +vc->push(); +vc->query(id861); +vc->popto(28); +vc->push(); +vc->assertFormula(id861); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id856); +vc->popto(29); +vc->push(); +vc->query(id857); +vc->popto(29); +vc->push(); +vc->assertFormula(id857); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id852); +vc->popto(30); +vc->push(); +vc->query(id853); +vc->popto(30); +vc->push(); +vc->assertFormula(id853); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id846); +vc->popto(31); +vc->push(); +vc->query(id847); +vc->popto(31); +vc->push(); +vc->assertFormula(id847); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id842); +vc->popto(32); +vc->push(); +vc->query(id843); +vc->popto(32); +vc->push(); +vc->assertFormula(id843); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id838); +vc->popto(33); +vc->push(); +vc->query(id839); +vc->popto(33); +vc->push(); +vc->assertFormula(id839); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id832); +vc->popto(34); +vc->push(); +vc->query(id833); +vc->popto(34); +vc->push(); +vc->assertFormula(id833); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id828); +vc->popto(35); +vc->push(); +vc->query(id829); +vc->popto(35); +vc->push(); +vc->assertFormula(id829); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id824); +vc->popto(36); +vc->push(); +vc->query(id825); +vc->popto(36); +vc->push(); +vc->assertFormula(id825); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id818); +vc->popto(37); +vc->push(); +vc->query(id819); +vc->popto(37); +vc->push(); +vc->assertFormula(id819); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id814); +vc->popto(38); +vc->push(); +vc->query(id815); +vc->popto(38); +vc->push(); +vc->assertFormula(id815); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id810); +vc->popto(39); +vc->push(); +vc->query(id811); +vc->popto(39); +vc->push(); +vc->assertFormula(id811); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id804); +vc->popto(40); +vc->push(); +vc->query(id805); +vc->popto(40); +vc->push(); +vc->assertFormula(id805); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id800); +vc->popto(41); +vc->push(); +vc->query(id801); +vc->popto(41); +vc->push(); +vc->assertFormula(id801); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id796); +vc->popto(42); +vc->push(); +vc->query(id797); +vc->popto(42); +vc->push(); +vc->assertFormula(id797); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id790); +vc->popto(43); +vc->push(); +vc->query(id791); +vc->popto(43); +vc->push(); +vc->assertFormula(id791); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id782); +vc->popto(44); +vc->push(); +vc->query(id783); +vc->popto(44); +vc->push(); +vc->assertFormula(id783); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id778); +vc->popto(45); +vc->push(); +vc->query(id779); +vc->popto(45); +vc->push(); +vc->assertFormula(id779); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id772); +vc->popto(46); +vc->push(); +vc->query(id773); +vc->popto(46); +vc->push(); +vc->assertFormula(id773); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id726); +vc->popto(47); +vc->push(); +vc->query(id727); +vc->popto(47); +vc->push(); +vc->assertFormula(id727); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id766); +vc->popto(48); +vc->push(); +vc->query(id767); +vc->popto(48); +vc->push(); +vc->assertFormula(id767); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id762); +vc->popto(49); +vc->push(); +vc->query(id763); +vc->popto(49); +vc->push(); +vc->assertFormula(id763); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id759); +vc->popto(50); +vc->push(); +vc->query(id758); +vc->popto(50); +vc->push(); +vc->assertFormula(id758); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3486); +vc->popto(51); +vc->push(); +vc->query(id3487); +vc->popto(51); +vc->push(); +vc->query(id3210); +vc->popto(51); +vc->push(); +vc->query(id3211); +vc->popto(51); +vc->push(); +vc->query(id463); +vc->popto(51); +vc->push(); +vc->query(id462); +vc->popto(51); +vc->push(); +vc->query(id462); +vc->popto(51); +vc->push(); +vc->query(id463); +vc->popto(51); +vc->push(); +vc->assertFormula(id463); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id481); +vc->popto(52); +vc->push(); +vc->query(id480); +vc->popto(52); +vc->push(); +vc->query(id480); +vc->popto(52); +vc->push(); +vc->query(id481); +vc->popto(52); +vc->push(); +vc->assertFormula(id481); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id499); +vc->popto(53); +vc->push(); +vc->query(id498); +vc->popto(53); +vc->push(); +vc->query(id498); +vc->popto(53); +vc->push(); +vc->query(id499); +vc->popto(53); +vc->push(); +vc->assertFormula(id499); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id517); +vc->popto(54); +vc->push(); +vc->query(id516); +vc->popto(54); +vc->push(); +vc->query(id516); +vc->popto(54); +vc->push(); +vc->query(id517); +vc->popto(54); +vc->push(); +vc->assertFormula(id517); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id535); +vc->popto(55); +vc->push(); +vc->query(id534); +vc->popto(55); +vc->push(); +vc->query(id534); +vc->popto(55); +vc->push(); +vc->query(id535); +vc->popto(55); +vc->push(); +vc->assertFormula(id535); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id553); +vc->popto(56); +vc->push(); +vc->query(id552); +vc->popto(56); +vc->push(); +vc->query(id552); +vc->popto(56); +vc->push(); +vc->query(id553); +vc->popto(56); +vc->push(); +vc->assertFormula(id553); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id571); +vc->popto(57); +vc->push(); +vc->query(id570); +vc->popto(57); +vc->push(); +vc->query(id570); +vc->popto(57); +vc->push(); +vc->query(id571); +vc->popto(57); +vc->push(); +vc->assertFormula(id571); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id589); +vc->popto(58); +vc->push(); +vc->query(id588); +vc->popto(58); +vc->push(); +vc->query(id588); +vc->popto(58); +vc->push(); +vc->query(id589); +vc->popto(58); +vc->push(); +vc->assertFormula(id589); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id607); +vc->popto(59); +vc->push(); +vc->query(id606); +vc->popto(59); +vc->push(); +vc->query(id606); +vc->popto(59); +vc->push(); +vc->query(id607); +vc->popto(59); +vc->push(); +vc->assertFormula(id607); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id625); +vc->popto(60); +vc->push(); +vc->query(id624); +vc->popto(60); +vc->push(); +vc->query(id624); +vc->popto(60); +vc->push(); +vc->query(id625); +vc->popto(60); +vc->push(); +vc->assertFormula(id625); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id643); +vc->popto(61); +vc->push(); +vc->query(id642); +vc->popto(61); +vc->push(); +vc->query(id642); +vc->popto(61); +vc->push(); +vc->query(id643); +vc->popto(61); +vc->push(); +vc->assertFormula(id643); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id661); +vc->popto(62); +vc->push(); +vc->query(id660); +vc->popto(62); +vc->push(); +vc->query(id660); +vc->popto(62); +vc->push(); +vc->query(id661); +vc->popto(62); +vc->push(); +vc->assertFormula(id661); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id679); +vc->popto(63); +vc->push(); +vc->query(id678); +vc->popto(63); +vc->push(); +vc->query(id678); +vc->popto(63); +vc->push(); +vc->query(id679); +vc->popto(63); +vc->push(); +vc->assertFormula(id679); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id697); +vc->popto(64); +vc->push(); +vc->query(id696); +vc->popto(64); +vc->push(); +vc->query(id696); +vc->popto(64); +vc->push(); +vc->query(id697); +vc->popto(64); +vc->push(); +vc->assertFormula(id697); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id715); +vc->popto(65); +vc->push(); +vc->query(id714); +vc->popto(65); +vc->push(); +vc->query(id714); +vc->popto(65); +vc->push(); +vc->query(id715); +vc->popto(65); +vc->push(); +vc->assertFormula(id715); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id471); +vc->popto(66); +vc->push(); +vc->query(id470); +vc->popto(66); +vc->push(); +vc->query(id470); +vc->popto(66); +vc->push(); +vc->query(id471); +vc->popto(66); +vc->push(); +vc->assertFormula(id471); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id489); +vc->popto(67); +vc->push(); +vc->query(id488); +vc->popto(67); +vc->push(); +vc->query(id488); +vc->popto(67); +vc->push(); +vc->query(id489); +vc->popto(67); +vc->push(); +vc->assertFormula(id489); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id467); +vc->popto(68); +vc->push(); +vc->query(id466); +vc->popto(68); +vc->push(); +vc->query(id466); +vc->popto(68); +vc->push(); +vc->query(id467); +vc->popto(68); +vc->push(); +vc->assertFormula(id467); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3219); +vc->popto(69); +vc->push(); +vc->query(id3218); +vc->popto(69); +vc->push(); +vc->query(id507); +vc->popto(69); +vc->push(); +vc->query(id506); +vc->popto(69); +vc->push(); +vc->query(id506); +vc->popto(69); +vc->push(); +vc->query(id507); +vc->popto(69); +vc->push(); +vc->assertFormula(id507); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id485); +vc->popto(70); +vc->push(); +vc->query(id484); +vc->popto(70); +vc->push(); +vc->query(id484); +vc->popto(70); +vc->push(); +vc->query(id485); +vc->popto(70); +vc->push(); +vc->assertFormula(id485); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3061); +vc->popto(71); +vc->push(); +vc->query(id3060); +vc->popto(71); +vc->push(); +vc->query(id465); +vc->popto(71); +vc->push(); +vc->query(id464); +vc->popto(71); +vc->push(); +vc->query(id464); +vc->popto(71); +vc->push(); +vc->query(id465); +vc->popto(71); +vc->push(); +vc->assertFormula(id465); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3229); +vc->popto(72); +vc->push(); +vc->query(id3228); +vc->popto(72); +vc->push(); +vc->query(id525); +vc->popto(72); +vc->push(); +vc->query(id524); +vc->popto(72); +vc->push(); +vc->query(id524); +vc->popto(72); +vc->push(); +vc->query(id525); +vc->popto(72); +vc->push(); +vc->assertFormula(id525); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id503); +vc->popto(73); +vc->push(); +vc->query(id502); +vc->popto(73); +vc->push(); +vc->query(id502); +vc->popto(73); +vc->push(); +vc->query(id503); +vc->popto(73); +vc->push(); +vc->assertFormula(id503); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2903); +vc->popto(74); +vc->push(); +vc->query(id2902); +vc->popto(74); +vc->push(); +vc->query(id483); +vc->popto(74); +vc->push(); +vc->query(id482); +vc->popto(74); +vc->push(); +vc->query(id482); +vc->popto(74); +vc->push(); +vc->query(id483); +vc->popto(74); +vc->push(); +vc->assertFormula(id483); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3071); +vc->popto(75); +vc->push(); +vc->query(id3070); +vc->popto(75); +vc->push(); +vc->query(id543); +vc->popto(75); +vc->push(); +vc->query(id542); +vc->popto(75); +vc->push(); +vc->query(id542); +vc->popto(75); +vc->push(); +vc->query(id543); +vc->popto(75); +vc->push(); +vc->assertFormula(id543); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id521); +vc->popto(76); +vc->push(); +vc->query(id520); +vc->popto(76); +vc->push(); +vc->query(id520); +vc->popto(76); +vc->push(); +vc->query(id521); +vc->popto(76); +vc->push(); +vc->assertFormula(id521); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2745); +vc->popto(77); +vc->push(); +vc->query(id2744); +vc->popto(77); +vc->push(); +vc->query(id501); +vc->popto(77); +vc->push(); +vc->query(id500); +vc->popto(77); +vc->push(); +vc->query(id500); +vc->popto(77); +vc->push(); +vc->query(id501); +vc->popto(77); +vc->push(); +vc->assertFormula(id501); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2913); +vc->popto(78); +vc->push(); +vc->query(id2912); +vc->popto(78); +vc->push(); +vc->query(id461); +vc->popto(78); +vc->push(); +vc->query(id460); +vc->popto(78); +vc->push(); +vc->query(id460); +vc->popto(78); +vc->push(); +vc->query(id461); +vc->popto(78); +vc->push(); +vc->assertFormula(id461); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id561); +vc->popto(79); +vc->push(); +vc->query(id560); +vc->popto(79); +vc->push(); +vc->query(id560); +vc->popto(79); +vc->push(); +vc->query(id561); +vc->popto(79); +vc->push(); +vc->assertFormula(id561); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id539); +vc->popto(80); +vc->push(); +vc->query(id538); +vc->popto(80); +vc->push(); +vc->query(id538); +vc->popto(80); +vc->push(); +vc->query(id539); +vc->popto(80); +vc->push(); +vc->assertFormula(id539); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2587); +vc->popto(81); +vc->push(); +vc->query(id2586); +vc->popto(81); +vc->push(); +vc->query(id519); +vc->popto(81); +vc->push(); +vc->query(id518); +vc->popto(81); +vc->push(); +vc->query(id518); +vc->popto(81); +vc->push(); +vc->query(id519); +vc->popto(81); +vc->push(); +vc->assertFormula(id519); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2755); +vc->popto(82); +vc->push(); +vc->query(id2754); +vc->popto(82); +vc->push(); +vc->query(id479); +vc->popto(82); +vc->push(); +vc->query(id478); +vc->popto(82); +vc->push(); +vc->query(id478); +vc->popto(82); +vc->push(); +vc->query(id479); +vc->popto(82); +vc->push(); +vc->assertFormula(id479); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id579); +vc->popto(83); +vc->push(); +vc->query(id578); +vc->popto(83); +vc->push(); +vc->query(id578); +vc->popto(83); +vc->push(); +vc->query(id579); +vc->popto(83); +vc->push(); +vc->assertFormula(id579); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id557); +vc->popto(84); +vc->push(); +vc->query(id556); +vc->popto(84); +vc->push(); +vc->query(id556); +vc->popto(84); +vc->push(); +vc->query(id557); +vc->popto(84); +vc->push(); +vc->assertFormula(id557); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2429); +vc->popto(85); +vc->push(); +vc->query(id2428); +vc->popto(85); +vc->push(); +vc->query(id537); +vc->popto(85); +vc->push(); +vc->query(id536); +vc->popto(85); +vc->push(); +vc->query(id536); +vc->popto(85); +vc->push(); +vc->query(id537); +vc->popto(85); +vc->push(); +vc->assertFormula(id537); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2597); +vc->popto(86); +vc->push(); +vc->query(id2596); +vc->popto(86); +vc->push(); +vc->query(id497); +vc->popto(86); +vc->push(); +vc->query(id496); +vc->popto(86); +vc->push(); +vc->query(id496); +vc->popto(86); +vc->push(); +vc->query(id497); +vc->popto(86); +vc->push(); +vc->assertFormula(id497); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id597); +vc->popto(87); +vc->push(); +vc->query(id596); +vc->popto(87); +vc->push(); +vc->query(id596); +vc->popto(87); +vc->push(); +vc->query(id597); +vc->popto(87); +vc->push(); +vc->assertFormula(id597); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id575); +vc->popto(88); +vc->push(); +vc->query(id574); +vc->popto(88); +vc->push(); +vc->query(id574); +vc->popto(88); +vc->push(); +vc->query(id575); +vc->popto(88); +vc->push(); +vc->assertFormula(id575); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2271); +vc->popto(89); +vc->push(); +vc->query(id2270); +vc->popto(89); +vc->push(); +vc->query(id555); +vc->popto(89); +vc->push(); +vc->query(id554); +vc->popto(89); +vc->push(); +vc->query(id554); +vc->popto(89); +vc->push(); +vc->query(id555); +vc->popto(89); +vc->push(); +vc->assertFormula(id555); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2439); +vc->popto(90); +vc->push(); +vc->query(id2438); +vc->popto(90); +vc->push(); +vc->query(id515); +vc->popto(90); +vc->push(); +vc->query(id514); +vc->popto(90); +vc->push(); +vc->query(id514); +vc->popto(90); +vc->push(); +vc->query(id515); +vc->popto(90); +vc->push(); +vc->assertFormula(id515); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id457); +vc->popto(91); +vc->push(); +vc->query(id456); +vc->popto(91); +vc->push(); +vc->query(id456); +vc->popto(91); +vc->push(); +vc->query(id457); +vc->popto(91); +vc->push(); +vc->assertFormula(id457); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3479); +vc->popto(92); +vc->push(); +vc->query(id3478); +vc->popto(92); +vc->push(); +vc->query(id3359); +vc->popto(92); +vc->push(); +vc->query(id3358); +vc->popto(92); +vc->push(); +vc->query(id615); +vc->popto(92); +vc->push(); +vc->query(id614); +vc->popto(92); +vc->push(); +vc->query(id614); +vc->popto(92); +vc->push(); +vc->query(id615); +vc->popto(92); +vc->push(); +vc->assertFormula(id615); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id593); +vc->popto(93); +vc->push(); +vc->query(id592); +vc->popto(93); +vc->push(); +vc->query(id592); +vc->popto(93); +vc->push(); +vc->query(id593); +vc->popto(93); +vc->push(); +vc->assertFormula(id593); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2113); +vc->popto(94); +vc->push(); +vc->query(id2112); +vc->popto(94); +vc->push(); +vc->query(id573); +vc->popto(94); +vc->push(); +vc->query(id572); +vc->popto(94); +vc->push(); +vc->query(id572); +vc->popto(94); +vc->push(); +vc->query(id573); +vc->popto(94); +vc->push(); +vc->assertFormula(id573); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2281); +vc->popto(95); +vc->push(); +vc->query(id2280); +vc->popto(95); +vc->push(); +vc->query(id533); +vc->popto(95); +vc->push(); +vc->query(id532); +vc->popto(95); +vc->push(); +vc->query(id532); +vc->popto(95); +vc->push(); +vc->query(id533); +vc->popto(95); +vc->push(); +vc->assertFormula(id533); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id475); +vc->popto(96); +vc->push(); +vc->query(id474); +vc->popto(96); +vc->push(); +vc->query(id474); +vc->popto(96); +vc->push(); +vc->query(id475); +vc->popto(96); +vc->push(); +vc->assertFormula(id475); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3471); +vc->popto(97); +vc->push(); +vc->query(id3470); +vc->popto(97); +vc->push(); +vc->query(id3201); +vc->popto(97); +vc->push(); +vc->query(id3200); +vc->popto(97); +vc->push(); +vc->query(id633); +vc->popto(97); +vc->push(); +vc->query(id632); +vc->popto(97); +vc->push(); +vc->query(id632); +vc->popto(97); +vc->push(); +vc->query(id633); +vc->popto(97); +vc->push(); +vc->assertFormula(id633); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id611); +vc->popto(98); +vc->push(); +vc->query(id610); +vc->popto(98); +vc->push(); +vc->query(id610); +vc->popto(98); +vc->push(); +vc->query(id611); +vc->popto(98); +vc->push(); +vc->assertFormula(id611); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1955); +vc->popto(99); +vc->push(); +vc->query(id1954); +vc->popto(99); +vc->push(); +vc->query(id591); +vc->popto(99); +vc->push(); +vc->query(id590); +vc->popto(99); +vc->push(); +vc->query(id590); +vc->popto(99); +vc->push(); +vc->query(id591); +vc->popto(99); +vc->push(); +vc->assertFormula(id591); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2123); +vc->popto(100); +vc->push(); +vc->query(id2122); +vc->popto(100); +vc->push(); +vc->query(id551); +vc->popto(100); +vc->push(); +vc->query(id550); +vc->popto(100); +vc->push(); +vc->query(id550); +vc->popto(100); +vc->push(); +vc->query(id551); +vc->popto(100); +vc->push(); +vc->assertFormula(id551); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id493); +vc->popto(101); +vc->push(); +vc->query(id492); +vc->popto(101); +vc->push(); +vc->query(id492); +vc->popto(101); +vc->push(); +vc->query(id493); +vc->popto(101); +vc->push(); +vc->assertFormula(id493); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3463); +vc->popto(102); +vc->push(); +vc->query(id3462); +vc->popto(102); +vc->push(); +vc->query(id3043); +vc->popto(102); +vc->push(); +vc->query(id3042); +vc->popto(102); +vc->push(); +vc->query(id651); +vc->popto(102); +vc->push(); +vc->query(id650); +vc->popto(102); +vc->push(); +vc->query(id650); +vc->popto(102); +vc->push(); +vc->query(id651); +vc->popto(102); +vc->push(); +vc->assertFormula(id651); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id629); +vc->popto(103); +vc->push(); +vc->query(id628); +vc->popto(103); +vc->push(); +vc->query(id628); +vc->popto(103); +vc->push(); +vc->query(id629); +vc->popto(103); +vc->push(); +vc->assertFormula(id629); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1797); +vc->popto(104); +vc->push(); +vc->query(id1796); +vc->popto(104); +vc->push(); +vc->query(id609); +vc->popto(104); +vc->push(); +vc->query(id608); +vc->popto(104); +vc->push(); +vc->query(id608); +vc->popto(104); +vc->push(); +vc->query(id609); +vc->popto(104); +vc->push(); +vc->assertFormula(id609); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1965); +vc->popto(105); +vc->push(); +vc->query(id1964); +vc->popto(105); +vc->push(); +vc->query(id569); +vc->popto(105); +vc->push(); +vc->query(id568); +vc->popto(105); +vc->push(); +vc->query(id568); +vc->popto(105); +vc->push(); +vc->query(id569); +vc->popto(105); +vc->push(); +vc->assertFormula(id569); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id511); +vc->popto(106); +vc->push(); +vc->query(id510); +vc->popto(106); +vc->push(); +vc->query(id510); +vc->popto(106); +vc->push(); +vc->query(id511); +vc->popto(106); +vc->push(); +vc->assertFormula(id511); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3455); +vc->popto(107); +vc->push(); +vc->query(id3454); +vc->popto(107); +vc->push(); +vc->query(id2885); +vc->popto(107); +vc->push(); +vc->query(id2884); +vc->popto(107); +vc->push(); +vc->query(id669); +vc->popto(107); +vc->push(); +vc->query(id668); +vc->popto(107); +vc->push(); +vc->query(id668); +vc->popto(107); +vc->push(); +vc->query(id669); +vc->popto(107); +vc->push(); +vc->assertFormula(id669); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id647); +vc->popto(108); +vc->push(); +vc->query(id646); +vc->popto(108); +vc->push(); +vc->query(id646); +vc->popto(108); +vc->push(); +vc->query(id647); +vc->popto(108); +vc->push(); +vc->assertFormula(id647); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1639); +vc->popto(109); +vc->push(); +vc->query(id1638); +vc->popto(109); +vc->push(); +vc->query(id627); +vc->popto(109); +vc->push(); +vc->query(id626); +vc->popto(109); +vc->push(); +vc->query(id626); +vc->popto(109); +vc->push(); +vc->query(id627); +vc->popto(109); +vc->push(); +vc->assertFormula(id627); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1807); +vc->popto(110); +vc->push(); +vc->query(id1806); +vc->popto(110); +vc->push(); +vc->query(id587); +vc->popto(110); +vc->push(); +vc->query(id586); +vc->popto(110); +vc->push(); +vc->query(id586); +vc->popto(110); +vc->push(); +vc->query(id587); +vc->popto(110); +vc->push(); +vc->assertFormula(id587); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id529); +vc->popto(111); +vc->push(); +vc->query(id528); +vc->popto(111); +vc->push(); +vc->query(id528); +vc->popto(111); +vc->push(); +vc->query(id529); +vc->popto(111); +vc->push(); +vc->assertFormula(id529); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3447); +vc->popto(112); +vc->push(); +vc->query(id3446); +vc->popto(112); +vc->push(); +vc->query(id2727); +vc->popto(112); +vc->push(); +vc->query(id2726); +vc->popto(112); +vc->push(); +vc->query(id687); +vc->popto(112); +vc->push(); +vc->query(id686); +vc->popto(112); +vc->push(); +vc->query(id686); +vc->popto(112); +vc->push(); +vc->query(id687); +vc->popto(112); +vc->push(); +vc->assertFormula(id687); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id665); +vc->popto(113); +vc->push(); +vc->query(id664); +vc->popto(113); +vc->push(); +vc->query(id664); +vc->popto(113); +vc->push(); +vc->query(id665); +vc->popto(113); +vc->push(); +vc->assertFormula(id665); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1481); +vc->popto(114); +vc->push(); +vc->query(id1480); +vc->popto(114); +vc->push(); +vc->query(id645); +vc->popto(114); +vc->push(); +vc->query(id644); +vc->popto(114); +vc->push(); +vc->query(id644); +vc->popto(114); +vc->push(); +vc->query(id645); +vc->popto(114); +vc->push(); +vc->assertFormula(id645); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1649); +vc->popto(115); +vc->push(); +vc->query(id1648); +vc->popto(115); +vc->push(); +vc->query(id605); +vc->popto(115); +vc->push(); +vc->query(id604); +vc->popto(115); +vc->push(); +vc->query(id604); +vc->popto(115); +vc->push(); +vc->query(id605); +vc->popto(115); +vc->push(); +vc->assertFormula(id605); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id547); +vc->popto(116); +vc->push(); +vc->query(id546); +vc->popto(116); +vc->push(); +vc->query(id546); +vc->popto(116); +vc->push(); +vc->query(id547); +vc->popto(116); +vc->push(); +vc->assertFormula(id547); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3439); +vc->popto(117); +vc->push(); +vc->query(id3438); +vc->popto(117); +vc->push(); +vc->query(id2569); +vc->popto(117); +vc->push(); +vc->query(id2568); +vc->popto(117); +vc->push(); +vc->query(id705); +vc->popto(117); +vc->push(); +vc->query(id704); +vc->popto(117); +vc->push(); +vc->query(id704); +vc->popto(117); +vc->push(); +vc->query(id705); +vc->popto(117); +vc->push(); +vc->assertFormula(id705); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id683); +vc->popto(118); +vc->push(); +vc->query(id682); +vc->popto(118); +vc->push(); +vc->query(id682); +vc->popto(118); +vc->push(); +vc->query(id683); +vc->popto(118); +vc->push(); +vc->assertFormula(id683); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1323); +vc->popto(119); +vc->push(); +vc->query(id1322); +vc->popto(119); +vc->push(); +vc->query(id663); +vc->popto(119); +vc->push(); +vc->query(id662); +vc->popto(119); +vc->push(); +vc->query(id662); +vc->popto(119); +vc->push(); +vc->query(id663); +vc->popto(119); +vc->push(); +vc->assertFormula(id663); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1491); +vc->popto(120); +vc->push(); +vc->query(id1490); +vc->popto(120); +vc->push(); +vc->query(id623); +vc->popto(120); +vc->push(); +vc->query(id622); +vc->popto(120); +vc->push(); +vc->query(id622); +vc->popto(120); +vc->push(); +vc->query(id623); +vc->popto(120); +vc->push(); +vc->assertFormula(id623); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id565); +vc->popto(121); +vc->push(); +vc->query(id564); +vc->popto(121); +vc->push(); +vc->query(id564); +vc->popto(121); +vc->push(); +vc->query(id565); +vc->popto(121); +vc->push(); +vc->assertFormula(id565); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3431); +vc->popto(122); +vc->push(); +vc->query(id3430); +vc->popto(122); +vc->push(); +vc->query(id2411); +vc->popto(122); +vc->push(); +vc->query(id2410); +vc->popto(122); +vc->push(); +vc->query(id723); +vc->popto(122); +vc->push(); +vc->query(id722); +vc->popto(122); +vc->push(); +vc->query(id722); +vc->popto(122); +vc->push(); +vc->query(id723); +vc->popto(122); +vc->push(); +vc->assertFormula(id723); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id701); +vc->popto(123); +vc->push(); +vc->query(id700); +vc->popto(123); +vc->push(); +vc->query(id700); +vc->popto(123); +vc->push(); +vc->query(id701); +vc->popto(123); +vc->push(); +vc->assertFormula(id701); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1165); +vc->popto(124); +vc->push(); +vc->query(id1164); +vc->popto(124); +vc->push(); +vc->query(id681); +vc->popto(124); +vc->push(); +vc->query(id680); +vc->popto(124); +vc->push(); +vc->query(id680); +vc->popto(124); +vc->push(); +vc->query(id681); +vc->popto(124); +vc->push(); +vc->assertFormula(id681); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1333); +vc->popto(125); +vc->push(); +vc->query(id1332); +vc->popto(125); +vc->push(); +vc->query(id641); +vc->popto(125); +vc->push(); +vc->query(id640); +vc->popto(125); +vc->push(); +vc->query(id640); +vc->popto(125); +vc->push(); +vc->query(id641); +vc->popto(125); +vc->push(); +vc->assertFormula(id641); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id583); +vc->popto(126); +vc->push(); +vc->query(id582); +vc->popto(126); +vc->push(); +vc->query(id582); +vc->popto(126); +vc->push(); +vc->query(id583); +vc->popto(126); +vc->push(); +vc->assertFormula(id583); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3423); +vc->popto(127); +vc->push(); +vc->query(id3422); +vc->popto(127); +vc->push(); +vc->query(id2253); +vc->popto(127); +vc->push(); +vc->query(id2252); +vc->popto(127); +vc->push(); +vc->query(id719); +vc->popto(127); +vc->push(); +vc->query(id718); +vc->popto(127); +vc->push(); +vc->query(id718); +vc->popto(127); +vc->push(); +vc->query(id719); +vc->popto(127); +vc->push(); +vc->assertFormula(id719); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1001); +vc->popto(128); +vc->push(); +vc->query(id1000); +vc->popto(128); +vc->push(); +vc->query(id699); +vc->popto(128); +vc->push(); +vc->query(id698); +vc->popto(128); +vc->push(); +vc->query(id698); +vc->popto(128); +vc->push(); +vc->query(id699); +vc->popto(128); +vc->push(); +vc->assertFormula(id699); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1175); +vc->popto(129); +vc->push(); +vc->query(id1174); +vc->popto(129); +vc->push(); +vc->query(id659); +vc->popto(129); +vc->push(); +vc->query(id658); +vc->popto(129); +vc->push(); +vc->query(id658); +vc->popto(129); +vc->push(); +vc->query(id659); +vc->popto(129); +vc->push(); +vc->assertFormula(id659); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id601); +vc->popto(130); +vc->push(); +vc->query(id600); +vc->popto(130); +vc->push(); +vc->query(id600); +vc->popto(130); +vc->push(); +vc->query(id601); +vc->popto(130); +vc->push(); +vc->assertFormula(id601); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3415); +vc->popto(131); +vc->push(); +vc->query(id3414); +vc->popto(131); +vc->push(); +vc->query(id2095); +vc->popto(131); +vc->push(); +vc->query(id2094); +vc->popto(131); +vc->push(); +vc->query(id717); +vc->popto(131); +vc->push(); +vc->query(id716); +vc->popto(131); +vc->push(); +vc->query(id716); +vc->popto(131); +vc->push(); +vc->query(id717); +vc->popto(131); +vc->push(); +vc->assertFormula(id717); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id1011); +vc->popto(132); +vc->push(); +vc->query(id1010); +vc->popto(132); +vc->push(); +vc->query(id677); +vc->popto(132); +vc->push(); +vc->query(id676); +vc->popto(132); +vc->push(); +vc->query(id676); +vc->popto(132); +vc->push(); +vc->query(id677); +vc->popto(132); +vc->push(); +vc->assertFormula(id677); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id619); +vc->popto(133); +vc->push(); +vc->query(id618); +vc->popto(133); +vc->push(); +vc->query(id618); +vc->popto(133); +vc->push(); +vc->query(id619); +vc->popto(133); +vc->push(); +vc->assertFormula(id619); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3407); +vc->popto(134); +vc->push(); +vc->query(id3406); +vc->popto(134); +vc->push(); +vc->query(id1937); +vc->popto(134); +vc->push(); +vc->query(id1936); +vc->popto(134); +vc->push(); +vc->query(id695); +vc->popto(134); +vc->push(); +vc->query(id694); +vc->popto(134); +vc->push(); +vc->query(id694); +vc->popto(134); +vc->push(); +vc->query(id695); +vc->popto(134); +vc->push(); +vc->assertFormula(id695); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id637); +vc->popto(135); +vc->push(); +vc->query(id636); +vc->popto(135); +vc->push(); +vc->query(id636); +vc->popto(135); +vc->push(); +vc->query(id637); +vc->popto(135); +vc->push(); +vc->assertFormula(id637); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3399); +vc->popto(136); +vc->push(); +vc->query(id3398); +vc->popto(136); +vc->push(); +vc->query(id1779); +vc->popto(136); +vc->push(); +vc->query(id1778); +vc->popto(136); +vc->push(); +vc->query(id713); +vc->popto(136); +vc->push(); +vc->query(id712); +vc->popto(136); +vc->push(); +vc->query(id712); +vc->popto(136); +vc->push(); +vc->query(id713); +vc->popto(136); +vc->push(); +vc->assertFormula(id713); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id655); +vc->popto(137); +vc->push(); +vc->query(id654); +vc->popto(137); +vc->push(); +vc->query(id654); +vc->popto(137); +vc->push(); +vc->query(id655); +vc->popto(137); +vc->push(); +vc->assertFormula(id655); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3391); +vc->popto(138); +vc->push(); +vc->query(id3390); +vc->popto(138); +vc->push(); +vc->query(id1621); +vc->popto(138); +vc->push(); +vc->query(id1620); +vc->popto(138); +vc->push(); +vc->query(id673); +vc->popto(138); +vc->push(); +vc->query(id672); +vc->popto(138); +vc->push(); +vc->query(id672); +vc->popto(138); +vc->push(); +vc->query(id673); +vc->popto(138); +vc->push(); +vc->assertFormula(id673); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3383); +vc->popto(139); +vc->push(); +vc->query(id3382); +vc->popto(139); +vc->push(); +vc->query(id1463); +vc->popto(139); +vc->push(); +vc->query(id1462); +vc->popto(139); +vc->push(); +vc->query(id691); +vc->popto(139); +vc->push(); +vc->query(id690); +vc->popto(139); +vc->push(); +vc->query(id690); +vc->popto(139); +vc->push(); +vc->query(id691); +vc->popto(139); +vc->push(); +vc->assertFormula(id691); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3375); +vc->popto(140); +vc->push(); +vc->query(id3374); +vc->popto(140); +vc->push(); +vc->query(id1305); +vc->popto(140); +vc->push(); +vc->query(id1304); +vc->popto(140); +vc->push(); +vc->query(id709); +vc->popto(140); +vc->push(); +vc->query(id708); +vc->popto(140); +vc->push(); +vc->query(id708); +vc->popto(140); +vc->push(); +vc->query(id709); +vc->popto(140); +vc->push(); +vc->assertFormula(id709); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3367); +vc->popto(141); +vc->push(); +vc->query(id3366); +vc->popto(141); +vc->push(); +vc->query(id1147); +vc->popto(141); +vc->push(); +vc->query(id1146); +vc->popto(141); +vc->push(); +vc->query(id459); +vc->popto(141); +vc->push(); +vc->query(id458); +vc->popto(141); +vc->push(); +vc->query(id458); +vc->popto(141); +vc->push(); +vc->query(id459); +vc->popto(141); +vc->push(); +vc->assertFormula(id459); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id754); +vc->popto(142); +vc->push(); +vc->query(id755); +vc->popto(142); +vc->push(); +vc->query(id3223); +vc->popto(142); +vc->push(); +vc->query(id3222); +vc->popto(142); +vc->push(); +vc->query(id477); +vc->popto(142); +vc->push(); +vc->query(id476); +vc->popto(142); +vc->push(); +vc->query(id476); +vc->popto(142); +vc->push(); +vc->query(id477); +vc->popto(142); +vc->push(); +vc->assertFormula(id477); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id752); +vc->popto(143); +vc->push(); +vc->query(id753); +vc->popto(143); +vc->push(); +vc->query(id3065); +vc->popto(143); +vc->push(); +vc->query(id3064); +vc->popto(143); +vc->push(); +vc->query(id495); +vc->popto(143); +vc->push(); +vc->query(id494); +vc->popto(143); +vc->push(); +vc->query(id494); +vc->popto(143); +vc->push(); +vc->query(id495); +vc->popto(143); +vc->push(); +vc->assertFormula(id495); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id750); +vc->popto(144); +vc->push(); +vc->query(id751); +vc->popto(144); +vc->push(); +vc->query(id2907); +vc->popto(144); +vc->push(); +vc->query(id2906); +vc->popto(144); +vc->push(); +vc->query(id513); +vc->popto(144); +vc->push(); +vc->query(id512); +vc->popto(144); +vc->push(); +vc->query(id512); +vc->popto(144); +vc->push(); +vc->query(id513); +vc->popto(144); +vc->push(); +vc->assertFormula(id513); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id748); +vc->popto(145); +vc->push(); +vc->query(id749); +vc->popto(145); +vc->push(); +vc->query(id2749); +vc->popto(145); +vc->push(); +vc->query(id2748); +vc->popto(145); +vc->push(); +vc->query(id531); +vc->popto(145); +vc->push(); +vc->query(id530); +vc->popto(145); +vc->push(); +vc->query(id530); +vc->popto(145); +vc->push(); +vc->query(id531); +vc->popto(145); +vc->push(); +vc->assertFormula(id531); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id746); +vc->popto(146); +vc->push(); +vc->query(id747); +vc->popto(146); +vc->push(); +vc->query(id2591); +vc->popto(146); +vc->push(); +vc->query(id2590); +vc->popto(146); +vc->push(); +vc->query(id549); +vc->popto(146); +vc->push(); +vc->query(id548); +vc->popto(146); +vc->push(); +vc->query(id548); +vc->popto(146); +vc->push(); +vc->query(id549); +vc->popto(146); +vc->push(); +vc->assertFormula(id549); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id744); +vc->popto(147); +vc->push(); +vc->query(id745); +vc->popto(147); +vc->push(); +vc->query(id2433); +vc->popto(147); +vc->push(); +vc->query(id2432); +vc->popto(147); +vc->push(); +vc->query(id567); +vc->popto(147); +vc->push(); +vc->query(id566); +vc->popto(147); +vc->push(); +vc->query(id566); +vc->popto(147); +vc->push(); +vc->query(id567); +vc->popto(147); +vc->push(); +vc->assertFormula(id567); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id742); +vc->popto(148); +vc->push(); +vc->query(id743); +vc->popto(148); +vc->push(); +vc->query(id2275); +vc->popto(148); +vc->push(); +vc->query(id2274); +vc->popto(148); +vc->push(); +vc->query(id585); +vc->popto(148); +vc->push(); +vc->query(id584); +vc->popto(148); +vc->push(); +vc->query(id584); +vc->popto(148); +vc->push(); +vc->query(id585); +vc->popto(148); +vc->push(); +vc->assertFormula(id585); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id740); +vc->popto(149); +vc->push(); +vc->query(id741); +vc->popto(149); +vc->push(); +vc->query(id2117); +vc->popto(149); +vc->push(); +vc->query(id2116); +vc->popto(149); +vc->push(); +vc->query(id603); +vc->popto(149); +vc->push(); +vc->query(id602); +vc->popto(149); +vc->push(); +vc->query(id602); +vc->popto(149); +vc->push(); +vc->query(id603); +vc->popto(149); +vc->push(); +vc->assertFormula(id603); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id738); +vc->popto(150); +vc->push(); +vc->query(id739); +vc->popto(150); +vc->push(); +vc->query(id1959); +vc->popto(150); +vc->push(); +vc->query(id1958); +vc->popto(150); +vc->push(); +vc->query(id621); +vc->popto(150); +vc->push(); +vc->query(id620); +vc->popto(150); +vc->push(); +vc->query(id620); +vc->popto(150); +vc->push(); +vc->query(id621); +vc->popto(150); +vc->push(); +vc->assertFormula(id621); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id736); +vc->popto(151); +vc->push(); +vc->query(id737); +vc->popto(151); +vc->push(); +vc->query(id1801); +vc->popto(151); +vc->push(); +vc->query(id1800); +vc->popto(151); +vc->push(); +vc->query(id639); +vc->popto(151); +vc->push(); +vc->query(id638); +vc->popto(151); +vc->push(); +vc->query(id638); +vc->popto(151); +vc->push(); +vc->query(id639); +vc->popto(151); +vc->push(); +vc->assertFormula(id639); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id734); +vc->popto(152); +vc->push(); +vc->query(id735); +vc->popto(152); +vc->push(); +vc->query(id1643); +vc->popto(152); +vc->push(); +vc->query(id1642); +vc->popto(152); +vc->push(); +vc->query(id657); +vc->popto(152); +vc->push(); +vc->query(id656); +vc->popto(152); +vc->push(); +vc->query(id656); +vc->popto(152); +vc->push(); +vc->query(id657); +vc->popto(152); +vc->push(); +vc->assertFormula(id657); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id732); +vc->popto(153); +vc->push(); +vc->query(id733); +vc->popto(153); +vc->push(); +vc->query(id1485); +vc->popto(153); +vc->push(); +vc->query(id1484); +vc->popto(153); +vc->push(); +vc->query(id675); +vc->popto(153); +vc->push(); +vc->query(id674); +vc->popto(153); +vc->push(); +vc->query(id674); +vc->popto(153); +vc->push(); +vc->query(id675); +vc->popto(153); +vc->push(); +vc->assertFormula(id675); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id730); +vc->popto(154); +vc->push(); +vc->query(id731); +vc->popto(154); +vc->push(); +vc->query(id1327); +vc->popto(154); +vc->push(); +vc->query(id1326); +vc->popto(154); +vc->push(); +vc->query(id693); +vc->popto(154); +vc->push(); +vc->query(id692); +vc->popto(154); +vc->push(); +vc->query(id692); +vc->popto(154); +vc->push(); +vc->query(id693); +vc->popto(154); +vc->push(); +vc->assertFormula(id693); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id728); +vc->popto(155); +vc->push(); +vc->query(id729); +vc->popto(155); +vc->push(); +vc->query(id1169); +vc->popto(155); +vc->push(); +vc->query(id1168); +vc->popto(155); +vc->push(); +vc->query(id711); +vc->popto(155); +vc->push(); +vc->query(id710); +vc->popto(155); +vc->push(); +vc->query(id710); +vc->popto(155); +vc->push(); +vc->query(id711); +vc->popto(155); +vc->push(); +vc->assertFormula(id711); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3370); +vc->popto(156); +vc->push(); +vc->query(id3371); +vc->popto(156); +vc->push(); +vc->query(id1005); +vc->popto(156); +vc->push(); +vc->query(id1004); +vc->popto(156); +vc->push(); +vc->query(id3300); +vc->popto(156); +vc->push(); +vc->query(id3301); +vc->popto(156); +vc->push(); +vc->assertFormula(id3301); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id3282); +vc->popto(157); +vc->popto(156); +vc->push(); +vc->query(id3328); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in testgeorge3(): \n" << e << endl; + } + delete vc; +} + + +void testgeorge4() { + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("arith3", true); + ValidityChecker *vc = ValidityChecker::create(flags); + try { +/*************/ +vector inconsistency; +/*************/ +Type id9 = vc->realType(); +Type id7 = vc->intType(); +Type id11 = vc->boolType(); +vc->push(); +vc->stackLevel(); +Expr id13=vc->trueExpr(); +Expr id12=vc->notExpr(vc->trueExpr()); +Type id19=vc->arrayType(id7,id7); +Type id21=vc->arrayType(id7,id9); +Type id23=vc->arrayType(id9,id7); +Type id25=vc->arrayType(id9,id9); +Type id27=vc->tupleType(id19,id7,id7); +Type id29=vc->funType(id27,id19); +Op id31=vc->createOp(".Int_Int_store",id29); +Type id33=vc->tupleType(id21,id7); +Type id35=vc->funType(id33,id9); +Op id37=vc->createOp(".Int_Real_select",id35); +Type id39=vc->tupleType(id21,id7,id9); +Type id41=vc->funType(id39,id21); +Op id43=vc->createOp(".Int_Real_store",id41); +Type id45=vc->tupleType(id19,id7); +Type id47=vc->funType(id45,id7); +Op id49=vc->createOp(".Int_Int_select",id47); +Type id51=vc->tupleType(id23,id9,id7); +Type id53=vc->funType(id51,id23); +Op id55=vc->createOp(".Real_Int_store",id53); +Type id57=vc->tupleType(id25,id9,id9); +Type id59=vc->funType(id57,id25); +Op id61=vc->createOp(".Real_Real_store",id59); +Type id63=vc->tupleType(id23,id9); +Type id65=vc->funType(id63,id7); +Op id67=vc->createOp(".Real_Int_select",id65); +Type id69=vc->tupleType(id25,id9); +Type id71=vc->funType(id69,id9); +Op id73=vc->createOp(".Real_Real_select",id71); +Expr id79=vc->varExpr("AT2_PROC1_X",id7); +Expr id81=vc->varExpr("AT0_PROC1_X",id7); +Expr id105=vc->varExpr("AT2_Z",id7); +Expr id133=vc->varExpr("AT2_PROC2_X",id7); +Expr id135=vc->varExpr("AT0_PROC2_X",id7); +Expr id137=vc->varExpr("AT1_PROC1_X",id7); +Expr id141=vc->varExpr("AT1_Z",id7); +Expr id205=vc->varExpr("AT1_PROC2_X",id7); +Expr id209=vc->varExpr("AT0_Z",id7); +Expr id219=vc->eqExpr(id209,id81); +Expr id218=vc->notExpr(id219); +vc->registerAtom(id219); +Expr id221=vc->gtExpr(id81,id209); +Expr id220=vc->notExpr(id221); +vc->registerAtom(id221); +Expr id225=vc->eqExpr(id141,id137); +Expr id224=vc->notExpr(id225); +vc->registerAtom(id225); +Expr id227=vc->gtExpr(id137,id141); +Expr id226=vc->notExpr(id227); +vc->registerAtom(id227); +Expr id231=vc->eqExpr(id105,id79); +Expr id230=vc->notExpr(id231); +vc->registerAtom(id231); +Expr id233=vc->gtExpr(id79,id105); +Expr id232=vc->notExpr(id233); +vc->registerAtom(id233); +Expr id237=vc->eqExpr(id209,id135); +Expr id236=vc->notExpr(id237); +vc->registerAtom(id237); +Expr id239=vc->gtExpr(id135,id209); +Expr id238=vc->notExpr(id239); +vc->registerAtom(id239); +Expr id243=vc->eqExpr(id141,id205); +Expr id242=vc->notExpr(id243); +vc->registerAtom(id243); +Expr id245=vc->gtExpr(id205,id141); +Expr id244=vc->notExpr(id245); +vc->registerAtom(id245); +Expr id249=vc->eqExpr(id105,id133); +Expr id248=vc->notExpr(id249); +vc->registerAtom(id249); +Expr id251=vc->gtExpr(id133,id105); +Expr id250=vc->notExpr(id251); +vc->registerAtom(id251); +Expr id255=vc->minusExpr(id81,id209); +Expr id257=vc->ratExpr(10,1); +Expr id259=vc->leExpr(id255,id257); +Expr id258=vc->notExpr(id259); +vc->registerAtom(id259); +Expr id261=vc->minusExpr(id137,id141); +Expr id263=vc->leExpr(id261,id257); +Expr id262=vc->notExpr(id263); +vc->registerAtom(id263); +Expr id265=vc->minusExpr(id135,id209); +Expr id267=vc->leExpr(id265,id257); +Expr id266=vc->notExpr(id267); +vc->registerAtom(id267); +Expr id269=vc->minusExpr(id205,id141); +Expr id271=vc->leExpr(id269,id257); +Expr id270=vc->notExpr(id271); +vc->registerAtom(id271); +Expr id273=vc->eqExpr(id81,id137); +Expr id272=vc->notExpr(id273); +vc->registerAtom(id273); +Expr id275=vc->eqExpr(id137,id79); +Expr id274=vc->notExpr(id275); +vc->registerAtom(id275); +Expr id277=vc->eqExpr(id209,id141); +Expr id276=vc->notExpr(id277); +vc->registerAtom(id277); +Expr id279=vc->eqExpr(id141,id105); +Expr id278=vc->notExpr(id279); +vc->registerAtom(id279); +Expr id281=vc->eqExpr(id135,id205); +Expr id280=vc->notExpr(id281); +vc->registerAtom(id281); +Expr id283=vc->eqExpr(id205,id133); +Expr id282=vc->notExpr(id283); +vc->registerAtom(id283); +Expr id285=vc->ltExpr(id141,id209); +Expr id284=vc->notExpr(id285); +vc->registerAtom(id285); +Expr id289=vc->ltExpr(id105,id141); +Expr id288=vc->notExpr(id289); +vc->registerAtom(id289); +Expr id293=vc->ltExpr(id137,id81); +Expr id292=vc->notExpr(id293); +vc->registerAtom(id293); +Expr id297=vc->ltExpr(id79,id137); +Expr id296=vc->notExpr(id297); +vc->registerAtom(id297); +Expr id301=vc->ltExpr(id205,id135); +Expr id300=vc->notExpr(id301); +vc->registerAtom(id301); +Expr id305=vc->ltExpr(id133,id205); +Expr id304=vc->notExpr(id305); +vc->registerAtom(id305); +Expr id319=vc->ltExpr(id141,id137); +Expr id318=vc->notExpr(id319); +vc->registerAtom(id319); +Expr id325=vc->ltExpr(id141,id205); +Expr id324=vc->notExpr(id325); +vc->registerAtom(id325); +Expr id539=vc->minusExpr(id79,id105); +Expr id541=vc->leExpr(id539,id257); +Expr id540=vc->notExpr(id541); +vc->registerAtom(id541); +Expr id555=vc->minusExpr(id133,id105); +Expr id557=vc->leExpr(id555,id257); +Expr id556=vc->notExpr(id557); +vc->registerAtom(id557); +Expr id683=vc->gtExpr(id255,id257); +Expr id682=vc->notExpr(id683); +vc->registerAtom(id683); +Expr id773=vc->gtExpr(id261,id257); +Expr id772=vc->notExpr(id773); +vc->registerAtom(id773); +Expr id903=vc->gtExpr(id265,id257); +Expr id902=vc->notExpr(id903); +vc->registerAtom(id903); +Expr id993=vc->gtExpr(id269,id257); +Expr id992=vc->notExpr(id993); +vc->registerAtom(id993); +Expr id1619=vc->ltExpr(id209,id81); +Expr id1618=vc->notExpr(id1619); +vc->registerAtom(id1619); +Expr id1665=vc->ltExpr(id105,id79); +Expr id1664=vc->notExpr(id1665); +vc->registerAtom(id1665); +Expr id1699=vc->ltExpr(id209,id135); +Expr id1698=vc->notExpr(id1699); +vc->registerAtom(id1699); +Expr id1745=vc->ltExpr(id105,id133); +Expr id1744=vc->notExpr(id1745); +vc->registerAtom(id1745); +Expr id2009=vc->eqExpr(id539,id261); +Expr id2008=vc->notExpr(id2009); +vc->registerAtom(id2009); +Expr id2053=vc->eqExpr(id555,id269); +Expr id2052=vc->notExpr(id2053); +vc->registerAtom(id2053); +vc->push(); +vc->query(id12); +vc->inconsistent(inconsistency); +vc->pop(); +vc->push(); +vc->query(id2052); +vc->stackLevel(); +vc->popto(1); +vc->push(); +vc->query(id2053); +vc->stackLevel(); +vc->popto(1); +vc->push(); +vc->assertFormula(id2053); +vc->getImpliedLiteral(); +vc->getImpliedLiteral(); +vc->push(); +vc->query(id2008); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in testgeorge4(): \n" << e << endl; + } + delete vc; +} + + +void testgeorge5() { + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("arith3", true); + ValidityChecker *vc = ValidityChecker::create(flags); + try { +/*************/ +vector inconsistency; +/*************/ +Type id2 = vc->realType(); +Type id1 = vc->intType(); +Type id3 = vc->boolType(); +vc->push(); +vc->stackLevel(); +Expr id4=vc->trueExpr(); +Expr idn4=vc->notExpr(vc->trueExpr()); +Type id7=vc->arrayType(id1,id1); +Type id8=vc->arrayType(id1,id2); +Type id9=vc->arrayType(id2,id1); +Type id10=vc->arrayType(id2,id2); +Type id11=vc->tupleType(id7,id1,id1); +Type id12=vc->funType(id11,id7); +Op id13=vc->createOp(".Int_Int_store",id12); +Type id14=vc->tupleType(id8,id1); +Type id15=vc->funType(id14,id2); +Op id16=vc->createOp(".Int_Real_select",id15); +Type id17=vc->tupleType(id8,id1,id2); +Type id18=vc->funType(id17,id8); +Op id19=vc->createOp(".Int_Real_store",id18); +Type id20=vc->tupleType(id7,id1); +Type id21=vc->funType(id20,id1); +Op id22=vc->createOp(".Int_Int_select",id21); +Type id23=vc->tupleType(id9,id2,id1); +Type id24=vc->funType(id23,id9); +Op id25=vc->createOp(".Real_Int_store",id24); +Type id26=vc->tupleType(id10,id2,id2); +Type id27=vc->funType(id26,id10); +Op id28=vc->createOp(".Real_Real_store",id27); +Type id29=vc->tupleType(id9,id2); +Type id30=vc->funType(id29,id1); +Op id31=vc->createOp(".Real_Int_select",id30); +Type id32=vc->tupleType(id10,id2); +Type id33=vc->funType(id32,id2); +Op id34=vc->createOp(".Real_Real_select",id33); +Type id36=vc->funType(id1,id3); +Op id37=vc->createOp("trainhere",id36); +Op id40=vc->createOp("trains_i",id36); +Op id41=vc->createOp("trains_p",id36); +Op id42=vc->createOp("trains_nothere",id36); +Expr id45=vc->varExpr("i",id1); +Expr id46=vc->varExpr("j",id1); +Expr id47=vc->varExpr("t",id2); +Expr id48=vc->varExpr("gammaup",id2); +Expr id49=vc->varExpr("lastup",id2); +Expr id50=vc->varExpr("beta",id2); +Type id51=vc->tupleType(id2,id2); +Type id52=vc->funType(id51,id2); +Op id53=vc->createOp("-",id52); +Expr id54=vc->varExpr("conmini",id2); +Expr id55=vc->varExpr("carpassingtime",id2); +Expr id56=vc->varExpr("gaterisetime",id2); +Expr id57=vc->varExpr("gammadown",id2); +Type id58=vc->funType(id1,id2); +Op id59=vc->createOp("lastenter",id58); +Expr id60=vc->varExpr("gatedowntime",id2); +Expr id61=vc->varExpr("mintimetoi",id2); +Op id62=vc->createOp("schedtime",id58); +Expr id63=vc->varExpr("lastdown",id2); +Op id64=vc->createOp("firstenter",id58); +Expr id65=vc->varExpr("maxtimetoi",id2); +Expr id75 = vc->funExpr(id41,id45); +Expr idn75=vc->notExpr(id75); +Expr id76 = vc->funExpr(id64,id45); +Expr id77=vc->geExpr(id47,id76); +Expr idn77=vc->notExpr(id77); +vc->push(); +vc->query(id77); +vc->stackLevel(); +vc->popto(1); +vc->push(); +vc->query(idn77); +vc->stackLevel(); +vc->popto(1); +vc->push(); +vc->query(id75); +vc->stackLevel(); +vc->popto(1); +vc->push(); +vc->query(idn75); +vc->stackLevel(); +vc->popto(1); +Expr id83=vc->varExpr("1?82",id1); +Expr id84 = vc->funExpr(id64,id83); +Expr id85=vc->ltExpr(id47,id84); +Expr idn85=vc->notExpr(id85); +Expr id87 = vc->funExpr(id40,id83); +Expr idn87=vc->notExpr(id87); +Expr id91=vc->varExpr("2?90",id1); +Expr id92 = vc->funExpr(id40,id91); +Expr idn92=vc->notExpr(id92); +Expr id93 = vc->funExpr(id41,id91); +Expr idn93=vc->notExpr(id93); +Expr id94 = vc->funExpr(id42,id91); +Expr idn94=vc->notExpr(id94); +Expr id97=vc->varExpr("3?96",id1); +Expr id98 = vc->funExpr(id40,id97); +Expr idn98=vc->notExpr(id98); +Expr id100 = vc->funExpr(id41,id97); +Expr idn100=vc->notExpr(id100); +Expr id101 = vc->funExpr(id42,id97); +Expr idn101=vc->notExpr(id101); +Expr id106=vc->varExpr("4?105",id1); +Expr id107 = vc->funExpr(id41,id106); +Expr idn107=vc->notExpr(id107); +Expr id109 = vc->funExpr(id40,id106); +Expr idn109=vc->notExpr(id109); +Expr id110 = vc->funExpr(id42,id106); +Expr idn110=vc->notExpr(id110); +Expr id115=vc->varExpr("5?114",id1); +Expr id116 = vc->funExpr(id42,id115); +Expr idn116=vc->notExpr(id116); +Expr id118 = vc->funExpr(id41,id115); +Expr idn118=vc->notExpr(id118); +Expr id119 = vc->funExpr(id40,id115); +Expr idn119=vc->notExpr(id119); +Expr id124=vc->varExpr("6?123",id1); +Expr id125=vc->eqExpr(id45,id124); +Expr idn125=vc->notExpr(id125); +Expr id128 = vc->funExpr(id40,id124); +Expr idn128=vc->notExpr(id128); +Expr id133 = vc->funExpr(id41,id124); +Expr idn133=vc->notExpr(id133); +Expr id136 = vc->funExpr(id42,id124); +Expr idn136=vc->notExpr(id136); +Expr id139=vc->varExpr("7?138",id1); +Expr id140=vc->eqExpr(id45,id139); +Expr idn140=vc->notExpr(id140); +Expr id143 = vc->funExpr(id40,id139); +Expr idn143=vc->notExpr(id143); +Expr id149 = vc->funExpr(id41,id139); +Expr idn149=vc->notExpr(id149); +Expr id152 = vc->funExpr(id42,id139); +Expr idn152=vc->notExpr(id152); +Expr id157=vc->varExpr("8?156",id1); +Expr id158=vc->eqExpr(id45,id157); +Expr idn158=vc->notExpr(id158); +Expr id162 = vc->funExpr(id41,id157); +Expr idn162=vc->notExpr(id162); +Expr id168 = vc->funExpr(id40,id157); +Expr idn168=vc->notExpr(id168); +Expr id170 = vc->funExpr(id42,id157); +Expr idn170=vc->notExpr(id170); +Expr id175=vc->varExpr("9?174",id1); +Expr id176 = vc->funExpr(id42,id175); +Expr idn176=vc->notExpr(id176); +Expr id178=vc->eqExpr(id45,id175); +Expr idn178=vc->notExpr(id178); +Expr id182 = vc->funExpr(id41,id175); +Expr idn182=vc->notExpr(id182); +Expr id187 = vc->funExpr(id40,id175); +Expr idn187=vc->notExpr(id187); +Expr id195=vc->varExpr("10?194",id1); +Expr id196=vc->eqExpr(id45,id195); +Expr idn196=vc->notExpr(id196); +Expr id199 = vc->funExpr(id40,id195); +Expr idn199=vc->notExpr(id199); +Expr id202 = vc->funExpr(id64,id195); +Expr id203=vc->ltExpr(id47,id202); +Expr idn203=vc->notExpr(id203); +inconsistency.clear( ); +vc->push(); +vc->query(idn4); +vc->inconsistent(inconsistency); +vc->pop(); +Expr id206 = vc->funExpr(id64,id115); +Expr id207 = vc->funExpr(id64,id97); +Expr id208 = vc->funExpr(id64,id157); +Expr id209 = vc->funExpr(id64,id139); +Expr id210 = vc->funExpr(id64,id124); +Expr id211 = vc->funExpr(id64,id175); +Expr id212 = vc->funExpr(id64,id106); +vc->push(); +vc->query(id203); +vc->stackLevel(); +vc->popto(1); +vc->push(); +vc->query(idn203); +vc->stackLevel(); +vc->popto(1); +vc->push(); +vc->assertFormula(id203); +vc->push(); +vc->query(id178); +vc->stackLevel(); +vc->popto(2); +vc->push(); +vc->query(idn178); +vc->stackLevel(); +vc->popto(2); +vc->push(); +vc->assertFormula(id178); +vc->push(); +vc->query(id158); +vc->stackLevel(); +vc->popto(3); +vc->push(); +vc->query(idn158); +vc->stackLevel(); +vc->popto(3); +vc->push(); +vc->assertFormula(id158); +vc->push(); +vc->query(id152); +vc->stackLevel(); +vc->popto(4); +vc->push(); +vc->query(idn152); +vc->stackLevel(); +vc->popto(4); +vc->push(); +vc->assertFormula(id152); +vc->push(); +vc->query(id125); +vc->stackLevel(); +vc->popto(5); +vc->push(); +vc->query(idn125); +vc->stackLevel(); +vc->popto(5); +vc->push(); +vc->assertFormula(idn125); +vc->push(); +vc->query(id140); +vc->stackLevel(); +vc->popto(6); +vc->push(); +vc->query(idn140); +vc->stackLevel(); +vc->popto(6); +vc->push(); +vc->assertFormula(id140); +vc->push(); +vc->query(id182); +vc->stackLevel(); +vc->popto(7); +vc->push(); +vc->query(idn182); +vc->stackLevel(); +vc->popto(7); +vc->push(); +vc->assertFormula(id182); +vc->push(); +vc->query(id162); +vc->stackLevel(); +vc->popto(8); +vc->push(); +vc->query(idn162); +vc->stackLevel(); +vc->popto(8); +vc->push(); +vc->query(id162); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(8); +vc->push(); +vc->query(id85); +vc->stackLevel(); +vc->popto(8); +vc->push(); +vc->query(idn85); +vc->stackLevel(); +vc->popto(8); +vc->push(); +vc->assertFormula(id85); +vc->push(); +vc->query(id187); +vc->stackLevel(); +vc->popto(9); +vc->push(); +vc->query(idn187); +vc->stackLevel(); +vc->popto(9); +vc->push(); +vc->assertFormula(id187); +vc->push(); +vc->query(id87); +vc->stackLevel(); +vc->popto(10); +vc->push(); +vc->query(idn87); +vc->stackLevel(); +vc->popto(10); +vc->push(); +vc->assertFormula(id87); +vc->push(); +vc->query(id119); +vc->stackLevel(); +vc->popto(11); +vc->push(); +vc->query(idn119); +vc->stackLevel(); +vc->popto(11); +vc->push(); +vc->assertFormula(id119); +vc->push(); +vc->query(id170); +vc->stackLevel(); +vc->popto(12); +vc->push(); +vc->query(idn170); +vc->stackLevel(); +vc->popto(12); +vc->push(); +vc->query(id170); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(12); +vc->push(); +vc->query(id110); +vc->stackLevel(); +vc->popto(12); +vc->push(); +vc->query(idn110); +vc->stackLevel(); +vc->popto(12); +vc->push(); +vc->assertFormula(id110); +vc->push(); +vc->query(id118); +vc->stackLevel(); +vc->popto(13); +vc->push(); +vc->query(idn118); +vc->stackLevel(); +vc->popto(13); +vc->push(); +vc->assertFormula(id118); +vc->push(); +vc->query(id196); +vc->stackLevel(); +vc->popto(14); +vc->push(); +vc->query(idn196); +vc->stackLevel(); +vc->popto(14); +vc->push(); +vc->assertFormula(id196); +vc->push(); +vc->query(id199); +vc->stackLevel(); +vc->popto(15); +vc->push(); +vc->query(idn199); +vc->stackLevel(); +vc->popto(15); +vc->push(); +vc->query(id199); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(15); +vc->push(); +vc->query(id100); +vc->stackLevel(); +vc->popto(15); +vc->push(); +vc->query(idn100); +vc->stackLevel(); +vc->popto(15); +vc->push(); +vc->assertFormula(id100); +vc->push(); +vc->query(id107); +vc->stackLevel(); +vc->popto(16); +vc->push(); +vc->query(idn107); +vc->stackLevel(); +vc->popto(16); +vc->push(); +vc->assertFormula(id107); +vc->push(); +vc->query(id98); +vc->stackLevel(); +vc->popto(17); +vc->push(); +vc->query(idn98); +vc->stackLevel(); +vc->popto(17); +vc->push(); +vc->assertFormula(id98); +vc->push(); +vc->query(id101); +vc->stackLevel(); +vc->popto(18); +vc->push(); +vc->query(idn101); +vc->stackLevel(); +vc->popto(18); +vc->push(); +vc->assertFormula(id101); +vc->push(); +vc->query(id75); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(idn75); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(id75); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(id77); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(idn77); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(idn77); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(id143); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(idn143); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(id143); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(id149); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(idn149); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(id149); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(id109); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->query(idn109); +vc->stackLevel(); +vc->popto(19); +vc->push(); +vc->assertFormula(id109); +vc->push(); +vc->query(id94); +vc->stackLevel(); +vc->popto(20); +vc->push(); +vc->query(idn94); +vc->stackLevel(); +vc->popto(20); +vc->push(); +vc->assertFormula(idn94); +vc->push(); +vc->query(id128); +vc->stackLevel(); +vc->popto(21); +vc->push(); +vc->query(idn128); +vc->stackLevel(); +vc->popto(21); +vc->push(); +vc->assertFormula(idn128); +vc->push(); +vc->query(id92); +vc->stackLevel(); +vc->popto(22); +vc->push(); +vc->query(idn92); +vc->stackLevel(); +vc->popto(22); +vc->push(); +vc->assertFormula(idn92); +vc->push(); +vc->query(id133); +vc->stackLevel(); +vc->popto(23); +vc->push(); +vc->query(idn133); +vc->stackLevel(); +vc->popto(23); +vc->push(); +vc->assertFormula(idn133); +vc->push(); +vc->query(id116); +vc->stackLevel(); +vc->popto(24); +vc->push(); +vc->query(idn116); +vc->stackLevel(); +vc->popto(24); +vc->push(); +vc->assertFormula(id116); +vc->push(); +vc->query(id93); +vc->stackLevel(); +vc->popto(25); +vc->push(); +vc->query(idn93); +vc->stackLevel(); +vc->popto(25); +vc->push(); +vc->assertFormula(idn93); +vc->push(); +vc->query(id176); +vc->stackLevel(); +vc->popto(26); +vc->push(); +vc->query(idn176); +vc->stackLevel(); +vc->popto(26); +vc->push(); +vc->query(id176); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(26); +vc->push(); +vc->query(id136); +vc->stackLevel(); +vc->popto(26); +vc->push(); +vc->query(idn136); +vc->stackLevel(); +vc->popto(26); +vc->push(); +vc->assertFormula(idn136); +vc->push(); +vc->query(id168); +vc->stackLevel(); +vc->popto(27); +vc->push(); +vc->query(idn168); +vc->stackLevel(); +vc->popto(27); +vc->push(); +vc->query(id168); +inconsistency.clear( ); +vc->getAssumptions(inconsistency); +vc->stackLevel(); +vc->popto(27); +inconsistency.clear( ); +vc->push(); +vc->query(idn4); +vc->inconsistent(inconsistency); +vc->pop(); +vc->stackLevel(); +vc->popto(26); +vc->stackLevel(); +vc->popto(25); +vc->stackLevel(); +vc->popto(24); +vc->stackLevel(); +vc->popto(23); +vc->stackLevel(); +vc->popto(22); +vc->stackLevel(); +vc->popto(21); +vc->stackLevel(); +vc->popto(20); +vc->stackLevel(); +vc->popto(19); +vc->stackLevel(); +vc->popto(18); +vc->stackLevel(); +vc->popto(17); +vc->stackLevel(); +vc->popto(16); +vc->stackLevel(); +vc->popto(15); +vc->stackLevel(); +vc->popto(14); +vc->stackLevel(); +vc->popto(13); +vc->stackLevel(); +vc->popto(12); +vc->stackLevel(); +vc->popto(11); +vc->stackLevel(); +vc->popto(10); +vc->stackLevel(); +vc->popto(9); +vc->stackLevel(); +vc->popto(8); +vc->stackLevel(); +vc->popto(7); +vc->stackLevel(); +vc->popto(6); +vc->stackLevel(); +vc->popto(5); +vc->stackLevel(); +vc->popto(4); +vc->stackLevel(); +vc->popto(3); +vc->stackLevel(); +vc->popto(2); +vc->stackLevel(); +vc->popto(1); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in testgeorge5(): \n" << e << endl; + } + delete vc; +} diff --git a/test/system/cvc3_george.h b/test/system/cvc3_george.h new file mode 100644 index 000000000..c904fd0c6 --- /dev/null +++ b/test/system/cvc3_george.h @@ -0,0 +1,24 @@ +/********************* */ +/*! \file cvc3_main.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, 2010, 2011 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 Test of CVC3 compatibility interface + ** + ** This is part of a test of the CVC3 compatibility interface present in + ** CVC4. It is a test copied from CVC3's "test" directory. + **/ + +void testgeorge1(); +void testgeorge2(); +void testgeorge3(); +void testgeorge4(); +void testgeorge5(); diff --git a/test/system/cvc3_main.cpp b/test/system/cvc3_main.cpp new file mode 100644 index 000000000..f72472acc --- /dev/null +++ b/test/system/cvc3_main.cpp @@ -0,0 +1,2182 @@ +/********************* */ +/*! \file cvc3_main.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, 2010, 2011 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 Test of CVC3 compatibility interface + ** + ** This is part of a test of the CVC3 compatibility interface present in + ** CVC4. It is a test copied from CVC3's "test" directory. Only #includes + ** were changed to support this test in CVC4. + ** + ** The original file comment is preserved in the source. + **/ + +/////////////////////////////////////////////////////////////////////////////// +// // +// File: main.cpp // +// Author: Clark Barrett // +// Created: Sat Apr 19 01:47:47 2003 // +// // +/////////////////////////////////////////////////////////////////////////////// + + +#include "compat/cvc3_compat.h" +//#include "vc.h" +//#include "theory_arith.h" // for arith kinds and expressions +//#include "theory_array.h" +#include +#include +#include +#include +//#include "exception.h" +//#include "typecheck_exception.h" +//#include "command_line_flags.h" +//#include "debug.h" +#include "cvc3_george.h" + + +using namespace std; +using namespace CVC3; + + +int exitStatus; + + +// Check whether e is valid +bool check(ValidityChecker* vc, Expr e, bool verbose=true) +{ + if(verbose) { + cout << "Query: "; + vc->printExpr(e); + } + bool res = vc->query(e); + switch (res) { + case false: + if(verbose) cout << "Invalid" << endl << endl; + break; + case true: + if(verbose) cout << "Valid" << endl << endl; + break; + } + return res; +} + + +// Make a new assertion +void newAssertion(ValidityChecker* vc, Expr e) +{ + cout << "Assert: "; + vc->printExpr(e); + vc->assertFormula(e); +} + +int eqExprVecs(const vector& v1, + const vector& v2) { + if( v1.size() != v2.size() ) { + return 0; + } + + for( unsigned int i=0; i < v1.size(); ++i ) { + if( v1[i] != v2[i] ) { + return 0; + } + } + + return 1; +} + +int eqExprVecVecs(const vector > vv1, + const vector > vv2) { + if( vv1.size() != vv2.size() ) { + return 0; + } + + for( unsigned int i=0; i < vv1.size(); ++i ) { + if( !eqExprVecs(vv1[i],vv2[i]) ) { + return 0; + } + } + + return 1; +} + + +void test () +{ + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Type it (vc->intType ()); //int + Op f = vc->createOp("f",vc->funType(it,it)); + Expr z = vc->varExpr("z",it); + Expr e = vc->funExpr(f, vc->funExpr(f, z)); + e = e[0]; + Expr f2 = vc->funExpr(f, e); + Expr f3 = vc->funExpr(f, f2); + + DebugAssert(e != f2 && e != f3, "Refcount problems"); + + Expr x (vc->boundVarExpr ("x", "0", it));//x0:int + vector xs; + xs.push_back (x); // + Op lxsx (vc->lambdaExpr (xs,x)); //\. x0:int + Expr y (vc->ratExpr (1,1)); //1 + vector ys; + ys.push_back (y); //<1> + Expr lxsxy = vc->funExpr (lxsx, y); //(\. x0:int)1 + Expr lxsxys = vc->funExpr (lxsx, ys); //(\. x0:int)<1> + cout << "Lambda application: " << lxsxy << endl; + cout << "Simplified: " << vc->simplify(lxsxy) << endl; + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test (): \n" << e << endl; + } + delete vc; +} + +void test1() +{ + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("dagify-exprs",false); + flags.setFlag("dump-log", ".test1.cvc"); + ValidityChecker* vc = ValidityChecker::create(flags); + + // It is important that all Expr objects are deleted before vc is + // deleted. Therefore, we enclose them in a scope of try{ }catch + // block. + // + // Also, vc methods may throw an Exception, and we want to delete vc + // even in those exceptional cases. + try { + + IF_DEBUG(bool b =) check(vc, vc->trueExpr()); + DebugAssert(b, "Should be valid"); + + vc->push(); + IF_DEBUG(b =) check(vc, vc->falseExpr()); + DebugAssert(!b, "Should be invalid"); + vc->pop(); + + // Check p OR ~p + + Expr p = vc->varExpr("p", vc->boolType()); + Expr e = vc->orExpr(p, vc->notExpr(p)); + + IF_DEBUG(b =) check(vc, e); + DebugAssert(b, "Should be valid"); + + // Check x = y -> f(x) = f(y) + + Expr x = vc->varExpr("x", vc->realType()); + Expr y = vc->varExpr("y", vc->realType()); + + Type real2real = vc->funType(vc->realType(), vc->realType()); + Op f = vc->createOp("f", real2real); + Expr fx = vc->funExpr(f, x); + Expr fy = vc->funExpr(f, y); + + e = vc->impliesExpr(vc->eqExpr(x,y),vc->eqExpr(fx, fy)); + IF_DEBUG(b =) check(vc, e); + DebugAssert(b, "Should be valid"); + + // Check f(x) = f(y) -> x = y + + e = vc->impliesExpr(vc->eqExpr(fx,fy),vc->eqExpr(x, y)); + IF_DEBUG(int scopeLevel = vc->scopeLevel();) + vc->push(); + IF_DEBUG(b =) check(vc, e); + DebugAssert(!b, "Should be invalid"); + + // Get counter-example + + vector assertions; + cout << "Scope level: " << vc->scopeLevel() << endl; + cout << "Counter-example:" << endl; + vc->getCounterExample(assertions); + for (unsigned i = 0; i < assertions.size(); ++i) { + vc->printExpr(assertions[i]); + } + cout << "End of counter-example" << endl << endl; + + // Reset to initial scope + cout << "Resetting" << endl; + vc->pop(); + DebugAssert(scopeLevel == vc->scopeLevel(), "scope error"); + cout << "Scope level: " << vc->scopeLevel() << endl << endl; + + // Check w = x & x = y & y = z & f(x) = f(y) & x = 1 & z = 2 + + Expr w = vc->varExpr("w", vc->realType()); + Expr z = vc->varExpr("z", vc->realType()); + + cout << "Push Scope" << endl << endl; + vc->push(); + + newAssertion(vc, vc->eqExpr(w, x)); + newAssertion(vc, vc->eqExpr(x, y)); + newAssertion(vc, vc->eqExpr(y, z)); + newAssertion(vc, vc->eqExpr(fx, fy)); + newAssertion(vc, vc->eqExpr(x, vc->ratExpr(1))); + + cout << endl << "simplify(w) = "; + vc->printExpr(vc->simplify(w)); + cout << endl; + DebugAssert(vc->simplify(w)==vc->ratExpr(1), "Expected simplify(w) = 1"); + + newAssertion(vc, vc->eqExpr(z, vc->ratExpr(2))); + assertions.clear(); + cout << "Inconsistent?: " << vc->inconsistent(assertions) << endl; + + cout << "Assumptions Used:" << endl; + for (unsigned i = 0; i < assertions.size(); ++i) { + vc->printExpr(assertions[i]); + } + + cout << endl << "Pop Scope" << endl << endl; + vc->pop(); + + cout << "simplify(w) = "; + vc->printExpr(vc->simplify(w)); + DebugAssert(vc->simplify(w)==w, "Expected simplify(w) = w"); + cout << endl; + + assertions.clear(); + cout << "Inconsistent?: " << vc->inconsistent(assertions) << endl; + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test1(): \n" << e << endl; + } + delete vc; +} + + +void test2() +{ + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("dagify-exprs",false); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + + Expr bexpr = vc->varExpr("b", vc->intType()); + vc->assertFormula(vc->ltExpr(bexpr, vc->ratExpr(10))); + + Expr c = vc->varExpr("c", vc->intType()); + vc->assertFormula(c.eqExpr(vc->ratExpr(0)) || c.eqExpr(vc->ratExpr(1))); + + IF_DEBUG(bool b =) check(vc, vc->leExpr(bexpr, vc->ratExpr(10))); + DebugAssert(b, "Should be valid"); + + IF_DEBUG(b =) check(vc, vc->falseExpr()); + DebugAssert(!b, "Should be invalid"); + vc->returnFromCheck(); + + // Check x = y -> g(x,y) = g(y,x) + + Expr x = vc->varExpr("x", vc->realType()); + Expr y = vc->varExpr("y", vc->realType()); + + Type real = vc->realType(); + vector RxR; + RxR.push_back(real); + RxR.push_back(real); + + Type realxreal2real = vc->funType(RxR, real); + Op g = vc->createOp("g", realxreal2real); + + Expr gxy = vc->funExpr(g, x, y); + Expr gyx = vc->funExpr(g, y, x); + + Expr e = vc->impliesExpr(vc->eqExpr(x,y),vc->eqExpr(gxy, gyx)); + IF_DEBUG(b =) check(vc, e); + DebugAssert(b, "Should be valid"); + + Op h = vc->createOp("h", realxreal2real); + + Expr hxy = vc->funExpr(h, x, y); + Expr hyx = vc->funExpr(h, y, x); + + e = vc->impliesExpr(vc->eqExpr(x,y),vc->eqExpr(hxy, hyx)); + IF_DEBUG(b =) check(vc, e); + DebugAssert(b, "Should be valid"); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test2(): \n" << e << endl; + } + + delete vc; +} + + +Expr ltLex(ValidityChecker* vc, Expr i1, Expr i2, Expr j1, Expr j2) +{ + Expr res = vc->ltExpr(i1, j1); + return vc->orExpr(res, vc->andExpr(vc->eqExpr(i1, j1), vc->ltExpr(i2, j2))); +} + + +Expr createTestFormula(ValidityChecker* vc, Expr i1, Expr i2, Expr r1, Expr r2) +{ + Expr lt1 = ltLex(vc, r1, r2, i1, i2); + Expr lt2 = ltLex(vc, i2, i1, r2, r1); + return vc->andExpr(lt1, lt2); +} + + +void test3() +{ + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("dagify-exprs",false); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Expr i = vc->varExpr("i", vc->realType()); + Expr j = vc->varExpr("j", vc->realType()); + Expr k = vc->varExpr("k", vc->realType()); + + Expr one = vc->ratExpr(1); + + cout << "i: " << i.getIndex() << endl; + + Expr test = createTestFormula(vc, i, j, + vc->minusExpr(i, one), vc->minusExpr(j, k)); + + cout << "Trying test: "; + vc->printExpr(test); + cout << endl; + + vc->push(); + bool result = vc->query(test); + if (result) { + cout << "Test Valid" << endl; + vc->pop(); + } + else { + Expr condition; + vector assertions; + unsigned index; + + vc->getCounterExample(assertions); + + cout << "Test Invalid Under Conditions:" << endl; + for (index = 0; index < assertions.size(); ++index) { + vc->printExpr(assertions[index]); + } + + // Try assertions one by one + for (index = 0; index < assertions.size(); ++index) { + condition = vc->notExpr(assertions[index]); + cout << "Trying test under condition: "; + vc->printExpr(condition); + cout << endl; + vc->pop(); + vc->push(); + result = vc->query(vc->impliesExpr(condition, test)); + if (result) { + cout << "Result Valid" << endl; + break; + } + else { + cout << "Result Invalid" << endl; + } + } + } + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test3(): \n" << e << endl; + } + delete vc; +} + + +void test4() +{ + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("dagify-exprs",false); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Expr i = vc->varExpr("i", vc->realType()); + Expr j = vc->varExpr("j", vc->realType()); + Expr k = vc->varExpr("k", vc->realType()); + + Expr one = vc->ratExpr(1); + + cout << "i: " << i.getIndex() << endl; + + Expr test = createTestFormula(vc, i, j, + vc->minusExpr(i, one), vc->minusExpr(j, k)); + + cout << "Trying test: "; + vc->printExpr(test); + cout << endl; + + vc->push(); + bool result = vc->query(test); + if (result) { + cout << "Test Valid" << endl; + } + else { + Expr condition; + vector assertions; + unsigned index; + + vc->getCounterExample(assertions); + + cout << "Test Invalid Under Conditions:" << endl; + for (index = 0; index < assertions.size(); ++index) { + vc->printExpr(assertions[index]); + } + + // Try assertions one by one + for (index = 0; index < assertions.size(); ++index) { + condition = vc->notExpr(assertions[index]); + cout << "Trying test under condition: "; + vc->printExpr(condition); + cout << endl; + vc->pop(); + vc->push(); + result = vc->query(vc->impliesExpr(condition, test)); + if (result) { + cout << "Result Valid" << endl; + break; + } + else { + cout << "Result Invalid" << endl; + } + } + } + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test4(): \n" << e << endl; + } + delete vc; +} + + +void findLeaves(Expr e, vector& l) +{ + int ar = e.arity(); + if (ar > 0) { + for (int i = 0; i < ar; ++i) + findLeaves(e[i], l); + return; + } + l.push_back(e); +} + + +bool hasij(Expr e, Expr i, Expr j) +{ + int ar = e.arity(); + if (ar > 0) { + for (int k = 0; k < ar; ++k) + if (hasij(e[k], i, j)) return true; + return false; + } + if (e == i || e == j) return true; + return false; +} + + +Expr plusExpr(ValidityChecker* vc, vector& kids) +{ + if (kids.size() == 0) return vc->ratExpr(0); + else if (kids.size() == 1) return kids[0]; + else if (kids.size() == 2) return vc->plusExpr(kids[0], kids[1]); + else { + Expr r = kids.back(); + kids.pop_back(); + return vc->plusExpr(plusExpr(vc, kids), r); + } +} + + +void test5() +{ + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("dagify-exprs",false); + flags.setFlag("dump-log", ".test5.cvc"); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Expr i = vc->varExpr("i1", vc->realType()); + Expr j = vc->varExpr("i2", vc->realType()); + Expr p = vc->varExpr("p", vc->realType()); + Expr q = vc->varExpr("q", vc->realType()); + Expr r = vc->varExpr("r", vc->realType()); + Expr a = vc->varExpr("arb_addr", vc->realType()); + Expr N = vc->varExpr("N", vc->realType()); + + Expr M = vc->varExpr("M", vc->arrayType(vc->realType(), vc->realType())); + + Expr M2 = vc->writeExpr(M, vc->plusExpr(q, i), vc->readExpr(M, vc->plusExpr(r, i))); + + Expr M1 = vc->writeExpr(M, vc->plusExpr(p, j), vc->readExpr(M, vc->plusExpr(r, j))); + + Expr e = vc->eqExpr(vc->readExpr(vc->writeExpr(M2, vc->plusExpr(p, j), vc->readExpr(M2, vc->plusExpr(r, j))), a), + vc->readExpr(vc->writeExpr(M1, vc->plusExpr(q, i), vc->readExpr(M1, vc->plusExpr(r, i))), a)); + + Expr one = vc->ratExpr(1); + Expr zero = vc->ratExpr(0); + + Expr qmp = vc->minusExpr(q, p); + Expr qmr = vc->minusExpr(q, r); + + vector hyp; + hyp.push_back(vc->ltExpr(i, j)); +// hyp.push_back(vc->orExpr(vc->geExpr(qmp, N), vc->leExpr(qmp, zero))); +// hyp.push_back(vc->orExpr(vc->geExpr(qmr, N), vc->leExpr(qmr, zero))); + + Expr test = vc->impliesExpr(vc->andExpr(hyp), e); + Expr query; + + cout << "Checking verification condition:" << endl; + vc->printExpr(test); + cout << endl; + + vc->push(); + bool result = vc->query(test); + if (result) { + cout << "Valid" << endl; + } + else { + vector conditions; + vector assertions; + unsigned index, index2; + int req; + vector leaves; + + vc->getCounterExample(assertions); + + cout << "Invalid Under Conditions:" << endl; + for (index = 0; index < assertions.size(); ++index) { + if (assertions[index] == (!test)) { + for (; index < assertions.size()-1; ++index) { + assertions[index] = assertions[index+1]; + } + assertions.pop_back(); + break; + } + } + for (index = 0; index < assertions.size(); ++index) { + vc->printExpr(assertions[index]); + } + + cout << endl; + + // Try assertions one by one + for (index = 0; index < assertions.size(); ++index) { + e = assertions[index]; + + // Check condition for eligibility + if (e.isNot()) { + cout << "Condition ineligible: negation" << endl; + vc->printExpr(e); + cout << endl; + continue; + } + if (e.isEq()) { + req = 2; + } + else req = 1; + + leaves.clear(); + findLeaves(e, leaves); + for (index2 = 0; index2 < leaves.size(); ++index2) { + if (!leaves[index2].isVar() || + leaves[index2] == i || + leaves[index2] == j || + leaves[index2] == a) + continue; + req--; + } + if (req > 0) { + cout << "Condition ineligible: not enough non-loop variables" << endl; + vc->printExpr(e); + cout << endl; + continue; + } + + cout << "Condition selected:" << endl; + vc->printExpr(e); + cout << endl << endl; + + conditions.push_back(vc->notExpr(e)); + cout << "Trying verification condition with hypothesis:" << endl; + vc->printExpr(vc->andExpr(conditions)); + cout << endl; + vc->pop(); + vc->push(); + query = vc->impliesExpr(vc->andExpr(conditions), test); + result = vc->query(query); + if (result) { + cout << "Result Valid" << endl; + break; + } + else { + assertions.clear(); + vc->getCounterExample(assertions); + + cout << "Invalid Under Conditions:" << endl; + for (index2 = 0; index2 < assertions.size(); ++index2) { + if (assertions[index2] == (!query)) { + for (; index2 < assertions.size()-1; ++index2) { + assertions[index2] = assertions[index2+1]; + } + assertions.pop_back(); + break; + } + } + + for (index2 = 0; index2 < assertions.size(); ++index2) { + vc->printExpr(assertions[index2]); + } + cout << endl; + index = (unsigned)-1; + } + } + + cout << endl << "Attempting to remove loop variables" << endl; + // replace loop variables in conditions + vector newConditions; + vector newPlus; + bool foundi, foundj, negi, negj; + Expr minusone = vc->ratExpr(-1); + for (index = 0; index < conditions.size(); ++index) { + if (conditions[index][0].isEq()) { + e = vc->simplify(vc->minusExpr(conditions[index][0][0], conditions[index][0][1])); + if (hasij(e, i, j)) { + if (e.getKind() == CVC3::PLUS) { + newPlus.clear(); + newPlus.push_back(e[0]); + foundi = foundj = negi = negj = false; + for (index2 = 1; index2 < (unsigned)e.arity(); index2++) { + Expr term = e[index2]; + if (term == i && !foundi) foundi = true; + else if (term == j && !foundj) { + foundj = true; + negj = true; + } + else if (term.getKind() == CVC3::MULT && term[0] == minusone && term[1] == i && !foundi) { + foundi = true; + negi = true; + } + else if (term.getKind() == CVC3::MULT && term[0] == minusone && term[1] == j && !foundj) foundj = true; + else newPlus.push_back(term); + } + if (foundi && foundj && ((negi && negj) || (!negi && !negj))) { + e = plusExpr(vc, newPlus); + if (negi && negj) e = vc->uminusExpr(e); + e = vc->simplify(e); + if (!hasij(e, i, j)) { + newConditions.push_back(vc->orExpr(vc->geExpr(e, N), vc->leExpr(e, zero))); + continue; + } + } + } + cout << "Unable to remove loop variables:" << endl; + vc->printExpr(e); + break; + } + } + newConditions.push_back(conditions[index]); + } + if (index == conditions.size()) { + cout << "Loop variables successfully removed:" << endl; + Expr cond = (newConditions.size()>0)? + vc->andExpr(newConditions) : vc->trueExpr(); + vc->printExpr(cond); + cout << endl; + + vector loopConditions; + loopConditions.push_back(cond); + loopConditions.push_back(vc->geExpr(i, one)); + loopConditions.push_back(vc->geExpr(j, one)); + loopConditions.push_back(vc->leExpr(i, N)); + loopConditions.push_back(vc->leExpr(j, N)); + vc->pop(); + vc->push(); + cout << "Final query" << endl; + result = vc->query(vc->impliesExpr(vc->andExpr(loopConditions), test)); + if (result) { + cout << "Result Valid" << endl; + } + else { + cout << "Result Invalid" << endl; + } + } + } + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test5(): \n" << e << endl; + } + delete vc; +} + +//#include "debug.h" + +// Test importing of Exprs from a different validity checker +void test6() { + ValidityChecker* vc1 = ValidityChecker::create(); + ValidityChecker* vc2 = ValidityChecker::create(); + + try { + Type real1 = vc1->realType(); + + Expr x1 = vc1->varExpr("x", real1); + Expr y1 = vc1->boundVarExpr("y", "0", real1); + + cout << "vc1 variables: " << x1 << ", " << y1 << endl; + + Expr x2 = vc2->varExpr("x", vc2->importType(real1)); + Expr y2 = vc2->boundVarExpr("y", "0", vc2->realType()); + + cout << "vc2 variables: " << x2 << ", " << y2 << endl; + cout << "vars imported to vc2 from vc1: " + << vc2->importExpr(x1) << ", " << vc2->importExpr(y1) << endl; + Expr t1 = vc1->trueExpr(); + Expr and1 = vc1->andExpr(t1, vc1->falseExpr()); + Op f1 = vc1->createOp("f", vc1->funType(real1, real1)); + Expr fx1 = vc1->funExpr(f1, x1); + Expr f5_1 = vc1->funExpr(f1, vc1->ratExpr(5,1)); + Type rt1 = vc1->recordType("foo", real1, "bar", real1); + Expr r1 = vc1->recordExpr("foo", fx1, "bar", f5_1); + Expr r1_eq = vc1->eqExpr(r1, vc1->recUpdateExpr(r1, "foo", f5_1)); + Type art1 = vc1->arrayType(real1, rt1); + Expr ar1 = vc1->varExpr("ar", art1); + Expr ar_eq1 = vc1->eqExpr(vc1->writeExpr(ar1, x1, r1), ar1); + Expr query1 = vc1->eqExpr(vc1->recSelectExpr(vc1->readExpr(ar1, x1), "foo"), + vc1->recSelectExpr(r1, "bar")); + + cout << "*** VC #1:" << endl; + newAssertion(vc1, r1_eq); + newAssertion(vc1, ar_eq1); + check(vc1, query1); + + cout << "*** VC #2:" << endl; + newAssertion(vc2, vc2->importExpr(r1_eq)); + newAssertion(vc2, vc2->importExpr(ar_eq1)); + check(vc2, vc2->importExpr(query1)); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test6(): \n" << e << endl; + } + delete vc1; + delete vc2; +} + + +void test7() { + ValidityChecker* vc1 = ValidityChecker::create(); + ValidityChecker* vc2 = ValidityChecker::create(); + try { + Expr e1 = vc1->varExpr("e1", vc1->realType()); + Expr e2 = vc2->varExpr("e2", vc2->realType()); + newAssertion(vc2, vc2->eqExpr(vc2->importExpr(e1), e2)); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test7(): \n" << e << endl; + } + delete vc1; + delete vc2; +} + + +void test8() { + ValidityChecker* vc = ValidityChecker::create(); + try { + vector vec; + vec.push_back(vc->boundVarExpr("x", "x", vc->realType())); + Expr lambda = vc->lambdaExpr(vec, vc->falseExpr());//.getExpr(); + Expr witness; + try { + Type t = vc->subtypeType(lambda, witness); + DebugAssert(false, "Typechecking exception expected"); + } catch(const TypecheckException&) { + // fall through + } + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test8(): \n" << e << endl; + } + delete vc; +} + + +Expr adder(ValidityChecker* vc, const Expr& a, const Expr& b, const Expr& c) +{ + return vc->notExpr(vc->iffExpr(vc->notExpr(vc->iffExpr(a,b)),c)); +} + + +Expr carry(ValidityChecker* vc, const Expr& a, const Expr& b, const Expr& c) +{ + return vc->orExpr(vc->andExpr(a,b), vc->orExpr(vc->andExpr(b,c),vc->andExpr(a,c))); +} + + +void add(ValidityChecker* vc, vector a, vector b, vector& sum) +{ + int i,N=a.size(); + Expr c = vc->falseExpr(); + + for (i=0; i < N; i++) + { + sum.push_back(adder(vc,a[i],b[i],c)); + c = carry(vc,a[i],b[i],c); + } +} + + +Expr vectorEq(ValidityChecker* vc, vector a, vector b) +{ + int i, N=a.size(); + Expr result = vc->trueExpr(); + + for (i=0; i < N; i++) { + result = result && a[i].iffExpr(b[i]); + } + return result; +} + + +void test9(int N) { + CLFlags flags = ValidityChecker::createFlags(); + // flags.setFlag("proofs",true); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + int i; + vector a,b,sum1,sum2; + + for (i=0; i < N; i++) { + a.push_back(vc->varExpr("a" + int2string(i), vc->boolType())); + b.push_back(vc->varExpr("b" + int2string(i), vc->boolType())); + } + + add(vc,a,b,sum1); + add(vc,b,a,sum2); + + Expr q = vectorEq(vc,sum1,sum2); + + check(vc, q); + + // Proof p = vc->getProof(); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test9(): \n" << e << endl; + } + delete vc; +} + + +Expr bvadder(ValidityChecker* vc, const Expr& a, const Expr& b, const Expr& c) +{ + return vc->newBVXorExpr(a, vc->newBVXorExpr(b, c)); +} + + +Expr bvcarry(ValidityChecker* vc, const Expr& a, const Expr& b, const Expr& c) +{ + return vc->newBVOrExpr(vc->newBVAndExpr(a,b), vc->newBVOrExpr(vc->newBVAndExpr(b,c),vc->newBVAndExpr(a,c))); +} + + +void bvadd(ValidityChecker* vc, vector a, vector b, vector& sum) +{ + int i,N=a.size(); + Expr c = vc->newBVConstExpr(Rational(0), 1); + + for (i=0; i < N; i++) + { + sum.push_back(bvadder(vc,a[i],b[i],c)); + c = bvcarry(vc,a[i],b[i],c); + } +} + + +Expr bvvectorEq(ValidityChecker* vc, vector a, vector b) +{ + int i, N=a.size(); + Expr result = vc->newBVConstExpr(string("1")); + + for (i=0; i < N; i++) { + result = vc->newBVAndExpr(result, vc->newBVXnorExpr(a[i], b[i])); + } + return result; +} + + +void bvtest9(int N) { + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + int i; + vector avec,bvec,sum1vec,sum2; + + Expr a, b, sum1; + a = vc->varExpr("a", vc->bitvecType(N)); + b = vc->varExpr("b", vc->bitvecType(N)); + vector kids; + kids.push_back(a); + kids.push_back(b); + sum1 = vc->newBVPlusExpr(N, kids); + + for (i=0; i < N; i++) { + avec.push_back(vc->newBVExtractExpr(a, i, i)); + bvec.push_back(vc->newBVExtractExpr(b, i, i)); + sum1vec.push_back(vc->newBVExtractExpr(sum1, i, i)); + } + + bvadd(vc,avec,bvec,sum2); + + Expr q = bvvectorEq(vc,sum1vec,sum2); + + check(vc, vc->eqExpr(q,vc->newBVConstExpr(string("1")))); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in bvtest9(): \n" << e << endl; + } + delete vc; +} + + +// Test for memory leaks (run silently) +void test10() +{ + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + // Create all expressions in a separate scope, so that they are + // destroyed before vc is deleted. + + try { + // Check x = y -> g(x,y) = g(y,x) + + Expr x = vc->varExpr("x", vc->realType()); + Expr y = vc->varExpr("y", vc->realType()); + + Type real = vc->realType(); + vector RxR; + RxR.push_back(real); + RxR.push_back(real); + + Type realxreal2real = vc->funType(RxR, real); + Op g = vc->createOp("g", realxreal2real); + + Expr gxy = vc->funExpr(g, x, y); + Expr gyx = vc->funExpr(g, y, x); + + Expr e = vc->impliesExpr(vc->eqExpr(x,y),vc->eqExpr(gxy, gyx)); + check(vc, e, false); + + Op h = vc->createOp("h", realxreal2real); + + Expr hxy = vc->funExpr(h, x, y); + Expr hyx = vc->funExpr(h, y, x); + + e = vc->impliesExpr(vc->eqExpr(x,y),vc->eqExpr(hxy, hyx)); + check(vc, e, false); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test10(): \n" << e << endl; + } + // Make sure all Expr's are deleted first + delete vc; +} + +unsigned int printImpliedLiterals(ValidityChecker* vc) +{ + unsigned int count = 0; + cout << "Implied Literals:" << endl; + Expr impLit = vc->getImpliedLiteral(); + while (!impLit.isNull()) { + ++count; + vc->printExpr(impLit); + impLit = vc->getImpliedLiteral(); + } + return count; +} + + +void test11() +{ + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Expr x = vc->varExpr("x", vc->realType()); + Expr y = vc->varExpr("y", vc->realType()); + Expr z = vc->varExpr("z", vc->realType()); + + Type real = vc->realType(); + Type real2real = vc->funType(real, real); + Type real2bool = vc->funType(real, vc->boolType()); + Op f = vc->createOp("f", real2real); + Op p = vc->createOp("p", real2bool); + + Expr fx = vc->funExpr(f, x); + Expr fy = vc->funExpr(f, y); + + Expr px = vc->funExpr(p, x); + Expr py = vc->funExpr(p, y); + + Expr xeqy = vc->eqExpr(x, y); + Expr yeqx = vc->eqExpr(y, x); + Expr xeqz = vc->eqExpr(x, z); + Expr zeqx = vc->eqExpr(z, x); + Expr yeqz = vc->eqExpr(y, z); + Expr zeqy = vc->eqExpr(z, y); + + unsigned int c; + + vc->registerAtom(vc->eqExpr(x,vc->ratExpr(0,1))); + vc->registerAtom(xeqy); + vc->registerAtom(yeqx); + vc->registerAtom(xeqz); + vc->registerAtom(zeqx); + vc->registerAtom(yeqz); + vc->registerAtom(zeqy); + vc->registerAtom(px); + vc->registerAtom(py); + vc->registerAtom(vc->eqExpr(fx, fy)); + + cout << "Push" << endl; + vc->push(); + + cout << "Assert x = y" << endl; + vc->assertFormula(xeqy); + c = printImpliedLiterals(vc); + DebugAssert(c==3,"Implied literal error 0"); + + cout << "Push" << endl; + vc->push(); + cout << "Assert x /= z" << endl; + vc->assertFormula(!xeqz); + c = printImpliedLiterals(vc); + DebugAssert(c==4,"Implied literal error 1"); + cout << "Pop" << endl; + vc->pop(); + + cout << "Push" << endl; + vc->push(); + cout << "Assert y /= z" << endl; + vc->assertFormula(!yeqz); + c = printImpliedLiterals(vc); + DebugAssert(c==4,"Implied literal error 2"); + cout << "Pop" << endl; + vc->pop(); + + cout << "Push" << endl; + vc->push(); + cout << "Assert p(x)" << endl; + vc->assertFormula(px); + c = printImpliedLiterals(vc); + DebugAssert(c==2,"Implied literal error 3"); + cout << "Pop" << endl; + vc->pop(); + + cout << "Push" << endl; + vc->push(); + cout << "Assert p(y)" << endl; + vc->assertFormula(py); + c = printImpliedLiterals(vc); + DebugAssert(c==2,"Implied literal error 4"); + cout << "Pop" << endl; + vc->pop(); + + cout << "Pop" << endl; + vc->pop(); + + cout << "Push" << endl; + vc->push(); + cout << "Assert y = x" << endl; + vc->assertFormula(yeqx); + c = printImpliedLiterals(vc); + DebugAssert(c==3,"Implied literal error 5"); + cout << "Pop" << endl; + vc->pop(); + + cout << "Push" << endl; + vc->push(); + cout << "Assert p(x)" << endl; + vc->assertFormula(px); + c = printImpliedLiterals(vc); + DebugAssert(c==1,"Implied literal error 6"); + cout << "Assert x = y" << endl; + vc->assertFormula(xeqy); + c = printImpliedLiterals(vc); + DebugAssert(c==4,"Implied literal error 7"); + cout << "Pop" << endl; + vc->pop(); + + cout << "Push" << endl; + vc->push(); + cout << "Assert NOT p(x)" << endl; + vc->assertFormula(!px); + c = printImpliedLiterals(vc); + DebugAssert(c==1,"Implied literal error 8"); + cout << "Assert x = y" << endl; + vc->assertFormula(xeqy); + c = printImpliedLiterals(vc); + DebugAssert(c==4,"Implied literal error 9"); + cout << "Pop" << endl; + vc->pop(); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test11(): \n" << e << endl; + } + delete vc; +} + + +void test12() +{ + ValidityChecker * vc = ValidityChecker::create( ); + try { + Type realType = vc->realType(); + Type intType = vc->intType(); + Type boolType = vc->boolType(); + vc -> push(); + int initial_layer = vc->stackLevel(); + IF_DEBUG(int initial_scope =) vc->scopeLevel(); + Expr exprObj_trueID = vc->trueExpr(); + Expr exprObj_falseID = vc->notExpr(vc->trueExpr()); + vc->popto(initial_layer); + DebugAssert(vc->scopeLevel() == initial_scope, "Expected no change"); + DebugAssert(vc->stackLevel() == initial_layer, "Expected no change"); + // TODO: what happens if we push and then popscope? + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test12(): \n" << e << endl; + } + delete vc; +} + + +void test13() +{ + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("dagify-exprs", false); + flags.setFlag("dump-log", ".test13.cvc"); + ValidityChecker* vc = ValidityChecker::create(flags); + try { + Expr rat_one = vc->ratExpr(1); + Expr rat_two = vc->ratExpr(2); + Expr rat_minus_one = vc->ratExpr(-1); + + bool query_result; + query_result = vc->query(vc->eqExpr(rat_two,rat_one)); + cout << "2=1 " << query_result << endl; + query_result = vc->query(vc->eqExpr(rat_two,rat_minus_one)); + cout << "2=-1 " << query_result << endl; + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test13(): \n" << e << endl; + } + delete vc; +} + + +Expr func1(ValidityChecker *vc) { + // local Expr 'tmp' + Expr tmp = vc->varExpr("tmp", vc->boolType()); + return vc->trueExpr(); +} + + +void test14() { + ValidityChecker *vc = ValidityChecker::create(); + try { + // func call: ok + Expr test1 = func1(vc); + + // func call: fail + Expr test2 = func1(vc); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test14(): \n" << e << endl; + } + delete vc; +} + + +void test15() { + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("dagify-exprs", false); + ValidityChecker *vc = ValidityChecker::create(flags); + try { + + /***************************************************** + * array declaration * + *****************************************************/ + + // array: index type + Type index_type = vc->subrangeType(vc->ratExpr(0), + vc->ratExpr(3)); + // array: data type + Type data_type = vc->subrangeType(vc->ratExpr(0), + vc->ratExpr(3)); + // array type: [0 .. 3] of 0 .. 3 + Type array_type = vc->arrayType(index_type, data_type); + Expr arr = vc->varExpr("array", array_type); + + // array: [1,1,0,0] + arr = vc->writeExpr(arr, vc->ratExpr(0), vc->ratExpr(1)); + arr = vc->writeExpr(arr, vc->ratExpr(1), vc->ratExpr(1)); + arr = vc->writeExpr(arr, vc->ratExpr(2), vc->ratExpr(0)); + arr = vc->writeExpr(arr, vc->ratExpr(3), vc->ratExpr(0)); + + + + /***************************************************** + * forall Expr * + *****************************************************/ + + // for loop: index + Expr id = vc->boundVarExpr("id", "0", vc->subrangeType(vc->ratExpr(0), + vc->ratExpr(2))); + vector vars; + vars.push_back(id); + + // for loop: body + Expr for_body = vc->leExpr(vc->readExpr(arr, id), + vc->readExpr(arr, vc->plusExpr(id, vc->ratExpr(1)))); + // forall expr + Expr forall_expr = vc->forallExpr(vars, for_body); + + vc->push(); + check(vc, forall_expr); + + vector assertions; + cout << "Scope level: " << vc->scopeLevel() << endl; + cout << "Counter-example:" << endl; + vc->getCounterExample(assertions); + for (unsigned i = 0; i < assertions.size(); ++i) { + vc->printExpr(assertions[i]); + } + cout << "End of counter-example" << endl << endl; + vc->pop(); + + /***************************************************** + * manual expansion * + *****************************************************/ + + Expr e1 = vc->leExpr(vc->readExpr(arr, vc->ratExpr(0)), + vc->readExpr(arr, vc->ratExpr(1))); + Expr e2 = vc->leExpr(vc->readExpr(arr, vc->ratExpr(1)), + vc->readExpr(arr, vc->ratExpr(2))); + Expr e3 = vc->leExpr(vc->readExpr(arr, vc->ratExpr(2)), + vc->readExpr(arr, vc->ratExpr(3))); + Expr manual_expr = vc->andExpr(e1, vc->andExpr(e2, e3)); + + + + /***************************************************** + * exists Expr * + *****************************************************/ + + // exists: index + Expr id_ex = vc->varExpr("id_ex", vc->subrangeType(vc->ratExpr(0), + vc->ratExpr(2))); + vector vars_ex; + vars_ex.push_back(id_ex); + + // exists: body + Expr ex_body = vc->gtExpr(vc->readExpr(arr, id_ex), + vc->readExpr(arr, vc->plusExpr(id_ex, vc->ratExpr(1)))); + // exists expr + Expr ex_expr = vc->existsExpr(vars_ex, ex_body); + + + + + /***************************************************** + * ??? forall <==> manual expansion * + *****************************************************/ + + cout << endl << "Checking forallExpr <==> manual expansion ..." << endl; + if (vc->query(vc->iffExpr(forall_expr, manual_expr))) + cout << " -- yes." << endl; + else { + cout << " -- no, with counter examples as " << endl; + + vector assert1; + vc->getCounterExample(assert1); + for (unsigned int i = 0; i < assert1.size(); i ++) + vc->printExpr(assert1[i]); + + } + cout << endl; + + + + /***************************************************** + * ??? !forall <==> existsExpr * + *****************************************************/ + cout << endl << "Checking !forallExpr <==> existsExpr ..." << endl; + if (vc->query(vc->iffExpr(vc->notExpr(forall_expr), ex_expr))) + cout << " -- yes." << endl; + else if (vc->incomplete()) { + cout << " -- incomplete:" << endl; + vector reasons; + vc->incomplete(reasons); + for (unsigned int i = 0; i < reasons.size(); ++i) + cout << reasons[i] << endl; + } + else { + cout << " -- no, with counter examples as " << endl; + + vector assert2; + vc->getCounterExample(assert2); + for (unsigned int i = 0; i < assert2.size(); i ++) + vc->printExpr(assert2[i]); + } + + cout << endl << "End of testcases." << endl << endl; + + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test15(): \n" << e << endl; + } + delete vc; +} + + +void test16() { + ValidityChecker *vc = ValidityChecker::create(); + try { + Type zto100 = vc->subrangeType(vc->ratExpr(0), vc->ratExpr(100)); + Expr mem = vc->varExpr("mem", vc->arrayType(zto100, vc->intType())); + Expr a = vc->varExpr("a", zto100); + Expr b = vc->varExpr("b", zto100); + + Expr lhs = vc->readExpr(vc->writeExpr(mem, a, vc->ratExpr(30)), b); + Expr rhs = vc->readExpr(vc->writeExpr(mem, b, vc->ratExpr(40)), a); + + Expr q = vc->impliesExpr(vc->notExpr(vc->eqExpr(a, b)), vc->eqExpr(lhs, rhs)); + + check(vc, q); + + vector assertions; + cout << "Scope level: " << vc->scopeLevel() << endl; + cout << "Counter-example:" << endl; + vc->getCounterExample(assertions); + DebugAssert(assertions.size() > 0, "Expected non-empty counter-example"); + for (unsigned i = 0; i < assertions.size(); ++i) { + vc->printExpr(assertions[i]); + } + cout << "End of counter-example" << endl << endl; + + ExprMap m; + vc->getConcreteModel(m); + ExprMap::iterator it = m.begin(), end = m.end(); + if(it == end) + cout << " Did not find concrete model for any vars" << endl; + else { + cout << "%Satisfiable Variable Assignment: % \n"; + for(; it!= end; it++) { + Expr eq; + if(it->first.getType().isBool()) { + DebugAssert((it->second).isBoolConst(), + "Bad variable assignement: e = "+(it->first).toString() + +"\n\n val = "+(it->second).toString()); + if((it->second).isTrue()) + eq = it->first; + else + eq = !(it->first); + } + else + eq = (it->first).eqExpr(it->second); + //cout << Expr(ASSERT, eq) << "\n"; + } + } + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test16(): \n" << e << endl; + } + delete vc; +} + + +void test17() { + ValidityChecker *vc = ValidityChecker::create(); + try { + try { + vector selectors; + vector types; + + selectors.push_back("car"); + types.push_back(vc->intType().getExpr()); + selectors.push_back("cdr"); + types.push_back(vc->stringExpr("list")); + + Type badList = vc->dataType("list", "cons", selectors, types); + DebugAssert(false, "Typechecking exception expected"); + } catch(const TypecheckException&) { + // fall through + } + delete vc; + vc = ValidityChecker::create(); + { + vector constructors; + vector > selectors(2); + vector > types(2); + + constructors.push_back("cons"); + selectors[0].push_back("car"); + types[0].push_back(vc->intType().getExpr()); + selectors[0].push_back("cdr"); + types[0].push_back(vc->stringExpr("list")); + constructors.push_back("null"); + + Type list = vc->dataType("list", constructors, selectors, types); + + Expr x = vc->varExpr("x", vc->intType()); + Expr y = vc->varExpr("y", list); + + vector args; + args.push_back(x); + args.push_back(y); + Expr cons = vc->datatypeConsExpr("cons", args); + + Expr sel = vc->datatypeSelExpr("car", cons); + IF_DEBUG(bool b =) check(vc, vc->eqExpr(sel, x)); + DebugAssert(b, "Should be valid"); + + } + delete vc; + vc = ValidityChecker::create(); + try { + vector names; + vector > constructors(2); + vector > > selectors(2); + vector > > types(2); + vector returnTypes; + + names.push_back("list1"); + + selectors[0].resize(1); + types[0].resize(1); + constructors[0].push_back("cons1"); + selectors[0][0].push_back("car1"); + types[0][0].push_back(vc->intType().getExpr()); + selectors[0][0].push_back("cdr1"); + types[0][0].push_back(vc->stringExpr("list2")); + + names.push_back("list2"); + + selectors[1].resize(1); + types[1].resize(1); + constructors[1].push_back("cons2"); + selectors[0][0].push_back("car2"); + types[0][0].push_back(vc->intType().getExpr()); + selectors[0][0].push_back("cdr2"); + types[0][0].push_back(vc->stringExpr("list1")); + + vc->dataType(names, constructors, selectors, types, returnTypes); + DebugAssert(false, "Typechecking exception expected"); + } catch(const TypecheckException&) { + // fall through + } + delete vc; + vc = ValidityChecker::create(); + { + vector names; + vector > constructors(2); + vector > > selectors(2); + vector > > types(2); + vector returnTypes; + + names.push_back("list1"); + + selectors[0].resize(1); + types[0].resize(1); + constructors[0].push_back("cons1"); + selectors[0][0].push_back("car1"); + types[0][0].push_back(vc->intType().getExpr()); + selectors[0][0].push_back("cdr1"); + types[0][0].push_back(vc->stringExpr("list2")); + + names.push_back("list2"); + + selectors[1].resize(2); + types[1].resize(2); + constructors[1].push_back("cons2"); + selectors[1][0].push_back("car2"); + types[1][0].push_back(vc->intType().getExpr()); + selectors[1][0].push_back("cdr2"); + types[1][0].push_back(vc->stringExpr("list1")); + constructors[1].push_back("null"); + + vc->dataType(names, constructors, selectors, types, returnTypes); + + Type list1 = returnTypes[0]; + Type list2 = returnTypes[1]; + + Expr x = vc->varExpr("x", vc->intType()); + Expr y = vc->varExpr("y", list2); + Expr z = vc->varExpr("z", list1); + + vector args; + args.push_back(x); + args.push_back(y); + Expr cons1 = vc->datatypeConsExpr("cons1", args); + + Expr isnull = vc->datatypeTestExpr("null", y); + Expr hyp = vc->andExpr(vc->eqExpr(z, cons1), isnull); + + args.clear(); + Expr null = vc->datatypeConsExpr("null", args); + + args.push_back(x); + args.push_back(null); + Expr cons1_2 = vc->datatypeConsExpr("cons1", args); + + IF_DEBUG(bool b =) check(vc, vc->impliesExpr(hyp, vc->eqExpr(z, cons1_2))); + DebugAssert(b, "Should be valid"); + + } + delete vc; + vc = ValidityChecker::create(); + { + vector constructors; + vector > selectors(2); + vector > types(2); + + constructors.push_back("A"); + constructors.push_back("B"); + + Type two = vc->dataType("two", constructors, selectors, types); + + Expr x = vc->varExpr("x", two); + Expr y = vc->varExpr("y", two); + Expr z = vc->varExpr("z", two); + + vector args; + args.push_back(!vc->eqExpr(x,y)); + args.push_back(!vc->eqExpr(y,z)); + args.push_back(!vc->eqExpr(x,z)); + + IF_DEBUG(bool b =) check(vc, !vc->andExpr(args)); + DebugAssert(b, "Should be valid"); + + } + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test17(): \n" << e << endl; + } + delete vc; +} + + +void test18() +{ + CLFlags flags = ValidityChecker::createFlags(); + flags.setFlag("tcc", true); + ValidityChecker *vc = ValidityChecker::create(flags); + try { + vector names; + vector > constructors(3); + vector > > selectors(3); + vector > > types(3); + vector returnTypes; + + names.push_back("nat"); + + selectors[0].resize(2); + types[0].resize(2); + constructors[0].push_back("zero"); + constructors[0].push_back("succ"); + selectors[0][1].push_back("pred"); + types[0][1].push_back(vc->stringExpr("nat")); + + names.push_back("list"); + + selectors[1].resize(2); + types[1].resize(2); + constructors[1].push_back("cons"); + selectors[1][0].push_back("car"); + types[1][0].push_back(vc->stringExpr("tree")); + selectors[1][0].push_back("cdr"); + types[1][0].push_back(vc->stringExpr("list")); + constructors[1].push_back("null"); + + names.push_back("tree"); + + selectors[2].resize(2); + types[2].resize(2); + constructors[2].push_back("leaf"); + constructors[2].push_back("node"); + selectors[2][1].push_back("data"); + types[2][1].push_back(vc->stringExpr("nat")); + selectors[2][1].push_back("children"); + types[2][1].push_back(vc->stringExpr("list")); + + vc->dataType(names, constructors, selectors, types, returnTypes); + + Type nat = returnTypes[0]; + Type listType = returnTypes[1]; + Type tree = returnTypes[2]; + + Expr x = vc->varExpr("x", nat); + + vector args; + Expr zero = vc->datatypeConsExpr("zero", args); + Expr null = vc->datatypeConsExpr("null", args); + Expr leaf = vc->datatypeConsExpr("leaf", args); + + vc->push(); + try { + check(vc, vc->notExpr(vc->eqExpr(zero, null))); + DebugAssert(false, "Should have caught tcc exception"); + } catch(const TypecheckException&) { } + + vc->pop(); + args.push_back(vc->datatypeSelExpr("pred",x)); + Expr spx = vc->datatypeConsExpr("succ", args); + Expr spxeqx = vc->eqExpr(spx, x); + vc->push(); + try { + check(vc, spxeqx); + DebugAssert(false, "Should have caught tcc exception"); + } catch(const TypecheckException&) { } + + vc->pop(); + bool b = check(vc, vc->impliesExpr(vc->datatypeTestExpr("succ", x), spxeqx)); + DebugAssert(b, "Should be valid"); + + b = check(vc, vc->orExpr(vc->datatypeTestExpr("zero", x), + vc->datatypeTestExpr("succ", x))); + DebugAssert(b, "Should be valid"); + + Expr y = vc->varExpr("y", nat); + Expr xeqy = vc->eqExpr(x, y); + args.clear(); + args.push_back(x); + Expr sx = vc->datatypeConsExpr("succ", args); + args.clear(); + args.push_back(y); + Expr sy = vc->datatypeConsExpr("succ", args); + Expr sxeqsy = vc->eqExpr(sx,sy); + b = check(vc, vc->impliesExpr(xeqy, sxeqsy)); + DebugAssert(b, "Should be valid"); + + b = check(vc, vc->notExpr(vc->eqExpr(sx, zero))); + DebugAssert(b, "Should be valid"); + + b = check(vc, vc->impliesExpr(sxeqsy, xeqy)); + DebugAssert(b, "Should be valid"); + + b = check(vc, vc->notExpr(vc->eqExpr(sx, x))); + DebugAssert(b, "Should be valid"); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test18(): \n" << e << endl; + } + delete vc; +} + +void test19() +{ + CVC3::CLFlags flags = CVC3::ValidityChecker::createFlags(); + flags.setFlag("dagify-exprs", false); + CVC3::ValidityChecker* vc = CVC3::ValidityChecker::create(flags); + try { + CVC3::Type RealType=(vc->realType()); + CVC3::Type IntType=(vc->intType()); + CVC3::Type BoolType=(vc->boolType()); + CVC3::Type PtrType=(RealType); + CVC3::Type HeapType=(vc->arrayType(PtrType, RealType)); + + // ----------------- + //ASSERT(FORALL (CVCi: REAL): (Hs[CVCi] = Ht[CVCi])); + //QUERY(Hs[(t6 + (3 * 1))] = Ht[(t6 + (3 * 1))]); + CVC3::Expr Ad = vc->boundVarExpr("CVCi", "CVCi", RealType); + CVC3::Expr Hs = vc->varExpr("Hs", HeapType); + CVC3::Expr Ht = vc->varExpr("Ht", HeapType); + CVC3::Expr t6 = vc->varExpr("t6", RealType); + + vector Vars; + Vars.push_back(Ad); + // Body= (Hs[Ad] = Ht[Ad]) + CVC3::Expr Body = vc->eqExpr(vc->readExpr(Hs, Ad), vc->readExpr(Ht, Ad)); + + //A = forall (~i:REAL): Body + CVC3::Expr A = vc->forallExpr(Vars, Body); + + // Q = (Hs[t6] = Ht[t6]) + CVC3::Expr Q = vc->eqExpr(vc->readExpr(Hs, t6), vc->readExpr(Ht, t6)); + + // ----------- CHECK A -> Q + vc->push(); + + vc->assertFormula(A); + + cout<<"Checking formula "<query(Q); + + DebugAssert(Succ, "Expected valid formula"); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test19(): \n" << e << endl; + } + delete vc; +} + + +void test20() { + ValidityChecker *vc = ValidityChecker::create(); + try { + vector names; + vector > constructors(3); + vector > > selectors(3); + vector > > types(3); + vector returnTypes; + + names.push_back("pair"); + + selectors[0].resize(1); + types[0].resize(1); + constructors[0].push_back("p"); + selectors[0][0].push_back("p1"); + types[0][0].push_back(vc->stringExpr("t1")); + selectors[0][0].push_back("p2"); + types[0][0].push_back(vc->stringExpr("t2")); + + names.push_back("t1"); + + selectors[1].resize(5); + types[1].resize(5); + constructors[1].push_back("a"); + constructors[1].push_back("b"); + constructors[1].push_back("c"); + constructors[1].push_back("d"); + constructors[1].push_back("e"); + + names.push_back("t2"); + + selectors[2].resize(1); + types[2].resize(1); + constructors[2].push_back("cons"); + selectors[2][0].push_back("s0"); + types[2][0].push_back(vc->bitvecType(2).getExpr()); + selectors[2][0].push_back("s1"); + types[2][0].push_back(vc->arrayType(vc->intType(), vc->subrangeType(vc->ratExpr(0), vc->ratExpr(0))).getExpr()); + + vc->dataType(names, constructors, selectors, types, returnTypes); + + DebugAssert(returnTypes[0].card() == CARD_FINITE, "Expected finite"); + Unsigned size = returnTypes[0].sizeFinite(); + Unsigned i = 0; + for (; i < size; ++i) { + cout << i << ": "; + vc->printExpr(returnTypes[0].enumerateFinite(i)); + } + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test20(): \n" << e << endl; + } + delete vc; +} + +void test21() { + ValidityChecker *vc = ValidityChecker::create(); + + try { + Type t = vc->realType(); + + Expr x1 = vc->varExpr("x",t); + + Expr x2 = vc->exprFromString("x"); + cout << "x1: " << x1; + cout << "\nx2: " << x2; + DebugAssert(x1 == x2, "Expected x1 == x2"); + + Expr y1 = vc->varExpr("y",t); + Expr y2 = vc->exprFromString("y"); + cout << "\ny1: " << y1; + cout << "\ny2: " << y2; + DebugAssert(y1 == y2, "Expected y1 == y2"); + + Expr a1 = vc->gtExpr(x1,vc->ratExpr(0,1)); + Expr a2 = vc->exprFromString("x > 0"); + cout << "\na1: " << a1; + cout << "\na2: " << a2; + DebugAssert(a1 == a2, "Expected a1 == a2"); + + Expr b1 = vc->ltExpr(x1,y1); + Expr b2 = vc->exprFromString ("x < y"); + cout << "\nb1: " << b1; + cout << "\nb2: " << b2; + DebugAssert(b1 == b2, "Expected b1 == b2"); + + Expr e1 = a1 && b1; + Expr e2 = vc->exprFromString("x > 0 AND x < y"); + + cout << "\ne1: " << e1; + cout << "\ne2: " << e2; + DebugAssert(e1 == e2, "Expected e1 == e2"); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test21(): \n" << e << endl; + } + delete vc; +} + +void test22() { + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Type intType(vc->intType()); + Type fType(vc->funType(intType,intType)); + + Op f(vc->createOp("f",fType)); + Expr x(vc->varExpr("x",intType)); + Expr fx(vc->exprFromString("f(x)")); + + Expr p(vc->exprFromString("FORALL (x:INT) : x < f(x)")); + + vector > patternvv; + vector patternv; + patternv.push_back(fx); + patternvv.push_back(patternv); + + vc->setTriggers(p,patternv); + DebugAssert( eqExprVecVecs(p.getTriggers(), patternvv), + "Expected p.getTriggers() == patternvv: " + p.toString() ); + + vc->setTriggers(p,patternvv); + + DebugAssert( eqExprVecVecs(p.getTriggers(), patternvv), + "Expected p.getTriggers() == patternvv: " + p.toString() ); + + // [chris 10/4/2009] Not sure why, but this fails + + // Expr q(vc->exprFromString("FORALL (x:INT) : PATTERN (f(x)) : x < f(x)")); + + // DebugAssert( eqExprVecVecs(q.getTriggers(), patternvv), + // "Expected q.getTriggers() == patternvv" + q.toString()); + + vector vars; + vars.push_back(x); + Expr r(vc->forallExpr( vars, vc->ltExpr(x,fx), patternvv )); + + DebugAssert( eqExprVecVecs(r.getTriggers(), patternvv), + "Expected r.getTriggers() == patternvv: " + r.toString() ); + + Expr s(vc->exprFromString("FORALL (x:INT) : x > f(x)")); + vc->setTrigger(s,fx); + + std::vector > trigsvv = s.getTriggers(); + DebugAssert( trigsvv.size() == 1, + "Expected s.getTriggers().size() == 1: " + trigsvv.size() ); + + std::vector trigsv = trigsvv[0]; + DebugAssert( trigsv.size() == 1, + "Expected s.getTriggers()[0].size() == 1: " + + trigsv.size() ); + + DebugAssert( trigsv[0] == fx, + "Expected s.getTriggers()[0][0] == fx: " + + (trigsv[0].toString()) ); + + Expr t(vc->exprFromString("FORALL (x:INT) : x > f(x)")); + vc->setMultiTrigger(t,patternv); + trigsvv = t.getTriggers(); + DebugAssert( trigsvv.size() == 1, + "Expected t.getTriggers().size() == 1: " + trigsvv.size() ); + + trigsv = trigsvv[0]; + DebugAssert( trigsv.size() == 1, + "Expected t.getTriggers()[0].size() == 1: " + + trigsv.size() ); + + DebugAssert( trigsv[0] == fx, + "Expected t.getTriggers()[0][0] == fx: " + + (trigsv[0].toString()) ); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test22(): \n" << e << endl; + } + delete vc; +} + +void test23() { + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Type intType(vc->intType()); + Type fType(vc->funType(intType,intType)); + + Expr x(vc->varExpr("x",intType)); + Expr y(vc->varExpr("y",intType)); + Expr a(vc->varExpr("a",intType)); + Expr b(vc->varExpr("b",intType)); + + Expr s(vc->exprFromString("x < y")); + Expr t(vc->exprFromString("a < b")); + + cout << "s=" << s << "\nt=" << t << "\n"; + + std::vector oldExprs, newExprs; + oldExprs.push_back(x); + oldExprs.push_back(y); + newExprs.push_back(a); + newExprs.push_back(b); + + Expr u(s.substExpr(oldExprs,newExprs)); + cout << "u=" << u << "\n"; + + DebugAssert( t == u, "Expected t==u" ); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test23(): \n" << e << endl; + } + delete vc; +} + +void test24() { + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Type intType(vc->intType()); + Type aType(vc->arrayType(intType,intType)); + + Expr a(vc->varExpr("a",aType)); + Expr x(vc->varExpr("x",intType)); + Expr ax(vc->exprFromString("a[x]")); + + Expr p(vc->exprFromString("FORALL (x:INT) : PATTERN (a[x]) : x < a[x]")); + + cout << p << "\n"; + + vector > pTriggers(p.getTriggers()); + DebugAssert( pTriggers.size() == 1, + "Expected one trigger set. Found: " + + int2string(pTriggers.size())); + DebugAssert( pTriggers[0].size() == 1, + "Expected one trigger. Found: " + + int2string( pTriggers[0].size())); + /* We can't check that the trigger == ax, because x will have + * been replaced with a bvar + */ + DebugAssert( pTriggers[0][0].getKind() == READ, + "Expected READ expression. Found: " + + pTriggers[0][0].getKind()); + DebugAssert( pTriggers[0][0][0] == a, + "Expected read on array: " + a.toString() + + "\nFound: " + pTriggers[0][0][0].toString() ); + + Expr aPrime(vc->varExpr("a'",aType)); + Expr axPrime(vc->exprFromString("a'[x]")); + + ExprHashMap substMap; + substMap.insert(a,aPrime); + + Expr q(p.substExpr(substMap)); + + cout << q << "\n"; + + vector > qTriggers(q.getTriggers()); + DebugAssert( qTriggers.size() == 1, + "Expected one trigger set. Found: " + + int2string(qTriggers.size())); + DebugAssert( qTriggers[0].size() == 1, + "Expected one trigger. Found: " + + int2string( qTriggers[0].size())); + DebugAssert( qTriggers[0][0].getKind() == READ, + "Expected READ expression. Found: " + + qTriggers[0][0].getKind()); + DebugAssert( qTriggers[0][0][0] == aPrime, + "Expected read on array: " + aPrime.toString() + + "\nFound: " + qTriggers[0][0][0].toString() ); + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test24(): \n" << e << endl; + } + delete vc; +} + + +void test25() { + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Type realType(vc->realType()); + + Expr x = vc->ratExpr("-0.1"); + cout << "-0.1: " << x << endl; + Expr y = vc->ratExpr("-1/10"); + cout << "-1/10: " << y << endl; + Expr z = vc->ratExpr("-1","10",10); + cout << "-1 over 10: " << z << endl; + Expr w = vc->ratExpr(-1,10); + cout << "-1 over 10 (ints): " << w << endl; + + DebugAssert(x == y && y == z && z == w, "Error in rational constants"); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test25(): \n" << e << endl; + } + delete vc; +} + + +void test26() { + CLFlags flags = ValidityChecker::createFlags(); + ValidityChecker* vc = ValidityChecker::create(flags); + + try { + Type bvType(vc->bitvecType(32)); + + Expr x = vc->varExpr("x", bvType); + Expr e1 = vc->newFixedConstWidthLeftShiftExpr(x, 16); + Expr e2 = vc->newBVSHL(x, vc->newBVConstExpr(16, 32)); + + bool b = check(vc, vc->eqExpr(e1, e2)); + DebugAssert(b, "Should be valid"); + + e1 = vc->newFixedRightShiftExpr(x, 16); + e2 = vc->newBVLSHR(x, vc->newBVConstExpr(16, 32)); + + b = check(vc, vc->eqExpr(e1, e2)); + DebugAssert(b, "Should be valid"); + + e2 = vc->newBVASHR(x, vc->newBVConstExpr(16, 32)); + b = check(vc, vc->eqExpr(e1, e2)); + DebugAssert(!b, "Should be invalid"); + + } catch(const Exception& e) { + exitStatus = 1; + cout << "*** Exception caught in test26(): \n" << e << endl; + } + delete vc; +} + + +int main(int argc, char** argv) +{ + int regressLevel = 3; + if (argc > 1) regressLevel = atoi(argv[1]); + cout << "Running API test, regress level = " << regressLevel << endl; + exitStatus = 0; + try { + cout << "\n}\ntest26(): {" << endl; + test26(); + cout << "\ntest(): {" << endl; + test(); + cout << "\n}\ntest1(): {" << endl; + test1(); + cout << "\n}\n\ntest2(): {" << endl; + test2(); + cout << "\n}\n\ntest3(): {" << endl; + test3(); + cout << "\n}\n\ntest4(): {" << endl; + test4(); + if (regressLevel > 0) { + cout << "\n}\n\ntest5(): {" << endl; + test5(); + } + cout << "\n}\n\ntest6(): {" << endl; + test6(); + cout << "\n}\n\ntest7(): {" << endl; + test7(); + cout << "\n}\n\ntest8(): {" << endl; + test8(); + cout << "\n}\n\ntest9(" << 10*regressLevel+10 << "): {" << endl; + test9(10*regressLevel+10); + cout << "\nbvtest9(): {" << endl; + bvtest9(regressLevel*3+2); + cout << "\n}" << endl; + + // Test for obvious memory leaks + int limit = 100 * regressLevel+10; + for(int i=0; i 1) { + cout << "\n}\ntestgeorge1(): {" << endl; + testgeorge1(); + cout << "\n}\ntestgeorge2(): {" << endl; + testgeorge2(); + cout << "\n}\ntestgeorge3(): {" << endl; + testgeorge3(); + cout << "\n}\ntestgeorge4(): {" << endl; + testgeorge4(); + cout << "\n}\ntestgeorge5(): {" << endl; + testgeorge5(); + } + cout << "\n}" << endl; + + } catch(const Exception& e) { + cout << "*** Exception caught: \n" << e << endl; + exitStatus = 1; + } + if(exitStatus == 0) + cout << "Program exits successfully." << endl; + else + cout << "Program exits with error status = " << exitStatus << "." << endl; + return exitStatus; +} diff --git a/test/unit/Makefile.am b/test/unit/Makefile.am index f98f434c1..608d6335b 100644 --- a/test/unit/Makefile.am +++ b/test/unit/Makefile.am @@ -3,9 +3,7 @@ UNIT_TESTS = \ theory/shared_term_manager_black \ theory/theory_engine_white \ theory/theory_black \ - theory/theory_uf_tim_white \ theory/theory_arith_white \ - theory/stacking_map_black \ theory/union_find_black \ expr/expr_public \ expr/expr_manager_public \ @@ -30,9 +28,12 @@ UNIT_TESTS = \ context/cdo_black \ context/cdlist_black \ context/cdlist_context_memory_black \ + context/cdcirclist_white \ context/cdmap_black \ context/cdmap_white \ context/cdvector_black \ + context/stacking_map_black \ + context/stacking_vector_black \ util/assert_white \ util/bitvector_black \ util/datatype_black \ diff --git a/test/unit/context/cdcirclist_white.h b/test/unit/context/cdcirclist_white.h new file mode 100644 index 000000000..b03a850a8 --- /dev/null +++ b/test/unit/context/cdcirclist_white.h @@ -0,0 +1,223 @@ +/********************* */ +/*! \file cdcirclist_white.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 White box testing of CVC4::context::CDCircList<>. + ** + ** White box testing of CVC4::context::CDCircList<>. + **/ + +#include + +#include +#include + +#include + +#include "context/context.h" +#include "context/cdcirclist.h" + +#include "util/output.h" + +using namespace std; +using namespace CVC4::context; +using namespace CVC4; + +class CDCircListWhite : public CxxTest::TestSuite { +private: + + Context* d_context; + +public: + + void setUp() { + d_context = new Context(); + } + + void tearDown() { + delete d_context; + } + + void testSimple() { + //Debug.on("cdcirclist"); + CDCircList l(d_context, ContextMemoryAllocator(d_context->getCMM())); + + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + + d_context->push(); + { + TS_ASSERT(l.empty()); + l.push_back(1); + TS_ASSERT(!l.empty()); + TS_ASSERT_EQUALS(l.front(), 1); + TS_ASSERT_EQUALS(l.back(), 1); + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + + l.push_back(2); + TS_ASSERT(!l.empty()); + TS_ASSERT_EQUALS(l.front(), 1); + TS_ASSERT_EQUALS(l.back(), 2); + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + + l.push_back(3); + TS_ASSERT(!l.empty()); + TS_ASSERT_EQUALS(l.front(), 1); + TS_ASSERT_EQUALS(l.back(), 3); + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + +#ifdef CVC4_ASSERTIONS + TS_ASSERT_THROWS( l.concat(l), AssertionException ); +#endif /* CVC4_ASSERTIONS */ + + CDCircList l2(d_context, ContextMemoryAllocator(d_context->getCMM())); + l2.push_back(4); + l2.push_back(5); + l2.push_back(6); + TS_ASSERT_EQUALS(l2.front(), 4); + TS_ASSERT_EQUALS(l2.back(), 6); + TS_ASSERT_THROWS_NOTHING( l2.debugCheck() ); + + d_context->push(); + { + l.concat(l2); + + TS_ASSERT_EQUALS(l.front(), 1); + TS_ASSERT_EQUALS(l.back(), 6); + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + + TS_ASSERT_EQUALS(l2.front(), 4); + TS_ASSERT_EQUALS(l2.back(), 3); + TS_ASSERT_THROWS_NOTHING( l2.debugCheck() ); + + d_context->push(); + { + CDCircList::iterator i = l.begin(); + CDCircList::iterator j = l.begin(); + TS_ASSERT_EQUALS(i, j); + TS_ASSERT_EQUALS(i++, j); + TS_ASSERT_EQUALS(i, ++j); + TS_ASSERT_EQUALS(l.erase(l.begin()), i); + + i = l.begin(); + TS_ASSERT_EQUALS(i, j); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i, l.front()); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i, 2); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 2); TS_ASSERT_DIFFERS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*i++, 3); TS_ASSERT_DIFFERS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*i++, 4); TS_ASSERT_DIFFERS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*i++, 5); TS_ASSERT_DIFFERS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*i++, 6); TS_ASSERT_EQUALS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*--i, 6); TS_ASSERT_DIFFERS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*--i, 5); TS_ASSERT_DIFFERS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*--i, 4); TS_ASSERT_DIFFERS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*--i, 3); TS_ASSERT_DIFFERS(i, l.end()); TS_ASSERT_DIFFERS(i, j); + TS_ASSERT_EQUALS(*--i, 2); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(i, l.begin()); TS_ASSERT_EQUALS(i, j); + + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + TS_ASSERT_THROWS_NOTHING( l2.debugCheck() ); + } + d_context->pop(); + + CDCircList::iterator i = l.begin(); + TS_ASSERT_EQUALS(*i, l.front()); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 1); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 2); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 3); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 4); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 5); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 6); TS_ASSERT_EQUALS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 6); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 5); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 4); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 3); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 2); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 1); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(i, l.begin()); + + i = l2.begin(); + TS_ASSERT_EQUALS(*i, l2.front()); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 4); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 5); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 6); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 1); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 2); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 3); TS_ASSERT_EQUALS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 3); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 2); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 1); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 6); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 5); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 4); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(i, l2.begin()); + + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + TS_ASSERT_THROWS_NOTHING( l2.debugCheck() ); + } + d_context->pop(); + + TS_ASSERT(! l.empty()); + TS_ASSERT(! l2.empty()); + + CDCircList::iterator i = l.begin(); + TS_ASSERT_EQUALS(*i, l.front()); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 1); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 2); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*i++, 3); TS_ASSERT_EQUALS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 3); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 2); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(*--i, 1); TS_ASSERT_DIFFERS(i, l.end()); + TS_ASSERT_EQUALS(i, l.begin()); + + i = l2.begin(); + TS_ASSERT_EQUALS(*i, l2.front()); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 4); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 5); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*i++, 6); TS_ASSERT_EQUALS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 6); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 5); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(*--i, 4); TS_ASSERT_DIFFERS(i, l2.end()); + TS_ASSERT_EQUALS(i, l2.begin()); + + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + TS_ASSERT_THROWS_NOTHING( l2.debugCheck() ); + } + d_context->pop(); + + TS_ASSERT(l.empty()); + TS_ASSERT_THROWS_NOTHING( l.debugCheck() ); + } + + void testCDPtr() { + int* x = (int*)0x12345678; + int* y = (int*)0x87654321; + CDPtr p(d_context, NULL); + TS_ASSERT(p == NULL); + d_context->push(); + TS_ASSERT(p == NULL); + d_context->push(); + TS_ASSERT(p == NULL); + p = x; + TS_ASSERT(p == x); + d_context->push(); + TS_ASSERT(p == x); + p = y; + TS_ASSERT(p == y); + d_context->pop(); + TS_ASSERT(p == x); + d_context->pop(); + TS_ASSERT(p == NULL); + d_context->pop(); + TS_ASSERT(p == NULL); + } + +};/* class CDCircListWhite */ diff --git a/test/unit/context/cdlist_black.h b/test/unit/context/cdlist_black.h index 6541973bf..fcc6a7e55 100644 --- a/test/unit/context/cdlist_black.h +++ b/test/unit/context/cdlist_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/cdlist_context_memory_black.h b/test/unit/context/cdlist_context_memory_black.h index 2f3c27ddb..a57fd131d 100644 --- a/test/unit/context/cdlist_context_memory_black.h +++ b/test/unit/context/cdlist_context_memory_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/cdmap_black.h b/test/unit/context/cdmap_black.h index 37beb5054..eb2caa98f 100644 --- a/test/unit/context/cdmap_black.h +++ b/test/unit/context/cdmap_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/cdmap_white.h b/test/unit/context/cdmap_white.h index a3abd6f25..42f9b8563 100644 --- a/test/unit/context/cdmap_white.h +++ b/test/unit/context/cdmap_white.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/cdo_black.h b/test/unit/context/cdo_black.h index f844c2ef5..6d40a0fb1 100644 --- a/test/unit/context/cdo_black.h +++ b/test/unit/context/cdo_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/cdvector_black.h b/test/unit/context/cdvector_black.h index 37a285abe..b49186dd0 100644 --- a/test/unit/context/cdvector_black.h +++ b/test/unit/context/cdvector_black.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/context_black.h b/test/unit/context/context_black.h index e5aee4baa..33863e848 100644 --- a/test/unit/context/context_black.h +++ b/test/unit/context/context_black.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/context_mm_black.h b/test/unit/context/context_mm_black.h index 126245af7..0e5de3198 100644 --- a/test/unit/context/context_mm_black.h +++ b/test/unit/context/context_mm_black.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/context_white.h b/test/unit/context/context_white.h index 38649ef5b..9fb94097d 100644 --- a/test/unit/context/context_white.h +++ b/test/unit/context/context_white.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/context/stacking_map_black.h b/test/unit/context/stacking_map_black.h new file mode 100644 index 000000000..f0feb1293 --- /dev/null +++ b/test/unit/context/stacking_map_black.h @@ -0,0 +1,161 @@ +/********************* */ +/*! \file stacking_map_black.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 Black box testing of CVC4::context::StackingMap + ** + ** Black box testing of CVC4::context::StackingMap. + **/ + +#include + +#include "context/context.h" +#include "expr/node.h" +#include "context/stacking_map.h" + +using namespace CVC4; +using namespace CVC4::context; + +using namespace std; + +/** + * Test the StackingMap. + */ +class StackingMapBlack : public CxxTest::TestSuite { + Context* d_ctxt; + StackingMap* d_mapPtr; + NodeManager* d_nm; + NodeManagerScope* d_scope; + + Node a, b, c, d, e, f, g; + +public: + + void setUp() { + d_ctxt = new Context; + d_nm = new NodeManager(d_ctxt, NULL); + d_scope = new NodeManagerScope(d_nm); + d_mapPtr = new StackingMap(d_ctxt); + + a = d_nm->mkVar("a", d_nm->realType()); + b = d_nm->mkVar("b", d_nm->realType()); + c = d_nm->mkVar("c", d_nm->realType()); + d = d_nm->mkVar("d", d_nm->realType()); + e = d_nm->mkVar("e", d_nm->realType()); + f = d_nm->mkVar("f", d_nm->realType()); + g = d_nm->mkVar("g", d_nm->realType()); + } + + void tearDown() { + g = Node::null(); + f = Node::null(); + e = Node::null(); + d = Node::null(); + c = Node::null(); + b = Node::null(); + a = Node::null(); + + delete d_mapPtr; + delete d_scope; + delete d_nm; + delete d_ctxt; + } + + void testSimpleContextual() { + StackingMap& d_map = *d_mapPtr; + + TS_ASSERT(d_map[a].isNull()); + TS_ASSERT(d_map[b].isNull()); + TS_ASSERT(d_map[c].isNull()); + TS_ASSERT(d_map[d].isNull()); + TS_ASSERT(d_map[e].isNull()); + TS_ASSERT(d_map[f].isNull()); + TS_ASSERT(d_map[g].isNull()); + + d_map.set(a, b); + + TS_ASSERT(d_map[a] == b); + TS_ASSERT(d_map[b].isNull()); + TS_ASSERT(d_map[c].isNull()); + TS_ASSERT(d_map[d].isNull()); + TS_ASSERT(d_map[e].isNull()); + TS_ASSERT(d_map[f].isNull()); + TS_ASSERT(d_map[g].isNull()); + + d_ctxt->push(); + { + TS_ASSERT(d_map[a] == b); + TS_ASSERT(d_map[b].isNull()); + TS_ASSERT(d_map[c].isNull()); + TS_ASSERT(d_map[d].isNull()); + TS_ASSERT(d_map[e].isNull()); + TS_ASSERT(d_map[f].isNull()); + TS_ASSERT(d_map[g].isNull()); + + d_map.set(c, d); + d_map.set(f, e); + + TS_ASSERT(d_map[a] == b); + TS_ASSERT(d_map[b].isNull()); + TS_ASSERT(d_map[c] == d); + TS_ASSERT(d_map[d].isNull()); + TS_ASSERT(d_map[e].isNull()); + TS_ASSERT(d_map[f] == e); + TS_ASSERT(d_map[g].isNull()); + + d_ctxt->push(); + { + + TS_ASSERT(d_map[a] == b); + TS_ASSERT(d_map[b].isNull()); + TS_ASSERT(d_map[c] == d); + TS_ASSERT(d_map[d].isNull()); + TS_ASSERT(d_map[e].isNull()); + TS_ASSERT(d_map[f] == e); + TS_ASSERT(d_map[g].isNull()); + + d_map.set(a, c); + d_map.set(f, f); + d_map.set(e, d); + d_map.set(c, Node::null()); + d_map.set(g, a); + + TS_ASSERT(d_map[a] == c); + TS_ASSERT(d_map[b].isNull()); + TS_ASSERT(d_map[c].isNull()); + TS_ASSERT(d_map[d].isNull()); + TS_ASSERT(d_map[e] == d); + TS_ASSERT(d_map[f] == f); + TS_ASSERT(d_map[g] == a); + + } + d_ctxt->pop(); + + TS_ASSERT(d_map[a] == b); + TS_ASSERT(d_map[b].isNull()); + TS_ASSERT(d_map[c] == d); + TS_ASSERT(d_map[d].isNull()); + TS_ASSERT(d_map[e].isNull()); + TS_ASSERT(d_map[f] == e); + TS_ASSERT(d_map[g].isNull()); + } + d_ctxt->pop(); + + TS_ASSERT(d_map[a] == b); + TS_ASSERT(d_map[b].isNull()); + TS_ASSERT(d_map[c].isNull()); + TS_ASSERT(d_map[d].isNull()); + TS_ASSERT(d_map[e].isNull()); + TS_ASSERT(d_map[f].isNull()); + TS_ASSERT(d_map[g].isNull()); + } +}; diff --git a/test/unit/context/stacking_vector_black.h b/test/unit/context/stacking_vector_black.h new file mode 100644 index 000000000..5f410881b --- /dev/null +++ b/test/unit/context/stacking_vector_black.h @@ -0,0 +1,161 @@ +/********************* */ +/*! \file stacking_vector_black.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 prototype. + ** Copyright (c) 2009, 2010, 2011 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 Black box testing of CVC4::context::StackingVector + ** + ** Black box testing of CVC4::context::StackingVector. + **/ + +#include + +#include "context/context.h" +#include "expr/node.h" +#include "context/stacking_vector.h" + +using namespace CVC4; +using namespace CVC4::context; + +using namespace std; + +/** + * Test the StackingVector. + */ +class StackingVectorBlack : public CxxTest::TestSuite { + Context* d_ctxt; + StackingVector* d_vectorPtr; + NodeManager* d_nm; + NodeManagerScope* d_scope; + + Node a, b, c, d, e, f, g; + +public: + + void setUp() { + d_ctxt = new Context; + d_nm = new NodeManager(d_ctxt, NULL); + d_scope = new NodeManagerScope(d_nm); + d_vectorPtr = new StackingVector(d_ctxt); + + a = d_nm->mkVar("a", d_nm->realType()); + b = d_nm->mkVar("b", d_nm->realType()); + c = d_nm->mkVar("c", d_nm->realType()); + d = d_nm->mkVar("d", d_nm->realType()); + e = d_nm->mkVar("e", d_nm->realType()); + f = d_nm->mkVar("f", d_nm->realType()); + g = d_nm->mkVar("g", d_nm->realType()); + } + + void tearDown() { + g = Node::null(); + f = Node::null(); + e = Node::null(); + d = Node::null(); + c = Node::null(); + b = Node::null(); + a = Node::null(); + + delete d_vectorPtr; + delete d_scope; + delete d_nm; + delete d_ctxt; + } + + void testSimpleContextual() { + StackingVector& d_vector = *d_vectorPtr; + + TS_ASSERT(d_vector[1].isNull()); + TS_ASSERT(d_vector[2].isNull()); + TS_ASSERT(d_vector[3].isNull()); + TS_ASSERT(d_vector[4].isNull()); + TS_ASSERT(d_vector[5].isNull()); + TS_ASSERT(d_vector[6].isNull()); + TS_ASSERT(d_vector[7].isNull()); + + d_vector.set(1, b); + + TS_ASSERT(d_vector[1] == b); + TS_ASSERT(d_vector[2].isNull()); + TS_ASSERT(d_vector[3].isNull()); + TS_ASSERT(d_vector[4].isNull()); + TS_ASSERT(d_vector[5].isNull()); + TS_ASSERT(d_vector[6].isNull()); + TS_ASSERT(d_vector[7].isNull()); + + d_ctxt->push(); + { + TS_ASSERT(d_vector[1] == b); + TS_ASSERT(d_vector[2].isNull()); + TS_ASSERT(d_vector[3].isNull()); + TS_ASSERT(d_vector[4].isNull()); + TS_ASSERT(d_vector[5].isNull()); + TS_ASSERT(d_vector[6].isNull()); + TS_ASSERT(d_vector[7].isNull()); + + d_vector.set(3, d); + d_vector.set(6, e); + + TS_ASSERT(d_vector[1] == b); + TS_ASSERT(d_vector[2].isNull()); + TS_ASSERT(d_vector[3] == d); + TS_ASSERT(d_vector[4].isNull()); + TS_ASSERT(d_vector[5].isNull()); + TS_ASSERT(d_vector[6] == e); + TS_ASSERT(d_vector[7].isNull()); + + d_ctxt->push(); + { + + TS_ASSERT(d_vector[1] == b); + TS_ASSERT(d_vector[2].isNull()); + TS_ASSERT(d_vector[3] == d); + TS_ASSERT(d_vector[4].isNull()); + TS_ASSERT(d_vector[5].isNull()); + TS_ASSERT(d_vector[6] == e); + TS_ASSERT(d_vector[7].isNull()); + + d_vector.set(1, c); + d_vector.set(6, f); + d_vector.set(5, d); + d_vector.set(3, Node::null()); + d_vector.set(7, a); + + TS_ASSERT(d_vector[1] == c); + TS_ASSERT(d_vector[2].isNull()); + TS_ASSERT(d_vector[3].isNull()); + TS_ASSERT(d_vector[4].isNull()); + TS_ASSERT(d_vector[5] == d); + TS_ASSERT(d_vector[6] == f); + TS_ASSERT(d_vector[7] == a); + + } + d_ctxt->pop(); + + TS_ASSERT(d_vector[1] == b); + TS_ASSERT(d_vector[2].isNull()); + TS_ASSERT(d_vector[3] == d); + TS_ASSERT(d_vector[4].isNull()); + TS_ASSERT(d_vector[5].isNull()); + TS_ASSERT(d_vector[6] == e); + TS_ASSERT(d_vector[7].isNull()); + } + d_ctxt->pop(); + + TS_ASSERT(d_vector[1] == b); + TS_ASSERT(d_vector[2].isNull()); + TS_ASSERT(d_vector[3].isNull()); + TS_ASSERT(d_vector[4].isNull()); + TS_ASSERT(d_vector[5].isNull()); + TS_ASSERT(d_vector[6].isNull()); + TS_ASSERT(d_vector[7].isNull()); + } +}; diff --git a/test/unit/expr/attribute_black.h b/test/unit/expr/attribute_black.h index a324bbbf1..8e7f89795 100644 --- a/test/unit/expr/attribute_black.h +++ b/test/unit/expr/attribute_black.h @@ -5,7 +5,7 @@ ** Major contributors: taking ** Minor contributors (to current version): cconway, mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/declaration_scope_black.h b/test/unit/expr/declaration_scope_black.h index b1e77c614..bde04157c 100644 --- a/test/unit/expr/declaration_scope_black.h +++ b/test/unit/expr/declaration_scope_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters, dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/expr_manager_public.h b/test/unit/expr/expr_manager_public.h index e37c197ab..e709648c9 100644 --- a/test/unit/expr/expr_manager_public.h +++ b/test/unit/expr/expr_manager_public.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/expr_public.h b/test/unit/expr/expr_public.h index 32e8da287..853d0086b 100644 --- a/test/unit/expr/expr_public.h +++ b/test/unit/expr/expr_public.h @@ -5,7 +5,7 @@ ** Major contributors: cconway, dejan ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/kind_black.h b/test/unit/expr/kind_black.h index 314108a5b..5cf4ba30a 100644 --- a/test/unit/expr/kind_black.h +++ b/test/unit/expr/kind_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/node_black.h b/test/unit/expr/node_black.h index 6bd5aa1fd..40545e5e8 100644 --- a/test/unit/expr/node_black.h +++ b/test/unit/expr/node_black.h @@ -5,7 +5,7 @@ ** Major contributors: taking ** Minor contributors (to current version): cconway, dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/node_builder_black.h b/test/unit/expr/node_builder_black.h index c084c4ecb..c6d6d815e 100644 --- a/test/unit/expr/node_builder_black.h +++ b/test/unit/expr/node_builder_black.h @@ -5,7 +5,7 @@ ** Major contributors: cconway, mdeters ** Minor contributors (to current version): dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/node_manager_black.h b/test/unit/expr/node_manager_black.h index e6ebc6724..c30e4badb 100644 --- a/test/unit/expr/node_manager_black.h +++ b/test/unit/expr/node_manager_black.h @@ -5,7 +5,7 @@ ** Major contributors: dejan ** Minor contributors (to current version): taking, mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/node_manager_white.h b/test/unit/expr/node_manager_white.h index 95d3271f2..735fe2ac8 100644 --- a/test/unit/expr/node_manager_white.h +++ b/test/unit/expr/node_manager_white.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): taking ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/node_self_iterator_black.h b/test/unit/expr/node_self_iterator_black.h index e97407dfc..9cc09f884 100644 --- a/test/unit/expr/node_self_iterator_black.h +++ b/test/unit/expr/node_self_iterator_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/expr/node_white.h b/test/unit/expr/node_white.h index 9d6311acb..ce67004c6 100644 --- a/test/unit/expr/node_white.h +++ b/test/unit/expr/node_white.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): taking, dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/main/interactive_shell_black.h b/test/unit/main/interactive_shell_black.h index e56e8de8a..7773644da 100644 --- a/test/unit/main/interactive_shell_black.h +++ b/test/unit/main/interactive_shell_black.h @@ -2,10 +2,10 @@ /*! \file interactive_shell_black.h ** \verbatim ** Original author: cconway - ** Major contributors: - ** Minor contributors (to current version): + ** Major contributors: none + ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/memory.h b/test/unit/memory.h index 6da3c08b5..19b45c05d 100644 --- a/test/unit/memory.h +++ b/test/unit/memory.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/parser/parser_builder_black.h b/test/unit/parser/parser_builder_black.h index 06b09f2ce..0f0dc5fbd 100644 --- a/test/unit/parser/parser_builder_black.h +++ b/test/unit/parser/parser_builder_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/prop/cnf_stream_black.h b/test/unit/prop/cnf_stream_black.h index c45740da9..8fb96c74a 100644 --- a/test/unit/prop/cnf_stream_black.h +++ b/test/unit/prop/cnf_stream_black.h @@ -2,10 +2,10 @@ /*! \file cnf_stream_black.h ** \verbatim ** Original author: cconway - ** Major contributors: none - ** Minor contributors (to current version): mdeters, dejan + ** Major contributors: mdeters + ** Minor contributors (to current version): taking, dejan ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/theory/shared_term_manager_black.h b/test/unit/theory/shared_term_manager_black.h index 0e8f5addb..1be116517 100644 --- a/test/unit/theory/shared_term_manager_black.h +++ b/test/unit/theory/shared_term_manager_black.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: barrett ** Major contributors: none - ** Minor contributors (to current version): mdeters + ** Minor contributors (to current version): cconway, mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/theory/stacking_map_black.h b/test/unit/theory/stacking_map_black.h index c60da2922..d70aa8c22 100644 --- a/test/unit/theory/stacking_map_black.h +++ b/test/unit/theory/stacking_map_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/theory/theory_arith_white.h b/test/unit/theory/theory_arith_white.h index fb82a7ac9..ded7cee97 100644 --- a/test/unit/theory/theory_arith_white.h +++ b/test/unit/theory/theory_arith_white.h @@ -3,9 +3,9 @@ ** \verbatim ** Original author: taking ** Major contributors: none - ** Minor contributors (to current version): barrett, mdeters + ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/theory/theory_black.h b/test/unit/theory/theory_black.h index 2d39af956..ff6b352d0 100644 --- a/test/unit/theory/theory_black.h +++ b/test/unit/theory/theory_black.h @@ -5,7 +5,7 @@ ** Major contributors: barrett, mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/theory/theory_engine_white.h b/test/unit/theory/theory_engine_white.h index f1a83cd49..a1b058eeb 100644 --- a/test/unit/theory/theory_engine_white.h +++ b/test/unit/theory/theory_engine_white.h @@ -2,10 +2,10 @@ /*! \file theory_engine_white.h ** \verbatim ** Original author: mdeters - ** Major contributors: none - ** Minor contributors (to current version): barrett, cconway + ** Major contributors: dejan + ** Minor contributors (to current version): taking, cconway ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/theory/theory_uf_tim_white.h b/test/unit/theory/theory_uf_tim_white.h deleted file mode 100644 index ae3eee369..000000000 --- a/test/unit/theory/theory_uf_tim_white.h +++ /dev/null @@ -1,252 +0,0 @@ -/********************* */ -/*! \file theory_uf_tim_white.h - ** \verbatim - ** Original author: taking - ** Major contributors: barrett - ** Minor contributors (to current version): cconway, dejan, mdeters - ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 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 White box testing of CVC4::theory::uf::tim::TheoryUFTim. - ** - ** White box testing of CVC4::theory::uf::tim::TheoryUFTim. - **/ - -#include - -#include "theory/theory.h" -#include "theory/uf/theory_uf.h" -#include "theory/uf/tim/theory_uf_tim.h" -#include "expr/node.h" -#include "expr/node_manager.h" -#include "context/context.h" - -#include "theory/theory_test_utils.h" - -#include - -using namespace CVC4; -using namespace CVC4::theory; -using namespace CVC4::theory::uf; -using namespace CVC4::theory::uf::tim; -using namespace CVC4::expr; -using namespace CVC4::context; - -using namespace std; - - -class TheoryUFTimWhite : public CxxTest::TestSuite { - - Context* d_ctxt; - NodeManager* d_nm; - NodeManagerScope* d_scope; - - TestOutputChannel d_outputChannel; - Theory::Effort d_level; - - TheoryUFTim* d_euf; - - TypeNode* d_booleanType; - -public: - - TheoryUFTimWhite() : d_level(Theory::FULL_EFFORT) {} - - void setUp() { - d_ctxt = new Context; - d_nm = new NodeManager(d_ctxt, NULL); - d_scope = new NodeManagerScope(d_nm); - d_outputChannel.clear(); - d_euf = new TheoryUFTim(d_ctxt, d_outputChannel, Valuation(NULL)); - - d_booleanType = new TypeNode(d_nm->booleanType()); - } - - void tearDown() { - delete d_booleanType; - delete d_euf; - d_outputChannel.clear(); - delete d_scope; - delete d_nm; - delete d_ctxt; - } - - void testPushPopSimple() { - TypeNode t = d_nm->mkSort(); - Node x = d_nm->mkVar(t); - Node x_eq_x = x.eqNode(x); - - d_ctxt->push(); - d_ctxt->pop(); - } - -// FIXME: This is broken because of moving registration into theory_engine @CB -// // void testPushPopChain() { -// // Node x = d_nm->mkVar(*d_booleanType); -// // Node f = d_nm->mkVar(*d_booleanType); -// // Node f_x = d_nm->mkNode(kind::APPLY_UF, f, x); -// // Node f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_x); -// // Node f_f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_f_x); -// // Node f_f_f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_f_f_x); -// // Node f_f_f_f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_f_f_f_x); - -// // Node f3_x_eq_x = f_f_f_x.eqNode(x); -// // Node f5_x_eq_x = f_f_f_f_f_x.eqNode(x); -// // Node f1_x_neq_x = f_x.eqNode(x).notNode(); - -// // Node expectedConflict = d_nm->mkNode(kind::AND, -// // f1_x_neq_x, -// // f3_x_eq_x, -// // f5_x_eq_x -// // ); - -// // d_euf->assertFact( f3_x_eq_x ); -// // d_euf->assertFact( f1_x_neq_x ); -// // d_euf->check(d_level); -// // d_ctxt->push(); - -// // d_euf->assertFact( f5_x_eq_x ); -// // d_euf->check(d_level); - -// // TS_ASSERT_EQUALS(1u, d_outputChannel.getNumCalls()); -// // TS_ASSERT_EQUALS(CONFLICT, d_outputChannel.getIthCallType(0)); -// // Node realConflict = d_outputChannel.getIthNode(0); -// // TS_ASSERT_EQUALS(expectedConflict, realConflict); - -// // d_ctxt->pop(); -// // d_euf->check(d_level); - -// // //Test that no additional calls to the output channel occurred. -// // TS_ASSERT_EQUALS(1u, d_outputChannel.getNumCalls()); - -// // d_euf->assertFact( f5_x_eq_x ); - -// // d_euf->check(d_level); - -// // TS_ASSERT_EQUALS(2u, d_outputChannel.getNumCalls()); -// // TS_ASSERT_EQUALS(CONFLICT, d_outputChannel.getIthCallType(0)); -// // TS_ASSERT_EQUALS(CONFLICT, d_outputChannel.getIthCallType(1)); -// // Node firstConflict = d_outputChannel.getIthNode(0); -// // Node secondConflict = d_outputChannel.getIthNode(1); -// // TS_ASSERT_EQUALS(expectedConflict, firstConflict); -// // TS_ASSERT_EQUALS(expectedConflict, secondConflict); - -// // } - - - -// /* test that {f(f(x)) == x, f(f(f(x))) != f(x)} is inconsistent */ -// void testSimpleChain() { -// Node x = d_nm->mkVar(*d_booleanType); -// Node f = d_nm->mkVar(*d_booleanType); -// Node f_x = d_nm->mkNode(kind::APPLY_UF, f, x); -// Node f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_x); -// Node f_f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_f_x); - -// Node f_f_x_eq_x = f_f_x.eqNode(x); -// Node f_f_f_x_neq_f_x = (f_f_f_x.eqNode(f_x)).notNode(); - -// Node expectedConflict = f_f_f_x_neq_f_x.andNode(f_f_x_eq_x); - -// d_euf->assertFact(f_f_x_eq_x); -// d_euf->assertFact(f_f_f_x_neq_f_x); -// d_euf->check(d_level); - -// TS_ASSERT_EQUALS(1u, d_outputChannel.getNumCalls()); -// TS_ASSERT_EQUALS(CONFLICT, d_outputChannel.getIthCallType(0)); - -// Node realConflict = d_outputChannel.getIthNode(0); -// TS_ASSERT_EQUALS(expectedConflict, realConflict); - -// } - - /* test that !(x == x) is inconsistent */ -// void testSelfInconsistent() { -// Node x = d_nm->mkVar(*d_booleanType); -// Node x_neq_x = (x.eqNode(x)).notNode(); - -// d_euf->assertFact(x_neq_x); -// d_euf->check(d_level); - -// TS_ASSERT_EQUALS(1u, d_outputChannel.getNumCalls()); -// TS_ASSERT_EQUALS(x_neq_x, d_outputChannel.getIthNode(0)); -// TS_ASSERT_EQUALS(CONFLICT, d_outputChannel.getIthCallType(0)); -// } - -// /* test that (x == x) is consistent */ -// void testSelfConsistent() { -// Node x = d_nm->mkVar(*d_booleanType); -// Node x_eq_x = x.eqNode(x); - -// d_euf->assertFact(x_eq_x); -// d_euf->check(d_level); - -// TS_ASSERT_EQUALS(0u, d_outputChannel.getNumCalls()); -// } - - -// /* test that -// {f(f(f(x))) == x, -// f(f(f(f(f(x))))) = x, -// f(x) != x -// } is inconsistent */ -// void testChain() { -// Node x = d_nm->mkVar(*d_booleanType); -// Node f = d_nm->mkVar(*d_booleanType); -// Node f_x = d_nm->mkNode(kind::APPLY_UF, f, x); -// Node f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_x); -// Node f_f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_f_x); -// Node f_f_f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_f_f_x); -// Node f_f_f_f_f_x = d_nm->mkNode(kind::APPLY_UF, f, f_f_f_f_x); - -// Node f3_x_eq_x = f_f_f_x.eqNode(x); -// Node f5_x_eq_x = f_f_f_f_f_x.eqNode(x); -// Node f1_x_neq_x = f_x.eqNode(x).notNode(); - -// Node expectedConflict = d_nm->mkNode(kind::AND, -// f1_x_neq_x, -// f3_x_eq_x, -// f5_x_eq_x -// ); - -// d_euf->assertFact( f3_x_eq_x ); -// d_euf->assertFact( f5_x_eq_x ); -// d_euf->assertFact( f1_x_neq_x ); -// d_euf->check(d_level); - -// TS_ASSERT_EQUALS(1u, d_outputChannel.getNumCalls()); -// TS_ASSERT_EQUALS(CONFLICT, d_outputChannel.getIthCallType(0)); -// Node realConflict = d_outputChannel.getIthNode(0); -// TS_ASSERT_EQUALS(expectedConflict, realConflict); -// } - - -// void testPushPopA() { -// Node x = d_nm->mkVar(*d_booleanType); -// Node x_eq_x = x.eqNode(x); - -// d_ctxt->push(); -// d_euf->assertFact( x_eq_x ); -// d_euf->check(d_level); -// d_ctxt->pop(); -// d_euf->check(d_level); -// } - -// void testPushPopB() { -// Node x = d_nm->mkVar(*d_booleanType); -// Node f = d_nm->mkVar(*d_booleanType); -// Node f_x = d_nm->mkNode(kind::APPLY_UF, f, x); -// Node f_x_eq_x = f_x.eqNode(x); - -// d_euf->assertFact( f_x_eq_x ); -// d_ctxt->push(); -// d_euf->check(d_level); -// d_ctxt->pop(); -// d_euf->check(d_level); -// } - -}; diff --git a/test/unit/theory/union_find_black.h b/test/unit/theory/union_find_black.h index 6ba653946..fead619d2 100644 --- a/test/unit/theory/union_find_black.h +++ b/test/unit/theory/union_find_black.h @@ -5,25 +5,25 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 Black box testing of CVC4::theory::uf::morgan::UnionFind + ** \brief Black box testing of CVC4::datatypes::UnionFind ** - ** Black box testing of CVC4::theory::uf::morgan::UnionFind. + ** Black box testing of CVC4::theory::datatypes::UnionFind. **/ #include #include "context/context.h" #include "expr/node.h" -#include "theory/uf/morgan/union_find.h" +#include "theory/datatypes/union_find.h" using namespace CVC4; -using namespace CVC4::theory::uf::morgan; +using namespace CVC4::theory::datatypes; using namespace CVC4::context; using namespace std; diff --git a/test/unit/util/assert_white.h b/test/unit/util/assert_white.h index 6a8438136..6d88f89bd 100644 --- a/test/unit/util/assert_white.h +++ b/test/unit/util/assert_white.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/configuration_black.h b/test/unit/util/configuration_black.h index e06fe9636..faafb28f7 100644 --- a/test/unit/util/configuration_black.h +++ b/test/unit/util/configuration_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/congruence_closure_white.h b/test/unit/util/congruence_closure_white.h index f5e299377..187b7dc08 100644 --- a/test/unit/util/congruence_closure_white.h +++ b/test/unit/util/congruence_closure_white.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/datatype_black.h b/test/unit/util/datatype_black.h index 485820a61..ea8d8a900 100644 --- a/test/unit/util/datatype_black.h +++ b/test/unit/util/datatype_black.h @@ -3,7 +3,7 @@ ** \verbatim ** Original author: mdeters ** Major contributors: none - ** Minor contributors (to current version): none + ** Minor contributors (to current version): ajreynol ** This file is part of the CVC4 prototype. ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys) ** Courant Institute of Mathematical Sciences diff --git a/test/unit/util/exception_black.h b/test/unit/util/exception_black.h index 2bbd727fb..f92b6af93 100644 --- a/test/unit/util/exception_black.h +++ b/test/unit/util/exception_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/integer_black.h b/test/unit/util/integer_black.h index 5b8397f66..92846bdf1 100644 --- a/test/unit/util/integer_black.h +++ b/test/unit/util/integer_black.h @@ -2,10 +2,10 @@ /*! \file integer_black.h ** \verbatim ** Original author: taking - ** Major contributors: none - ** Minor contributors (to current version): cconway, mdeters + ** Major contributors: mdeters + ** Minor contributors (to current version): cconway ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/integer_white.h b/test/unit/util/integer_white.h index 1c6b03cdf..284c94670 100644 --- a/test/unit/util/integer_white.h +++ b/test/unit/util/integer_white.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/rational_black.h b/test/unit/util/rational_black.h index dcae800d1..66d119567 100644 --- a/test/unit/util/rational_black.h +++ b/test/unit/util/rational_black.h @@ -5,7 +5,7 @@ ** Major contributors: mdeters ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/rational_white.h b/test/unit/util/rational_white.h index 2fcb33642..b5d120c52 100644 --- a/test/unit/util/rational_white.h +++ b/test/unit/util/rational_white.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): mdeters ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/stats_black.h b/test/unit/util/stats_black.h index d32ef828c..7ba88edc6 100644 --- a/test/unit/util/stats_black.h +++ b/test/unit/util/stats_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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 diff --git a/test/unit/util/trans_closure_black.h b/test/unit/util/trans_closure_black.h index dfa066194..251e47a17 100644 --- a/test/unit/util/trans_closure_black.h +++ b/test/unit/util/trans_closure_black.h @@ -5,7 +5,7 @@ ** Major contributors: none ** Minor contributors (to current version): none ** This file is part of the CVC4 prototype. - ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys) + ** Copyright (c) 2009, 2010, 2011 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