diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2019-05-01 10:39:13 -0700 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2019-05-01 10:39:13 -0700 |
commit | 0cc88cf09c59effc41a076d4d78ef2082f780509 (patch) | |
tree | 29499ec78572f954eb053083a32ac4bfca4aa530 | |
parent | 689f1f89ccea1825a7b222e5af97f5133069ff74 (diff) | |
parent | 172e0bd41cbd410fb1e66bc32a9a9b8523bc40e2 (diff) |
1113 files changed, 10167 insertions, 5862 deletions
diff --git a/.clang-format b/.clang-format index cf788cb6b..01c8eeb25 100644 --- a/.clang-format +++ b/.clang-format @@ -15,5 +15,5 @@ BraceWrapping: BeforeCatch: true BeforeElse: true BreakBeforeBraces: Custom +DerivePointerAlignment: false ... - diff --git a/.github/dco.yml b/.github/dco.yml new file mode 100644 index 000000000..0c4b142e9 --- /dev/null +++ b/.github/dco.yml @@ -0,0 +1,2 @@ +require: + members: false diff --git a/.travis.yml b/.travis.yml index 265f42bb4..61a40a9f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ script: normal="$(echo -e '\033[0m')" red="$normal$(echo -e '\033[01;31m')" green="$normal$(echo -e '\033[01;32m')" configureCVC4() { echo "CVC4 config - $TRAVIS_CVC4_CONFIG"; - ./configure.sh --name=build --unit-testing $TRAVIS_CVC4_CONFIG + ./configure.sh --name=build --prefix=$(pwd)/build/install --unit-testing $TRAVIS_CVC4_CONFIG } error() { echo; @@ -69,6 +69,12 @@ script: make -j2 check ARGS='-LE regress[1-4]' CVC4_REGRESSION_ARGS='--no-early-exit' || error "BUILD/UNIT/SYSTEM/REGRESSION TEST FAILED" ctest -j2 -L example || error "RUNNING EXAMPLES FAILED" } + makeInstallCheck() { + cd build + make install -j2 + echo -e "#include <cvc4/cvc4.h>\nint main() { CVC4::ExprManager em; return 0; }" > /tmp/test.cpp + $CXX -std=c++11 /tmp/test.cpp -I install/include -L install/lib -lcvc4 -lcln || exit 1 + } run() { echo "travis_fold:start:$1" echo "Running $1" @@ -77,7 +83,7 @@ script: } [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_WITH_LFSC" ] && run contrib/get-lfsc-checker [ -n "$TRAVIS_CVC4" ] && run configureCVC4 - [ -n "$TRAVIS_CVC4" ] && run makeCheck + [ -n "$TRAVIS_CVC4" ] && run makeCheck && run makeInstallCheck [ -z "$TRAVIS_CVC4" ] && error "Unknown Travis-CI configuration" echo "travis_fold:end:load_script" - echo; echo "${green}EVERYTHING SEEMED TO PASS!${normal}" diff --git a/CMakeLists.txt b/CMakeLists.txt index 9af357790..d9cdf3481 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,14 +6,14 @@ cmake_minimum_required(VERSION 3.1) project(cvc4) set(CVC4_MAJOR 1) # Major component of the version of CVC4. -set(CVC4_MINOR 7) # Minor component of the version of CVC4. +set(CVC4_MINOR 8) # Minor component of the version of CVC4. set(CVC4_RELEASE 0) # Release component of the version of CVC4. # Extraversion component of the version of CVC4. set(CVC4_EXTRAVERSION "-prerelease") # Shared library versioning. Increment SOVERSION for every new CVC4 release. -set(CVC4_SOVERSION 5) +set(CVC4_SOVERSION 6) # Full release string for CVC4. if(CVC4_RELEASE) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..c54589e83 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,61 @@ +# Contributing + +External contributions to CVC4 may be proposed using git's standard pull request +mechanism. The following terms apply to all such contributions: + +- We require all pull requests to be squashed into a single commit before + being submitted and to be signed using `git commit -s`. + +- CVC4 is distributed under the terms of the modified BSD license (see + [COPYING](https://github.com/CVC4/CVC4/blob/master/COPYING) file). By + submitting a signed contribution, you automatically agree to accept the conditions + described in [COPYING](https://github.com/CVC4/CVC4/blob/master/COPYING). + +- By submitting a signed contribution, you additionally automatically agree + that the [Developer Certificate of Origin](https://developercertificate.org) + shown below applies to your contribution. + +``` +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. +``` + +If you are interested in becoming a long-term contributor to the CVC4 project, +please contact one of the +[project leaders](https://cvc4.github.io/people.html#project-leaders). +We'd be happy to point you to some internal documentation to help you out. diff --git a/INSTALL.md b/INSTALL.md index dc0de6cb4..fc32138f9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,6 +1,19 @@ -CVC4 prerelease version 1.7. +CVC4 prerelease version 1.8. ============================ +## Building CVC4 + + ./contrib/get-antlr-3.4 # download and build ANTLR + ./configure.sh # use --prefix to specify a prefix (default: /usr/local) + # use --name=<PATH> for custom build directory + cd <build_dir> # default is ./build + make # use -jN for parallel build with N threads + make check # to run default set of tests + make install # to install into the prefix specified above + +All binaries are built into `<build_dir>/bin`, the CVC4 library is built into +`<build_dir>/src`. + ## Supported Operating Systems CVC4 can be built on Linux and macOS. For Windows, CVC4 can be cross-compiled @@ -23,13 +36,14 @@ compatible. - [Python >= 2.7](https://www.python.org) - [GMP v4.2 (GNU Multi-Precision arithmetic library)](https://gmplib.org) - [libantlr3c v3.2 or v3.4 (ANTLR parser generator C support library)](http://www.antlr3.org/) +- [Java >= 1.6](https://www.java.com) Some features, such as the theory of floating-point numbers, require [optional dependencies](optional-dependencies) (see below). ### Installing libantlr3c: ANTLR parser generator C support library -For libantlr3c, you can use the script contrib/get-antlr-3.4. +For libantlr3c, you can use the script `contrib/get-antlr-3.4`. This will download, patch, and install libantlr3c. If you're on a 32-bit machine, or if you have difficulty building @@ -155,18 +169,6 @@ provided with CVC4. See [Testing CVC4](#Testing-CVC4) below for more details. -## Building CVC4 - - ./configure.sh # use --prefix to specify a prefix (default: /usr/local) - # use --name=<PATH> for custom build directory - cd <build_dir> # default is ./build - make # use -jN for parallel build with N threads - make check # to run default set of tests - make install # to install into the prefix specified above - -All binaries are built into `<build_dir>/bin`, the CVC4 library is built into -`<build_dir>/src`. - ## Language bindings CVC4 provides a complete and flexible C++ API (see `examples/api` for examples). @@ -1,12 +1,39 @@ -This file contains a summary of important user-visible changes. +This file contains a summary of important user-visible changes. Changes since 1.6 ================= New Features: -* Strings: Support for `str.replaceall` operator. +* Proofs: + * Support for bit-vector proofs with eager bitblasting (older versions only + supported proofs with lazy bitblasting). +* Strings: + * Support for `str.replaceall` operator. + * New option `--re-elim` to reduce regular expressions to extended string + operators, resulting in better performance on regular expression benchmarks + (enabled by default). +* SyGuS: + * Support for abduction (`--sygus-abduct`). Given a formula, this option uses + CVC4's SyGuS solver to find a sufficient condition such that the + conjunction of the condition and the formula is unsatisfiable. + * Support for two new term enumerator strategies: variable agnostic + (`--sygus-active-gen=var-agnostic`) and fast (`--sygus-active-gen=enum`). + By default, CVC4 tries to choose the best term enumerator strategy + automatically based on the input (`--sygus-active-gen=auto`). + * Support for streaming solutions of increasingly smaller size when using the + PBE solver (`--sygus-stream --sygus-pbe`). After the first solution is found + and printed, the solver will continue to look for new solutions and print + those, if any, that are smaller than previously printed solutions. + * Support for unification-based techniques in non-separable specifications + (`--sygus-unif`). For solving invariant problems a dedicate mode + (`--sygus-unif-boolean-heuristic-dt`) is available that builds candidate + solutions using heuristic decision tree learning. Improvements: +* Strings: + * Significantly better performance on string benchmarks over the core theory + and those with extended string functions like substring, contains, and + replace. Changes: * API change: Expr::iffExpr() is renamed to Expr::eqExpr() to reflect its @@ -14,7 +41,7 @@ Changes: * Compiling the language bindings now requires SWIG 3 instead of SWIG 2. * The CVC3 compatibility layer has been removed. * The build system now uses CMake instead of Autotools. Please refer to -* [INSTALL.md](https://github.com/CVC4/CVC4/blob/master/INSTALL.md) for + [INSTALL.md](https://github.com/CVC4/CVC4/blob/master/INSTALL.md) for up-to-date instructions on how to build CVC4. Changes since 1.5 @@ -171,4 +198,3 @@ Changes since 1.0 use -q. Previously, this would silence all output (including "sat" or "unsat") as well. Now, single -q silences messages and warnings, and double -qq silences all output (except on exception or signal). - @@ -56,39 +56,28 @@ We recommend that you visit our CVC4 tutorials online at: for help getting started using CVC4. +If you need help with using CVC4, please refer to +[http://cvc4.stanford.edu#technical-support]( + http://cvc4.stanford.edu#technical-support). -Contributing -------------------------------------------------------------------------------- - -We are always happy to hear feedback from our users: - -* if you need help with using CVC4, please refer to - [http://cvc4.stanford.edu/#Technical_Support](http://cvc4.stanford.edu/#Technical_Support). - -* if you need to report a bug with CVC4, or make a feature request, please - visit our bugtracker at our - [GitHub issues](https://github.com/CVC4/CVC4/issues) page or write to the - cvc-bugs@cs.stanford.edu mailing list. We are very grateful for bug reports, - as they help us improve CVC4, and patches are generally reviewed and accepted - quickly. +If you are using CVC4 in your work, or incorporating it into software of your +own, we'd like to invite you to leave a description and link to your +project/software on our [Third Party +Applications](http://cvc4.cs.stanford.edu/wiki/Public:Third_Party_Applications). -* if you are using CVC4 in your work, or incorporating it into software of your - own, we'd like to invite you to leave a description and link to your - project/software on our [Third Party Applications](http://cvc4.cs.stanford.edu/wiki/Public:Third_Party_Applications). -* if you are interested in contributing code (for example, a new - decision procedure implementation) to the CVC4 project, please - contact one of the [project leaders](#project_leaders). - We'd be happy to point you to some internal documentation to help you out. +Bug Reports +------------------------------------------------------------------------------- -Thank you for using CVC4! +If you need to report a bug with CVC4, or make a feature request, please visit +our bugtracker at our [GitHub issues](https://github.com/CVC4/CVC4/issues) +page. We are very grateful for bug reports, as they help us improve CVC4. -Project Leaders +Contributing ------------------------------------------------------------------------------- -* [Clark Barrett](http://theory.stanford.edu/~barrett/) (Stanford University) -* [Cesare Tinelli](http://homepage.cs.uiowa.edu/~tinelli/) (The University of Iowa) +Please refer to our [contributing guidelines](CONTRIBUTING.md). Authors @@ -96,43 +85,3 @@ Authors For a full list of authors, please refer to the [AUTHORS](https://github.com/CVC4/CVC4/blob/master/AUTHORS) file. - -History -------------------------------------------------------------------------------- - -The Cooperating Validity Checker series has a long history. The Stanford -Validity Checker (SVC) came first in 1996, incorporating theories and its own -SAT solver. Its successor, the Cooperating Validity Checker (CVC), had a more -optimized internal design, produced proofs, used the 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 "lite") while extending the feature set: CVC -Lite 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 fifth generation of this validity checker line. 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(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. diff --git a/RELEASE-NOTES b/RELEASE-NOTES deleted file mode 100644 index c9c1fabb5..000000000 --- a/RELEASE-NOTES +++ /dev/null @@ -1,159 +0,0 @@ -Release Notes for CVC4 1.6, June 2018 - -** Getting started - -If you run CVC4 without arguments, you will find yourself in an interactive -CVC4 session, which expects commands in CVC4's native language (the so-called -"presentation" language). To use SMT-LIB, use the "--lang smt" option on the -command line. For stricter adherence to the standard, use "--smtlib-strict" -(see below regarding SMT-LIB compliance). - -When a filename is given on the command line, the file's extension determines -the language parser that's used (e.g., file.smt is SMT-LIB 1.2, file.smt2 -is SMT-LIB 2.6, and file.cvc is the presentation language). To override -this, you can use the --lang option. - -** Type correctness - -The CVC family of systems relies on Type Correctness Conditions (TCCs) when -mixing two types that have a compatible base type. TCCs, and the checking of -such, are not supported by CVC4 1.6. This is an issue when mixing integers and -reals. A function defined only on integers can be applied to REAL (as INT is a -subtype of REAL), and CVC4 will not complain. It is up to the user to ensure -that the REAL expression must be an integer. If the REAL expression is not -an integer and is used where an INT is expected, CVC4 may produce strange -results. - -For example: - - f : INT -> INT; - ASSERT f(1/3) = 0; - ASSERT f(2/3) = 1; - CHECKSAT; - % sat - COUNTEREXAMPLE; - % f : (INT) -> INT = LAMBDA(x1:INT) : 0; - -This kind of problem can be identified by checking TCCs. Though CVC4 does not -(yet) support TCCs, CVC3 can be used to produce TCCs for this input (with the -+dump-tcc option). The TCC can then be checked by CVC4 or another solver. -(CVC3 can also check TCCs at the same time it creates them, with +tcc.) - -** Changes in CVC's Presentation Language - -The native language of all solvers in the CVC family, referred to as the -"presentation language," has undergone some revisions for CVC4. The -most notable is that CVC4 does _not_ add counterexample assertions to -the current assertion set after a SAT/INVALID result. For example: - - x, y : INT; - ASSERT x = 1 OR x = 2; - ASSERT y = 1 OR y = 2; - ASSERT x /= y; - CHECKSAT; - % sat - QUERY x = 1; - % invalid - QUERY x = 2; - % invalid - -Here, CVC4 responds "invalid" to the second and third queries, because -each has a counterexample (x=2 is a counterexample to the first, and -x=1 is a counterexample to the second). However, CVC3 will respond -with "valid" to one of these two, as the first query (the CHECKSAT) -had the side-effect of locking CVC3 into one of the two cases; the -later queries are effectively querying the counterexample that was -found by the first. CVC4 removes this side-effect of the CHECKSAT and -QUERY commands. - -CVC4 supports rational literals (of type REAL) in decimal; CVC3 did not -support decimals. - -CVC4 does not have support for predicate subtypes, although these are -planned for future releases. - -** SMT-LIB compliance - -Every effort has been made to make CVC4 compliant with the SMT-LIB 2.6 -standard (http://smtlib.org/). However, when parsing SMT-LIB input, -certain default settings don't match what is stated in the official -standard. To make CVC4 adhere more strictly to the standard, use the -"--smtlib-strict" command-line option. Even with this setting, CVC4 is -somewhat lenient; some non-conforming input may still be parsed and -processed. - -For the latest news on SMT-LIB compliance, please check: - - http://cvc4.cs.stanford.edu/wiki/SMT-LIB_Compliance - -** Getting statistics - -Statistics can be dumped on exit (both normal and abnormal exits) with -the --stats command line option. - -** Time and resource limits - -CVC4 can be made to self-timeout after a given number of milliseconds. -Use the --tlimit command line option to limit the entire run of -CVC4, or use --tlimit-per to limit each individual query separately. -Occasionally, you may encounter a problem for which --tlimit does not work very -well. If you suspect this might be the case, please report it as a bug. You -can also use "-vv" (double verbosity) to see what CVC4 is doing. - -Time-limited runs are not deterministic; two consecutive runs with the -same time limit might produce different results (i.e., one may time out -and respond with "unknown", while the other completes and provides an -answer). To ensure that results are reproducible, use --rlimit or ---rlimit-per. These options take a "resource count" (presently, based on -the number of SAT conflicts) that limits the search time. A word of -caution, though: there is no guarantee that runs of different versions of -CVC4 or of different builds of CVC4 (e.g., two CVC4 binaries with different -features enabled, or for different architectures) will interpret the resource -count in the same manner. - -CVC4 does not presently have a way to limit its memory use; you may opt -to run it from a shell after using "ulimit" to limit the size of the -heap. - -** Proof support - -CVC4 1.6 has support for proofs when using uninterpreted functions, arrays, -bitvectors, or their combinations, and proofs are enabled by default. -(Run the configure script with --disable-proof to disable proofs). Proofs -are exported in LFSC format. - -** Nonlinear arithmetic - -CVC4 1.6 has a state-of-the-art linear arithmetic solver as well as some -heuristic support for non-linear arithmetic. - -** Portfolio solving - -If enabled at configure-time (./configure --with-portfolio), a second -CVC4 binary will be produced ("pcvc4"). This binary has support for -running multiple instances of CVC4 in different threads. Use --threads=N -to specify the number of threads, and use --thread0="options for thread 0" ---thread1="options for thread 1", etc., to specify a configuration for the -threads. Lemmas are *not* shared between the threads by default; to adjust -this, use the --filter-lemma-length=N option to share lemmas of N literals -(or smaller). (Some lemmas are ineligible for sharing because they include -literals that are "local" to one thread.) - -Currently, the portfolio **does not work** with the theory of inductive -datatypes. This limitation will be addressed in a future release. - -** Questions ?? - -CVC4 and its predecessors have an active user base. You might want to -subscribe to the mailing list (http://cvc4.stanford.edu/#Technical_Support) -and post a question there. - -** Reporting bugs and making feature requests - -CVC4 is under active development. Should you find a bug in CVC4's -documentation, behavior, API, or SMT-LIB compliance, or if you have -a feature request, please let us know on our bugtracker at - - https://github.com/CVC4/CVC4/issues - -or send an email to cvc-bugs@cs.stanford.edu. diff --git a/cmake/ConfigureCVC4.cmake b/cmake/ConfigureCVC4.cmake index 84575d610..67c1f414d 100644 --- a/cmake/ConfigureCVC4.cmake +++ b/cmake/ConfigureCVC4.cmake @@ -2,6 +2,7 @@ include(CheckCXXSourceCompiles) include(CheckIncludeFile) include(CheckIncludeFileCXX) include(CheckSymbolExists) +include(CheckLibraryExists) # Check whether "long" and "int64_t" are distinct types w.r.t. overloading. # Even if they have the same size, they can be distinct, and some platforms @@ -54,6 +55,11 @@ if(CVC4_WINDOWS_BUILD) endif() else() check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) + if(NOT HAVE_CLOCK_GETTIME) + unset(HAVE_CLOCK_GETTIME CACHE) + check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) + find_library(RT_LIBRARIES NAMES rt) + endif() endif() check_symbol_exists(ffs "strings.h" HAVE_FFS) check_symbol_exists(optreset "getopt.h" HAVE_DECL_OPTRESET) diff --git a/configure.sh b/configure.sh index e53d8caa7..9bf33ae8a 100755 --- a/configure.sh +++ b/configure.sh @@ -74,7 +74,6 @@ Optional Path to Optional Packages: --lfsc-dir=PATH path to top level of LFSC source tree --symfpu-dir=PATH path to top level of SymFPU source tree -Report bugs to <cvc4-bugs@cs.stanford.edu>. EOF exit 0 } diff --git a/contrib/get-authors b/contrib/get-authors index 6050e8bb6..df147d10d 100755 --- a/contrib/get-authors +++ b/contrib/get-authors @@ -1,37 +1,58 @@ #!/bin/sh # # get-authors -# Copyright (c) 2009-2018 The CVC4 Project +# Copyright (c) 2009-2019 The CVC4 Project # # usage: get-authors [ files... ] # -# This script uses git to get the original author +# This script uses git blame -w -N -C to get the original author # gituser="`git config user.name` <`git config user.email`>" -if [ "$1" = "--email" ]; then - strip_email=cat - shift -else - strip_email="sed 's, *<[^>]*@[^>]*>,,g'" -fi - while [ $# -gt 0 ]; do f=$1 shift - contributors= - if [ -z "`grep " \*\* Top contributors" $f`" ] + if ! grep -q " \*\* Top contributors" "$f" then header_lines=0 else - header_lines=`grep "\*\*\/" $f -m 1 -n | cut -d ':' -f 1` + header_lines=$(grep "\*\*\/" "$f" -m 1 -n | cut -d ':' -f 1) if [ -z $header_lines ]; then header_lines=0; fi fi ((header_lines++)) - total_lines=`wc -l "$f" | awk '{print$1}'` - git blame -w -M --incremental -L $header_lines,$total_lines "$f" | \ - gawk '/^[0-9a-f]+ [0-9]+ [0-9]+ [0-9]+$/ {nl=$4;} /^summary .*copyright/ {nl=0} /^author / {$1=""; author=$0;} /^author-mail / {mail=$2} /^filename / {while(nl--) {print author,mail}}' | \ + total_lines=$(wc -l "$f" | awk '{print$1}') + + # Note: Instead of using the porcelain format, we extract the author name + # information from the humand readable format since it prints the source code + # and we want to exclude specific lines of code. + + # Each line looks a follows: + # + # sha1 filename (Author Name 2019-03-25 13:36:07 -0800 42) code ... + + git blame -w -M -C -L $header_lines,$total_lines "$f" | \ + + # Discard everthing left to first '(' + awk -F '(' '{print $2}' | \ + + # Discard the source code left to first ')' and omit lines that begin + # with: + # (1) #include + # (2) namespace + # (3) } ... namespace ... + # (4) empty lines + # + awk -F ')' \ + '$2 !~ /^[ \t]*(#include|namespace|}.*namespace.*|[ \t]*$)/ {print $1}' | \ + + # Keep author names only, remove the last 4 columns in ( ... ) + awk 'NF{NF-=4};1' | \ + + # Determine top three contributors + sort | uniq -c | sort -rn | head -n3 | \ + + # Fix author names sed "s,Not Committed Yet <not.committed.yet>,$gituser," | \ sed 's/PaulMeng/Paul Meng/' | \ sed 's/barrettcw/Clark Barrett/' | \ @@ -45,10 +66,12 @@ while [ $# -gt 0 ]; do sed 's/Martin/Martin Brain/' | \ sed 's/justinxu421/Justin Xu/' | \ sed 's/yoni206/Yoni Zohar/' | \ - eval "$strip_email" | \ - sort | uniq -c | sort -nr | head -n 3 | \ - ( while read lines author; do - contributors="${contributors:+$contributors, }$author" - done; \ - echo "$contributors") + sed 's/ayveejay/Andrew V. Jones/' | \ + + # Remove first columns from uniq -c (number of lines) + awk '{$1=""; print}' | \ + + # Comma separated list of author names, remove leading whitespaces, and + # remove trailing comma + tr '\n' ', ' | sed 's/^[ \t]*//' | sed 's/,$/\n/' done diff --git a/contrib/run-script-smtcomp2019 b/contrib/run-script-smtcomp2019 new file mode 100644 index 000000000..849df0a6b --- /dev/null +++ b/contrib/run-script-smtcomp2019 @@ -0,0 +1,157 @@ +#!/bin/bash + +cvc4=./cvc4 +bench="$1" + +logic=$(expr "$(grep -m1 '^[^;]*set-logic' "$bench")" : ' *(set-logic *\([A-Z_]*\) *) *$') + +# use: trywith [params..] +# to attempt a run. Only thing printed on stdout is "sat" or "unsat", in which +# case this run script terminates immediately. Otherwise, this function +# returns normally and prints the output of the solver to stderr. +function trywith { + limit=$1; shift; + result="$(ulimit -S -t "$limit";$cvc4 -L smt2.6 --no-incremental --no-checking --no-interactive "$@" $bench)" + case "$result" in + sat|unsat) echo "$result"; exit 0;; + *) echo "$result" >&2;; + esac +} + +# use: finishwith [params..] +# to run cvc4 and let it output whatever it will to stdout. +function finishwith { + $cvc4 -L smt2.6 --no-incremental --no-checking --no-interactive "$@" $bench +} + +case "$logic" in + +QF_LRA) + trywith 200 --miplib-trick --miplib-trick-subs=4 --use-approx --lemmas-on-replay-failure --replay-early-close-depth=4 --replay-lemma-reject-cut=128 --replay-reject-cut=512 --unconstrained-simp --use-soi + finishwith --no-restrict-pivots --use-soi --new-prop --unconstrained-simp + ;; +QF_LIA) + # same as QF_LRA but add --pb-rewrites + finishwith --miplib-trick --miplib-trick-subs=4 --use-approx --lemmas-on-replay-failure --replay-early-close-depth=4 --replay-lemma-reject-cut=128 --replay-reject-cut=512 --unconstrained-simp --use-soi --pb-rewrites + ;; +QF_NIA) + trywith 300 --nl-ext-tplanes --decision=internal + trywith 30 --no-nl-ext-tplanes --decision=internal + # this totals up to more than 20 minutes, although notice that smaller bit-widths may quickly fail + trywith 300 --solve-int-as-bv=2 --bitblast=eager --bv-sat-solver=cadical --bitblast-aig --no-bv-abstraction + trywith 300 --solve-int-as-bv=4 --bitblast=eager --bv-sat-solver=cadical --bitblast-aig --no-bv-abstraction + trywith 300 --solve-int-as-bv=8 --bitblast=eager --bv-sat-solver=cadical --bitblast-aig --no-bv-abstraction + trywith 300 --solve-int-as-bv=16 --bitblast=eager --bv-sat-solver=cadical --bitblast-aig --no-bv-abstraction + finishwith --solve-int-as-bv=32 --bitblast=eager --bv-sat-solver=cadical --bitblast-aig --no-bv-abstraction + ;; +QF_NRA) + trywith 300 --nl-ext-tplanes --decision=internal + trywith 300 --nl-ext-tplanes --decision=justification --no-nl-ext-factor + trywith 30 --nl-ext-tplanes --decision=internal --solve-real-as-int + finishwith --nl-ext-tplanes --decision=justification + ;; +# all logics with UF + quantifiers should either fall under this or special cases below +ALIA|AUFLIA|AUFLIRA|AUFNIRA|UF|UFIDL|UFLIA|UFLRA|UFNIA|UFDT|UFDTLIA|AUFDTLIA|AUFBVDTLIA|AUFNIA) + # the following is designed for a run time of 20 min. + # initial runs 1min + trywith 30 --simplification=none --full-saturate-quant + trywith 30 --no-e-matching --full-saturate-quant + # trigger selections 3min + trywith 30 --relevant-triggers --full-saturate-quant + trywith 30 --trigger-sel=max --full-saturate-quant + trywith 30 --multi-trigger-when-single --full-saturate-quant + trywith 30 --multi-trigger-when-single --multi-trigger-priority --full-saturate-quant + trywith 30 --multi-trigger-cache --full-saturate-quant + trywith 30 --no-multi-trigger-linear --full-saturate-quant + # other 4min + trywith 30 --pre-skolem-quant --full-saturate-quant + trywith 30 --inst-when=full --full-saturate-quant + trywith 30 --no-e-matching --no-quant-cf --full-saturate-quant + trywith 30 --full-saturate-quant --quant-ind + trywith 30 --decision=internal --simplification=none --no-inst-no-entail --no-quant-cf --full-saturate-quant + trywith 30 --decision=internal --full-saturate-quant + trywith 30 --term-db-mode=relevant --full-saturate-quant + trywith 30 --fs-interleave --full-saturate-quant + # finite model find 3min + trywith 30 --finite-model-find --mbqi=none + trywith 30 --finite-model-find --decision=internal + trywith 30 --finite-model-find --macros-quant --macros-quant-mode=all + trywith 30 --finite-model-find --uf-ss=no-minimal + trywith 60 --finite-model-find --fmf-inst-engine + # long runs 9min + trywith 240 --finite-model-find --decision=internal + finishwith --full-saturate-quant + ;; +ABVFP|BVFP|FP) + finishwith --full-saturate-quant + ;; +UFBV) + # most problems in UFBV are essentially BV + trywith 300 --full-saturate-quant --decision=internal + trywith 300 --full-saturate-quant --cbqi-nested-qe --decision=internal + trywith 30 --full-saturate-quant --no-cbqi-innermost --global-negate + finishwith --finite-model-find + ;; +BV) + trywith 120 --full-saturate-quant + trywith 120 --full-saturate-quant --no-cbqi-innermost + trywith 300 --full-saturate-quant --cbqi-nested-qe --decision=internal + trywith 30 --full-saturate-quant --no-cbqi-bv + trywith 30 --full-saturate-quant --cbqi-bv-ineq=eq-slack + # finish 10min + finishwith --full-saturate-quant --no-cbqi-innermost --global-negate + ;; +LIA|LRA|NIA|NRA) + trywith 30 --full-saturate-quant --nl-ext-tplanes + trywith 300 --full-saturate-quant --no-cbqi-innermost + trywith 300 --full-saturate-quant --cbqi-nested-qe + finishwith --full-saturate-quant --cbqi-nested-qe --decision=internal + ;; +QF_AUFBV) + trywith 600 + finishwith --decision=justification-stoponly + ;; +QF_ABV) + trywith 50 --ite-simp --simp-with-care --repeat-simp --arrays-weak-equiv + trywith 500 --arrays-weak-equiv + finishwith --ite-simp --simp-with-care --repeat-simp --arrays-weak-equiv + ;; +QF_UFBV) + finishwith --bitblast=eager --bv-sat-solver=cadical + ;; +QF_BV) + finishwith --unconstrained-simp --bv-div-zero-const --bv-intro-pow2 --bitblast=eager --bv-sat-solver=cadical --bitblast-aig --bv-eq-slicer=auto --no-bv-abstraction + ;; +QF_AUFLIA) + finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=justification + ;; +QF_AX) + finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=internal + ;; +QF_AUFNIA) + finishwith --decision=justification --no-arrays-eager-index --arrays-eager-lemmas + ;; +QF_ALIA) + trywith 70 --decision=justification --arrays-weak-equiv + finishwith --decision=justification-stoponly --no-arrays-eager-index --arrays-eager-lemmas + ;; +QF_SLIA) + trywith 500 --strings-exp --rewrite-divk --lang=smt2.6.1 + finishwith --strings-exp --rewrite-divk --lang=smt2.6.1 --strings-fmf + ;; +QF_ABVFP) + finishwith + ;; +QF_BVFP) + finishwith + ;; +QF_FP) + finishwith + ;; +*) + # just run the default + finishwith + ;; + +esac + diff --git a/contrib/run-script-smtcomp2019-application b/contrib/run-script-smtcomp2019-application new file mode 100755 index 000000000..58db84d36 --- /dev/null +++ b/contrib/run-script-smtcomp2019-application @@ -0,0 +1,84 @@ +#!/bin/bash + +cvc4=./cvc4-application + +line="" +while [[ -z "$line" ]]; do + read line +done +if [ "$line" != '(set-option :print-success true)' ]; then + echo 'ERROR: first line supposed to be set-option :print-success, but got: "'"$line"'"' >&2 + exit 1 +fi +echo success +line="" +while [[ -z "$line" ]]; do + read line +done +logic=$(expr "$line" : ' *(set-logic *\([A-Z_]*\) *) *$') +if [ -z "$logic" ]; then + echo 'ERROR: second line supposed to be set-logic, but got: "'"$line"'"' >&2 + exit 1 +fi +echo success + +function runcvc4 { + # we run in this way for line-buffered input, otherwise memory's a + # concern (plus it mimics what we'll end up getting from an + # application-track trace runner?) + $cvc4 --force-logic="$logic" -L smt2.6 --print-success --no-checking --no-interactive "$@" <&0- +} + +case "$logic" in + +ALIA|QF_ALIA|QF_LRA|QF_UFLIA|QF_UFLRA|UFLRA) + runcvc4 --incremental + ;; +ANIA|QF_ANIA|QF_NIA|QF_UFNIA|QF_NRA) + runcvc4 --tear-down-incremental=1 + ;; +LIA|LRA) + runcvc4 --incremental + ;; +QF_AUFLIA) + runcvc4 --no-arrays-eager-index --arrays-eager-lemmas --incremental + ;; +QF_BV) + runcvc4 --tear-down-incremental=4 --bv-eq-slicer=auto --bv-div-zero-const --bv-intro-pow2 + ;; +QF_LIA) + runcvc4 --tear-down-incremental=1 --unconstrained-simp + ;; +QF_UFBV) + runcvc4 --incremental + ;; +QF_UF) + runcvc4 --incremental + ;; +QF_AUFBV) + runcvc4 --incremental + ;; +QF_ABV) + runcvc4 --incremental + ;; +ABVFP) + runcvc4 --incremental + ;; +BVFP) + runcvc4 --incremental + ;; +QF_ABVFP) + runcvc4 --incremental + ;; +QF_BVFP) + runcvc4 --incremental + ;; +QF_FP) + runcvc4 --incremental + ;; +*) + # just run the default + runcvc4 --incremental + ;; + +esac diff --git a/contrib/run-script-smtcomp2019-unsat-cores b/contrib/run-script-smtcomp2019-unsat-cores new file mode 100644 index 000000000..1454e7a8a --- /dev/null +++ b/contrib/run-script-smtcomp2019-unsat-cores @@ -0,0 +1,83 @@ +#!/bin/bash + +cvc4=./cvc4 +bench="$1" + +logic=$(expr "$(grep -m1 '^[^;]*set-logic' "$bench")" : ' *(set-logic *\([A-Z_]*\) *) *$') + +# use: finishwith [params..] +# to run cvc4 and let it output whatever it will to stdout. +function finishwith { + $cvc4 -L smt2.6 --no-incremental --no-checking --no-interactive "$@" $bench +} + +case "$logic" in + +QF_LRA) + finishwith --no-restrict-pivots --use-soi --new-prop --unconstrained-simp + ;; +QF_LIA) + finishwith --miplib-trick --miplib-trick-subs=4 --use-approx --lemmas-on-replay-failure --replay-early-close-depth=4 --replay-lemma-reject-cut=128 --replay-reject-cut=512 --unconstrained-simp --use-soi + ;; +QF_NIA) + finishwith --solve-int-as-bv=32 --bitblast=eager --bv-sat-solver=cryptominisat + ;; +QF_NRA) + finishwith --nl-ext --nl-ext-tplanes + ;; +# all logics with UF + quantifiers should either fall under this or special cases below +ALIA|AUFLIA|AUFLIRA|AUFNIRA|UF|UFIDL|UFLIA|UFLRA|UFNIA|UFDT|UFDTLIA|AUFDTLIA|AUFBVDTLIA|AUFNIA|ABVFP|BVFP|FP) + finishwith --full-saturate-quant + ;; +UFBV) + finishwith --finite-model-find + ;; +BV) + finishwith --full-saturate-quant --decision=internal + ;; +LIA|LRA) + finishwith --full-saturate-quant --cbqi-nested-qe --decision=internal + ;; +NIA|NRA) + finishwith --full-saturate-quant --cbqi-nested-qe --decision=internal + ;; +QF_AUFBV) + finishwith --decision=justification-stoponly + ;; +QF_ABV) + finishwith --ite-simp --simp-with-care --arrays-weak-equiv + ;; +QF_UFBV) + finishwith --bitblast=eager --bv-sat-solver=cryptominisat + ;; +QF_BV) + finishwith --bv-div-zero-const --bv-eq-slicer=auto --no-bv-abstraction + ;; +QF_AUFLIA) + finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=justification + ;; +QF_AX) + finishwith --no-arrays-eager-index --arrays-eager-lemmas --decision=internal + ;; +QF_AUFNIA) + finishwith --decision=justification --no-arrays-eager-index --arrays-eager-lemmas + ;; +QF_ALIA) + finishwith --decision=justification-stoponly --no-arrays-eager-index --arrays-eager-lemmas + ;; +QF_ABVFP) + finishwith + ;; +QF_BVFP) + finishwith + ;; +QF_FP) + finishwith + ;; +*) + # just run the default + finishwith + ;; + +esac + diff --git a/contrib/update-copyright.pl b/contrib/update-copyright.pl index 26db51e25..148392aab 100755 --- a/contrib/update-copyright.pl +++ b/contrib/update-copyright.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # # update-copyright.pl -# Copyright (c) 2009-2018 The CVC4 Project +# Copyright (c) 2009-2019 The CVC4 Project # # usage: update-copyright [-m] [files/directories...] # update-copyright [-h | --help] @@ -35,18 +35,19 @@ my $excluded_directories = '^(CVS|generated)$'; my $excluded_paths = '^('; +# note: first excluded path regexp must not start with a '|' # different license -$excluded_paths .= '|src/util/channel.h'; +$excluded_paths .= 'src/util/channel.h'; # minisat license $excluded_paths .= '|src/prop/(bv)?minisat/core/.*'; $excluded_paths .= '|src/prop/(bv)?minisat/mtl/.*'; $excluded_paths .= '|src/prop/(bv)?minisat/simp/.*'; $excluded_paths .= '|src/prop/(bv)?minisat/utils/.*'; -$excluded_paths .= '$)'; +$excluded_paths .= ')$'; # Years of copyright for the template. E.g., the string # "1985, 1987, 1992, 1997, 2008" or "2006-2009" or whatever. -my $years = '2009-2018'; +my $years = '2009-2019'; my $standard_template = <<EOF; ** This file is part of the CVC4 project. diff --git a/examples/SimpleVC.java b/examples/SimpleVC.java index 50f226ed6..125b4f848 100644 --- a/examples/SimpleVC.java +++ b/examples/SimpleVC.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/bitvectors-new.cpp b/examples/api/bitvectors-new.cpp index 7070f6748..d0c26f134 100644 --- a/examples/api/bitvectors-new.cpp +++ b/examples/api/bitvectors-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file bitvectors.cpp +/*! \file bitvectors-new.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Liana Hadarean, Morgan Deters + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,7 +16,7 @@ #include <iostream> -//#include <cvc4/cvc4.h> // use this after CVC4 is properly installed +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" using namespace std; @@ -50,9 +50,9 @@ int main() Sort bitvector32 = slv.mkBitVectorSort(32); // Variables - Term x = slv.mkVar("x", bitvector32); - Term a = slv.mkVar("a", bitvector32); - Term b = slv.mkVar("b", bitvector32); + Term x = slv.mkConst(bitvector32, "x"); + Term a = slv.mkConst(bitvector32, "a"); + Term b = slv.mkConst(bitvector32, "b"); // First encode the assumption that x must be equal to a or b Term x_eq_a = slv.mkTerm(EQUAL, x, a); @@ -63,9 +63,9 @@ int main() slv.assertFormula(assumption); // Introduce a new variable for the new value of x after assignment. - Term new_x = slv.mkVar("new_x", bitvector32); // x after executing code (0) + Term new_x = slv.mkConst(bitvector32, "new_x"); // x after executing code (0) Term new_x_ = - slv.mkVar("new_x_", bitvector32); // x after executing code (1) or (2) + slv.mkConst(bitvector32, "new_x_"); // x after executing code (1) or (2) // Encoding code (0) // new_x = x == a ? b : a; diff --git a/examples/api/bitvectors.cpp b/examples/api/bitvectors.cpp index e058dcef8..59257976d 100644 --- a/examples/api/bitvectors.cpp +++ b/examples/api/bitvectors.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/bitvectors_and_arrays-new.cpp b/examples/api/bitvectors_and_arrays-new.cpp index 3d4e6bca0..955a83cff 100644 --- a/examples/api/bitvectors_and_arrays-new.cpp +++ b/examples/api/bitvectors_and_arrays-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file bitvectors_and_arrays.cpp +/*! \file bitvectors_and_arrays-new.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Aina Niemetz, Morgan Deters + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,7 +16,8 @@ #include <iostream> #include <cmath> -// #include <cvc4/cvc4.h> // use this after CVC4 is properly installed + +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" using namespace std; @@ -52,7 +53,7 @@ int main() Sort arraySort = slv.mkArraySort(indexSort, elementSort); // Variables - Term current_array = slv.mkVar("current_array", arraySort); + Term current_array = slv.mkConst(arraySort, "current_array"); // Making a bit-vector constant Term zero = slv.mkBitVector(index_size, 0u); diff --git a/examples/api/bitvectors_and_arrays.cpp b/examples/api/bitvectors_and_arrays.cpp index e6af948b9..983da71db 100644 --- a/examples/api/bitvectors_and_arrays.cpp +++ b/examples/api/bitvectors_and_arrays.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/combination-new.cpp b/examples/api/combination-new.cpp index 8c968c95e..e78e8919f 100644 --- a/examples/api/combination-new.cpp +++ b/examples/api/combination-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file combination.cpp +/*! \file combination-new.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Tim King + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,7 +18,7 @@ #include <iostream> -//#include <cvc4/cvc4.h> // use this after CVC4 is properly installed +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" using namespace std; @@ -51,12 +51,12 @@ int main() Sort intPred = slv.mkFunctionSort(integer, boolean); // Variables - Term x = slv.mkVar("x", u); - Term y = slv.mkVar("y", u); + Term x = slv.mkConst(u, "x"); + Term y = slv.mkConst(u, "y"); // Functions - Term f = slv.mkVar("f", uToInt); - Term p = slv.mkVar("p", intPred); + Term f = slv.mkConst(uToInt, "f"); + Term p = slv.mkConst(intPred, "p"); // Constants Term zero = slv.mkReal(0); diff --git a/examples/api/combination.cpp b/examples/api/combination.cpp index 67371e4c2..0d8ae0494 100644 --- a/examples/api/combination.cpp +++ b/examples/api/combination.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/datatypes-new.cpp b/examples/api/datatypes-new.cpp index 14ddcd383..08918fc87 100644 --- a/examples/api/datatypes-new.cpp +++ b/examples/api/datatypes-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file datatypes.cpp +/*! \file datatypes-new.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Morgan Deters, Tim King + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,9 +15,10 @@ **/ #include <iostream> -//#include <cvc4/cvc4.h> // To follow the wiki +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" + using namespace CVC4::api; void test(Solver& slv, Sort& consListSort) @@ -115,7 +116,7 @@ void test(Solver& slv, Sort& consListSort) } } - Term a = slv.declareFun("a", paramConsIntListSort); + Term a = slv.mkConst(paramConsIntListSort, "a"); std::cout << "term " << a << " is of sort " << a.getSort() << std::endl; Term head_a = slv.mkTerm( diff --git a/examples/api/datatypes.cpp b/examples/api/datatypes.cpp index 200f1bb2c..3bf1df12f 100644 --- a/examples/api/datatypes.cpp +++ b/examples/api/datatypes.cpp @@ -2,9 +2,9 @@ /*! \file datatypes.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Aina Niemetz, Tim King + ** Morgan Deters, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/extract-new.cpp b/examples/api/extract-new.cpp index 96961458e..cb7d96fa5 100644 --- a/examples/api/extract-new.cpp +++ b/examples/api/extract-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file extract.cpp +/*! \file extract-new.cpp ** \verbatim ** Top contributors (to current version): - ** Clark Barrett, Aina Niemetz + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,7 +16,7 @@ #include <iostream> -//#include <cvc4/cvc4.h> // use this after CVC4 is properly installed +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" using namespace std; @@ -29,7 +29,7 @@ int main() Sort bitvector32 = slv.mkBitVectorSort(32); - Term x = slv.mkVar("a", bitvector32); + Term x = slv.mkConst(bitvector32, "a"); OpTerm ext_31_1 = slv.mkOpTerm(BITVECTOR_EXTRACT_OP, 31, 1); Term x_31_1 = slv.mkTerm(BITVECTOR_EXTRACT, ext_31_1, x); diff --git a/examples/api/extract.cpp b/examples/api/extract.cpp index 5aed0168c..c9240363e 100644 --- a/examples/api/extract.cpp +++ b/examples/api/extract.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/helloworld-new.cpp b/examples/api/helloworld-new.cpp index 484995143..a7fbe22e9 100644 --- a/examples/api/helloworld-new.cpp +++ b/examples/api/helloworld-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file helloworld.cpp +/*! \file helloworld-new.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Tim King, Kshitij Bansal + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,7 +16,7 @@ #include <iostream> -//#include <cvc4/cvc4.h> // use this after CVC4 is properly installed +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" using namespace CVC4::api; @@ -24,7 +24,7 @@ using namespace CVC4::api; int main() { Solver slv; - Term helloworld = slv.mkVar("Hello World!", slv.getBooleanSort()); + Term helloworld = slv.mkVar(slv.getBooleanSort(), "Hello World!"); std::cout << helloworld << " is " << slv.checkValidAssuming(helloworld) << std::endl; return 0; diff --git a/examples/api/helloworld.cpp b/examples/api/helloworld.cpp index 667faed50..1235c4c55 100644 --- a/examples/api/helloworld.cpp +++ b/examples/api/helloworld.cpp @@ -2,9 +2,9 @@ /*! \file helloworld.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Kshitij Bansal + ** Tim King, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/java/BitVectors.java b/examples/api/java/BitVectors.java index 2f5188bba..fec871357 100644 --- a/examples/api/java/BitVectors.java +++ b/examples/api/java/BitVectors.java @@ -2,9 +2,9 @@ /*! \file BitVectors.java ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/java/BitVectorsAndArrays.java b/examples/api/java/BitVectorsAndArrays.java index d92cba79a..11474d1e1 100644 --- a/examples/api/java/BitVectorsAndArrays.java +++ b/examples/api/java/BitVectorsAndArrays.java @@ -2,9 +2,9 @@ /*! \file BitVectorsAndArrays.java ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/java/CVC4Streams.java b/examples/api/java/CVC4Streams.java index 96a9e8aed..8e395b512 100644 --- a/examples/api/java/CVC4Streams.java +++ b/examples/api/java/CVC4Streams.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/java/Combination.java b/examples/api/java/Combination.java index 55743c62b..6d34e16c4 100644 --- a/examples/api/java/Combination.java +++ b/examples/api/java/Combination.java @@ -2,9 +2,9 @@ /*! \file Combination.java ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/java/Datatypes.java b/examples/api/java/Datatypes.java index 376d038d8..2c79bb75f 100644 --- a/examples/api/java/Datatypes.java +++ b/examples/api/java/Datatypes.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/java/HelloWorld.java b/examples/api/java/HelloWorld.java index 07ae34a3d..56acffa76 100644 --- a/examples/api/java/HelloWorld.java +++ b/examples/api/java/HelloWorld.java @@ -2,7 +2,13 @@ /*! \file HelloWorld.java ** \verbatim ** Top contributors (to current version): - ** + ** Morgan Deters, Tim King + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** ** This file is part of the CVC4 project. ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. diff --git a/examples/api/java/LinearArith.java b/examples/api/java/LinearArith.java index eab17ea43..368178155 100644 --- a/examples/api/java/LinearArith.java +++ b/examples/api/java/LinearArith.java @@ -2,9 +2,9 @@ /*! \file LinearArith.java ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/java/PipedInput.java b/examples/api/java/PipedInput.java index f19636f78..13883d033 100644 --- a/examples/api/java/PipedInput.java +++ b/examples/api/java/PipedInput.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/java/Strings.java b/examples/api/java/Strings.java index dd5d2938b..fe017980b 100644 --- a/examples/api/java/Strings.java +++ b/examples/api/java/Strings.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tianyi Liang ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/linear_arith-new.cpp b/examples/api/linear_arith-new.cpp index d643b85bc..2edcaf71e 100644 --- a/examples/api/linear_arith-new.cpp +++ b/examples/api/linear_arith-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file linear_arith.cpp +/*! \file linear_arith-new.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Aina Niemetz + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,7 +17,7 @@ #include <iostream> -//#include <cvc4/cvc4.h> // use this after CVC4 is properly installed +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" using namespace std; @@ -36,8 +36,8 @@ int main() Sort integer = slv.getIntegerSort(); // Variables - Term x = slv.mkVar("x", integer); - Term y = slv.mkVar("y", real); + Term x = slv.mkConst(integer, "x"); + Term y = slv.mkConst(real, "y"); // Constants Term three = slv.mkReal(3); diff --git a/examples/api/linear_arith.cpp b/examples/api/linear_arith.cpp index 3a3dd9aa0..83a0064c9 100644 --- a/examples/api/linear_arith.cpp +++ b/examples/api/linear_arith.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/sets-new.cpp b/examples/api/sets-new.cpp index 2dcfbbc02..60df7a82f 100644 --- a/examples/api/sets-new.cpp +++ b/examples/api/sets-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file sets.cpp +/*! \file sets-new.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Kshitij Bansal + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,7 +16,7 @@ #include <iostream> -//#include <cvc4/cvc4.h> // use this after CVC4 is properly installed +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" using namespace std; @@ -40,9 +40,9 @@ int main() // Verify union distributions over intersection // (A union B) intersection C = (A intersection C) union (B intersection C) { - Term A = slv.mkVar("A", set); - Term B = slv.mkVar("B", set); - Term C = slv.mkVar("C", set); + Term A = slv.mkConst(set, "A"); + Term B = slv.mkConst(set, "B"); + Term C = slv.mkConst(set, "C"); Term unionAB = slv.mkTerm(UNION, A, B); Term lhs = slv.mkTerm(INTERSECTION, unionAB, C); @@ -59,7 +59,7 @@ int main() // Verify emptset is a subset of any set { - Term A = slv.mkVar("A", set); + Term A = slv.mkConst(set, "A"); Term emptyset = slv.mkEmptySet(set); Term theorem = slv.mkTerm(SUBSET, emptyset, A); @@ -81,7 +81,7 @@ int main() Term two_three = slv.mkTerm(UNION, singleton_two, singleton_three); Term intersection = slv.mkTerm(INTERSECTION, one_two, two_three); - Term x = slv.mkVar("x", integer); + Term x = slv.mkConst(integer, "x"); Term e = slv.mkTerm(MEMBER, x, intersection); diff --git a/examples/api/sets.cpp b/examples/api/sets.cpp index 17a93a905..3110c01e3 100644 --- a/examples/api/sets.cpp +++ b/examples/api/sets.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/api/strings-new.cpp b/examples/api/strings-new.cpp index c88ccc9c0..42630dc0e 100644 --- a/examples/api/strings-new.cpp +++ b/examples/api/strings-new.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file strings.cpp +/*! \file strings-new.cpp ** \verbatim ** Top contributors (to current version): - ** Clark Barrett, Paul Meng, Tim King + ** Aina Niemetz, Makai Mann ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,7 +16,7 @@ #include <iostream> -//#include <cvc4/cvc4.h> // use this after CVC4 is properly installed +// #include "cvc4/api/cvc4cpp.h" // use this after CVC4 is properly installed #include "api/cvc4cpp.h" using namespace CVC4::api; @@ -43,9 +43,9 @@ int main() Term ab = slv.mkString(str_ab); Term abc = slv.mkString("abc"); // String variables - Term x = slv.mkVar("x", string); - Term y = slv.mkVar("y", string); - Term z = slv.mkVar("z", string); + Term x = slv.mkConst(string, "x"); + Term y = slv.mkConst(string, "y"); + Term z = slv.mkConst(string, "z"); // String concatenation: x.ab.y Term lhs = slv.mkTerm(STRING_CONCAT, x, ab, y); @@ -70,8 +70,8 @@ int main() slv.mkTerm(STRING_TO_REGEXP, slv.mkString("h"))); // String variables - Term s1 = slv.mkVar("s1", string); - Term s2 = slv.mkVar("s2", string); + Term s1 = slv.mkConst(string, "s1"); + Term s2 = slv.mkConst(string, "s2"); // String concatenation: s1.s2 Term s = slv.mkTerm(STRING_CONCAT, s1, s2); diff --git a/examples/api/strings.cpp b/examples/api/strings.cpp index 02e11d672..96f4dd400 100644 --- a/examples/api/strings.cpp +++ b/examples/api/strings.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tianyi Liang, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/hashsmt/sha1.hpp b/examples/hashsmt/sha1.hpp index 4e7f60e39..a09da39c4 100644 --- a/examples/hashsmt/sha1.hpp +++ b/examples/hashsmt/sha1.hpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/hashsmt/sha1_collision.cpp b/examples/hashsmt/sha1_collision.cpp index 2193c7b68..e26b2623b 100644 --- a/examples/hashsmt/sha1_collision.cpp +++ b/examples/hashsmt/sha1_collision.cpp @@ -2,9 +2,9 @@ /*! \file sha1_collision.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Tim King + ** Dejan Jovanovic, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/hashsmt/sha1_inversion.cpp b/examples/hashsmt/sha1_inversion.cpp index ef5191cb7..667c3c4e0 100644 --- a/examples/hashsmt/sha1_inversion.cpp +++ b/examples/hashsmt/sha1_inversion.cpp @@ -2,9 +2,9 @@ /*! \file sha1_inversion.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Tim King, Andres Noetzli + ** Dejan Jovanovic, Aina Niemetz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/hashsmt/word.cpp b/examples/hashsmt/word.cpp index f067ef57b..189eaf485 100644 --- a/examples/hashsmt/word.cpp +++ b/examples/hashsmt/word.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/hashsmt/word.h b/examples/hashsmt/word.h index 223a5b5d5..cbe53d549 100644 --- a/examples/hashsmt/word.h +++ b/examples/hashsmt/word.h @@ -2,9 +2,9 @@ /*! \file word.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters + ** Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/nra-translate/normalize.cpp b/examples/nra-translate/normalize.cpp index a6c146622..3ca09c5bf 100644 --- a/examples/nra-translate/normalize.cpp +++ b/examples/nra-translate/normalize.cpp @@ -2,9 +2,9 @@ /*! \file normalize.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Tim King, Aina Niemetz + ** Dejan Jovanovic, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/nra-translate/smt2info.cpp b/examples/nra-translate/smt2info.cpp index 55ddb0997..513b52a39 100644 --- a/examples/nra-translate/smt2info.cpp +++ b/examples/nra-translate/smt2info.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/nra-translate/smt2todreal.cpp b/examples/nra-translate/smt2todreal.cpp index 04a33624c..11f5ad4f8 100644 --- a/examples/nra-translate/smt2todreal.cpp +++ b/examples/nra-translate/smt2todreal.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Tim King, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/nra-translate/smt2toisat.cpp b/examples/nra-translate/smt2toisat.cpp index c4649dcae..5992cd0dc 100644 --- a/examples/nra-translate/smt2toisat.cpp +++ b/examples/nra-translate/smt2toisat.cpp @@ -2,9 +2,9 @@ /*! \file smt2toisat.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Tim King, Aina Niemetz + ** Dejan Jovanovic, Andrew Reynolds, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/nra-translate/smt2tomathematica.cpp b/examples/nra-translate/smt2tomathematica.cpp index fd344caa9..8f0764e92 100644 --- a/examples/nra-translate/smt2tomathematica.cpp +++ b/examples/nra-translate/smt2tomathematica.cpp @@ -2,9 +2,9 @@ /*! \file smt2tomathematica.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Tim King, Andrew Reynolds + ** Dejan Jovanovic, Andrew Reynolds, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/nra-translate/smt2toqepcad.cpp b/examples/nra-translate/smt2toqepcad.cpp index acfd6bf97..28e699b6f 100644 --- a/examples/nra-translate/smt2toqepcad.cpp +++ b/examples/nra-translate/smt2toqepcad.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Tim King, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/nra-translate/smt2toredlog.cpp b/examples/nra-translate/smt2toredlog.cpp index feb5a583a..0629b5d1c 100644 --- a/examples/nra-translate/smt2toredlog.cpp +++ b/examples/nra-translate/smt2toredlog.cpp @@ -2,9 +2,9 @@ /*! \file smt2toredlog.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Tim King, Aina Niemetz + ** Dejan Jovanovic, Andrew Reynolds, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/sets-translate/sets_translate.cpp b/examples/sets-translate/sets_translate.cpp index 7a1990545..f7513a401 100644 --- a/examples/sets-translate/sets_translate.cpp +++ b/examples/sets-translate/sets_translate.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -204,7 +204,7 @@ class Mapper { } else { vector<Expr> children = e.getChildren(); children.insert(children.begin(), setoperators[ make_pair(t, e.getKind()) ]); - ret = em->mkExpr(kind::APPLY, children); + ret = em->mkExpr(kind::APPLY_UF, children); } // cout << "returning " << ret << endl; return ret; diff --git a/examples/simple_vc_cxx.cpp b/examples/simple_vc_cxx.cpp index d6b6212c0..ad18ae5b7 100644 --- a/examples/simple_vc_cxx.cpp +++ b/examples/simple_vc_cxx.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/simple_vc_quant_cxx.cpp b/examples/simple_vc_quant_cxx.cpp index 4821e1464..a8bbfe29a 100644 --- a/examples/simple_vc_quant_cxx.cpp +++ b/examples/simple_vc_quant_cxx.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/examples/translator.cpp b/examples/translator.cpp index 5be837e63..82a206d4b 100644 --- a/examples/translator.cpp +++ b/examples/translator.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/proofs/signatures/CMakeLists.txt b/proofs/signatures/CMakeLists.txt index 8af026952..6e9c8947d 100644 --- a/proofs/signatures/CMakeLists.txt +++ b/proofs/signatures/CMakeLists.txt @@ -5,8 +5,11 @@ set(core_signature_files sat.plf + er.plf smt.plf th_base.plf + lrat.plf + drat.plf th_arrays.plf th_bv.plf th_bv_bitblast.plf diff --git a/proofs/signatures/core_rewrites.plf b/proofs/signatures/core_rewrites.plf deleted file mode 100644 index ca2c1fa03..000000000 --- a/proofs/signatures/core_rewrites.plf +++ /dev/null @@ -1,123 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;; Rewrite rules -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; t rewrites to t' -(declare rw_term - (! s sort - (! t (term s) - (! t' (term s) - type)))) - -(declare rw_formula - (! f formula - (! f' formula - type))) - - -(declare apply_rw_formula - (! f formula - (! f' formula - (! rw (rw_formula f f') - (! fh (th_holds f) - (th_holds f')))))) - - -;; Identity rewrite rules -(declare rw_term_id - (! s sort - (! t (term s) - (rw_term s t t)))) - -(declare rw_term_trans - (! s sort - (! t1 (term s) - (! t2 (term s) - (! t3 (term s) - (! rw12 (rw_term _ t1 t2) - (! rw23 (rw_term _ t2 t3) - (rw_term s t1 t3)))))))) - -;; rw_symmetry - -(declare rw_formula_trans - (! f1 formula - (! f2 formula - (! f3 formula - (! rw1 (rw_formula f1 f2) - (! rw2 (rw_formula f2 f3) - (rw_formula f1 f3))))))) - - -(declare rw_op1_id - (! s sort - (! a (term s) - (! a' (term s) - (! rw (rw_term _ a a') - (! op term_op1 - (rw_term _ (op _ a) (op _ a')))))))) - -(declare rw_op2_id - (! s sort - (! a (term s) - (! a' (term s) - (! b (term s) - (! b' (term s) - (! rw (rw_term _ a a') - (! rw (rw_term _ b b') - (! op term_op2 - (rw_term _ (op _ a b) (op _ a' b'))))))))))) - -(declare rw_pred1_id - (! s sort - (! a (term s) - (! a' (term s) - (! rw (rw_term _ a a') - (! op op_pred1 - (rw_formula (op _ a) (op _ a')))))))) - -(declare rw_pred2_id - (! s sort - (! a (term s) - (! a' (term s) - (! b (term s) - (! b' (term s) - (! rw (rw_term _ a a') - (! rw (rw_term _ b b') - (! op op_pred2 - (rw_formula (op _ a b) (op _ a' b'))))))))))) - -(declare rw_eq_id - (! s sort - (! a (term s) - (! a' (term s) - (! b (term s) - (! b' (term s) - (! rw (rw_term _ a a') - (! rw (rw_term _ b b') - (rw_formula (= s a b) (= s a' b')))))))))) - -(declare rw_formula_op1_id - (! f formula - (! f' formula - (! frw (rw_formula f f') - (! op formula_op1 - (rw_formula (op f) (op f'))))))) - -(declare rw_formula_op2_id - (! f1 formula - (! f1' formula - (! f2 formula - (! f2' formula - (! frw1 (rw_formula f1 f1') - (! frw2 (rw_formula f2 f2') - (! op formula_op2 - (rw_formula (op f1 f2) (op f1' f2')))))))))) - - -(apply_rw_formula - (! f formula - (! f' formula - (! r (rw_formula f f') - (! h (th_holds f) - (th_holds f'))))))
\ No newline at end of file diff --git a/proofs/signatures/ex_bv.plf b/proofs/signatures/ex_bv.plf index 58494e793..332d7765c 100644 --- a/proofs/signatures/ex_bv.plf +++ b/proofs/signatures/ex_bv.plf @@ -24,9 +24,9 @@ (decl_bblast _ _ _ (bv_bbl_bvand 4 _ _ _ _ _ bt1 bt3) (\ bt5 ; bitblasting formulas -(th_let_pf _ (bv_bbl_eq _ _ _ _ _ _ bt1 bt2) (\ bf1 +(th_let_pf _ (bv_bbl_= _ _ _ _ _ _ bt1 bt2) (\ bf1 (th_let_pf _ (bv_bbl_bvult _ _ _ _ _ _ bt1 bt5) (\ bf2 -(th_let_pf _ (bv_bbl_eq _ _ _ _ _ _ bt2 bt4) (\ bf3 +(th_let_pf _ (bv_bbl_= _ _ _ _ _ _ bt2 bt4) (\ bf3 ; CNFication ; a.4 V ~b.4 @@ -44,7 +44,7 @@ trust ))) (\ C3 -; b.4 +; b.4 (satlem _ _ (asf _ _ _ a2 (\ l2 (clausify_false @@ -52,7 +52,7 @@ ))) (\ C6 -(satlem_simplify _ _ _ +(satlem_simplify _ _ _ (R _ _ (R _ _ C6 C2 v2) C3 v1) (\ x x)) ))))))))))))))))))))))))))))))))))))))))))))) diff --git a/proofs/signatures/ex_bv_rewrite.plf b/proofs/signatures/ex_bv_rewrite.plf deleted file mode 100644 index fbe593502..000000000 --- a/proofs/signatures/ex_bv_rewrite.plf +++ /dev/null @@ -1,41 +0,0 @@ -(check -(% x var_bv -(% y var_bv -(% a var_bv -(% A0 (th_holds true) -(% A1 (th_holds - (= (BitVec 1) (a_var_bv 1 x) - (bvnot 1 (bvxnor 1 (bvxor 1 (a_var_bv 1 a) (a_bv 1 (bvc b1 bvn))) - (bvxor 1 (a_var_bv 1 a) (a_bv 1 (bvc b0 bvn))) )))) -(: (th_holds - (= (BitVec 1) (a_var_bv 1 x) - (bvxor 1 (bvnot 1 (a_var_bv 1 a)) (a_var_bv 1 a)))) - -;; print rewritten assertions - -(@ ones (a_bv 1 (bvc b1 bvn)) -(@ zero (a_bv 1 (bvc b0 bvn)) -(@ xorone (bvxor 1 (a_var_bv 1 a) ones) -(@ xorzero (bvxor 1 (a_var_bv 1 a) zero) -(@ t1 (bvxor 1 xorone xorzero) -(@ t2 (bvxnor 1 xorone xorzero) -(@ t3 (bvnot 1 t2) -(@ t4 (bvnot 1 t1) -(@ t5 (bvxor 1 (bvnot 1 (a_var_bv 1 a)) (a_var_bv 1 a)) -;; adding identity rewrite proofs -(@ xor_onerw (rw_term_id 1 xorone) -(@ xor_zerorw (rw_term_id 1 xorzero) -(@ rw1 (xnor_elim 1 _ _ _ _ xor_onerw xor_zerorw) ;; bvxnor t1 t2 -> bvnot (bvxor t1 t2) -(@ rw2 (xor_zero 1 _ _ _ _ (rw_term_id 1 (a_var_bv 1 a)) (rw_term_id 1 zero)) -(@ rw3 (xor_one 1 _ _ _ _ (rw_term_id 1 (a_var_bv 1 a)) (rw_term_id 1 ones)) -(@ rw4 (rw_bvop2_id 1 _ _ _ _ rw3 rw2 bvxor) ;; bvxor t1 t2 -> bvxor t1' t2' -(@ rw5 (rw_bvop1_id 1 _ _ rw4 bvnot) ;; bvnot (bvxor t1 t2) -> bvnot (bvxor t1' t2') -(@ rw6 (rw_term_trans 1 _ _ _ rw1 rw5) ;; bvxnor t1 t2 -> bvnot (bvxor t1' t2') -(@ rw7 (rw_bvop1_id 1 _ _ rw6 bvnot) ;; (bvnot (bvxnor t1 t2)) ->(bvnot (bvnot (bvxor t1' t2'))) -(@ rw8 (not_idemp 1 _ _ (rw_term_id 1 t5)) ;; (bvnot (bvnot (bvxor t1' t2'))) -> bvxor t1' t2' -(@ rw9 (rw_term_trans 1 _ _ _ rw7 rw8) ;; (bvnot (bvxnor t1 t2)) -> (bvxor t1' t2') -(@ rw10 (rw_term_id 1 (a_var_bv 1 x)) -(@ rw11 (rw_eq_id 1 _ _ _ _ rw10 rw9) ;; x = t1 => x = t' -(apply_rw_formula _ _ rw11 A1) - -)))))))))))))))))))))))))))))
\ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0124bf4f9..cff31dbcd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -88,6 +88,8 @@ libcvc4_add_sources( preprocessing/passes/sort_infer.h preprocessing/passes/static_learning.cpp preprocessing/passes/static_learning.h + preprocessing/passes/sygus_abduct.cpp + preprocessing/passes/sygus_abduct.h preprocessing/passes/sygus_inference.cpp preprocessing/passes/sygus_inference.h preprocessing/passes/symmetry_breaker.cpp @@ -139,6 +141,8 @@ libcvc4_add_sources( proof/dimacs_printer.h proof/drat/drat_proof.cpp proof/drat/drat_proof.h + proof/er/er_proof.cpp + proof/er/er_proof.h proof/lemma_proof.cpp proof/lemma_proof.h proof/lfsc_proof_printer.cpp @@ -235,7 +239,6 @@ libcvc4_add_sources( smt/model_core_builder.h smt/smt_engine.cpp smt/smt_engine.h - smt/smt_engine_check_proof.cpp smt/smt_engine_scope.cpp smt/smt_engine_scope.h smt/smt_statistics_registry.cpp @@ -622,10 +625,14 @@ libcvc4_add_sources( theory/shared_terms_database.h theory/sort_inference.cpp theory/sort_inference.h + theory/strings/normal_form.cpp + theory/strings/normal_form.h theory/strings/regexp_elim.cpp theory/strings/regexp_elim.h theory/strings/regexp_operation.cpp theory/strings/regexp_operation.h + theory/strings/regexp_solver.cpp + theory/strings/regexp_solver.h theory/strings/skolem_cache.cpp theory/strings/skolem_cache.h theory/strings/theory_strings.cpp @@ -768,6 +775,11 @@ endif() target_link_libraries(cvc4 ${GMP_LIBRARIES}) target_include_directories(cvc4 PUBLIC ${GMP_INCLUDE_DIR}) +# Add rt library +# Note: For glibc < 2.17 we have to additionally link against rt (man clock_gettime). +# RT_LIBRARIES should be empty for glibc >= 2.17 +target_link_libraries(cvc4 ${RT_LIBRARIES}) + #-----------------------------------------------------------------------------# # Visit main subdirectory after creating target cvc4. For target main, we have # to manually add library dependencies since we can't use @@ -789,27 +801,27 @@ install(FILES api/cvc4cpp.h api/cvc4cppkind.h DESTINATION - include/api) + include/cvc4/api) install(FILES base/configuration.h base/exception.h base/listener.h base/modal_exception.h DESTINATION - include/base) + include/cvc4/base) install(FILES context/cdhashmap_forward.h context/cdhashset_forward.h context/cdinsert_hashmap_forward.h context/cdlist_forward.h DESTINATION - include/context) + include/cvc4/context) install(FILES include/cvc4.h include/cvc4_public.h include/cvc4parser_public.h DESTINATION - include) + include/cvc4) install(FILES expr/array.h expr/array_store_all.h @@ -829,7 +841,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expr/kind.h ${CMAKE_CURRENT_BINARY_DIR}/expr/expr_manager.h DESTINATION - include/expr) + include/cvc4/expr) install(FILES options/argument_extender.h options/arith_heuristic_pivot_rule.h @@ -846,38 +858,38 @@ install(FILES options/sygus_out_mode.h options/theoryof_mode.h DESTINATION - include/options) + include/cvc4/options) install(FILES parser/input.h parser/parser.h parser/parser_builder.h parser/parser_exception.h DESTINATION - include/parser) + include/cvc4/parser) install(FILES printer/sygus_print_callback.h DESTINATION - include/printer) + include/cvc4/printer) install(FILES proof/unsat_core.h DESTINATION - include/proof) + include/cvc4/proof) install(FILES smt/command.h smt/logic_exception.h smt/smt_engine.h DESTINATION - include/smt) + include/cvc4/smt) install(FILES smt_util/lemma_channels.h smt_util/lemma_input_channel.h smt_util/lemma_output_channel.h DESTINATION - include/smt_util) + include/cvc4/smt_util) install(FILES theory/logic_info.h DESTINATION - include/theory) + include/cvc4/theory) install(FILES util/abstract_value.h util/bitvector.h @@ -904,4 +916,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/util/integer.h ${CMAKE_CURRENT_BINARY_DIR}/util/rational.h DESTINATION - include/util) + include/cvc4/util) + +# Fix include paths for all public headers. +# Note: This is a temporary fix until the new C++ API is in place. +install(CODE "execute_process(COMMAND + ${CMAKE_CURRENT_LIST_DIR}/fix-install-headers.sh + ${CMAKE_INSTALL_PREFIX})") diff --git a/src/api/cvc4cpp.cpp b/src/api/cvc4cpp.cpp index ddb17c3a7..ab34e62b4 100644 --- a/src/api/cvc4cpp.cpp +++ b/src/api/cvc4cpp.cpp @@ -2,9 +2,9 @@ /*! \file cvc4cpp.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -52,12 +52,10 @@ const static std::unordered_map<Kind, CVC4::Kind, KindHashFunction> s_kinds{ /* Builtin ------------------------------------------------------------- */ {UNINTERPRETED_CONSTANT, CVC4::Kind::UNINTERPRETED_CONSTANT}, {ABSTRACT_VALUE, CVC4::Kind::ABSTRACT_VALUE}, - {FUNCTION, CVC4::Kind::FUNCTION}, - {APPLY, CVC4::Kind::APPLY}, {EQUAL, CVC4::Kind::EQUAL}, {DISTINCT, CVC4::Kind::DISTINCT}, - {VARIABLE, CVC4::Kind::VARIABLE}, - {BOUND_VARIABLE, CVC4::Kind::BOUND_VARIABLE}, + {CONSTANT, CVC4::Kind::VARIABLE}, + {VARIABLE, CVC4::Kind::BOUND_VARIABLE}, {LAMBDA, CVC4::Kind::LAMBDA}, {CHOICE, CVC4::Kind::CHOICE}, {CHAIN, CVC4::Kind::CHAIN}, @@ -300,12 +298,10 @@ const static std::unordered_map<CVC4::Kind, Kind, CVC4::kind::KindHashFunction> /* Builtin --------------------------------------------------------- */ {CVC4::Kind::UNINTERPRETED_CONSTANT, UNINTERPRETED_CONSTANT}, {CVC4::Kind::ABSTRACT_VALUE, ABSTRACT_VALUE}, - {CVC4::Kind::FUNCTION, FUNCTION}, - {CVC4::Kind::APPLY, APPLY}, {CVC4::Kind::EQUAL, EQUAL}, {CVC4::Kind::DISTINCT, DISTINCT}, - {CVC4::Kind::VARIABLE, VARIABLE}, - {CVC4::Kind::BOUND_VARIABLE, BOUND_VARIABLE}, + {CVC4::Kind::VARIABLE, CONSTANT}, + {CVC4::Kind::BOUND_VARIABLE, VARIABLE}, {CVC4::Kind::LAMBDA, LAMBDA}, {CVC4::Kind::CHOICE, CHOICE}, {CVC4::Kind::CHAIN, CHAIN}, @@ -1373,6 +1369,13 @@ std::ostream& operator<<(std::ostream& out, return out; } +std::ostream& operator<<(std::ostream& out, + const std::vector<DatatypeConstructorDecl>& vector) +{ + container_to_stream(out, vector); + return out; +} + /* DatatypeDecl ------------------------------------------------------------- */ DatatypeDecl::DatatypeDecl(const std::string& name, bool isCoDatatype) @@ -1963,7 +1966,7 @@ Term Solver::mkPi() const } template <typename T> -Term Solver::mkConstHelper(T t) const +Term Solver::mkValHelper(T t) const { try { @@ -1990,7 +1993,7 @@ Term Solver::mkRealFromStrHelper(std::string s) const CVC4::Rational r = s.find('/') != std::string::npos ? CVC4::Rational(s) : CVC4::Rational::fromDecimal(s); - return mkConstHelper<CVC4::Rational>(r); + return mkValHelper<CVC4::Rational>(r); } catch (const std::invalid_argument& e) { @@ -2013,7 +2016,7 @@ Term Solver::mkReal(int32_t val) const { try { - return mkConstHelper<CVC4::Rational>(CVC4::Rational(val)); + return mkValHelper<CVC4::Rational>(CVC4::Rational(val)); } catch (const std::invalid_argument& e) { @@ -2025,7 +2028,7 @@ Term Solver::mkReal(int64_t val) const { try { - return mkConstHelper<CVC4::Rational>(CVC4::Rational(val)); + return mkValHelper<CVC4::Rational>(CVC4::Rational(val)); } catch (const std::invalid_argument& e) { @@ -2037,7 +2040,7 @@ Term Solver::mkReal(uint32_t val) const { try { - return mkConstHelper<CVC4::Rational>(CVC4::Rational(val)); + return mkValHelper<CVC4::Rational>(CVC4::Rational(val)); } catch (const std::invalid_argument& e) { @@ -2049,7 +2052,7 @@ Term Solver::mkReal(uint64_t val) const { try { - return mkConstHelper<CVC4::Rational>(CVC4::Rational(val)); + return mkValHelper<CVC4::Rational>(CVC4::Rational(val)); } catch (const std::invalid_argument& e) { @@ -2061,7 +2064,7 @@ Term Solver::mkReal(int32_t num, int32_t den) const { try { - return mkConstHelper<CVC4::Rational>(CVC4::Rational(num, den)); + return mkValHelper<CVC4::Rational>(CVC4::Rational(num, den)); } catch (const std::invalid_argument& e) { @@ -2073,7 +2076,7 @@ Term Solver::mkReal(int64_t num, int64_t den) const { try { - return mkConstHelper<CVC4::Rational>(CVC4::Rational(num, den)); + return mkValHelper<CVC4::Rational>(CVC4::Rational(num, den)); } catch (const std::invalid_argument& e) { @@ -2085,7 +2088,7 @@ Term Solver::mkReal(uint32_t num, uint32_t den) const { try { - return mkConstHelper<CVC4::Rational>(CVC4::Rational(num, den)); + return mkValHelper<CVC4::Rational>(CVC4::Rational(num, den)); } catch (const std::invalid_argument& e) { @@ -2097,7 +2100,7 @@ Term Solver::mkReal(uint64_t num, uint64_t den) const { try { - return mkConstHelper<CVC4::Rational>(CVC4::Rational(num, den)); + return mkValHelper<CVC4::Rational>(CVC4::Rational(num, den)); } catch (const std::invalid_argument& e) { @@ -2139,7 +2142,7 @@ Term Solver::mkEmptySet(Sort s) const { CVC4_API_ARG_CHECK_EXPECTED(s.isNull() || s.isSet(), s) << "null sort or set sort"; - return mkConstHelper<CVC4::EmptySet>(CVC4::EmptySet(*s.d_type)); + return mkValHelper<CVC4::EmptySet>(CVC4::EmptySet(*s.d_type)); } Term Solver::mkSepNil(Sort sort) const @@ -2159,22 +2162,22 @@ Term Solver::mkSepNil(Sort sort) const Term Solver::mkString(const char* s, bool useEscSequences) const { - return mkConstHelper<CVC4::String>(CVC4::String(s, useEscSequences)); + return mkValHelper<CVC4::String>(CVC4::String(s, useEscSequences)); } Term Solver::mkString(const std::string& s, bool useEscSequences) const { - return mkConstHelper<CVC4::String>(CVC4::String(s, useEscSequences)); + return mkValHelper<CVC4::String>(CVC4::String(s, useEscSequences)); } Term Solver::mkString(const unsigned char c) const { - return mkConstHelper<CVC4::String>(CVC4::String(std::string(1, c))); + return mkValHelper<CVC4::String>(CVC4::String(std::string(1, c))); } Term Solver::mkString(const std::vector<unsigned>& s) const { - return mkConstHelper<CVC4::String>(CVC4::String(s)); + return mkValHelper<CVC4::String>(CVC4::String(s)); } Term Solver::mkUniverseSet(Sort sort) const @@ -2200,7 +2203,7 @@ Term Solver::mkBVFromIntHelper(uint32_t size, uint64_t val) const CVC4_API_ARG_CHECK_EXPECTED(size > 0, size) << "a bit-width > 0"; try { - return mkConstHelper<CVC4::BitVector>(CVC4::BitVector(size, val)); + return mkValHelper<CVC4::BitVector>(CVC4::BitVector(size, val)); } catch (const std::invalid_argument& e) { @@ -2221,7 +2224,7 @@ Term Solver::mkBVFromStrHelper(std::string s, uint32_t base) const << "base 2, 10, or 16"; try { - return mkConstHelper<CVC4::BitVector>(CVC4::BitVector(s, base)); + return mkValHelper<CVC4::BitVector>(CVC4::BitVector(s, base)); } catch (const std::invalid_argument& e) { @@ -2242,7 +2245,7 @@ Term Solver::mkBVFromStrHelper(uint32_t size, CVC4_API_CHECK(val.modByPow2(size) == val) << "Overflow in bitvector construction (specified bitvector size " << size << " too small to hold value " << s << ")"; - return mkConstHelper<CVC4::BitVector>(CVC4::BitVector(size, val)); + return mkValHelper<CVC4::BitVector>(CVC4::BitVector(size, val)); } catch (const std::invalid_argument& e) { @@ -2276,7 +2279,7 @@ Term Solver::mkPosInf(uint32_t exp, uint32_t sig) const { CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; - return mkConstHelper<CVC4::FloatingPoint>( + return mkValHelper<CVC4::FloatingPoint>( FloatingPoint::makeInf(FloatingPointSize(exp, sig), false)); } @@ -2284,7 +2287,7 @@ Term Solver::mkNegInf(uint32_t exp, uint32_t sig) const { CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; - return mkConstHelper<CVC4::FloatingPoint>( + return mkValHelper<CVC4::FloatingPoint>( FloatingPoint::makeInf(FloatingPointSize(exp, sig), true)); } @@ -2292,7 +2295,7 @@ Term Solver::mkNaN(uint32_t exp, uint32_t sig) const { CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; - return mkConstHelper<CVC4::FloatingPoint>( + return mkValHelper<CVC4::FloatingPoint>( FloatingPoint::makeNaN(FloatingPointSize(exp, sig))); } @@ -2300,7 +2303,7 @@ Term Solver::mkPosZero(uint32_t exp, uint32_t sig) const { CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; - return mkConstHelper<CVC4::FloatingPoint>( + return mkValHelper<CVC4::FloatingPoint>( FloatingPoint::makeZero(FloatingPointSize(exp, sig), false)); } @@ -2308,19 +2311,19 @@ Term Solver::mkNegZero(uint32_t exp, uint32_t sig) const { CVC4_API_CHECK(Configuration::isBuiltWithSymFPU()) << "Expected CVC4 to be compiled with SymFPU support"; - return mkConstHelper<CVC4::FloatingPoint>( + return mkValHelper<CVC4::FloatingPoint>( FloatingPoint::makeZero(FloatingPointSize(exp, sig), true)); } Term Solver::mkRoundingMode(RoundingMode rm) const { - return mkConstHelper<CVC4::RoundingMode>(s_rmodes.at(rm)); + return mkValHelper<CVC4::RoundingMode>(s_rmodes.at(rm)); } Term Solver::mkUninterpretedConst(Sort sort, int32_t index) const { CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null sort"; - return mkConstHelper<CVC4::UninterpretedConstant>( + return mkValHelper<CVC4::UninterpretedConstant>( CVC4::UninterpretedConstant(*sort.d_type, index)); } @@ -2378,19 +2381,20 @@ Term Solver::mkFloatingPoint(uint32_t exp, uint32_t sig, Term val) const CVC4_API_ARG_CHECK_EXPECTED( val.getSort().isBitVector() && val.d_expr->isConst(), val) << "bit-vector constant"; - return mkConstHelper<CVC4::FloatingPoint>( + return mkValHelper<CVC4::FloatingPoint>( CVC4::FloatingPoint(exp, sig, val.d_expr->getConst<BitVector>())); } -/* Create variables */ +/* Create constants */ /* -------------------------------------------------------------------------- */ -Term Solver::mkVar(const std::string& symbol, Sort sort) const +Term Solver::mkConst(Sort sort, const std::string& symbol) const { try { CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null sort"; - Term res = d_exprMgr->mkVar(symbol, *sort.d_type); + Term res = symbol.empty() ? d_exprMgr->mkVar(*sort.d_type) + : d_exprMgr->mkVar(symbol, *sort.d_type); (void)res.d_expr->getType(true); /* kick off type checking */ return res; } @@ -2400,42 +2404,16 @@ Term Solver::mkVar(const std::string& symbol, Sort sort) const } } -Term Solver::mkVar(Sort sort) const -{ - try - { - CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null sort"; - Term res = d_exprMgr->mkVar(*sort.d_type); - (void)res.d_expr->getType(true); /* kick off type checking */ - return res; - } - catch (const CVC4::TypeCheckingException& e) - { - throw CVC4ApiException(e.getMessage()); - } -} - -Term Solver::mkBoundVar(const std::string& symbol, Sort sort) const -{ - try - { - CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null sort"; - Term res = d_exprMgr->mkBoundVar(symbol, *sort.d_type); - (void)res.d_expr->getType(true); /* kick off type checking */ - return res; - } - catch (const CVC4::TypeCheckingException& e) - { - throw CVC4ApiException(e.getMessage()); - } -} +/* Create variables */ +/* -------------------------------------------------------------------------- */ -Term Solver::mkBoundVar(Sort sort) const +Term Solver::mkVar(Sort sort, const std::string& symbol) const { try { CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null sort"; - Term res = d_exprMgr->mkBoundVar(*sort.d_type); + Term res = symbol.empty() ? d_exprMgr->mkBoundVar(*sort.d_type) + : d_exprMgr->mkBoundVar(symbol, *sort.d_type); (void)res.d_expr->getType(true); /* kick off type checking */ return res; } @@ -2457,8 +2435,9 @@ void Solver::checkMkTerm(Kind kind, uint32_t nchildren) const mk == kind::metakind::PARAMETERIZED || mk == kind::metakind::OPERATOR, kind) << "Only operator-style terms are created with mkTerm(), " - "to create variables and constants see mkVar(), mkBoundVar(), " - "and mkConst()."; + "to create variables, constants and values see mkVar(), mkConst() " + "and the respective theory-specific functions to create values, " + "e.g., mkBitVector()."; CVC4_API_KIND_CHECK_EXPECTED( nchildren >= minArity(kind) && nchildren <= maxArity(kind), kind) << "Terms with kind " << kindToString(kind) << " must have at least " @@ -2524,21 +2503,6 @@ Term Solver::mkTerm(Kind kind) const } } -Term Solver::mkTerm(Kind kind, Sort sort) const -{ - try - { - CVC4_API_KIND_CHECK_EXPECTED(kind == SEP_NIL, kind) << "SEP_NIL"; - Term res = d_exprMgr->mkNullaryOperator(*sort.d_type, extToIntKind(kind)); - (void)res.d_expr->getType(true); /* kick off type checking */ - return res; - } - catch (const CVC4::TypeCheckingException& e) - { - throw CVC4ApiException(e.getMessage()); - } -} - Term Solver::mkTerm(Kind kind, Term child) const { try @@ -2765,15 +2729,14 @@ std::vector<Expr> Solver::termVectorToExprs( OpTerm Solver::mkOpTerm(Kind kind, Kind k) { CVC4_API_KIND_CHECK_EXPECTED(kind == CHAIN_OP, kind) << "CHAIN_OP"; - return *mkConstHelper<CVC4::Chain>(CVC4::Chain(extToIntKind(k))).d_expr.get(); + return *mkValHelper<CVC4::Chain>(CVC4::Chain(extToIntKind(k))).d_expr.get(); } OpTerm Solver::mkOpTerm(Kind kind, const std::string& arg) { CVC4_API_KIND_CHECK_EXPECTED(kind == RECORD_UPDATE_OP, kind) << "RECORD_UPDATE_OP"; - return *mkConstHelper<CVC4::RecordUpdate>(CVC4::RecordUpdate(arg)) - .d_expr.get(); + return *mkValHelper<CVC4::RecordUpdate>(CVC4::RecordUpdate(arg)).d_expr.get(); } OpTerm Solver::mkOpTerm(Kind kind, uint32_t arg) @@ -2783,59 +2746,59 @@ OpTerm Solver::mkOpTerm(Kind kind, uint32_t arg) switch (kind) { case DIVISIBLE_OP: - res = *mkConstHelper<CVC4::Divisible>(CVC4::Divisible(arg)).d_expr.get(); + res = *mkValHelper<CVC4::Divisible>(CVC4::Divisible(arg)).d_expr.get(); break; case BITVECTOR_REPEAT_OP: - res = *mkConstHelper<CVC4::BitVectorRepeat>(CVC4::BitVectorRepeat(arg)) + res = *mkValHelper<CVC4::BitVectorRepeat>(CVC4::BitVectorRepeat(arg)) .d_expr.get(); break; case BITVECTOR_ZERO_EXTEND_OP: - res = *mkConstHelper<CVC4::BitVectorZeroExtend>( + res = *mkValHelper<CVC4::BitVectorZeroExtend>( CVC4::BitVectorZeroExtend(arg)) .d_expr.get(); break; case BITVECTOR_SIGN_EXTEND_OP: - res = *mkConstHelper<CVC4::BitVectorSignExtend>( + res = *mkValHelper<CVC4::BitVectorSignExtend>( CVC4::BitVectorSignExtend(arg)) .d_expr.get(); break; case BITVECTOR_ROTATE_LEFT_OP: - res = *mkConstHelper<CVC4::BitVectorRotateLeft>( + res = *mkValHelper<CVC4::BitVectorRotateLeft>( CVC4::BitVectorRotateLeft(arg)) .d_expr.get(); break; case BITVECTOR_ROTATE_RIGHT_OP: - res = *mkConstHelper<CVC4::BitVectorRotateRight>( + res = *mkValHelper<CVC4::BitVectorRotateRight>( CVC4::BitVectorRotateRight(arg)) .d_expr.get(); break; case INT_TO_BITVECTOR_OP: - res = *mkConstHelper<CVC4::IntToBitVector>(CVC4::IntToBitVector(arg)) + res = *mkValHelper<CVC4::IntToBitVector>(CVC4::IntToBitVector(arg)) .d_expr.get(); break; case FLOATINGPOINT_TO_UBV_OP: - res = *mkConstHelper<CVC4::FloatingPointToUBV>( - CVC4::FloatingPointToUBV(arg)) - .d_expr.get(); + res = + *mkValHelper<CVC4::FloatingPointToUBV>(CVC4::FloatingPointToUBV(arg)) + .d_expr.get(); break; case FLOATINGPOINT_TO_UBV_TOTAL_OP: - res = *mkConstHelper<CVC4::FloatingPointToUBVTotal>( + res = *mkValHelper<CVC4::FloatingPointToUBVTotal>( CVC4::FloatingPointToUBVTotal(arg)) .d_expr.get(); break; case FLOATINGPOINT_TO_SBV_OP: - res = *mkConstHelper<CVC4::FloatingPointToSBV>( - CVC4::FloatingPointToSBV(arg)) - .d_expr.get(); + res = + *mkValHelper<CVC4::FloatingPointToSBV>(CVC4::FloatingPointToSBV(arg)) + .d_expr.get(); break; case FLOATINGPOINT_TO_SBV_TOTAL_OP: - res = *mkConstHelper<CVC4::FloatingPointToSBVTotal>( + res = *mkValHelper<CVC4::FloatingPointToSBVTotal>( CVC4::FloatingPointToSBVTotal(arg)) .d_expr.get(); break; case TUPLE_UPDATE_OP: - res = *mkConstHelper<CVC4::TupleUpdate>(CVC4::TupleUpdate(arg)) - .d_expr.get(); + res = + *mkValHelper<CVC4::TupleUpdate>(CVC4::TupleUpdate(arg)).d_expr.get(); break; default: CVC4_API_KIND_CHECK_EXPECTED(false, kind) @@ -2852,37 +2815,37 @@ OpTerm Solver::mkOpTerm(Kind kind, uint32_t arg1, uint32_t arg2) switch (kind) { case BITVECTOR_EXTRACT_OP: - res = *mkConstHelper<CVC4::BitVectorExtract>( + res = *mkValHelper<CVC4::BitVectorExtract>( CVC4::BitVectorExtract(arg1, arg2)) .d_expr.get(); break; case FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP: - res = *mkConstHelper<CVC4::FloatingPointToFPIEEEBitVector>( + res = *mkValHelper<CVC4::FloatingPointToFPIEEEBitVector>( CVC4::FloatingPointToFPIEEEBitVector(arg1, arg2)) .d_expr.get(); break; case FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP: - res = *mkConstHelper<CVC4::FloatingPointToFPFloatingPoint>( + res = *mkValHelper<CVC4::FloatingPointToFPFloatingPoint>( CVC4::FloatingPointToFPFloatingPoint(arg1, arg2)) .d_expr.get(); break; case FLOATINGPOINT_TO_FP_REAL_OP: - res = *mkConstHelper<CVC4::FloatingPointToFPReal>( + res = *mkValHelper<CVC4::FloatingPointToFPReal>( CVC4::FloatingPointToFPReal(arg1, arg2)) .d_expr.get(); break; case FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP: - res = *mkConstHelper<CVC4::FloatingPointToFPSignedBitVector>( + res = *mkValHelper<CVC4::FloatingPointToFPSignedBitVector>( CVC4::FloatingPointToFPSignedBitVector(arg1, arg2)) .d_expr.get(); break; case FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP: - res = *mkConstHelper<CVC4::FloatingPointToFPUnsignedBitVector>( + res = *mkValHelper<CVC4::FloatingPointToFPUnsignedBitVector>( CVC4::FloatingPointToFPUnsignedBitVector(arg1, arg2)) .d_expr.get(); break; case FLOATINGPOINT_TO_FP_GENERIC_OP: - res = *mkConstHelper<CVC4::FloatingPointToFPGeneric>( + res = *mkValHelper<CVC4::FloatingPointToFPGeneric>( CVC4::FloatingPointToFPGeneric(arg1, arg2)) .d_expr.get(); break; @@ -2976,35 +2939,20 @@ Result Solver::checkSatAssuming(const std::vector<Term>& assumptions) const } /** - * ( declare-const <symbol> <sort> ) - */ -Term Solver::declareConst(const std::string& symbol, Sort sort) const -{ - return d_exprMgr->mkVar(symbol, *sort.d_type); -} - -/** * ( declare-datatype <symbol> <datatype_decl> ) */ Sort Solver::declareDatatype( const std::string& symbol, const std::vector<DatatypeConstructorDecl>& ctors) const { + CVC4_API_ARG_CHECK_EXPECTED(ctors.size() > 0, ctors) + << "a datatype declaration with at least one constructor"; DatatypeDecl dtdecl(symbol); for (const DatatypeConstructorDecl& ctor : ctors) { dtdecl.addConstructor(ctor); } - return mkDatatypeSort(dtdecl); -} - -/** - * ( declare-fun <symbol> () <sort> ) - */ -Term Solver::declareFun(const std::string& symbol, Sort sort) const -{ - Type type = *sort.d_type; - return d_exprMgr->mkVar(symbol, type); + return d_exprMgr->mkDatatypeType(*dtdecl.d_dtype); } /** diff --git a/src/api/cvc4cpp.h b/src/api/cvc4cpp.h index b8da070fc..c13c7919e 100644 --- a/src/api/cvc4cpp.h +++ b/src/api/cvc4cpp.h @@ -2,9 +2,9 @@ /*! \file cvc4cpp.h ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,10 +16,10 @@ #include "cvc4_public.h" -#ifndef __CVC4__API__CVC4CPP_H -#define __CVC4__API__CVC4CPP_H +#ifndef CVC4__API__CVC4CPP_H +#define CVC4__API__CVC4CPP_H -#include "cvc4cppkind.h" +#include "api/cvc4cppkind.h" #include <map> #include <memory> @@ -1456,6 +1456,16 @@ std::ostream& operator<<(std::ostream& out, const DatatypeConstructorDecl& ctordecl) CVC4_PUBLIC; /** + * Serialize a vector of datatype constructor declarations to given stream. + * @param out the output stream + * @param vector the vector of datatype constructor declarations to be + * serialized to the given stream + * @return the output stream + */ +std::ostream& operator<<(std::ostream& out, + const std::vector<DatatypeConstructorDecl>& vector); + +/** * Serialize a datatype selector declaration to given stream. * @param out the output stream * @param stordecl the datatype selector declaration to be serialized @@ -1693,14 +1703,6 @@ class CVC4_PUBLIC Solver Term mkTerm(Kind kind) const; /** - * Create 0-ary term of given kind and sort. - * @param kind the kind of the term - * @param sort the sort argument to this kind - * @return the Term - */ - Term mkTerm(Kind kind, Sort sort) const; - - /** * Create a unary term of given kind. * @param kind the kind of the term * @param child the child of the term @@ -2045,7 +2047,14 @@ class CVC4_PUBLIC Solver Term mkBitVector(const char* s, uint32_t base = 2) const; /** - * Create a bit-vector constant from a given string. + * Create a bit-vector constant from a given string of base 2, 10 or 16. + * + * The size of resulting bit-vector is + * - base 2: the size of the binary string + * - base 10: the min. size required to represent the decimal as a bit-vector + * - base 16: the max. size required to represent the hexadecimal as a + * bit-vector (4 * size of the given value string) + * * @param s the string representation of the constant * @param base the base of the string representation (2, 10, or 16) * @return the bit-vector constant @@ -2053,7 +2062,9 @@ class CVC4_PUBLIC Solver Term mkBitVector(const std::string& s, uint32_t base = 2) const; /** - * Create a bit-vector constant of a given bit-width from a given string. + * Create a bit-vector constant of a given bit-width from a given string of + * base 2, 10 or 16. + * * @param size the bit-width of the constant * @param s the string representation of the constant * @param base the base of the string representation (2, 10, or 16) @@ -2062,7 +2073,8 @@ class CVC4_PUBLIC Solver Term mkBitVector(uint32_t size, const char* s, uint32_t base) const; /** - * Create a bit-vector constant of a given bit-width from a given string. + * Create a bit-vector constant of a given bit-width from a given string of + * base 2, 10 or 16. * @param size the bit-width of the constant * @param s the string representation of the constant * @param base the base of the string representation (2, 10, or 16) @@ -2154,34 +2166,23 @@ class CVC4_PUBLIC Solver /* .................................................................... */ /** - * Create variable. - * @param symbol the name of the variable - * @param sort the sort of the variable - * @return the variable + * Create (first-order) constant (0-arity function symbol). + * SMT-LIB: ( declare-const <symbol> <sort> ) + * SMT-LIB: ( declare-fun <symbol> ( ) <sort> ) + * + * @param sort the sort of the constant + * @param symbol the name of the constant + * @return the first-order constant */ - Term mkVar(const std::string& symbol, Sort sort) const; + Term mkConst(Sort sort, const std::string& symbol = std::string()) const; /** - * Create variable. + * Create (bound) variable. * @param sort the sort of the variable - * @return the variable - */ - Term mkVar(Sort sort) const; - - /** - * Create bound variable. * @param symbol the name of the variable - * @param sort the sort of the variable * @return the variable */ - Term mkBoundVar(const std::string& symbol, Sort sort) const; - - /** - * Create bound variable. - * @param sort the sort of the variable - * @return the variable - */ - Term mkBoundVar(Sort sort) const; + Term mkVar(Sort sort, const std::string& symbol = std::string()) const; /* .................................................................... */ /* Formula Handling */ @@ -2248,17 +2249,6 @@ class CVC4_PUBLIC Solver Result checkValidAssuming(const std::vector<Term>& assumptions) const; /** - * Declare first-order constant (0-arity function symbol). - * SMT-LIB: ( declare-const <symbol> <sort> ) - * SMT-LIB: ( declare-fun <symbol> ( ) <sort> ) - * This command corresponds to mkVar(). - * @param symbol the name of the first-order constant - * @param sort the sort of the first-order constant - * @return the first-order constant - */ - Term declareConst(const std::string& symbol, Sort sort) const; - - /** * Create datatype sort. * SMT-LIB: ( declare-datatype <symbol> <datatype_decl> ) * @param symbol the name of the datatype sort @@ -2269,15 +2259,6 @@ class CVC4_PUBLIC Solver const std::vector<DatatypeConstructorDecl>& ctors) const; /** - * Declare 0-arity function symbol. - * SMT-LIB: ( declare-fun <symbol> ( ) <sort> ) - * @param symbol the name of the function - * @param sort the sort of the return value of this function - * @return the function - */ - Term declareFun(const std::string& symbol, Sort sort) const; - - /** * Declare n-ary function symbol. * SMT-LIB: ( declare-fun <symbol> ( <sort>* ) <sort> ) * @param symbol the name of the function @@ -2314,7 +2295,7 @@ class CVC4_PUBLIC Solver /** * Define n-ary function. * SMT-LIB: ( define-fun <function_def> ) - * Create parameter 'fun' with mkVar(). + * Create parameter 'fun' with mkConst(). * @param fun the sorted function * @param bound_vars the parameters to this function * @param term the function body @@ -2341,7 +2322,7 @@ class CVC4_PUBLIC Solver /** * Define recursive function. * SMT-LIB: ( define-fun-rec <function_def> ) - * Create parameter 'fun' with mkVar(). + * Create parameter 'fun' with mkConst(). * @param fun the sorted function * @param bound_vars the parameters to this function * @param term the function body @@ -2354,7 +2335,7 @@ class CVC4_PUBLIC Solver /** * Define recursive functions. * SMT-LIB: ( define-funs-rec ( <function_decl>^{n+1} ) ( <term>^{n+1} ) ) - * Create elements of parameter 'funs' with mkVar(). + * Create elements of parameter 'funs' with mkConst(). * @param funs the sorted functions * @param bound_vars the list of parameters to the functions * @param term the list of function bodies of the functions @@ -2517,7 +2498,7 @@ class CVC4_PUBLIC Solver void checkMkTerm(Kind kind, uint32_t nchildren) const; /* Helper for mk-functions that call d_exprMgr->mkConst(). */ template <typename T> - Term mkConstHelper(T t) const; + Term mkValHelper(T t) const; /* Helper for mkReal functions that take a string as argument. */ Term mkRealFromStrHelper(std::string s) const; /* Helper for mkBitVector functions that take a string as argument. */ diff --git a/src/api/cvc4cppkind.h b/src/api/cvc4cppkind.h index 4e69ddfe1..7d9ec28c6 100644 --- a/src/api/cvc4cppkind.h +++ b/src/api/cvc4cppkind.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__API__CVC4CPPKIND_H -#define __CVC4__API__CVC4CPPKIND_H +#ifndef CVC4__API__CVC4CPPKIND_H +#define CVC4__API__CVC4CPPKIND_H #include <ostream> @@ -33,7 +33,7 @@ namespace api { * * Note that the underlying type of Kind must be signed (to enable range * checks for validity). The size of this type depends on the size of - * CVC4::Kind (__CVC4__EXPR__NODE_VALUE__NBITS__KIND, currently 10 bits, + * CVC4::Kind (CVC4__EXPR__NODE_VALUE__NBITS__KIND, currently 10 bits, * see expr/metakind_template.h). */ enum CVC4_PUBLIC Kind : int32_t @@ -79,31 +79,6 @@ enum CVC4_PUBLIC Kind : int32_t BUILTIN, #endif /** - * Defined function. - * Parameters: 3 (4) - * See defineFun(). - * Create with: - * defineFun(const std::string& symbol, - * const std::vector<Term>& bound_vars, - * Sort sort, - * Term term) - * defineFun(Term fun, - * const std::vector<Term>& bound_vars, - * Term term) - */ - FUNCTION, - /** - * Application of a defined function. - * Parameters: n > 1 - * -[1]..[n]: Function argument instantiation Terms - * Create with: - * mkTerm(Kind kind, Term child) - * mkTerm(Kind kind, Term child1, Term child2) - * mkTerm(Kind kind, Term child1, Term child2, Term child3) - * mkTerm(Kind kind, const std::vector<Term>& children) - */ - APPLY, - /** * Equality. * Parameters: 2 * -[1]..[2]: Terms with same sort @@ -123,25 +98,25 @@ enum CVC4_PUBLIC Kind : int32_t */ DISTINCT, /** - * Variable. + * First-order constant. * Not permitted in bindings (forall, exists, ...). * Parameters: - * See mkVar(). + * See mkConst(). * Create with: - * mkVar(const std::string& symbol, Sort sort) - * mkVar(Sort sort) + * mkConst(const std::string& symbol, Sort sort) + * mkConst(Sort sort) */ - VARIABLE, + CONSTANT, /** - * Bound variable. + * (Bound) variable. * Permitted in bindings and in the lambda and quantifier bodies only. * Parameters: - * See mkBoundVar(). + * See mkVar(). * Create with: - * mkBoundVar(const std::string& symbol, Sort sort) - * mkBoundVar(Sort sort) + * mkVar(const std::string& symbol, Sort sort) + * mkVar(Sort sort) */ - BOUND_VARIABLE, + VARIABLE, #if 0 /* Skolem variable (internal only) */ SKOLEM, @@ -1755,7 +1730,6 @@ enum CVC4_PUBLIC Kind : int32_t * Parameters: 0 * Create with: * mkSepNil(Sort sort) - * mkTerm(Kind kind, Sort sort) */ SEP_NIL, /** diff --git a/src/base/configuration.cpp b/src/base/configuration.cpp index f154e5c90..a7fa79395 100644 --- a/src/base/configuration.cpp +++ b/src/base/configuration.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Aina Niemetz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -114,7 +114,7 @@ std::string Configuration::getVersionExtra() { std::string Configuration::copyright() { std::stringstream ss; - ss << "Copyright (c) 2009-2018 by the authors and their institutional\n" + ss << "Copyright (c) 2009-2019 by the authors and their institutional\n" << "affiliations listed at http://cvc4.cs.stanford.edu/authors\n\n"; if (Configuration::licenseIsGpl()) { @@ -130,7 +130,7 @@ std::string Configuration::copyright() { ss << "THIS SOFTWARE IS PROVIDED AS-IS, WITHOUT ANY WARRANTIES.\n" << "USE AT YOUR OWN RISK.\n\n"; - + ss << "CVC4 incorporates code from ANTLR3 (http://www.antlr.org).\n" << "See licenses/antlr3-LICENSE for copyright and licensing information." << "\n\n"; @@ -250,6 +250,8 @@ bool Configuration::isBuiltWithCryptominisat() { return IS_CRYPTOMINISAT_BUILD; } +bool Configuration::isBuiltWithDrat2Er() { return IS_DRAT2ER_BUILD; } + bool Configuration::isBuiltWithReadline() { return IS_READLINE_BUILD; } diff --git a/src/base/configuration.h b/src/base/configuration.h index b6e2a1963..fc149587b 100644 --- a/src/base/configuration.h +++ b/src/base/configuration.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Francois Bobot, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__CONFIGURATION_H -#define __CVC4__CONFIGURATION_H +#ifndef CVC4__CONFIGURATION_H +#define CVC4__CONFIGURATION_H #include <string> @@ -97,6 +97,8 @@ public: static bool isBuiltWithCryptominisat(); + static bool isBuiltWithDrat2Er(); + static bool isBuiltWithReadline(); static bool isBuiltWithLfsc(); @@ -130,4 +132,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__CONFIGURATION_H */ +#endif /* CVC4__CONFIGURATION_H */ diff --git a/src/base/configuration_private.h b/src/base/configuration_private.h index 77f3f5e77..3b06a9e6a 100644 --- a/src/base/configuration_private.h +++ b/src/base/configuration_private.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONFIGURATION_PRIVATE_H -#define __CVC4__CONFIGURATION_PRIVATE_H +#ifndef CVC4__CONFIGURATION_PRIVATE_H +#define CVC4__CONFIGURATION_PRIVATE_H #include <string> @@ -174,4 +174,4 @@ namespace CVC4 { }/* CVC4 namespace */ -#endif /* __CVC4__CONFIGURATION_PRIVATE_H */ +#endif /* CVC4__CONFIGURATION_PRIVATE_H */ diff --git a/src/base/cvc4_assert.cpp b/src/base/cvc4_assert.cpp index 3af6a9909..1150f41f1 100644 --- a/src/base/cvc4_assert.cpp +++ b/src/base/cvc4_assert.cpp @@ -2,9 +2,9 @@ /*! \file cvc4_assert.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andres Noetzli + ** Morgan Deters, Tim King, Chad Brewbaker ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/base/cvc4_assert.h b/src/base/cvc4_assert.h index ed69daf23..a29e6f545 100644 --- a/src/base/cvc4_assert.h +++ b/src/base/cvc4_assert.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__ASSERT_H -#define __CVC4__ASSERT_H +#ifndef CVC4__ASSERT_H +#define CVC4__ASSERT_H #include <cstdarg> #include <cstdio> @@ -317,4 +317,4 @@ void debugAssertionFailed(const AssertionException& thisException, } /* CVC4 namespace */ -#endif /* __CVC4__ASSERT_H */ +#endif /* CVC4__ASSERT_H */ diff --git a/src/base/cvc4_check.cpp b/src/base/cvc4_check.cpp index 5976ac3f7..f0b602849 100644 --- a/src/base/cvc4_check.cpp +++ b/src/base/cvc4_check.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/base/cvc4_check.h b/src/base/cvc4_check.h index 5cb3315f4..703931108 100644 --- a/src/base/cvc4_check.h +++ b/src/base/cvc4_check.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -34,8 +34,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CHECK_H -#define __CVC4__CHECK_H +#ifndef CVC4__CHECK_H +#define CVC4__CHECK_H #include <ostream> @@ -143,4 +143,4 @@ class OstreamVoider } // namespace CVC4 -#endif /* __CVC4__CHECK_H */ +#endif /* CVC4__CHECK_H */ diff --git a/src/base/exception.cpp b/src/base/exception.cpp index 831220a2b..c1c174d1d 100644 --- a/src/base/exception.cpp +++ b/src/base/exception.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/base/exception.h b/src/base/exception.h index 54f6aa92d..51829c86c 100644 --- a/src/base/exception.h +++ b/src/base/exception.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__EXCEPTION_H -#define __CVC4__EXCEPTION_H +#ifndef CVC4__EXCEPTION_H +#define CVC4__EXCEPTION_H #include <cstdarg> #include <cstdlib> @@ -166,4 +166,4 @@ private: }/* CVC4 namespace */ -#endif /* __CVC4__EXCEPTION_H */ +#endif /* CVC4__EXCEPTION_H */ diff --git a/src/base/git_versioninfo.cpp.in b/src/base/git_versioninfo.cpp.in index 20da094bc..5c18d4e2b 100644 --- a/src/base/git_versioninfo.cpp.in +++ b/src/base/git_versioninfo.cpp.in @@ -1,3 +1,20 @@ +/********************* */ +/*! \file git_versioninfo.cpp.in + ** \verbatim + ** Top contributors (to current version): + ** Aina Niemetz, Mathias Preiner + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. 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 "base/configuration.h" const bool ::CVC4::Configuration::IS_GIT_BUILD = @GIT_BUILD@; const char* const ::CVC4::Configuration::GIT_BRANCH_NAME = "@GIT_BRANCH@"; diff --git a/src/base/listener.cpp b/src/base/listener.cpp index 3b67b8a06..44e5563e7 100644 --- a/src/base/listener.cpp +++ b/src/base/listener.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/base/listener.h b/src/base/listener.h index 88bcee742..842567646 100644 --- a/src/base/listener.h +++ b/src/base/listener.h @@ -2,9 +2,9 @@ /*! \file listener.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__LISTENER_H -#define __CVC4__LISTENER_H +#ifndef CVC4__LISTENER_H +#define CVC4__LISTENER_H #include <list> @@ -161,4 +161,4 @@ class ListenerRegistrationList { }/* CVC4 namespace */ -#endif /* __CVC4__LISTENER_H */ +#endif /* CVC4__LISTENER_H */ diff --git a/src/base/map_util.h b/src/base/map_util.h index 2e17c9290..786e22ae0 100644 --- a/src/base/map_util.h +++ b/src/base/map_util.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -35,8 +35,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BASE__MAP_UTIL_H -#define __CVC4__BASE__MAP_UTIL_H +#ifndef CVC4__BASE__MAP_UTIL_H +#define CVC4__BASE__MAP_UTIL_H #include "base/cvc4_check.h" @@ -94,4 +94,4 @@ const MapMappedTypeT<M>& FindOrDie(const M& map, const MapKeyTypeT<M>& key) } // namespace CVC4 -#endif /* __CVC4__BASE__MAP_UTIL_H */ +#endif /* CVC4__BASE__MAP_UTIL_H */ diff --git a/src/base/modal_exception.h b/src/base/modal_exception.h index fefb5aed9..4fa9349fb 100644 --- a/src/base/modal_exception.h +++ b/src/base/modal_exception.h @@ -2,9 +2,9 @@ /*! \file modal_exception.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andres Noetzli, Tim King + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__SMT__MODAL_EXCEPTION_H -#define __CVC4__SMT__MODAL_EXCEPTION_H +#ifndef CVC4__SMT__MODAL_EXCEPTION_H +#define CVC4__SMT__MODAL_EXCEPTION_H #include "base/exception.h" @@ -58,4 +58,4 @@ class CVC4_PUBLIC RecoverableModalException : public CVC4::ModalException { }/* CVC4 namespace */ -#endif /* __CVC4__SMT__MODAL_EXCEPTION_H */ +#endif /* CVC4__SMT__MODAL_EXCEPTION_H */ diff --git a/src/base/output.cpp b/src/base/output.cpp index 787d26bf6..fee8b1d8d 100644 --- a/src/base/output.cpp +++ b/src/base/output.cpp @@ -2,9 +2,9 @@ /*! \file output.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/base/output.h b/src/base/output.h index fef8af876..c3a073580 100644 --- a/src/base/output.h +++ b/src/base/output.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andres Noetzli, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private_library.h" -#ifndef __CVC4__OUTPUT_H -#define __CVC4__OUTPUT_H +#ifndef CVC4__OUTPUT_H +#define CVC4__OUTPUT_H #include <ios> #include <iostream> @@ -543,4 +543,4 @@ inline IndentedScope::~IndentedScope() {} }/* CVC4 namespace */ -#endif /* __CVC4__OUTPUT_H */ +#endif /* CVC4__OUTPUT_H */ diff --git a/src/bindings/java_iterator_adapter.h b/src/bindings/java_iterator_adapter.h index 1cf88aaad..bf1b22e1b 100644 --- a/src/bindings/java_iterator_adapter.h +++ b/src/bindings/java_iterator_adapter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -27,8 +27,8 @@ # error This should only be included from the Java bindings layer. #endif /* SWIGJAVA */ -#ifndef __CVC4__BINDINGS__JAVA_ITERATOR_ADAPTER_H -#define __CVC4__BINDINGS__JAVA_ITERATOR_ADAPTER_H +#ifndef CVC4__BINDINGS__JAVA_ITERATOR_ADAPTER_H +#define CVC4__BINDINGS__JAVA_ITERATOR_ADAPTER_H namespace CVC4 { @@ -56,4 +56,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__BINDINGS__JAVA_ITERATOR_ADAPTER_H */ +#endif /* CVC4__BINDINGS__JAVA_ITERATOR_ADAPTER_H */ diff --git a/src/bindings/java_stream_adapters.h b/src/bindings/java_stream_adapters.h index 86d3e7c9d..f2e89c004 100644 --- a/src/bindings/java_stream_adapters.h +++ b/src/bindings/java_stream_adapters.h @@ -2,9 +2,9 @@ /*! \file java_stream_adapters.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -37,8 +37,8 @@ #include <string> #include <jni.h> -#ifndef __CVC4__BINDINGS__JAVA_STREAM_ADAPTERS_H -#define __CVC4__BINDINGS__JAVA_STREAM_ADAPTERS_H +#ifndef CVC4__BINDINGS__JAVA_STREAM_ADAPTERS_H +#define CVC4__BINDINGS__JAVA_STREAM_ADAPTERS_H namespace CVC4 { @@ -105,4 +105,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__BINDINGS__JAVA_STREAM_ADAPTERS_H */ +#endif /* CVC4__BINDINGS__JAVA_STREAM_ADAPTERS_H */ diff --git a/src/bindings/swig.h b/src/bindings/swig.h index 5316eef12..81f197d5f 100644 --- a/src/bindings/swig.h +++ b/src/bindings/swig.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ ** Common swig checks and definitions, when generating swig interfaces. **/ -#ifndef __CVC4__BINDINGS__SWIG_H -#define __CVC4__BINDINGS__SWIG_H +#ifndef CVC4__BINDINGS__SWIG_H +#define CVC4__BINDINGS__SWIG_H #ifndef SWIG # error This file should only be included when generating swig interfaces. @@ -30,4 +30,4 @@ // swig doesn't like GCC attributes #define __attribute__(x) -#endif /* __CVC4__BINDINGS__SWIG_H */ +#endif /* CVC4__BINDINGS__SWIG_H */ diff --git a/src/context/backtrackable.h b/src/context/backtrackable.h index 110bf9afb..5d358941f 100644 --- a/src/context/backtrackable.h +++ b/src/context/backtrackable.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__UTIL__BACKTRACKABLE_H -#define __CVC4__UTIL__BACKTRACKABLE_H +#ifndef CVC4__UTIL__BACKTRACKABLE_H +#define CVC4__UTIL__BACKTRACKABLE_H #include <cstdlib> #include <vector> @@ -219,4 +219,4 @@ template <class T> void Backtracker<T>::checkConsistency() { }/* CVC4 namespace */ -#endif /* __CVC4__UTIL__BACKTRACKABLE_H */ +#endif /* CVC4__UTIL__BACKTRACKABLE_H */ diff --git a/src/context/cddense_set.h b/src/context/cddense_set.h index 625946cc8..4d48bf5d9 100644 --- a/src/context/cddense_set.h +++ b/src/context/cddense_set.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/context/cdhashmap.h b/src/context/cdhashmap.h index 4697cd291..0a1f3387c 100644 --- a/src/context/cdhashmap.h +++ b/src/context/cdhashmap.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -79,8 +79,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONTEXT__CDHASHMAP_H -#define __CVC4__CONTEXT__CDHASHMAP_H +#ifndef CVC4__CONTEXT__CDHASHMAP_H +#define CVC4__CONTEXT__CDHASHMAP_H #include <functional> #include <iterator> @@ -448,4 +448,4 @@ public: }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CDHASHMAP_H */ +#endif /* CVC4__CONTEXT__CDHASHMAP_H */ diff --git a/src/context/cdhashmap_forward.h b/src/context/cdhashmap_forward.h index 54dc545f5..667e71990 100644 --- a/src/context/cdhashmap_forward.h +++ b/src/context/cdhashmap_forward.h @@ -2,9 +2,9 @@ /*! \file cdhashmap_forward.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Dejan Jovanovic + ** Tim King, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__CONTEXT__CDHASHMAP_FORWARD_H -#define __CVC4__CONTEXT__CDHASHMAP_FORWARD_H +#ifndef CVC4__CONTEXT__CDHASHMAP_FORWARD_H +#define CVC4__CONTEXT__CDHASHMAP_FORWARD_H #include <functional> @@ -40,4 +40,4 @@ namespace CVC4 { /// \endcond -#endif /* __CVC4__CONTEXT__CDHASHMAP_FORWARD_H */ +#endif /* CVC4__CONTEXT__CDHASHMAP_FORWARD_H */ diff --git a/src/context/cdhashset.h b/src/context/cdhashset.h index b907d9823..a35ecae88 100644 --- a/src/context/cdhashset.h +++ b/src/context/cdhashset.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONTEXT__CDHASHSET_H -#define __CVC4__CONTEXT__CDHASHSET_H +#ifndef CVC4__CONTEXT__CDHASHSET_H +#define CVC4__CONTEXT__CDHASHSET_H #include "base/cvc4_assert.h" #include "context/context.h" @@ -158,4 +158,4 @@ public: }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CDHASHSET_H */ +#endif /* CVC4__CONTEXT__CDHASHSET_H */ diff --git a/src/context/cdhashset_forward.h b/src/context/cdhashset_forward.h index a3ec3ea31..dbe8ff052 100644 --- a/src/context/cdhashset_forward.h +++ b/src/context/cdhashset_forward.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__CONTEXT__CDSET_FORWARD_H -#define __CVC4__CONTEXT__CDSET_FORWARD_H +#ifndef CVC4__CONTEXT__CDSET_FORWARD_H +#define CVC4__CONTEXT__CDSET_FORWARD_H #include <functional> @@ -35,4 +35,4 @@ class CDHashSet; } // namespace context } // namespace CVC4 -#endif /* __CVC4__CONTEXT__CDSET_FORWARD_H */ +#endif /* CVC4__CONTEXT__CDSET_FORWARD_H */ diff --git a/src/context/cdinsert_hashmap.h b/src/context/cdinsert_hashmap.h index d59bf584d..f15c418eb 100644 --- a/src/context/cdinsert_hashmap.h +++ b/src/context/cdinsert_hashmap.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/context/cdinsert_hashmap_forward.h b/src/context/cdinsert_hashmap_forward.h index df567e8aa..a1559a078 100644 --- a/src/context/cdinsert_hashmap_forward.h +++ b/src/context/cdinsert_hashmap_forward.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__CONTEXT__CDINSERT_HASHMAP_FORWARD_H -#define __CVC4__CONTEXT__CDINSERT_HASHMAP_FORWARD_H +#ifndef CVC4__CONTEXT__CDINSERT_HASHMAP_FORWARD_H +#define CVC4__CONTEXT__CDINSERT_HASHMAP_FORWARD_H #include <functional> @@ -35,4 +35,4 @@ class CDInsertHashMap; } // namespace context } // namespace CVC4 -#endif /* __CVC4__CONTEXT__CDINSERT_HASHMAP_FORWARD_H */ +#endif /* CVC4__CONTEXT__CDINSERT_HASHMAP_FORWARD_H */ diff --git a/src/context/cdlist.h b/src/context/cdlist.h index 834e363f9..dda88a0fd 100644 --- a/src/context/cdlist.h +++ b/src/context/cdlist.h @@ -2,9 +2,9 @@ /*! \file cdlist.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Mathias Preiner + ** Morgan Deters, Tim King, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONTEXT__CDLIST_H -#define __CVC4__CONTEXT__CDLIST_H +#ifndef CVC4__CONTEXT__CDLIST_H +#define CVC4__CONTEXT__CDLIST_H #include <iterator> #include <memory> @@ -436,4 +436,4 @@ class CDList<T, CleanUp, ContextMemoryAllocator<T> > : public ContextObj { }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CDLIST_H */ +#endif /* CVC4__CONTEXT__CDLIST_H */ diff --git a/src/context/cdlist_forward.h b/src/context/cdlist_forward.h index 8bf1c2678..d7b1cbc61 100644 --- a/src/context/cdlist_forward.h +++ b/src/context/cdlist_forward.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -29,8 +29,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__CONTEXT__CDLIST_FORWARD_H -#define __CVC4__CONTEXT__CDLIST_FORWARD_H +#ifndef CVC4__CONTEXT__CDLIST_FORWARD_H +#define CVC4__CONTEXT__CDLIST_FORWARD_H #include <memory> @@ -53,4 +53,4 @@ class CDList; }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CDLIST_FORWARD_H */ +#endif /* CVC4__CONTEXT__CDLIST_FORWARD_H */ diff --git a/src/context/cdmaybe.h b/src/context/cdmaybe.h index edb638016..19827aabd 100644 --- a/src/context/cdmaybe.h +++ b/src/context/cdmaybe.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/context/cdo.h b/src/context/cdo.h index da6c8d338..fe588afb0 100644 --- a/src/context/cdo.h +++ b/src/context/cdo.h @@ -2,9 +2,9 @@ /*! \file cdo.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Mathias Preiner + ** Morgan Deters, Clark Barrett, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONTEXT__CDO_H -#define __CVC4__CONTEXT__CDO_H +#ifndef CVC4__CONTEXT__CDO_H +#define CVC4__CONTEXT__CDO_H #include "base/cvc4_assert.h" #include "context/context.h" @@ -180,4 +180,4 @@ public: }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CDO_H */ +#endif /* CVC4__CONTEXT__CDO_H */ diff --git a/src/context/cdqueue.h b/src/context/cdqueue.h index dc518fb1d..6ad0e9339 100644 --- a/src/context/cdqueue.h +++ b/src/context/cdqueue.h @@ -2,9 +2,9 @@ /*! \file cdqueue.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Mathias Preiner, Francois Bobot + ** Tim King, Francois Bobot, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONTEXT__CDQUEUE_H -#define __CVC4__CONTEXT__CDQUEUE_H +#ifndef CVC4__CONTEXT__CDQUEUE_H +#define CVC4__CONTEXT__CDQUEUE_H #include "context/context.h" #include "context/cdlist.h" @@ -166,4 +166,4 @@ public: }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CDQUEUE_H */ +#endif /* CVC4__CONTEXT__CDQUEUE_H */ diff --git a/src/context/cdtrail_queue.h b/src/context/cdtrail_queue.h index 58ec4061b..ad2bef54c 100644 --- a/src/context/cdtrail_queue.h +++ b/src/context/cdtrail_queue.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONTEXT__CDTRAIL_QUEUE_H -#define __CVC4__CONTEXT__CDTRAIL_QUEUE_H +#ifndef CVC4__CONTEXT__CDTRAIL_QUEUE_H +#define CVC4__CONTEXT__CDTRAIL_QUEUE_H #include "context/context.h" #include "context/cdlist.h" @@ -92,4 +92,4 @@ public: }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CDTRAIL_QUEUE_H */ +#endif /* CVC4__CONTEXT__CDTRAIL_QUEUE_H */ diff --git a/src/context/context.cpp b/src/context/context.cpp index 128a90751..310f88b04 100644 --- a/src/context/context.cpp +++ b/src/context/context.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Clark Barrett, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/context/context.h b/src/context/context.h index 04da9c25d..d9d73f770 100644 --- a/src/context/context.h +++ b/src/context/context.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Clark Barrett, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONTEXT__CONTEXT_H -#define __CVC4__CONTEXT__CONTEXT_H +#ifndef CVC4__CONTEXT__CONTEXT_H +#define CVC4__CONTEXT__CONTEXT_H #include <cstdlib> #include <cstring> @@ -745,4 +745,4 @@ inline void Scope::addToChain(ContextObj* pContextObj) }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CONTEXT_H */ +#endif /* CVC4__CONTEXT__CONTEXT_H */ diff --git a/src/context/context_mm.cpp b/src/context/context_mm.cpp index 939696a63..76a2168d1 100644 --- a/src/context/context_mm.cpp +++ b/src/context/context_mm.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Clark Barrett, Andres Noetzli, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/context/context_mm.h b/src/context/context_mm.h index 88c3a16cc..51726f36e 100644 --- a/src/context/context_mm.h +++ b/src/context/context_mm.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Clark Barrett, Andres Noetzli, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CONTEXT__CONTEXT_MM_H -#define __CVC4__CONTEXT__CONTEXT_MM_H +#ifndef CVC4__CONTEXT__CONTEXT_MM_H +#define CVC4__CONTEXT__CONTEXT_MM_H #include <deque> #include <limits> @@ -266,4 +266,4 @@ inline bool operator!=(const ContextMemoryAllocator<T>& a1, }/* CVC4::context namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__CONTEXT__CONTEXT_MM_H */ +#endif /* CVC4__CONTEXT__CONTEXT_MM_H */ diff --git a/src/decision/decision_attributes.h b/src/decision/decision_attributes.h index eaf6e6fde..bdcc722ec 100644 --- a/src/decision/decision_attributes.h +++ b/src/decision/decision_attributes.h @@ -2,9 +2,9 @@ /*! \file decision_attributes.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Tim King, Morgan Deters + ** Tim King, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__DECISION__DECISION_ATTRIBUTES_H -#define __CVC4__DECISION__DECISION_ATTRIBUTES_H +#ifndef CVC4__DECISION__DECISION_ATTRIBUTES_H +#define CVC4__DECISION__DECISION_ATTRIBUTES_H #include "options/decision_weight.h" #include "expr/attribute.h" @@ -33,4 +33,4 @@ typedef expr::Attribute<attr::DecisionWeightTag, DecisionWeight> DecisionWeightA }/* CVC4::decision namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__DECISION__DECISION_ATTRIBUTES_H */ +#endif /* CVC4__DECISION__DECISION_ATTRIBUTES_H */ diff --git a/src/decision/decision_engine.cpp b/src/decision/decision_engine.cpp index 01f78f2d6..679dd6cc6 100644 --- a/src/decision/decision_engine.cpp +++ b/src/decision/decision_engine.cpp @@ -2,9 +2,9 @@ /*! \file decision_engine.cpp ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Tim King, Morgan Deters + ** Kshitij Bansal, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/decision/decision_engine.h b/src/decision/decision_engine.h index c5325bc9a..73d7e2a31 100644 --- a/src/decision/decision_engine.h +++ b/src/decision/decision_engine.h @@ -2,9 +2,9 @@ /*! \file decision_engine.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Tim King, Morgan Deters + ** Kshitij Bansal, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__DECISION__DECISION_ENGINE_H -#define __CVC4__DECISION__DECISION_ENGINE_H +#ifndef CVC4__DECISION__DECISION_ENGINE_H +#define CVC4__DECISION__DECISION_ENGINE_H #include <vector> @@ -219,4 +219,4 @@ private: }/* CVC4 namespace */ -#endif /* __CVC4__DECISION__DECISION_ENGINE_H */ +#endif /* CVC4__DECISION__DECISION_ENGINE_H */ diff --git a/src/decision/decision_strategy.h b/src/decision/decision_strategy.h index d26b28eeb..f408515de 100644 --- a/src/decision/decision_strategy.h +++ b/src/decision/decision_strategy.h @@ -2,9 +2,9 @@ /*! \file decision_strategy.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Morgan Deters, Mathias Preiner + ** Kshitij Bansal, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__DECISION__DECISION_STRATEGY_H -#define __CVC4__DECISION__DECISION_STRATEGY_H +#ifndef CVC4__DECISION__DECISION_STRATEGY_H +#define CVC4__DECISION__DECISION_STRATEGY_H #include "preprocessing/assertion_pipeline.h" #include "prop/sat_solver_types.h" @@ -75,4 +75,4 @@ public: }/* CVC4::decision namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__DECISION__DECISION_STRATEGY_H */ +#endif /* CVC4__DECISION__DECISION_STRATEGY_H */ diff --git a/src/decision/justification_heuristic.cpp b/src/decision/justification_heuristic.cpp index b4fbe1cbd..043ec10f2 100644 --- a/src/decision/justification_heuristic.cpp +++ b/src/decision/justification_heuristic.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/decision/justification_heuristic.h b/src/decision/justification_heuristic.h index 0cd45ada7..b2c325628 100644 --- a/src/decision/justification_heuristic.h +++ b/src/decision/justification_heuristic.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__DECISION__JUSTIFICATION_HEURISTIC -#define __CVC4__DECISION__JUSTIFICATION_HEURISTIC +#ifndef CVC4__DECISION__JUSTIFICATION_HEURISTIC +#define CVC4__DECISION__JUSTIFICATION_HEURISTIC #include <unordered_set> @@ -181,4 +181,4 @@ public: }/* namespace decision */ }/* namespace CVC4 */ -#endif /* __CVC4__DECISION__JUSTIFICATION_HEURISTIC */ +#endif /* CVC4__DECISION__JUSTIFICATION_HEURISTIC */ diff --git a/src/expr/array.h b/src/expr/array.h index 580ba5d06..a53ac3cd2 100644 --- a/src/expr/array.h +++ b/src/expr/array.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,11 +16,11 @@ #include "cvc4_public.h" -#ifndef __CVC4__ARRAY_H -#define __CVC4__ARRAY_H +#ifndef CVC4__ARRAY_H +#define CVC4__ARRAY_H // we get ArrayType right now by #including type.h. // array.h is still useful for the auto-generated kinds #includes. #include "expr/type.h" -#endif /* __CVC4__ARRAY_H */ +#endif /* CVC4__ARRAY_H */ diff --git a/src/expr/array_store_all.cpp b/src/expr/array_store_all.cpp index 0f66273e1..eff2c2151 100644 --- a/src/expr/array_store_all.cpp +++ b/src/expr/array_store_all.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/array_store_all.h b/src/expr/array_store_all.h index 9375d8648..0adcfde36 100644 --- a/src/expr/array_store_all.h +++ b/src/expr/array_store_all.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__ARRAY_STORE_ALL_H -#define __CVC4__ARRAY_STORE_ALL_H +#ifndef CVC4__ARRAY_STORE_ALL_H +#define CVC4__ARRAY_STORE_ALL_H #include <iosfwd> #include <memory> @@ -72,4 +72,4 @@ struct CVC4_PUBLIC ArrayStoreAllHashFunction { } // namespace CVC4 -#endif /* __CVC4__ARRAY_STORE_ALL_H */ +#endif /* CVC4__ARRAY_STORE_ALL_H */ diff --git a/src/expr/ascription_type.h b/src/expr/ascription_type.h index 331ac8849..94258896a 100644 --- a/src/expr/ascription_type.h +++ b/src/expr/ascription_type.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__ASCRIPTION_TYPE_H -#define __CVC4__ASCRIPTION_TYPE_H +#ifndef CVC4__ASCRIPTION_TYPE_H +#define CVC4__ASCRIPTION_TYPE_H #include "expr/type.h" @@ -63,4 +63,4 @@ inline std::ostream& operator<<(std::ostream& out, AscriptionType at) { }/* CVC4 namespace */ -#endif /* __CVC4__ASCRIPTION_TYPE_H */ +#endif /* CVC4__ASCRIPTION_TYPE_H */ diff --git a/src/expr/attribute.cpp b/src/expr/attribute.cpp index 9481cde99..b9234883b 100644 --- a/src/expr/attribute.cpp +++ b/src/expr/attribute.cpp @@ -2,9 +2,9 @@ /*! \file attribute.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Dejan Jovanovic + ** Tim King, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/attribute.h b/src/expr/attribute.h index db6fb52a0..46302fc9f 100644 --- a/src/expr/attribute.h +++ b/src/expr/attribute.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -21,8 +21,8 @@ #include "expr/node.h" #include "expr/type_node.h" -#ifndef __CVC4__EXPR__ATTRIBUTE_H -#define __CVC4__EXPR__ATTRIBUTE_H +#ifndef CVC4__EXPR__ATTRIBUTE_H +#define CVC4__EXPR__ATTRIBUTE_H #include <string> #include <stdint.h> @@ -578,4 +578,4 @@ NodeManager::setAttribute(TypeNode n, const AttrKind&, }/* CVC4 namespace */ -#endif /* __CVC4__EXPR__ATTRIBUTE_H */ +#endif /* CVC4__EXPR__ATTRIBUTE_H */ diff --git a/src/expr/attribute_internals.h b/src/expr/attribute_internals.h index c6dc66eb2..e47dce434 100644 --- a/src/expr/attribute_internals.h +++ b/src/expr/attribute_internals.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ # error expr/attribute_internals.h should only be included by expr/attribute.h #endif /* CVC4_ATTRIBUTE_H__INCLUDING__ATTRIBUTE_INTERNALS_H */ -#ifndef __CVC4__EXPR__ATTRIBUTE_INTERNALS_H -#define __CVC4__EXPR__ATTRIBUTE_INTERNALS_H +#ifndef CVC4__EXPR__ATTRIBUTE_INTERNALS_H +#define CVC4__EXPR__ATTRIBUTE_INTERNALS_H #include <cstdint> #include <unordered_map> @@ -486,4 +486,4 @@ const uint64_t Attribute<T, bool, context_dep>::s_id = }/* CVC4::expr namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__EXPR__ATTRIBUTE_INTERNALS_H */ +#endif /* CVC4__EXPR__ATTRIBUTE_INTERNALS_H */ diff --git a/src/expr/attribute_unique_id.h b/src/expr/attribute_unique_id.h index 1a6220db2..88ecc90a8 100644 --- a/src/expr/attribute_unique_id.h +++ b/src/expr/attribute_unique_id.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/chain.h b/src/expr/chain.h index 6a785f282..9df819b4d 100644 --- a/src/expr/chain.h +++ b/src/expr/chain.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__CHAIN_H -#define __CVC4__CHAIN_H +#ifndef CVC4__CHAIN_H +#define CVC4__CHAIN_H #include "expr/kind.h" #include <iostream> @@ -48,4 +48,4 @@ struct CVC4_PUBLIC ChainHashFunction { }/* CVC4 namespace */ -#endif /* __CVC4__CHAIN_H */ +#endif /* CVC4__CHAIN_H */ diff --git a/src/expr/datatype.cpp b/src/expr/datatype.cpp index 8bedd4979..3b925d0b1 100644 --- a/src/expr/datatype.cpp +++ b/src/expr/datatype.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/datatype.h b/src/expr/datatype.h index 615ad0e10..0e8ace709 100644 --- a/src/expr/datatype.h +++ b/src/expr/datatype.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__DATATYPE_H -#define __CVC4__DATATYPE_H +#ifndef CVC4__DATATYPE_H +#define CVC4__DATATYPE_H #include <functional> #include <iostream> @@ -1288,4 +1288,4 @@ inline DatatypeConstructor::const_iterator DatatypeConstructor::end() const }/* CVC4 namespace */ -#endif /* __CVC4__DATATYPE_H */ +#endif /* CVC4__DATATYPE_H */ diff --git a/src/expr/emptyset.cpp b/src/expr/emptyset.cpp index f9093cb22..789eaf20e 100644 --- a/src/expr/emptyset.cpp +++ b/src/expr/emptyset.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/emptyset.h b/src/expr/emptyset.h index 8cca1e4b8..a9487e9a7 100644 --- a/src/expr/emptyset.h +++ b/src/expr/emptyset.h @@ -2,9 +2,9 @@ /*! \file emptyset.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Tim King, Morgan Deters + ** Tim King, Kshitij Bansal, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/expr_iomanip.cpp b/src/expr/expr_iomanip.cpp index 6be2e37f1..22600d79d 100644 --- a/src/expr/expr_iomanip.cpp +++ b/src/expr/expr_iomanip.cpp @@ -2,9 +2,9 @@ /*! \file expr_iomanip.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Morgan Deters, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/expr_iomanip.h b/src/expr/expr_iomanip.h index 936a62589..9a582f8c8 100644 --- a/src/expr/expr_iomanip.h +++ b/src/expr/expr_iomanip.h @@ -2,9 +2,9 @@ /*! \file expr_iomanip.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__EXPR__EXPR_IOMANIP_H -#define __CVC4__EXPR__EXPR_IOMANIP_H +#ifndef CVC4__EXPR__EXPR_IOMANIP_H +#define CVC4__EXPR__EXPR_IOMANIP_H #include <iosfwd> @@ -236,4 +236,4 @@ std::ostream& operator<<(std::ostream& out, ExprSetDepth sd) CVC4_PUBLIC; }/* CVC4 namespace */ -#endif /* __CVC4__EXPR__EXPR_IOMANIP_H */ +#endif /* CVC4__EXPR__EXPR_IOMANIP_H */ diff --git a/src/expr/expr_manager_scope.h b/src/expr/expr_manager_scope.h index a546638ad..b494796a1 100644 --- a/src/expr/expr_manager_scope.h +++ b/src/expr/expr_manager_scope.h @@ -2,9 +2,9 @@ /*! \file expr_manager_scope.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters + ** Morgan Deters, Dejan Jovanovic, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__EXPR_MANAGER_SCOPE_H -#define __CVC4__EXPR_MANAGER_SCOPE_H +#ifndef CVC4__EXPR_MANAGER_SCOPE_H +#define CVC4__EXPR_MANAGER_SCOPE_H #include "expr/expr.h" #include "expr/node_manager.h" @@ -66,4 +66,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__EXPR_MANAGER_SCOPE_H */ +#endif /* CVC4__EXPR_MANAGER_SCOPE_H */ diff --git a/src/expr/expr_manager_template.cpp b/src/expr/expr_manager_template.cpp index d0d36508f..988705aa8 100644 --- a/src/expr/expr_manager_template.cpp +++ b/src/expr/expr_manager_template.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Christopher L. Conway, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/expr_manager_template.h b/src/expr/expr_manager_template.h index 4e0ab700c..17affaef0 100644 --- a/src/expr/expr_manager_template.h +++ b/src/expr/expr_manager_template.h @@ -2,9 +2,9 @@ /*! \file expr_manager_template.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Dejan Jovanovic, Christopher L. Conway + ** Morgan Deters, Dejan Jovanovic, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__EXPR_MANAGER_H -#define __CVC4__EXPR_MANAGER_H +#ifndef CVC4__EXPR_MANAGER_H +#define CVC4__EXPR_MANAGER_H #include <vector> @@ -520,7 +520,7 @@ public: /** * Create a new, fresh variable for use in a binder expression - * (the BOUND_VAR_LIST of a FORALL, EXISTS, or LAMBDA). It is + * (the BOUND_VAR_LIST of a FORALL, EXISTS, LAMBDA, or CHOICE). It is * an error for this bound variable to exist outside of a binder, * and it should also only be used in a single binder expression. * That is, two distinct FORALL expressions should use entirely @@ -539,7 +539,7 @@ public: /** * Create a (nameless) new, fresh variable for use in a binder - * expression (the BOUND_VAR_LIST of a FORALL, EXISTS, or LAMBDA). + * expression (the BOUND_VAR_LIST of a FORALL, EXISTS, LAMBDA, or CHOICE). * It is an error for this bound variable to exist outside of a * binder, and it should also only be used in a single binder * expression. That is, two distinct FORALL expressions should use @@ -586,4 +586,4 @@ ${mkConst_instantiations} }/* CVC4 namespace */ -#endif /* __CVC4__EXPR_MANAGER_H */ +#endif /* CVC4__EXPR_MANAGER_H */ diff --git a/src/expr/expr_stream.h b/src/expr/expr_stream.h index 77ada6f11..d31e8e4fc 100644 --- a/src/expr/expr_stream.h +++ b/src/expr/expr_stream.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__EXPR_STREAM_H -#define __CVC4__EXPR_STREAM_H +#ifndef CVC4__EXPR_STREAM_H +#define CVC4__EXPR_STREAM_H #include "expr/expr.h" @@ -41,5 +41,5 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__EXPR_STREAM_H */ +#endif /* CVC4__EXPR_STREAM_H */ diff --git a/src/expr/expr_template.cpp b/src/expr/expr_template.cpp index 96bdb2d04..d6a6f47bb 100644 --- a/src/expr/expr_template.cpp +++ b/src/expr/expr_template.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -33,7 +33,7 @@ ${includes} // 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 36 "${template}" +#line 37 "${template}" using namespace CVC4::kind; using namespace std; @@ -200,6 +200,10 @@ public: TypeNode typeNode = TypeNode::fromType(type); NodeManager* to_nm = NodeManager::fromExprManager(to); Node n = to_nm->mkBoundVar(name, typeNode); // FIXME thread safety + + // Make sure that the correct `NodeManager` is in scope while + // converting the node to an expression. + NodeManagerScope to_nms(to_nm); to_e = n.toExpr(); } else if(n.getKind() == kind::VARIABLE) { bool isGlobal; @@ -214,6 +218,10 @@ public: TypeNode typeNode = TypeNode::fromType(type); NodeManager* to_nm = NodeManager::fromExprManager(to); Node n = to_nm->mkSkolem(name, typeNode, "is a skolem variable imported from another ExprManager");// FIXME thread safety + + // Make sure that the correct `NodeManager` is in scope while + // converting the node to an expression. + NodeManagerScope to_nms(to_nm); to_e = n.toExpr(); } else { Unhandled(); @@ -228,6 +236,10 @@ public: TypeNode typeNode = TypeNode::fromType(type); NodeManager* to_nm = NodeManager::fromExprManager(to); Node n = to_nm->mkBoundVar(typeNode); // FIXME thread safety + + // Make sure that the correct `NodeManager` is in scope while + // converting the node to an expression. + NodeManagerScope to_nms(to_nm); to_e = n.toExpr(); } else @@ -244,6 +256,11 @@ public: vmap.d_from[to_int] = from_int; vmap.d_to[from_int] = to_int; vmap.d_typeMap[to_e] = from_e;// insert other direction too + + // Make sure that the expressions are associated with the correct + // `ExprManager`s. + Assert(from_e.getExprManager() == from); + Assert(to_e.getExprManager() == to); return Node::fromExpr(to_e); } } else { diff --git a/src/expr/expr_template.h b/src/expr/expr_template.h index da9d22389..a32590050 100644 --- a/src/expr/expr_template.h +++ b/src/expr/expr_template.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ // "expr.h" safely, then go on to completely declare their own stuff. ${includes} -#ifndef __CVC4__EXPR_H -#define __CVC4__EXPR_H +#ifndef CVC4__EXPR_H +#define CVC4__EXPR_H #include <stdint.h> #include <iosfwd> @@ -612,7 +612,7 @@ private: ${getConst_instantiations} -#line 613 "${template}" +#line 616 "${template}" inline size_t ExprHashFunction::operator()(CVC4::Expr e) const { return (size_t) e.getId(); @@ -620,4 +620,4 @@ inline size_t ExprHashFunction::operator()(CVC4::Expr e) const { }/* CVC4 namespace */ -#endif /* __CVC4__EXPR_H */ +#endif /* CVC4__EXPR_H */ diff --git a/src/expr/kind_map.h b/src/expr/kind_map.h index af66b1630..a5ae73802 100644 --- a/src/expr/kind_map.h +++ b/src/expr/kind_map.h @@ -2,9 +2,9 @@ /*! \file kind_map.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Tim King + ** Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__KIND_MAP_H -#define __CVC4__KIND_MAP_H +#ifndef CVC4__KIND_MAP_H +#define CVC4__KIND_MAP_H #include <stdint.h> #include <iterator> @@ -271,4 +271,4 @@ inline KindMap operator^(Kind k1, KindMap m2) { }/* CVC4 namespace */ -#endif /* __CVC4__KIND_MAP_H */ +#endif /* CVC4__KIND_MAP_H */ diff --git a/src/expr/kind_template.cpp b/src/expr/kind_template.cpp index dcc98a1b7..e1a933e7b 100644 --- a/src/expr/kind_template.cpp +++ b/src/expr/kind_template.cpp @@ -2,9 +2,9 @@ /*! \file kind_template.cpp ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli, Mathias Preiner + ** Andres Noetzli, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -64,7 +64,7 @@ std::string kindToString(::CVC4::Kind k) { std::ostream& operator<<(std::ostream& out, TypeConstant typeConstant) { switch(typeConstant) { ${type_constant_descriptions} -#line 51 "${template}" +#line 68 "${template}" default: out << "UNKNOWN_TYPE_CONSTANT"; break; @@ -77,7 +77,7 @@ namespace theory { std::ostream& operator<<(std::ostream& out, TheoryId theoryId) { switch(theoryId) { ${theory_descriptions} -#line 64 "${template}" +#line 81 "${template}" default: out << "UNKNOWN_THEORY"; break; @@ -91,7 +91,7 @@ TheoryId kindToTheoryId(::CVC4::Kind k) { case kind::NULL_EXPR: break; ${kind_to_theory_id} -#line 78 "${template}" +#line 95 "${template}" case kind::LAST_KIND: break; } @@ -101,7 +101,7 @@ ${kind_to_theory_id} TheoryId typeConstantToTheoryId(::CVC4::TypeConstant typeConstant) { switch(typeConstant) { ${type_constant_to_theory_id} -#line 88 "${template}" +#line 105 "${template}" case LAST_TYPE: break; } @@ -111,7 +111,7 @@ ${type_constant_to_theory_id} std::string getStatsPrefix(TheoryId theoryId) { switch(theoryId) { ${theory_stats_prefixes} -#line 98 "${template}" +#line 115 "${template}" default: break; } diff --git a/src/expr/kind_template.h b/src/expr/kind_template.h index cdeb5ec88..93c37f6cc 100644 --- a/src/expr/kind_template.h +++ b/src/expr/kind_template.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__KIND_H -#define __CVC4__KIND_H +#ifndef CVC4__KIND_H +#define CVC4__KIND_H #include <iosfwd> @@ -104,4 +104,4 @@ std::string getStatsPrefix(TheoryId theoryId) CVC4_PUBLIC; }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__KIND_H */ +#endif /* CVC4__KIND_H */ diff --git a/src/expr/matcher.h b/src/expr/matcher.h index ff0631728..95ece7d23 100644 --- a/src/expr/matcher.h +++ b/src/expr/matcher.h @@ -2,9 +2,9 @@ /*! \file matcher.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__MATCHER_H -#define __CVC4__MATCHER_H +#ifndef CVC4__MATCHER_H +#define CVC4__MATCHER_H #include <iosfwd> #include <string> @@ -116,4 +116,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__MATCHER_H */ +#endif /* CVC4__MATCHER_H */ diff --git a/src/expr/metakind_template.cpp b/src/expr/metakind_template.cpp index 4ffa4dd44..5116392cb 100644 --- a/src/expr/metakind_template.cpp +++ b/src/expr/metakind_template.cpp @@ -2,9 +2,9 @@ /*! \file metakind_template.cpp ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Morgan Deters, Andres Noetzli, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/metakind_template.h b/src/expr/metakind_template.h index 1aad647a6..3550acf05 100644 --- a/src/expr/metakind_template.h +++ b/src/expr/metakind_template.h @@ -2,9 +2,9 @@ /*! \file metakind_template.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andres Noetzli, Tim King + ** Morgan Deters, Andres Noetzli, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__KIND__METAKIND_H -#define __CVC4__KIND__METAKIND_H +#ifndef CVC4__KIND__METAKIND_H +#define CVC4__KIND__METAKIND_H #include <iosfwd> @@ -118,13 +118,13 @@ namespace kind { namespace metakind { /* these are #defines so their sum can be #if-checked in node_value.h */ -#define __CVC4__EXPR__NODE_VALUE__NBITS__REFCOUNT 20 -#define __CVC4__EXPR__NODE_VALUE__NBITS__KIND 10 -#define __CVC4__EXPR__NODE_VALUE__NBITS__ID 40 -#define __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN 26 +#define CVC4__EXPR__NODE_VALUE__NBITS__REFCOUNT 20 +#define CVC4__EXPR__NODE_VALUE__NBITS__KIND 10 +#define CVC4__EXPR__NODE_VALUE__NBITS__ID 40 +#define CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN 26 static const unsigned MAX_CHILDREN = - (1u << __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN) - 1; + (1u << CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN) - 1; }/* CVC4::kind::metakind namespace */ }/* CVC4::kind namespace */ @@ -143,11 +143,11 @@ struct NodeValuePoolEq { #include "expr/node_value.h" -#endif /* __CVC4__KIND__METAKIND_H */ +#endif /* CVC4__KIND__METAKIND_H */ ${metakind_includes} -#ifdef __CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP +#ifdef CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP namespace CVC4 { @@ -234,4 +234,4 @@ ${theory_alternate_doc}"; }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP */ +#endif /* CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP */ diff --git a/src/expr/node.cpp b/src/expr/node.cpp index b983c81f5..de1d5475b 100644 --- a/src/expr/node.cpp +++ b/src/expr/node.cpp @@ -2,9 +2,9 @@ /*! \file node.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Morgan Deters, Tim King, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/node.h b/src/expr/node.h index 750a5547b..768d7b948 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ // circular dependency #include "expr/node_value.h" -#ifndef __CVC4__NODE_H -#define __CVC4__NODE_H +#ifndef CVC4__NODE_H +#define CVC4__NODE_H #include <stdint.h> @@ -459,7 +459,7 @@ public: assertTNodeNotExpired(); return getMetaKind() == kind::metakind::VARIABLE; } - + /** * Returns true if this node represents a nullary operator */ @@ -467,13 +467,15 @@ public: assertTNodeNotExpired(); return getMetaKind() == kind::metakind::NULLARY_OPERATOR; } - + + /** + * Returns true if this node represents a closure, that is an expression + * that binds variables. + */ inline bool isClosure() const { assertTNodeNotExpired(); - return getKind() == kind::LAMBDA || - getKind() == kind::FORALL || - getKind() == kind::EXISTS || - getKind() == kind::REWRITE_RULE; + return getKind() == kind::LAMBDA || getKind() == kind::FORALL + || getKind() == kind::EXISTS || getKind() == kind::CHOICE; } /** @@ -487,7 +489,7 @@ public: /** * Returns a node representing the operator of this expression. - * If this is an APPLY, then the operator will be a functional term. + * If this is an APPLY_UF, then the operator will be a functional term. * Otherwise, it will be a node with kind BUILTIN. */ NodeTemplate<true> getOperator() const; @@ -1271,7 +1273,7 @@ NodeTemplate<ref_count>::printAst(std::ostream& out, int indent) const { /** * Returns a node representing the operator of this expression. - * If this is an APPLY, then the operator will be a functional term. + * If this is an APPLY_UF, then the operator will be a functional term. * Otherwise, it will be a node with kind BUILTIN. */ template <bool ref_count> @@ -1568,4 +1570,4 @@ static void __attribute__((used)) debugPrintRawTNode(const NodeTemplate<false>& }/* CVC4 namespace */ -#endif /* __CVC4__NODE_H */ +#endif /* CVC4__NODE_H */ diff --git a/src/expr/node_algorithm.cpp b/src/expr/node_algorithm.cpp index 3905ad5c9..25ffb0778 100644 --- a/src/expr/node_algorithm.cpp +++ b/src/expr/node_algorithm.cpp @@ -2,9 +2,9 @@ /*! \file node_algorithm.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Andrew Reynolds, Haniel Barbosa, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -159,6 +159,14 @@ bool hasBoundVar(TNode n) bool hasFreeVar(TNode n) { + std::unordered_set<Node, NodeHashFunction> fvs; + return getFreeVariables(n, fvs, false); +} + +bool getFreeVariables(TNode n, + std::unordered_set<Node, NodeHashFunction>& fvs, + bool computeFv) +{ std::unordered_set<TNode, TNodeHashFunction> bound_var; std::unordered_map<TNode, bool, TNodeHashFunction> visited; std::vector<TNode> visit; @@ -174,8 +182,7 @@ bool hasFreeVar(TNode n) continue; } Kind k = cur.getKind(); - bool isQuant = k == kind::FORALL || k == kind::EXISTS || k == kind::LAMBDA - || k == kind::CHOICE; + bool isQuant = cur.isClosure(); std::unordered_map<TNode, bool, TNodeHashFunction>::iterator itv = visited.find(cur); if (itv == visited.end()) @@ -184,7 +191,14 @@ bool hasFreeVar(TNode n) { if (bound_var.find(cur) == bound_var.end()) { - return true; + if (computeFv) + { + fvs.insert(cur); + } + else + { + return true; + } } } else if (isQuant) @@ -218,7 +232,8 @@ bool hasFreeVar(TNode n) visited[cur] = true; } } while (!visit.empty()); - return false; + + return !fvs.empty(); } void getSymbols(TNode n, std::unordered_set<Node, NodeHashFunction>& syms) @@ -257,5 +272,117 @@ void getSymbols(TNode n, } while (!visit.empty()); } +Node substituteCaptureAvoiding(TNode n, Node src, Node dest) +{ + if (n == src) + { + return dest; + } + if (src == dest) + { + return n; + } + std::vector<Node> srcs; + std::vector<Node> dests; + srcs.push_back(src); + dests.push_back(dest); + return substituteCaptureAvoiding(n, srcs, dests); +} + +Node substituteCaptureAvoiding(TNode n, + std::vector<Node>& src, + std::vector<Node>& dest) +{ + std::unordered_map<TNode, Node, TNodeHashFunction> visited; + std::unordered_map<TNode, Node, TNodeHashFunction>::iterator it; + std::vector<TNode> visit; + TNode curr; + visit.push_back(n); + Assert(src.size() == dest.size(), + "Substitution domain and range must be equal size"); + do + { + curr = visit.back(); + visit.pop_back(); + it = visited.find(curr); + + if (it == visited.end()) + { + auto itt = std::find(src.rbegin(), src.rend(), curr); + if (itt != src.rend()) + { + Assert( + (std::distance(src.begin(), itt.base()) - 1) >= 0 + && static_cast<unsigned>(std::distance(src.begin(), itt.base()) - 1) + < dest.size()); + Node n = dest[std::distance(src.begin(), itt.base()) - 1]; + visited[curr] = n; + continue; + } + if (curr.getNumChildren() == 0) + { + visited[curr] = curr; + continue; + } + + visited[curr] = Node::null(); + // if binder, rename variables to avoid capture + if (curr.isClosure()) + { + NodeManager* nm = NodeManager::currentNM(); + // have new vars -> renames subs in the end of current sub + for (const Node& v : curr[0]) + { + src.push_back(v); + dest.push_back(nm->mkBoundVar(v.getType())); + } + } + // save for post-visit + visit.push_back(curr); + // visit children + if (curr.getMetaKind() == kind::metakind::PARAMETERIZED) + { + // push the operator + visit.push_back(curr.getOperator()); + } + for (unsigned i = 0, size = curr.getNumChildren(); i < size; ++i) + { + visit.push_back(curr[i]); + } + } + else if (it->second.isNull()) + { + // build node + NodeBuilder<> nb(curr.getKind()); + if (curr.getMetaKind() == kind::metakind::PARAMETERIZED) + { + // push the operator + Assert(visited.find(curr.getOperator()) != visited.end()); + nb << visited[curr.getOperator()]; + } + // collect substituted children + for (unsigned i = 0, size = curr.getNumChildren(); i < size; ++i) + { + Assert(visited.find(curr[i]) != visited.end()); + nb << visited[curr[i]]; + } + Node n = nb; + visited[curr] = n; + + // remove renaming + if (curr.isClosure()) + { + // remove beginning of sub which correspond to renaming of variables in + // this binder + unsigned nchildren = curr[0].getNumChildren(); + src.resize(src.size() - nchildren); + dest.resize(dest.size() - nchildren); + } + } + } while (!visit.empty()); + Assert(visited.find(n) != visited.end()); + return visited[n]; +} + } // namespace expr } // namespace CVC4 diff --git a/src/expr/node_algorithm.h b/src/expr/node_algorithm.h index d825d7f57..656f162ae 100644 --- a/src/expr/node_algorithm.h +++ b/src/expr/node_algorithm.h @@ -2,9 +2,9 @@ /*! \file node_algorithm.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Andrew Reynolds, Andres Noetzli, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__EXPR__NODE_ALGORITHM_H -#define __CVC4__EXPR__NODE_ALGORITHM_H +#ifndef CVC4__EXPR__NODE_ALGORITHM_H +#define CVC4__EXPR__NODE_ALGORITHM_H #include <unordered_map> #include <vector> @@ -60,6 +60,19 @@ bool hasBoundVar(TNode n); bool hasFreeVar(TNode n); /** + * Get the free variables in n, that is, the subterms of n of kind + * BOUND_VARIABLE that are not bound in n, adds these to fvs. + * @param n The node under investigation + * @param fvs The set which free variables are added to + * @param computeFv If this flag is false, then we only return true/false and + * do not add to fvs. + * @return true iff this node contains a free variable. + */ +bool getFreeVariables(TNode n, + std::unordered_set<Node, NodeHashFunction>& fvs, + bool computeFv = true); + +/** * For term n, this function collects the symbols that occur as a subterms * of n. A symbol is a variable that does not have kind BOUND_VARIABLE. * @param n The node under investigation @@ -70,6 +83,19 @@ void getSymbols(TNode n, std::unordered_set<Node, NodeHashFunction>& syms); void getSymbols(TNode n, std::unordered_set<Node, NodeHashFunction>& syms, std::unordered_set<TNode, TNodeHashFunction>& visited); +/** + * Substitution of Nodes in a capture avoiding way. + */ +Node substituteCaptureAvoiding(TNode n, Node src, Node dest); + +/** + * Simultaneous substitution of Nodes in a capture avoiding way. Elements in + * source will be replaced by their corresponding element in dest. Both + * vectors should have the same size. + */ +Node substituteCaptureAvoiding(TNode n, + std::vector<Node>& src, + std::vector<Node>& dest); } // namespace expr } // namespace CVC4 diff --git a/src/expr/node_builder.h b/src/expr/node_builder.h index 9f258c560..9128bc190 100644 --- a/src/expr/node_builder.h +++ b/src/expr/node_builder.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -152,8 +152,8 @@ #include "expr/node.h" #include "expr/type_node.h" -#ifndef __CVC4__NODE_BUILDER_H -#define __CVC4__NODE_BUILDER_H +#ifndef CVC4__NODE_BUILDER_H +#define CVC4__NODE_BUILDER_H #include <cstdlib> #include <iostream> @@ -274,7 +274,7 @@ class NodeBuilder { */ inline void realloc() { size_t newSize = 2 * size_t(d_nvMaxChildren); - size_t hardLimit = (1lu << __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN) - 1; + size_t hardLimit = (1lu << CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN) - 1; realloc(__builtin_expect( ( newSize > hardLimit ), false ) ? hardLimit : newSize); } @@ -774,9 +774,9 @@ template <unsigned nchild_thresh> void NodeBuilder<nchild_thresh>::realloc(size_t toSize) { Assert( toSize > d_nvMaxChildren, "attempt to realloc() a NodeBuilder to a smaller/equal size!" ); - Assert( toSize < (1lu << __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN), + Assert( toSize < (1lu << CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN), "attempt to realloc() a NodeBuilder to size %u (beyond hard limit of %u)", - toSize, (1lu << __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN) - 1 ); + toSize, (1lu << CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN) - 1 ); if(__builtin_expect( ( nvIsAllocated() ), false )) { // Ensure d_nv is not modified on allocation failure @@ -1342,4 +1342,4 @@ std::ostream& operator<<(std::ostream& out, const NodeBuilder<nchild_thresh>& nb }/* CVC4 namespace */ -#endif /* __CVC4__NODE_BUILDER_H */ +#endif /* CVC4__NODE_BUILDER_H */ diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp index a40d1511b..66d597a36 100644 --- a/src/expr/node_manager.cpp +++ b/src/expr/node_manager.cpp @@ -2,9 +2,9 @@ /*! \file node_manager.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Morgan Deters, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -363,7 +363,10 @@ void NodeManager::reclaimZombies() { std::vector<NodeValue*> NodeManager::TopologicalSort( const std::vector<NodeValue*>& roots) { std::vector<NodeValue*> order; + // The stack of nodes to visit. The Boolean value is false when visiting the + // node in preorder and true when visiting it in postorder. std::vector<std::pair<bool, NodeValue*> > stack; + // Nodes that have been visited in both pre- and postorder NodeValueIDSet visited; const NodeValueIDSet root_set(roots.begin(), roots.end()); @@ -382,17 +385,20 @@ std::vector<NodeValue*> NodeManager::TopologicalSort( order.push_back(current); } stack.pop_back(); - } else { + } + else if (visited.find(current) == visited.end()) + { stack.back().first = true; - Assert(visited.count(current) == 0); visited.insert(current); for (unsigned i = 0; i < current->getNumChildren(); ++i) { expr::NodeValue* child = current->getChild(i); - if (visited.find(child) == visited.end()) { - stack.push_back(std::make_pair(false, child)); - } + stack.push_back(std::make_pair(false, child)); } } + else + { + stack.pop_back(); + } } } Assert(order.size() == roots.size()); diff --git a/src/expr/node_manager.h b/src/expr/node_manager.h index 7cafb6e11..510e6d585 100644 --- a/src/expr/node_manager.h +++ b/src/expr/node_manager.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Christopher L. Conway, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -25,8 +25,8 @@ #include "expr/expr.h" #include "expr/expr_manager.h" -#ifndef __CVC4__NODE_MANAGER_H -#define __CVC4__NODE_MANAGER_H +#ifndef CVC4__NODE_MANAGER_H +#define CVC4__NODE_MANAGER_H #include <vector> #include <string> @@ -276,6 +276,17 @@ class NodeManager { Debug("gc") << (d_inReclaimZombies ? " [CURRENTLY-RECLAIMING]" : "") << std::endl; } + + // `d_zombies` uses the node id to hash and compare nodes. If `d_zombies` + // already contains a node value with the same id as `nv`, but the pointers + // are different, then the wrong `NodeManager` was in scope for one of the + // two nodes when it reached refcount zero. This can happen for example if + // you create a node with a `NodeManager` n1 and then call `Node::toExpr()` + // on that node while a different `NodeManager` n2 is in scope. When that + // `Expr` is deleted and the node reaches refcount zero in the `Expr`'s + // destructor, then `markForDeletion()` will be called on n2. + Assert(d_zombies.find(nv) == d_zombies.end() || *d_zombies.find(nv) == nv); + d_zombies.insert(nv); // FIXME multithreading if(safeToReclaimZombies()) { @@ -1204,9 +1215,9 @@ inline TypeNode NodeManager::fromType(Type t) { }/* CVC4 namespace */ -#define __CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP +#define CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP #include "expr/metakind.h" -#undef __CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP +#undef CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP #include "expr/node_builder.h" @@ -1548,4 +1559,4 @@ NodeClass NodeManager::mkConstInternal(const T& val) { }/* CVC4 namespace */ -#endif /* __CVC4__NODE_MANAGER_H */ +#endif /* CVC4__NODE_MANAGER_H */ diff --git a/src/expr/node_manager_attributes.h b/src/expr/node_manager_attributes.h index fe2e38924..99bfcb8a9 100644 --- a/src/expr/node_manager_attributes.h +++ b/src/expr/node_manager_attributes.h @@ -2,9 +2,9 @@ /*! \file node_manager_attributes.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/node_manager_listeners.cpp b/src/expr/node_manager_listeners.cpp index a38181107..ecb089dc9 100644 --- a/src/expr/node_manager_listeners.cpp +++ b/src/expr/node_manager_listeners.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/node_manager_listeners.h b/src/expr/node_manager_listeners.h index 6834aabbb..501c6129f 100644 --- a/src/expr/node_manager_listeners.h +++ b/src/expr/node_manager_listeners.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__EXPR__NODE_MANAGER_LISTENERS_H -#define __CVC4__EXPR__NODE_MANAGER_LISTENERS_H +#ifndef CVC4__EXPR__NODE_MANAGER_LISTENERS_H +#define CVC4__EXPR__NODE_MANAGER_LISTENERS_H #include "base/listener.h" #include "util/resource_manager.h" @@ -64,4 +64,4 @@ class RlimitPerListener : public Listener { }/* CVC4::expr namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__EXPR__NODE_MANAGER_LISTENERS_H */ +#endif /* CVC4__EXPR__NODE_MANAGER_LISTENERS_H */ diff --git a/src/expr/node_self_iterator.h b/src/expr/node_self_iterator.h index 6783fd3ea..7e0478acc 100644 --- a/src/expr/node_self_iterator.h +++ b/src/expr/node_self_iterator.h @@ -2,9 +2,9 @@ /*! \file node_self_iterator.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andres Noetzli + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__EXPR__NODE_SELF_ITERATOR_H -#define __CVC4__EXPR__NODE_SELF_ITERATOR_H +#ifndef CVC4__EXPR__NODE_SELF_ITERATOR_H +#define CVC4__EXPR__NODE_SELF_ITERATOR_H #include <iterator> @@ -125,4 +125,4 @@ inline bool NodeSelfIterator::operator!=(NodeSelfIterator i) const { }/* CVC4::expr namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__EXPR__NODE_SELF_ITERATOR_H */ +#endif /* CVC4__EXPR__NODE_SELF_ITERATOR_H */ diff --git a/src/expr/node_trie.cpp b/src/expr/node_trie.cpp index 4404e78ca..0900ec9af 100644 --- a/src/expr/node_trie.cpp +++ b/src/expr/node_trie.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/node_trie.h b/src/expr/node_trie.h index d0c0f0627..7aa740a42 100644 --- a/src/expr/node_trie.h +++ b/src/expr/node_trie.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__EXPR__NODE_TRIE_H -#define __CVC4__EXPR__NODE_TRIE_H +#ifndef CVC4__EXPR__NODE_TRIE_H +#define CVC4__EXPR__NODE_TRIE_H #include <map> #include "expr/node.h" @@ -109,4 +109,4 @@ typedef NodeTemplateTrie<false> TNodeTrie; } // namespace theory } // namespace CVC4 -#endif /* __CVC4__EXPR__NODE_TRIE_H */ +#endif /* CVC4__EXPR__NODE_TRIE_H */ diff --git a/src/expr/node_value.cpp b/src/expr/node_value.cpp index e3c8ef331..d7faf0814 100644 --- a/src/expr/node_value.cpp +++ b/src/expr/node_value.cpp @@ -2,9 +2,9 @@ /*! \file node_value.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Morgan Deters, Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/node_value.h b/src/expr/node_value.h index 6bba80dd1..024a13941 100644 --- a/src/expr/node_value.h +++ b/src/expr/node_value.h @@ -2,9 +2,9 @@ /*! \file node_value.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Dejan Jovanovic + ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ // circular dependency #include "expr/metakind.h" -#ifndef __CVC4__EXPR__NODE_VALUE_H -#define __CVC4__EXPR__NODE_VALUE_H +#ifndef CVC4__EXPR__NODE_VALUE_H +#define CVC4__EXPR__NODE_VALUE_H #include <stdint.h> @@ -59,10 +59,10 @@ namespace kind { namespace expr { -#if __CVC4__EXPR__NODE_VALUE__NBITS__REFCOUNT + \ - __CVC4__EXPR__NODE_VALUE__NBITS__KIND + \ - __CVC4__EXPR__NODE_VALUE__NBITS__ID + \ - __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN != 96 +#if CVC4__EXPR__NODE_VALUE__NBITS__REFCOUNT + \ + CVC4__EXPR__NODE_VALUE__NBITS__KIND + \ + CVC4__EXPR__NODE_VALUE__NBITS__ID + \ + CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN != 96 # error NodeValue header bit assignment does not sum to 96 ! #endif /* sum != 96 */ @@ -71,10 +71,10 @@ namespace expr { */ class NodeValue { - static const unsigned NBITS_REFCOUNT = __CVC4__EXPR__NODE_VALUE__NBITS__REFCOUNT; - static const unsigned NBITS_KIND = __CVC4__EXPR__NODE_VALUE__NBITS__KIND; - static const unsigned NBITS_ID = __CVC4__EXPR__NODE_VALUE__NBITS__ID; - static const unsigned NBITS_NCHILDREN = __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN; + static const unsigned NBITS_REFCOUNT = CVC4__EXPR__NODE_VALUE__NBITS__REFCOUNT; + static const unsigned NBITS_KIND = CVC4__EXPR__NODE_VALUE__NBITS__KIND; + static const unsigned NBITS_ID = CVC4__EXPR__NODE_VALUE__NBITS__ID; + static const unsigned NBITS_NCHILDREN = CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN; /** Maximum reference count possible. Used for sticky * reference-counting. Should be (1 << num_bits(d_rc)) - 1 */ @@ -549,4 +549,4 @@ static void __attribute__((used)) debugPrintRawNodeValue(const expr::NodeValue* }/* CVC4 namespace */ -#endif /* __CVC4__EXPR__NODE_VALUE_H */ +#endif /* CVC4__EXPR__NODE_VALUE_H */ diff --git a/src/expr/pickle_data.cpp b/src/expr/pickle_data.cpp index 709cb4e1a..fd3b69d26 100644 --- a/src/expr/pickle_data.cpp +++ b/src/expr/pickle_data.cpp @@ -2,9 +2,9 @@ /*! \file pickle_data.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/pickle_data.h b/src/expr/pickle_data.h index 7fa23f3d4..316b6285c 100644 --- a/src/expr/pickle_data.h +++ b/src/expr/pickle_data.h @@ -2,9 +2,9 @@ /*! \file pickle_data.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PICKLE_DATA_H -#define __CVC4__PICKLE_DATA_H +#ifndef CVC4__PICKLE_DATA_H +#define CVC4__PICKLE_DATA_H #include <sstream> #include <deque> @@ -44,8 +44,8 @@ namespace expr { namespace pickle { const unsigned NBITS_BLOCK = 64; -const unsigned NBITS_KIND = __CVC4__EXPR__NODE_VALUE__NBITS__KIND; -const unsigned NBITS_NCHILDREN = __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN; +const unsigned NBITS_KIND = CVC4__EXPR__NODE_VALUE__NBITS__KIND; +const unsigned NBITS_NCHILDREN = CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN; const unsigned NBITS_CONSTBLOCKS = 32; struct BlockHeader { @@ -117,4 +117,4 @@ public: }/* CVC4::expr namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PICKLE_DATA_H */ +#endif /* CVC4__PICKLE_DATA_H */ diff --git a/src/expr/pickler.cpp b/src/expr/pickler.cpp index 8e1f07b08..42198d676 100644 --- a/src/expr/pickler.cpp +++ b/src/expr/pickler.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Kshitij Bansal, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/pickler.h b/src/expr/pickler.h index ae9f6d94f..02abdf18d 100644 --- a/src/expr/pickler.h +++ b/src/expr/pickler.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__PICKLER_H -#define __CVC4__PICKLER_H +#ifndef CVC4__PICKLER_H +#define CVC4__PICKLER_H #include "expr/variable_type_map.h" #include "expr/expr.h" @@ -126,4 +126,4 @@ protected: }/* CVC4::expr namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PICKLER_H */ +#endif /* CVC4__PICKLER_H */ diff --git a/src/expr/record.cpp b/src/expr/record.cpp index 123000ab4..03682c8d4 100644 --- a/src/expr/record.cpp +++ b/src/expr/record.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/record.h b/src/expr/record.h index 3d2abf844..bfa5d9395 100644 --- a/src/expr/record.h +++ b/src/expr/record.h @@ -2,9 +2,9 @@ /*! \file record.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andres Noetzli + ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__RECORD_H -#define __CVC4__RECORD_H +#ifndef CVC4__RECORD_H +#define CVC4__RECORD_H #include <functional> #include <iostream> @@ -90,4 +90,4 @@ std::ostream& operator<<(std::ostream& os, const Record& r) CVC4_PUBLIC; }/* CVC4 namespace */ -#endif /* __CVC4__RECORD_H */ +#endif /* CVC4__RECORD_H */ diff --git a/src/expr/symbol_table.cpp b/src/expr/symbol_table.cpp index 9401e772c..600f666bc 100644 --- a/src/expr/symbol_table.cpp +++ b/src/expr/symbol_table.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/symbol_table.h b/src/expr/symbol_table.h index 19a42a303..07f557059 100644 --- a/src/expr/symbol_table.h +++ b/src/expr/symbol_table.h @@ -2,9 +2,9 @@ /*! \file symbol_table.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Christopher L. Conway + ** Morgan Deters, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__SYMBOL_TABLE_H -#define __CVC4__SYMBOL_TABLE_H +#ifndef CVC4__SYMBOL_TABLE_H +#define CVC4__SYMBOL_TABLE_H #include <memory> #include <string> @@ -246,4 +246,4 @@ class CVC4_PUBLIC SymbolTable { } // namespace CVC4 -#endif /* __CVC4__SYMBOL_TABLE_H */ +#endif /* CVC4__SYMBOL_TABLE_H */ diff --git a/src/expr/type.cpp b/src/expr/type.cpp index fe8cc097b..f2b5945dd 100644 --- a/src/expr/type.cpp +++ b/src/expr/type.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/type.h b/src/expr/type.h index 4d22f1538..2c68c9e73 100644 --- a/src/expr/type.h +++ b/src/expr/type.h @@ -2,9 +2,9 @@ /*! \file type.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Dejan Jovanovic, Christopher L. Conway + ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__TYPE_H -#define __CVC4__TYPE_H +#ifndef CVC4__TYPE_H +#define CVC4__TYPE_H #include <climits> #include <cstdint> @@ -665,4 +665,4 @@ class CVC4_PUBLIC TesterType : public Type { }/* CVC4 namespace */ -#endif /* __CVC4__TYPE_H */ +#endif /* CVC4__TYPE_H */ diff --git a/src/expr/type_checker.h b/src/expr/type_checker.h index 35a4e46a8..8c03cea98 100644 --- a/src/expr/type_checker.h +++ b/src/expr/type_checker.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ // ordering dependence #include "expr/node.h" -#ifndef __CVC4__EXPR__TYPE_CHECKER_H -#define __CVC4__EXPR__TYPE_CHECKER_H +#ifndef CVC4__EXPR__TYPE_CHECKER_H +#define CVC4__EXPR__TYPE_CHECKER_H namespace CVC4 { namespace expr { @@ -40,4 +40,4 @@ public: }/* CVC4::expr namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__EXPR__TYPE_CHECKER_H */ +#endif /* CVC4__EXPR__TYPE_CHECKER_H */ diff --git a/src/expr/type_checker_template.cpp b/src/expr/type_checker_template.cpp index 4fbed28a5..078c275f8 100644 --- a/src/expr/type_checker_template.cpp +++ b/src/expr/type_checker_template.cpp @@ -2,9 +2,9 @@ /*! \file type_checker_template.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Morgan Deters, Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/type_node.cpp b/src/expr/type_node.cpp index b54290612..b093e596e 100644 --- a/src/expr/type_node.cpp +++ b/src/expr/type_node.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/type_node.h b/src/expr/type_node.h index 5b0caf659..8ed26596b 100644 --- a/src/expr/type_node.h +++ b/src/expr/type_node.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ // circular dependency #include "expr/node_value.h" -#ifndef __CVC4__TYPE_NODE_H -#define __CVC4__TYPE_NODE_H +#ifndef CVC4__TYPE_NODE_H +#define CVC4__TYPE_NODE_H #include <stdint.h> @@ -1072,4 +1072,4 @@ static void __attribute__((used)) debugPrintRawTypeNode(const TypeNode& n) { }/* CVC4 namespace */ -#endif /* __CVC4__NODE_H */ +#endif /* CVC4__NODE_H */ diff --git a/src/expr/type_properties_template.h b/src/expr/type_properties_template.h index 74152a5ac..88447a125 100644 --- a/src/expr/type_properties_template.h +++ b/src/expr/type_properties_template.h @@ -2,9 +2,9 @@ /*! \file type_properties_template.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__TYPE_PROPERTIES_H -#define __CVC4__TYPE_PROPERTIES_H +#ifndef CVC4__TYPE_PROPERTIES_H +#define CVC4__TYPE_PROPERTIES_H #line 23 "${template}" @@ -138,4 +138,4 @@ ${type_groundterms} }/* CVC4::kind namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__TYPE_PROPERTIES_H */ +#endif /* CVC4__TYPE_PROPERTIES_H */ diff --git a/src/expr/uninterpreted_constant.cpp b/src/expr/uninterpreted_constant.cpp index 9898bcb3f..5c9daf784 100644 --- a/src/expr/uninterpreted_constant.cpp +++ b/src/expr/uninterpreted_constant.cpp @@ -2,9 +2,9 @@ /*! \file uninterpreted_constant.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/uninterpreted_constant.h b/src/expr/uninterpreted_constant.h index 6d4081ba0..fb6557497 100644 --- a/src/expr/uninterpreted_constant.h +++ b/src/expr/uninterpreted_constant.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/expr/variable_type_map.h b/src/expr/variable_type_map.h index 04adb246c..ba1c60549 100644 --- a/src/expr/variable_type_map.h +++ b/src/expr/variable_type_map.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__VARIABLE_TYPE_MAP_H -#define __CVC4__VARIABLE_TYPE_MAP_H +#ifndef CVC4__VARIABLE_TYPE_MAP_H +#define CVC4__VARIABLE_TYPE_MAP_H #include <unordered_map> @@ -60,4 +60,4 @@ struct CVC4_PUBLIC ExprManagerMapCollection { }/* CVC4 namespace */ -#endif /* __CVC4__VARIABLE_MAP_H */ +#endif /* CVC4__VARIABLE_MAP_H */ diff --git a/src/fix-install-headers.sh b/src/fix-install-headers.sh new file mode 100755 index 000000000..a1f15996a --- /dev/null +++ b/src/fix-install-headers.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +dir=$1 +find "$dir/include/cvc4/" -type f | \ + xargs sed -i 's/include.*"\(.*\)"/include <cvc4\/\1>/' diff --git a/src/include/cvc4.h b/src/include/cvc4.h index 2670f469d..86433731f 100644 --- a/src/include/cvc4.h +++ b/src/include/cvc4.h @@ -2,9 +2,9 @@ /*! \file cvc4.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ ** most-commonly used CVC4 public-facing class interfaces. **/ -#ifndef __CVC4__CVC4_H -#define __CVC4__CVC4_H +#ifndef CVC4__CVC4_H +#define CVC4__CVC4_H #include <cvc4/base/configuration.h> #include <cvc4/base/exception.h> @@ -31,4 +31,4 @@ #include <cvc4/util/integer.h> #include <cvc4/util/rational.h> -#endif /* __CVC4__CVC4_H */ +#endif /* CVC4__CVC4_H */ diff --git a/src/include/cvc4_private.h b/src/include/cvc4_private.h index 715f7ccc2..cadbbae33 100644 --- a/src/include/cvc4_private.h +++ b/src/include/cvc4_private.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ ** warning when the file is included improperly. **/ -#ifndef __CVC4_PRIVATE_H -#define __CVC4_PRIVATE_H +#ifndef CVC4_PRIVATE_H +#define CVC4_PRIVATE_H #if ! (defined(__BUILDING_CVC4LIB) || defined(__BUILDING_CVC4LIB_UNIT_TEST)) # error A private CVC4 header was included when not building the library or private unit test code. @@ -27,4 +27,4 @@ #include "cvc4_public.h" #include "cvc4autoconfig.h" -#endif /* __CVC4_PRIVATE_H */ +#endif /* CVC4_PRIVATE_H */ diff --git a/src/include/cvc4_private_library.h b/src/include/cvc4_private_library.h index 23bf0e01f..6c0c8f324 100644 --- a/src/include/cvc4_private_library.h +++ b/src/include/cvc4_private_library.h @@ -2,9 +2,9 @@ /*! \file cvc4_private_library.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ ** warning when the file is included improperly. **/ -#ifndef __CVC4_PRIVATE_LIBRARY_H -#define __CVC4_PRIVATE_LIBRARY_H +#ifndef CVC4_PRIVATE_LIBRARY_H +#define CVC4_PRIVATE_LIBRARY_H #if !(defined(__BUILDING_CVC4LIB) || defined(__BUILDING_CVC4LIB_UNIT_TEST) \ || defined(__BUILDING_CVC4PARSERLIB) \ @@ -29,4 +29,4 @@ #include "cvc4_public.h" #include "cvc4autoconfig.h" -#endif /* __CVC4_PRIVATE_LIBRARY_H */ +#endif /* CVC4_PRIVATE_LIBRARY_H */ diff --git a/src/include/cvc4_public.h b/src/include/cvc4_public.h index 7950a5af6..39b919f9f 100644 --- a/src/include/cvc4_public.h +++ b/src/include/cvc4_public.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ ** the libraries and driver binary, and also exported to the user. **/ -#ifndef __CVC4_PUBLIC_H -#define __CVC4_PUBLIC_H +#ifndef CVC4_PUBLIC_H +#define CVC4_PUBLIC_H #include <stdint.h> @@ -52,4 +52,4 @@ # define CVC4_WARN_UNUSED_RESULT #endif /* __GNUC__ */ -#endif /* __CVC4_PUBLIC_H */ +#endif /* CVC4_PUBLIC_H */ diff --git a/src/include/cvc4parser_private.h b/src/include/cvc4parser_private.h index 9fc2d464a..203105fe6 100644 --- a/src/include/cvc4parser_private.h +++ b/src/include/cvc4parser_private.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/include/cvc4parser_public.h b/src/include/cvc4parser_public.h index ac015ba92..fe8d017bf 100644 --- a/src/include/cvc4parser_public.h +++ b/src/include/cvc4parser_public.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/lib/clock_gettime.c b/src/lib/clock_gettime.c index 71b2bf569..82cb8a4cb 100644 --- a/src/lib/clock_gettime.c +++ b/src/lib/clock_gettime.c @@ -2,9 +2,9 @@ /*! \file clock_gettime.c ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Paul Meng + ** Morgan Deters, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/lib/clock_gettime.h b/src/lib/clock_gettime.h index db83da853..d9382f506 100644 --- a/src/lib/clock_gettime.h +++ b/src/lib/clock_gettime.h @@ -2,9 +2,9 @@ /*! \file clock_gettime.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private_library.h" -#ifndef __CVC4__LIB__CLOCK_GETTIME_H -#define __CVC4__LIB__CLOCK_GETTIME_H +#ifndef CVC4__LIB__CLOCK_GETTIME_H +#define CVC4__LIB__CLOCK_GETTIME_H #include "lib/replacements.h" @@ -72,4 +72,4 @@ long clock_gettime(clockid_t which_clock, struct timespec* tp); #endif /* __cplusplus */ #endif /* HAVE_CLOCK_GETTIME */ -#endif /*__CVC4__LIB__CLOCK_GETTIME_H */ +#endif /*CVC4__LIB__CLOCK_GETTIME_H */ diff --git a/src/lib/ffs.c b/src/lib/ffs.c index e9df47775..4715b35f2 100644 --- a/src/lib/ffs.c +++ b/src/lib/ffs.c @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/lib/ffs.h b/src/lib/ffs.h index 129ccdbf0..ce7ecc2a1 100644 --- a/src/lib/ffs.h +++ b/src/lib/ffs.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__LIB__FFS_H -#define __CVC4__LIB__FFS_H +#ifndef CVC4__LIB__FFS_H +#define CVC4__LIB__FFS_H //We include this for HAVE_FFS #include "cvc4autoconfig.h" @@ -42,4 +42,4 @@ int ffs(int i); #endif /* __cplusplus */ #endif /* HAVE_FFS */ -#endif /* __CVC4__LIB__FFS_H */ +#endif /* CVC4__LIB__FFS_H */ diff --git a/src/lib/replacements.h b/src/lib/replacements.h index 544374586..fef6baa28 100644 --- a/src/lib/replacements.h +++ b/src/lib/replacements.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ ** Common header for replacement function sources. **/ -#ifndef __CVC4__LIB__REPLACEMENTS_H -#define __CVC4__LIB__REPLACEMENTS_H +#ifndef CVC4__LIB__REPLACEMENTS_H +#define CVC4__LIB__REPLACEMENTS_H #if (defined(__BUILDING_CVC4LIB) || defined(__BUILDING_CVC4LIB_UNIT_TEST)) && !defined(__BUILDING_STATISTICS_FOR_EXPORT) # include "cvc4_private.h" @@ -31,4 +31,4 @@ # endif #endif -#endif /* __CVC4__LIB__REPLACEMENTS_H */ +#endif /* CVC4__LIB__REPLACEMENTS_H */ diff --git a/src/lib/strtok_r.c b/src/lib/strtok_r.c index 704fae369..1d0e039b0 100644 --- a/src/lib/strtok_r.c +++ b/src/lib/strtok_r.c @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/lib/strtok_r.h b/src/lib/strtok_r.h index 9534e71f6..0640893c9 100644 --- a/src/lib/strtok_r.h +++ b/src/lib/strtok_r.h @@ -2,9 +2,9 @@ /*! \file strtok_r.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__LIB__STRTOK_R_H -#define __CVC4__LIB__STRTOK_R_H +#ifndef CVC4__LIB__STRTOK_R_H +#define CVC4__LIB__STRTOK_R_H #ifdef HAVE_STRTOK_R @@ -39,4 +39,4 @@ char* strtok_r(char *str, const char *delim, char **saveptr); #endif /* __cplusplus */ #endif /* HAVE_STRTOK_R */ -#endif /* __CVC4__LIB__STRTOK_R_H */ +#endif /* CVC4__LIB__STRTOK_R_H */ diff --git a/src/main/command_executor.cpp b/src/main/command_executor.cpp index 40c31de99..7e46b163b 100644 --- a/src/main/command_executor.cpp +++ b/src/main/command_executor.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/main/command_executor.h b/src/main/command_executor.h index f8c6e6e5a..c71f4d7a5 100644 --- a/src/main/command_executor.h +++ b/src/main/command_executor.h @@ -2,9 +2,9 @@ /*! \file command_executor.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Morgan Deters, Aina Niemetz + ** Morgan Deters, Kshitij Bansal, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -12,8 +12,8 @@ ** \brief An additional layer between commands and invoking them. **/ -#ifndef __CVC4__MAIN__COMMAND_EXECUTOR_H -#define __CVC4__MAIN__COMMAND_EXECUTOR_H +#ifndef CVC4__MAIN__COMMAND_EXECUTOR_H +#define CVC4__MAIN__COMMAND_EXECUTOR_H #include <iosfwd> #include <string> @@ -104,4 +104,4 @@ bool smtEngineInvoke(SmtEngine* smt, Command* cmd, std::ostream *out); }/* CVC4::main namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__MAIN__COMMAND_EXECUTOR_H */ +#endif /* CVC4__MAIN__COMMAND_EXECUTOR_H */ diff --git a/src/main/command_executor_portfolio.cpp b/src/main/command_executor_portfolio.cpp index ba75d5ff7..fde1b59d3 100644 --- a/src/main/command_executor_portfolio.cpp +++ b/src/main/command_executor_portfolio.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/main/command_executor_portfolio.h b/src/main/command_executor_portfolio.h index fe4d35640..ef3329ef5 100644 --- a/src/main/command_executor_portfolio.h +++ b/src/main/command_executor_portfolio.h @@ -2,9 +2,9 @@ /*! \file command_executor_portfolio.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Morgan Deters, Tim King + ** Kshitij Bansal, Morgan Deters, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ ** threads. **/ -#ifndef __CVC4__MAIN__COMMAND_EXECUTOR_PORTFOLIO_H -#define __CVC4__MAIN__COMMAND_EXECUTOR_PORTFOLIO_H +#ifndef CVC4__MAIN__COMMAND_EXECUTOR_PORTFOLIO_H +#define CVC4__MAIN__COMMAND_EXECUTOR_PORTFOLIO_H #include "main/command_executor.h" #include "main/portfolio_util.h" @@ -82,4 +82,4 @@ private: }/* CVC4::main namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__MAIN__COMMAND_EXECUTOR_PORTFOLIO_H */ +#endif /* CVC4__MAIN__COMMAND_EXECUTOR_PORTFOLIO_H */ diff --git a/src/main/driver_unified.cpp b/src/main/driver_unified.cpp index de2348973..7af8a6fdb 100644 --- a/src/main/driver_unified.cpp +++ b/src/main/driver_unified.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index aeccd3a64..e7cd8691e 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Christopher L. Conway, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/main/interactive_shell.h b/src/main/interactive_shell.h index ac52a78c4..7ed5a1c1f 100644 --- a/src/main/interactive_shell.h +++ b/src/main/interactive_shell.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Christopher L. Conway, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -12,8 +12,8 @@ ** \brief Interactive shell for CVC4 **/ -#ifndef __CVC4__INTERACTIVE_SHELL_H -#define __CVC4__INTERACTIVE_SHELL_H +#ifndef CVC4__INTERACTIVE_SHELL_H +#define CVC4__INTERACTIVE_SHELL_H #include <iosfwd> #include <string> @@ -72,4 +72,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__INTERACTIVE_SHELL_H */ +#endif /* CVC4__INTERACTIVE_SHELL_H */ diff --git a/src/main/main.cpp b/src/main/main.cpp index fe2147240..96ba1bc93 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/main/main.h b/src/main/main.h index ee5341b87..266d043aa 100644 --- a/src/main/main.h +++ b/src/main/main.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -25,8 +25,8 @@ #include "util/statistics.h" #include "util/statistics_registry.h" -#ifndef __CVC4__MAIN__MAIN_H -#define __CVC4__MAIN__MAIN_H +#ifndef CVC4__MAIN__MAIN_H +#define CVC4__MAIN__MAIN_H namespace CVC4 { namespace main { @@ -70,4 +70,4 @@ void cvc4_shutdown() noexcept; int runCvc4(int argc, char* argv[], CVC4::Options&); void printUsage(CVC4::Options&, bool full = false); -#endif /* __CVC4__MAIN__MAIN_H */ +#endif /* CVC4__MAIN__MAIN_H */ diff --git a/src/main/portfolio.cpp b/src/main/portfolio.cpp index 9faba47ca..89a6d8253 100644 --- a/src/main/portfolio.cpp +++ b/src/main/portfolio.cpp @@ -2,9 +2,9 @@ /*! \file portfolio.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Kshitij Bansal, Tim King + ** Morgan Deters, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/main/portfolio.h b/src/main/portfolio.h index 2d3a9e5ad..2cb23d5c5 100644 --- a/src/main/portfolio.h +++ b/src/main/portfolio.h @@ -2,9 +2,9 @@ /*! \file portfolio.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Kshitij Bansal + ** Morgan Deters, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -13,8 +13,8 @@ ** (potentially cooperative) race **/ -#ifndef __CVC4__PORTFOLIO_H -#define __CVC4__PORTFOLIO_H +#ifndef CVC4__PORTFOLIO_H +#define CVC4__PORTFOLIO_H #include <boost/function.hpp> #include <utility> @@ -38,4 +38,4 @@ std::pair<int, S> runPortfolio(int numThreads, }/* CVC4 namespace */ -#endif /* __CVC4__PORTFOLIO_H */ +#endif /* CVC4__PORTFOLIO_H */ diff --git a/src/main/portfolio_util.cpp b/src/main/portfolio_util.cpp index 7f8bb185b..a3b6767c7 100644 --- a/src/main/portfolio_util.cpp +++ b/src/main/portfolio_util.cpp @@ -2,9 +2,9 @@ /*! \file portfolio_util.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Kshitij Bansal + ** Tim King, Morgan Deters, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/main/portfolio_util.h b/src/main/portfolio_util.h index 5b2152728..e5ca296ae 100644 --- a/src/main/portfolio_util.h +++ b/src/main/portfolio_util.h @@ -2,9 +2,9 @@ /*! \file portfolio_util.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Tim King, Morgan Deters + ** Morgan Deters, Kshitij Bansal, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -12,8 +12,8 @@ ** \brief Code relevant only for portfolio builds **/ -#ifndef __CVC4__PORTFOLIO_UTIL_H -#define __CVC4__PORTFOLIO_UTIL_H +#ifndef CVC4__PORTFOLIO_UTIL_H +#define CVC4__PORTFOLIO_UTIL_H #include <queue> @@ -177,4 +177,4 @@ void sharingManager(unsigned numThreads, }/* CVC4 namespace */ -#endif /* __CVC4__PORTFOLIO_UTIL_H */ +#endif /* CVC4__PORTFOLIO_UTIL_H */ diff --git a/src/main/util.cpp b/src/main/util.cpp index e61ad34d8..115703b09 100644 --- a/src/main/util.cpp +++ b/src/main/util.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/argument_extender.h b/src/options/argument_extender.h index 9e52691ed..e3cec3c25 100644 --- a/src/options/argument_extender.h +++ b/src/options/argument_extender.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__OPTIONS__ARGUMENT_EXTENDER_H -#define __CVC4__OPTIONS__ARGUMENT_EXTENDER_H +#ifndef CVC4__OPTIONS__ARGUMENT_EXTENDER_H +#define CVC4__OPTIONS__ARGUMENT_EXTENDER_H #include <cstddef> @@ -82,4 +82,4 @@ public: }/* CVC4::options namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__OPTIONS__ARGUMENT_EXTENDER_H */ +#endif /* CVC4__OPTIONS__ARGUMENT_EXTENDER_H */ diff --git a/src/options/argument_extender_implementation.cpp b/src/options/argument_extender_implementation.cpp index 7c8549627..0d789c626 100644 --- a/src/options/argument_extender_implementation.cpp +++ b/src/options/argument_extender_implementation.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/argument_extender_implementation.h b/src/options/argument_extender_implementation.h index 66b21ce8c..9906bb420 100644 --- a/src/options/argument_extender_implementation.h +++ b/src/options/argument_extender_implementation.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__OPTIONS__ARGUMENT_EXTENDER_IMPLEMENTATION_H -#define __CVC4__OPTIONS__ARGUMENT_EXTENDER_IMPLEMENTATION_H +#ifndef CVC4__OPTIONS__ARGUMENT_EXTENDER_IMPLEMENTATION_H +#define CVC4__OPTIONS__ARGUMENT_EXTENDER_IMPLEMENTATION_H #include <cstddef> #include <list> @@ -112,4 +112,4 @@ class ArgumentExtenderImplementation : public ArgumentExtender { }/* CVC4::options namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__OPTIONS__ARGUMENT_EXTENDER_IMPLEMENTATION_H */ +#endif /* CVC4__OPTIONS__ARGUMENT_EXTENDER_IMPLEMENTATION_H */ diff --git a/src/options/arith_heuristic_pivot_rule.cpp b/src/options/arith_heuristic_pivot_rule.cpp index 00ac7ab5d..6c1312dbf 100644 --- a/src/options/arith_heuristic_pivot_rule.cpp +++ b/src/options/arith_heuristic_pivot_rule.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/arith_heuristic_pivot_rule.h b/src/options/arith_heuristic_pivot_rule.h index f79a796b9..2caa21043 100644 --- a/src/options/arith_heuristic_pivot_rule.h +++ b/src/options/arith_heuristic_pivot_rule.h @@ -2,9 +2,9 @@ /*! \file arith_heuristic_pivot_rule.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H -#define __CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H +#ifndef CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H +#define CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H #include <iostream> @@ -35,4 +35,4 @@ std::ostream& operator<<(std::ostream& out, ErrorSelectionRule rule) CVC4_PUBLIC }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H */ +#endif /* CVC4__THEORY__ARITH__ARITH_HEURISTIC_PIVOT_RULE_H */ diff --git a/src/options/arith_propagation_mode.cpp b/src/options/arith_propagation_mode.cpp index 09a78b92a..895a01381 100644 --- a/src/options/arith_propagation_mode.cpp +++ b/src/options/arith_propagation_mode.cpp @@ -2,9 +2,9 @@ /*! \file arith_propagation_mode.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/arith_propagation_mode.h b/src/options/arith_propagation_mode.h index 0d54d901b..b2c6b4c61 100644 --- a/src/options/arith_propagation_mode.h +++ b/src/options/arith_propagation_mode.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H -#define __CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H +#ifndef CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H +#define CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H #include <iostream> @@ -35,4 +35,4 @@ std::ostream& operator<<(std::ostream& out, ArithPropagationMode rule) CVC4_PUBL }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H */ +#endif /* CVC4__THEORY__ARITH__ARITH_PROPAGATION_MODE_H */ diff --git a/src/options/arith_unate_lemma_mode.cpp b/src/options/arith_unate_lemma_mode.cpp index a1f8d5613..34fbeb3b2 100644 --- a/src/options/arith_unate_lemma_mode.cpp +++ b/src/options/arith_unate_lemma_mode.cpp @@ -2,9 +2,9 @@ /*! \file arith_unate_lemma_mode.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/arith_unate_lemma_mode.h b/src/options/arith_unate_lemma_mode.h index 4cec65011..a917b83fd 100644 --- a/src/options/arith_unate_lemma_mode.h +++ b/src/options/arith_unate_lemma_mode.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H -#define __CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H +#ifndef CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H +#define CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H #include <iostream> @@ -35,4 +35,4 @@ std::ostream& operator<<(std::ostream& out, ArithUnateLemmaMode rule) CVC4_PUBLI }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H */ +#endif /* CVC4__THEORY__ARITH__ARITH_UNATE_LEMMA_MODE_H */ diff --git a/src/options/base_handlers.h b/src/options/base_handlers.h index 0f1d735d1..fae6549f3 100644 --- a/src/options/base_handlers.h +++ b/src/options/base_handlers.h @@ -2,9 +2,9 @@ /*! \file base_handlers.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BASE_HANDLERS_H -#define __CVC4__BASE_HANDLERS_H +#ifndef CVC4__BASE_HANDLERS_H +#define CVC4__BASE_HANDLERS_H #include <iostream> #include <string> @@ -83,4 +83,4 @@ struct not_equal : public comparator<std::not_equal_to> { }/* CVC4::options namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__BASE_HANDLERS_H */ +#endif /* CVC4__BASE_HANDLERS_H */ diff --git a/src/options/bool_to_bv_mode.cpp b/src/options/bool_to_bv_mode.cpp index 670e15419..12fd3c1f9 100644 --- a/src/options/bool_to_bv_mode.cpp +++ b/src/options/bool_to_bv_mode.cpp @@ -1,18 +1,18 @@ /********************* */ /*! \file bool_to_bv_mode.cpp -** \verbatim -** Top contributors (to current version): -** Makai Mann -** This file is part of the CVC4 project. -** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS -** in the top-level source directory) and their institutional affiliations. -** All rights reserved. See the file COPYING in the top-level source -** directory for licensing information.\endverbatim -** -** \brief Modes for bool-to-bv preprocessing pass -** -** Modes for bool-to-bv preprocessing pass which tries to lower booleans -** to bit-vectors of width 1 at various levels of aggressiveness. + ** \verbatim + ** Top contributors (to current version): + ** Makai Mann + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** [[ Add lengthier description here ]] + + ** \todo document this file + **/ #include "options/bool_to_bv_mode.h" diff --git a/src/options/bool_to_bv_mode.h b/src/options/bool_to_bv_mode.h index f2911c339..2dbd723c9 100644 --- a/src/options/bool_to_bv_mode.h +++ b/src/options/bool_to_bv_mode.h @@ -1,24 +1,24 @@ /********************* */ /*! \file bool_to_bv_mode.h -** \verbatim -** Top contributors (to current version): -** Makai Mann -** This file is part of the CVC4 project. -** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS -** in the top-level source directory) and their institutional affiliations. -** All rights reserved. See the file COPYING in the top-level source -** directory for licensing information.\endverbatim -** -** \brief Modes for bool-to-bv preprocessing pass -** -** Modes for bool-to-bv preprocessing pass which tries to lower booleans -** to bit-vectors of width 1 at various levels of aggressiveness. + ** \verbatim + ** Top contributors (to current version): + ** Makai Mann + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** [[ Add lengthier description here ]] + + ** \todo document this file + **/ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H -#define __CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H +#ifndef CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H +#define CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H #include <iosfwd> @@ -54,4 +54,4 @@ std::ostream& operator<<(std::ostream& out, preprocessing::passes::BoolToBVMode } -#endif /* __CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H */ +#endif /* CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_MODE_H */ diff --git a/src/options/bv_bitblast_mode.cpp b/src/options/bv_bitblast_mode.cpp index 59a97c5a2..d2425831a 100644 --- a/src/options/bv_bitblast_mode.cpp +++ b/src/options/bv_bitblast_mode.cpp @@ -2,9 +2,9 @@ /*! \file bv_bitblast_mode.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Tim King + ** Liana Hadarean, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -81,4 +81,25 @@ std::ostream& operator<<(std::ostream& out, theory::bv::BvProofFormat format) return out; } +std::ostream& operator<<(std::ostream& out, + theory::bv::BvOptimizeSatProof level) +{ + switch (level) + { + case theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_NONE: + out << "BITVECTOR_OPTIMIZE_SAT_PROOF_NONE"; + break; + case theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF: + out << "BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF"; + break; + case theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA: + out << "BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA"; + break; + default: out << "BvOptimizeSatProof:UNKNOWN![" << unsigned(level) << "]"; + } + + return out; +} + }/* CVC4 namespace */ + diff --git a/src/options/bv_bitblast_mode.h b/src/options/bv_bitblast_mode.h index fa5791ac9..7243c38e1 100644 --- a/src/options/bv_bitblast_mode.h +++ b/src/options/bv_bitblast_mode.h @@ -2,9 +2,9 @@ /*! \file bv_bitblast_mode.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Tim King, Mathias Preiner + ** Liana Hadarean, Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BITBLAST_MODE_H -#define __CVC4__THEORY__BV__BITBLAST_MODE_H +#ifndef CVC4__THEORY__BV__BITBLAST_MODE_H +#define CVC4__THEORY__BV__BITBLAST_MODE_H #include <iosfwd> @@ -88,6 +88,27 @@ enum BvProofFormat BITVECTOR_PROOF_LRAT, }; +/** + * When the BV solver does eager bit-blasting backed by DRAT-producing SAT solvers, proofs + * can be written in a variety of formats. + */ +enum BvOptimizeSatProof +{ + /** + * Do not optimize the SAT proof. + */ + BITVECTOR_OPTIMIZE_SAT_PROOF_NONE = 0, + /** + * Optimize the SAT proof, but do not shrink the formula + */ + BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF = 1, + /** + * Optimize the SAT proof and shrink the formula + */ + BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA = 2, +}; + + }/* CVC4::theory::bv namespace */ }/* CVC4::theory namespace */ @@ -95,7 +116,8 @@ std::ostream& operator<<(std::ostream& out, theory::bv::BitblastMode mode); std::ostream& operator<<(std::ostream& out, theory::bv::BvSlicerMode mode); std::ostream& operator<<(std::ostream& out, theory::bv::SatSolverMode mode); std::ostream& operator<<(std::ostream& out, theory::bv::BvProofFormat format); +std::ostream& operator<<(std::ostream& out, theory::bv::BvOptimizeSatProof level); }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BV__BITBLAST_MODE_H */ +#endif /* CVC4__THEORY__BV__BITBLAST_MODE_H */ diff --git a/src/options/bv_options.toml b/src/options/bv_options.toml index c4541f4e4..9529b7500 100644 --- a/src/options/bv_options.toml +++ b/src/options/bv_options.toml @@ -7,13 +7,24 @@ header = "options/bv_options.h" category = "expert" long = "bv-proof-format=MODE" type = "CVC4::theory::bv::BvProofFormat" - default = "CVC4::theory::bv::BITVECTOR_PROOF_LRAT" + default = "CVC4::theory::bv::BITVECTOR_PROOF_ER" handler = "stringToBvProofFormat" predicates = ["satSolverEnabledBuild"] includes = ["options/bv_bitblast_mode.h"] help = "choose which UNSAT proof format to use, see --bv-sat-solver=help" [[option]] + name = "bvOptimizeSatProof" + category = "expert" + long = "bv-optimize-sat-proof=MODE" + type = "CVC4::theory::bv::BvOptimizeSatProof" + default = "CVC4::theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA" + handler = "stringToBvOptimizeSatProof" + predicates = ["satSolverEnabledBuild"] + includes = ["options/bv_bitblast_mode.h"] + help = "enable SAT proof optimizations, see --bv-optimize-sat-proof=help" + +[[option]] name = "bvSatSolver" smt_name = "bv-sat-solver" category = "expert" diff --git a/src/options/datatypes_modes.h b/src/options/datatypes_modes.h index 5f41ce11d..8d7ced9e2 100644 --- a/src/options/datatypes_modes.h +++ b/src/options/datatypes_modes.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__BASE__DATATYPES_MODES_H -#define __CVC4__BASE__DATATYPES_MODES_H +#ifndef CVC4__BASE__DATATYPES_MODES_H +#define CVC4__BASE__DATATYPES_MODES_H #include <iostream> @@ -41,4 +41,4 @@ enum SygusFairMode { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__BASE__DATATYPES_MODES_H */ +#endif /* CVC4__BASE__DATATYPES_MODES_H */ diff --git a/src/options/decision_mode.cpp b/src/options/decision_mode.cpp index cd0bc8180..f2c37f52a 100644 --- a/src/options/decision_mode.cpp +++ b/src/options/decision_mode.cpp @@ -2,9 +2,9 @@ /*! \file decision_mode.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/decision_mode.h b/src/options/decision_mode.h index eb10ba8e8..c90e0a6f0 100644 --- a/src/options/decision_mode.h +++ b/src/options/decision_mode.h @@ -2,9 +2,9 @@ /*! \file decision_mode.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Kshitij Bansal, Tim King + ** Kshitij Bansal, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__SMT__DECISION_MODE_H -#define __CVC4__SMT__DECISION_MODE_H +#ifndef CVC4__SMT__DECISION_MODE_H +#define CVC4__SMT__DECISION_MODE_H #include <iosfwd> @@ -61,4 +61,4 @@ std::ostream& operator<<(std::ostream& out, decision::DecisionMode mode); }/* CVC4 namespace */ -#endif /* __CVC4__SMT__DECISION_MODE_H */ +#endif /* CVC4__SMT__DECISION_MODE_H */ diff --git a/src/options/decision_weight.h b/src/options/decision_weight.h index 90f6affa5..16c12a3b4 100644 --- a/src/options/decision_weight.h +++ b/src/options/decision_weight.h @@ -2,9 +2,9 @@ /*! \file decision_weight.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Tim King, Morgan Deters + ** Tim King, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__OPTIONS__DECISION_WEIGHT_H -#define __CVC4__OPTIONS__DECISION_WEIGHT_H +#ifndef CVC4__OPTIONS__DECISION_WEIGHT_H +#define CVC4__OPTIONS__DECISION_WEIGHT_H namespace CVC4 { namespace decision { @@ -27,4 +27,4 @@ typedef uint64_t DecisionWeight; }/* CVC4::decision namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__OPTIONS__DECISION_WEIGHT_H */ +#endif /* CVC4__OPTIONS__DECISION_WEIGHT_H */ diff --git a/src/options/didyoumean.cpp b/src/options/didyoumean.cpp index 3f5278b7e..cbaa4d09e 100644 --- a/src/options/didyoumean.cpp +++ b/src/options/didyoumean.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/didyoumean.h b/src/options/didyoumean.h index 4d7734771..f33716565 100644 --- a/src/options/didyoumean.h +++ b/src/options/didyoumean.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/didyoumean_test.cpp b/src/options/didyoumean_test.cpp index b01b52777..7230f544d 100644 --- a/src/options/didyoumean_test.cpp +++ b/src/options/didyoumean_test.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/fp_options.toml b/src/options/fp_options.toml index eb8c933af..af8d044f7 100644 --- a/src/options/fp_options.toml +++ b/src/options/fp_options.toml @@ -1,3 +1,11 @@ id = "FP" name = "Fp" header = "options/fp_options.h" + +[[option]] + name = "fpExp" + category = "regular" + long = "fp-exp" + type = "bool" + default = "false" + help = "Allow floating-point sorts of all sizes, rather than only Float32 (8/24) or Float64 (11/53) (experimental)" diff --git a/src/options/language.cpp b/src/options/language.cpp index 089633519..4aefd742c 100644 --- a/src/options/language.cpp +++ b/src/options/language.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/language.h b/src/options/language.h index 87a05a24f..4d213c305 100644 --- a/src/options/language.h +++ b/src/options/language.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Francois Bobot ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__LANGUAGE_H -#define __CVC4__LANGUAGE_H +#ifndef CVC4__LANGUAGE_H +#define CVC4__LANGUAGE_H #include <sstream> #include <string> @@ -232,4 +232,4 @@ OutputLanguage toOutputLanguage(std::string language) CVC4_PUBLIC; }/* CVC4::language namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__LANGUAGE_H */ +#endif /* CVC4__LANGUAGE_H */ diff --git a/src/options/module_template.cpp b/src/options/module_template.cpp index 636dbe89b..46162845d 100644 --- a/src/options/module_template.cpp +++ b/src/options/module_template.cpp @@ -2,9 +2,9 @@ /*! \file module_template.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Mathias Preiner + ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/module_template.h b/src/options/module_template.h index 00bb74490..2ffe070d2 100644 --- a/src/options/module_template.h +++ b/src/options/module_template.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__OPTIONS__${id}$_H -#define __CVC4__OPTIONS__${id}$_H +#ifndef CVC4__OPTIONS__${id}$_H +#define CVC4__OPTIONS__${id}$_H #include "options/options.h" @@ -48,4 +48,4 @@ ${inls}$ } // namespace options } // namespace CVC4 -#endif /* __CVC4__OPTIONS__${id}$_H */ +#endif /* CVC4__OPTIONS__${id}$_H */ diff --git a/src/options/open_ostream.cpp b/src/options/open_ostream.cpp index a05ff63c3..c65e5da2a 100644 --- a/src/options/open_ostream.cpp +++ b/src/options/open_ostream.cpp @@ -2,9 +2,9 @@ /*! \file open_ostream.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/open_ostream.h b/src/options/open_ostream.h index b72c3a400..592db925f 100644 --- a/src/options/open_ostream.h +++ b/src/options/open_ostream.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__OPEN_OSTREAM_H -#define __CVC4__OPEN_OSTREAM_H +#ifndef CVC4__OPEN_OSTREAM_H +#define CVC4__OPEN_OSTREAM_H #include <map> #include <ostream> @@ -59,4 +59,4 @@ std::string cvc4_errno_failreason(); }/* CVC4 namespace */ -#endif /* __CVC4__OPEN_OSTREAM_H */ +#endif /* CVC4__OPEN_OSTREAM_H */ diff --git a/src/options/option_exception.cpp b/src/options/option_exception.cpp index 33e2e21d1..09bc94023 100644 --- a/src/options/option_exception.cpp +++ b/src/options/option_exception.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file option_exception.h +/*! \file option_exception.cpp ** \verbatim ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/option_exception.h b/src/options/option_exception.h index 63b8aa890..d337d4c9b 100644 --- a/src/options/option_exception.h +++ b/src/options/option_exception.h @@ -2,9 +2,9 @@ /*! \file option_exception.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__OPTION_EXCEPTION_H -#define __CVC4__OPTION_EXCEPTION_H +#ifndef CVC4__OPTION_EXCEPTION_H +#define CVC4__OPTION_EXCEPTION_H #include "base/exception.h" @@ -64,4 +64,4 @@ class CVC4_PUBLIC UnrecognizedOptionException : public CVC4::OptionException { }/* CVC4 namespace */ -#endif /* __CVC4__OPTION_EXCEPTION_H */ +#endif /* CVC4__OPTION_EXCEPTION_H */ diff --git a/src/options/options.h b/src/options/options.h index 1b61994c5..3f2d72b7e 100644 --- a/src/options/options.h +++ b/src/options/options.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__OPTIONS__OPTIONS_H -#define __CVC4__OPTIONS__OPTIONS_H +#ifndef CVC4__OPTIONS__OPTIONS_H +#define CVC4__OPTIONS__OPTIONS_H #include <fstream> #include <ostream> @@ -560,4 +560,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__OPTIONS__OPTIONS_H */ +#endif /* CVC4__OPTIONS__OPTIONS_H */ diff --git a/src/options/options_handler.cpp b/src/options/options_handler.cpp index 84b9f3b4c..7a4967de5 100644 --- a/src/options/options_handler.cpp +++ b/src/options/options_handler.cpp @@ -2,9 +2,9 @@ /*! \file options_handler.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andrew Reynolds, Aina Niemetz + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -1245,6 +1245,45 @@ theory::bv::BvProofFormat OptionsHandler::stringToBvProofFormat( } } +const std::string OptionsHandler::s_bvOptimizeSatProofHelp = + "\ +Optimization levels currently supported by the --bv-optimize-sat-proof option:\n\ +\n\ + none : Do not optimize the SAT proof\n\ +\n\ + proof : Use drat-trim to shrink the SAT proof\n\ +\n\ + formula : Use drat-trim to shrink the SAT proof and formula (default)\ +"; + +theory::bv::BvOptimizeSatProof OptionsHandler::stringToBvOptimizeSatProof( + std::string option, std::string optarg) +{ + if (optarg == "none") + { + return theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_NONE; + } + else if (optarg == "proof") + { + return theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_PROOF; + } + else if (optarg == "formula") + { + return theory::bv::BITVECTOR_OPTIMIZE_SAT_PROOF_FORMULA; + } + else if (optarg == "help") + { + puts(s_bvOptimizeSatProofHelp.c_str()); + exit(1); + } + else + { + throw OptionException(std::string("unknown option for --bv-optimize-sat-proof: `") + + optarg + "'. Try --bv-optimize-sat-proof=help."); + } +} + + const std::string OptionsHandler::s_bitblastingModeHelp = "\ Bit-blasting modes currently supported by the --bitblast option:\n\ \n\ @@ -1769,10 +1808,11 @@ void OptionsHandler::proofEnabledBuild(std::string option, bool value) { #ifdef CVC4_PROOF if (value && options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER - && options::bvSatSolver() != theory::bv::SAT_SOLVER_MINISAT) + && options::bvSatSolver() != theory::bv::SAT_SOLVER_MINISAT + && options::bvSatSolver() != theory::bv::SAT_SOLVER_CRYPTOMINISAT) { throw OptionException( - "Eager BV proofs only supported when minisat is used"); + "Eager BV proofs only supported when MiniSat or CryptoMiniSat is used"); } #else if(value) { @@ -1938,6 +1978,7 @@ void OptionsHandler::showConfiguration(std::string option) { print_config_cond("glpk", Configuration::isBuiltWithGlpk()); print_config_cond("cadical", Configuration::isBuiltWithCadical()); print_config_cond("cryptominisat", Configuration::isBuiltWithCryptominisat()); + print_config_cond("drat2er", Configuration::isBuiltWithDrat2Er()); print_config_cond("gmp", Configuration::isBuiltWithGmp()); print_config_cond("lfsc", Configuration::isBuiltWithLfsc()); print_config_cond("readline", Configuration::isBuiltWithReadline()); diff --git a/src/options/options_handler.h b/src/options/options_handler.h index 8b2629db7..06f7ab6e4 100644 --- a/src/options/options_handler.h +++ b/src/options/options_handler.h @@ -2,9 +2,9 @@ /*! \file options_handler.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Andrew Reynolds, Liana Hadarean + ** Tim King, Andrew Reynolds, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__OPTIONS__OPTIONS_HANDLER_H -#define __CVC4__OPTIONS__OPTIONS_HANDLER_H +#ifndef CVC4__OPTIONS__OPTIONS_HANDLER_H +#define CVC4__OPTIONS__OPTIONS_HANDLER_H #include <ostream> #include <string> @@ -148,6 +148,8 @@ public: theory::bv::BvProofFormat stringToBvProofFormat(std::string option, std::string optarg); + theory::bv::BvOptimizeSatProof stringToBvOptimizeSatProof(std::string option, + std::string optarg); theory::strings::ProcessLoopMode stringToStringsProcessLoopMode( std::string option, std::string optarg); @@ -238,6 +240,7 @@ public: static const std::string s_bitblastingModeHelp; static const std::string s_bvSatSolverHelp; static const std::string s_bvProofFormatHelp; + static const std::string s_bvOptimizeSatProofHelp; static const std::string s_booleanTermConversionModeHelp; static const std::string s_bvSlicerModeHelp; static const std::string s_stringToStringsProcessLoopModeHelp; @@ -283,4 +286,4 @@ public: }/* CVC4::options namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__OPTIONS__OPTIONS_HANDLER_H */ +#endif /* CVC4__OPTIONS__OPTIONS_HANDLER_H */ diff --git a/src/options/options_holder_template.h b/src/options/options_holder_template.h index 438d1c7cc..4cd77a441 100644 --- a/src/options/options_holder_template.h +++ b/src/options/options_holder_template.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__OPTIONS__OPTIONS_HOLDER_H -#define __CVC4__OPTIONS__OPTIONS_HOLDER_H +#ifndef CVC4__OPTIONS__OPTIONS_HOLDER_H +#define CVC4__OPTIONS__OPTIONS_HOLDER_H ${headers_module}$ @@ -35,4 +35,4 @@ struct OptionsHolder { } // namespace options } // namespace CVC4 -#endif /* __CVC4__OPTIONS__OPTIONS_HOLDER_H */ +#endif /* CVC4__OPTIONS__OPTIONS_HOLDER_H */ diff --git a/src/options/options_public_functions.cpp b/src/options/options_public_functions.cpp index d95335c76..39f2eb140 100644 --- a/src/options/options_public_functions.cpp +++ b/src/options/options_public_functions.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/options_template.cpp b/src/options/options_template.cpp index 9650aba7a..1f7ba05fc 100644 --- a/src/options/options_template.cpp +++ b/src/options/options_template.cpp @@ -2,9 +2,9 @@ /*! \file options_template.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Mathias Preiner + ** Tim King, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -446,7 +446,7 @@ Languages currently supported as arguments to the -L / --lang option:\n\ smt2.5 | smtlib2.5 SMT-LIB format 2.5\n\ smt2.6 | smtlib2.6 SMT-LIB format 2.6\n\ smt2.6.1 | smtlib2.6.1 SMT-LIB format 2.6 with support for the strings standard\n\ - tptp TPTP format (cnf and fof)\n\ + tptp TPTP format (cnf, fof and tff)\n\ sygus SyGuS format\n\ \n\ Languages currently supported as arguments to the --output-lang option:\n\ diff --git a/src/options/printer_modes.cpp b/src/options/printer_modes.cpp index 499646bbf..b60dde467 100644 --- a/src/options/printer_modes.cpp +++ b/src/options/printer_modes.cpp @@ -2,9 +2,9 @@ /*! \file printer_modes.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Tim King + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/printer_modes.h b/src/options/printer_modes.h index 456a7980b..79c57828b 100644 --- a/src/options/printer_modes.h +++ b/src/options/printer_modes.h @@ -2,9 +2,9 @@ /*! \file printer_modes.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Tim King + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__PRINTER__MODES_H -#define __CVC4__PRINTER__MODES_H +#ifndef CVC4__PRINTER__MODES_H +#define CVC4__PRINTER__MODES_H #include <iostream> @@ -45,4 +45,4 @@ std::ostream& operator<<(std::ostream& out, InstFormatMode mode) CVC4_PUBLIC; }/* CVC4 namespace */ -#endif /* __CVC4__PRINTER__MODEL_FORMAT_H */ +#endif /* CVC4__PRINTER__MODEL_FORMAT_H */ diff --git a/src/options/quantifiers_modes.cpp b/src/options/quantifiers_modes.cpp index b08f71c2e..a1d012aa5 100644 --- a/src/options/quantifiers_modes.cpp +++ b/src/options/quantifiers_modes.cpp @@ -2,9 +2,9 @@ /*! \file quantifiers_modes.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Tim King + ** Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/quantifiers_modes.h b/src/options/quantifiers_modes.h index eea043865..c9aeda154 100644 --- a/src/options/quantifiers_modes.h +++ b/src/options/quantifiers_modes.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__BASE__QUANTIFIERS_MODES_H -#define __CVC4__BASE__QUANTIFIERS_MODES_H +#ifndef CVC4__BASE__QUANTIFIERS_MODES_H +#define CVC4__BASE__QUANTIFIERS_MODES_H #include <iostream> @@ -316,4 +316,4 @@ std::ostream& operator<<(std::ostream& out, theory::quantifiers::InstWhenMode mo }/* CVC4 namespace */ -#endif /* __CVC4__BASE__QUANTIFIERS_MODES_H */ +#endif /* CVC4__BASE__QUANTIFIERS_MODES_H */ diff --git a/src/options/quantifiers_options.toml b/src/options/quantifiers_options.toml index d9d3e0d38..0a69178b3 100644 --- a/src/options/quantifiers_options.toml +++ b/src/options/quantifiers_options.toml @@ -456,6 +456,15 @@ header = "options/quantifiers_options.h" help = "interleave full saturate instantiation with other techniques" [[option]] + name = "fullSaturateStratify" + category = "regular" + long = "fs-stratify" + type = "bool" + default = "false" + read_only = true + help = "stratify effort levels in enumerative instantiation, which favors speed over fairness" + +[[option]] name = "literalMatchMode" category = "regular" long = "literal-matching=MODE" @@ -877,6 +886,15 @@ header = "options/quantifiers_options.h" help = "attempt to preprocess arbitrary inputs to sygus conjectures" [[option]] + name = "sygusAbduct" + category = "regular" + long = "sygus-abduct" + type = "bool" + default = "false" + read_only = false + help = "compute abductions using sygus" + +[[option]] name = "ceGuidedInst" category = "regular" long = "cegqi" @@ -1240,7 +1258,7 @@ header = "options/quantifiers_options.h" type = "bool" default = "false" read_only = true - help = "use sygus to enumerate and verify correctness of rewrite rules via sampling" + help = "use sygus to enumerate and verify correctness of rewrite rules" [[option]] name = "sygusRewSynth" @@ -1248,7 +1266,7 @@ header = "options/quantifiers_options.h" long = "sygus-rr-synth" type = "bool" default = "false" - help = "use sygus to enumerate candidate rewrite rules via sampling" + help = "use sygus to enumerate candidate rewrite rules" [[option]] name = "sygusRewSynthFilterOrder" @@ -1369,6 +1387,14 @@ header = "options/quantifiers_options.h" long = "sygus-expr-miner-check-timeout=N" type = "unsigned long" help = "timeout (in milliseconds) for satisfiability checks in expression miners" + +[[option]] + name = "sygusRewSynthRec" + category = "regular" + long = "sygus-rr-synth-rec" + type = "bool" + default = "false" + help = "synthesize rewrite rules over all sygus grammar types recursively" [[option]] name = "sygusQueryGen" @@ -1420,6 +1446,7 @@ header = "options/quantifiers_options.h" default = "false" help = "compute backwards filtering to compute whether previous solutions are filtered based on later ones" + [[option]] name = "sygusExprMinerCheckUseExport" category = "expert" @@ -1447,15 +1474,6 @@ header = "options/quantifiers_options.h" help = "turns on full effort counterexample-based quantifier instantiation, which may resort to model-value instantiation" [[option]] - name = "recurseCbqi" - category = "regular" - long = "cbqi-recurse" - type = "bool" - default = "true" - read_only = true - help = "turns on recursive counterexample-based quantifier instantiation" - -[[option]] name = "cbqiSat" category = "regular" long = "cbqi-sat" diff --git a/src/options/set_language.cpp b/src/options/set_language.cpp index c4690db36..dfdbb1ab7 100644 --- a/src/options/set_language.cpp +++ b/src/options/set_language.cpp @@ -2,9 +2,9 @@ /*! \file set_language.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Morgan Deters, Tim King, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/set_language.h b/src/options/set_language.h index ca691e9e5..0e3b32dd7 100644 --- a/src/options/set_language.h +++ b/src/options/set_language.h @@ -2,9 +2,9 @@ /*! \file set_language.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__OPTIONS__SET_LANGUAGE_H -#define __CVC4__OPTIONS__SET_LANGUAGE_H +#ifndef CVC4__OPTIONS__SET_LANGUAGE_H +#define CVC4__OPTIONS__SET_LANGUAGE_H #include <iostream> #include "options/language.h" @@ -96,4 +96,4 @@ std::ostream& operator<<(std::ostream& out, SetLanguage l) CVC4_PUBLIC; }/* CVC4::language namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__OPTIONS__SET_LANGUAGE_H */ +#endif /* CVC4__OPTIONS__SET_LANGUAGE_H */ diff --git a/src/options/smt_modes.cpp b/src/options/smt_modes.cpp index 4a2fd404c..3501da878 100644 --- a/src/options/smt_modes.cpp +++ b/src/options/smt_modes.cpp @@ -2,9 +2,9 @@ /*! \file smt_modes.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/smt_modes.h b/src/options/smt_modes.h index 761f3be01..ed40a28a1 100644 --- a/src/options/smt_modes.h +++ b/src/options/smt_modes.h @@ -2,9 +2,9 @@ /*! \file smt_modes.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Andrew Reynolds, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__SMT__MODES_H -#define __CVC4__SMT__MODES_H +#ifndef CVC4__SMT__MODES_H +#define CVC4__SMT__MODES_H #include <iosfwd> @@ -55,4 +55,4 @@ enum ModelCoresMode } // namespace CVC4 -#endif /* __CVC4__SMT__MODES_H */ +#endif /* CVC4__SMT__MODES_H */ diff --git a/src/options/smt_options.toml b/src/options/smt_options.toml index e0041774a..3a3da2f14 100644 --- a/src/options/smt_options.toml +++ b/src/options/smt_options.toml @@ -297,6 +297,14 @@ header = "options/smt_options.h" help = "use aggressive extended rewriter as a preprocessing pass" [[option]] + name = "extRewPrepOnly" + category = "regular" + long = "ext-rew-prep-only" + type = "bool" + default = "false" + help = "use extended rewriter as the only preprocessing pass" + +[[option]] name = "simplifyWithCareEnabled" category = "regular" long = "simp-with-care" diff --git a/src/options/strings_process_loop_mode.h b/src/options/strings_process_loop_mode.h index 2933e034f..fb2248eec 100644 --- a/src/options/strings_process_loop_mode.h +++ b/src/options/strings_process_loop_mode.h @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__STRINGS__PROCESS_LOOP_MODE_H -#define __CVC4__THEORY__STRINGS__PROCESS_LOOP_MODE_H +#ifndef CVC4__THEORY__STRINGS__PROCESS_LOOP_MODE_H +#define CVC4__THEORY__STRINGS__PROCESS_LOOP_MODE_H #include <iosfwd> @@ -52,4 +52,4 @@ std::ostream& operator<<(std::ostream& out, } // namespace CVC4 -#endif /* __CVC4__THEORY__BV__BITBLAST_MODE_H */ +#endif /* CVC4__THEORY__BV__BITBLAST_MODE_H */ diff --git a/src/options/sygus_out_mode.h b/src/options/sygus_out_mode.h index 863e4d4bc..79480946a 100644 --- a/src/options/sygus_out_mode.h +++ b/src/options/sygus_out_mode.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__SMT__SYGUS_OUT_MODE_H -#define __CVC4__SMT__SYGUS_OUT_MODE_H +#ifndef CVC4__SMT__SYGUS_OUT_MODE_H +#define CVC4__SMT__SYGUS_OUT_MODE_H #include <iosfwd> @@ -36,4 +36,4 @@ enum SygusSolutionOutMode } /* CVC4 namespace */ -#endif /* __CVC4__SMT__SYGUS_OUT_MODE_H */ +#endif /* CVC4__SMT__SYGUS_OUT_MODE_H */ diff --git a/src/options/theoryof_mode.cpp b/src/options/theoryof_mode.cpp index 59919a272..4d8d92e17 100644 --- a/src/options/theoryof_mode.cpp +++ b/src/options/theoryof_mode.cpp @@ -2,9 +2,9 @@ /*! \file theoryof_mode.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Paul Meng + ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/theoryof_mode.h b/src/options/theoryof_mode.h index 0dc7194e9..900452fbc 100644 --- a/src/options/theoryof_mode.h +++ b/src/options/theoryof_mode.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/options/ufss_mode.h b/src/options/ufss_mode.h index fa7fad6be..d6a106ecf 100644 --- a/src/options/ufss_mode.h +++ b/src/options/ufss_mode.h @@ -2,9 +2,9 @@ /*! \file ufss_mode.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BASE__UFSS_MODE_H -#define __CVC4__BASE__UFSS_MODE_H +#ifndef CVC4__BASE__UFSS_MODE_H +#define CVC4__BASE__UFSS_MODE_H namespace CVC4 { namespace theory { @@ -36,4 +36,4 @@ enum UfssMode{ }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__BASE__UFSS_MODE_H */ +#endif /* CVC4__BASE__UFSS_MODE_H */ diff --git a/src/parser/antlr_input.cpp b/src/parser/antlr_input.cpp index a2885d1b6..3e7e86446 100644 --- a/src/parser/antlr_input.cpp +++ b/src/parser/antlr_input.cpp @@ -2,9 +2,9 @@ /*! \file antlr_input.cpp ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Kshitij Bansal, Tim King + ** Christopher L. Conway, Kshitij Bansal, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h index 576b693e8..9c53e0349 100644 --- a/src/parser/antlr_input.h +++ b/src/parser/antlr_input.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ ** Base for ANTLR parser classes. **/ -#ifndef __CVC4__PARSER__ANTLR_INPUT_H -#define __CVC4__PARSER__ANTLR_INPUT_H +#ifndef CVC4__PARSER__ANTLR_INPUT_H +#define CVC4__PARSER__ANTLR_INPUT_H #include "cvc4parser_private.h" @@ -299,4 +299,4 @@ inline BitVector AntlrInput::tokenToBitvector(pANTLR3_COMMON_TOKEN number, pANTL }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__ANTLR_INPUT_H */ +#endif /* CVC4__PARSER__ANTLR_INPUT_H */ diff --git a/src/parser/antlr_input_imports.cpp b/src/parser/antlr_input_imports.cpp index 91ced0f41..39b109232 100644 --- a/src/parser/antlr_input_imports.cpp +++ b/src/parser/antlr_input_imports.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Francois Bobot, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/antlr_line_buffered_input.cpp b/src/parser/antlr_line_buffered_input.cpp index 356663559..052bd5f7f 100644 --- a/src/parser/antlr_line_buffered_input.cpp +++ b/src/parser/antlr_line_buffered_input.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/antlr_line_buffered_input.h b/src/parser/antlr_line_buffered_input.h index c33566e22..34cb72f1e 100644 --- a/src/parser/antlr_line_buffered_input.h +++ b/src/parser/antlr_line_buffered_input.h @@ -2,9 +2,9 @@ /*! \file antlr_line_buffered_input.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andres Noetzli, Tim King + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -22,8 +22,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__ANTLR_LINE_BUFFERED_INPUT_H -#define __CVC4__PARSER__ANTLR_LINE_BUFFERED_INPUT_H +#ifndef CVC4__PARSER__ANTLR_LINE_BUFFERED_INPUT_H +#define CVC4__PARSER__ANTLR_LINE_BUFFERED_INPUT_H #include <antlr3.h> #include <istream> @@ -47,4 +47,4 @@ pANTLR3_INPUT_STREAM antlr3LineBufferedStreamNew(std::istream& in, }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__ANTLR_LINE_BUFFERED_INPUT_H */ +#endif /* CVC4__PARSER__ANTLR_LINE_BUFFERED_INPUT_H */ diff --git a/src/parser/antlr_tracing.h b/src/parser/antlr_tracing.h index 017c72fb4..d2eb742c2 100644 --- a/src/parser/antlr_tracing.h +++ b/src/parser/antlr_tracing.h @@ -2,9 +2,9 @@ /*! \file antlr_tracing.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ ** \todo document this file **/ -#ifndef __CVC4__PARSER__ANTLR_TRACING_H -#define __CVC4__PARSER__ANTLR_TRACING_H +#ifndef CVC4__PARSER__ANTLR_TRACING_H +#define CVC4__PARSER__ANTLR_TRACING_H // only enable the hack with -DCVC4_TRACE_ANTLR #ifdef CVC4_TRACE_ANTLR @@ -83,4 +83,4 @@ static struct __Cvc4System { #endif /* CVC4_TRACE_ANTLR */ -#endif /* __CVC4__PARSER__ANTLR_TRACING_H */ +#endif /* CVC4__PARSER__ANTLR_TRACING_H */ diff --git a/src/parser/bounded_token_buffer.cpp b/src/parser/bounded_token_buffer.cpp index fc2b0dea9..5746793e3 100644 --- a/src/parser/bounded_token_buffer.cpp +++ b/src/parser/bounded_token_buffer.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/bounded_token_buffer.h b/src/parser/bounded_token_buffer.h index b1567f346..8afe6864a 100644 --- a/src/parser/bounded_token_buffer.h +++ b/src/parser/bounded_token_buffer.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -25,8 +25,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__BOUNDED_TOKEN_BUFFER_H -#define __CVC4__PARSER__BOUNDED_TOKEN_BUFFER_H +#ifndef CVC4__PARSER__BOUNDED_TOKEN_BUFFER_H +#define CVC4__PARSER__BOUNDED_TOKEN_BUFFER_H #include <antlr3defs.h> @@ -61,4 +61,4 @@ BoundedTokenBufferFree(pBOUNDED_TOKEN_BUFFER buffer); }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__BOUNDED_TOKEN_BUFFER_H */ +#endif /* CVC4__PARSER__BOUNDED_TOKEN_BUFFER_H */ diff --git a/src/parser/bounded_token_factory.cpp b/src/parser/bounded_token_factory.cpp index 472a7125c..fb6208d0c 100644 --- a/src/parser/bounded_token_factory.cpp +++ b/src/parser/bounded_token_factory.cpp @@ -2,9 +2,9 @@ /*! \file bounded_token_factory.cpp ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Morgan Deters + ** Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/bounded_token_factory.h b/src/parser/bounded_token_factory.h index 8371c7e17..f2df9ac36 100644 --- a/src/parser/bounded_token_factory.h +++ b/src/parser/bounded_token_factory.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H -#define __CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H +#ifndef CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H +#define CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H namespace CVC4 { namespace parser { @@ -48,4 +48,4 @@ BoundedTokenFactoryNew(pANTLR3_INPUT_STREAM input,ANTLR3_UINT32 size); }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H */ +#endif /* CVC4__PARSER__BOUNDED_TOKEN_FACTORY_H */ diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g index 29bc84510..6de746ad7 100644 --- a/src/parser/cvc/Cvc.g +++ b/src/parser/cvc/Cvc.g @@ -2,9 +2,9 @@ /*! \file Cvc.g ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Christopher L. Conway, Andrew Reynolds + ** Morgan Deters, Andrew Reynolds, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -1552,9 +1552,6 @@ booleanBinop[unsigned& op] | OR_TOK | XOR_TOK | AND_TOK - | JOIN_TOK - | PRODUCT_TOK - | JOIN_IMAGE_TOK ; comparison[CVC4::Expr& f] @@ -1705,9 +1702,8 @@ uminusTerm[CVC4::Expr& f] unsigned minusCount = 0; } /* Unary minus */ - : (MINUS_TOK { ++minusCount; })+ bvBinaryOpTerm[f] + : (MINUS_TOK { ++minusCount; })* bvBinaryOpTerm[f] { while(minusCount > 0) { --minusCount; f = MK_EXPR(CVC4::kind::UMINUS, f); } } - | bvBinaryOpTerm[f] ; /** Parses bitvectors. Starts with binary operators @, &, and |. */ @@ -1734,28 +1730,27 @@ bvNegTerm[CVC4::Expr& f] /* BV neg */ : BVNEG_TOK bvNegTerm[f] { f = f.getType().isSet() ? MK_EXPR(CVC4::kind::COMPLEMENT, f) : MK_EXPR(CVC4::kind::BITVECTOR_NOT, f); } - | relationTerm[f] + | relationBinopTerm[f] ; -relationTerm[CVC4::Expr& f] - /* relation terms */ - : TRANSPOSE_TOK relationTerm[f] - { f = MK_EXPR(CVC4::kind::TRANSPOSE, f); } - | TRANSCLOSURE_TOK relationTerm[f] - { f = MK_EXPR(CVC4::kind::TCLOSURE, f); } - | TUPLE_TOK LPAREN relationTerm[f] RPAREN - { std::vector<Type> types; - std::vector<Expr> args; - args.push_back(f); - types.push_back(f.getType()); - DatatypeType t = EXPR_MANAGER->mkTupleType(types); - const Datatype& dt = t.getDatatype(); - args.insert( args.begin(), dt[0].getConstructor() ); - f = MK_EXPR(kind::APPLY_CONSTRUCTOR, args); - } - | IDEN_TOK relationTerm[f] - { f = MK_EXPR(CVC4::kind::IDEN, f); } - | postfixTerm[f] +relationBinop[unsigned& op] +@init { + op = LT(1)->getType(LT(1)); +} + : JOIN_TOK + | PRODUCT_TOK + | JOIN_IMAGE_TOK + ; + +relationBinopTerm[CVC4::Expr& f] +@init { + std::vector<CVC4::Expr> expressions; + std::vector<unsigned> operators; + unsigned op; +} + : postfixTerm[f] { expressions.push_back(f); } + ( relationBinop[op] postfixTerm[f] { operators.push_back(op); expressions.push_back(f); } )* + { f = createPrecedenceTree(PARSER_STATE, EXPR_MANAGER, expressions, operators); } ; /** @@ -1775,7 +1770,7 @@ postfixTerm[CVC4::Expr& f] std::string id; Type t; } - : ( bvTerm[f] + : ( relationTerm[f] ( /* array select / bitvector extract */ LBRACKET ( formula[f2] { extract = false; } @@ -1883,7 +1878,28 @@ postfixTerm[CVC4::Expr& f] } )? ; - + +relationTerm[CVC4::Expr& f] + /* relation terms */ + : TRANSPOSE_TOK LPAREN formula[f] RPAREN + { f = MK_EXPR(CVC4::kind::TRANSPOSE, f); } + | TRANSCLOSURE_TOK LPAREN formula[f] RPAREN + { f = MK_EXPR(CVC4::kind::TCLOSURE, f); } + | TUPLE_TOK LPAREN formula[f] RPAREN + { std::vector<Type> types; + std::vector<Expr> args; + args.push_back(f); + types.push_back(f.getType()); + DatatypeType t = EXPR_MANAGER->mkTupleType(types); + const Datatype& dt = t.getDatatype(); + args.insert( args.begin(), dt[0].getConstructor() ); + f = MK_EXPR(kind::APPLY_CONSTRUCTOR, args); + } + | IDEN_TOK LPAREN formula[f] RPAREN + { f = MK_EXPR(CVC4::kind::IDEN, f); } + | bvTerm[f] + ; + bvTerm[CVC4::Expr& f] @init { Expr f2; diff --git a/src/parser/cvc/cvc_input.cpp b/src/parser/cvc/cvc_input.cpp index 17a670f40..1de624f49 100644 --- a/src/parser/cvc/cvc_input.cpp +++ b/src/parser/cvc/cvc_input.cpp @@ -2,9 +2,9 @@ /*! \file cvc_input.cpp ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Morgan Deters, Tim King + ** Christopher L. Conway, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/cvc/cvc_input.h b/src/parser/cvc/cvc_input.h index d9a065fd5..098efd580 100644 --- a/src/parser/cvc/cvc_input.h +++ b/src/parser/cvc/cvc_input.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__CVC_INPUT_H -#define __CVC4__PARSER__CVC_INPUT_H +#ifndef CVC4__PARSER__CVC_INPUT_H +#define CVC4__PARSER__CVC_INPUT_H #include "parser/antlr_input.h" #include "parser/cvc/CvcLexer.h" @@ -74,4 +74,4 @@ class CvcInput : public AntlrInput { }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__CVC_INPUT_H */ +#endif /* CVC4__PARSER__CVC_INPUT_H */ diff --git a/src/parser/input.cpp b/src/parser/input.cpp index cfc4796bf..78e9b474d 100644 --- a/src/parser/input.cpp +++ b/src/parser/input.cpp @@ -2,9 +2,9 @@ /*! \file input.cpp ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Morgan Deters, Tim King + ** Christopher L. Conway, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/input.h b/src/parser/input.h index 02d92749d..5627dc15e 100644 --- a/src/parser/input.h +++ b/src/parser/input.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_public.h" -#ifndef __CVC4__PARSER__INPUT_H -#define __CVC4__PARSER__INPUT_H +#ifndef CVC4__PARSER__INPUT_H +#define CVC4__PARSER__INPUT_H #include <iostream> #include <stdio.h> @@ -178,4 +178,4 @@ class CVC4_PUBLIC Input { }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__ANTLR_INPUT_H */ +#endif /* CVC4__PARSER__ANTLR_INPUT_H */ diff --git a/src/parser/line_buffer.cpp b/src/parser/line_buffer.cpp index 71b913227..35263f3ac 100644 --- a/src/parser/line_buffer.cpp +++ b/src/parser/line_buffer.cpp @@ -2,9 +2,9 @@ /*! \file line_buffer.cpp ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Andres Noetzli, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/line_buffer.h b/src/parser/line_buffer.h index 2b447a0e9..e8ab05691 100644 --- a/src/parser/line_buffer.h +++ b/src/parser/line_buffer.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__LINE_BUFFER_H -#define __CVC4__PARSER__LINE_BUFFER_H +#ifndef CVC4__PARSER__LINE_BUFFER_H +#define CVC4__PARSER__LINE_BUFFER_H #include <cstdlib> #include <istream> @@ -73,4 +73,4 @@ class LineBuffer { } // namespace parser } // namespace CVC4 -#endif /* __CVC4__PARSER__LINE_BUFFER_H */ +#endif /* CVC4__PARSER__LINE_BUFFER_H */ diff --git a/src/parser/memory_mapped_input_buffer.cpp b/src/parser/memory_mapped_input_buffer.cpp index b2bc04de9..2fa0bd7b9 100644 --- a/src/parser/memory_mapped_input_buffer.cpp +++ b/src/parser/memory_mapped_input_buffer.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/memory_mapped_input_buffer.h b/src/parser/memory_mapped_input_buffer.h index c99329d79..ee143c6b3 100644 --- a/src/parser/memory_mapped_input_buffer.h +++ b/src/parser/memory_mapped_input_buffer.h @@ -2,9 +2,9 @@ /*! \file memory_mapped_input_buffer.h ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Morgan Deters + ** Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__MEMORY_MAPPED_INPUT_BUFFER_H -#define __CVC4__PARSER__MEMORY_MAPPED_INPUT_BUFFER_H +#ifndef CVC4__PARSER__MEMORY_MAPPED_INPUT_BUFFER_H +#define CVC4__PARSER__MEMORY_MAPPED_INPUT_BUFFER_H #include <antlr3input.h> #include <string> @@ -39,4 +39,4 @@ MemoryMappedInputBufferNew(const std::string& filename); }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__MEMORY_MAPPED_INPUT_BUFFER_H */ +#endif /* CVC4__PARSER__MEMORY_MAPPED_INPUT_BUFFER_H */ diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index 71d226c98..28489154a 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -128,23 +128,18 @@ Expr Parser::getExpressionForNameAndType(const std::string& name, Type t) { } // now, post-process the expression assert( !expr.isNull() ); - if(isDefinedFunction(expr)) { - // defined functions/constants are wrapped in an APPLY so that they are - // expanded into their definition, e.g. during SmtEnginePrivate::expandDefinitions - expr = getExprManager()->mkExpr(CVC4::kind::APPLY, expr); - }else{ - Type te = expr.getType(); - if(te.isConstructor() && ConstructorType(te).getArity() == 0) { - // nullary constructors have APPLY_CONSTRUCTOR kind with no children - expr = getExprManager()->mkExpr(CVC4::kind::APPLY_CONSTRUCTOR, expr); - } + Type te = expr.getType(); + if (te.isConstructor() && ConstructorType(te).getArity() == 0) + { + // nullary constructors have APPLY_CONSTRUCTOR kind with no children + expr = getExprManager()->mkExpr(CVC4::kind::APPLY_CONSTRUCTOR, expr); } return expr; } Kind Parser::getKindForFunction(Expr fun) { if(isDefinedFunction(fun)) { - return APPLY; + return APPLY_UF; } Type t = fun.getType(); if(t.isConstructor()) { diff --git a/src/parser/parser.h b/src/parser/parser.h index 8c18055a7..826d460b2 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_public.h" -#ifndef __CVC4__PARSER__PARSER_STATE_H -#define __CVC4__PARSER__PARSER_STATE_H +#ifndef CVC4__PARSER__PARSER_STATE_H +#define CVC4__PARSER__PARSER_STATE_H #include <string> #include <set> @@ -835,4 +835,4 @@ public: }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__PARSER_STATE_H */ +#endif /* CVC4__PARSER__PARSER_STATE_H */ diff --git a/src/parser/parser_builder.cpp b/src/parser/parser_builder.cpp index 95a3a7840..57b63cc0f 100644 --- a/src/parser/parser_builder.cpp +++ b/src/parser/parser_builder.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/parser_builder.h b/src/parser/parser_builder.h index 3e14d715a..1a9ca719e 100644 --- a/src/parser/parser_builder.h +++ b/src/parser/parser_builder.h @@ -2,9 +2,9 @@ /*! \file parser_builder.h ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Morgan Deters, Aina Niemetz + ** Morgan Deters, Christopher L. Conway, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_public.h" -#ifndef __CVC4__PARSER__PARSER_BUILDER_H -#define __CVC4__PARSER__PARSER_BUILDER_H +#ifndef CVC4__PARSER__PARSER_BUILDER_H +#define CVC4__PARSER__PARSER_BUILDER_H #include <string> @@ -180,4 +180,4 @@ class CVC4_PUBLIC ParserBuilder { }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__PARSER_BUILDER_H */ +#endif /* CVC4__PARSER__PARSER_BUILDER_H */ diff --git a/src/parser/parser_exception.h b/src/parser/parser_exception.h index 9054b88ac..cd5e162d2 100644 --- a/src/parser/parser_exception.h +++ b/src/parser/parser_exception.h @@ -2,9 +2,9 @@ /*! \file parser_exception.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Christopher L. Conway + ** Tim King, Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_public.h" -#ifndef __CVC4__PARSER__PARSER_EXCEPTION_H -#define __CVC4__PARSER__PARSER_EXCEPTION_H +#ifndef CVC4__PARSER__PARSER_EXCEPTION_H +#define CVC4__PARSER__PARSER_EXCEPTION_H #include <iostream> #include <string> @@ -99,4 +99,4 @@ class CVC4_PUBLIC ParserEndOfFileException : public ParserException { }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__PARSER_EXCEPTION_H */ +#endif /* CVC4__PARSER__PARSER_EXCEPTION_H */ diff --git a/src/parser/smt1/Smt1.g b/src/parser/smt1/Smt1.g index 455da3b42..ca67ec592 100644 --- a/src/parser/smt1/Smt1.g +++ b/src/parser/smt1/Smt1.g @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/smt1/smt1.cpp b/src/parser/smt1/smt1.cpp index 544c6e85c..979880f8b 100644 --- a/src/parser/smt1/smt1.cpp +++ b/src/parser/smt1/smt1.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/smt1/smt1.h b/src/parser/smt1/smt1.h index fe177d21e..32867e692 100644 --- a/src/parser/smt1/smt1.h +++ b/src/parser/smt1/smt1.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__SMT1_H -#define __CVC4__PARSER__SMT1_H +#ifndef CVC4__PARSER__SMT1_H +#define CVC4__PARSER__SMT1_H #include <string> #include <unordered_map> @@ -130,4 +130,4 @@ private: }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__SMT1_H */ +#endif /* CVC4__PARSER__SMT1_H */ diff --git a/src/parser/smt1/smt1_input.cpp b/src/parser/smt1/smt1_input.cpp index 0a8118711..b8f476687 100644 --- a/src/parser/smt1/smt1_input.cpp +++ b/src/parser/smt1/smt1_input.cpp @@ -2,9 +2,9 @@ /*! \file smt1_input.cpp ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Morgan Deters, Tim King + ** Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/smt1/smt1_input.h b/src/parser/smt1/smt1_input.h index 6e7a8f8c4..fcdc63ee2 100644 --- a/src/parser/smt1/smt1_input.h +++ b/src/parser/smt1/smt1_input.h @@ -2,9 +2,9 @@ /*! \file smt1_input.h ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Morgan Deters, Tim King + ** Morgan Deters, Christopher L. Conway, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__SMT1_INPUT_H -#define __CVC4__PARSER__SMT1_INPUT_H +#ifndef CVC4__PARSER__SMT1_INPUT_H +#define CVC4__PARSER__SMT1_INPUT_H #include "parser/antlr_input.h" #include "parser/smt1/Smt1Lexer.h" @@ -82,4 +82,4 @@ public: }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__SMT1_INPUT_H */ +#endif /* CVC4__PARSER__SMT1_INPUT_H */ diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index c72a4f99b..9ba7f4b2e 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -407,6 +407,8 @@ command [std::unique_ptr<CVC4::Command>* cmd] ExprManager::VAR_FLAG_DEFINED, true); cmd->reset(new DefineFunctionCommand(name, func, terms, expr)); } + | DECLARE_DATATYPE_TOK datatypeDefCommand[false, cmd] + | DECLARE_DATATYPES_TOK datatypesDefCommand[false, cmd] | /* value query */ GET_VALUE_TOK { PARSER_STATE->checkThatLogicIsSet(); } ( LPAREN_TOK termList[terms,expr] RPAREN_TOK @@ -1211,9 +1213,7 @@ extendedCommand[std::unique_ptr<CVC4::Command>* cmd] * --smtlib2 compliance mode. */ : DECLARE_DATATYPES_2_5_TOK datatypes_2_5_DefCommand[false, cmd] | DECLARE_CODATATYPES_2_5_TOK datatypes_2_5_DefCommand[true, cmd] - | DECLARE_DATATYPE_TOK datatypeDefCommand[false, cmd] | DECLARE_CODATATYPE_TOK datatypeDefCommand[true, cmd] - | DECLARE_DATATYPES_TOK datatypesDefCommand[false, cmd] | DECLARE_CODATATYPES_TOK datatypesDefCommand[true, cmd] | rewriterulesCommand[cmd] @@ -1886,7 +1886,8 @@ termNonVariable[CVC4::Expr& expr, CVC4::Expr& expr2] Kind lassocKind = CVC4::kind::UNDEFINED_KIND; if (args.size() >= 2) { - if (kind == CVC4::kind::INTS_DIVISION) + if (kind == CVC4::kind::INTS_DIVISION + || (kind == CVC4::kind::BITVECTOR_XNOR && PARSER_STATE->v2_6())) { // Builtin operators that are not tokenized, are left associative, // but not internally variadic must set this. @@ -2090,7 +2091,7 @@ termNonVariable[CVC4::Expr& expr, CVC4::Expr& expr2] // however, we need to apply partial version since we don't have the internal selector available aargs.push_back( MK_EXPR( CVC4::kind::APPLY_SELECTOR, dtc[i].getSelector(), expr ) ); } - patexprs.push_back( MK_EXPR( CVC4::kind::APPLY, aargs ) ); + patexprs.push_back( MK_EXPR( CVC4::kind::APPLY_UF, aargs ) ); patconds.push_back( MK_EXPR( CVC4::kind::APPLY_TESTER, dtc.getTester(), expr ) ); } RPAREN_TOK @@ -2306,8 +2307,8 @@ termAtomic[CVC4::api::Term& atomTerm] sortSymbol[type,CHECK_DECLARED] sortSymbol[type2,CHECK_DECLARED] { - api::Term v1 = SOLVER->mkVar("_emp1", api::Sort(type)); - api::Term v2 = SOLVER->mkVar("_emp2", api::Sort(type2)); + api::Term v1 = SOLVER->mkConst(api::Sort(type), "_emp1"); + api::Term v2 = SOLVER->mkConst(api::Sort(type2), "_emp2"); atomTerm = SOLVER->mkTerm(api::SEP_EMP, v1, v2); } diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp index d52dd948b..71ba81124 100644 --- a/src/parser/smt2/smt2.cpp +++ b/src/parser/smt2/smt2.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Kshitij Bansal, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -859,7 +859,9 @@ Type Smt2::processSygusNestedGTerm( int sub_dt_index, std::string& sub_dname, st children.push_back( it->second ); } } - Kind sk = sop.getKind() != kind::BUILTIN ? kind::APPLY : getExprManager()->operatorToKind(sop); + Kind sk = sop.getKind() != kind::BUILTIN + ? kind::APPLY_UF + : getExprManager()->operatorToKind(sop); Debug("parser-sygus") << ": operator " << sop << " with " << sop.getKind() << " " << sk << std::endl; Expr e = getExprManager()->mkExpr( sk, children ); Debug("parser-sygus") << ": constructed " << e << ", which has type " << e.getType() << std::endl; @@ -1072,7 +1074,7 @@ void Smt2::mkSygusDatatype( CVC4::Datatype& dt, std::vector<CVC4::Expr>& ops, } children.insert(children.end(), largs.begin(), largs.end()); Kind sk = ops[i].getKind() != kind::BUILTIN - ? kind::APPLY + ? kind::APPLY_UF : getExprManager()->operatorToKind(ops[i]); Expr body = getExprManager()->mkExpr(sk, children); // replace by lambda @@ -1131,14 +1133,13 @@ void Smt2::mkSygusDatatype( CVC4::Datatype& dt, std::vector<CVC4::Expr>& ops, std::vector<Expr> largs; Expr lbvl = makeSygusBoundVarList(dt, i, ftypes, largs); largs.insert(largs.begin(), ops[i]); - Expr body = getExprManager()->mkExpr(kind::APPLY, largs); + Expr body = getExprManager()->mkExpr(kind::APPLY_UF, largs); ops[i] = getExprManager()->mkExpr(kind::LAMBDA, lbvl, body); Debug("parser-sygus") << " ...replace op : " << ops[i] << std::endl; } else { - ops[i] = getExprManager()->mkExpr(kind::APPLY, ops[i]); Debug("parser-sygus") << " ...replace op : " << ops[i] << std::endl; } diff --git a/src/parser/smt2/smt2.h b/src/parser/smt2/smt2.h index 7a3dbb9db..ee694db06 100644 --- a/src/parser/smt2/smt2.h +++ b/src/parser/smt2/smt2.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__SMT2_H -#define __CVC4__PARSER__SMT2_H +#ifndef CVC4__PARSER__SMT2_H +#define CVC4__PARSER__SMT2_H #include <sstream> #include <stack> @@ -319,15 +319,25 @@ private: // that CVC4 permits as N-ary but the standard requires is binary if(strictModeEnabled()) { switch(kind) { - case kind::BITVECTOR_CONCAT: case kind::BITVECTOR_AND: - case kind::BITVECTOR_OR: - case kind::BITVECTOR_XOR: case kind::BITVECTOR_MULT: + case kind::BITVECTOR_OR: case kind::BITVECTOR_PLUS: + case kind::BITVECTOR_XOR: + if (numArgs != 2 && !v2_6()) + { + parseError( + "Operator requires exactly 2 arguments in strict SMT-LIB " + "compliance mode (for versions <2.6): " + + kindToString(kind)); + } + break; + case kind::BITVECTOR_CONCAT: if(numArgs != 2) { - parseError("Operator requires exact 2 arguments in strict SMT-LIB " - "compliance mode: " + kindToString(kind)); + parseError( + "Operator requires exactly 2 arguments in strict SMT-LIB " + "compliance mode: " + + kindToString(kind)); } break; default: @@ -404,4 +414,4 @@ private: }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__SMT2_H */ +#endif /* CVC4__PARSER__SMT2_H */ diff --git a/src/parser/smt2/smt2_input.cpp b/src/parser/smt2/smt2_input.cpp index e8b52ee34..87739789b 100644 --- a/src/parser/smt2/smt2_input.cpp +++ b/src/parser/smt2/smt2_input.cpp @@ -2,9 +2,9 @@ /*! \file smt2_input.cpp ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Tim King, Morgan Deters + ** Christopher L. Conway, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/smt2/smt2_input.h b/src/parser/smt2/smt2_input.h index 47b420068..e8b736a16 100644 --- a/src/parser/smt2/smt2_input.h +++ b/src/parser/smt2/smt2_input.h @@ -2,9 +2,9 @@ /*! \file smt2_input.h ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Tim King, Andres Noetzli + ** Christopher L. Conway, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__SMT2_INPUT_H -#define __CVC4__PARSER__SMT2_INPUT_H +#ifndef CVC4__PARSER__SMT2_INPUT_H +#define CVC4__PARSER__SMT2_INPUT_H #include "parser/antlr_input.h" #include "parser/smt2/Smt2Lexer.h" @@ -83,4 +83,4 @@ class Smt2Input : public AntlrInput { }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__SMT2_INPUT_H */ +#endif /* CVC4__PARSER__SMT2_INPUT_H */ diff --git a/src/parser/smt2/sygus_input.cpp b/src/parser/smt2/sygus_input.cpp index 00760bffc..ff1a409ae 100644 --- a/src/parser/smt2/sygus_input.cpp +++ b/src/parser/smt2/sygus_input.cpp @@ -2,9 +2,9 @@ /*! \file sygus_input.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/smt2/sygus_input.h b/src/parser/smt2/sygus_input.h index 826c81670..a0e3e81ef 100644 --- a/src/parser/smt2/sygus_input.h +++ b/src/parser/smt2/sygus_input.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__SYGUS_INPUT_H -#define __CVC4__PARSER__SYGUS_INPUT_H +#ifndef CVC4__PARSER__SYGUS_INPUT_H +#define CVC4__PARSER__SYGUS_INPUT_H #include "parser/antlr_input.h" #include "parser/smt2/Smt2Lexer.h" @@ -83,4 +83,4 @@ class SygusInput : public AntlrInput { }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__SYGUS_INPUT_H */ +#endif /* CVC4__PARSER__SYGUS_INPUT_H */ diff --git a/src/parser/tptp/Tptp.g b/src/parser/tptp/Tptp.g index 54e9b0b4a..758198e0d 100644 --- a/src/parser/tptp/Tptp.g +++ b/src/parser/tptp/Tptp.g @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Francois Bobot, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -352,10 +352,24 @@ definedPred[CVC4::Expr& expr] | '$lesseq' { expr = EXPR_MANAGER->operatorOf(CVC4::kind::LEQ); } | '$greater' { expr = EXPR_MANAGER->operatorOf(CVC4::kind::GT); } | '$greatereq' { expr = EXPR_MANAGER->operatorOf(CVC4::kind::GEQ); } - | '$is_rat' // all "real" are actually "rat" in CVC4 + | '$is_rat' + // a real n is a rational if there exists q,r integers such that + // to_real(q) = n*to_real(r), + // where r is non-zero. { Expr n = EXPR_MANAGER->mkBoundVar("N", EXPR_MANAGER->realType()); - n = MK_EXPR(CVC4::kind::BOUND_VAR_LIST, n); - expr = MK_EXPR(CVC4::kind::LAMBDA, n, MK_CONST(bool(true))); + Expr q = EXPR_MANAGER->mkBoundVar("Q", EXPR_MANAGER->integerType()); + Expr qr = MK_EXPR(CVC4::kind::TO_REAL, q); + Expr r = EXPR_MANAGER->mkBoundVar("R", EXPR_MANAGER->integerType()); + Expr rr = MK_EXPR(CVC4::kind::TO_REAL, r); + Expr body = + MK_EXPR(CVC4::kind::AND, + MK_EXPR(CVC4::kind::NOT, + MK_EXPR(CVC4::kind::EQUAL, r, MK_CONST(Rational(0)))), + MK_EXPR(CVC4::kind::EQUAL, qr, MK_EXPR(CVC4::kind::MULT, n, rr))); + Expr bvl = MK_EXPR(CVC4::kind::BOUND_VAR_LIST, q, r); + body = MK_EXPR(CVC4::kind::EXISTS, bvl, body); + Expr lbvl = MK_EXPR(CVC4::kind::BOUND_VAR_LIST, n); + expr = MK_EXPR(CVC4::kind::LAMBDA, lbvl, body); } | '$is_int' { expr = EXPR_MANAGER->operatorOf(CVC4::kind::IS_INTEGER); } | '$distinct' { expr = EXPR_MANAGER->operatorOf(CVC4::kind::DISTINCT); } diff --git a/src/parser/tptp/tptp.cpp b/src/parser/tptp/tptp.cpp index ee313a202..fd593c68b 100644 --- a/src/parser/tptp/tptp.cpp +++ b/src/parser/tptp/tptp.cpp @@ -2,9 +2,9 @@ /*! \file tptp.cpp ** \verbatim ** Top contributors (to current version): - ** Francois Bobot, Tim King, Andrew Reynolds + ** Francois Bobot, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/tptp/tptp.h b/src/parser/tptp/tptp.h index eb5532247..082b905df 100644 --- a/src/parser/tptp/tptp.h +++ b/src/parser/tptp/tptp.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Francois Bobot, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__TPTP_H -#define __CVC4__PARSER__TPTP_H +#ifndef CVC4__PARSER__TPTP_H +#define CVC4__PARSER__TPTP_H #include <cassert> #include <unordered_map> @@ -196,4 +196,4 @@ enum NonAssoc { }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__TPTP_INPUT_H */ +#endif /* CVC4__PARSER__TPTP_INPUT_H */ diff --git a/src/parser/tptp/tptp_input.cpp b/src/parser/tptp/tptp_input.cpp index 126b28735..e17e6608e 100644 --- a/src/parser/tptp/tptp_input.cpp +++ b/src/parser/tptp/tptp_input.cpp @@ -2,9 +2,9 @@ /*! \file tptp_input.cpp ** \verbatim ** Top contributors (to current version): - ** Francois Bobot, Tim King, Morgan Deters + ** Francois Bobot, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/parser/tptp/tptp_input.h b/src/parser/tptp/tptp_input.h index e7c681804..5205cbc17 100644 --- a/src/parser/tptp/tptp_input.h +++ b/src/parser/tptp/tptp_input.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Francois Bobot, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4parser_private.h" -#ifndef __CVC4__PARSER__TPTP_INPUT_H -#define __CVC4__PARSER__TPTP_INPUT_H +#ifndef CVC4__PARSER__TPTP_INPUT_H +#define CVC4__PARSER__TPTP_INPUT_H #include "parser/antlr_input.h" #include "parser/tptp/TptpLexer.h" @@ -83,4 +83,4 @@ class TptpInput : public AntlrInput { }/* CVC4::parser namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PARSER__TPTP_INPUT_H */ +#endif /* CVC4__PARSER__TPTP_INPUT_H */ diff --git a/src/preprocessing/assertion_pipeline.cpp b/src/preprocessing/assertion_pipeline.cpp index 7d4351baa..382b1eb63 100644 --- a/src/preprocessing/assertion_pipeline.cpp +++ b/src/preprocessing/assertion_pipeline.cpp @@ -2,9 +2,9 @@ /*! \file assertion_pipeline.cpp ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Andres Noetzli, Justin Xu, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/assertion_pipeline.h b/src/preprocessing/assertion_pipeline.h index 77c5c4582..cc9d1c2af 100644 --- a/src/preprocessing/assertion_pipeline.h +++ b/src/preprocessing/assertion_pipeline.h @@ -2,9 +2,9 @@ /*! \file assertion_pipeline.h ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Andres Noetzli, Justin Xu, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__ASSERTION_PIPELINE_H -#define __CVC4__PREPROCESSING__ASSERTION_PIPELINE_H +#ifndef CVC4__PREPROCESSING__ASSERTION_PIPELINE_H +#define CVC4__PREPROCESSING__ASSERTION_PIPELINE_H #include <vector> @@ -117,4 +117,4 @@ class AssertionPipeline } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__ASSERTION_PIPELINE_H */ +#endif /* CVC4__PREPROCESSING__ASSERTION_PIPELINE_H */ diff --git a/src/preprocessing/passes/apply_substs.cpp b/src/preprocessing/passes/apply_substs.cpp index f5c3520d0..ddacc20c0 100644 --- a/src/preprocessing/passes/apply_substs.cpp +++ b/src/preprocessing/passes/apply_substs.cpp @@ -2,9 +2,9 @@ /*! \file apply_substs.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/apply_substs.h b/src/preprocessing/passes/apply_substs.h index f2f77fd0e..f20ffa61e 100644 --- a/src/preprocessing/passes/apply_substs.h +++ b/src/preprocessing/passes/apply_substs.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__APPLY_SUBSTS_H -#define __CVC4__PREPROCESSING__PASSES__APPLY_SUBSTS_H +#ifndef CVC4__PREPROCESSING__PASSES__APPLY_SUBSTS_H +#define CVC4__PREPROCESSING__PASSES__APPLY_SUBSTS_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" diff --git a/src/preprocessing/passes/apply_to_const.cpp b/src/preprocessing/passes/apply_to_const.cpp index 653a915d5..12591db0b 100644 --- a/src/preprocessing/passes/apply_to_const.cpp +++ b/src/preprocessing/passes/apply_to_const.cpp @@ -2,9 +2,9 @@ /*! \file apply_to_const.cpp ** \verbatim ** Top contributors (to current version): - ** Haniel Barbosa + ** Haniel Barbosa, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/apply_to_const.h b/src/preprocessing/passes/apply_to_const.h index 9d5072023..4c1df22ca 100644 --- a/src/preprocessing/passes/apply_to_const.h +++ b/src/preprocessing/passes/apply_to_const.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H -#define __CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H +#ifndef CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H +#define CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H #include <unordered_map> @@ -48,4 +48,4 @@ class ApplyToConst : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H */ +#endif /* CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H */ diff --git a/src/preprocessing/passes/bool_to_bv.cpp b/src/preprocessing/passes/bool_to_bv.cpp index 252ab941c..520e9f2a7 100644 --- a/src/preprocessing/passes/bool_to_bv.cpp +++ b/src/preprocessing/passes/bool_to_bv.cpp @@ -2,9 +2,9 @@ /*! \file bool_to_bv.cpp ** \verbatim ** Top contributors (to current version): - ** Yoni Zohar, Makai Mann + ** Makai Mann, Yoni Zohar, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/bool_to_bv.h b/src/preprocessing/passes/bool_to_bv.h index da99d3c84..11cb551fa 100644 --- a/src/preprocessing/passes/bool_to_bv.h +++ b/src/preprocessing/passes/bool_to_bv.h @@ -2,9 +2,9 @@ /*! \file bool_to_bv.h ** \verbatim ** Top contributors (to current version): - ** Makai Mann, Yoni Zohar + ** Yoni Zohar, Makai Mann, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_H -#define __CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_H +#ifndef CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_H +#define CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -70,4 +70,4 @@ class BoolToBV : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_H */ +#endif /* CVC4__PREPROCESSING__PASSES__BOOL_TO_BV_H */ diff --git a/src/preprocessing/passes/bv_abstraction.cpp b/src/preprocessing/passes/bv_abstraction.cpp index 27648b45d..9c0d0ec68 100644 --- a/src/preprocessing/passes/bv_abstraction.cpp +++ b/src/preprocessing/passes/bv_abstraction.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/bv_abstraction.h b/src/preprocessing/passes/bv_abstraction.h index 67e2ef296..b5840b355 100644 --- a/src/preprocessing/passes/bv_abstraction.h +++ b/src/preprocessing/passes/bv_abstraction.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__BV_ABSTRACTION_H -#define __CVC4__PREPROCESSING__PASSES__BV_ABSTRACTION_H +#ifndef CVC4__PREPROCESSING__PASSES__BV_ABSTRACTION_H +#define CVC4__PREPROCESSING__PASSES__BV_ABSTRACTION_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -47,4 +47,4 @@ class BvAbstraction : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__BV_ABSTRACTION_H */ +#endif /* CVC4__PREPROCESSING__PASSES__BV_ABSTRACTION_H */ diff --git a/src/preprocessing/passes/bv_ackermann.cpp b/src/preprocessing/passes/bv_ackermann.cpp index 2ec49b985..c8cefcb17 100644 --- a/src/preprocessing/passes/bv_ackermann.cpp +++ b/src/preprocessing/passes/bv_ackermann.cpp @@ -2,9 +2,9 @@ /*! \file bv_ackermann.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Yoni Zohar, Aina Niemetz, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/bv_ackermann.h b/src/preprocessing/passes/bv_ackermann.h index 5f799ffe4..98d1080bd 100644 --- a/src/preprocessing/passes/bv_ackermann.h +++ b/src/preprocessing/passes/bv_ackermann.h @@ -2,9 +2,9 @@ /*! \file bv_ackermann.h ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__BV_ACKERMANN_H -#define __CVC4__PREPROCESSING__PASSES__BV_ACKERMANN_H +#ifndef CVC4__PREPROCESSING__PASSES__BV_ACKERMANN_H +#define CVC4__PREPROCESSING__PASSES__BV_ACKERMANN_H #include <unordered_map> #include "expr/node.h" diff --git a/src/preprocessing/passes/bv_eager_atoms.cpp b/src/preprocessing/passes/bv_eager_atoms.cpp index 8ee46829a..a16a8347d 100644 --- a/src/preprocessing/passes/bv_eager_atoms.cpp +++ b/src/preprocessing/passes/bv_eager_atoms.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/bv_eager_atoms.h b/src/preprocessing/passes/bv_eager_atoms.h index 585c108fc..4ed685855 100644 --- a/src/preprocessing/passes/bv_eager_atoms.h +++ b/src/preprocessing/passes/bv_eager_atoms.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__BV_EAGER_ATOMS_H -#define __CVC4__PREPROCESSING__PASSES__BV_EAGER_ATOMS_H +#ifndef CVC4__PREPROCESSING__PASSES__BV_EAGER_ATOMS_H +#define CVC4__PREPROCESSING__PASSES__BV_EAGER_ATOMS_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -41,4 +41,4 @@ class BvEagerAtoms : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__BV_EAGER_ATOMS_H */ +#endif /* CVC4__PREPROCESSING__PASSES__BV_EAGER_ATOMS_H */ diff --git a/src/preprocessing/passes/bv_gauss.cpp b/src/preprocessing/passes/bv_gauss.cpp index 58e5f93bf..fccdfa2f9 100644 --- a/src/preprocessing/passes/bv_gauss.cpp +++ b/src/preprocessing/passes/bv_gauss.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/bv_gauss.h b/src/preprocessing/passes/bv_gauss.h index 8ed5a884e..862777a9b 100644 --- a/src/preprocessing/passes/bv_gauss.h +++ b/src/preprocessing/passes/bv_gauss.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__BV_GAUSS_ELIM_H -#define __CVC4__PREPROCESSING__PASSES__BV_GAUSS_ELIM_H +#ifndef CVC4__PREPROCESSING__PASSES__BV_GAUSS_ELIM_H +#define CVC4__PREPROCESSING__PASSES__BV_GAUSS_ELIM_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" diff --git a/src/preprocessing/passes/bv_intro_pow2.cpp b/src/preprocessing/passes/bv_intro_pow2.cpp index fb9ceac71..bfc02f332 100644 --- a/src/preprocessing/passes/bv_intro_pow2.cpp +++ b/src/preprocessing/passes/bv_intro_pow2.cpp @@ -2,9 +2,9 @@ /*! \file bv_intro_pow2.cpp ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner + ** Mathias Preiner, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/bv_intro_pow2.h b/src/preprocessing/passes/bv_intro_pow2.h index a5fe8e7bb..86d5ebfef 100644 --- a/src/preprocessing/passes/bv_intro_pow2.h +++ b/src/preprocessing/passes/bv_intro_pow2.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__BV_INTRO_POW2_H -#define __CVC4__PREPROCESSING__PASSES__BV_INTRO_POW2_H +#ifndef CVC4__PREPROCESSING__PASSES__BV_INTRO_POW2_H +#define CVC4__PREPROCESSING__PASSES__BV_INTRO_POW2_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -42,4 +42,4 @@ class BvIntroPow2 : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__BV_INTRO_POW2_H */ +#endif /* CVC4__PREPROCESSING__PASSES__BV_INTRO_POW2_H */ diff --git a/src/preprocessing/passes/bv_to_bool.cpp b/src/preprocessing/passes/bv_to_bool.cpp index 811fe9251..3d3762ecd 100644 --- a/src/preprocessing/passes/bv_to_bool.cpp +++ b/src/preprocessing/passes/bv_to_bool.cpp @@ -2,9 +2,9 @@ /*! \file bv_to_bool.cpp ** \verbatim ** Top contributors (to current version): - ** Yoni Zohar + ** Yoni Zohar, Liana Hadarean, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/bv_to_bool.h b/src/preprocessing/passes/bv_to_bool.h index 2d138ee1d..dc0494943 100644 --- a/src/preprocessing/passes/bv_to_bool.h +++ b/src/preprocessing/passes/bv_to_bool.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Yoni Zohar, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__BV_TO_BOOL_H -#define __CVC4__PREPROCESSING__PASSES__BV_TO_BOOL_H +#ifndef CVC4__PREPROCESSING__PASSES__BV_TO_BOOL_H +#define CVC4__PREPROCESSING__PASSES__BV_TO_BOOL_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -76,4 +76,4 @@ class BVToBool : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__BV_TO_BOOL_H */ +#endif /* CVC4__PREPROCESSING__PASSES__BV_TO_BOOL_H */ diff --git a/src/preprocessing/passes/extended_rewriter_pass.cpp b/src/preprocessing/passes/extended_rewriter_pass.cpp index 261a5f2ae..8bf4cc816 100644 --- a/src/preprocessing/passes/extended_rewriter_pass.cpp +++ b/src/preprocessing/passes/extended_rewriter_pass.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/extended_rewriter_pass.h b/src/preprocessing/passes/extended_rewriter_pass.h index f604a1af5..dbaaa05ad 100644 --- a/src/preprocessing/passes/extended_rewriter_pass.h +++ b/src/preprocessing/passes/extended_rewriter_pass.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__EXTENDED_REWRITER_PASS_H -#define __CVC4__PREPROCESSING__PASSES__EXTENDED_REWRITER_PASS_H +#ifndef CVC4__PREPROCESSING__PASSES__EXTENDED_REWRITER_PASS_H +#define CVC4__PREPROCESSING__PASSES__EXTENDED_REWRITER_PASS_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -40,4 +40,4 @@ class ExtRewPre : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__EXTENDED_REWRITER_PASS_H */ +#endif /* CVC4__PREPROCESSING__PASSES__EXTENDED_REWRITER_PASS_H */ diff --git a/src/preprocessing/passes/global_negate.cpp b/src/preprocessing/passes/global_negate.cpp index 428360e8d..5e7d42632 100644 --- a/src/preprocessing/passes/global_negate.cpp +++ b/src/preprocessing/passes/global_negate.cpp @@ -2,9 +2,9 @@ /*! \file global_negate.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/global_negate.h b/src/preprocessing/passes/global_negate.h index 0330aa10e..89c3a3e3e 100644 --- a/src/preprocessing/passes/global_negate.h +++ b/src/preprocessing/passes/global_negate.h @@ -2,9 +2,9 @@ /*! \file global_negate.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -22,8 +22,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__GLOBAL_NEGATE_H -#define __CVC4__PREPROCESSING__PASSES__GLOBAL_NEGATE_H +#ifndef CVC4__PREPROCESSING__PASSES__GLOBAL_NEGATE_H +#define CVC4__PREPROCESSING__PASSES__GLOBAL_NEGATE_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -49,4 +49,4 @@ class GlobalNegate : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING_PASSES__GLOBAL_NEGATE_H */ +#endif /* CVC4__PREPROCESSING_PASSES__GLOBAL_NEGATE_H */ diff --git a/src/preprocessing/passes/int_to_bv.cpp b/src/preprocessing/passes/int_to_bv.cpp index cc95bd1f2..150e41b8f 100644 --- a/src/preprocessing/passes/int_to_bv.cpp +++ b/src/preprocessing/passes/int_to_bv.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/int_to_bv.h b/src/preprocessing/passes/int_to_bv.h index 072e547c9..95f31621a 100644 --- a/src/preprocessing/passes/int_to_bv.h +++ b/src/preprocessing/passes/int_to_bv.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__INT_TO_BV_H -#define __CVC4__PREPROCESSING__PASSES__INT_TO_BV_H +#ifndef CVC4__PREPROCESSING__PASSES__INT_TO_BV_H +#define CVC4__PREPROCESSING__PASSES__INT_TO_BV_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -42,4 +42,4 @@ class IntToBV : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__INT_TO_BV_H */ +#endif /* CVC4__PREPROCESSING__PASSES__INT_TO_BV_H */ diff --git a/src/preprocessing/passes/ite_removal.cpp b/src/preprocessing/passes/ite_removal.cpp index b70d2460d..bda38a6df 100644 --- a/src/preprocessing/passes/ite_removal.cpp +++ b/src/preprocessing/passes/ite_removal.cpp @@ -2,9 +2,9 @@ /*! \file ite_removal.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Paul Meng + ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/ite_removal.h b/src/preprocessing/passes/ite_removal.h index 27ec4f095..5620b4afb 100644 --- a/src/preprocessing/passes/ite_removal.h +++ b/src/preprocessing/passes/ite_removal.h @@ -2,9 +2,9 @@ /*! \file ite_removal.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Paul Meng + ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__ITE_REMOVAL_H -#define __CVC4__PREPROCESSING__PASSES__ITE_REMOVAL_H +#ifndef CVC4__PREPROCESSING__PASSES__ITE_REMOVAL_H +#define CVC4__PREPROCESSING__PASSES__ITE_REMOVAL_H #include <unordered_set> #include <vector> @@ -43,4 +43,4 @@ class IteRemoval : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif // __CVC4__PREPROCESSING__PASSES__ITE_REMOVAL_H +#endif // CVC4__PREPROCESSING__PASSES__ITE_REMOVAL_H diff --git a/src/preprocessing/passes/ite_simp.cpp b/src/preprocessing/passes/ite_simp.cpp index 02f14f508..ad00ec204 100644 --- a/src/preprocessing/passes/ite_simp.cpp +++ b/src/preprocessing/passes/ite_simp.cpp @@ -2,9 +2,9 @@ /*! \file ite_simp.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Tim King, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/ite_simp.h b/src/preprocessing/passes/ite_simp.h index 2296d663e..44976bded 100644 --- a/src/preprocessing/passes/ite_simp.h +++ b/src/preprocessing/passes/ite_simp.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__ITE_SIMP_H -#define __CVC4__PREPROCESSING__PASSES__ITE_SIMP_H +#ifndef CVC4__PREPROCESSING__PASSES__ITE_SIMP_H +#define CVC4__PREPROCESSING__PASSES__ITE_SIMP_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" diff --git a/src/preprocessing/passes/miplib_trick.cpp b/src/preprocessing/passes/miplib_trick.cpp index 9a2dcca1f..37bc363f8 100644 --- a/src/preprocessing/passes/miplib_trick.cpp +++ b/src/preprocessing/passes/miplib_trick.cpp @@ -2,9 +2,9 @@ /*! \file miplib_trick.cpp ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner + ** Mathias Preiner, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/miplib_trick.h b/src/preprocessing/passes/miplib_trick.h index 7e75372a8..f1748d635 100644 --- a/src/preprocessing/passes/miplib_trick.h +++ b/src/preprocessing/passes/miplib_trick.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__MIPLIB_TRICK_H -#define __CVC4__PREPROCESSING__PASSES__MIPLIB_TRICK_H +#ifndef CVC4__PREPROCESSING__PASSES__MIPLIB_TRICK_H +#define CVC4__PREPROCESSING__PASSES__MIPLIB_TRICK_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -59,4 +59,4 @@ class MipLibTrick : public PreprocessingPass, public NodeManagerListener } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__MIPLIB_TRICK_H */ +#endif /* CVC4__PREPROCESSING__PASSES__MIPLIB_TRICK_H */ diff --git a/src/preprocessing/passes/nl_ext_purify.cpp b/src/preprocessing/passes/nl_ext_purify.cpp index 744bd8ad8..a6da281ba 100644 --- a/src/preprocessing/passes/nl_ext_purify.cpp +++ b/src/preprocessing/passes/nl_ext_purify.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/nl_ext_purify.h b/src/preprocessing/passes/nl_ext_purify.h index 8d28b0742..7744df824 100644 --- a/src/preprocessing/passes/nl_ext_purify.h +++ b/src/preprocessing/passes/nl_ext_purify.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__NL_EXT_PURIFY_H -#define __CVC4__PREPROCESSING__PASSES__NL_EXT_PURIFY_H +#ifndef CVC4__PREPROCESSING__PASSES__NL_EXT_PURIFY_H +#define CVC4__PREPROCESSING__PASSES__NL_EXT_PURIFY_H #include <unordered_map> #include <vector> @@ -54,4 +54,4 @@ class NlExtPurify : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__NL_EXT_PURIFY_H */ +#endif /* CVC4__PREPROCESSING__PASSES__NL_EXT_PURIFY_H */ diff --git a/src/preprocessing/passes/non_clausal_simp.cpp b/src/preprocessing/passes/non_clausal_simp.cpp index d8e1b3d66..4a0f38689 100644 --- a/src/preprocessing/passes/non_clausal_simp.cpp +++ b/src/preprocessing/passes/non_clausal_simp.cpp @@ -2,9 +2,9 @@ /*! \file non_clausal_simp.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/non_clausal_simp.h b/src/preprocessing/passes/non_clausal_simp.h index 2a244d7ad..cb4ece4a9 100644 --- a/src/preprocessing/passes/non_clausal_simp.h +++ b/src/preprocessing/passes/non_clausal_simp.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__NON_CLAUSAL_SIMP_H -#define __CVC4__PREPROCESSING__PASSES__NON_CLAUSAL_SIMP_H +#ifndef CVC4__PREPROCESSING__PASSES__NON_CLAUSAL_SIMP_H +#define CVC4__PREPROCESSING__PASSES__NON_CLAUSAL_SIMP_H #include <vector> diff --git a/src/preprocessing/passes/pseudo_boolean_processor.cpp b/src/preprocessing/passes/pseudo_boolean_processor.cpp index 624b98ec1..d852f2d86 100644 --- a/src/preprocessing/passes/pseudo_boolean_processor.cpp +++ b/src/preprocessing/passes/pseudo_boolean_processor.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/pseudo_boolean_processor.h b/src/preprocessing/passes/pseudo_boolean_processor.h index 5a91fef55..e73b721ff 100644 --- a/src/preprocessing/passes/pseudo_boolean_processor.h +++ b/src/preprocessing/passes/pseudo_boolean_processor.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__PSEUDO_BOOLEAN_PROCESSOR_H -#define __CVC4__PREPROCESSING__PASSES__PSEUDO_BOOLEAN_PROCESSOR_H +#ifndef CVC4__PREPROCESSING__PASSES__PSEUDO_BOOLEAN_PROCESSOR_H +#define CVC4__PREPROCESSING__PASSES__PSEUDO_BOOLEAN_PROCESSOR_H #include <unordered_set> #include <vector> @@ -114,4 +114,4 @@ class PseudoBooleanProcessor : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif // __CVC4__PREPROCESSING__PASSES__PSEUDO_BOOLEAN_PROCESSOR_H +#endif // CVC4__PREPROCESSING__PASSES__PSEUDO_BOOLEAN_PROCESSOR_H diff --git a/src/preprocessing/passes/quantifier_macros.cpp b/src/preprocessing/passes/quantifier_macros.cpp index 6bd94a3f0..0f71943c9 100644 --- a/src/preprocessing/passes/quantifier_macros.cpp +++ b/src/preprocessing/passes/quantifier_macros.cpp @@ -2,9 +2,9 @@ /*! \file quantifier_macros.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Kshitij Bansal + ** Andrew Reynolds, Yoni Zohar, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/quantifier_macros.h b/src/preprocessing/passes/quantifier_macros.h index 092a62942..6b62c4d31 100644 --- a/src/preprocessing/passes/quantifier_macros.h +++ b/src/preprocessing/passes/quantifier_macros.h @@ -2,9 +2,9 @@ /*! \file quantifier_macros.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Yoni Zohar, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__QUANTIFIER_MACROS_H -#define __CVC4__PREPROCESSING__PASSES__QUANTIFIER_MACROS_H +#ifndef CVC4__PREPROCESSING__PASSES__QUANTIFIER_MACROS_H +#define CVC4__PREPROCESSING__PASSES__QUANTIFIER_MACROS_H #include <map> #include <string> @@ -86,4 +86,4 @@ class QuantifierMacros : public PreprocessingPass } // preprocessing } // CVC4 -#endif /*__CVC4__PREPROCESSING__PASSES__QUANTIFIER_MACROS_H */ +#endif /*CVC4__PREPROCESSING__PASSES__QUANTIFIER_MACROS_H */ diff --git a/src/preprocessing/passes/quantifiers_preprocess.cpp b/src/preprocessing/passes/quantifiers_preprocess.cpp index cfc4a8103..eb6017402 100644 --- a/src/preprocessing/passes/quantifiers_preprocess.cpp +++ b/src/preprocessing/passes/quantifiers_preprocess.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Caleb Donovick ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/quantifiers_preprocess.h b/src/preprocessing/passes/quantifiers_preprocess.h index 56ad2f175..991b3dd05 100644 --- a/src/preprocessing/passes/quantifiers_preprocess.h +++ b/src/preprocessing/passes/quantifiers_preprocess.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Caleb Donovick ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__QUANTIFIERS_PREPROCESS_H -#define __CVC4__PREPROCESSING__PASSES__QUANTIFIERS_PREPROCESS_H +#ifndef CVC4__PREPROCESSING__PASSES__QUANTIFIERS_PREPROCESS_H +#define CVC4__PREPROCESSING__PASSES__QUANTIFIERS_PREPROCESS_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -43,4 +43,4 @@ class QuantifiersPreprocess : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__QUANTIFIERS_PREPROCESS_H */ +#endif /* CVC4__PREPROCESSING__PASSES__QUANTIFIERS_PREPROCESS_H */ diff --git a/src/preprocessing/passes/real_to_int.cpp b/src/preprocessing/passes/real_to_int.cpp index 4b1fc06eb..ca47e3ea0 100644 --- a/src/preprocessing/passes/real_to_int.cpp +++ b/src/preprocessing/passes/real_to_int.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/real_to_int.h b/src/preprocessing/passes/real_to_int.h index eb4ac6593..7949fb051 100644 --- a/src/preprocessing/passes/real_to_int.h +++ b/src/preprocessing/passes/real_to_int.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__REAL_TO_INT_H -#define __CVC4__PREPROCESSING__PASSES__REAL_TO_INT_H +#ifndef CVC4__PREPROCESSING__PASSES__REAL_TO_INT_H +#define CVC4__PREPROCESSING__PASSES__REAL_TO_INT_H #include <unordered_map> #include <vector> @@ -49,4 +49,4 @@ class RealToInt : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__REAL_TO_INT_H */ +#endif /* CVC4__PREPROCESSING__PASSES__REAL_TO_INT_H */ diff --git a/src/preprocessing/passes/rewrite.cpp b/src/preprocessing/passes/rewrite.cpp index 4a5eccd4b..deb58ae9f 100644 --- a/src/preprocessing/passes/rewrite.cpp +++ b/src/preprocessing/passes/rewrite.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Caleb Donovick ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/rewrite.h b/src/preprocessing/passes/rewrite.h index 1ab614fcd..e83cafb85 100644 --- a/src/preprocessing/passes/rewrite.h +++ b/src/preprocessing/passes/rewrite.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Caleb Donovick ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__REWRITE_H -#define __CVC4__PREPROCESSING__PASSES__REWRITE_H +#ifndef CVC4__PREPROCESSING__PASSES__REWRITE_H +#define CVC4__PREPROCESSING__PASSES__REWRITE_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -40,5 +40,5 @@ class Rewrite : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__REWRITE_H */ +#endif /* CVC4__PREPROCESSING__PASSES__REWRITE_H */ diff --git a/src/preprocessing/passes/sep_skolem_emp.cpp b/src/preprocessing/passes/sep_skolem_emp.cpp index 95a7995ce..a81dbb4b5 100644 --- a/src/preprocessing/passes/sep_skolem_emp.cpp +++ b/src/preprocessing/passes/sep_skolem_emp.cpp @@ -1,10 +1,10 @@ -/**********************/ +/********************* */ /*! \file sep_skolem_emp.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner, Yoni Zohar + ** Yoni Zohar, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/sep_skolem_emp.h b/src/preprocessing/passes/sep_skolem_emp.h index 4a3dba6b8..1a5e36c40 100644 --- a/src/preprocessing/passes/sep_skolem_emp.h +++ b/src/preprocessing/passes/sep_skolem_emp.h @@ -2,9 +2,9 @@ /*! \file sep_skolem_emp.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner, Yoni Zohar + ** Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__SEP_SKOLEM_EMP_H -#define __CVC4__PREPROCESSING__PASSES__SEP_SKOLEM_EMP_H +#ifndef CVC4__PREPROCESSING__PASSES__SEP_SKOLEM_EMP_H +#define CVC4__PREPROCESSING__PASSES__SEP_SKOLEM_EMP_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -39,4 +39,4 @@ class SepSkolemEmp : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__SEP_SKOLEM_EMP_H */ +#endif /* CVC4__PREPROCESSING__PASSES__SEP_SKOLEM_EMP_H */ diff --git a/src/preprocessing/passes/sort_infer.cpp b/src/preprocessing/passes/sort_infer.cpp index 807048696..d0612086c 100644 --- a/src/preprocessing/passes/sort_infer.cpp +++ b/src/preprocessing/passes/sort_infer.cpp @@ -2,9 +2,9 @@ /*! \file sort_infer.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/sort_infer.h b/src/preprocessing/passes/sort_infer.h index 7c913e9cf..ae722529d 100644 --- a/src/preprocessing/passes/sort_infer.h +++ b/src/preprocessing/passes/sort_infer.h @@ -2,9 +2,9 @@ /*! \file sort_infer.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -12,8 +12,8 @@ ** \brief Sort inference preprocessing pass **/ -#ifndef __CVC4__PREPROCESSING__PASSES__SORT_INFERENCE_PASS_H_ -#define __CVC4__PREPROCESSING__PASSES__SORT_INFERENCE_PASS_H_ +#ifndef CVC4__PREPROCESSING__PASSES__SORT_INFERENCE_PASS_H_ +#define CVC4__PREPROCESSING__PASSES__SORT_INFERENCE_PASS_H_ #include <map> #include <string> @@ -46,4 +46,4 @@ class SortInferencePass : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__SORT_INFERENCE_PASS_H_ */ +#endif /* CVC4__PREPROCESSING__PASSES__SORT_INFERENCE_PASS_H_ */ diff --git a/src/preprocessing/passes/static_learning.cpp b/src/preprocessing/passes/static_learning.cpp index 26327fd5b..7af9f7fac 100644 --- a/src/preprocessing/passes/static_learning.cpp +++ b/src/preprocessing/passes/static_learning.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/static_learning.h b/src/preprocessing/passes/static_learning.h index ade1f5a33..f200755c5 100644 --- a/src/preprocessing/passes/static_learning.h +++ b/src/preprocessing/passes/static_learning.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__STATIC_LEARNING_H -#define __CVC4__PREPROCESSING__PASSES__STATIC_LEARNING_H +#ifndef CVC4__PREPROCESSING__PASSES__STATIC_LEARNING_H +#define CVC4__PREPROCESSING__PASSES__STATIC_LEARNING_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -39,4 +39,4 @@ class StaticLearning : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__STATIC_LEARNING_H */ +#endif /* CVC4__PREPROCESSING__PASSES__STATIC_LEARNING_H */ diff --git a/src/preprocessing/passes/sygus_abduct.cpp b/src/preprocessing/passes/sygus_abduct.cpp new file mode 100644 index 000000000..346915b51 --- /dev/null +++ b/src/preprocessing/passes/sygus_abduct.cpp @@ -0,0 +1,174 @@ +/********************* */ +/*! \file sygus_abduct.cpp + ** \verbatim + ** Top contributors (to current version): + ** Andrew Reynolds + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Implementation of sygus abduction preprocessing pass, which + ** transforms an arbitrary input into an abduction problem. + **/ + +#include "preprocessing/passes/sygus_abduct.h" + +#include "expr/node_algorithm.h" +#include "smt/smt_engine.h" +#include "smt/smt_engine_scope.h" +#include "smt/smt_statistics_registry.h" +#include "theory/quantifiers/quantifiers_attributes.h" +#include "theory/quantifiers/quantifiers_rewriter.h" +#include "theory/quantifiers/term_util.h" +#include "theory/rewriter.h" + +using namespace std; +using namespace CVC4::kind; + +namespace CVC4 { +namespace preprocessing { +namespace passes { + +SygusAbduct::SygusAbduct(PreprocessingPassContext* preprocContext) + : PreprocessingPass(preprocContext, "sygus-abduct"){}; + +PreprocessingPassResult SygusAbduct::applyInternal( + AssertionPipeline* assertionsToPreprocess) +{ + NodeManager* nm = NodeManager::currentNM(); + Trace("sygus-abduct") << "Run sygus abduct..." << std::endl; + + Trace("sygus-abduct-debug") << "Collect symbols..." << std::endl; + std::unordered_set<Node, NodeHashFunction> symset; + std::vector<Node>& asserts = assertionsToPreprocess->ref(); + // do we have any assumptions, e.g. via check-sat-assuming? + bool usingAssumptions = (assertionsToPreprocess->getNumAssumptions() > 0); + // The following is our set of "axioms". We construct this set only when the + // usingAssumptions (above) is true. In this case, our input formula is + // partitioned into Fa ^ Fc as described in the header of this class, where: + // - The conjunction of assertions marked as assumptions are the negated + // conjecture Fc, and + // - The conjunction of all other assertions are the axioms Fa. + std::vector<Node> axioms; + for (size_t i = 0, size = asserts.size(); i < size; i++) + { + expr::getSymbols(asserts[i], symset); + // if we are not an assumption, add it to the set of axioms + if (usingAssumptions && i < assertionsToPreprocess->getAssumptionsStart()) + { + axioms.push_back(asserts[i]); + } + } + Trace("sygus-abduct-debug") + << "...finish, got " << symset.size() << " symbols." << std::endl; + + Trace("sygus-abduct-debug") << "Setup symbols..." << std::endl; + std::vector<Node> syms; + std::vector<Node> vars; + std::vector<Node> varlist; + std::vector<TypeNode> varlistTypes; + for (const Node& s : symset) + { + TypeNode tn = s.getType(); + if (tn.isFirstClass()) + { + std::stringstream ss; + ss << s; + Node var = nm->mkBoundVar(tn); + syms.push_back(s); + vars.push_back(var); + Node vlv = nm->mkBoundVar(ss.str(), tn); + varlist.push_back(vlv); + varlistTypes.push_back(tn); + } + } + Trace("sygus-abduct-debug") << "...finish" << std::endl; + + Trace("sygus-abduct-debug") << "Make abduction predicate..." << std::endl; + // make the abduction predicate to synthesize + TypeNode abdType = varlistTypes.empty() ? nm->booleanType() + : nm->mkPredicateType(varlistTypes); + Node abd = nm->mkBoundVar("A", abdType); + Trace("sygus-abduct-debug") << "...finish" << std::endl; + + Trace("sygus-abduct-debug") << "Make abduction predicate app..." << std::endl; + std::vector<Node> achildren; + achildren.push_back(abd); + achildren.insert(achildren.end(), vars.begin(), vars.end()); + Node abdApp = vars.empty() ? abd : nm->mkNode(APPLY_UF, achildren); + Trace("sygus-abduct-debug") << "...finish" << std::endl; + + Trace("sygus-abduct-debug") << "Set attributes..." << std::endl; + // set the sygus bound variable list + Node abvl = nm->mkNode(BOUND_VAR_LIST, varlist); + abd.setAttribute(theory::SygusSynthFunVarListAttribute(), abvl); + Trace("sygus-abduct-debug") << "...finish" << std::endl; + + Trace("sygus-abduct-debug") << "Make conjecture body..." << std::endl; + Node input = asserts.size() == 1 ? asserts[0] : nm->mkNode(AND, asserts); + input = input.substitute(syms.begin(), syms.end(), vars.begin(), vars.end()); + // A(x) => ~input( x ) + input = nm->mkNode(OR, abdApp.negate(), input.negate()); + Trace("sygus-abduct-debug") << "...finish" << std::endl; + + Trace("sygus-abduct-debug") << "Make conjecture..." << std::endl; + Node res = input.negate(); + if (!vars.empty()) + { + Node bvl = nm->mkNode(BOUND_VAR_LIST, vars); + // exists x. ~( A( x ) => ~input( x ) ) + res = nm->mkNode(EXISTS, bvl, res); + } + // sygus attribute + Node sygusVar = nm->mkSkolem("sygus", nm->booleanType()); + theory::SygusAttribute ca; + sygusVar.setAttribute(ca, true); + Node instAttr = nm->mkNode(INST_ATTRIBUTE, sygusVar); + std::vector<Node> iplc; + iplc.push_back(instAttr); + if (!axioms.empty()) + { + Node aconj = axioms.size() == 1 ? axioms[0] : nm->mkNode(AND, axioms); + aconj = + aconj.substitute(syms.begin(), syms.end(), vars.begin(), vars.end()); + Trace("sygus-abduct") << "---> Assumptions: " << aconj << std::endl; + Node sc = nm->mkNode(AND, aconj, abdApp); + Node vbvl = nm->mkNode(BOUND_VAR_LIST, vars); + sc = nm->mkNode(EXISTS, vbvl, sc); + Node sygusScVar = nm->mkSkolem("sygus_sc", nm->booleanType()); + sygusScVar.setAttribute(theory::SygusSideConditionAttribute(), sc); + instAttr = nm->mkNode(INST_ATTRIBUTE, sygusScVar); + // build in the side condition + // exists x. A( x ) ^ input_axioms( x ) + // as an additional annotation on the sygus conjecture. In other words, + // the abducts A we procedure must be consistent with our axioms. + iplc.push_back(instAttr); + } + Node instAttrList = nm->mkNode(INST_PATTERN_LIST, iplc); + + Node fbvl = nm->mkNode(BOUND_VAR_LIST, abd); + + // forall A. exists x. ~( A( x ) => ~input( x ) ) + res = nm->mkNode(FORALL, fbvl, res, instAttrList); + Trace("sygus-abduct-debug") << "...finish" << std::endl; + + res = theory::Rewriter::rewrite(res); + + Trace("sygus-abduct") << "Generate: " << res << std::endl; + + Node trueNode = nm->mkConst(true); + + assertionsToPreprocess->replace(0, res); + for (size_t i = 1, size = assertionsToPreprocess->size(); i < size; ++i) + { + assertionsToPreprocess->replace(i, trueNode); + } + + return PreprocessingPassResult::NO_CONFLICT; +} + +} // namespace passes +} // namespace preprocessing +} // namespace CVC4 diff --git a/src/preprocessing/passes/sygus_abduct.h b/src/preprocessing/passes/sygus_abduct.h new file mode 100644 index 000000000..0e0868cda --- /dev/null +++ b/src/preprocessing/passes/sygus_abduct.h @@ -0,0 +1,72 @@ +/********************* */ +/*! \file sygus_abduct.h + ** \verbatim + ** Top contributors (to current version): + ** Andrew Reynolds + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Sygus abduction preprocessing pass, which transforms an arbitrary + ** input into an abduction problem. + **/ + +#ifndef CVC4__PREPROCESSING__PASSES__SYGUS_ABDUCT_H +#define CVC4__PREPROCESSING__PASSES__SYGUS_ABDUCT_H + +#include "preprocessing/preprocessing_pass.h" +#include "preprocessing/preprocessing_pass_context.h" + +namespace CVC4 { +namespace preprocessing { +namespace passes { + +/** SygusAbduct + * + * A preprocessing utility that turns a set of quantifier-free assertions into + * a sygus conjecture that encodes an abduction problem. In detail, if our + * input formula is F( x ) for free symbols x, then we construct the sygus + * conjecture: + * + * exists A. forall x. ( A( x ) => ~F( x ) ) + * + * where A( x ) is a predicate over the free symbols of our input. In other + * words, A( x ) is a sufficient condition for showing ~F( x ). + * + * Another way to view this is A( x ) is any condition such that A( x ) ^ F( x ) + * is unsatisfiable. + * + * A common use case is to find the weakest such A that meets the above + * specification. We do this by streaming solutions (sygus-stream) for A + * while filtering stronger solutions (sygus-filter-sol=strong). These options + * are enabled by default when this preprocessing class is used (sygus-abduct). + * + * If the input F( x ) is partitioned into axioms Fa and negated conjecture Fc + * Fa( x ) ^ Fc( x ), then the sygus conjecture we construct is: + * + * exists A. ( exists y. A( y ) ^ Fa( y ) ) ^ forall x. ( A( x ) => ~F( x ) ) + * + * In other words, A( y ) must be consistent with our axioms Fa and imply + * ~F( x ). We encode this conjecture using SygusSideConditionAttribute. + */ +class SygusAbduct : public PreprocessingPass +{ + public: + SygusAbduct(PreprocessingPassContext* preprocContext); + + protected: + /** + * Replaces the set of assertions by an abduction sygus problem described + * above. + */ + PreprocessingPassResult applyInternal( + AssertionPipeline* assertionsToPreprocess) override; +}; + +} // namespace passes +} // namespace preprocessing +} // namespace CVC4 + +#endif /* CVC4__PREPROCESSING__PASSES__SYGUS_ABDUCT_H_ */ diff --git a/src/preprocessing/passes/sygus_inference.cpp b/src/preprocessing/passes/sygus_inference.cpp index b0c374ff9..78e9e639a 100644 --- a/src/preprocessing/passes/sygus_inference.cpp +++ b/src/preprocessing/passes/sygus_inference.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/sygus_inference.h b/src/preprocessing/passes/sygus_inference.h index 5e7c6f7d0..91deb445c 100644 --- a/src/preprocessing/passes/sygus_inference.h +++ b/src/preprocessing/passes/sygus_inference.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -12,8 +12,8 @@ ** \brief SygusInference **/ -#ifndef __CVC4__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_ -#define __CVC4__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_ +#ifndef CVC4__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_ +#define CVC4__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_ #include <map> #include <string> @@ -68,4 +68,4 @@ class SygusInference : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_ */ +#endif /* CVC4__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_ */ diff --git a/src/preprocessing/passes/symmetry_breaker.cpp b/src/preprocessing/passes/symmetry_breaker.cpp index 44fdd2c79..eb83fd229 100644 --- a/src/preprocessing/passes/symmetry_breaker.cpp +++ b/src/preprocessing/passes/symmetry_breaker.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/symmetry_breaker.h b/src/preprocessing/passes/symmetry_breaker.h index 9f0e7bb64..6bb10ebb8 100644 --- a/src/preprocessing/passes/symmetry_breaker.h +++ b/src/preprocessing/passes/symmetry_breaker.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -12,8 +12,8 @@ ** \brief Symmetry breaker for theories **/ -#ifndef __CVC4__PREPROCESSING__PASSES__SYMMETRY_BREAKER_H_ -#define __CVC4__PREPROCESSING__PASSES__SYMMETRY_BREAKER_H_ +#ifndef CVC4__PREPROCESSING__PASSES__SYMMETRY_BREAKER_H_ +#define CVC4__PREPROCESSING__PASSES__SYMMETRY_BREAKER_H_ #include <map> #include <string> @@ -106,4 +106,4 @@ class SymBreakerPass : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__SYMMETRY_BREAKER_H_ */ +#endif /* CVC4__PREPROCESSING__PASSES__SYMMETRY_BREAKER_H_ */ diff --git a/src/preprocessing/passes/symmetry_detect.cpp b/src/preprocessing/passes/symmetry_detect.cpp index ec784a6ba..8d0d04149 100644 --- a/src/preprocessing/passes/symmetry_detect.cpp +++ b/src/preprocessing/passes/symmetry_detect.cpp @@ -2,9 +2,9 @@ /*! \file symmetry_detect.cpp ** \verbatim ** Top contributors (to current version): - ** Paul Meng + ** Andrew Reynolds, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/symmetry_detect.h b/src/preprocessing/passes/symmetry_detect.h index 67e40da00..07a545723 100644 --- a/src/preprocessing/passes/symmetry_detect.h +++ b/src/preprocessing/passes/symmetry_detect.h @@ -2,9 +2,9 @@ /*! \file symmetry_detect.h ** \verbatim ** Top contributors (to current version): - ** Paul Meng + ** Andrew Reynolds, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__SYMMETRY_DETECT_H -#define __CVC4__PREPROCESSING__PASSES__SYMMETRY_DETECT_H +#ifndef CVC4__PREPROCESSING__PASSES__SYMMETRY_DETECT_H +#define CVC4__PREPROCESSING__PASSES__SYMMETRY_DETECT_H #include <map> #include <string> diff --git a/src/preprocessing/passes/synth_rew_rules.cpp b/src/preprocessing/passes/synth_rew_rules.cpp index 7e687329b..3eb27c2f7 100644 --- a/src/preprocessing/passes/synth_rew_rules.cpp +++ b/src/preprocessing/passes/synth_rew_rules.cpp @@ -2,9 +2,9 @@ /*! \file synth_rew_rules.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -79,8 +79,7 @@ PreprocessingPassResult SynthRewRulesPass::applyInternal( { Trace("srs-input-debug") << "...preprocess " << cur << std::endl; visited[cur] = false; - Kind k = cur.getKind(); - bool isQuant = k == FORALL || k == EXISTS || k == LAMBDA || k == CHOICE; + bool isQuant = cur.isClosure(); // we recurse on this node if it is not a quantified formula if (!isQuant) { diff --git a/src/preprocessing/passes/synth_rew_rules.h b/src/preprocessing/passes/synth_rew_rules.h index 2b05bbf00..38ef98b35 100644 --- a/src/preprocessing/passes/synth_rew_rules.h +++ b/src/preprocessing/passes/synth_rew_rules.h @@ -2,9 +2,9 @@ /*! \file synth_rew_rules.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -13,8 +13,8 @@ ** where t1 and t2 are subterms of the input. **/ -#ifndef __CVC4__PREPROCESSING__PASSES__SYNTH_REW_RULES_H -#define __CVC4__PREPROCESSING__PASSES__SYNTH_REW_RULES_H +#ifndef CVC4__PREPROCESSING__PASSES__SYNTH_REW_RULES_H +#define CVC4__PREPROCESSING__PASSES__SYNTH_REW_RULES_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -74,4 +74,4 @@ class SynthRewRulesPass : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__SYNTH_REW_RULES_H */ +#endif /* CVC4__PREPROCESSING__PASSES__SYNTH_REW_RULES_H */ diff --git a/src/preprocessing/passes/theory_preprocess.cpp b/src/preprocessing/passes/theory_preprocess.cpp index 3a5213f43..1399363fa 100644 --- a/src/preprocessing/passes/theory_preprocess.cpp +++ b/src/preprocessing/passes/theory_preprocess.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file bv_abstraction.cpp +/*! \file theory_preprocess.cpp ** \verbatim ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/theory_preprocess.h b/src/preprocessing/passes/theory_preprocess.h index 58eaee611..cfa9ab0b5 100644 --- a/src/preprocessing/passes/theory_preprocess.h +++ b/src/preprocessing/passes/theory_preprocess.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PASSES__THEORY_PREPROCESS_H -#define __CVC4__PREPROCESSING__PASSES__THEORY_PREPROCESS_H +#ifndef CVC4__PREPROCESSING__PASSES__THEORY_PREPROCESS_H +#define CVC4__PREPROCESSING__PASSES__THEORY_PREPROCESS_H #include "preprocessing/preprocessing_pass.h" #include "preprocessing/preprocessing_pass_context.h" @@ -40,4 +40,4 @@ class TheoryPreprocess : public PreprocessingPass } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PASSES__THEORY_PREPROCESS_H */ +#endif /* CVC4__PREPROCESSING__PASSES__THEORY_PREPROCESS_H */ diff --git a/src/preprocessing/passes/unconstrained_simplifier.cpp b/src/preprocessing/passes/unconstrained_simplifier.cpp index f58f1a44b..c41f1fca9 100644 --- a/src/preprocessing/passes/unconstrained_simplifier.cpp +++ b/src/preprocessing/passes/unconstrained_simplifier.cpp @@ -2,9 +2,9 @@ /*! \file unconstrained_simplifier.cpp ** \verbatim ** Top contributors (to current version): - ** Clark Barrett, Tim King, Andrew Reynolds + ** Clark Barrett, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/passes/unconstrained_simplifier.h b/src/preprocessing/passes/unconstrained_simplifier.h index 658834ee3..ac4fd0a03 100644 --- a/src/preprocessing/passes/unconstrained_simplifier.h +++ b/src/preprocessing/passes/unconstrained_simplifier.h @@ -2,9 +2,9 @@ /*! \file unconstrained_simplifier.h ** \verbatim ** Top contributors (to current version): - ** Clark Barrett, Tim King + ** Clark Barrett, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING_PASSES_UNCONSTRAINED_SIMPLIFIER_H -#define __CVC4__PREPROCESSING_PASSES_UNCONSTRAINED_SIMPLIFIER_H +#ifndef CVC4__PREPROCESSING_PASSES_UNCONSTRAINED_SIMPLIFIER_H +#define CVC4__PREPROCESSING_PASSES_UNCONSTRAINED_SIMPLIFIER_H #include <unordered_map> #include <unordered_set> diff --git a/src/preprocessing/preprocessing_pass.cpp b/src/preprocessing/preprocessing_pass.cpp index 120c68a91..84c3ca79b 100644 --- a/src/preprocessing/preprocessing_pass.cpp +++ b/src/preprocessing/preprocessing_pass.cpp @@ -2,9 +2,9 @@ /*! \file preprocessing_pass.cpp ** \verbatim ** Top contributors (to current version): - ** Justin Xu, Aina Niemetz + ** Justin Xu, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/preprocessing_pass.h b/src/preprocessing/preprocessing_pass.h index 448cacb87..4a2e71488 100644 --- a/src/preprocessing/preprocessing_pass.h +++ b/src/preprocessing/preprocessing_pass.h @@ -2,9 +2,9 @@ /*! \file preprocessing_pass.h ** \verbatim ** Top contributors (to current version): - ** Justin Xu, Aina Niemetz + ** Justin Xu ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -28,8 +28,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PREPROCESSING_PASS_H -#define __CVC4__PREPROCESSING__PREPROCESSING_PASS_H +#ifndef CVC4__PREPROCESSING__PREPROCESSING_PASS_H +#define CVC4__PREPROCESSING__PREPROCESSING_PASS_H #include <string> @@ -82,4 +82,4 @@ class PreprocessingPass { } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PREPROCESSING_PASS_H */ +#endif /* CVC4__PREPROCESSING__PREPROCESSING_PASS_H */ diff --git a/src/preprocessing/preprocessing_pass_context.cpp b/src/preprocessing/preprocessing_pass_context.cpp index 3f72a4559..2d25502d1 100644 --- a/src/preprocessing/preprocessing_pass_context.cpp +++ b/src/preprocessing/preprocessing_pass_context.cpp @@ -2,9 +2,9 @@ /*! \file preprocessing_pass_context.cpp ** \verbatim ** Top contributors (to current version): - ** Justin Xu, Mathias Preiner, Aina Niemetz + ** Aina Niemetz, Mathias Preiner, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/preprocessing_pass_context.h b/src/preprocessing/preprocessing_pass_context.h index 3eb0f10b5..e37680538 100644 --- a/src/preprocessing/preprocessing_pass_context.h +++ b/src/preprocessing/preprocessing_pass_context.h @@ -2,9 +2,9 @@ /*! \file preprocessing_pass_context.h ** \verbatim ** Top contributors (to current version): - ** Justin Xu, Andres Noetzli, Aina Niemetz + ** Aina Niemetz, Mathias Preiner, Justin Xu ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PREPROCESSING_PASS_CONTEXT_H -#define __CVC4__PREPROCESSING__PREPROCESSING_PASS_CONTEXT_H +#ifndef CVC4__PREPROCESSING__PREPROCESSING_PASS_CONTEXT_H +#define CVC4__PREPROCESSING__PREPROCESSING_PASS_CONTEXT_H #include "context/cdo.h" #include "context/context.h" @@ -121,4 +121,4 @@ class PreprocessingPassContext } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PREPROCESSING_PASS_CONTEXT_H */ +#endif /* CVC4__PREPROCESSING__PREPROCESSING_PASS_CONTEXT_H */ diff --git a/src/preprocessing/preprocessing_pass_registry.cpp b/src/preprocessing/preprocessing_pass_registry.cpp index f2e7c8603..15618f575 100644 --- a/src/preprocessing/preprocessing_pass_registry.cpp +++ b/src/preprocessing/preprocessing_pass_registry.cpp @@ -2,9 +2,9 @@ /*! \file preprocessing_pass_registry.cpp ** \verbatim ** Top contributors (to current version): - ** Justin Xu, Yoni Zohar + ** Andres Noetzli, Justin Xu, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -48,6 +48,7 @@ #include "preprocessing/passes/sep_skolem_emp.h" #include "preprocessing/passes/sort_infer.h" #include "preprocessing/passes/static_learning.h" +#include "preprocessing/passes/sygus_abduct.h" #include "preprocessing/passes/sygus_inference.h" #include "preprocessing/passes/symmetry_breaker.h" #include "preprocessing/passes/symmetry_detect.h" @@ -126,6 +127,7 @@ PreprocessingPassRegistry::PreprocessingPassRegistry() registerPassInfo("synth-rr", callCtor<SynthRewRulesPass>); registerPassInfo("real-to-int", callCtor<RealToInt>); registerPassInfo("sygus-infer", callCtor<SygusInference>); + registerPassInfo("sygus-abduct", callCtor<SygusAbduct>); registerPassInfo("bv-to-bool", callCtor<BVToBool>); registerPassInfo("bv-intro-pow2", callCtor<BvIntroPow2>); registerPassInfo("sort-inference", callCtor<SortInferencePass>); diff --git a/src/preprocessing/preprocessing_pass_registry.h b/src/preprocessing/preprocessing_pass_registry.h index e6c98c1f9..9cc109897 100644 --- a/src/preprocessing/preprocessing_pass_registry.h +++ b/src/preprocessing/preprocessing_pass_registry.h @@ -2,9 +2,9 @@ /*! \file preprocessing_pass_registry.h ** \verbatim ** Top contributors (to current version): - ** Justin Xu, Yoni Zohar + ** Andres Noetzli, Justin Xu, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ **/ #include "cvc4_private.h" -#ifndef __CVC4__PREPROCESSING__PREPROCESSING_PASS_REGISTRY_H -#define __CVC4__PREPROCESSING__PREPROCESSING_PASS_REGISTRY_H +#ifndef CVC4__PREPROCESSING__PREPROCESSING_PASS_REGISTRY_H +#define CVC4__PREPROCESSING__PREPROCESSING_PASS_REGISTRY_H #include <memory> #include <string> @@ -97,4 +97,4 @@ class PreprocessingPassRegistry { } // namespace preprocessing } // namespace CVC4 -#endif /* __CVC4__PREPROCESSING__PREPROCESSING_PASS_REGISTRY_H */ +#endif /* CVC4__PREPROCESSING__PREPROCESSING_PASS_REGISTRY_H */ diff --git a/src/preprocessing/util/ite_utilities.cpp b/src/preprocessing/util/ite_utilities.cpp index 66d9151df..9c3db0b0d 100644 --- a/src/preprocessing/util/ite_utilities.cpp +++ b/src/preprocessing/util/ite_utilities.cpp @@ -2,9 +2,9 @@ /*! \file ite_utilities.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Aina Niemetz, Andres Noetzli + ** Tim King, Aina Niemetz, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/preprocessing/util/ite_utilities.h b/src/preprocessing/util/ite_utilities.h index e137749db..ad195e62e 100644 --- a/src/preprocessing/util/ite_utilities.h +++ b/src/preprocessing/util/ite_utilities.h @@ -2,9 +2,9 @@ /*! \file ite_utilities.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Aina Niemetz, Paul Meng + ** Tim King, Aina Niemetz, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__ITE_UTILITIES_H -#define __CVC4__ITE_UTILITIES_H +#ifndef CVC4__ITE_UTILITIES_H +#define CVC4__ITE_UTILITIES_H #include <unordered_map> #include <vector> diff --git a/src/printer/ast/ast_printer.cpp b/src/printer/ast/ast_printer.cpp index 6b88a109c..1e6604d24 100644 --- a/src/printer/ast/ast_printer.cpp +++ b/src/printer/ast/ast_printer.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/printer/ast/ast_printer.h b/src/printer/ast/ast_printer.h index 8f2e6dcd9..fa109c779 100644 --- a/src/printer/ast/ast_printer.h +++ b/src/printer/ast/ast_printer.h @@ -2,9 +2,9 @@ /*! \file ast_printer.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PRINTER__AST_PRINTER_H -#define __CVC4__PRINTER__AST_PRINTER_H +#ifndef CVC4__PRINTER__AST_PRINTER_H +#define CVC4__PRINTER__AST_PRINTER_H #include <iostream> @@ -54,4 +54,4 @@ class AstPrinter : public CVC4::Printer { }/* CVC4::printer namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PRINTER__AST_PRINTER_H */ +#endif /* CVC4__PRINTER__AST_PRINTER_H */ diff --git a/src/printer/cvc/cvc_printer.cpp b/src/printer/cvc/cvc_printer.cpp index 36d2ddfb7..630d8bdd7 100644 --- a/src/printer/cvc/cvc_printer.cpp +++ b/src/printer/cvc/cvc_printer.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -280,9 +280,6 @@ void CvcPrinter::toStream( out << ")"; return; break; - case kind::APPLY: - toStream(op, n.getOperator(), depth, types, true); - break; case kind::CHAIN: case kind::DISTINCT: // chain and distinct not supported directly in CVC4, blast them away with the rewriter toStream(out, theory::Rewriter::rewrite(n), depth, types, true); diff --git a/src/printer/cvc/cvc_printer.h b/src/printer/cvc/cvc_printer.h index 1afd096ff..d379af7e3 100644 --- a/src/printer/cvc/cvc_printer.h +++ b/src/printer/cvc/cvc_printer.h @@ -2,9 +2,9 @@ /*! \file cvc_printer.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PRINTER__CVC_PRINTER_H -#define __CVC4__PRINTER__CVC_PRINTER_H +#ifndef CVC4__PRINTER__CVC_PRINTER_H +#define CVC4__PRINTER__CVC_PRINTER_H #include <iostream> @@ -57,4 +57,4 @@ class CvcPrinter : public CVC4::Printer { }/* CVC4::printer namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PRINTER__CVC_PRINTER_H */ +#endif /* CVC4__PRINTER__CVC_PRINTER_H */ diff --git a/src/printer/dagification_visitor.cpp b/src/printer/dagification_visitor.cpp index 202249759..cf5f35457 100644 --- a/src/printer/dagification_visitor.cpp +++ b/src/printer/dagification_visitor.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -47,8 +47,7 @@ DagificationVisitor::~DagificationVisitor() { bool DagificationVisitor::alreadyVisited(TNode current, TNode parent) { Kind ck = current.getKind(); - if (ck == kind::FORALL || ck == kind::EXISTS || ck == kind::LAMBDA - || ck == kind::CHOICE) + if (current.isClosure()) { // for quantifiers, we visit them but we don't recurse on them visit(current, parent); diff --git a/src/printer/dagification_visitor.h b/src/printer/dagification_visitor.h index b05e221f3..18f31e662 100644 --- a/src/printer/dagification_visitor.h +++ b/src/printer/dagification_visitor.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PRINTER__DAGIFICATION_VISITOR_H -#define __CVC4__PRINTER__DAGIFICATION_VISITOR_H +#ifndef CVC4__PRINTER__DAGIFICATION_VISITOR_H +#define CVC4__PRINTER__DAGIFICATION_VISITOR_H #include <string> #include <unordered_map> @@ -175,4 +175,4 @@ public: }/* CVC4::printer namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PRINTER__DAGIFICATION_VISITOR_H */ +#endif /* CVC4__PRINTER__DAGIFICATION_VISITOR_H */ diff --git a/src/printer/printer.cpp b/src/printer/printer.cpp index e834238a5..51888addd 100644 --- a/src/printer/printer.cpp +++ b/src/printer/printer.cpp @@ -2,9 +2,9 @@ /*! \file printer.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Aina Niemetz + ** Morgan Deters, Aina Niemetz, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/printer/printer.h b/src/printer/printer.h index 6b34094e7..85b7d498f 100644 --- a/src/printer/printer.h +++ b/src/printer/printer.h @@ -2,9 +2,9 @@ /*! \file printer.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PRINTER__PRINTER_H -#define __CVC4__PRINTER__PRINTER_H +#ifndef CVC4__PRINTER__PRINTER_H +#define CVC4__PRINTER__PRINTER_H #include <map> #include <string> @@ -113,4 +113,4 @@ class Printer } // namespace CVC4 -#endif /* __CVC4__PRINTER__PRINTER_H */ +#endif /* CVC4__PRINTER__PRINTER_H */ diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index d6ed07c12..5311f1bec 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -2,9 +2,9 @@ /*! \file smt2_printer.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -475,7 +475,6 @@ void Smt2Printer::toStream(std::ostream& out, } switch(Kind k = n.getKind()) { // builtin theory - case kind::APPLY: break; case kind::EQUAL: case kind::DISTINCT: out << smtKindString(k, d_variant) << " "; @@ -965,7 +964,6 @@ static string smtKindString(Kind k, Variant v) { switch(k) { // builtin theory - case kind::APPLY: break; case kind::EQUAL: return "="; case kind::DISTINCT: return "distinct"; case kind::CHAIN: break; diff --git a/src/printer/smt2/smt2_printer.h b/src/printer/smt2/smt2_printer.h index 2418e7109..579231364 100644 --- a/src/printer/smt2/smt2_printer.h +++ b/src/printer/smt2/smt2_printer.h @@ -2,9 +2,9 @@ /*! \file smt2_printer.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Tim King, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PRINTER__SMT2_PRINTER_H -#define __CVC4__PRINTER__SMT2_PRINTER_H +#ifndef CVC4__PRINTER__SMT2_PRINTER_H +#define CVC4__PRINTER__SMT2_PRINTER_H #include <iostream> @@ -80,4 +80,4 @@ class Smt2Printer : public CVC4::Printer { }/* CVC4::printer namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PRINTER__SMT2_PRINTER_H */ +#endif /* CVC4__PRINTER__SMT2_PRINTER_H */ diff --git a/src/printer/sygus_print_callback.cpp b/src/printer/sygus_print_callback.cpp index 7fac58395..e320d5dfd 100644 --- a/src/printer/sygus_print_callback.cpp +++ b/src/printer/sygus_print_callback.cpp @@ -2,9 +2,9 @@ /*! \file sygus_print_callback.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Haniel Barbosa + ** Andrew Reynolds, Morgan Deters, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/printer/sygus_print_callback.h b/src/printer/sygus_print_callback.h index 26907dbfd..d956fd4c6 100644 --- a/src/printer/sygus_print_callback.h +++ b/src/printer/sygus_print_callback.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__PRINTER__SYGUS_PRINT_CALLBACK_H -#define __CVC4__PRINTER__SYGUS_PRINT_CALLBACK_H +#ifndef CVC4__PRINTER__SYGUS_PRINT_CALLBACK_H +#define CVC4__PRINTER__SYGUS_PRINT_CALLBACK_H #include <vector> @@ -172,4 +172,4 @@ class CVC4_PUBLIC SygusEmptyPrintCallback : public SygusPrintCallback } /* CVC4::printer namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__PRINTER__SYGUS_PRINT_CALLBACK_H */ +#endif /* CVC4__PRINTER__SYGUS_PRINT_CALLBACK_H */ diff --git a/src/printer/tptp/tptp_printer.cpp b/src/printer/tptp/tptp_printer.cpp index 4a3b62be4..3ed642805 100644 --- a/src/printer/tptp/tptp_printer.cpp +++ b/src/printer/tptp/tptp_printer.cpp @@ -2,9 +2,9 @@ /*! \file tptp_printer.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/printer/tptp/tptp_printer.h b/src/printer/tptp/tptp_printer.h index 0cc95ed42..63272891e 100644 --- a/src/printer/tptp/tptp_printer.h +++ b/src/printer/tptp/tptp_printer.h @@ -2,9 +2,9 @@ /*! \file tptp_printer.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PRINTER__TPTP_PRINTER_H -#define __CVC4__PRINTER__TPTP_PRINTER_H +#ifndef CVC4__PRINTER__TPTP_PRINTER_H +#define CVC4__PRINTER__TPTP_PRINTER_H #include <iostream> @@ -58,4 +58,4 @@ class TptpPrinter : public CVC4::Printer { }/* CVC4::printer namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PRINTER__TPTP_PRINTER_H */ +#endif /* CVC4__PRINTER__TPTP_PRINTER_H */ diff --git a/src/proof/arith_proof.cpp b/src/proof/arith_proof.cpp index 0d2bb5be0..8b55c29db 100644 --- a/src/proof/arith_proof.cpp +++ b/src/proof/arith_proof.cpp @@ -2,9 +2,9 @@ /*! \file arith_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Guy Katz, Tim King, Andrew Reynolds + ** Alex Ozdemir, Guy Katz, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/arith_proof.h b/src/proof/arith_proof.h index 640d2db8d..a1df24fac 100644 --- a/src/proof/arith_proof.h +++ b/src/proof/arith_proof.h @@ -2,9 +2,9 @@ /*! \file arith_proof.h ** \verbatim ** Top contributors (to current version): - ** Guy Katz, Mathias Preiner, Tim King + ** Alex Ozdemir, Guy Katz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__ARITH__PROOF_H -#define __CVC4__ARITH__PROOF_H +#ifndef CVC4__ARITH__PROOF_H +#define CVC4__ARITH__PROOF_H #include <memory> #include <unordered_set> @@ -172,4 +172,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__ARITH__PROOF_H */ +#endif /* CVC4__ARITH__PROOF_H */ diff --git a/src/proof/arith_proof_recorder.cpp b/src/proof/arith_proof_recorder.cpp index 097fdb51e..c240f9582 100644 --- a/src/proof/arith_proof_recorder.cpp +++ b/src/proof/arith_proof_recorder.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/arith_proof_recorder.h b/src/proof/arith_proof_recorder.h index 2d0501332..3fff6968d 100644 --- a/src/proof/arith_proof_recorder.h +++ b/src/proof/arith_proof_recorder.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -42,8 +42,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF__ARITH_PROOF_RECORDER_H -#define __CVC4__PROOF__ARITH_PROOF_RECORDER_H +#ifndef CVC4__PROOF__ARITH_PROOF_RECORDER_H +#define CVC4__PROOF__ARITH_PROOF_RECORDER_H #include <map> #include <set> diff --git a/src/proof/array_proof.cpp b/src/proof/array_proof.cpp index c22f36413..131fcd3b6 100644 --- a/src/proof/array_proof.cpp +++ b/src/proof/array_proof.cpp @@ -2,9 +2,9 @@ /*! \file array_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Guy Katz, Yoni Zohar, Tim King + ** Guy Katz, Yoni Zohar, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/array_proof.h b/src/proof/array_proof.h index 53b825522..372ad1f67 100644 --- a/src/proof/array_proof.h +++ b/src/proof/array_proof.h @@ -2,9 +2,9 @@ /*! \file array_proof.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Guy Katz, Tim King + ** Tim King, Mathias Preiner, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__ARRAY__PROOF_H -#define __CVC4__ARRAY__PROOF_H +#ifndef CVC4__ARRAY__PROOF_H +#define CVC4__ARRAY__PROOF_H #include <memory> #include <unordered_set> @@ -117,4 +117,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__ARRAY__PROOF_H */ +#endif /* CVC4__ARRAY__PROOF_H */ diff --git a/src/proof/bitvector_proof.cpp b/src/proof/bitvector_proof.cpp index 90c0c9b30..18e46a292 100644 --- a/src/proof/bitvector_proof.cpp +++ b/src/proof/bitvector_proof.cpp @@ -2,9 +2,9 @@ /*! \file bitvector_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Guy Katz, Paul Meng + ** Liana Hadarean, Guy Katz, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -221,6 +221,14 @@ void BitVectorProof::printOwnedTerm(Expr term, } } +void BitVectorProof::printEmptyClauseProof(std::ostream& os, + std::ostream& paren) +{ + Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER, + "the BV theory should only be proving bottom directly in the eager " + "bitblasting mode"); +} + void BitVectorProof::printBitOf(Expr term, std::ostream& os, const ProofLetMap& map) diff --git a/src/proof/bitvector_proof.h b/src/proof/bitvector_proof.h index 4b897a6c6..f0a0717fa 100644 --- a/src/proof/bitvector_proof.h +++ b/src/proof/bitvector_proof.h @@ -2,9 +2,9 @@ /*! \file bitvector_proof.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Mathias Preiner, Guy Katz + ** Alex Ozdemir, Mathias Preiner, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BITVECTOR_PROOF_H -#define __CVC4__BITVECTOR_PROOF_H +#ifndef CVC4__BITVECTOR_PROOF_H +#define CVC4__BITVECTOR_PROOF_H #include <set> #include <unordered_map> @@ -167,7 +167,7 @@ class BitVectorProof : public TheoryProof * @param os the stream to print to * @param paren any parentheses to add to the end of the global proof */ - virtual void printEmptyClauseProof(std::ostream& os, std::ostream& paren) = 0; + virtual void printEmptyClauseProof(std::ostream& os, std::ostream& paren); /** * Read the d_atomsInBitblastingProof member. @@ -276,4 +276,4 @@ class BitVectorProof : public TheoryProof }/* CVC4 namespace */ -#endif /* __CVC4__BITVECTOR__PROOF_H */ +#endif /* CVC4__BITVECTOR__PROOF_H */ diff --git a/src/proof/clausal_bitvector_proof.cpp b/src/proof/clausal_bitvector_proof.cpp index bb875d1d8..eed295b1a 100644 --- a/src/proof/clausal_bitvector_proof.cpp +++ b/src/proof/clausal_bitvector_proof.cpp @@ -19,10 +19,13 @@ #include <algorithm> #include <iterator> #include <set> + #include "options/bv_options.h" #include "proof/clausal_bitvector_proof.h" #include "proof/drat/drat_proof.h" +#include "proof/er/er_proof.h" #include "proof/lfsc_proof_printer.h" +#include "proof/lrat/lrat_proof.h" #include "theory/bv/theory_bv.h" namespace CVC4 { @@ -66,12 +69,12 @@ void ClausalBitVectorProof::initCnfProof(prop::CnfStream* cnfStream, void ClausalBitVectorProof::registerUsedClause(ClauseId id, prop::SatClause& clause) { - d_usedClauses.emplace_back( - id, std::unique_ptr<prop::SatClause>(new prop::SatClause(clause))); + d_usedClauses.emplace_back(id, clause); }; void ClausalBitVectorProof::calculateAtomsInBitblastingProof() { + // Debug dump of DRAT Proof if (Debug.isOn("bv::clausal")) { std::string serializedDratProof = d_binaryDratProof.str(); @@ -84,7 +87,16 @@ void ClausalBitVectorProof::calculateAtomsInBitblastingProof() Debug("bv::clausal") << "Printing DRAT proof ... " << std::endl; dratProof.outputAsText(Debug("bv::clausal")); } - Unimplemented(); + + // Empty any old record of which atoms were used + d_atomsInBitblastingProof.clear(); + + // For each used clause, ask the CNF proof which atoms are used in it + for (const auto& usedIndexAndClause : d_usedClauses) + { + d_cnfProof->collectAtoms(&usedIndexAndClause.second, + d_atomsInBitblastingProof); + } } void LfscClausalBitVectorProof::printTheoryLemmaProof(std::vector<Expr>& lemma, @@ -101,13 +113,91 @@ void LfscClausalBitVectorProof::printBBDeclarationAndCnf(std::ostream& os, std::ostream& paren, ProofLetMap& letMap) { - Unimplemented(); + os << "\n;; Bitblasting mappings\n"; + printBitblasting(os, paren); + + os << "\n;; BB-CNF mappings\n"; + d_cnfProof->printAtomMapping(d_atomsInBitblastingProof, os, paren, letMap); + + os << "\n;; BB-CNF proofs\n"; + for (const auto& idAndClause : d_usedClauses) + { + d_cnfProof->printCnfProofForClause( + idAndClause.first, &idAndClause.second, os, paren); + } } -void LfscClausalBitVectorProof::printEmptyClauseProof(std::ostream& os, - std::ostream& paren) +void LfscDratBitVectorProof::printEmptyClauseProof(std::ostream& os, + std::ostream& paren) { - Unimplemented(); + Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER, + "the BV theory should only be proving bottom directly in the eager " + "bitblasting mode"); + + os << "\n;; Proof of input to SAT solver\n"; + os << "(@ proofOfSatInput "; + paren << ")"; + std::vector<ClauseId> usedIds; + usedIds.reserve(d_usedClauses.size()); + for (const auto& idAnd : d_usedClauses) + { + usedIds.push_back(idAnd.first); + }; + LFSCProofPrinter::printSatInputProof(usedIds, os, "bb"); + + os << "\n;; DRAT Proof Value\n"; + os << "(@ dratProof "; + paren << ")"; + drat::DratProof::fromBinary(d_binaryDratProof.str()).outputAsLfsc(os, 2); + os << "\n"; + + os << "\n;; Verification of DRAT Proof\n"; + os << "(drat_proof_of_bottom _ proofOfSatInput dratProof " + << "\n)"; +} + +void LfscLratBitVectorProof::printEmptyClauseProof(std::ostream& os, + std::ostream& paren) +{ + Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER, + "the BV theory should only be proving bottom directly in the eager " + "bitblasting mode"); + + os << "\n;; Proof of input to SAT solver\n"; + os << "(@ proofOfCMap "; + paren << ")"; + std::vector<ClauseId> usedIds; + usedIds.reserve(d_usedClauses.size()); + for (const auto& idAnd : d_usedClauses) + { + usedIds.push_back(idAnd.first); + }; + LFSCProofPrinter::printCMapProof(usedIds, os, "bb"); + + os << "\n;; DRAT Proof Value\n"; + os << "(@ lratProof "; + paren << ")"; + lrat::LratProof pf = + lrat::LratProof::fromDratProof(d_usedClauses, d_binaryDratProof.str()); + pf.outputAsLfsc(os); + os << "\n"; + + os << "\n;; Verification of DRAT Proof\n"; + os << "(lrat_proof_of_bottom _ proofOfCMap lratProof " + << "\n)"; +} + +void LfscErBitVectorProof::printEmptyClauseProof(std::ostream& os, + std::ostream& paren) +{ + Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER, + "the BV theory should only be proving bottom directly in the eager " + "bitblasting mode"); + + er::ErProof pf = + er::ErProof::fromBinaryDratProof(d_usedClauses, d_binaryDratProof.str()); + + pf.outputAsLfsc(os); } } // namespace proof diff --git a/src/proof/clausal_bitvector_proof.h b/src/proof/clausal_bitvector_proof.h index 85e409e0d..b10b1ad1c 100644 --- a/src/proof/clausal_bitvector_proof.h +++ b/src/proof/clausal_bitvector_proof.h @@ -2,7 +2,7 @@ /*! \file clausal_bitvector_proof.h ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF__CLAUSAL_BITVECTOR_PROOF_H -#define __CVC4__PROOF__CLAUSAL_BITVECTOR_PROOF_H +#ifndef CVC4__PROOF__CLAUSAL_BITVECTOR_PROOF_H +#define CVC4__PROOF__CLAUSAL_BITVECTOR_PROOF_H #include <iostream> #include <sstream> @@ -61,8 +61,7 @@ class ClausalBitVectorProof : public BitVectorProof protected: // A list of all clauses and their ids which are passed into the SAT solver - std::vector<std::pair<ClauseId, std::unique_ptr<prop::SatClause>>> - d_usedClauses; + std::vector<std::pair<ClauseId, prop::SatClause>> d_usedClauses; // Stores the proof recieved from the SAT solver. std::ostringstream d_binaryDratProof; }; @@ -77,7 +76,6 @@ class LfscClausalBitVectorProof : public ClausalBitVectorProof TheoryProofEngine* proofEngine) : ClausalBitVectorProof(bv, proofEngine) { - // That's all! } void printTheoryLemmaProof(std::vector<Expr>& lemma, @@ -87,6 +85,49 @@ class LfscClausalBitVectorProof : public ClausalBitVectorProof void printBBDeclarationAndCnf(std::ostream& os, std::ostream& paren, ProofLetMap& letMap) override; +}; + +/** + * A DRAT proof for a bit-vector problem + */ +class LfscDratBitVectorProof : public LfscClausalBitVectorProof +{ + public: + LfscDratBitVectorProof(theory::bv::TheoryBV* bv, + TheoryProofEngine* proofEngine) + : LfscClausalBitVectorProof(bv, proofEngine) + { + } + + void printEmptyClauseProof(std::ostream& os, std::ostream& paren) override; +}; + +/** + * An LRAT proof for a bit-vector problem + */ +class LfscLratBitVectorProof : public LfscClausalBitVectorProof +{ + public: + LfscLratBitVectorProof(theory::bv::TheoryBV* bv, + TheoryProofEngine* proofEngine) + : LfscClausalBitVectorProof(bv, proofEngine) + { + } + + void printEmptyClauseProof(std::ostream& os, std::ostream& paren) override; +}; + +/** + * An Extended Resolution proof for a bit-vector problem + */ +class LfscErBitVectorProof : public LfscClausalBitVectorProof +{ + public: + LfscErBitVectorProof(theory::bv::TheoryBV* bv, TheoryProofEngine* proofEngine) + : LfscClausalBitVectorProof(bv, proofEngine) + { + } + void printEmptyClauseProof(std::ostream& os, std::ostream& paren) override; }; @@ -94,4 +135,4 @@ class LfscClausalBitVectorProof : public ClausalBitVectorProof } // namespace CVC4 -#endif /* __CVC4__PROOF__CLAUSAL_BITVECTOR_PROOF_H */ +#endif /* CVC4__PROOF__CLAUSAL_BITVECTOR_PROOF_H */ diff --git a/src/proof/clause_id.h b/src/proof/clause_id.h index 384bc560c..4a9ebc74a 100644 --- a/src/proof/clause_id.h +++ b/src/proof/clause_id.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF__CLAUSE_ID_H -#define __CVC4__PROOF__CLAUSE_ID_H +#ifndef CVC4__PROOF__CLAUSE_ID_H +#define CVC4__PROOF__CLAUSE_ID_H namespace CVC4 { @@ -30,4 +30,4 @@ typedef unsigned ClauseId; }/* CVC4 namespace */ -#endif /* __CVC4__PROOF__CLAUSE_ID_H */ +#endif /* CVC4__PROOF__CLAUSE_ID_H */ diff --git a/src/proof/cnf_proof.cpp b/src/proof/cnf_proof.cpp index 4e8d20162..9c263e08f 100644 --- a/src/proof/cnf_proof.cpp +++ b/src/proof/cnf_proof.cpp @@ -2,9 +2,9 @@ /*! \file cnf_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Andrew Reynolds, Guy Katz + ** Liana Hadarean, Andrew Reynolds, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -349,6 +349,39 @@ void CnfProof::collectAssertionsForClauses(const IdToSatClause& clauses, } } +// Detects whether a clause has x v ~x for some x +// If so, returns the positive occurence's idx first, then the negative's +Maybe<std::pair<size_t, size_t>> CnfProof::detectTrivialTautology( + const prop::SatClause& clause) +{ + // a map from a SatVariable to its previous occurence's polarity and location + std::map<prop::SatVariable, std::pair<bool, size_t>> varsToPolsAndIndices; + for (size_t i = 0; i < clause.size(); ++i) + { + prop::SatLiteral lit = clause[i]; + prop::SatVariable var = lit.getSatVariable(); + bool polarity = !lit.isNegated(); + + // Check if this var has already occured w/ opposite polarity + auto iter = varsToPolsAndIndices.find(var); + if (iter != varsToPolsAndIndices.end() && iter->second.first != polarity) + { + if (iter->second.first) + { + return Maybe<std::pair<size_t, size_t>>{ + std::make_pair(iter->second.second, i)}; + } + else + { + return Maybe<std::pair<size_t, size_t>>{ + std::make_pair(i, iter->second.second)}; + } + } + varsToPolsAndIndices[var] = std::make_pair(polarity, i); + } + return Maybe<std::pair<size_t, size_t>>{}; +} + void LFSCCnfProof::printAtomMapping(const std::set<Node>& atoms, std::ostream& os, std::ostream& paren) { @@ -431,61 +464,98 @@ void LFSCCnfProof::printCnfProofForClause(ClauseId id, Assert( clause->size()>0 ); - Node base_assertion = getDefinitionForClause(id); - - //get the assertion for the clause id - std::map<Node, unsigned > childIndex; - std::map<Node, bool > childPol; - Node assertion = clauseToNode( *clause, childIndex, childPol ); - //if there is no reason, construct assertion directly. This can happen for unit clauses. - if( base_assertion.isNull() ){ - base_assertion = assertion; + // If the clause contains x v ~x, it's easy! + // + // It's important to check for this case, because our other logic for + // recording the location of variables in the clause assumes the clause is + // not tautological + Maybe<std::pair<size_t, size_t>> isTrivialTaut = + detectTrivialTautology(*clause); + if (isTrivialTaut.just()) + { + size_t posIndexInClause = isTrivialTaut.value().first; + size_t negIndexInClause = isTrivialTaut.value().second; + Trace("cnf-pf") << "; Indices " << posIndexInClause << " (+) and " + << negIndexInClause << " (-) make this clause a tautology" + << std::endl; + + std::string proofOfPos = + ProofManager::getLitName((*clause)[negIndexInClause], d_name); + std::string proofOfNeg = + ProofManager::getLitName((*clause)[posIndexInClause], d_name); + os << "(contra _ " << proofOfPos << " " << proofOfNeg << ")"; } - //os_base is proof of base_assertion - std::stringstream os_base; - - // checks if tautological definitional clause or top-level clause - // and prints the proof of the top-level formula - bool is_input = printProofTopLevel(base_assertion, os_base); + else + { + Node base_assertion = getDefinitionForClause(id); + + // get the assertion for the clause id + std::map<Node, unsigned> childIndex; + std::map<Node, bool> childPol; + Node assertion = clauseToNode(*clause, childIndex, childPol); + // if there is no reason, construct assertion directly. This can happen + // for unit clauses. + if (base_assertion.isNull()) + { + base_assertion = assertion; + } + // os_base is proof of base_assertion + std::stringstream os_base; + + // checks if tautological definitional clause or top-level clause + // and prints the proof of the top-level formula + bool is_input = printProofTopLevel(base_assertion, os_base); + + if (is_input) + { + Debug("cnf-pf") << std::endl + << "; base assertion is input. proof: " << os_base.str() + << std::endl; + } - if (is_input) { - Debug("cnf-pf") << std::endl << "; base assertion is input. proof: " << os_base.str() << std::endl; - } + // get base assertion with polarity + bool base_pol = base_assertion.getKind() != kind::NOT; + base_assertion = base_assertion.getKind() == kind::NOT ? base_assertion[0] + : base_assertion; - //get base assertion with polarity - bool base_pol = base_assertion.getKind()!=kind::NOT; - base_assertion = base_assertion.getKind()==kind::NOT ? base_assertion[0] : base_assertion; - - std::map< Node, unsigned >::iterator itci = childIndex.find( base_assertion ); - bool is_in_clause = itci!=childIndex.end(); - unsigned base_index = is_in_clause ? itci->second : 0; - Trace("cnf-pf") << std::endl; - Trace("cnf-pf") << "; input = " << is_input << ", is_in_clause = " << is_in_clause << ", id = " << id << ", assertion = " << assertion << ", base assertion = " << base_assertion << std::endl; - if (!is_input){ - Assert(is_in_clause); - prop::SatLiteral blit = (*clause)[ base_index ]; - os_base << ProofManager::getLitName(blit, d_name); - base_pol = !childPol[base_assertion]; // WHY? if the case is => - } - Trace("cnf-pf") << "; polarity of base assertion = " << base_pol << std::endl; - Trace("cnf-pf") << "; proof of base : " << os_base.str() << std::endl; - - bool success = false; - if( is_input && - is_in_clause && - childPol[base_assertion]==base_pol ){ - //if both in input and in clause, the proof is trivial. this is the case for unit clauses. - Trace("cnf-pf") << "; trivial" << std::endl; - os << "(contra _ "; - success = true; - prop::SatLiteral lit = (*clause)[itci->second]; - if( base_pol ){ - os << os_base.str() << " " << ProofManager::getLitName(lit, d_name); - }else{ - os << ProofManager::getLitName(lit, d_name) << " " << os_base.str(); + std::map<Node, unsigned>::iterator itci = childIndex.find(base_assertion); + bool is_in_clause = itci != childIndex.end(); + unsigned base_index = is_in_clause ? itci->second : 0; + Trace("cnf-pf") << std::endl; + Trace("cnf-pf") << "; input = " << is_input + << ", is_in_clause = " << is_in_clause << ", id = " << id + << ", assertion = " << assertion + << ", base assertion = " << base_assertion << std::endl; + if (!is_input) + { + Assert(is_in_clause); + prop::SatLiteral blit = (*clause)[base_index]; + os_base << ProofManager::getLitName(blit, d_name); + base_pol = !childPol[base_assertion]; // WHY? if the case is => } - os << ")"; - } else if ((base_assertion.getKind()==kind::AND && !base_pol) || + Trace("cnf-pf") << "; polarity of base assertion = " << base_pol + << std::endl; + Trace("cnf-pf") << "; proof of base : " << os_base.str() << std::endl; + + bool success = false; + if (is_input && is_in_clause && childPol[base_assertion] == base_pol) + { + // if both in input and in clause, the proof is trivial. this is the case + // for unit clauses. + Trace("cnf-pf") << "; trivial" << std::endl; + os << "(contra _ "; + success = true; + prop::SatLiteral lit = (*clause)[itci->second]; + if (base_pol) + { + os << os_base.str() << " " << ProofManager::getLitName(lit, d_name); + } + else + { + os << ProofManager::getLitName(lit, d_name) << " " << os_base.str(); + } + os << ")"; + } else if ((base_assertion.getKind()==kind::AND && !base_pol) || ((base_assertion.getKind()==kind::OR || base_assertion.getKind()==kind::IMPLIES) && base_pol)) { Trace("cnf-pf") << "; and/or case 1" << std::endl; @@ -776,6 +846,7 @@ void LFSCCnfProof::printCnfProofForClause(ClauseId id, Trace("cnf-pf") << std::endl; os << "trust-bad"; } + } os << ")" << clause_paren.str() << " (\\ " << ProofManager::getInputClauseName(id, d_name) << "\n"; diff --git a/src/proof/cnf_proof.h b/src/proof/cnf_proof.h index 78ddeebd0..e589950bc 100644 --- a/src/proof/cnf_proof.h +++ b/src/proof/cnf_proof.h @@ -2,9 +2,9 @@ /*! \file cnf_proof.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Guy Katz, Tim King + ** Liana Hadarean, Guy Katz, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__CNF_PROOF_H -#define __CVC4__CNF_PROOF_H +#ifndef CVC4__CNF_PROOF_H +#define CVC4__CNF_PROOF_H #include <iosfwd> #include <unordered_map> @@ -29,6 +29,7 @@ #include "proof/clause_id.h" #include "proof/lemma_proof.h" #include "proof/sat_proof.h" +#include "util/maybe.h" #include "util/proof.h" namespace CVC4 { @@ -164,6 +165,10 @@ public: std::ostream& paren, ProofLetMap &letMap) = 0; + // Detects whether a clause has x v ~x for some x + // If so, returns the positive occurence's idx first, then the negative's + static Maybe<std::pair<size_t, size_t>> detectTrivialTautology( + const prop::SatClause& clause); virtual void printClause(const prop::SatClause& clause, std::ostream& os, std::ostream& paren) = 0; @@ -207,4 +212,4 @@ public: } /* CVC4 namespace */ -#endif /* __CVC4__CNF_PROOF_H */ +#endif /* CVC4__CNF_PROOF_H */ diff --git a/src/proof/dimacs_printer.cpp b/src/proof/dimacs_printer.cpp index 48199066e..04f880e11 100644 --- a/src/proof/dimacs_printer.cpp +++ b/src/proof/dimacs_printer.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/dimacs_printer.h b/src/proof/dimacs_printer.h index d11adea3f..2ae4abefa 100644 --- a/src/proof/dimacs_printer.h +++ b/src/proof/dimacs_printer.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF__DIMACS_PRINTER_H -#define __CVC4__PROOF__DIMACS_PRINTER_H +#ifndef CVC4__PROOF__DIMACS_PRINTER_H +#define CVC4__PROOF__DIMACS_PRINTER_H #include <iosfwd> #include <memory> @@ -63,4 +63,4 @@ void printDimacs( } // namespace proof } // namespace CVC4 -#endif // __CVC4__PROOF__DIMACS_PRINTER_H +#endif // CVC4__PROOF__DIMACS_PRINTER_H diff --git a/src/proof/drat/drat_proof.cpp b/src/proof/drat/drat_proof.cpp index c2f2fa49e..5a01ffdfd 100644 --- a/src/proof/drat/drat_proof.cpp +++ b/src/proof/drat/drat_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -259,12 +259,12 @@ void DratProof::outputAsLfsc(std::ostream& os, uint8_t indentation) const { case ADDITION: { - os << "DRATProofa"; + os << "DRATProofa "; break; } case DELETION: { - os << "DRATProofd"; + os << "DRATProofd "; break; } default: { Unreachable("Unrecognized DRAT instruction kind"); @@ -273,7 +273,7 @@ void DratProof::outputAsLfsc(std::ostream& os, uint8_t indentation) const for (const SatLiteral& l : i.d_clause) { os << "(clc (" << (l.isNegated() ? "neg " : "pos ") - << ProofManager::getVarName(l.getSatVariable()) << ") "; + << ProofManager::getVarName(l.getSatVariable(), "bb") << ") "; } os << "cln"; std::fill_n(std::ostream_iterator<char>(os), i.d_clause.size(), ')'); diff --git a/src/proof/drat/drat_proof.h b/src/proof/drat/drat_proof.h index 4715b38f4..082107d0a 100644 --- a/src/proof/drat/drat_proof.h +++ b/src/proof/drat/drat_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ ** **/ -#ifndef __CVC4__PROOF__DRAT__DRAT_PROOF_H -#define __CVC4__PROOF__DRAT__DRAT_PROOF_H +#ifndef CVC4__PROOF__DRAT__DRAT_PROOF_H +#define CVC4__PROOF__DRAT__DRAT_PROOF_H #include "cvc4_private.h" #include "prop/sat_solver.h" @@ -137,4 +137,4 @@ class DratProof } // namespace proof } // namespace CVC4 -#endif // __CVC4__PROOF__DRAT__DRAT_PROOF_H +#endif // CVC4__PROOF__DRAT__DRAT_PROOF_H diff --git a/src/proof/er/er_proof.cpp b/src/proof/er/er_proof.cpp new file mode 100644 index 000000000..22903c3c9 --- /dev/null +++ b/src/proof/er/er_proof.cpp @@ -0,0 +1,391 @@ +/********************* */ +/*! \file er_proof.cpp + ** \verbatim + ** Top contributors (to current version): + ** Alex Ozdemir + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief ER Proof Format + ** + ** Declares C++ types that represent an ER/TRACECHECK proof. + ** Defines serialization for these types. + ** + ** You can find details about the way ER is encoded in the TRACECHECK + ** format at these locations: + ** https://github.com/benjaminkiesl/drat2er + ** http://www.cs.utexas.edu/users/marijn/publications/ijcar18.pdf + **/ + +#include "proof/er/er_proof.h" + +#include <unistd.h> +#include <algorithm> +#include <fstream> +#include <iostream> +#include <iterator> +#include <unordered_set> + +#include "base/cvc4_assert.h" +#include "base/map_util.h" +#include "proof/dimacs_printer.h" +#include "proof/lfsc_proof_printer.h" +#include "proof/proof_manager.h" + +#if CVC4_USE_DRAT2ER +#include "drat2er.h" +#include "drat2er_options.h" +#endif + +namespace CVC4 { +namespace proof { +namespace er { + +TraceCheckProof TraceCheckProof::fromText(std::istream& in) +{ + TraceCheckProof pf; + TraceCheckIdx idx = 0; + int64_t token = 0; + + // For each line of the proof, start with the idx + // If there is no idx, then you're done! + in >> idx; + for (; !in.eof(); in >> idx) + { + Assert(in.good()); + + // Then parse the clause (it's 0-terminated) + std::vector<prop::SatLiteral> clause; + in >> token; + for (; token != 0; in >> token) + { + clause.emplace_back(std::abs(token) - 1, token < 0); + } + + // Then parse the chain of literals (it's also 0-terminated) + std::vector<TraceCheckIdx> chain; + in >> token; + for (; token != 0; in >> token) + { + Assert(token > 0); + chain.push_back(token); + } + + // Add the line to the proof + pf.d_lines.emplace_back(idx, std::move(clause), std::move(chain)); + } + return pf; +} + +ErProof ErProof::fromBinaryDratProof(const ClauseUseRecord& usedClauses, + const std::string& dratBinary) +{ + std::ostringstream cmd; + char formulaFilename[] = "/tmp/cvc4-dimacs-XXXXXX"; + char dratFilename[] = "/tmp/cvc4-drat-XXXXXX"; + char tracecheckFilename[] = "/tmp/cvc4-tracecheck-er-XXXXXX"; + + int r; + r = mkstemp(formulaFilename); + AlwaysAssert(r > 0); + close(r); + r = mkstemp(dratFilename); + AlwaysAssert(r > 0); + close(r); + r = mkstemp(tracecheckFilename); + AlwaysAssert(r > 0); + close(r); + + // Write the formula + std::ofstream formStream(formulaFilename); + printDimacs(formStream, usedClauses); + formStream.close(); + + // Write the (binary) DRAT proof + std::ofstream dratStream(dratFilename); + dratStream << dratBinary; + dratStream.close(); + + // Invoke drat2er +#if CVC4_USE_DRAT2ER + drat2er::TransformDRATToExtendedResolution(formulaFilename, + dratFilename, + tracecheckFilename, + false, + drat2er::options::QUIET, + false); + +#else + Unimplemented( + "ER proof production requires drat2er.\n" + "Run contrib/get-drat2er, reconfigure with --drat2er, and rebuild"); +#endif + + // Parse the resulting TRACECHECK proof into an ER proof. + std::ifstream tracecheckStream(tracecheckFilename); + ErProof proof(usedClauses, TraceCheckProof::fromText(tracecheckStream)); + tracecheckStream.close(); + + remove(formulaFilename); + remove(dratFilename); + remove(tracecheckFilename); + + return proof; +} + +ErProof::ErProof(const ClauseUseRecord& usedClauses, + TraceCheckProof&& tracecheck) + : d_inputClauseIds(), d_definitions(), d_tracecheck(tracecheck) +{ + // Step zero, save input clause Ids for future printing + std::transform(usedClauses.begin(), + usedClauses.end(), + std::back_inserter(d_inputClauseIds), + [](const std::pair<ClauseId, prop::SatClause>& pair) { + return pair.first; + }); + + // Step one, verify the formula starts the proof + if (Configuration::isAssertionBuild()) + { + for (size_t i = 0, n = usedClauses.size(); i < n; ++i) + { + Assert(d_tracecheck.d_lines[i].d_idx = i + 1); + Assert(d_tracecheck.d_lines[i].d_chain.size() == 0); + std::unordered_set<prop::SatLiteral, prop::SatLiteralHashFunction> + traceCheckClause{d_tracecheck.d_lines[i].d_clause.begin(), + d_tracecheck.d_lines[i].d_clause.end()}; + std::unordered_set<prop::SatLiteral, prop::SatLiteralHashFunction> + originalClause{usedClauses[i].second.begin(), + usedClauses[i].second.end()}; + Assert(traceCheckClause == originalClause); + Assert(d_tracecheck.d_lines[i].d_idx = i + 1); + Assert(d_tracecheck.d_lines[i].d_chain.size() == 0); + Assert(d_tracecheck.d_lines[i].d_clause.size() + == usedClauses[i].second.size()); + for (size_t j = 0, m = usedClauses[i].second.size(); j < m; ++j) + { + Assert(usedClauses[i].second[j] == d_tracecheck.d_lines[i].d_clause[j]); + } + } + } + + // Step two, identify definitions. They correspond to lines that follow the + // input lines, are in bounds, and have no justifying chain. + for (size_t i = usedClauses.size(), n = d_tracecheck.d_lines.size(); + i < n && d_tracecheck.d_lines[i].d_chain.size() == 0;) + { + prop::SatClause c = d_tracecheck.d_lines[i].d_clause; + Assert(c.size() > 0); + Assert(!c[0].isNegated()); + + // Get the new variable of the definition -- the first variable of the + // first clause + prop::SatVariable newVar = c[0].getSatVariable(); + + // The rest of the literals in the clause of the 'other literals' of the def + std::vector<prop::SatLiteral> otherLiterals{++c.begin(), c.end()}; + + size_t nLinesForThisDef = 2 + otherLiterals.size(); + // Look at the negation of the second literal in the second clause to get + // the old literal + AlwaysAssert(d_tracecheck.d_lines.size() > i + 1, + "Malformed definition in TRACECHECK proof from drat2er"); + d_definitions.emplace_back(newVar, + ~d_tracecheck.d_lines[i + 1].d_clause[1], + std::move(otherLiterals)); + + // Advance over the lines for this definition + i += nLinesForThisDef; + } +} + +void ErProof::outputAsLfsc(std::ostream& os) const +{ + // How many parens to close? + size_t parenCount = 0; + std::unordered_set<prop::SatVariable> newVariables; + + // Print Definitions + for (const ErDefinition& def : d_definitions) + { + os << "\n (decl_rat_elimination_def (" + << (def.d_oldLiteral.isNegated() ? "neg " : "pos ") + << ProofManager::getVarName(def.d_oldLiteral.getSatVariable(), "bb") + << ") "; + LFSCProofPrinter::printSatClause(def.d_otherLiterals, os, "bb"); + os << " (\\ er.v" << def.d_newVariable << " (\\ er.def" + << def.d_newVariable; + newVariables.insert(def.d_newVariable); + } + parenCount += 3 * d_definitions.size(); + + // Clausify Definitions + TraceCheckIdx firstDefClause = d_inputClauseIds.size() + 1; + for (const ErDefinition& def : d_definitions) + { + os << "\n (clausify_rat_elimination_def _ _ _ " + << "er.def " << def.d_newVariable << " _ _ (\\ er.c" << firstDefClause + << " (\\ er.c" << (firstDefClause + 1) << " (\\ er.cnf" + << def.d_newVariable; + + firstDefClause += 2 + def.d_otherLiterals.size(); + } + parenCount += 4 * d_definitions.size(); + + // Unroll proofs of CNFs to proofs of clauses + firstDefClause = d_inputClauseIds.size() + 1; + for (const ErDefinition& def : d_definitions) + { + for (size_t i = 0, n = def.d_otherLiterals.size(); i < n; ++i) + { + os << "\n (cnfc_unroll _ _ "; + os << "er.cnf" << def.d_newVariable; + if (i != 0) + { + os << ".u" << i; + } + os << " (\\ er.c" << (firstDefClause + 2 + i); + os << " (\\ er.cnf" << def.d_newVariable << ".u" << (i + 1); + } + parenCount += 3 * def.d_otherLiterals.size(); + + firstDefClause += 2 + def.d_otherLiterals.size(); + } + + // NB: At this point `firstDefClause` points to the first clause resulting + // from a resolution chain + + // Now, elaborate each resolution chain + for (size_t cId = firstDefClause, nLines = d_tracecheck.d_lines.size(); + cId <= nLines; + ++cId) + { + const std::vector<TraceCheckIdx>& chain = + d_tracecheck.d_lines[cId - 1].d_chain; + const std::vector<prop::SatLiteral> pivots = computePivotsForChain(chain); + Assert(chain.size() > 0); + Assert(chain.size() == pivots.size() + 1); + + os << "\n (satlem_simplify _ _ _ "; + parenCount += 1; + + // Print resolution openings (reverse order) + for (int64_t i = pivots.size() - 1; i >= 0; --i) + { + prop::SatLiteral pivot = pivots[i]; + os << "(" << (pivot.isNegated() ? 'Q' : 'R') << " _ _ "; + } + + // Print resolution start + writeIdForClauseProof(os, chain[0]); + os << " "; + + // Print resolution closings (forward order) + for (size_t i = 0, n = pivots.size(); i < n; ++i) + { + prop::SatVariable pivotVar = pivots[i].getSatVariable(); + TraceCheckIdx clauseId = chain[i + 1]; + writeIdForClauseProof(os, clauseId); + os << " "; + if (ContainsKey(newVariables, pivotVar)) + { + // This is a defined variable + os << "er.v" << pivotVar; + } + else + { + os << ProofManager::getVarName(pivotVar, "bb"); + } + os << ") "; + } + os << "(\\ er.c" << cId; + parenCount += 1; + } + + // Write proof of bottom + Assert(d_tracecheck.d_lines.back().d_clause.size() == 0, + "The TRACECHECK proof from drat2er did not prove bottom."); + os << "\n er.c" << d_tracecheck.d_lines.back().d_idx + << " ; (holds cln)\n"; + + // Finally, close the parentheses! + std::fill_n(std::ostream_iterator<char>(os), parenCount, ')'); +} + +namespace { +/** + * Resolves two clauses + * + * @param dest one of the inputs, and the output too. **This is an input and + * output** + * @param src the other input + * + * @return the unique literal that was resolved on, with the polarization that + * it originally had in `dest`. + * + * For example, if dest = (1 3 -4 5) and src = (1 -3 5), then 3 is returned and + * after the call dest = (1 -4 5). + */ +prop::SatLiteral resolveModify( + std::unordered_set<prop::SatLiteral, prop::SatLiteralHashFunction>& dest, + const prop::SatClause& src) +{ + bool foundPivot = false; + prop::SatLiteral pivot(0, false); + + for (prop::SatLiteral lit : src) + { + auto negationLocation = dest.find(~lit); + if (negationLocation != dest.end()) + { + Assert(!foundPivot); + foundPivot = true; + dest.erase(negationLocation); + pivot = ~lit; + } + dest.insert(lit); + } + + Assert(foundPivot); + return pivot; +} +} // namespace + +std::vector<prop::SatLiteral> ErProof::computePivotsForChain( + const std::vector<TraceCheckIdx>& chain) const +{ + std::vector<prop::SatLiteral> pivots; + + const prop::SatClause& first = d_tracecheck.d_lines[chain[0] - 1].d_clause; + std::unordered_set<prop::SatLiteral, prop::SatLiteralHashFunction> + runningClause{first.begin(), first.end()}; + + for (auto idx = ++chain.cbegin(), end = chain.cend(); idx != end; ++idx) + { + pivots.push_back( + resolveModify(runningClause, d_tracecheck.d_lines[*idx - 1].d_clause)); + } + return pivots; +} + +void ErProof::writeIdForClauseProof(std::ostream& o, TraceCheckIdx i) const +{ + if (i <= d_inputClauseIds.size()) + { + // This clause is an input clause! Ask the ProofManager for its name + o << ProofManager::getInputClauseName(d_inputClauseIds[i - 1], "bb"); + } + else + { + // This clause was introduced by a definition or resolution chain + o << "er.c" << i; + } +} + +} // namespace er +} // namespace proof +} // namespace CVC4 diff --git a/src/proof/er/er_proof.h b/src/proof/er/er_proof.h new file mode 100644 index 000000000..f5af0783b --- /dev/null +++ b/src/proof/er/er_proof.h @@ -0,0 +1,208 @@ +/********************* */ +/*! \file er_proof.h + ** \verbatim + ** Top contributors (to current version): + ** Alex Ozdemir + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief ER Proof Format + ** + ** Declares C++ types that represent an ER/TRACECHECK proof. + ** Defines serialization for these types. + ** + ** You can find details about the way ER is encoded in the TRACECHECK + ** format at these locations: + ** https://github.com/benjaminkiesl/drat2er + ** http://www.cs.utexas.edu/users/marijn/publications/ijcar18.pdf + ** + **/ + +#include "cvc4_private.h" + +#ifndef CVC4__PROOF__ER__ER_PROOF_H +#define CVC4__PROOF__ER__ER_PROOF_H + +#include <memory> +#include <vector> + +#include "proof/clause_id.h" +#include "prop/sat_solver_types.h" + +namespace CVC4 { +namespace proof { +namespace er { + +using ClauseUseRecord = std::vector<std::pair<ClauseId, prop::SatClause>>; + +/** + * A definition of the form: + * newVar <-> p v (~x_1 ^ ~x_2 ^ ... ^ ~x_n) + */ +struct ErDefinition +{ + ErDefinition(prop::SatVariable newVariable, + prop::SatLiteral oldLiteral, + std::vector<prop::SatLiteral>&& otherLiterals) + : d_newVariable(newVariable), + d_oldLiteral(oldLiteral), + d_otherLiterals(otherLiterals) + { + } + + // newVar + prop::SatVariable d_newVariable; + // p + prop::SatLiteral d_oldLiteral; + // A list of the x_i's + std::vector<prop::SatLiteral> d_otherLiterals; +}; + +// For representing a clause's index within a TRACECHECK proof. +using TraceCheckIdx = size_t; + +/** + * A single line in a TRACECHECK proof. + * + * Consists of the index of a new clause, the literals of that clause, and the + * indices for preceding clauses which can be combined in a resolution chain to + * produce this new clause. + */ +struct TraceCheckLine +{ + TraceCheckLine(TraceCheckIdx idx, + std::vector<prop::SatLiteral>&& clause, + std::vector<TraceCheckIdx>&& chain) + : d_idx(idx), d_clause(clause), d_chain(chain) + { + } + + // The index of the new clause + TraceCheckIdx d_idx; + // The new clause + std::vector<prop::SatLiteral> d_clause; + /** + * Indices of clauses which must be resolved to produce this new clause. + * While the TRACECHECK format does not specify the order, we require them to + * be in resolution-order. + */ + std::vector<TraceCheckIdx> d_chain; +}; + +/** + * A TRACECHECK proof -- just a list of lines + */ +struct TraceCheckProof +{ + static TraceCheckProof fromText(std::istream& in); + TraceCheckProof() : d_lines() {} + + // The lines of this proof. + std::vector<TraceCheckLine> d_lines; +}; + +/** + * An extended resolution proof. + * It supports resolution, along with extensions of the form + * + * newVar <-> p v (~x_1 ^ ~x_2 ^ ... ^ ~x_n) + */ +class ErProof +{ + public: + /** + * Construct an ER proof from a DRAT proof, using drat2er + * + * @param usedClauses The CNF formula that we're deriving bottom from. + * @param dratBinary The DRAT proof from the SAT solver, as a binary stream. + */ + static ErProof fromBinaryDratProof(const ClauseUseRecord& usedClauses, + const std::string& dratBinary); + + /** + * Construct an ER proof from a TRACECHECK ER proof + * + * This basically just identifies groups of lines which correspond to + * definitions, and extracts them. + * + * @param usedClauses The CNF formula that we're deriving bottom from. + * @param tracecheck The TRACECHECK proof, as a stream. + */ + ErProof(const ClauseUseRecord& usedClauses, TraceCheckProof&& tracecheck); + + /** + * Write the ER proof as an LFSC value of type (holds cln). + * The format is from the LFSC signature er.plf + * + * Reads the current `ProofManager` to determine what the variables should be + * named. + * + * @param os the stream to write to + */ + void outputAsLfsc(std::ostream& os) const; + + const std::vector<ClauseId>& getInputClauseIds() const + { + return d_inputClauseIds; + } + + const std::vector<ErDefinition>& getDefinitions() const + { + return d_definitions; + } + + const TraceCheckProof& getTraceCheckProof() const { return d_tracecheck; } + + private: + /** + * Creates an empty ErProof. + */ + ErProof() : d_inputClauseIds(), d_definitions(), d_tracecheck() {} + + /** + * Computes the pivots on the basis of which an in-order resolution chain is + * resolved. + * + * c0 c1 + * \ / Clauses c_i being resolved in a chain around + * v1 c2 pivots v_i. + * \ / + * v2 c3 + * \ / + * v3 c4 + * \ / + * v4 + * + * + * @param chain the chain, of N clause indices + * + * @return a list of N - 1 variables, the list ( v_i ) from i = 1 to N - 1 + */ + std::vector<prop::SatLiteral> computePivotsForChain( + const std::vector<TraceCheckIdx>& chain) const; + + /** + * Write the LFSC identifier for the proof of a clause + * + * @param o where to write to + * @param i the TRACECHECK index for the clause whose proof identifier to + * print + */ + void writeIdForClauseProof(std::ostream& o, TraceCheckIdx i) const; + + // A list of the Ids for the input clauses, in order. + std::vector<ClauseId> d_inputClauseIds; + // A list of new variable definitions, in order. + std::vector<ErDefinition> d_definitions; + // The underlying TRACECHECK proof. + TraceCheckProof d_tracecheck; +}; + +} // namespace er +} // namespace proof +} // namespace CVC4 + +#endif // CVC4__PROOF__ER__ER_PROOF_H diff --git a/src/proof/lemma_proof.cpp b/src/proof/lemma_proof.cpp index 392805473..6bb2c2854 100644 --- a/src/proof/lemma_proof.cpp +++ b/src/proof/lemma_proof.cpp @@ -2,9 +2,9 @@ /*! \file lemma_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Guy Katz + ** Guy Katz, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lemma_proof.h b/src/proof/lemma_proof.h index 857632083..7dfce57cf 100644 --- a/src/proof/lemma_proof.h +++ b/src/proof/lemma_proof.h @@ -2,9 +2,9 @@ /*! \file lemma_proof.h ** \verbatim ** Top contributors (to current version): - ** Guy Katz + ** Guy Katz, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__LEMMA_PROOF_H -#define __CVC4__LEMMA_PROOF_H +#ifndef CVC4__LEMMA_PROOF_H +#define CVC4__LEMMA_PROOF_H #include "expr/expr.h" #include "proof/clause_id.h" @@ -112,4 +112,4 @@ std::ostream& operator<<(std::ostream & out, const LemmaProofRecipe & recipe); } /* CVC4 namespace */ -#endif /* __CVC4__LEMMA_PROOF_H */ +#endif /* CVC4__LEMMA_PROOF_H */ diff --git a/src/proof/lfsc_proof_printer.cpp b/src/proof/lfsc_proof_printer.cpp index be1259837..1a18d06a6 100644 --- a/src/proof/lfsc_proof_printer.cpp +++ b/src/proof/lfsc_proof_printer.cpp @@ -2,9 +2,9 @@ /*! \file lfsc_proof_printer.cpp ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Andres Noetzli, Alex Ozdemir, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lfsc_proof_printer.h b/src/proof/lfsc_proof_printer.h index 36a3490f7..f2f55aa94 100644 --- a/src/proof/lfsc_proof_printer.h +++ b/src/proof/lfsc_proof_printer.h @@ -2,9 +2,9 @@ /*! \file lfsc_proof_printer.h ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Andres Noetzli, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF__LFSC_PROOF_PRINTER_H -#define __CVC4__PROOF__LFSC_PROOF_PRINTER_H +#ifndef CVC4__PROOF__LFSC_PROOF_PRINTER_H +#define CVC4__PROOF__LFSC_PROOF_PRINTER_H #include <iosfwd> #include <string> @@ -151,4 +151,4 @@ class LFSCProofPrinter } // namespace proof } // namespace CVC4 -#endif /* __CVC4__PROOF__LFSC_PROOF_PRINTER_H */ +#endif /* CVC4__PROOF__LFSC_PROOF_PRINTER_H */ diff --git a/src/proof/lrat/lrat_proof.cpp b/src/proof/lrat/lrat_proof.cpp index 0b7af7aa5..a1939ec92 100644 --- a/src/proof/lrat/lrat_proof.cpp +++ b/src/proof/lrat/lrat_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lrat/lrat_proof.h b/src/proof/lrat/lrat_proof.h index a999e5ca6..33b2fad3f 100644 --- a/src/proof/lrat/lrat_proof.h +++ b/src/proof/lrat/lrat_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF__LRAT__LRAT_PROOF_H -#define __CVC4__PROOF__LRAT__LRAT_PROOF_H +#ifndef CVC4__PROOF__LRAT__LRAT_PROOF_H +#define CVC4__PROOF__LRAT__LRAT_PROOF_H #include <iosfwd> #include <string> diff --git a/src/proof/proof.h b/src/proof/proof.h index 3ee8d66ef..9e7e20a22 100644 --- a/src/proof/proof.h +++ b/src/proof/proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Liana Hadarean, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF__PROOF_H -#define __CVC4__PROOF__PROOF_H +#ifndef CVC4__PROOF__PROOF_H +#define CVC4__PROOF__PROOF_H #include "options/smt_options.h" @@ -67,4 +67,4 @@ # define PSTATS(x) #endif /* CVC4_PROOF_STATS */ -#endif /* __CVC4__PROOF__PROOF_H */ +#endif /* CVC4__PROOF__PROOF_H */ diff --git a/src/proof/proof_manager.cpp b/src/proof/proof_manager.cpp index 9878972bf..005a23378 100644 --- a/src/proof/proof_manager.cpp +++ b/src/proof/proof_manager.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Liana Hadarean, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -30,6 +30,7 @@ #include "proof/theory_proof.h" #include "smt/smt_engine.h" #include "smt/smt_engine_scope.h" +#include "smt/smt_statistics_registry.h" #include "smt_util/node_visitor.h" #include "theory/arrays/theory_arrays.h" #include "theory/output_channel.h" @@ -559,6 +560,9 @@ void LFSCProof::toStream(std::ostream& out, const ProofLetMap& map) const void LFSCProof::toStream(std::ostream& out) const { + TimerStat::CodeTimer proofProductionTimer( + *ProofManager::currentPM()->getProofProductionTime()); + Assert(!d_satProof->proofConstructed()); d_satProof->constructProof(); @@ -730,8 +734,7 @@ void LFSCProof::toStream(std::ostream& out) const out << ";; Printing final unsat proof \n"; if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER && ProofManager::getBitVectorProof()) { - proof::LFSCProofPrinter::printResolutionEmptyClause( - ProofManager::getBitVectorProof()->getSatProof(), out, paren); + ProofManager::getBitVectorProof()->printEmptyClauseProof(out, paren); } else { // print actual resolution proof proof::LFSCProofPrinter::printResolutions(d_satProof, out, paren); @@ -1069,4 +1072,16 @@ void ProofManager::printTrustedTerm(Node term, tpe->printTheoryTerm(term.toExpr(), os, globalLetMap); if (tpe->printsAsBool(term)) os << ")"; } + +ProofManager::ProofManagerStatistics::ProofManagerStatistics() + : d_proofProductionTime("proof::ProofManager::proofProductionTime") +{ + smtStatisticsRegistry()->registerStat(&d_proofProductionTime); +} + +ProofManager::ProofManagerStatistics::~ProofManagerStatistics() +{ + smtStatisticsRegistry()->unregisterStat(&d_proofProductionTime); +} + } /* CVC4 namespace */ diff --git a/src/proof/proof_manager.h b/src/proof/proof_manager.h index 82efbab0f..eb5942bea 100644 --- a/src/proof/proof_manager.h +++ b/src/proof/proof_manager.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Guy Katz, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,17 +16,17 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF_MANAGER_H -#define __CVC4__PROOF_MANAGER_H +#ifndef CVC4__PROOF_MANAGER_H +#define CVC4__PROOF_MANAGER_H #include <iosfwd> #include <memory> #include <unordered_map> #include <unordered_set> -#include "expr/node.h" -#include "context/cdhashset.h" #include "context/cdhashmap.h" +#include "context/cdhashset.h" +#include "expr/node.h" #include "proof/clause_id.h" #include "proof/proof.h" #include "proof/proof_utils.h" @@ -34,7 +34,7 @@ #include "theory/logic_info.h" #include "theory/substitutions.h" #include "util/proof.h" - +#include "util/statistics_registry.h" namespace CVC4 { @@ -298,9 +298,26 @@ public: std::ostream& out, std::ostringstream& paren); -private: + TimerStat* getProofProductionTime() { return &d_stats.d_proofProductionTime; } + + private: void constructSatProof(); std::set<Node> satClauseToNodeSet(prop::SatClause* clause); + + struct ProofManagerStatistics + { + ProofManagerStatistics(); + ~ProofManagerStatistics(); + + /** + * Time spent producing proofs (i.e. generating the proof from the logging + * information) + */ + TimerStat d_proofProductionTime; + }; /* struct ProofManagerStatistics */ + + ProofManagerStatistics d_stats; + };/* class ProofManager */ class LFSCProof : public Proof @@ -334,4 +351,4 @@ std::ostream& operator<<(std::ostream& out, CVC4::ProofRule k); -#endif /* __CVC4__PROOF_MANAGER_H */ +#endif /* CVC4__PROOF_MANAGER_H */ diff --git a/src/proof/proof_output_channel.cpp b/src/proof/proof_output_channel.cpp index 1489e83bd..449e12225 100644 --- a/src/proof/proof_output_channel.cpp +++ b/src/proof/proof_output_channel.cpp @@ -2,9 +2,9 @@ /*! \file proof_output_channel.cpp ** \verbatim ** Top contributors (to current version): - ** Guy Katz, Tim King + ** Guy Katz, Tim King, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/proof_output_channel.h b/src/proof/proof_output_channel.h index 8be434f50..ff84a3743 100644 --- a/src/proof/proof_output_channel.h +++ b/src/proof/proof_output_channel.h @@ -2,9 +2,9 @@ /*! \file proof_output_channel.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Guy Katz + ** Tim King, Guy Katz, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -13,8 +13,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF_OUTPUT_CHANNEL_H -#define __CVC4__PROOF_OUTPUT_CHANNEL_H +#ifndef CVC4__PROOF_OUTPUT_CHANNEL_H +#define CVC4__PROOF_OUTPUT_CHANNEL_H #include <memory> #include <set> @@ -74,4 +74,4 @@ public: } /* CVC4 namespace */ -#endif /* __CVC4__PROOF_OUTPUT_CHANNEL_H */ +#endif /* CVC4__PROOF_OUTPUT_CHANNEL_H */ diff --git a/src/proof/proof_utils.cpp b/src/proof/proof_utils.cpp index ead70ddde..3342d421a 100644 --- a/src/proof/proof_utils.cpp +++ b/src/proof/proof_utils.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Andrew Reynolds, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/proof_utils.h b/src/proof/proof_utils.h index c24897c8d..cb509063d 100644 --- a/src/proof/proof_utils.h +++ b/src/proof/proof_utils.h @@ -2,9 +2,9 @@ /*! \file proof_utils.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Guy Katz, Tim King + ** Liana Hadarean, Guy Katz, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/resolution_bitvector_proof.cpp b/src/proof/resolution_bitvector_proof.cpp index 1db673949..505500d5e 100644 --- a/src/proof/resolution_bitvector_proof.cpp +++ b/src/proof/resolution_bitvector_proof.cpp @@ -2,9 +2,9 @@ /*! \file resolution_bitvector_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Guy Katz, Paul Meng + ** Alex Ozdemir, Liana Hadarean, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/resolution_bitvector_proof.h b/src/proof/resolution_bitvector_proof.h index 6c2ae589f..5fd11092f 100644 --- a/src/proof/resolution_bitvector_proof.h +++ b/src/proof/resolution_bitvector_proof.h @@ -2,9 +2,9 @@ /*! \file resolution_bitvector_proof.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Mathias Preiner, Guy Katz + ** Alex Ozdemir, Mathias Preiner, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROOF__RESOLUTION_BITVECTOR_PROOF_H -#define __CVC4__PROOF__RESOLUTION_BITVECTOR_PROOF_H +#ifndef CVC4__PROOF__RESOLUTION_BITVECTOR_PROOF_H +#define CVC4__PROOF__RESOLUTION_BITVECTOR_PROOF_H #include <iosfwd> @@ -110,4 +110,4 @@ class LfscResolutionBitVectorProof : public ResolutionBitVectorProof } // namespace CVC4 -#endif /* __CVC4__PROOF__RESOLUTIONBITVECTORPROOF_H */ +#endif /* CVC4__PROOF__RESOLUTIONBITVECTORPROOF_H */ diff --git a/src/proof/sat_proof.h b/src/proof/sat_proof.h index 8fd2cb9eb..ec0928c07 100644 --- a/src/proof/sat_proof.h +++ b/src/proof/sat_proof.h @@ -2,9 +2,9 @@ /*! \file sat_proof.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Tim King, Guy Katz + ** Liana Hadarean, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__SAT__PROOF_H -#define __CVC4__SAT__PROOF_H +#ifndef CVC4__SAT__PROOF_H +#define CVC4__SAT__PROOF_H #include <stdint.h> @@ -373,4 +373,4 @@ void toSatClause(const typename Solver::TClause& minisat_cl, } /* CVC4 namespace */ -#endif /* __CVC4__SAT__PROOF_H */ +#endif /* CVC4__SAT__PROOF_H */ diff --git a/src/proof/sat_proof_implementation.h b/src/proof/sat_proof_implementation.h index 96f99be47..d9c959ae4 100644 --- a/src/proof/sat_proof_implementation.h +++ b/src/proof/sat_proof_implementation.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__SAT__PROOF_IMPLEMENTATION_H -#define __CVC4__SAT__PROOF_IMPLEMENTATION_H +#ifndef CVC4__SAT__PROOF_IMPLEMENTATION_H +#define CVC4__SAT__PROOF_IMPLEMENTATION_H #include "proof/clause_id.h" #include "proof/cnf_proof.h" @@ -1081,4 +1081,4 @@ inline std::ostream& operator<<(std::ostream& out, CVC4::ClauseKind k) { } /* CVC4 namespace */ -#endif /* __CVC4__SAT__PROOF_IMPLEMENTATION_H */ +#endif /* CVC4__SAT__PROOF_IMPLEMENTATION_H */ diff --git a/src/proof/simplify_boolean_node.cpp b/src/proof/simplify_boolean_node.cpp index 0ad6d0500..0fd69fc20 100644 --- a/src/proof/simplify_boolean_node.cpp +++ b/src/proof/simplify_boolean_node.cpp @@ -2,9 +2,9 @@ /*! \file simplify_boolean_node.cpp ** \verbatim ** Top contributors (to current version): - ** Guy Katz + ** Guy Katz, Liana Hadarean, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/simplify_boolean_node.h b/src/proof/simplify_boolean_node.h index 1c479e38d..fe8b7174b 100644 --- a/src/proof/simplify_boolean_node.h +++ b/src/proof/simplify_boolean_node.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__SIMPLIFY_BOOLEAN_NODE_H -#define __CVC4__SIMPLIFY_BOOLEAN_NODE_H +#ifndef CVC4__SIMPLIFY_BOOLEAN_NODE_H +#define CVC4__SIMPLIFY_BOOLEAN_NODE_H namespace CVC4 { @@ -24,4 +24,4 @@ Node simplifyBooleanNode(const Node &n); }/* CVC4 namespace */ -#endif /* __CVC4__SIMPLIFY_BOOLEAN_NODE_H */ +#endif /* CVC4__SIMPLIFY_BOOLEAN_NODE_H */ diff --git a/src/proof/skolemization_manager.cpp b/src/proof/skolemization_manager.cpp index f5fba4003..b0397d08c 100644 --- a/src/proof/skolemization_manager.cpp +++ b/src/proof/skolemization_manager.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/skolemization_manager.h b/src/proof/skolemization_manager.h index d8feb959f..cb23268f3 100644 --- a/src/proof/skolemization_manager.h +++ b/src/proof/skolemization_manager.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__SKOLEMIZATION_MANAGER_H -#define __CVC4__SKOLEMIZATION_MANAGER_H +#ifndef CVC4__SKOLEMIZATION_MANAGER_H +#define CVC4__SKOLEMIZATION_MANAGER_H #include <iostream> #include <unordered_map> @@ -52,4 +52,4 @@ private: -#endif /* __CVC4__SKOLEMIZATION_MANAGER_H */ +#endif /* CVC4__SKOLEMIZATION_MANAGER_H */ diff --git a/src/proof/theory_proof.cpp b/src/proof/theory_proof.cpp index fe9acfef3..c66aa59e4 100644 --- a/src/proof/theory_proof.cpp +++ b/src/proof/theory_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Liana Hadarean, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -85,8 +85,27 @@ void TheoryProofEngine::registerTheory(theory::Theory* th) { if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER && options::bvSatSolver() == theory::bv::SAT_SOLVER_CRYPTOMINISAT) { - proof::BitVectorProof* bvp = - new proof::LfscClausalBitVectorProof(thBv, this); + proof::BitVectorProof* bvp = nullptr; + switch (options::bvProofFormat()) + { + case theory::bv::BvProofFormat::BITVECTOR_PROOF_DRAT: + { + bvp = new proof::LfscDratBitVectorProof(thBv, this); + break; + } + case theory::bv::BvProofFormat::BITVECTOR_PROOF_LRAT: + { + bvp = new proof::LfscLratBitVectorProof(thBv, this); + break; + } + case theory::bv::BvProofFormat::BITVECTOR_PROOF_ER: + { + bvp = new proof::LfscErBitVectorProof(thBv, this); + break; + } + default: { Unreachable("Invalid BvProofFormat"); + } + }; d_theoryProofTable[id] = bvp; } else diff --git a/src/proof/theory_proof.h b/src/proof/theory_proof.h index 2f2ce83fd..b487b62a8 100644 --- a/src/proof/theory_proof.h +++ b/src/proof/theory_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Guy Katz, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY_PROOF_H -#define __CVC4__THEORY_PROOF_H +#ifndef CVC4__THEORY_PROOF_H +#define CVC4__THEORY_PROOF_H #include <iosfwd> #include <unordered_map> @@ -401,4 +401,4 @@ public: } /* CVC4 namespace */ -#endif /* __CVC4__THEORY_PROOF_H */ +#endif /* CVC4__THEORY_PROOF_H */ diff --git a/src/proof/uf_proof.cpp b/src/proof/uf_proof.cpp index 5d4a1ce11..10823693d 100644 --- a/src/proof/uf_proof.cpp +++ b/src/proof/uf_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Guy Katz, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -141,7 +141,7 @@ Node ProofUF::toStreamRecLFSC(std::ostream& out, return Node(); } - + // TODO (#2965): improve this code, which is highly complicated. switch(pf.d_id) { case theory::eq::MERGED_THROUGH_CONGRUENCE: { Debug("pf::uf") << "\nok, looking at congruence:\n"; diff --git a/src/proof/uf_proof.h b/src/proof/uf_proof.h index 6f69a3d00..ca8b3f90e 100644 --- a/src/proof/uf_proof.h +++ b/src/proof/uf_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__UF__PROOF_H -#define __CVC4__UF__PROOF_H +#ifndef CVC4__UF__PROOF_H +#define CVC4__UF__PROOF_H #include <memory> #include <unordered_set> @@ -102,4 +102,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__UF__PROOF_H */ +#endif /* CVC4__UF__PROOF_H */ diff --git a/src/proof/unsat_core.cpp b/src/proof/unsat_core.cpp index 0321ccd29..4212331af 100644 --- a/src/proof/unsat_core.cpp +++ b/src/proof/unsat_core.cpp @@ -2,9 +2,9 @@ /*! \file unsat_core.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Clark Barrett + ** Morgan Deters, Clark Barrett, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/unsat_core.h b/src/proof/unsat_core.h index 77f65e24a..0217b6326 100644 --- a/src/proof/unsat_core.h +++ b/src/proof/unsat_core.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__UNSAT_CORE_H -#define __CVC4__UNSAT_CORE_H +#ifndef CVC4__UNSAT_CORE_H +#define CVC4__UNSAT_CORE_H #include <iosfwd> #include <vector> @@ -71,4 +71,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__UNSAT_CORE_H */ +#endif /* CVC4__UNSAT_CORE_H */ diff --git a/src/prop/bv_sat_solver_notify.h b/src/prop/bv_sat_solver_notify.h index 686848829..77163cfe6 100644 --- a/src/prop/bv_sat_solver_notify.h +++ b/src/prop/bv_sat_solver_notify.h @@ -1,10 +1,10 @@ /********************* */ -/*! \file sat_solver_notify.h +/*! \file bv_sat_solver_notify.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Dejan Jovanovic, Morgan Deters + ** Liana Hadarean, Alex Ozdemir, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP__BVSATSOLVERNOTIFY_H -#define __CVC4__PROP__BVSATSOLVERNOTIFY_H +#ifndef CVC4__PROP__BVSATSOLVERNOTIFY_H +#define CVC4__PROP__BVSATSOLVERNOTIFY_H #include "prop/sat_solver_types.h" diff --git a/src/prop/bvminisat/bvminisat.cpp b/src/prop/bvminisat/bvminisat.cpp index 57ef8ef30..76d473395 100644 --- a/src/prop/bvminisat/bvminisat.cpp +++ b/src/prop/bvminisat/bvminisat.cpp @@ -2,9 +2,9 @@ /*! \file bvminisat.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Liana Hadarean, Tim King + ** Liana Hadarean, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/bvminisat/bvminisat.h b/src/prop/bvminisat/bvminisat.h index efb90a3f0..ca9c553d9 100644 --- a/src/prop/bvminisat/bvminisat.h +++ b/src/prop/bvminisat/bvminisat.h @@ -2,9 +2,9 @@ /*! \file bvminisat.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Mathias Preiner, Liana Hadarean + ** Mathias Preiner, Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/cadical.cpp b/src/prop/cadical.cpp index 3fd210699..5a0968ec8 100644 --- a/src/prop/cadical.cpp +++ b/src/prop/cadical.cpp @@ -2,9 +2,9 @@ /*! \file cadical.cpp ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner + ** Mathias Preiner, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/cadical.h b/src/prop/cadical.h index 2e2c1cc51..e43a2d278 100644 --- a/src/prop/cadical.h +++ b/src/prop/cadical.h @@ -2,9 +2,9 @@ /*! \file cadical.h ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner + ** Mathias Preiner, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP__CADICAL_H -#define __CVC4__PROP__CADICAL_H +#ifndef CVC4__PROP__CADICAL_H +#define CVC4__PROP__CADICAL_H #ifdef CVC4_USE_CADICAL @@ -87,4 +87,4 @@ class CadicalSolver : public SatSolver } // namespace CVC4 #endif // CVC4_USE_CADICAL -#endif // __CVC4__PROP__CADICAL_H +#endif // CVC4__PROP__CADICAL_H diff --git a/src/prop/cnf_stream.cpp b/src/prop/cnf_stream.cpp index 84c315547..dc4722fa1 100644 --- a/src/prop/cnf_stream.cpp +++ b/src/prop/cnf_stream.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/cnf_stream.h b/src/prop/cnf_stream.h index e0996014a..8e60863fa 100644 --- a/src/prop/cnf_stream.h +++ b/src/prop/cnf_stream.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -22,8 +22,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP__CNF_STREAM_H -#define __CVC4__PROP__CNF_STREAM_H +#ifndef CVC4__PROP__CNF_STREAM_H +#define CVC4__PROP__CNF_STREAM_H #include "context/cdinsert_hashmap.h" #include "context/cdlist.h" @@ -338,4 +338,4 @@ class TseitinCnfStream : public CnfStream { } /* CVC4::prop namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__PROP__CNF_STREAM_H */ +#endif /* CVC4__PROP__CNF_STREAM_H */ diff --git a/src/prop/cryptominisat.cpp b/src/prop/cryptominisat.cpp index 970ba13cf..62e2c5a43 100644 --- a/src/prop/cryptominisat.cpp +++ b/src/prop/cryptominisat.cpp @@ -2,9 +2,9 @@ /*! \file cryptominisat.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Mathias Preiner + ** Liana Hadarean, Mathias Preiner, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/cryptominisat.h b/src/prop/cryptominisat.h index 17cc1568c..d3c5aeb30 100644 --- a/src/prop/cryptominisat.h +++ b/src/prop/cryptominisat.h @@ -2,9 +2,9 @@ /*! \file cryptominisat.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Mathias Preiner + ** Mathias Preiner, Liana Hadarean, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP__CRYPTOMINISAT_H -#define __CVC4__PROP__CRYPTOMINISAT_H +#ifndef CVC4__PROP__CRYPTOMINISAT_H +#define CVC4__PROP__CRYPTOMINISAT_H #ifdef CVC4_USE_CRYPTOMINISAT @@ -95,4 +95,4 @@ public: } // namespace CVC4 #endif // CVC4_USE_CRYPTOMINISAT -#endif // __CVC4__PROP__CRYPTOMINISAT_H +#endif // CVC4__PROP__CRYPTOMINISAT_H diff --git a/src/prop/minisat/minisat.cpp b/src/prop/minisat/minisat.cpp index 3c11d5ad8..4995a60dd 100644 --- a/src/prop/minisat/minisat.cpp +++ b/src/prop/minisat/minisat.cpp @@ -2,9 +2,9 @@ /*! \file minisat.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters, Tim King + ** Liana Hadarean, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/minisat/minisat.h b/src/prop/minisat/minisat.h index dc42066d7..d4720def5 100644 --- a/src/prop/minisat/minisat.h +++ b/src/prop/minisat/minisat.h @@ -2,9 +2,9 @@ /*! \file minisat.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Mathias Preiner, Morgan Deters + ** Mathias Preiner, Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/prop_engine.cpp b/src/prop/prop_engine.cpp index e1200c7e5..b12573085 100644 --- a/src/prop/prop_engine.cpp +++ b/src/prop/prop_engine.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/prop_engine.h b/src/prop/prop_engine.h index 2ff862d18..aaa65b85a 100644 --- a/src/prop/prop_engine.h +++ b/src/prop/prop_engine.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP_ENGINE_H -#define __CVC4__PROP_ENGINE_H +#ifndef CVC4__PROP_ENGINE_H +#define CVC4__PROP_ENGINE_H #include <sys/time.h> @@ -248,4 +248,4 @@ public: }/* CVC4::prop namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PROP_ENGINE_H */ +#endif /* CVC4__PROP_ENGINE_H */ diff --git a/src/prop/registrar.h b/src/prop/registrar.h index 46c2cdd0d..0846b8829 100644 --- a/src/prop/registrar.h +++ b/src/prop/registrar.h @@ -2,9 +2,9 @@ /*! \file registrar.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Liana Hadarean, Morgan Deters + ** Liana Hadarean, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP__REGISTRAR_H -#define __CVC4__PROP__REGISTRAR_H +#ifndef CVC4__PROP__REGISTRAR_H +#define CVC4__PROP__REGISTRAR_H namespace CVC4 { namespace prop { @@ -42,4 +42,4 @@ public: }/* CVC4::prop namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PROP__REGISTRAR_H */ +#endif /* CVC4__PROP__REGISTRAR_H */ diff --git a/src/prop/sat_solver.h b/src/prop/sat_solver.h index 70e46eceb..45bfca4d6 100644 --- a/src/prop/sat_solver.h +++ b/src/prop/sat_solver.h @@ -2,9 +2,9 @@ /*! \file sat_solver.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Dejan Jovanovic, Morgan Deters + ** Dejan Jovanovic, Liana Hadarean, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP__SAT_SOLVER_H -#define __CVC4__PROP__SAT_SOLVER_H +#ifndef CVC4__PROP__SAT_SOLVER_H +#define CVC4__PROP__SAT_SOLVER_H #include <stdint.h> @@ -192,4 +192,4 @@ inline std::ostream& operator <<(std::ostream& out, prop::SatValue val) { }/* CVC4::prop namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__PROP__SAT_MODULE_H */ +#endif /* CVC4__PROP__SAT_MODULE_H */ diff --git a/src/prop/sat_solver_factory.cpp b/src/prop/sat_solver_factory.cpp index 81e15777d..cfab5703c 100644 --- a/src/prop/sat_solver_factory.cpp +++ b/src/prop/sat_solver_factory.cpp @@ -2,9 +2,9 @@ /*! \file sat_solver_factory.cpp ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner, Dejan Jovanovic, Tim King + ** Mathias Preiner, Liana Hadarean, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/sat_solver_factory.h b/src/prop/sat_solver_factory.h index eb588af13..5f8649768 100644 --- a/src/prop/sat_solver_factory.h +++ b/src/prop/sat_solver_factory.h @@ -2,9 +2,9 @@ /*! \file sat_solver_factory.h ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner, Dejan Jovanovic, Liana Hadarean + ** Mathias Preiner, Liana Hadarean, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP__SAT_SOLVER_FACTORY_H -#define __CVC4__PROP__SAT_SOLVER_FACTORY_H +#ifndef CVC4__PROP__SAT_SOLVER_FACTORY_H +#define CVC4__PROP__SAT_SOLVER_FACTORY_H #include <string> #include <vector> @@ -50,4 +50,4 @@ class SatSolverFactory } // namespace prop } // namespace CVC4 -#endif // __CVC4__PROP__SAT_SOLVER_FACTORY_H +#endif // CVC4__PROP__SAT_SOLVER_FACTORY_H diff --git a/src/prop/sat_solver_types.h b/src/prop/sat_solver_types.h index ed1c5397d..f1fd6233e 100644 --- a/src/prop/sat_solver_types.h +++ b/src/prop/sat_solver_types.h @@ -2,9 +2,9 @@ /*! \file sat_solver_types.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Kshitij Bansal, Liana Hadarean + ** Dejan Jovanovic, Liana Hadarean, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -26,6 +26,7 @@ #include <sstream> #include <string> +#include <unordered_set> #include <vector> namespace CVC4 { @@ -167,6 +168,21 @@ struct SatLiteralHashFunction { */ typedef std::vector<SatLiteral> SatClause; +struct SatClauseSetHashFunction +{ + inline size_t operator()( + const std::unordered_set<SatLiteral, SatLiteralHashFunction>& clause) + const + { + size_t acc = 0; + for (const auto& l : clause) + { + acc ^= l.hash(); + } + return acc; + } +}; + /** * Each object in the SAT solver, such as as variables and clauses, can be assigned a life span, * so that the SAT solver can (or should) remove them when the lifespan is over. diff --git a/src/prop/theory_proxy.cpp b/src/prop/theory_proxy.cpp index 2526830f9..f6cd42eff 100644 --- a/src/prop/theory_proxy.cpp +++ b/src/prop/theory_proxy.cpp @@ -2,9 +2,9 @@ /*! \file theory_proxy.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Guy Katz + ** Morgan Deters, Tim King, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/prop/theory_proxy.h b/src/prop/theory_proxy.h index e2923ddff..3bb15aa4e 100644 --- a/src/prop/theory_proxy.h +++ b/src/prop/theory_proxy.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,12 +16,12 @@ #include "cvc4_private.h" -#ifndef __CVC4__PROP__SAT_H -#define __CVC4__PROP__SAT_H +#ifndef CVC4__PROP__SAT_H +#define CVC4__PROP__SAT_H // Just defining this for now, since there's no other SAT solver bindings. // Optional blocks below will be unconditionally included -#define __CVC4_USE_MINISAT +#define CVC4_USE_MINISAT #include <iosfwd> #include <unordered_set> @@ -152,4 +152,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__PROP__SAT_H */ +#endif /* CVC4__PROP__SAT_H */ diff --git a/src/smt/command.cpp b/src/smt/command.cpp index 5198ea2d1..b1936d8cc 100644 --- a/src/smt/command.cpp +++ b/src/smt/command.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -1358,8 +1358,7 @@ void DefineNamedFunctionCommand::invoke(SmtEngine* smtEngine) this->DefineFunctionCommand::invoke(smtEngine); if (!d_func.isNull() && d_func.getType().isBoolean()) { - smtEngine->addToAssignment( - d_func.getExprManager()->mkExpr(kind::APPLY, d_func)); + smtEngine->addToAssignment(d_func); } d_commandStatus = CommandSuccess::instance(); } @@ -1751,14 +1750,7 @@ void GetAssignmentCommand::invoke(SmtEngine* smtEngine) for (const auto& p : assignments) { vector<SExpr> v; - if (p.first.getKind() == kind::APPLY) - { - v.emplace_back(SExpr::Keyword(p.first.getOperator().toString())); - } - else - { - v.emplace_back(SExpr::Keyword(p.first.toString())); - } + v.emplace_back(SExpr::Keyword(p.first.toString())); v.emplace_back(SExpr::Keyword(p.second.toString())); sexprs.emplace_back(v); } diff --git a/src/smt/command.h b/src/smt/command.h index f7824c1aa..68f9d1881 100644 --- a/src/smt/command.h +++ b/src/smt/command.h @@ -2,9 +2,9 @@ /*! \file command.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Andrew Reynolds + ** Tim King, Morgan Deters, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__COMMAND_H -#define __CVC4__COMMAND_H +#ifndef CVC4__COMMAND_H +#define CVC4__COMMAND_H #include <iosfwd> #include <map> @@ -1396,4 +1396,4 @@ class CVC4_PUBLIC DeclarationSequence : public CommandSequence } /* CVC4 namespace */ -#endif /* __CVC4__COMMAND_H */ +#endif /* CVC4__COMMAND_H */ diff --git a/src/smt/command_list.cpp b/src/smt/command_list.cpp index a78a01fdc..43bb6b268 100644 --- a/src/smt/command_list.cpp +++ b/src/smt/command_list.cpp @@ -2,9 +2,9 @@ /*! \file command_list.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/command_list.h b/src/smt/command_list.h index 01df7afce..0b1aaecf2 100644 --- a/src/smt/command_list.h +++ b/src/smt/command_list.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__SMT__COMMAND_LIST_H -#define __CVC4__SMT__COMMAND_LIST_H +#ifndef CVC4__SMT__COMMAND_LIST_H +#define CVC4__SMT__COMMAND_LIST_H #include "context/cdlist.h" @@ -36,4 +36,4 @@ typedef context::CDList<Command*, CommandCleanup> CommandList; }/* CVC4::smt namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__SMT__COMMAND_LIST_H */ +#endif /* CVC4__SMT__COMMAND_LIST_H */ diff --git a/src/smt/dump.cpp b/src/smt/dump.cpp index eae11606f..90c89cd3d 100644 --- a/src/smt/dump.cpp +++ b/src/smt/dump.cpp @@ -2,9 +2,9 @@ /*! \file dump.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Clark Barrett, Morgan Deters + ** Morgan Deters, Clark Barrett, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/dump.h b/src/smt/dump.h index 9de8eb0ce..4946341af 100644 --- a/src/smt/dump.h +++ b/src/smt/dump.h @@ -2,9 +2,9 @@ /*! \file dump.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__DUMP_H -#define __CVC4__DUMP_H +#ifndef CVC4__DUMP_H +#define CVC4__DUMP_H #include "base/output.h" #include "smt/command.h" @@ -110,4 +110,4 @@ extern DumpC DumpChannel CVC4_PUBLIC; }/* CVC4 namespace */ -#endif /* __CVC4__DUMP_H */ +#endif /* CVC4__DUMP_H */ diff --git a/src/smt/logic_exception.h b/src/smt/logic_exception.h index 1ce3b2e0b..e5da2a6e8 100644 --- a/src/smt/logic_exception.h +++ b/src/smt/logic_exception.h @@ -2,9 +2,9 @@ /*! \file logic_exception.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__SMT__LOGIC_EXCEPTION_H -#define __CVC4__SMT__LOGIC_EXCEPTION_H +#ifndef CVC4__SMT__LOGIC_EXCEPTION_H +#define CVC4__SMT__LOGIC_EXCEPTION_H #include "base/exception.h" @@ -44,4 +44,4 @@ class CVC4_PUBLIC LogicException : public CVC4::Exception { }/* CVC4 namespace */ -#endif /* __CVC4__SMT__LOGIC_EXCEPTION_H */ +#endif /* CVC4__SMT__LOGIC_EXCEPTION_H */ diff --git a/src/smt/logic_request.cpp b/src/smt/logic_request.cpp index c9ddad176..c24378cb1 100644 --- a/src/smt/logic_request.cpp +++ b/src/smt/logic_request.cpp @@ -2,9 +2,9 @@ /*! \file logic_request.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Mathias Preiner, Martin Brain, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/logic_request.h b/src/smt/logic_request.h index 23add1cf4..432d5469c 100644 --- a/src/smt/logic_request.h +++ b/src/smt/logic_request.h @@ -2,9 +2,9 @@ /*! \file logic_request.h ** \verbatim ** Top contributors (to current version): - ** Martin Brain, Tim King + ** Martin Brain, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__LOGIC_REQUEST_H -#define __CVC4__LOGIC_REQUEST_H +#ifndef CVC4__LOGIC_REQUEST_H +#define CVC4__LOGIC_REQUEST_H #include "expr/kind.h" @@ -49,4 +49,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__LOGIC_REQUEST_H */ +#endif /* CVC4__LOGIC_REQUEST_H */ diff --git a/src/smt/managed_ostreams.cpp b/src/smt/managed_ostreams.cpp index 300465d3d..fbc1bb242 100644 --- a/src/smt/managed_ostreams.cpp +++ b/src/smt/managed_ostreams.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/managed_ostreams.h b/src/smt/managed_ostreams.h index 32075d011..f495f8e72 100644 --- a/src/smt/managed_ostreams.h +++ b/src/smt/managed_ostreams.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__MANAGED_OSTREAMS_H -#define __CVC4__MANAGED_OSTREAMS_H +#ifndef CVC4__MANAGED_OSTREAMS_H +#define CVC4__MANAGED_OSTREAMS_H #include <ostream> @@ -179,4 +179,4 @@ class ManagedReplayLogOstream : public ManagedOstream { }/* CVC4 namespace */ -#endif /* __CVC4__MANAGED_OSTREAMS_H */ +#endif /* CVC4__MANAGED_OSTREAMS_H */ diff --git a/src/smt/model.cpp b/src/smt/model.cpp index f4b1af49a..e452905e1 100644 --- a/src/smt/model.cpp +++ b/src/smt/model.cpp @@ -2,9 +2,9 @@ /*! \file model.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andres Noetzli + ** Morgan Deters, Tim King, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/model.h b/src/smt/model.h index 3ad35fa5f..b435fb5e2 100644 --- a/src/smt/model.h +++ b/src/smt/model.h @@ -2,9 +2,9 @@ /*! \file model.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Clark Barrett + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__MODEL_H -#define __CVC4__MODEL_H +#ifndef CVC4__MODEL_H +#define CVC4__MODEL_H #include <iosfwd> #include <vector> @@ -107,4 +107,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__MODEL_H */ +#endif /* CVC4__MODEL_H */ diff --git a/src/smt/model_core_builder.cpp b/src/smt/model_core_builder.cpp index a077bb2fa..168ded839 100644 --- a/src/smt/model_core_builder.cpp +++ b/src/smt/model_core_builder.cpp @@ -2,9 +2,9 @@ /*! \file model_core_builder.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/model_core_builder.h b/src/smt/model_core_builder.h index a60a3767c..0c179e287 100644 --- a/src/smt/model_core_builder.h +++ b/src/smt/model_core_builder.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__MODEL_CORE_BUILDER_H -#define __CVC4__THEORY__MODEL_CORE_BUILDER_H +#ifndef CVC4__THEORY__MODEL_CORE_BUILDER_H +#define CVC4__THEORY__MODEL_CORE_BUILDER_H #include <vector> @@ -61,4 +61,4 @@ class ModelCoreBuilder } // namespace CVC4 -#endif /* __CVC4__THEORY__MODEL_CORE_BUILDER_H */ +#endif /* CVC4__THEORY__MODEL_CORE_BUILDER_H */ diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 99bc96916..3c232035f 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -111,6 +111,10 @@ #include "util/random.h" #include "util/resource_manager.h" +#if (IS_LFSC_BUILD && IS_PROOFS_BUILD) +#include "lfscc.h" +#endif + using namespace std; using namespace CVC4; using namespace CVC4::smt; @@ -120,6 +124,11 @@ using namespace CVC4::context; using namespace CVC4::theory; namespace CVC4 { + +namespace proof { +extern const char* const plf_signatures; +} // namespace proof + namespace smt { struct DeleteCommandFunction : public std::unary_function<const Command*, void> @@ -178,10 +187,12 @@ struct SmtEngineStatistics { IntStat d_numAssertionsPre; /** Num of assertions after ite removal */ IntStat d_numAssertionsPost; + /** Size of all proofs generated */ + IntStat d_proofsSize; /** time spent in checkModel() */ TimerStat d_checkModelTime; - /** time spent in checkProof() */ - TimerStat d_checkProofTime; + /** time spent checking the proof with LFSC */ + TimerStat d_lfscCheckProofTime; /** time spent in checkUnsatCore() */ TimerStat d_checkUnsatCoreTime; /** time spent in PropEngine::checkSat() */ @@ -199,30 +210,32 @@ struct SmtEngineStatistics { /** Number of resource units spent. */ ReferenceStat<uint64_t> d_resourceUnitsUsed; - SmtEngineStatistics() : - d_definitionExpansionTime("smt::SmtEngine::definitionExpansionTime"), - d_numConstantProps("smt::SmtEngine::numConstantProps", 0), - d_cnfConversionTime("smt::SmtEngine::cnfConversionTime"), - d_numAssertionsPre("smt::SmtEngine::numAssertionsPreITERemoval", 0), - d_numAssertionsPost("smt::SmtEngine::numAssertionsPostITERemoval", 0), - d_checkModelTime("smt::SmtEngine::checkModelTime"), - d_checkProofTime("smt::SmtEngine::checkProofTime"), - d_checkUnsatCoreTime("smt::SmtEngine::checkUnsatCoreTime"), - d_solveTime("smt::SmtEngine::solveTime"), - d_pushPopTime("smt::SmtEngine::pushPopTime"), - d_processAssertionsTime("smt::SmtEngine::processAssertionsTime"), - d_extStringFunPre("smt::SmtEngine::extStringFunPre", 0), - d_extStringFunPost("smt::SmtEngine::extStringFunPost", 0), - d_simplifiedToFalse("smt::SmtEngine::simplifiedToFalse", 0), - d_resourceUnitsUsed("smt::SmtEngine::resourceUnitsUsed") - { + SmtEngineStatistics() + : d_definitionExpansionTime("smt::SmtEngine::definitionExpansionTime"), + d_numConstantProps("smt::SmtEngine::numConstantProps", 0), + d_cnfConversionTime("smt::SmtEngine::cnfConversionTime"), + d_numAssertionsPre("smt::SmtEngine::numAssertionsPreITERemoval", 0), + d_numAssertionsPost("smt::SmtEngine::numAssertionsPostITERemoval", 0), + d_proofsSize("smt::SmtEngine::proofsSize", 0), + d_checkModelTime("smt::SmtEngine::checkModelTime"), + d_lfscCheckProofTime("smt::SmtEngine::lfscCheckProofTime"), + d_checkUnsatCoreTime("smt::SmtEngine::checkUnsatCoreTime"), + d_solveTime("smt::SmtEngine::solveTime"), + d_pushPopTime("smt::SmtEngine::pushPopTime"), + d_processAssertionsTime("smt::SmtEngine::processAssertionsTime"), + d_extStringFunPre("smt::SmtEngine::extStringFunPre", 0), + d_extStringFunPost("smt::SmtEngine::extStringFunPost", 0), + d_simplifiedToFalse("smt::SmtEngine::simplifiedToFalse", 0), + d_resourceUnitsUsed("smt::SmtEngine::resourceUnitsUsed") + { smtStatisticsRegistry()->registerStat(&d_definitionExpansionTime); smtStatisticsRegistry()->registerStat(&d_numConstantProps); smtStatisticsRegistry()->registerStat(&d_cnfConversionTime); smtStatisticsRegistry()->registerStat(&d_numAssertionsPre); smtStatisticsRegistry()->registerStat(&d_numAssertionsPost); + smtStatisticsRegistry()->registerStat(&d_proofsSize); smtStatisticsRegistry()->registerStat(&d_checkModelTime); - smtStatisticsRegistry()->registerStat(&d_checkProofTime); + smtStatisticsRegistry()->registerStat(&d_lfscCheckProofTime); smtStatisticsRegistry()->registerStat(&d_checkUnsatCoreTime); smtStatisticsRegistry()->registerStat(&d_solveTime); smtStatisticsRegistry()->registerStat(&d_pushPopTime); @@ -239,8 +252,9 @@ struct SmtEngineStatistics { smtStatisticsRegistry()->unregisterStat(&d_cnfConversionTime); smtStatisticsRegistry()->unregisterStat(&d_numAssertionsPre); smtStatisticsRegistry()->unregisterStat(&d_numAssertionsPost); + smtStatisticsRegistry()->unregisterStat(&d_proofsSize); smtStatisticsRegistry()->unregisterStat(&d_checkModelTime); - smtStatisticsRegistry()->unregisterStat(&d_checkProofTime); + smtStatisticsRegistry()->unregisterStat(&d_lfscCheckProofTime); smtStatisticsRegistry()->unregisterStat(&d_checkUnsatCoreTime); smtStatisticsRegistry()->unregisterStat(&d_solveTime); smtStatisticsRegistry()->unregisterStat(&d_pushPopTime); @@ -874,6 +888,7 @@ SmtEngine::SmtEngine(ExprManager* em) d_defineCommands(), d_logic(), d_originalOptions(), + d_isInternalSubsolver(false), d_pendingPops(0), d_fullyInited(false), d_problemExtended(false), @@ -1204,6 +1219,12 @@ void SmtEngine::setDefaults() { if(options::forceLogicString.wasSetByUser()) { d_logic = LogicInfo(options::forceLogicString()); }else if (options::solveIntAsBV() > 0) { + if (!(d_logic <= LogicInfo("QF_NIA"))) + { + throw OptionException( + "--solve-int-as-bv=X only supported for pure integer logics (QF_NIA, " + "QF_LIA, QF_IDL)"); + } d_logic = LogicInfo("QF_BV"); }else if (d_logic.getLogicString() == "QF_NRA" && options::solveRealAsInt()) { d_logic = LogicInfo("QF_NIA"); @@ -1253,16 +1274,20 @@ void SmtEngine::setDefaults() { } // sygus inference may require datatypes - if (options::sygusInference() || options::sygusRewSynthInput()) + if (!d_isInternalSubsolver) { - d_logic = d_logic.getUnlockedCopy(); - // sygus requires arithmetic, datatypes and quantifiers - d_logic.enableTheory(THEORY_ARITH); - d_logic.enableTheory(THEORY_DATATYPES); - d_logic.enableTheory(THEORY_QUANTIFIERS); - d_logic.lock(); - // since we are trying to recast as sygus, we assume the input is sygus - is_sygus = true; + if (options::sygusInference() || options::sygusRewSynthInput() + || options::sygusAbduct()) + { + d_logic = d_logic.getUnlockedCopy(); + // sygus requires arithmetic, datatypes and quantifiers + d_logic.enableTheory(THEORY_ARITH); + d_logic.enableTheory(THEORY_DATATYPES); + d_logic.enableTheory(THEORY_QUANTIFIERS); + d_logic.lock(); + // since we are trying to recast as sygus, we assume the input is sygus + is_sygus = true; + } } if ((options::checkModels() || options::checkSynthSol() @@ -1947,8 +1972,16 @@ void SmtEngine::setDefaults() { options::sygusExtRew.set(false); } } + if (options::sygusAbduct()) + { + // if doing abduction, we should filter strong solutions + if (!options::sygusFilterSolMode.wasSetByUser()) + { + options::sygusFilterSolMode.set(quantifiers::SYGUS_FILTER_SOL_STRONG); + } + } if (options::sygusRewSynth() || options::sygusRewVerify() - || options::sygusQueryGen()) + || options::sygusQueryGen() || options::sygusAbduct()) { // rewrite rule synthesis implies that sygus stream must be true options::sygusStream.set(true); @@ -1956,8 +1989,9 @@ void SmtEngine::setDefaults() { if (options::sygusStream()) { // Streaming is incompatible with techniques that focus the search towards - // finding a single solution. This currently includes the PBE solver and - // static template inference for invariant synthesis. + // finding a single solution. This currently includes the PBE solver, + // static template inference for invariant synthesis, and single + // invocation techniques. if (!options::sygusUnifPbe.wasSetByUser()) { options::sygusUnifPbe.set(false); @@ -1971,6 +2005,10 @@ void SmtEngine::setDefaults() { { options::sygusInvTemplMode.set(quantifiers::SYGUS_INV_TEMPL_MODE_NONE); } + if (!options::cegqiSingleInvMode.wasSetByUser()) + { + options::cegqiSingleInvMode.set(quantifiers::CEGQI_SI_MODE_NONE); + } } //do not allow partial functions if( !options::bitvectorDivByZeroConst.wasSetByUser() ){ @@ -2271,11 +2309,13 @@ void SmtEngine::setDefaults() { "--sygus-expr-miner-check-timeout=N requires " "--sygus-expr-miner-check-use-export"); } - if (options::sygusRewSynthInput()) + if (options::sygusRewSynthInput() || options::sygusAbduct()) { - throw OptionException( - "--sygus-rr-synth-input requires " - "--sygus-expr-miner-check-use-export"); + std::stringstream ss; + ss << (options::sygusRewSynthInput() ? "--sygus-rr-synth-input" + : "--sygus-abduct"); + ss << "requires --sygus-expr-miner-check-use-export"; + throw OptionException(ss.str()); } } @@ -2703,13 +2743,20 @@ Node SmtEnginePrivate::expandDefinitions(TNode n, unordered_map<Node, Node, Node if(n.isVar()) { SmtEngine::DefinedFunctionMap::const_iterator i = d_smt.d_definedFunctions->find(n); if(i != d_smt.d_definedFunctions->end()) { + Node f = (*i).second.getFormula(); + // must expand its definition + Node fe = expandDefinitions(f, cache, expandOnly); // replacement must be closed if((*i).second.getFormals().size() > 0) { - result.push(d_smt.d_nodeManager->mkNode(kind::LAMBDA, d_smt.d_nodeManager->mkNode(kind::BOUND_VAR_LIST, (*i).second.getFormals()), (*i).second.getFormula())); + result.push(d_smt.d_nodeManager->mkNode( + kind::LAMBDA, + d_smt.d_nodeManager->mkNode(kind::BOUND_VAR_LIST, + (*i).second.getFormals()), + fe)); continue; } // don't bother putting in the cache - result.push((*i).second.getFormula()); + result.push(fe); continue; } // don't bother putting in the cache @@ -2727,11 +2774,7 @@ Node SmtEnginePrivate::expandDefinitions(TNode n, unordered_map<Node, Node, Node // otherwise expand it bool doExpand = false; - if (k == kind::APPLY) - { - doExpand = true; - } - else if (k == kind::APPLY_UF) + if (k == kind::APPLY_UF) { // Always do beta-reduction here. The reason is that there may be // operators such as INTS_MODULUS in the body of the lambda that would @@ -2744,10 +2787,9 @@ Node SmtEnginePrivate::expandDefinitions(TNode n, unordered_map<Node, Node, Node { doExpand = true; } - else if (options::macrosQuant() || options::sygusInference()) + else { - // The above options assign substitutions to APPLY_UF, thus we check - // here and expand if this operator corresponds to a defined function. + // We always check if this operator corresponds to a defined function. doExpand = d_smt.isDefinedFunction(n.getOperator().toExpr()); } } @@ -3163,6 +3205,13 @@ void SmtEnginePrivate::processAssertions() { return; } + if (options::extRewPrepOnly()) + { + d_passes["ext-rew-pre"]->apply(&d_assertions); + dumpAssertions("post-everything", d_assertions); + return; + } + if (options::bvGaussElim()) { d_passes["bv-gauss"]->apply(&d_assertions); @@ -3353,10 +3402,6 @@ void SmtEnginePrivate::processAssertions() { d_smt.d_fmfRecFunctionsDefined->push_back( f ); } } - if (options::sygusInference()) - { - d_passes["sygus-infer"]->apply(&d_assertions); - } } if( options::sortInference() || options::ufssFairnessMonotone() ){ @@ -3367,10 +3412,22 @@ void SmtEnginePrivate::processAssertions() { d_passes["pseudo-boolean-processor"]->apply(&d_assertions); } - if (options::sygusRewSynthInput()) + // rephrasing normal inputs as sygus problems + if (!d_smt.d_isInternalSubsolver) { - // do candidate rewrite rule synthesis - d_passes["synth-rr"]->apply(&d_assertions); + if (options::sygusInference()) + { + d_passes["sygus-infer"]->apply(&d_assertions); + } + else if (options::sygusAbduct()) + { + d_passes["sygus-abduct"]->apply(&d_assertions); + } + else if (options::sygusRewSynthInput()) + { + // do candidate rewrite rule synthesis + d_passes["synth-rr"]->apply(&d_assertions); + } } Trace("smt-proc") << "SmtEnginePrivate::processAssertions() : pre-simplify" << endl; @@ -3612,8 +3669,10 @@ Result SmtEngine::checkSat(const vector<Expr>& assumptions, bool inUnsatCore) Result SmtEngine::query(const Expr& assumption, bool inUnsatCore) { - Assert(!assumption.isNull()); - return checkSatisfiability(assumption, inUnsatCore, true); + return checkSatisfiability( + assumption.isNull() ? std::vector<Expr>() : std::vector<Expr>{assumption}, + inUnsatCore, + true); } Result SmtEngine::query(const vector<Expr>& assumptions, bool inUnsatCore) @@ -3626,7 +3685,7 @@ Result SmtEngine::checkSatisfiability(const Expr& expr, bool isQuery) { return checkSatisfiability( - expr.isNull() ? vector<Expr>() : vector<Expr>{expr}, + expr.isNull() ? std::vector<Expr>() : std::vector<Expr>{expr}, inUnsatCore, isQuery); } @@ -3779,7 +3838,6 @@ Result SmtEngine::checkSatisfiability(const vector<Expr>& assumptions, // Check that UNSAT results generate a proof correctly. if(options::checkProofs()) { if(r.asSatisfiabilityResult().isSat() == Result::UNSAT) { - TimerStat::CodeTimer checkProofTimer(d_stats->d_checkProofTime); checkProof(); } } @@ -3987,8 +4045,7 @@ void SmtEngine::assertSygusInvConstraint(const Expr& inv, { children.insert(children.end(), vars.begin(), vars.end()); } - terms[i] = - d_nodeManager->mkNode(i == 0 ? kind::APPLY_UF : kind::APPLY, children); + terms[i] = d_nodeManager->mkNode(kind::APPLY_UF, children); // make application of Inv on primed variables if (i == 0) { @@ -4236,15 +4293,15 @@ bool SmtEngine::addToAssignment(const Expr& ex) { "expected Boolean-typed variable or function application " "in addToAssignment()" ); Node n = e.getNode(); - // must be an APPLY of a zero-ary defined function, or a variable + // must be a defined constant, or a variable PrettyCheckArgument( - ( ( n.getKind() == kind::APPLY && - ( d_definedFunctions->find(n.getOperator()) != - d_definedFunctions->end() ) && - n.getNumChildren() == 0 ) || - n.isVar() ), e, + (((d_definedFunctions->find(n) != d_definedFunctions->end()) + && n.getNumChildren() == 0) + || n.isVar()), + e, "expected variable or defined-function application " - "in addToAssignment(),\ngot %s", e.toString().c_str() ); + "in addToAssignment(),\ngot %s", + e.toString().c_str()); if(!options::produceAssignments()) { return false; } @@ -4313,8 +4370,7 @@ vector<pair<Expr, Expr>> SmtEngine::getAssignment() // ensure it's a constant Assert(resultNode.isConst()); - Assert(as.getKind() == kind::APPLY || as.isVar()); - Assert(as.getKind() != kind::APPLY || as.getNumChildren() == 0); + Assert(as.isVar()); res.emplace_back(as.toExpr(), resultNode.toExpr()); } } @@ -4434,6 +4490,57 @@ Expr SmtEngine::getSepHeapExpr() { return getSepHeapAndNilExpr().first; } Expr SmtEngine::getSepNilExpr() { return getSepHeapAndNilExpr().second; } +void SmtEngine::checkProof() +{ +#if (IS_LFSC_BUILD && IS_PROOFS_BUILD) + + Chat() << "generating proof..." << endl; + + const Proof& pf = getProof(); + + Chat() << "checking proof..." << endl; + + std::string logicString = d_logic.getLogicString(); + + if (!( + // Pure logics + logicString == "QF_UF" || logicString == "QF_AX" + || logicString == "QF_BV" || + // Non-pure logics + logicString == "QF_AUF" || logicString == "QF_UFBV" + || logicString == "QF_ABV" || logicString == "QF_AUFBV")) + { + // This logic is not yet supported + Notice() << "Notice: no proof-checking for " << logicString << " proofs yet" + << endl; + return; + } + + std::stringstream pfStream; + + pfStream << proof::plf_signatures << endl; + int64_t sizeBeforeProof = static_cast<int64_t>(pfStream.tellp()); + + pf.toStream(pfStream); + d_stats->d_proofsSize += + static_cast<int64_t>(pfStream.tellp()) - sizeBeforeProof; + + { + TimerStat::CodeTimer checkProofTimer(d_stats->d_lfscCheckProofTime); + lfscc_init(); + lfscc_check_file(pfStream, false, false, false, false, false, false, false); + } + // FIXME: we should actually call lfscc_cleanup here, but lfscc_cleanup + // segfaults on regress0/bv/core/bitvec7.smt + // lfscc_cleanup(); + +#else /* (IS_LFSC_BUILD && IS_PROOFS_BUILD) */ + Unreachable( + "This version of CVC4 was built without proof support; cannot check " + "proofs."); +#endif /* (IS_LFSC_BUILD && IS_PROOFS_BUILD) */ +} + UnsatCore SmtEngine::getUnsatCoreInternal() { #if IS_PROOFS_BUILD @@ -5292,6 +5399,7 @@ void SmtEngine::setOption(const std::string& key, const CVC4::SExpr& value) nodeManagerOptions.setOption(key, optionarg); } +void SmtEngine::setIsInternalSubsolver() { d_isInternalSubsolver = true; } CVC4::SExpr SmtEngine::getOption(const std::string& key) const { NodeManagerScope nms(d_nodeManager); diff --git a/src/smt/smt_engine.h b/src/smt/smt_engine.h index e53d1eb55..165e93997 100644 --- a/src/smt/smt_engine.h +++ b/src/smt/smt_engine.h @@ -2,9 +2,9 @@ /*! \file smt_engine.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Morgan Deters, Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__SMT_ENGINE_H -#define __CVC4__SMT_ENGINE_H +#ifndef CVC4__SMT_ENGINE_H +#define CVC4__SMT_ENGINE_H #include <string> #include <vector> @@ -209,6 +209,9 @@ class CVC4_PUBLIC SmtEngine { */ Options d_originalOptions; + /** whether this is an internal subsolver */ + bool d_isInternalSubsolver; + /** * Number of internal pops that have been deferred. */ @@ -502,6 +505,15 @@ class CVC4_PUBLIC SmtEngine { void setOption(const std::string& key, const CVC4::SExpr& value) /* throw(OptionException, ModalException) */; + /** Set is internal subsolver. + * + * This function is called on SmtEngine objects that are created internally. + * It is used to mark that this SmtEngine should not perform preprocessing + * passes that rephrase the input, such as --sygus-rr-synth-input or + * --sygus-abduct. + */ + void setIsInternalSubsolver(); + /** sets the input name */ void setFilename(std::string filename); /** return the input name (if any) */ @@ -1052,4 +1064,4 @@ class CVC4_PUBLIC SmtEngine { }/* CVC4 namespace */ -#endif /* __CVC4__SMT_ENGINE_H */ +#endif /* CVC4__SMT_ENGINE_H */ diff --git a/src/smt/smt_engine_check_proof.cpp b/src/smt/smt_engine_check_proof.cpp deleted file mode 100644 index c86ec7a89..000000000 --- a/src/smt/smt_engine_check_proof.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/********************* */ -/*! \file smt_engine_check_proof.cpp - ** \verbatim - ** Top contributors (to current version): - ** Morgan Deters, Mark Laws, Guy Katz - ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS - ** in the top-level source directory) and their institutional affiliations. - ** All rights reserved. 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 - **/ - -#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) -#include <io.h> -#endif -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> - -#include <cstdlib> -#include <cstring> -#include <fstream> -#include <string> - -#include "base/configuration_private.h" -#include "base/cvc4_assert.h" -#include "base/output.h" -#include "smt/smt_engine.h" -#include "util/proof.h" -#include "util/statistics_registry.h" - -#if (IS_LFSC_BUILD && IS_PROOFS_BUILD) -#include "lfscc.h" -#endif - -using namespace CVC4; -using namespace std; - -namespace CVC4 { - -namespace proof { - extern const char *const plf_signatures; -}/* CVC4::proof namespace */ - -namespace smt { - -class UnlinkProofFile { - string d_filename; -public: - UnlinkProofFile(const char* filename) : d_filename(filename) {} - ~UnlinkProofFile() { unlink(d_filename.c_str()); } -};/* class UnlinkProofFile */ - -}/* CVC4::smt namespace */ - -}/* CVC4 namespace */ - -void SmtEngine::checkProof() { - -#if (IS_LFSC_BUILD && IS_PROOFS_BUILD) - - Chat() << "generating proof..." << endl; - - const Proof& pf = getProof(); - - Chat() << "checking proof..." << endl; - - std::string logicString = d_logic.getLogicString(); - - if (!( - // Pure logics - logicString == "QF_UF" || - logicString == "QF_AX" || - logicString == "QF_BV" || - // Non-pure logics - logicString == "QF_AUF" || - logicString == "QF_UFBV" || - logicString == "QF_ABV" || - logicString == "QF_AUFBV" - )) { - // This logic is not yet supported - Notice() << "Notice: no proof-checking for " << logicString << " proofs yet" << endl; - return; - } - - char *pfFile = tempnam(NULL, "cvc4_"); - if (!pfFile) { - Notice() << "Error: couldn't get path from tempnam() during proof checking" << endl; - return; - } -#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) - int fd = _open(pfFile, - _O_CREAT | _O_EXCL | _O_SHORT_LIVED | _O_RDWR, - _S_IREAD | _S_IWRITE); -#else - mode_t openmode = S_IRUSR | S_IWUSR; - int fd = open(pfFile, O_CREAT | O_EXCL | O_RDWR, openmode); -#endif - if (fd == -1) { - free(pfFile); - Notice() << "Error: failed to open temporary file during proof checking" << endl; - return; - } - - // ensure this temp file is removed after - smt::UnlinkProofFile unlinker(pfFile); - - ofstream pfStream(pfFile); - pfStream << proof::plf_signatures << endl; - pf.toStream(pfStream); - pfStream.close(); - lfscc_init(); - lfscc_check_file(pfFile, false, false, false, false, false, false, false); - // FIXME: we should actually call lfscc_cleanup here, but lfscc_cleanup - // segfaults on regress0/bv/core/bitvec7.smt - //lfscc_cleanup(); - free(pfFile); - close(fd); - -#else /* (IS_LFSC_BUILD && IS_PROOFS_BUILD) */ - Unreachable("This version of CVC4 was built without proof support; cannot check proofs."); -#endif /* (IS_LFSC_BUILD && IS_PROOFS_BUILD) */ -} diff --git a/src/smt/smt_engine_scope.cpp b/src/smt/smt_engine_scope.cpp index a4a0967b2..c16278962 100644 --- a/src/smt/smt_engine_scope.cpp +++ b/src/smt/smt_engine_scope.cpp @@ -2,9 +2,9 @@ /*! \file smt_engine_scope.cpp ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli, Morgan Deters + ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/smt_engine_scope.h b/src/smt/smt_engine_scope.h index 8e40d54ff..d72d58caa 100644 --- a/src/smt/smt_engine_scope.h +++ b/src/smt/smt_engine_scope.h @@ -2,9 +2,9 @@ /*! \file smt_engine_scope.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andres Noetzli, Tim King + ** Andres Noetzli, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__SMT__SMT_ENGINE_SCOPE_H -#define __CVC4__SMT__SMT_ENGINE_SCOPE_H +#ifndef CVC4__SMT__SMT_ENGINE_SCOPE_H +#define CVC4__SMT__SMT_ENGINE_SCOPE_H #include "expr/node_manager.h" @@ -56,4 +56,4 @@ public: }/* CVC4::smt namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__SMT__SMT_ENGINE_SCOPE_H */ +#endif /* CVC4__SMT__SMT_ENGINE_SCOPE_H */ diff --git a/src/smt/smt_statistics_registry.cpp b/src/smt/smt_statistics_registry.cpp index 2584ac404..1912b0eb2 100644 --- a/src/smt/smt_statistics_registry.cpp +++ b/src/smt/smt_statistics_registry.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/smt_statistics_registry.h b/src/smt/smt_statistics_registry.h index 9a8e61101..e6932a084 100644 --- a/src/smt/smt_statistics_registry.h +++ b/src/smt/smt_statistics_registry.h @@ -2,9 +2,9 @@ /*! \file smt_statistics_registry.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/term_formula_removal.cpp b/src/smt/term_formula_removal.cpp index 2e18899a2..d37ed05e1 100644 --- a/src/smt/term_formula_removal.cpp +++ b/src/smt/term_formula_removal.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -84,9 +84,13 @@ Node RemoveTermFormulas::run(TNode node, std::vector<Node>& output, TypeNode nodeType = node.getType(); Node skolem; Node newAssertion; - if(node.getKind() == kind::ITE) { - // If an ITE, replace it - if (!nodeType.isBoolean() && (!inQuant || !expr::hasBoundVar(node))) + // Handle non-Boolean ITEs here. Boolean ones (within terms) are handled + // in the "non-variable Boolean term within term" case below. + if (node.getKind() == kind::ITE && !nodeType.isBoolean()) + { + // Here, we eliminate the ITE if we are not Boolean and if we do not contain + // a bound variable. + if (!inQuant || !expr::hasBoundVar(node)) { skolem = getSkolemForNode(node); if (skolem.isNull()) @@ -163,13 +167,15 @@ Node RemoveTermFormulas::run(TNode node, std::vector<Node>& output, && inTerm && !inQuant) { - // if a non-variable Boolean term, replace it + // if a non-variable Boolean term within another term, replace it skolem = getSkolemForNode(node); if (skolem.isNull()) { // Make the skolem to represent the Boolean term - // skolem = nodeManager->mkSkolem("termBT", nodeType, "a variable - // introduced due to Boolean term removal"); + // Skolems introduced for Boolean formulas appearing in terms have a + // special kind (BOOLEAN_TERM_VARIABLE) that ensures they are handled + // properly in theory combination. We must use this kind here instead of a + // generic skolem. skolem = nodeManager->mkBooleanTermVariable(); d_skolem_cache.insert(node, skolem); @@ -201,9 +207,7 @@ Node RemoveTermFormulas::run(TNode node, std::vector<Node>& output, return skolem; } - if (node.getKind() == kind::FORALL || node.getKind() == kind::EXISTS - || node.getKind() == kind::LAMBDA - || node.getKind() == kind::CHOICE) + if (node.isClosure()) { // Remember if we're inside a quantifier inQuant = true; @@ -263,9 +267,7 @@ Node RemoveTermFormulas::replace(TNode node, bool inQuant, bool inTerm) const { return cached.isNull() ? Node(node) : cached; } - if (node.getKind() == kind::FORALL || node.getKind() == kind::EXISTS - || node.getKind() == kind::LAMBDA - || node.getKind() == kind::CHOICE) + if (node.isClosure()) { // Remember if we're inside a quantifier inQuant = true; diff --git a/src/smt/term_formula_removal.h b/src/smt/term_formula_removal.h index 27a15429b..b6456bda6 100644 --- a/src/smt/term_formula_removal.h +++ b/src/smt/term_formula_removal.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt/update_ostream.h b/src/smt/update_ostream.h index 06bce33a8..0427f4058 100644 --- a/src/smt/update_ostream.h +++ b/src/smt/update_ostream.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__UPDATE_OSTREAM_H -#define __CVC4__UPDATE_OSTREAM_H +#ifndef CVC4__UPDATE_OSTREAM_H +#define CVC4__UPDATE_OSTREAM_H #include <ostream> @@ -121,4 +121,4 @@ class TraceOstreamUpdate : public OstreamUpdate { }/* CVC4 namespace */ -#endif /* __CVC4__UPDATE_OSTREAM_H */ +#endif /* CVC4__UPDATE_OSTREAM_H */ diff --git a/src/smt_util/boolean_simplification.cpp b/src/smt_util/boolean_simplification.cpp index 190de2a97..199841279 100644 --- a/src/smt_util/boolean_simplification.cpp +++ b/src/smt_util/boolean_simplification.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt_util/boolean_simplification.h b/src/smt_util/boolean_simplification.h index 8e4d8aa25..c1e2e4d76 100644 --- a/src/smt_util/boolean_simplification.h +++ b/src/smt_util/boolean_simplification.h @@ -2,9 +2,9 @@ /*! \file boolean_simplification.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BOOLEAN_SIMPLIFICATION_H -#define __CVC4__BOOLEAN_SIMPLIFICATION_H +#ifndef CVC4__BOOLEAN_SIMPLIFICATION_H +#define CVC4__BOOLEAN_SIMPLIFICATION_H #include <vector> #include <algorithm> @@ -238,4 +238,4 @@ class BooleanSimplification { }/* CVC4 namespace */ -#endif /* __CVC4__BOOLEAN_SIMPLIFICATION_H */ +#endif /* CVC4__BOOLEAN_SIMPLIFICATION_H */ diff --git a/src/smt_util/lemma_channels.cpp b/src/smt_util/lemma_channels.cpp index 057b1bac2..d65a2596e 100644 --- a/src/smt_util/lemma_channels.cpp +++ b/src/smt_util/lemma_channels.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt_util/lemma_channels.h b/src/smt_util/lemma_channels.h index b2af0dfe4..40c58dd24 100644 --- a/src/smt_util/lemma_channels.h +++ b/src/smt_util/lemma_channels.h @@ -2,9 +2,9 @@ /*! \file lemma_channels.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -25,8 +25,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__SMT_UTIL__LEMMA_CHANNELS_H -#define __CVC4__SMT_UTIL__LEMMA_CHANNELS_H +#ifndef CVC4__SMT_UTIL__LEMMA_CHANNELS_H +#define CVC4__SMT_UTIL__LEMMA_CHANNELS_H #include <iosfwd> #include <string> @@ -74,4 +74,4 @@ class CVC4_PUBLIC LemmaChannels { } /* namespace CVC4 */ -#endif /* __CVC4__SMT_UTIL__LEMMA_CHANNELS_H */ +#endif /* CVC4__SMT_UTIL__LEMMA_CHANNELS_H */ diff --git a/src/smt_util/lemma_input_channel.h b/src/smt_util/lemma_input_channel.h index 1247d74b9..16bb457c8 100644 --- a/src/smt_util/lemma_input_channel.h +++ b/src/smt_util/lemma_input_channel.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__LEMMA_INPUT_CHANNEL_H -#define __CVC4__LEMMA_INPUT_CHANNEL_H +#ifndef CVC4__LEMMA_INPUT_CHANNEL_H +#define CVC4__LEMMA_INPUT_CHANNEL_H #include "expr/expr.h" @@ -35,4 +35,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__LEMMA_INPUT_CHANNEL_H */ +#endif /* CVC4__LEMMA_INPUT_CHANNEL_H */ diff --git a/src/smt_util/lemma_output_channel.h b/src/smt_util/lemma_output_channel.h index b38c757f1..e2218775d 100644 --- a/src/smt_util/lemma_output_channel.h +++ b/src/smt_util/lemma_output_channel.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__LEMMA_OUTPUT_CHANNEL_H -#define __CVC4__LEMMA_OUTPUT_CHANNEL_H +#ifndef CVC4__LEMMA_OUTPUT_CHANNEL_H +#define CVC4__LEMMA_OUTPUT_CHANNEL_H #include "expr/expr.h" @@ -43,4 +43,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__LEMMA_OUTPUT_CHANNEL_H */ +#endif /* CVC4__LEMMA_OUTPUT_CHANNEL_H */ diff --git a/src/smt_util/nary_builder.cpp b/src/smt_util/nary_builder.cpp index e527e4c24..2c2256d47 100644 --- a/src/smt_util/nary_builder.cpp +++ b/src/smt_util/nary_builder.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt_util/nary_builder.h b/src/smt_util/nary_builder.h index 809286bce..889591909 100644 --- a/src/smt_util/nary_builder.h +++ b/src/smt_util/nary_builder.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/smt_util/node_visitor.h b/src/smt_util/node_visitor.h index 31a436f81..58070c0b2 100644 --- a/src/smt_util/node_visitor.h +++ b/src/smt_util/node_visitor.h @@ -2,9 +2,9 @@ /*! \file node_visitor.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Liana Hadarean, Morgan Deters + ** Dejan Jovanovic, Morgan Deters, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/approx_simplex.cpp b/src/theory/arith/approx_simplex.cpp index bc7efdaf7..e621131d5 100644 --- a/src/theory/arith/approx_simplex.cpp +++ b/src/theory/arith/approx_simplex.cpp @@ -2,9 +2,9 @@ /*! \file approx_simplex.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andres Noetzli, Morgan Deters + ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/approx_simplex.h b/src/theory/arith/approx_simplex.h index a0982169d..2914c2da8 100644 --- a/src/theory/arith/approx_simplex.h +++ b/src/theory/arith/approx_simplex.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/arith_ite_utils.cpp b/src/theory/arith/arith_ite_utils.cpp index 5b51e162d..3980b41b8 100644 --- a/src/theory/arith/arith_ite_utils.cpp +++ b/src/theory/arith/arith_ite_utils.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Aina Niemetz, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/arith_ite_utils.h b/src/theory/arith/arith_ite_utils.h index 2c6a30758..a9e7aa92c 100644 --- a/src/theory/arith/arith_ite_utils.h +++ b/src/theory/arith/arith_ite_utils.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,8 +19,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__ARITH_ITE_UTILS_H -#define __CVC4__THEORY__ARITH__ARITH_ITE_UTILS_H +#ifndef CVC4__THEORY__ARITH__ARITH_ITE_UTILS_H +#define CVC4__THEORY__ARITH__ARITH_ITE_UTILS_H #include <unordered_map> @@ -115,4 +115,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__ARITH_ITE_UTILS_H */ +#endif /* CVC4__THEORY__ARITH__ARITH_ITE_UTILS_H */ diff --git a/src/theory/arith/arith_msum.cpp b/src/theory/arith/arith_msum.cpp index f08b4c0ba..7f13ce07d 100644 --- a/src/theory/arith/arith_msum.cpp +++ b/src/theory/arith/arith_msum.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/arith_msum.h b/src/theory/arith/arith_msum.h index 195db38c9..8a9dbf791 100644 --- a/src/theory/arith/arith_msum.h +++ b/src/theory/arith/arith_msum.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__MSUM_H -#define __CVC4__THEORY__ARITH__MSUM_H +#ifndef CVC4__THEORY__ARITH__MSUM_H +#define CVC4__THEORY__ARITH__MSUM_H #include <map> @@ -185,4 +185,4 @@ class ArithMSum } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__MSUM_H */ +#endif /* CVC4__THEORY__ARITH__MSUM_H */ diff --git a/src/theory/arith/arith_rewriter.cpp b/src/theory/arith/arith_rewriter.cpp index c3327e620..267fcc383 100644 --- a/src/theory/arith/arith_rewriter.cpp +++ b/src/theory/arith/arith_rewriter.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/arith_rewriter.h b/src/theory/arith/arith_rewriter.h index 7d137bdfd..de6b3f228 100644 --- a/src/theory/arith/arith_rewriter.h +++ b/src/theory/arith/arith_rewriter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__ARITH_REWRITER_H -#define __CVC4__THEORY__ARITH__ARITH_REWRITER_H +#ifndef CVC4__THEORY__ARITH__ARITH_REWRITER_H +#define CVC4__THEORY__ARITH__ARITH_REWRITER_H #include "theory/theory.h" #include "theory/rewriter.h" @@ -76,4 +76,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__ARITH_REWRITER_H */ +#endif /* CVC4__THEORY__ARITH__ARITH_REWRITER_H */ diff --git a/src/theory/arith/arith_static_learner.cpp b/src/theory/arith/arith_static_learner.cpp index 4bfc1a4f9..2138b513e 100644 --- a/src/theory/arith/arith_static_learner.cpp +++ b/src/theory/arith/arith_static_learner.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/arith_static_learner.h b/src/theory/arith/arith_static_learner.h index a6b57411b..bc77f8ec0 100644 --- a/src/theory/arith/arith_static_learner.h +++ b/src/theory/arith/arith_static_learner.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__ARITH_STATIC_LEARNER_H -#define __CVC4__THEORY__ARITH__ARITH_STATIC_LEARNER_H +#ifndef CVC4__THEORY__ARITH__ARITH_STATIC_LEARNER_H +#define CVC4__THEORY__ARITH__ARITH_STATIC_LEARNER_H #include <set> @@ -72,4 +72,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__ARITH_STATIC_LEARNER_H */ +#endif /* CVC4__THEORY__ARITH__ARITH_STATIC_LEARNER_H */ diff --git a/src/theory/arith/arith_utilities.h b/src/theory/arith/arith_utilities.h index 14c7fcefe..c8e92dfd3 100644 --- a/src/theory/arith/arith_utilities.h +++ b/src/theory/arith/arith_utilities.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__ARITH_UTILITIES_H -#define __CVC4__THEORY__ARITH__ARITH_UTILITIES_H +#ifndef CVC4__THEORY__ARITH__ARITH_UTILITIES_H +#define CVC4__THEORY__ARITH__ARITH_UTILITIES_H #include <unordered_map> #include <unordered_set> @@ -307,4 +307,4 @@ inline Node mkPi() }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__ARITH_UTILITIES_H */ +#endif /* CVC4__THEORY__ARITH__ARITH_UTILITIES_H */ diff --git a/src/theory/arith/arithvar.cpp b/src/theory/arith/arithvar.cpp index 8ac72276d..2eb349984 100644 --- a/src/theory/arith/arithvar.cpp +++ b/src/theory/arith/arithvar.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/arithvar.h b/src/theory/arith/arithvar.h index cb1fb7b5f..9ab452947 100644 --- a/src/theory/arith/arithvar.h +++ b/src/theory/arith/arithvar.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/arithvar_node_map.h b/src/theory/arith/arithvar_node_map.h index 0606eb65d..03b061504 100644 --- a/src/theory/arith/arithvar_node_map.h +++ b/src/theory/arith/arithvar_node_map.h @@ -2,9 +2,9 @@ /*! \file arithvar_node_map.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Dejan Jovanovic + ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__ARITHVAR_NODE_MAP_H -#define __CVC4__THEORY__ARITH__ARITHVAR_NODE_MAP_H +#ifndef CVC4__THEORY__ARITH__ARITHVAR_NODE_MAP_H +#define CVC4__THEORY__ARITH__ARITHVAR_NODE_MAP_H #include "theory/arith/arithvar.h" @@ -92,4 +92,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__ARITHVAR_NODE_MAP_H */ +#endif /* CVC4__THEORY__ARITH__ARITHVAR_NODE_MAP_H */ diff --git a/src/theory/arith/attempt_solution_simplex.cpp b/src/theory/arith/attempt_solution_simplex.cpp index 025571650..f269847de 100644 --- a/src/theory/arith/attempt_solution_simplex.cpp +++ b/src/theory/arith/attempt_solution_simplex.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/attempt_solution_simplex.h b/src/theory/arith/attempt_solution_simplex.h index 7e5b41936..1fd8ee146 100644 --- a/src/theory/arith/attempt_solution_simplex.h +++ b/src/theory/arith/attempt_solution_simplex.h @@ -2,9 +2,9 @@ /*! \file attempt_solution_simplex.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Mathias Preiner + ** Tim King, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/bound_counts.h b/src/theory/arith/bound_counts.h index 7debbad13..7bd69190e 100644 --- a/src/theory/arith/bound_counts.h +++ b/src/theory/arith/bound_counts.h @@ -2,9 +2,9 @@ /*! \file bound_counts.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Clark Barrett + ** Tim King, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/callbacks.cpp b/src/theory/arith/callbacks.cpp index 86240b949..a11dd729b 100644 --- a/src/theory/arith/callbacks.cpp +++ b/src/theory/arith/callbacks.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/callbacks.h b/src/theory/arith/callbacks.h index 8b79ff659..ee39c76f9 100644 --- a/src/theory/arith/callbacks.h +++ b/src/theory/arith/callbacks.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Mathias Preiner, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/congruence_manager.cpp b/src/theory/arith/congruence_manager.cpp index bf251660d..ce45141ef 100644 --- a/src/theory/arith/congruence_manager.cpp +++ b/src/theory/arith/congruence_manager.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Paul Meng, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/congruence_manager.h b/src/theory/arith/congruence_manager.h index 11c229399..bccd2e943 100644 --- a/src/theory/arith/congruence_manager.h +++ b/src/theory/arith/congruence_manager.h @@ -2,9 +2,9 @@ /*! \file congruence_manager.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Paul Meng, Mathias Preiner + ** Tim King, Mathias Preiner, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/constraint.cpp b/src/theory/arith/constraint.cpp index 297e3de37..c7251d4c4 100644 --- a/src/theory/arith/constraint.cpp +++ b/src/theory/arith/constraint.cpp @@ -2,9 +2,9 @@ /*! \file constraint.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters + ** Tim King, Alex Ozdemir, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/constraint.h b/src/theory/arith/constraint.h index 51575bb2f..f2c0c4b02 100644 --- a/src/theory/arith/constraint.h +++ b/src/theory/arith/constraint.h @@ -2,9 +2,9 @@ /*! \file constraint.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters + ** Tim King, Alex Ozdemir, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -72,8 +72,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__CONSTRAINT_H -#define __CVC4__THEORY__ARITH__CONSTRAINT_H +#ifndef CVC4__THEORY__ARITH__CONSTRAINT_H +#define CVC4__THEORY__ARITH__CONSTRAINT_H #include <unordered_map> #include <list> @@ -1209,4 +1209,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__CONSTRAINT_H */ +#endif /* CVC4__THEORY__ARITH__CONSTRAINT_H */ diff --git a/src/theory/arith/constraint_forward.h b/src/theory/arith/constraint_forward.h index b08b572be..5f3f2251d 100644 --- a/src/theory/arith/constraint_forward.h +++ b/src/theory/arith/constraint_forward.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ ** minimize interaction between header files. **/ -#ifndef __CVC4__THEORY__ARITH__CONSTRAINT_FORWARD_H -#define __CVC4__THEORY__ARITH__CONSTRAINT_FORWARD_H +#ifndef CVC4__THEORY__ARITH__CONSTRAINT_FORWARD_H +#define CVC4__THEORY__ARITH__CONSTRAINT_FORWARD_H #include "cvc4_private.h" #include <vector> @@ -46,4 +46,4 @@ static const RationalVectorP RationalVectorPSentinel = NULL; }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__CONSTRAINT_FORWARD_H */ +#endif /* CVC4__THEORY__ARITH__CONSTRAINT_FORWARD_H */ diff --git a/src/theory/arith/cut_log.cpp b/src/theory/arith/cut_log.cpp index dcdadd76f..e9df7559d 100644 --- a/src/theory/arith/cut_log.cpp +++ b/src/theory/arith/cut_log.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/cut_log.h b/src/theory/arith/cut_log.h index 5fd585588..44553a15b 100644 --- a/src/theory/arith/cut_log.h +++ b/src/theory/arith/cut_log.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/delta_rational.cpp b/src/theory/arith/delta_rational.cpp index 758f8af4a..35640ac1a 100644 --- a/src/theory/arith/delta_rational.cpp +++ b/src/theory/arith/delta_rational.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/delta_rational.h b/src/theory/arith/delta_rational.h index 9a8e4586e..831c631f8 100644 --- a/src/theory/arith/delta_rational.h +++ b/src/theory/arith/delta_rational.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/dio_solver.cpp b/src/theory/arith/dio_solver.cpp index 718034f62..b30dc515b 100644 --- a/src/theory/arith/dio_solver.cpp +++ b/src/theory/arith/dio_solver.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/dio_solver.h b/src/theory/arith/dio_solver.h index aeb82a82b..0c26f9c55 100644 --- a/src/theory/arith/dio_solver.h +++ b/src/theory/arith/dio_solver.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__DIO_SOLVER_H -#define __CVC4__THEORY__ARITH__DIO_SOLVER_H +#ifndef CVC4__THEORY__ARITH__DIO_SOLVER_H +#define CVC4__THEORY__ARITH__DIO_SOLVER_H #include <unordered_map> #include <utility> @@ -423,4 +423,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__DIO_SOLVER_H */ +#endif /* CVC4__THEORY__ARITH__DIO_SOLVER_H */ diff --git a/src/theory/arith/dual_simplex.cpp b/src/theory/arith/dual_simplex.cpp index c2b95890a..47a196353 100644 --- a/src/theory/arith/dual_simplex.cpp +++ b/src/theory/arith/dual_simplex.cpp @@ -2,9 +2,9 @@ /*! \file dual_simplex.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andres Noetzli + ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/dual_simplex.h b/src/theory/arith/dual_simplex.h index 56eaf9a50..ab04bc616 100644 --- a/src/theory/arith/dual_simplex.h +++ b/src/theory/arith/dual_simplex.h @@ -2,9 +2,9 @@ /*! \file dual_simplex.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Mathias Preiner + ** Tim King, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/error_set.cpp b/src/theory/arith/error_set.cpp index d5b86143d..80c1e03ec 100644 --- a/src/theory/arith/error_set.cpp +++ b/src/theory/arith/error_set.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/error_set.h b/src/theory/arith/error_set.h index 2eb2b60d2..8839739a2 100644 --- a/src/theory/arith/error_set.h +++ b/src/theory/arith/error_set.h @@ -2,9 +2,9 @@ /*! \file error_set.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/fc_simplex.cpp b/src/theory/arith/fc_simplex.cpp index 07c6b1691..827323302 100644 --- a/src/theory/arith/fc_simplex.cpp +++ b/src/theory/arith/fc_simplex.cpp @@ -2,9 +2,9 @@ /*! \file fc_simplex.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andres Noetzli + ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/fc_simplex.h b/src/theory/arith/fc_simplex.h index 0fc646151..cfeef1d26 100644 --- a/src/theory/arith/fc_simplex.h +++ b/src/theory/arith/fc_simplex.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/infer_bounds.cpp b/src/theory/arith/infer_bounds.cpp index 501b3507c..5ce617061 100644 --- a/src/theory/arith/infer_bounds.cpp +++ b/src/theory/arith/infer_bounds.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/infer_bounds.h b/src/theory/arith/infer_bounds.h index 8a48cb8bc..bce9a07db 100644 --- a/src/theory/arith/infer_bounds.h +++ b/src/theory/arith/infer_bounds.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/linear_equality.cpp b/src/theory/arith/linear_equality.cpp index e424c714e..7f729751b 100644 --- a/src/theory/arith/linear_equality.cpp +++ b/src/theory/arith/linear_equality.cpp @@ -2,9 +2,9 @@ /*! \file linear_equality.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/linear_equality.h b/src/theory/arith/linear_equality.h index 531b52c3a..1f5bb9ea4 100644 --- a/src/theory/arith/linear_equality.h +++ b/src/theory/arith/linear_equality.h @@ -2,9 +2,9 @@ /*! \file linear_equality.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Mathias Preiner, Clark Barrett + ** Tim King, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/matrix.cpp b/src/theory/arith/matrix.cpp index 5da2ab2f6..c6332fd23 100644 --- a/src/theory/arith/matrix.cpp +++ b/src/theory/arith/matrix.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/matrix.h b/src/theory/arith/matrix.h index ef045ea37..02b8dc194 100644 --- a/src/theory/arith/matrix.h +++ b/src/theory/arith/matrix.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/nonlinear_extension.cpp b/src/theory/arith/nonlinear_extension.cpp index 929c7808d..29b1cf2fc 100644 --- a/src/theory/arith/nonlinear_extension.cpp +++ b/src/theory/arith/nonlinear_extension.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -2621,8 +2621,10 @@ void NonlinearExtension::mkPi(){ d_pi_neg = Rewriter::rewrite(NodeManager::currentNM()->mkNode( MULT, d_pi, NodeManager::currentNM()->mkConst(Rational(-1)))); //initialize bounds - d_pi_bound[0] = NodeManager::currentNM()->mkConst( Rational(333)/Rational(106) ); - d_pi_bound[1] = NodeManager::currentNM()->mkConst( Rational(355)/Rational(113) ); + d_pi_bound[0] = + NodeManager::currentNM()->mkConst(Rational(103993) / Rational(33102)); + d_pi_bound[1] = + NodeManager::currentNM()->mkConst(Rational(104348) / Rational(33215)); } } @@ -4358,31 +4360,21 @@ bool NonlinearExtension::checkTfTangentPlanesFun(Node tf, { // compute tangent plane // Figure 3: T( x ) - Node tplane; - Node poly_approx_deriv = getDerivative(poly_approx, d_taylor_real_fv); - Assert(!poly_approx_deriv.isNull()); - poly_approx_deriv = Rewriter::rewrite(poly_approx_deriv); - Trace("nl-ext-tftp-debug2") << "...derivative of " << poly_approx << " is " - << poly_approx_deriv << std::endl; - std::vector<Node> taylor_subs; - taylor_subs.push_back(c); - Assert(taylor_vars.size() == taylor_subs.size()); - Node poly_approx_c_deriv = poly_approx_deriv.substitute(taylor_vars.begin(), - taylor_vars.end(), - taylor_subs.begin(), - taylor_subs.end()); - tplane = nm->mkNode( - PLUS, - poly_approx_c, - nm->mkNode(MULT, poly_approx_c_deriv, nm->mkNode(MINUS, tf[0], c))); + // We use zero slope tangent planes, since the concavity of the Taylor + // approximation cannot be easily established. + Node tplane = poly_approx_c; Node lem = nm->mkNode(concavity == 1 ? GEQ : LEQ, tf, tplane); std::vector<Node> antec; + int mdir = regionToMonotonicityDir(k, region); for (unsigned i = 0; i < 2; i++) { - if (!bounds[i].isNull()) + // Tangent plane is valid in the interval [c,u) if the slope of the + // function matches its concavity, and is valid in (l, c] otherwise. + Node use_bound = (mdir == concavity) == (i == 0) ? c : bounds[i]; + if (!use_bound.isNull()) { - Node ant = nm->mkNode(i == 0 ? GEQ : LEQ, tf[0], bounds[i]); + Node ant = nm->mkNode(i == 0 ? GEQ : LEQ, tf[0], use_bound); antec.push_back(ant); } } diff --git a/src/theory/arith/nonlinear_extension.h b/src/theory/arith/nonlinear_extension.h index cb74502d6..7452e322b 100644 --- a/src/theory/arith/nonlinear_extension.h +++ b/src/theory/arith/nonlinear_extension.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ ** multiplication via axiom instantiations. **/ -#ifndef __CVC4__THEORY__ARITH__NONLINEAR_EXTENSION_H -#define __CVC4__THEORY__ARITH__NONLINEAR_EXTENSION_H +#ifndef CVC4__THEORY__ARITH__NONLINEAR_EXTENSION_H +#define CVC4__THEORY__ARITH__NONLINEAR_EXTENSION_H #include <stdint.h> @@ -1013,4 +1013,4 @@ class NonlinearExtension { } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__ARITH__NONLINEAR_EXTENSION_H */ +#endif /* CVC4__THEORY__ARITH__NONLINEAR_EXTENSION_H */ diff --git a/src/theory/arith/normal_form.cpp b/src/theory/arith/normal_form.cpp index 12bf90f2e..ee298bc66 100644 --- a/src/theory/arith/normal_form.cpp +++ b/src/theory/arith/normal_form.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/normal_form.h b/src/theory/arith/normal_form.h index b4d9e9f13..a3d173cc7 100644 --- a/src/theory/arith/normal_form.h +++ b/src/theory/arith/normal_form.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__NORMAL_FORM_H -#define __CVC4__THEORY__ARITH__NORMAL_FORM_H +#ifndef CVC4__THEORY__ARITH__NORMAL_FORM_H +#define CVC4__THEORY__ARITH__NORMAL_FORM_H #include <algorithm> #include <list> @@ -1393,4 +1393,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__NORMAL_FORM_H */ +#endif /* CVC4__THEORY__ARITH__NORMAL_FORM_H */ diff --git a/src/theory/arith/partial_model.cpp b/src/theory/arith/partial_model.cpp index 4364b730a..855b673c5 100644 --- a/src/theory/arith/partial_model.cpp +++ b/src/theory/arith/partial_model.cpp @@ -2,9 +2,9 @@ /*! \file partial_model.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters + ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/partial_model.h b/src/theory/arith/partial_model.h index 9e8a51b9f..5006c6a9c 100644 --- a/src/theory/arith/partial_model.h +++ b/src/theory/arith/partial_model.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__PARTIAL_MODEL_H -#define __CVC4__THEORY__ARITH__PARTIAL_MODEL_H +#ifndef CVC4__THEORY__ARITH__PARTIAL_MODEL_H +#define CVC4__THEORY__ARITH__PARTIAL_MODEL_H #include <list> #include <vector> @@ -416,4 +416,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__PARTIAL_MODEL_H */ +#endif /* CVC4__THEORY__ARITH__PARTIAL_MODEL_H */ diff --git a/src/theory/arith/simplex.cpp b/src/theory/arith/simplex.cpp index 4ee613f4c..77872fb55 100644 --- a/src/theory/arith/simplex.cpp +++ b/src/theory/arith/simplex.cpp @@ -2,9 +2,9 @@ /*! \file simplex.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andres Noetzli, Morgan Deters + ** Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/simplex.h b/src/theory/arith/simplex.h index 477e0c1fe..56a9bc95f 100644 --- a/src/theory/arith/simplex.h +++ b/src/theory/arith/simplex.h @@ -2,9 +2,9 @@ /*! \file simplex.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Clark Barrett + ** Tim King, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/simplex_update.cpp b/src/theory/arith/simplex_update.cpp index 634d17a55..011e07143 100644 --- a/src/theory/arith/simplex_update.cpp +++ b/src/theory/arith/simplex_update.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/simplex_update.h b/src/theory/arith/simplex_update.h index f823be36c..cfd00ac30 100644 --- a/src/theory/arith/simplex_update.h +++ b/src/theory/arith/simplex_update.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/soi_simplex.cpp b/src/theory/arith/soi_simplex.cpp index 31301df61..e23273a09 100644 --- a/src/theory/arith/soi_simplex.cpp +++ b/src/theory/arith/soi_simplex.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/soi_simplex.h b/src/theory/arith/soi_simplex.h index 68af680d0..6fd8cf7c1 100644 --- a/src/theory/arith/soi_simplex.h +++ b/src/theory/arith/soi_simplex.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/tableau.cpp b/src/theory/arith/tableau.cpp index e0f5fc9e3..aa4c3d454 100644 --- a/src/theory/arith/tableau.cpp +++ b/src/theory/arith/tableau.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/tableau.h b/src/theory/arith/tableau.h index 338baea7f..3f3bf883a 100644 --- a/src/theory/arith/tableau.h +++ b/src/theory/arith/tableau.h @@ -2,9 +2,9 @@ /*! \file tableau.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/tableau_sizes.cpp b/src/theory/arith/tableau_sizes.cpp index d7434529e..aec7b0384 100644 --- a/src/theory/arith/tableau_sizes.cpp +++ b/src/theory/arith/tableau_sizes.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/tableau_sizes.h b/src/theory/arith/tableau_sizes.h index 228ce06b8..95820dc93 100644 --- a/src/theory/arith/tableau_sizes.h +++ b/src/theory/arith/tableau_sizes.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/theory_arith.cpp b/src/theory/arith/theory_arith.cpp index 9902121d0..6943c5546 100644 --- a/src/theory/arith/theory_arith.cpp +++ b/src/theory/arith/theory_arith.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Dejan Jovanovic, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/theory_arith.h b/src/theory/arith/theory_arith.h index e4b1c5b26..b39ab961f 100644 --- a/src/theory/arith/theory_arith.h +++ b/src/theory/arith/theory_arith.h @@ -2,9 +2,9 @@ /*! \file theory_arith.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Dejan Jovanovic + ** Tim King, Alex Ozdemir, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/theory_arith_private.cpp b/src/theory/arith/theory_arith_private.cpp index 48d1b0188..c775a2611 100644 --- a/src/theory/arith/theory_arith_private.cpp +++ b/src/theory/arith/theory_arith_private.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/theory_arith_private.h b/src/theory/arith/theory_arith_private.h index 2d8d61736..03cb81785 100644 --- a/src/theory/arith/theory_arith_private.h +++ b/src/theory/arith/theory_arith_private.h @@ -2,9 +2,9 @@ /*! \file theory_arith_private.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Andrew Reynolds, Martin Brain + ** Tim King, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/theory_arith_private_forward.h b/src/theory/arith/theory_arith_private_forward.h index 4bd242037..84dea1b4e 100644 --- a/src/theory/arith/theory_arith_private_forward.h +++ b/src/theory/arith/theory_arith_private_forward.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arith/theory_arith_type_rules.h b/src/theory/arith/theory_arith_type_rules.h index bde1730a2..c32b612e2 100644 --- a/src/theory/arith/theory_arith_type_rules.h +++ b/src/theory/arith/theory_arith_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__THEORY_ARITH_TYPE_RULES_H -#define __CVC4__THEORY__ARITH__THEORY_ARITH_TYPE_RULES_H +#ifndef CVC4__THEORY__ARITH__THEORY_ARITH_TYPE_RULES_H +#define CVC4__THEORY__ARITH__THEORY_ARITH_TYPE_RULES_H namespace CVC4 { namespace theory { @@ -185,4 +185,4 @@ class DivisibleOpTypeRule }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__THEORY_ARITH_TYPE_RULES_H */ +#endif /* CVC4__THEORY__ARITH__THEORY_ARITH_TYPE_RULES_H */ diff --git a/src/theory/arith/type_enumerator.h b/src/theory/arith/type_enumerator.h index ab0dff020..5c6bf63ce 100644 --- a/src/theory/arith/type_enumerator.h +++ b/src/theory/arith/type_enumerator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARITH__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__ARITH__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__ARITH__TYPE_ENUMERATOR_H +#define CVC4__THEORY__ARITH__TYPE_ENUMERATOR_H #include "expr/kind.h" #include "expr/type_node.h" @@ -104,4 +104,4 @@ class IntegerEnumerator : public TypeEnumeratorBase<IntegerEnumerator> { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARITH__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__ARITH__TYPE_ENUMERATOR_H */ diff --git a/src/theory/arrays/array_info.cpp b/src/theory/arrays/array_info.cpp index 406ae5329..e92947c7f 100644 --- a/src/theory/arrays/array_info.cpp +++ b/src/theory/arrays/array_info.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Clark Barrett, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arrays/array_info.h b/src/theory/arrays/array_info.h index ed8594ca7..7e18f9ed2 100644 --- a/src/theory/arrays/array_info.h +++ b/src/theory/arrays/array_info.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Clark Barrett, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARRAYS__ARRAY_INFO_H -#define __CVC4__THEORY__ARRAYS__ARRAY_INFO_H +#ifndef CVC4__THEORY__ARRAYS__ARRAY_INFO_H +#define CVC4__THEORY__ARRAYS__ARRAY_INFO_H #include <iostream> #include <map> @@ -211,4 +211,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARRAYS__ARRAY_INFO_H */ +#endif /* CVC4__THEORY__ARRAYS__ARRAY_INFO_H */ diff --git a/src/theory/arrays/array_proof_reconstruction.cpp b/src/theory/arrays/array_proof_reconstruction.cpp index e0f3b03be..c25ce1aba 100644 --- a/src/theory/arrays/array_proof_reconstruction.cpp +++ b/src/theory/arrays/array_proof_reconstruction.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arrays/array_proof_reconstruction.h b/src/theory/arrays/array_proof_reconstruction.h index 7132b2f3e..37b014d35 100644 --- a/src/theory/arrays/array_proof_reconstruction.h +++ b/src/theory/arrays/array_proof_reconstruction.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARRAYS__ARRAY_PROOF_RECONSTRUCTION_H -#define __CVC4__THEORY__ARRAYS__ARRAY_PROOF_RECONSTRUCTION_H +#ifndef CVC4__THEORY__ARRAYS__ARRAY_PROOF_RECONSTRUCTION_H +#define CVC4__THEORY__ARRAYS__ARRAY_PROOF_RECONSTRUCTION_H #include "theory/uf/equality_engine.h" @@ -56,4 +56,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARRAYS__ARRAY_PROOF_RECONSTRUCTION_H */ +#endif /* CVC4__THEORY__ARRAYS__ARRAY_PROOF_RECONSTRUCTION_H */ diff --git a/src/theory/arrays/static_fact_manager.cpp b/src/theory/arrays/static_fact_manager.cpp index d7758d00c..63dfae173 100644 --- a/src/theory/arrays/static_fact_manager.cpp +++ b/src/theory/arrays/static_fact_manager.cpp @@ -2,9 +2,9 @@ /*! \file static_fact_manager.cpp ** \verbatim ** Top contributors (to current version): - ** Clark Barrett, Tim King + ** Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arrays/static_fact_manager.h b/src/theory/arrays/static_fact_manager.h index 1f3c3d1df..6b68edf26 100644 --- a/src/theory/arrays/static_fact_manager.h +++ b/src/theory/arrays/static_fact_manager.h @@ -2,9 +2,9 @@ /*! \file static_fact_manager.h ** \verbatim ** Top contributors (to current version): - ** Clark Barrett, Tim King, Morgan Deters + ** Clark Barrett, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARRAYS__STATIC_FACT_MANAGER_H -#define __CVC4__THEORY__ARRAYS__STATIC_FACT_MANAGER_H +#ifndef CVC4__THEORY__ARRAYS__STATIC_FACT_MANAGER_H +#define CVC4__THEORY__ARRAYS__STATIC_FACT_MANAGER_H #include <utility> #include <vector> @@ -113,4 +113,4 @@ inline void StaticFactManager::setCanon(TNode n, TNode newParent) { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /*__CVC4__THEORY__ARRAYS__STATIC_FACT_MANAGER_H */ +#endif /*CVC4__THEORY__ARRAYS__STATIC_FACT_MANAGER_H */ diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp index c21fda430..9f06950bd 100644 --- a/src/theory/arrays/theory_arrays.cpp +++ b/src/theory/arrays/theory_arrays.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Clark Barrett, Morgan Deters, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arrays/theory_arrays.h b/src/theory/arrays/theory_arrays.h index e0f187e33..be80a081d 100644 --- a/src/theory/arrays/theory_arrays.h +++ b/src/theory/arrays/theory_arrays.h @@ -2,9 +2,9 @@ /*! \file theory_arrays.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Clark Barrett, Tim King + ** Morgan Deters, Clark Barrett, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_H -#define __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_H +#ifndef CVC4__THEORY__ARRAYS__THEORY_ARRAYS_H +#define CVC4__THEORY__ARRAYS__THEORY_ARRAYS_H #include <tuple> #include <unordered_map> @@ -491,4 +491,4 @@ class TheoryArrays : public Theory { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_H */ +#endif /* CVC4__THEORY__ARRAYS__THEORY_ARRAYS_H */ diff --git a/src/theory/arrays/theory_arrays_rewriter.cpp b/src/theory/arrays/theory_arrays_rewriter.cpp index eaf7b5ff9..43c6153c7 100644 --- a/src/theory/arrays/theory_arrays_rewriter.cpp +++ b/src/theory/arrays/theory_arrays_rewriter.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arrays/theory_arrays_rewriter.h b/src/theory/arrays/theory_arrays_rewriter.h index d17c4d4ab..5f3fcf48d 100644 --- a/src/theory/arrays/theory_arrays_rewriter.h +++ b/src/theory/arrays/theory_arrays_rewriter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Clark Barrett, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_REWRITER_H -#define __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_REWRITER_H +#ifndef CVC4__THEORY__ARRAYS__THEORY_ARRAYS_REWRITER_H +#define CVC4__THEORY__ARRAYS__THEORY_ARRAYS_REWRITER_H #include <unordered_map> #include <unordered_set> @@ -509,4 +509,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_REWRITER_H */ +#endif /* CVC4__THEORY__ARRAYS__THEORY_ARRAYS_REWRITER_H */ diff --git a/src/theory/arrays/theory_arrays_type_rules.h b/src/theory/arrays/theory_arrays_type_rules.h index 171a03555..78756176d 100644 --- a/src/theory/arrays/theory_arrays_type_rules.h +++ b/src/theory/arrays/theory_arrays_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Clark Barrett, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_TYPE_RULES_H -#define __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_TYPE_RULES_H +#ifndef CVC4__THEORY__ARRAYS__THEORY_ARRAYS_TYPE_RULES_H +#define CVC4__THEORY__ARRAYS__THEORY_ARRAYS_TYPE_RULES_H #include "theory/arrays/theory_arrays_rewriter.h" // for array-constant attributes #include "theory/type_enumerator.h" @@ -227,4 +227,4 @@ struct ArrayPartialSelectTypeRule { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_TYPE_RULES_H */ +#endif /* CVC4__THEORY__ARRAYS__THEORY_ARRAYS_TYPE_RULES_H */ diff --git a/src/theory/arrays/type_enumerator.h b/src/theory/arrays/type_enumerator.h index f9a88f2ae..5ca156b2e 100644 --- a/src/theory/arrays/type_enumerator.h +++ b/src/theory/arrays/type_enumerator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Clark Barrett, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARRAYS__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__ARRAYS__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__ARRAYS__TYPE_ENUMERATOR_H +#define CVC4__THEORY__ARRAYS__TYPE_ENUMERATOR_H #include "theory/type_enumerator.h" #include "expr/type_node.h" @@ -158,4 +158,4 @@ class ArrayEnumerator : public TypeEnumeratorBase<ArrayEnumerator> { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ARRAYS__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__ARRAYS__TYPE_ENUMERATOR_H */ diff --git a/src/theory/arrays/union_find.cpp b/src/theory/arrays/union_find.cpp index f919f9260..af2cf3c3f 100644 --- a/src/theory/arrays/union_find.cpp +++ b/src/theory/arrays/union_find.cpp @@ -2,9 +2,9 @@ /*! \file union_find.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/arrays/union_find.h b/src/theory/arrays/union_find.h index 617c9a1ba..1f38f1280 100644 --- a/src/theory/arrays/union_find.h +++ b/src/theory/arrays/union_find.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ARRAYS__UNION_FIND_H -#define __CVC4__THEORY__ARRAYS__UNION_FIND_H +#ifndef CVC4__THEORY__ARRAYS__UNION_FIND_H +#define CVC4__THEORY__ARRAYS__UNION_FIND_H #include <utility> #include <vector> @@ -139,4 +139,4 @@ inline void UnionFind<NodeType, NodeHash>::setCanon(TNode n, TNode newParent) { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /*__CVC4__THEORY__ARRAYS__UNION_FIND_H */ +#endif /*CVC4__THEORY__ARRAYS__UNION_FIND_H */ diff --git a/src/theory/assertion.cpp b/src/theory/assertion.cpp index bef29131e..4f428e85c 100644 --- a/src/theory/assertion.cpp +++ b/src/theory/assertion.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/assertion.h b/src/theory/assertion.h index c9748f8c8..863a7e893 100644 --- a/src/theory/assertion.h +++ b/src/theory/assertion.h @@ -2,9 +2,9 @@ /*! \file assertion.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__ASSERTION_H -#define __CVC4__THEORY__ASSERTION_H +#ifndef CVC4__THEORY__ASSERTION_H +#define CVC4__THEORY__ASSERTION_H #include "expr/node.h" @@ -49,4 +49,4 @@ std::ostream& operator<<(std::ostream& out, const Assertion& a); }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__ASSERTION_H */ +#endif /* CVC4__THEORY__ASSERTION_H */ diff --git a/src/theory/atom_requests.cpp b/src/theory/atom_requests.cpp index 85c7907bb..6054ac603 100644 --- a/src/theory/atom_requests.cpp +++ b/src/theory/atom_requests.cpp @@ -2,9 +2,9 @@ /*! \file atom_requests.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters + ** Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/atom_requests.h b/src/theory/atom_requests.h index 678a0f3f0..6a3ffe5e9 100644 --- a/src/theory/atom_requests.h +++ b/src/theory/atom_requests.h @@ -2,9 +2,9 @@ /*! \file atom_requests.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters + ** Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/booleans/circuit_propagator.cpp b/src/theory/booleans/circuit_propagator.cpp index 2548cf5c3..150403b67 100644 --- a/src/theory/booleans/circuit_propagator.cpp +++ b/src/theory/booleans/circuit_propagator.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/booleans/circuit_propagator.h b/src/theory/booleans/circuit_propagator.h index 077a019fd..9c4798898 100644 --- a/src/theory/booleans/circuit_propagator.h +++ b/src/theory/booleans/circuit_propagator.h @@ -2,9 +2,9 @@ /*! \file circuit_propagator.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Dejan Jovanovic, Clark Barrett + ** Aina Niemetz, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BOOLEANS__CIRCUIT_PROPAGATOR_H -#define __CVC4__THEORY__BOOLEANS__CIRCUIT_PROPAGATOR_H +#ifndef CVC4__THEORY__BOOLEANS__CIRCUIT_PROPAGATOR_H +#define CVC4__THEORY__BOOLEANS__CIRCUIT_PROPAGATOR_H #include <functional> #include <unordered_map> @@ -313,4 +313,4 @@ class CircuitPropagator } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__BOOLEANS__CIRCUIT_PROPAGATOR_H */ +#endif /* CVC4__THEORY__BOOLEANS__CIRCUIT_PROPAGATOR_H */ diff --git a/src/theory/booleans/theory_bool.cpp b/src/theory/booleans/theory_bool.cpp index d025c4966..8fbe83951 100644 --- a/src/theory/booleans/theory_bool.cpp +++ b/src/theory/booleans/theory_bool.cpp @@ -2,9 +2,9 @@ /*! \file theory_bool.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Dejan Jovanovic + ** Andrew Reynolds, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/booleans/theory_bool.h b/src/theory/booleans/theory_bool.h index b81ed50f1..abe024282 100644 --- a/src/theory/booleans/theory_bool.h +++ b/src/theory/booleans/theory_bool.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BOOLEANS__THEORY_BOOL_H -#define __CVC4__THEORY__BOOLEANS__THEORY_BOOL_H +#ifndef CVC4__THEORY__BOOLEANS__THEORY_BOOL_H +#define CVC4__THEORY__BOOLEANS__THEORY_BOOL_H #include "theory/theory.h" #include "context/context.h" @@ -44,4 +44,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BOOLEANS__THEORY_BOOL_H */ +#endif /* CVC4__THEORY__BOOLEANS__THEORY_BOOL_H */ diff --git a/src/theory/booleans/theory_bool_rewriter.cpp b/src/theory/booleans/theory_bool_rewriter.cpp index 28f86da7a..02267cf2c 100644 --- a/src/theory/booleans/theory_bool_rewriter.cpp +++ b/src/theory/booleans/theory_bool_rewriter.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Dejan Jovanovic, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -77,7 +77,7 @@ RewriteResponse flattenNode(TNode n, TNode trivialNode, TNode skipNode) /* Trickery to stay under number of children possible in a node */ NodeManager* nodeManager = NodeManager::currentNM(); - static const unsigned MAX_CHILDREN = (1u << __CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN ) - 1; + static const unsigned MAX_CHILDREN = (1u << CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN ) - 1; if (childList.size() < MAX_CHILDREN) { Node retNode = nodeManager->mkNode(k, childList); return RewriteResponse(REWRITE_DONE, retNode); diff --git a/src/theory/booleans/theory_bool_rewriter.h b/src/theory/booleans/theory_bool_rewriter.h index 11c7b16a2..250f36efa 100644 --- a/src/theory/booleans/theory_bool_rewriter.h +++ b/src/theory/booleans/theory_bool_rewriter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BOOLEANS__THEORY_BOOL_REWRITER_H -#define __CVC4__THEORY__BOOLEANS__THEORY_BOOL_REWRITER_H +#ifndef CVC4__THEORY__BOOLEANS__THEORY_BOOL_REWRITER_H +#define CVC4__THEORY__BOOLEANS__THEORY_BOOL_REWRITER_H #include "theory/rewriter.h" @@ -42,4 +42,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BOOLEANS__THEORY_BOOL_REWRITER_H */ +#endif /* CVC4__THEORY__BOOLEANS__THEORY_BOOL_REWRITER_H */ diff --git a/src/theory/booleans/theory_bool_type_rules.h b/src/theory/booleans/theory_bool_type_rules.h index 7498b7de4..18329b8b9 100644 --- a/src/theory/booleans/theory_bool_type_rules.h +++ b/src/theory/booleans/theory_bool_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY_BOOL_TYPE_RULES_H -#define __CVC4__THEORY_BOOL_TYPE_RULES_H +#ifndef CVC4__THEORY_BOOL_TYPE_RULES_H +#define CVC4__THEORY_BOOL_TYPE_RULES_H namespace CVC4 { namespace theory { @@ -74,4 +74,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY_BOOL_TYPE_RULES_H */ +#endif /* CVC4__THEORY_BOOL_TYPE_RULES_H */ diff --git a/src/theory/booleans/type_enumerator.h b/src/theory/booleans/type_enumerator.h index 2e00f22ce..361216b10 100644 --- a/src/theory/booleans/type_enumerator.h +++ b/src/theory/booleans/type_enumerator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BOOLEANS__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__BOOLEANS__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__BOOLEANS__TYPE_ENUMERATOR_H +#define CVC4__THEORY__BOOLEANS__TYPE_ENUMERATOR_H #include "theory/type_enumerator.h" #include "expr/type_node.h" @@ -67,4 +67,4 @@ class BooleanEnumerator : public TypeEnumeratorBase<BooleanEnumerator> { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BOOLEANS__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__BOOLEANS__TYPE_ENUMERATOR_H */ diff --git a/src/theory/builtin/kinds b/src/theory/builtin/kinds index 3313a684f..15891dfad 100644 --- a/src/theory/builtin/kinds +++ b/src/theory/builtin/kinds @@ -289,9 +289,6 @@ constant BUILTIN \ "expr/kind.h" \ "the kind of expressions representing built-in operators" -variable FUNCTION "a defined function" -parameterized APPLY FUNCTION 0: "application of a defined function" - operator EQUAL 2 "equality (two parameters only, sorts must match)" operator DISTINCT 2: "disequality (N-ary, sorts must match)" variable VARIABLE "a variable (not permitted in bindings)" @@ -332,7 +329,6 @@ well-founded SEXPR_TYPE \ "::CVC4::theory::builtin::SExprProperties::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 SEXPR ::CVC4::theory::builtin::SExprTypeRule diff --git a/src/theory/builtin/theory_builtin.cpp b/src/theory/builtin/theory_builtin.cpp index ec22eb3f6..b819b883d 100644 --- a/src/theory/builtin/theory_builtin.cpp +++ b/src/theory/builtin/theory_builtin.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/builtin/theory_builtin.h b/src/theory/builtin/theory_builtin.h index c987941f6..8a7d1bf7b 100644 --- a/src/theory/builtin/theory_builtin.h +++ b/src/theory/builtin/theory_builtin.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_H -#define __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_H +#ifndef CVC4__THEORY__BUILTIN__THEORY_BUILTIN_H +#define CVC4__THEORY__BUILTIN__THEORY_BUILTIN_H #include "theory/theory.h" @@ -38,4 +38,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_H */ +#endif /* CVC4__THEORY__BUILTIN__THEORY_BUILTIN_H */ diff --git a/src/theory/builtin/theory_builtin_rewriter.cpp b/src/theory/builtin/theory_builtin_rewriter.cpp index 4c14ec177..5b893ffc6 100644 --- a/src/theory/builtin/theory_builtin_rewriter.cpp +++ b/src/theory/builtin/theory_builtin_rewriter.cpp @@ -2,9 +2,9 @@ /*! \file theory_builtin_rewriter.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Dejan Jovanovic, Morgan Deters + ** Andrew Reynolds, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/builtin/theory_builtin_rewriter.h b/src/theory/builtin/theory_builtin_rewriter.h index 8f45cc0fd..5f703fa00 100644 --- a/src/theory/builtin/theory_builtin_rewriter.h +++ b/src/theory/builtin/theory_builtin_rewriter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_REWRITER_H -#define __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_REWRITER_H +#ifndef CVC4__THEORY__BUILTIN__THEORY_BUILTIN_REWRITER_H +#define CVC4__THEORY__BUILTIN__THEORY_BUILTIN_REWRITER_H #include "theory/rewriter.h" #include "theory/theory.h" @@ -130,4 +130,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_REWRITER_H */ +#endif /* CVC4__THEORY__BUILTIN__THEORY_BUILTIN_REWRITER_H */ diff --git a/src/theory/builtin/theory_builtin_type_rules.h b/src/theory/builtin/theory_builtin_type_rules.h index c471caf86..db427d21e 100644 --- a/src/theory/builtin/theory_builtin_type_rules.h +++ b/src/theory/builtin/theory_builtin_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_TYPE_RULES_H -#define __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_TYPE_RULES_H +#ifndef CVC4__THEORY__BUILTIN__THEORY_BUILTIN_TYPE_RULES_H +#define CVC4__THEORY__BUILTIN__THEORY_BUILTIN_TYPE_RULES_H #include "expr/node.h" #include "expr/type_node.h" @@ -31,44 +31,6 @@ namespace CVC4 { namespace theory { namespace builtin { -class ApplyTypeRule { - public: - inline static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check) - { - TNode f = n.getOperator(); - TypeNode fType = f.getType(check); - if( !fType.isFunction() && n.getNumChildren() > 0 ) { - throw TypeCheckingExceptionPrivate(n, "operator does not have function type"); - } - if( check ) { - if(fType.isFunction()) { - if(n.getNumChildren() != fType.getNumChildren() - 1) { - throw TypeCheckingExceptionPrivate(n, "number of arguments does not match the function type"); - } - TNode::iterator argument_it = n.begin(); - TNode::iterator argument_it_end = n.end(); - TypeNode::iterator argument_type_it = fType.begin(); - for(; argument_it != argument_it_end; ++argument_it, ++argument_type_it) { - if(!(*argument_it).getType().isComparableTo(*argument_type_it)) { - std::stringstream ss; - ss << "argument types do not match the function type:\n" - << "argument: " << *argument_it << "\n" - << "has type: " << (*argument_it).getType() << "\n" - << "not equal: " << *argument_type_it; - throw TypeCheckingExceptionPrivate(n, ss.str()); - } - } - } else { - if( n.getNumChildren() > 0 ) { - throw TypeCheckingExceptionPrivate(n, "number of arguments does not match the function type"); - } - } - } - return fType.isFunction() ? fType.getRangeType() : fType; - } -};/* class ApplyTypeRule */ - - class EqualityTypeRule { public: inline static TypeNode computeType(NodeManager* nodeManager, @@ -375,4 +337,4 @@ class SExprProperties { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BUILTIN__THEORY_BUILTIN_TYPE_RULES_H */ +#endif /* CVC4__THEORY__BUILTIN__THEORY_BUILTIN_TYPE_RULES_H */ diff --git a/src/theory/builtin/type_enumerator.cpp b/src/theory/builtin/type_enumerator.cpp index 7a088bd8d..10c6d16dc 100644 --- a/src/theory/builtin/type_enumerator.cpp +++ b/src/theory/builtin/type_enumerator.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/builtin/type_enumerator.h b/src/theory/builtin/type_enumerator.h index bea3b7c18..8ce17306f 100644 --- a/src/theory/builtin/type_enumerator.h +++ b/src/theory/builtin/type_enumerator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BUILTIN__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__BUILTIN__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__BUILTIN__TYPE_ENUMERATOR_H +#define CVC4__THEORY__BUILTIN__TYPE_ENUMERATOR_H #include "expr/kind.h" #include "expr/type_node.h" @@ -108,4 +108,4 @@ class FunctionEnumerator : public TypeEnumeratorBase<FunctionEnumerator> }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BUILTIN_TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__BUILTIN_TYPE_ENUMERATOR_H */ diff --git a/src/theory/bv/abstraction.cpp b/src/theory/bv/abstraction.cpp index 081590810..16f77f925 100644 --- a/src/theory/bv/abstraction.cpp +++ b/src/theory/bv/abstraction.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/abstraction.h b/src/theory/bv/abstraction.h index a6bc5f12f..5472aa5a2 100644 --- a/src/theory/bv/abstraction.h +++ b/src/theory/bv/abstraction.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__ABSTRACTION_H -#define __CVC4__THEORY__BV__ABSTRACTION_H +#ifndef CVC4__THEORY__BV__ABSTRACTION_H +#define CVC4__THEORY__BV__ABSTRACTION_H #include <unordered_map> #include <unordered_set> diff --git a/src/theory/bv/bitblast/aig_bitblaster.cpp b/src/theory/bv/bitblast/aig_bitblaster.cpp index b69704dfb..3ed926f84 100644 --- a/src/theory/bv/bitblast/aig_bitblaster.cpp +++ b/src/theory/bv/bitblast/aig_bitblaster.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bitblast/aig_bitblaster.h b/src/theory/bv/bitblast/aig_bitblaster.h index 3b48928ca..8b63a9aa6 100644 --- a/src/theory/bv/bitblast/aig_bitblaster.h +++ b/src/theory/bv/bitblast/aig_bitblaster.h @@ -2,9 +2,9 @@ /*! \file aig_bitblaster.h ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner + ** Liana Hadarean, Mathias Preiner, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BITBLAST__AIG_BITBLASTER_H -#define __CVC4__THEORY__BV__BITBLAST__AIG_BITBLASTER_H +#ifndef CVC4__THEORY__BV__BITBLAST__AIG_BITBLASTER_H +#define CVC4__THEORY__BV__BITBLAST__AIG_BITBLASTER_H #include "theory/bv/bitblast/bitblaster.h" #include "prop/sat_solver.h" @@ -111,4 +111,4 @@ class AigBitblaster : public TBitblaster<Abc_Obj_t*> } // namespace bv } // namespace theory } // namespace CVC4 -#endif // __CVC4__THEORY__BV__BITBLAST__AIG_BITBLASTER_H +#endif // CVC4__THEORY__BV__BITBLAST__AIG_BITBLASTER_H diff --git a/src/theory/bv/bitblast/bitblast_strategies_template.h b/src/theory/bv/bitblast/bitblast_strategies_template.h index c081b87cf..9e668e258 100644 --- a/src/theory/bv/bitblast/bitblast_strategies_template.h +++ b/src/theory/bv/bitblast/bitblast_strategies_template.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BITBLAST__BITBLAST_STRATEGIES_TEMPLATE_H -#define __CVC4__THEORY__BV__BITBLAST__BITBLAST_STRATEGIES_TEMPLATE_H +#ifndef CVC4__THEORY__BV__BITBLAST__BITBLAST_STRATEGIES_TEMPLATE_H +#define CVC4__THEORY__BV__BITBLAST__BITBLAST_STRATEGIES_TEMPLATE_H #include <cmath> #include <ostream> diff --git a/src/theory/bv/bitblast/bitblast_utils.h b/src/theory/bv/bitblast/bitblast_utils.h index 731ffb3dd..f2bee22e5 100644 --- a/src/theory/bv/bitblast/bitblast_utils.h +++ b/src/theory/bv/bitblast/bitblast_utils.h @@ -2,9 +2,9 @@ /*! \file bitblast_utils.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Mathias Preiner, Andrew Reynolds + ** Liana Hadarean, Dejan Jovanovic, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BITBLAST__BITBLAST_UTILS_H -#define __CVC4__THEORY__BV__BITBLAST__BITBLAST_UTILS_H +#ifndef CVC4__THEORY__BV__BITBLAST__BITBLAST_UTILS_H +#define CVC4__THEORY__BV__BITBLAST__BITBLAST_UTILS_H #include <ostream> @@ -269,4 +269,4 @@ T inline sLessThanBB(const std::vector<T>&a, const std::vector<T>& b, bool orEqu } // namespace theory } // namespace CVC4 -#endif // __CVC4__THEORY__BV__BITBLAST__BITBLAST_UTILS_H +#endif // CVC4__THEORY__BV__BITBLAST__BITBLAST_UTILS_H diff --git a/src/theory/bv/bitblast/bitblaster.h b/src/theory/bv/bitblast/bitblaster.h index b28ff3e2a..df7cc4f11 100644 --- a/src/theory/bv/bitblast/bitblaster.h +++ b/src/theory/bv/bitblast/bitblaster.h @@ -2,9 +2,9 @@ /*! \file bitblaster.h ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner + ** Liana Hadarean, Mathias Preiner, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BITBLAST__BITBLASTER_H -#define __CVC4__THEORY__BV__BITBLAST__BITBLASTER_H +#ifndef CVC4__THEORY__BV__BITBLAST__BITBLASTER_H +#define CVC4__THEORY__BV__BITBLAST__BITBLASTER_H #include <unordered_map> #include <unordered_set> @@ -286,4 +286,4 @@ Node TBitblaster<T>::getTermModel(TNode node, bool fullModel) } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__BV__BITBLAST__BITBLASTER_H */ +#endif /* CVC4__THEORY__BV__BITBLAST__BITBLASTER_H */ diff --git a/src/theory/bv/bitblast/eager_bitblaster.cpp b/src/theory/bv/bitblast/eager_bitblaster.cpp index 1e557bb64..77ff6f885 100644 --- a/src/theory/bv/bitblast/eager_bitblaster.cpp +++ b/src/theory/bv/bitblast/eager_bitblaster.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bitblast/eager_bitblaster.h b/src/theory/bv/bitblast/eager_bitblaster.h index 1c183b509..d407b8131 100644 --- a/src/theory/bv/bitblast/eager_bitblaster.h +++ b/src/theory/bv/bitblast/eager_bitblaster.h @@ -2,9 +2,9 @@ /*! \file eager_bitblaster.h ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner, Andres Noetzli + ** Mathias Preiner, Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BITBLAST__EAGER_BITBLASTER_H -#define __CVC4__THEORY__BV__BITBLAST__EAGER_BITBLASTER_H +#ifndef CVC4__THEORY__BV__BITBLAST__EAGER_BITBLASTER_H +#define CVC4__THEORY__BV__BITBLAST__EAGER_BITBLASTER_H #include <unordered_set> @@ -88,4 +88,4 @@ class BitblastingRegistrar : public prop::Registrar } // namespace bv } // namespace theory } // namespace CVC4 -#endif // __CVC4__THEORY__BV__BITBLAST__EAGER_BITBLASTER_H +#endif // CVC4__THEORY__BV__BITBLAST__EAGER_BITBLASTER_H diff --git a/src/theory/bv/bitblast/lazy_bitblaster.cpp b/src/theory/bv/bitblast/lazy_bitblaster.cpp index 3b44bfddf..845fd399e 100644 --- a/src/theory/bv/bitblast/lazy_bitblaster.cpp +++ b/src/theory/bv/bitblast/lazy_bitblaster.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bitblast/lazy_bitblaster.h b/src/theory/bv/bitblast/lazy_bitblaster.h index 8dbf7807d..ac5cd5c7f 100644 --- a/src/theory/bv/bitblast/lazy_bitblaster.h +++ b/src/theory/bv/bitblast/lazy_bitblaster.h @@ -2,9 +2,9 @@ /*! \file lazy_bitblaster.h ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner + ** Liana Hadarean, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BITBLAST__LAZY_BITBLASTER_H -#define __CVC4__THEORY__BV__BITBLAST__LAZY_BITBLASTER_H +#ifndef CVC4__THEORY__BV__BITBLAST__LAZY_BITBLASTER_H +#define CVC4__THEORY__BV__BITBLAST__LAZY_BITBLASTER_H #include "proof/resolution_bitvector_proof.h" #include "theory/bv/bitblast/bitblaster.h" @@ -176,4 +176,4 @@ class TLazyBitblaster : public TBitblaster<Node> } // namespace bv } // namespace theory } // namespace CVC4 -#endif // __CVC4__THEORY__BV__BITBLAST__LAZY_BITBLASTER_H +#endif // CVC4__THEORY__BV__BITBLAST__LAZY_BITBLASTER_H diff --git a/src/theory/bv/bv_eager_solver.cpp b/src/theory/bv/bv_eager_solver.cpp index 336529dfd..dd0458a70 100644 --- a/src/theory/bv/bv_eager_solver.cpp +++ b/src/theory/bv/bv_eager_solver.cpp @@ -2,9 +2,9 @@ /*! \file bv_eager_solver.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Mathias Preiner, Tim King + ** Mathias Preiner, Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_eager_solver.h b/src/theory/bv/bv_eager_solver.h index 0b518ca4a..8e42d5cab 100644 --- a/src/theory/bv/bv_eager_solver.h +++ b/src/theory/bv/bv_eager_solver.h @@ -2,9 +2,9 @@ /*! \file bv_eager_solver.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Tim King, Mathias Preiner + ** Liana Hadarean, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BV_EAGER_SOLVER_H -#define __CVC4__THEORY__BV__BV_EAGER_SOLVER_H +#ifndef CVC4__THEORY__BV__BV_EAGER_SOLVER_H +#define CVC4__THEORY__BV__BV_EAGER_SOLVER_H #include <unordered_set> #include <vector> @@ -68,4 +68,4 @@ class EagerBitblastSolver { } // namespace theory } // namespace CVC4 -#endif // __CVC4__THEORY__BV__BV_EAGER_SOLVER_H +#endif // CVC4__THEORY__BV__BV_EAGER_SOLVER_H diff --git a/src/theory/bv/bv_inequality_graph.cpp b/src/theory/bv/bv_inequality_graph.cpp index 3d1ce4f27..89d5e1883 100644 --- a/src/theory/bv/bv_inequality_graph.cpp +++ b/src/theory/bv/bv_inequality_graph.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_inequality_graph.h b/src/theory/bv/bv_inequality_graph.h index e1f2fbf7c..07facf4af 100644 --- a/src/theory/bv/bv_inequality_graph.h +++ b/src/theory/bv/bv_inequality_graph.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BV_INEQUALITY__GRAPH_H -#define __CVC4__THEORY__BV__BV_INEQUALITY__GRAPH_H +#ifndef CVC4__THEORY__BV__BV_INEQUALITY__GRAPH_H +#define CVC4__THEORY__BV__BV_INEQUALITY__GRAPH_H #include <list> #include <queue> @@ -282,4 +282,4 @@ public: } } -#endif /* __CVC4__THEORY__BV__BV_INEQUALITY__GRAPH_H */ +#endif /* CVC4__THEORY__BV__BV_INEQUALITY__GRAPH_H */ diff --git a/src/theory/bv/bv_quick_check.cpp b/src/theory/bv/bv_quick_check.cpp index d81300b84..0183dd6e7 100644 --- a/src/theory/bv/bv_quick_check.cpp +++ b/src/theory/bv/bv_quick_check.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_quick_check.h b/src/theory/bv/bv_quick_check.h index b2c31edcb..75f39b6e0 100644 --- a/src/theory/bv/bv_quick_check.h +++ b/src/theory/bv/bv_quick_check.h @@ -2,9 +2,9 @@ /*! \file bv_quick_check.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Morgan Deters, Tim King + ** Liana Hadarean, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BV_QUICK_CHECK_H -#define __CVC4__BV_QUICK_CHECK_H +#ifndef CVC4__BV_QUICK_CHECK_H +#define CVC4__BV_QUICK_CHECK_H #include <vector> #include <unordered_set> @@ -172,4 +172,4 @@ public: } /* theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__BV_QUICK_CHECK_H */ +#endif /* CVC4__BV_QUICK_CHECK_H */ diff --git a/src/theory/bv/bv_subtheory.h b/src/theory/bv/bv_subtheory.h index e2b649841..60660eda9 100644 --- a/src/theory/bv/bv_subtheory.h +++ b/src/theory/bv/bv_subtheory.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ ** Interface for bit-vectors sub-solvers. **/ -#ifndef __CVC4__THEORY__BV__BV_SUBTHEORY_H -#define __CVC4__THEORY__BV__BV_SUBTHEORY_H +#ifndef CVC4__THEORY__BV__BV_SUBTHEORY_H +#define CVC4__THEORY__BV__BV_SUBTHEORY_H #include "cvc4_private.h" #include "context/context.h" @@ -117,4 +117,4 @@ class SubtheorySolver { } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__BV__BV_SUBTHEORY_H */ +#endif /* CVC4__THEORY__BV__BV_SUBTHEORY_H */ diff --git a/src/theory/bv/bv_subtheory_algebraic.cpp b/src/theory/bv/bv_subtheory_algebraic.cpp index df7ba29b5..1f4aef42d 100644 --- a/src/theory/bv/bv_subtheory_algebraic.cpp +++ b/src/theory/bv/bv_subtheory_algebraic.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_subtheory_algebraic.h b/src/theory/bv/bv_subtheory_algebraic.h index 42f5faa7c..7f38b1563 100644 --- a/src/theory/bv/bv_subtheory_algebraic.h +++ b/src/theory/bv/bv_subtheory_algebraic.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_subtheory_bitblast.cpp b/src/theory/bv/bv_subtheory_bitblast.cpp index ceb02af40..94dfdee14 100644 --- a/src/theory/bv/bv_subtheory_bitblast.cpp +++ b/src/theory/bv/bv_subtheory_bitblast.cpp @@ -2,9 +2,9 @@ /*! \file bv_subtheory_bitblast.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Dejan Jovanovic, Aina Niemetz + ** Liana Hadarean, Aina Niemetz, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_subtheory_bitblast.h b/src/theory/bv/bv_subtheory_bitblast.h index e028dbbdc..0b0a9521b 100644 --- a/src/theory/bv/bv_subtheory_bitblast.h +++ b/src/theory/bv/bv_subtheory_bitblast.h @@ -2,9 +2,9 @@ /*! \file bv_subtheory_bitblast.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Dejan Jovanovic, Mathias Preiner + ** Liana Hadarean, Mathias Preiner, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_subtheory_core.cpp b/src/theory/bv/bv_subtheory_core.cpp index 9285141a0..f809c38c0 100644 --- a/src/theory/bv/bv_subtheory_core.cpp +++ b/src/theory/bv/bv_subtheory_core.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_subtheory_core.h b/src/theory/bv/bv_subtheory_core.h index ce570d531..e2026d4a5 100644 --- a/src/theory/bv/bv_subtheory_core.h +++ b/src/theory/bv/bv_subtheory_core.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_subtheory_inequality.cpp b/src/theory/bv/bv_subtheory_inequality.cpp index 6fc167793..b527eada4 100644 --- a/src/theory/bv/bv_subtheory_inequality.cpp +++ b/src/theory/bv/bv_subtheory_inequality.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/bv_subtheory_inequality.h b/src/theory/bv/bv_subtheory_inequality.h index 1bdec8386..e18c886df 100644 --- a/src/theory/bv/bv_subtheory_inequality.h +++ b/src/theory/bv/bv_subtheory_inequality.h @@ -2,9 +2,9 @@ /*! \file bv_subtheory_inequality.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Morgan Deters, Mathias Preiner + ** Liana Hadarean, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H -#define __CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H +#ifndef CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H +#define CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H #include <unordered_set> @@ -83,4 +83,4 @@ public: } } -#endif /* __CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H */ +#endif /* CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H */ diff --git a/src/theory/bv/slicer.cpp b/src/theory/bv/slicer.cpp index 4c4b7c723..e633792d8 100644 --- a/src/theory/bv/slicer.cpp +++ b/src/theory/bv/slicer.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/slicer.h b/src/theory/bv/slicer.h index e6ddfb93c..3ddbcaf36 100644 --- a/src/theory/bv/slicer.h +++ b/src/theory/bv/slicer.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -28,8 +28,8 @@ #include "util/index.h" #include "util/statistics_registry.h" -#ifndef __CVC4__THEORY__BV__SLICER_BV_H -#define __CVC4__THEORY__BV__SLICER_BV_H +#ifndef CVC4__THEORY__BV__SLICER_BV_H +#define CVC4__THEORY__BV__SLICER_BV_H namespace CVC4 { @@ -251,4 +251,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BV__SLICER_BV_H */ +#endif /* CVC4__THEORY__BV__SLICER_BV_H */ diff --git a/src/theory/bv/theory_bv.cpp b/src/theory/bv/theory_bv.cpp index 04a6cf52c..b7e52205f 100644 --- a/src/theory/bv/theory_bv.cpp +++ b/src/theory/bv/theory_bv.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Andrew Reynolds, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/theory_bv.h b/src/theory/bv/theory_bv.h index 3d151cfb1..7ca98f2ea 100644 --- a/src/theory/bv/theory_bv.h +++ b/src/theory/bv/theory_bv.h @@ -2,9 +2,9 @@ /*! \file theory_bv.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Morgan Deters, Tim King + ** Liana Hadarean, Tim King, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__THEORY_BV_H -#define __CVC4__THEORY__BV__THEORY_BV_H +#ifndef CVC4__THEORY__BV__THEORY_BV_H +#define CVC4__THEORY__BV__THEORY_BV_H #include <unordered_map> #include <unordered_set> @@ -273,4 +273,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BV__THEORY_BV_H */ +#endif /* CVC4__THEORY__BV__THEORY_BV_H */ diff --git a/src/theory/bv/theory_bv_rewrite_rules.h b/src/theory/bv/theory_bv_rewrite_rules.h index c6cd9eb1c..eefda524e 100644 --- a/src/theory/bv/theory_bv_rewrite_rules.h +++ b/src/theory/bv/theory_bv_rewrite_rules.h @@ -2,9 +2,9 @@ /*! \file theory_bv_rewrite_rules.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Dejan Jovanovic, Clark Barrett + ** Liana Hadarean, Dejan Jovanovic, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h b/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h index 1eb813116..22a12cc10 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h +++ b/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Clark Barrett, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/theory_bv_rewrite_rules_core.h b/src/theory/bv/theory_bv_rewrite_rules_core.h index 42bf09d92..4a66aa847 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_core.h +++ b/src/theory/bv/theory_bv_rewrite_rules_core.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Liana Hadarean, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/theory_bv_rewrite_rules_normalization.h b/src/theory/bv/theory_bv_rewrite_rules_normalization.h index 1293f8311..cada3d30c 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_normalization.h +++ b/src/theory/bv/theory_bv_rewrite_rules_normalization.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/theory_bv_rewrite_rules_operator_elimination.h b/src/theory/bv/theory_bv_rewrite_rules_operator_elimination.h index 575a40aff..80974b2a5 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_operator_elimination.h +++ b/src/theory/bv/theory_bv_rewrite_rules_operator_elimination.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/theory_bv_rewrite_rules_simplification.h b/src/theory/bv/theory_bv_rewrite_rules_simplification.h index c58d69f6f..0e42886b5 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_simplification.h +++ b/src/theory/bv/theory_bv_rewrite_rules_simplification.h @@ -2,9 +2,9 @@ /*! \file theory_bv_rewrite_rules_simplification.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Mathias Preiner, Aina Niemetz + ** Liana Hadarean, Aina Niemetz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/theory_bv_rewriter.cpp b/src/theory/bv/theory_bv_rewriter.cpp index 0c6f1d37a..0f7629c5f 100644 --- a/src/theory/bv/theory_bv_rewriter.cpp +++ b/src/theory/bv/theory_bv_rewriter.cpp @@ -2,9 +2,9 @@ /*! \file theory_bv_rewriter.cpp ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Dejan Jovanovic, Morgan Deters + ** Liana Hadarean, Aina Niemetz, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -173,12 +173,19 @@ RewriteResponse TheoryBVRewriter::RewriteITEBv(TNode node, bool prerewrite) RewriteRule<BvIteConstCond>, RewriteRule<BvIteEqualChildren>, RewriteRule<BvIteConstChildren>, - RewriteRule<BvIteEqualCond>, - RewriteRule<BvIteMergeThenIf>, + RewriteRule<BvIteEqualCond>>::apply(node); + if (resultNode != node) + { + return RewriteResponse(REWRITE_AGAIN, resultNode); + } + + resultNode = + LinearRewriteStrategy<RewriteRule<BvIteMergeThenIf>, RewriteRule<BvIteMergeElseIf>, RewriteRule<BvIteMergeThenElse>, RewriteRule<BvIteMergeElseElse>>::apply(node); - return RewriteResponse(REWRITE_DONE, resultNode); + return RewriteResponse(resultNode == node ? REWRITE_DONE : REWRITE_AGAIN_FULL, + resultNode); } RewriteResponse TheoryBVRewriter::RewriteNot(TNode node, bool prerewrite){ diff --git a/src/theory/bv/theory_bv_rewriter.h b/src/theory/bv/theory_bv_rewriter.h index aa771fc94..bf707c268 100644 --- a/src/theory/bv/theory_bv_rewriter.h +++ b/src/theory/bv/theory_bv_rewriter.h @@ -2,9 +2,9 @@ /*! \file theory_bv_rewriter.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Dejan Jovanovic, Morgan Deters + ** Liana Hadarean, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__THEORY_BV_REWRITER_H -#define __CVC4__THEORY__BV__THEORY_BV_REWRITER_H +#ifndef CVC4__THEORY__BV__THEORY_BV_REWRITER_H +#define CVC4__THEORY__BV__THEORY_BV_REWRITER_H #include "theory/rewriter.h" #include "util/statistics_registry.h" @@ -109,4 +109,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BV__THEORY_BV_REWRITER_H */ +#endif /* CVC4__THEORY__BV__THEORY_BV_REWRITER_H */ diff --git a/src/theory/bv/theory_bv_type_rules.h b/src/theory/bv/theory_bv_type_rules.h index 616a03f6b..64d04a37e 100644 --- a/src/theory/bv/theory_bv_type_rules.h +++ b/src/theory/bv/theory_bv_type_rules.h @@ -2,9 +2,9 @@ /*! \file theory_bv_type_rules.h ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Dejan Jovanovic, Morgan Deters + ** Aina Niemetz, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include <algorithm> -#ifndef __CVC4__THEORY__BV__THEORY_BV_TYPE_RULES_H -#define __CVC4__THEORY__BV__THEORY_BV_TYPE_RULES_H +#ifndef CVC4__THEORY__BV__THEORY_BV_TYPE_RULES_H +#define CVC4__THEORY__BV__THEORY_BV_TYPE_RULES_H namespace CVC4 { namespace theory { @@ -348,7 +348,7 @@ class BitVectorRotateLeftOpTypeRule TNode n, bool check) { - Assert(n.getKind() == kind::BITVECTOR_ROTATE_LEFT); + Assert(n.getKind() == kind::BITVECTOR_ROTATE_LEFT_OP); return nodeManager->builtinOperatorType(); } }; /* class BitVectorRotateLeftOpTypeRule */ @@ -360,7 +360,7 @@ class BitVectorRotateRightOpTypeRule TNode n, bool check) { - Assert(n.getKind() == kind::BITVECTOR_ROTATE_RIGHT); + Assert(n.getKind() == kind::BITVECTOR_ROTATE_RIGHT_OP); return nodeManager->builtinOperatorType(); } }; /* class BitVectorRotateRightOpTypeRule */ @@ -525,4 +525,4 @@ class BitVectorAckermanizationUremTypeRule } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__BV__THEORY_BV_TYPE_RULES_H */ +#endif /* CVC4__THEORY__BV__THEORY_BV_TYPE_RULES_H */ diff --git a/src/theory/bv/theory_bv_utils.cpp b/src/theory/bv/theory_bv_utils.cpp index 9ccaa58e9..f1cb197ab 100644 --- a/src/theory/bv/theory_bv_utils.cpp +++ b/src/theory/bv/theory_bv_utils.cpp @@ -2,9 +2,9 @@ /*! \file theory_bv_utils.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Tim King, Mathias Preiner + ** Aina Niemetz, Liana Hadarean, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/theory_bv_utils.h b/src/theory/bv/theory_bv_utils.h index 2ece472e4..975796719 100644 --- a/src/theory/bv/theory_bv_utils.h +++ b/src/theory/bv/theory_bv_utils.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/bv/type_enumerator.h b/src/theory/bv/type_enumerator.h index fdf7dfbd3..90aae339b 100644 --- a/src/theory/bv/type_enumerator.h +++ b/src/theory/bv/type_enumerator.h @@ -2,9 +2,9 @@ /*! \file type_enumerator.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Mathias Preiner + ** Morgan Deters, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__BV__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__BV__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__BV__TYPE_ENUMERATOR_H +#define CVC4__THEORY__BV__TYPE_ENUMERATOR_H #include "expr/kind.h" #include "expr/type_node.h" @@ -63,4 +63,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__BV__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__BV__TYPE_ENUMERATOR_H */ diff --git a/src/theory/care_graph.h b/src/theory/care_graph.h index d81cd8389..55851c1a4 100644 --- a/src/theory/care_graph.h +++ b/src/theory/care_graph.h @@ -2,9 +2,9 @@ /*! \file care_graph.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Dejan Jovanovic, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__CARE_GRAPH_H -#define __CVC4__THEORY__CARE_GRAPH_H +#ifndef CVC4__THEORY__CARE_GRAPH_H +#define CVC4__THEORY__CARE_GRAPH_H #include <set> @@ -59,4 +59,4 @@ typedef std::set<CarePair> CareGraph; } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__CARE_GRAPH_H */ +#endif /* CVC4__THEORY__CARE_GRAPH_H */ diff --git a/src/theory/datatypes/datatypes_rewriter.cpp b/src/theory/datatypes/datatypes_rewriter.cpp index a2458e2eb..be87b7e8d 100644 --- a/src/theory/datatypes/datatypes_rewriter.cpp +++ b/src/theory/datatypes/datatypes_rewriter.cpp @@ -2,9 +2,9 @@ /*! \file datatypes_rewriter.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -32,7 +32,7 @@ RewriteResponse DatatypesRewriter::postRewrite(TNode in) { return rewriteConstructor(in); } - else if (k == kind::APPLY_SELECTOR_TOTAL) + else if (k == kind::APPLY_SELECTOR_TOTAL || k == kind::APPLY_SELECTOR) { return rewriteSelector(in); } @@ -191,8 +191,6 @@ Kind DatatypesRewriter::getOperatorKindForSygusBuiltin(Node op) Assert(op.getKind() != BUILTIN); if (op.getKind() == LAMBDA) { - // we use APPLY_UF instead of APPLY, since the rewriter for APPLY_UF - // does beta-reduction but does not for APPLY return APPLY_UF; } TypeNode tn = op.getType(); @@ -247,7 +245,16 @@ Node DatatypesRewriter::mkSygusTerm(const Datatype& dt, Kind ok = NodeManager::operatorToKind(op); if (ok != UNDEFINED_KIND) { - ret = NodeManager::currentNM()->mkNode(ok, schildren); + if (ok == APPLY_UF && schildren.size() == 1) + { + // This case is triggered for defined constant symbols. In this case, + // we return the operator itself instead of an APPLY_UF node. + ret = schildren[0]; + } + else + { + ret = NodeManager::currentNM()->mkNode(ok, schildren); + } Trace("dt-sygus-util") << "...return (op) " << ret << std::endl; return ret; } @@ -331,6 +338,7 @@ RewriteResponse DatatypesRewriter::rewriteConstructor(TNode in) RewriteResponse DatatypesRewriter::rewriteSelector(TNode in) { + Kind k = in.getKind(); if (in[0].getKind() == kind::APPLY_CONSTRUCTOR) { // Have to be careful not to rewrite well-typed expressions @@ -338,17 +346,41 @@ RewriteResponse DatatypesRewriter::rewriteSelector(TNode in) // e.g. "pred(zero)". TypeNode tn = in.getType(); TypeNode argType = in[0].getType(); - TNode selector = in.getOperator(); + Expr selector = in.getOperator().toExpr(); TNode constructor = in[0].getOperator(); size_t constructorIndex = indexOf(constructor); - const Datatype& dt = Datatype::datatypeOf(selector.toExpr()); + const Datatype& dt = Datatype::datatypeOf(selector); const DatatypeConstructor& c = dt[constructorIndex]; Trace("datatypes-rewrite-debug") << "Rewriting collapsable selector : " << in; Trace("datatypes-rewrite-debug") << ", cindex = " << constructorIndex << ", selector is " << selector << std::endl; - int selectorIndex = c.getSelectorIndexInternal(selector.toExpr()); + // The argument that the selector extracts, or -1 if the selector is + // is wrongly applied. + int selectorIndex = -1; + if (k == kind::APPLY_SELECTOR_TOTAL) + { + // The argument index of internal selectors is obtained by + // getSelectorIndexInternal. + selectorIndex = c.getSelectorIndexInternal(selector); + } + else + { + // The argument index of external selectors (applications of + // APPLY_SELECTOR) is given by an attribute and obtained via indexOf below + // The argument is only valid if it is the proper constructor. + selectorIndex = Datatype::indexOf(selector); + if (selectorIndex < 0 + || selectorIndex >= static_cast<int>(c.getNumArgs())) + { + selectorIndex = -1; + } + else if (c[selectorIndex].getSelector() != selector) + { + selectorIndex = -1; + } + } Trace("datatypes-rewrite-debug") << "Internal selector index is " << selectorIndex << std::endl; if (selectorIndex >= 0) @@ -374,7 +406,7 @@ RewriteResponse DatatypesRewriter::rewriteSelector(TNode in) return RewriteResponse(REWRITE_DONE, in[0][selectorIndex]); } } - else + else if (k == kind::APPLY_SELECTOR_TOTAL) { Node gt; bool useTe = true; diff --git a/src/theory/datatypes/datatypes_rewriter.h b/src/theory/datatypes/datatypes_rewriter.h index 2eeecbb0e..6c1d64e5b 100644 --- a/src/theory/datatypes/datatypes_rewriter.h +++ b/src/theory/datatypes/datatypes_rewriter.h @@ -2,9 +2,9 @@ /*! \file datatypes_rewriter.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Tim King + ** Andrew Reynolds, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__DATATYPES__DATATYPES_REWRITER_H -#define __CVC4__THEORY__DATATYPES__DATATYPES_REWRITER_H +#ifndef CVC4__THEORY__DATATYPES__DATATYPES_REWRITER_H +#define CVC4__THEORY__DATATYPES__DATATYPES_REWRITER_H #include "expr/node_manager_attributes.h" #include "options/datatypes_options.h" @@ -258,4 +258,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__DATATYPES__DATATYPES_REWRITER_H */ +#endif /* CVC4__THEORY__DATATYPES__DATATYPES_REWRITER_H */ diff --git a/src/theory/datatypes/datatypes_sygus.cpp b/src/theory/datatypes/datatypes_sygus.cpp index cb2968bd5..ea3bb5f72 100644 --- a/src/theory/datatypes/datatypes_sygus.cpp +++ b/src/theory/datatypes/datatypes_sygus.cpp @@ -2,9 +2,9 @@ /*! \file datatypes_sygus.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/datatypes/datatypes_sygus.h b/src/theory/datatypes/datatypes_sygus.h index 6cf1d7d37..95c259f2b 100644 --- a/src/theory/datatypes/datatypes_sygus.h +++ b/src/theory/datatypes/datatypes_sygus.h @@ -2,9 +2,9 @@ /*! \file datatypes_sygus.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Andres Noetzli + ** Andrew Reynolds, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__DATATYPES__DATATYPES_SYGUS_NEW_H -#define __CVC4__THEORY__DATATYPES__DATATYPES_SYGUS_NEW_H +#ifndef CVC4__THEORY__DATATYPES__DATATYPES_SYGUS_NEW_H +#define CVC4__THEORY__DATATYPES__DATATYPES_SYGUS_NEW_H #include <iostream> #include <map> diff --git a/src/theory/datatypes/sygus_simple_sym.cpp b/src/theory/datatypes/sygus_simple_sym.cpp index a35ab2a03..fb8bd7515 100644 --- a/src/theory/datatypes/sygus_simple_sym.cpp +++ b/src/theory/datatypes/sygus_simple_sym.cpp @@ -2,9 +2,9 @@ /*! \file sygus_simple_sym.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/datatypes/sygus_simple_sym.h b/src/theory/datatypes/sygus_simple_sym.h index 7fb7f4653..815466d00 100644 --- a/src/theory/datatypes/sygus_simple_sym.h +++ b/src/theory/datatypes/sygus_simple_sym.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__DATATYPES__SIMPLE_SYM_BREAK_H -#define __CVC4__THEORY__DATATYPES__SIMPLE_SYM_BREAK_H +#ifndef CVC4__THEORY__DATATYPES__SIMPLE_SYM_BREAK_H +#define CVC4__THEORY__DATATYPES__SIMPLE_SYM_BREAK_H #include <map> #include "theory/quantifiers/sygus/term_database_sygus.h" @@ -104,4 +104,4 @@ class SygusSimpleSymBreak } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__DATATYPES__SIMPLE_SYM_BREAK_H */ +#endif /* CVC4__THEORY__DATATYPES__SIMPLE_SYM_BREAK_H */ diff --git a/src/theory/datatypes/theory_datatypes.cpp b/src/theory/datatypes/theory_datatypes.cpp index 5ed623190..609cdaf6e 100644 --- a/src/theory/datatypes/theory_datatypes.cpp +++ b/src/theory/datatypes/theory_datatypes.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -552,100 +552,130 @@ void TheoryDatatypes::finishInit() { } Node TheoryDatatypes::expandDefinition(LogicRequest &logicRequest, Node n) { - switch( n.getKind() ){ - case kind::APPLY_SELECTOR: { - Trace("dt-expand") << "Dt Expand definition : " << n << std::endl; - Node selector = n.getOperator(); - Expr selectorExpr = selector.toExpr(); - // APPLY_SELECTOR always applies to an external selector, cindexOf is legal here - size_t cindex = Datatype::cindexOf(selectorExpr); - const Datatype& dt = Datatype::datatypeOf(selectorExpr); - const DatatypeConstructor& c = dt[cindex]; - Node selector_use; - TypeNode ndt = n[0].getType(); - if( options::dtSharedSelectors() ){ - size_t selectorIndex = DatatypesRewriter::indexOf(selector); - Trace("dt-expand") << "...selector index = " << selectorIndex << std::endl; - Assert( selectorIndex<c.getNumArgs() ); - selector_use = Node::fromExpr( c.getSelectorInternal( ndt.toType(), selectorIndex ) ); - }else{ - selector_use = selector; - } - Node sel = NodeManager::currentNM()->mkNode( kind::APPLY_SELECTOR_TOTAL, selector_use, n[0] ); - if( options::dtRewriteErrorSel() ){ - return sel; - }else{ - Expr tester = c.getTester(); - Node tst = NodeManager::currentNM()->mkNode( kind::APPLY_TESTER, Node::fromExpr( tester ), n[0] ); - tst = Rewriter::rewrite( tst ); - Node n_ret; - if( tst==d_true ){ - n_ret = sel; + NodeManager* nm = NodeManager::currentNM(); + switch (n.getKind()) + { + case kind::APPLY_SELECTOR: + { + Trace("dt-expand") << "Dt Expand definition : " << n << std::endl; + Node selector = n.getOperator(); + Expr selectorExpr = selector.toExpr(); + // APPLY_SELECTOR always applies to an external selector, cindexOf is + // legal here + size_t cindex = Datatype::cindexOf(selectorExpr); + const Datatype& dt = Datatype::datatypeOf(selectorExpr); + const DatatypeConstructor& c = dt[cindex]; + Node selector_use; + TypeNode ndt = n[0].getType(); + if (options::dtSharedSelectors()) + { + size_t selectorIndex = DatatypesRewriter::indexOf(selector); + Trace("dt-expand") << "...selector index = " << selectorIndex + << std::endl; + Assert(selectorIndex < c.getNumArgs()); + selector_use = + Node::fromExpr(c.getSelectorInternal(ndt.toType(), selectorIndex)); }else{ - mkExpDefSkolem( selector, ndt, n.getType() ); - Node sk = NodeManager::currentNM()->mkNode( kind::APPLY_UF, d_exp_def_skolem[ndt][ selector ], n[0] ); - if( tst==NodeManager::currentNM()->mkConst( false ) ){ - n_ret = sk; + selector_use = selector; + } + Node sel = nm->mkNode(kind::APPLY_SELECTOR_TOTAL, selector_use, n[0]); + if (options::dtRewriteErrorSel()) + { + return sel; + } + else + { + Expr tester = c.getTester(); + Node tst = nm->mkNode(kind::APPLY_TESTER, Node::fromExpr(tester), n[0]); + tst = Rewriter::rewrite(tst); + Node n_ret; + if (tst == d_true) + { + n_ret = sel; }else{ - n_ret = NodeManager::currentNM()->mkNode( kind::ITE, tst, sel, sk ); + mkExpDefSkolem(selector, ndt, n.getType()); + Node sk = + nm->mkNode(kind::APPLY_UF, d_exp_def_skolem[ndt][selector], n[0]); + if (tst == nm->mkConst(false)) + { + n_ret = sk; + } + else + { + n_ret = nm->mkNode(kind::ITE, tst, sel, sk); + } } + // n_ret = Rewriter::rewrite( n_ret ); + Trace("dt-expand") << "Expand def : " << n << " to " << n_ret + << std::endl; + return n_ret; } - //n_ret = Rewriter::rewrite( n_ret ); - Trace("dt-expand") << "Expand def : " << n << " to " << n_ret << std::endl; - return n_ret; } - } break; - default: - return n; + case TUPLE_UPDATE: + case RECORD_UPDATE: + { + TypeNode t = n.getType(); + Assert(t.isDatatype()); + const Datatype& dt = DatatypeType(t.toType()).getDatatype(); + NodeBuilder<> b(APPLY_CONSTRUCTOR); + b << Node::fromExpr(dt[0].getConstructor()); + size_t size, updateIndex; + if (n.getKind() == TUPLE_UPDATE) + { + Assert(t.isTuple()); + size = t.getTupleLength(); + updateIndex = n.getOperator().getConst<TupleUpdate>().getIndex(); + } + else + { + Assert(t.isRecord()); + const Record& record = t.getRecord(); + size = record.getNumFields(); + updateIndex = record.getIndex( + n.getOperator().getConst<RecordUpdate>().getField()); + } + Debug("tuprec") << "expr is " << n << std::endl; + Debug("tuprec") << "updateIndex is " << updateIndex << std::endl; + Debug("tuprec") << "t is " << t << std::endl; + Debug("tuprec") << "t has arity " << size << std::endl; + for (size_t i = 0; i < size; ++i) + { + if (i == updateIndex) + { + b << n[1]; + Debug("tuprec") << "arg " << i << " gets updated to " << n[1] + << std::endl; + } + else + { + b << nm->mkNode( + APPLY_SELECTOR_TOTAL, + Node::fromExpr(dt[0].getSelectorInternal(t.toType(), i)), + n[0]); + Debug("tuprec") << "arg " << i << " copies " + << b[b.getNumChildren() - 1] << std::endl; + } + } + Node n_ret = b; + Debug("tuprec") << "return " << n_ret << std::endl; + return n_ret; + } break; + default: return n; break; } Unreachable(); } -void TheoryDatatypes::presolve() { +void TheoryDatatypes::presolve() +{ Debug("datatypes") << "TheoryDatatypes::presolve()" << endl; } -Node TheoryDatatypes::ppRewrite(TNode in) { +Node TheoryDatatypes::ppRewrite(TNode in) +{ Debug("tuprec") << "TheoryDatatypes::ppRewrite(" << in << ")" << endl; - TypeNode t = in.getType(); - - if(in.getKind() == kind::TUPLE_UPDATE || in.getKind() == kind::RECORD_UPDATE) { - Assert( t.isDatatype() ); - const Datatype& dt = DatatypeType(t.toType()).getDatatype(); - NodeBuilder<> b(kind::APPLY_CONSTRUCTOR); - b << Node::fromExpr(dt[0].getConstructor()); - size_t size, updateIndex; - if(in.getKind() == kind::TUPLE_UPDATE) { - Assert( t.isTuple() ); - size = t.getTupleLength(); - updateIndex = in.getOperator().getConst<TupleUpdate>().getIndex(); - } else { // kind::RECORD_UPDATE - Assert( t.isRecord() ); - const Record& record = t.getRecord(); - size = record.getNumFields(); - updateIndex = record.getIndex(in.getOperator().getConst<RecordUpdate>().getField()); - } - Debug("tuprec") << "expr is " << in << std::endl; - Debug("tuprec") << "updateIndex is " << updateIndex << std::endl; - Debug("tuprec") << "t is " << t << std::endl; - Debug("tuprec") << "t has arity " << size << std::endl; - for(size_t i = 0; i < size; ++i) { - if(i == updateIndex) { - b << in[1]; - Debug("tuprec") << "arg " << i << " gets updated to " << in[1] << std::endl; - } else { - b << NodeManager::currentNM()->mkNode(kind::APPLY_SELECTOR_TOTAL, Node::fromExpr(dt[0].getSelectorInternal( t.toType(), i )), in[0]); - Debug("tuprec") << "arg " << i << " copies " << b[b.getNumChildren() - 1] << std::endl; - } - } - Debug("tuprec") << "builder says " << b << std::endl; - Node n = b; - return n; - } - if( in.getKind()==EQUAL ){ Node nn; std::vector< Node > rew; diff --git a/src/theory/datatypes/theory_datatypes.h b/src/theory/datatypes/theory_datatypes.h index a7b40e282..b4803e69a 100644 --- a/src/theory/datatypes/theory_datatypes.h +++ b/src/theory/datatypes/theory_datatypes.h @@ -2,9 +2,9 @@ /*! \file theory_datatypes.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Morgan Deters + ** Andrew Reynolds, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__DATATYPES__THEORY_DATATYPES_H -#define __CVC4__THEORY__DATATYPES__THEORY_DATATYPES_H +#ifndef CVC4__THEORY__DATATYPES__THEORY_DATATYPES_H +#define CVC4__THEORY__DATATYPES__THEORY_DATATYPES_H #include <iostream> #include <map> @@ -370,4 +370,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__DATATYPES__THEORY_DATATYPES_H */ +#endif /* CVC4__THEORY__DATATYPES__THEORY_DATATYPES_H */ diff --git a/src/theory/datatypes/theory_datatypes_type_rules.h b/src/theory/datatypes/theory_datatypes_type_rules.h index 8a5849010..22ac074f0 100644 --- a/src/theory/datatypes/theory_datatypes_type_rules.h +++ b/src/theory/datatypes/theory_datatypes_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__DATATYPES__THEORY_DATATYPES_TYPE_RULES_H -#define __CVC4__THEORY__DATATYPES__THEORY_DATATYPES_TYPE_RULES_H +#ifndef CVC4__THEORY__DATATYPES__THEORY_DATATYPES_TYPE_RULES_H +#define CVC4__THEORY__DATATYPES__THEORY_DATATYPES_TYPE_RULES_H #include "expr/matcher.h" //#include "expr/attribute.h" @@ -433,4 +433,4 @@ class DtSyguEvalTypeRule } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__DATATYPES__THEORY_DATATYPES_TYPE_RULES_H */ +#endif /* CVC4__THEORY__DATATYPES__THEORY_DATATYPES_TYPE_RULES_H */ diff --git a/src/theory/datatypes/type_enumerator.cpp b/src/theory/datatypes/type_enumerator.cpp index afe6e182f..609106b46 100644 --- a/src/theory/datatypes/type_enumerator.cpp +++ b/src/theory/datatypes/type_enumerator.cpp @@ -2,9 +2,9 @@ /*! \file type_enumerator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/datatypes/type_enumerator.h b/src/theory/datatypes/type_enumerator.h index 13d590508..a294324fa 100644 --- a/src/theory/datatypes/type_enumerator.h +++ b/src/theory/datatypes/type_enumerator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__DATATYPES__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__DATATYPES__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__DATATYPES__TYPE_ENUMERATOR_H +#define CVC4__THEORY__DATATYPES__TYPE_ENUMERATOR_H #include "theory/type_enumerator.h" #include "expr/type_node.h" @@ -185,4 +185,4 @@ class DatatypesEnumerator : public TypeEnumeratorBase<DatatypesEnumerator> { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__DATATYPES__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__DATATYPES__TYPE_ENUMERATOR_H */ diff --git a/src/theory/decision_manager.cpp b/src/theory/decision_manager.cpp index 5c43e6159..3eda45b00 100644 --- a/src/theory/decision_manager.cpp +++ b/src/theory/decision_manager.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/decision_manager.h b/src/theory/decision_manager.h index fbc0e2cd6..6825c1cf4 100644 --- a/src/theory/decision_manager.h +++ b/src/theory/decision_manager.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__DECISION_MANAGER__H -#define __CVC4__THEORY__DECISION_MANAGER__H +#ifndef CVC4__THEORY__DECISION_MANAGER__H +#define CVC4__THEORY__DECISION_MANAGER__H #include <map> #include "theory/decision_strategy.h" @@ -116,4 +116,4 @@ class DecisionManager } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__DECISION_MANAGER__H */ +#endif /* CVC4__THEORY__DECISION_MANAGER__H */ diff --git a/src/theory/decision_strategy.cpp b/src/theory/decision_strategy.cpp index fcd11f6ba..b14936ee9 100644 --- a/src/theory/decision_strategy.cpp +++ b/src/theory/decision_strategy.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/decision_strategy.h b/src/theory/decision_strategy.h index 04788f515..65b80b7f6 100644 --- a/src/theory/decision_strategy.h +++ b/src/theory/decision_strategy.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__DECISION_STRATEGY__H -#define __CVC4__THEORY__DECISION_STRATEGY__H +#ifndef CVC4__THEORY__DECISION_STRATEGY__H +#define CVC4__THEORY__DECISION_STRATEGY__H #include <map> #include "context/cdo.h" @@ -143,4 +143,4 @@ class DecisionStrategySingleton : public DecisionStrategyFmf } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__DECISION_STRATEGY__H */ +#endif /* CVC4__THEORY__DECISION_STRATEGY__H */ diff --git a/src/theory/evaluator.cpp b/src/theory/evaluator.cpp index 0a0176f25..818f40e8c 100644 --- a/src/theory/evaluator.cpp +++ b/src/theory/evaluator.cpp @@ -2,9 +2,9 @@ /*! \file evaluator.cpp ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Andres Noetzli, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/evaluator.h b/src/theory/evaluator.h index 0d7ddbec8..5c0e9b944 100644 --- a/src/theory/evaluator.h +++ b/src/theory/evaluator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__EVALUATOR_H -#define __CVC4__THEORY__EVALUATOR_H +#ifndef CVC4__THEORY__EVALUATOR_H +#define CVC4__THEORY__EVALUATOR_H #include <utility> #include <vector> @@ -110,4 +110,4 @@ class Evaluator } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__EVALUATOR_H */ +#endif /* CVC4__THEORY__EVALUATOR_H */ diff --git a/src/theory/example/ecdata.cpp b/src/theory/example/ecdata.cpp index 4089ad45d..6a66f5491 100644 --- a/src/theory/example/ecdata.cpp +++ b/src/theory/example/ecdata.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/example/ecdata.h b/src/theory/example/ecdata.h index 7c62f9833..c646725e8 100644 --- a/src/theory/example/ecdata.h +++ b/src/theory/example/ecdata.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__UF__TIM__ECDATA_H -#define __CVC4__THEORY__UF__TIM__ECDATA_H +#ifndef CVC4__THEORY__UF__TIM__ECDATA_H +#define CVC4__THEORY__UF__TIM__ECDATA_H #include "expr/node.h" #include "context/context.h" @@ -255,4 +255,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__UF__TIM__ECDATA_H */ +#endif /* CVC4__THEORY__UF__TIM__ECDATA_H */ diff --git a/src/theory/example/theory_uf_tim.cpp b/src/theory/example/theory_uf_tim.cpp index fa329f1d5..54d2e3209 100644 --- a/src/theory/example/theory_uf_tim.cpp +++ b/src/theory/example/theory_uf_tim.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/example/theory_uf_tim.h b/src/theory/example/theory_uf_tim.h index ccdab9d35..20fd6bcfb 100644 --- a/src/theory/example/theory_uf_tim.h +++ b/src/theory/example/theory_uf_tim.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -22,8 +22,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__UF__TIM__THEORY_UF_TIM_H -#define __CVC4__THEORY__UF__TIM__THEORY_UF_TIM_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" @@ -210,4 +210,4 @@ typedef expr::Attribute<ECAttrTag, ECData*, ECCleanupStrategy> ECAttr; }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__UF__TIM__THEORY_UF_TIM_H */ +#endif /* CVC4__THEORY__UF__TIM__THEORY_UF_TIM_H */ diff --git a/src/theory/ext_theory.cpp b/src/theory/ext_theory.cpp index c1e7c971f..5a37889a2 100644 --- a/src/theory/ext_theory.cpp +++ b/src/theory/ext_theory.cpp @@ -2,9 +2,9 @@ /*! \file ext_theory.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andrew Reynolds, Dejan Jovanovic + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/ext_theory.h b/src/theory/ext_theory.h index 8657d0fb8..7ac79a4d6 100644 --- a/src/theory/ext_theory.h +++ b/src/theory/ext_theory.h @@ -2,9 +2,9 @@ /*! \file ext_theory.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -30,8 +30,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__EXT_THEORY_H -#define __CVC4__THEORY__EXT_THEORY_H +#ifndef CVC4__THEORY__EXT_THEORY_H +#define CVC4__THEORY__EXT_THEORY_H #include <map> #include <set> @@ -247,4 +247,4 @@ class ExtTheory } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__EXT_THEORY_H */ +#endif /* CVC4__THEORY__EXT_THEORY_H */ diff --git a/src/theory/fp/fp_converter.cpp b/src/theory/fp/fp_converter.cpp index dc6c001c9..a69cf8c96 100644 --- a/src/theory/fp/fp_converter.cpp +++ b/src/theory/fp/fp_converter.cpp @@ -2,9 +2,9 @@ /*! \file fp_converter.cpp ** \verbatim ** Top contributors (to current version): - ** Martin Brain + ** Martin Brain, Andres Noetzli, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/fp/fp_converter.h b/src/theory/fp/fp_converter.h index 018f3ee66..753030408 100644 --- a/src/theory/fp/fp_converter.h +++ b/src/theory/fp/fp_converter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Martin Brain ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__FP__FP_CONVERTER_H -#define __CVC4__THEORY__FP__FP_CONVERTER_H +#ifndef CVC4__THEORY__FP__FP_CONVERTER_H +#define CVC4__THEORY__FP__FP_CONVERTER_H #include "base/cvc4_assert.h" #include "context/cdhashmap.h" @@ -355,4 +355,4 @@ class FpConverter } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__FP__THEORY_FP_H */ +#endif /* CVC4__THEORY__FP__THEORY_FP_H */ diff --git a/src/theory/fp/theory_fp.cpp b/src/theory/fp/theory_fp.cpp index 364df3890..2c93553fe 100644 --- a/src/theory/fp/theory_fp.cpp +++ b/src/theory/fp/theory_fp.cpp @@ -2,9 +2,9 @@ /*! \file theory_fp.cpp ** \verbatim ** Top contributors (to current version): - ** Martin Brain, Andrew Reynolds, Tim King + ** Martin Brain, Andres Noetzli, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,9 +15,12 @@ ** \todo document this file **/ -#include "theory/fp/theory_fp.h" + +#include "options/fp_options.h" #include "theory/rewriter.h" #include "theory/theory_model.h" +#include "theory/fp/theory_fp.h" + #include <set> #include <stack> @@ -306,7 +309,7 @@ Node TheoryFp::toRealUF(Node node) { std::vector<TypeNode> args(1); args[0] = t; fun = nm->mkSkolem("floatingpoint_to_real_infinity_and_NaN_case", - nm->mkFunctionType(args, nm->realType()), + nm->mkFunctionType(args, nm->realType()), "floatingpoint_to_real_infinity_and_NaN_case", NodeManager::SKOLEM_EXACT_NAME); d_toRealMap.insert(t, fun); @@ -876,7 +879,27 @@ bool TheoryFp::isRegistered(TNode node) { return !(d_registeredTerms.find(node) == d_registeredTerms.end()); } -void TheoryFp::preRegisterTerm(TNode node) { +void TheoryFp::preRegisterTerm(TNode node) +{ + if (Configuration::isBuiltWithSymFPU() && !options::fpExp()) + { + TypeNode tn = node.getType(); + if (tn.isFloatingPoint()) + { + unsigned exp_sz = tn.getFloatingPointExponentSize(); + unsigned sig_sz = tn.getFloatingPointSignificandSize(); + if (!((exp_sz == 8 && sig_sz == 24) || (exp_sz == 11 && sig_sz == 53))) + { + std::stringstream ss; + ss << "FP term " << node << " with type whose size is " << exp_sz << "/" + << sig_sz + << " is not supported, only Float32 (8/24) or Float64 (11/53) types " + "are supported in default mode. Try the experimental solver via " + "--fp-exp"; + throw LogicException(ss.str()); + } + } + } Trace("fp-preRegisterTerm") << "TheoryFp::preRegisterTerm(): " << node << std::endl; registerTerm(node); @@ -1084,6 +1107,41 @@ bool TheoryFp::collectModelInfo(TheoryModel *m) { return false; } + + if (Configuration::isAssertionBuild() && isLeaf(node) && !node.isConst() + && node.getType().isFloatingPoint()) + { + // Check that the equality engine has asssigned values to all the + // components of `node` except `(sign node)` (the sign component is + // assignable, meaning that the model builder can pick an arbitrary value + // for it if it hasn't been assigned in the equality engine). + NodeManager* nm = NodeManager::currentNM(); + Node compNaN = nm->mkNode(kind::FLOATINGPOINT_COMPONENT_NAN, node); + Node compInf = nm->mkNode(kind::FLOATINGPOINT_COMPONENT_INF, node); + Node compZero = nm->mkNode(kind::FLOATINGPOINT_COMPONENT_ZERO, node); + Node compExponent = + nm->mkNode(kind::FLOATINGPOINT_COMPONENT_EXPONENT, node); + Node compSignificand = + nm->mkNode(kind::FLOATINGPOINT_COMPONENT_SIGNIFICAND, node); + + eq::EqualityEngine* ee = m->getEqualityEngine(); + Assert(ee->hasTerm(compNaN) && ee->getRepresentative(compNaN).isConst()); + Assert(ee->hasTerm(compInf) && ee->getRepresentative(compInf).isConst()); + Assert(ee->hasTerm(compZero) + && ee->getRepresentative(compZero).isConst()); + Assert(ee->hasTerm(compExponent) + && ee->getRepresentative(compExponent).isConst()); + Assert(ee->hasTerm(compSignificand)); + Assert(ee->getRepresentative(compSignificand).isConst()); + + // At most one of the flags (NaN, inf, zero) can be set + Node one = nm->mkConst(BitVector(1U, 1U)); + size_t numFlags = 0; + numFlags += ee->getRepresentative(compNaN) == one ? 1 : 0; + numFlags += ee->getRepresentative(compInf) == one ? 1 : 0; + numFlags += ee->getRepresentative(compZero) == one ? 1 : 0; + Assert(numFlags <= 1); + } } return true; diff --git a/src/theory/fp/theory_fp.h b/src/theory/fp/theory_fp.h index 3d13cc63f..ad093f924 100644 --- a/src/theory/fp/theory_fp.h +++ b/src/theory/fp/theory_fp.h @@ -2,9 +2,9 @@ /*! \file theory_fp.h ** \verbatim ** Top contributors (to current version): - ** Martin Brain, Mathias Preiner, Tim King + ** Martin Brain, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__FP__THEORY_FP_H -#define __CVC4__THEORY__FP__THEORY_FP_H +#ifndef CVC4__THEORY__FP__THEORY_FP_H +#define CVC4__THEORY__FP__THEORY_FP_H #include <string> #include <utility> @@ -148,4 +148,4 @@ class TheoryFp : public Theory { } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__FP__THEORY_FP_H */ +#endif /* CVC4__THEORY__FP__THEORY_FP_H */ diff --git a/src/theory/fp/theory_fp_rewriter.cpp b/src/theory/fp/theory_fp_rewriter.cpp index 875471ded..68ea01eb8 100644 --- a/src/theory/fp/theory_fp_rewriter.cpp +++ b/src/theory/fp/theory_fp_rewriter.cpp @@ -2,10 +2,10 @@ /*! \file theory_fp_rewriter.cpp ** \verbatim ** Top contributors (to current version): - ** Martin Brain, Clark Barrett, Andrew Reynolds + ** Martin Brain, Martin Brain, Andrew Reynolds ** Copyright (c) 2013 University of Oxford ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/fp/theory_fp_rewriter.h b/src/theory/fp/theory_fp_rewriter.h index e39a95615..fef97afea 100644 --- a/src/theory/fp/theory_fp_rewriter.h +++ b/src/theory/fp/theory_fp_rewriter.h @@ -2,9 +2,9 @@ /*! \file theory_fp_rewriter.h ** \verbatim ** Top contributors (to current version): - ** Martin Brain, Paul Meng + ** Martin Brain ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__FP__THEORY_FP_REWRITER_H -#define __CVC4__THEORY__FP__THEORY_FP_REWRITER_H +#ifndef CVC4__THEORY__FP__THEORY_FP_REWRITER_H +#define CVC4__THEORY__FP__THEORY_FP_REWRITER_H #include "theory/rewriter.h" @@ -64,4 +64,4 @@ class TheoryFpRewriter { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__FP__THEORY_FP_REWRITER_H */ +#endif /* CVC4__THEORY__FP__THEORY_FP_REWRITER_H */ diff --git a/src/theory/fp/theory_fp_type_rules.h b/src/theory/fp/theory_fp_type_rules.h index 94ce476bf..4022cc278 100644 --- a/src/theory/fp/theory_fp_type_rules.h +++ b/src/theory/fp/theory_fp_type_rules.h @@ -2,9 +2,9 @@ /*! \file theory_fp_type_rules.h ** \verbatim ** Top contributors (to current version): - ** Martin Brain, Tim King + ** Martin Brain, Tim King, Martin Brain ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ // This is only needed for checking that components are only applied to leaves. #include "theory/theory.h" -#ifndef __CVC4__THEORY__FP__THEORY_FP_TYPE_RULES_H -#define __CVC4__THEORY__FP__THEORY_FP_TYPE_RULES_H +#ifndef CVC4__THEORY__FP__THEORY_FP_TYPE_RULES_H +#define CVC4__THEORY__FP__THEORY_FP_TYPE_RULES_H namespace CVC4 { namespace theory { @@ -806,4 +806,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__FP__THEORY_FP_TYPE_RULES_H */ +#endif /* CVC4__THEORY__FP__THEORY_FP_TYPE_RULES_H */ diff --git a/src/theory/fp/type_enumerator.h b/src/theory/fp/type_enumerator.h index eeb1ac4f8..4494fd40f 100644 --- a/src/theory/fp/type_enumerator.h +++ b/src/theory/fp/type_enumerator.h @@ -2,10 +2,10 @@ /*! \file type_enumerator.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Martin Brain + ** Tim King, Martin Brain, Andrew Reynolds ** Copyright (c) 2009-2015 New York University and The University of Iowa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__FP__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__FP__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__FP__TYPE_ENUMERATOR_H +#define CVC4__THEORY__FP__TYPE_ENUMERATOR_H #include "expr/kind.h" #include "expr/type_node.h" @@ -132,4 +132,4 @@ class RoundingModeEnumerator } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__FP__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__FP__TYPE_ENUMERATOR_H */ diff --git a/src/theory/idl/idl_assertion.cpp b/src/theory/idl/idl_assertion.cpp index 8b5758f5a..1e3905537 100644 --- a/src/theory/idl/idl_assertion.cpp +++ b/src/theory/idl/idl_assertion.cpp @@ -2,9 +2,9 @@ /*! \file idl_assertion.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters + ** Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/idl/idl_assertion.h b/src/theory/idl/idl_assertion.h index 6804945f3..e24fbfc67 100644 --- a/src/theory/idl/idl_assertion.h +++ b/src/theory/idl/idl_assertion.h @@ -2,9 +2,9 @@ /*! \file idl_assertion.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters + ** Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/idl/idl_assertion_db.cpp b/src/theory/idl/idl_assertion_db.cpp index 150d0814a..865d8b4f5 100644 --- a/src/theory/idl/idl_assertion_db.cpp +++ b/src/theory/idl/idl_assertion_db.cpp @@ -2,9 +2,9 @@ /*! \file idl_assertion_db.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters + ** Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/idl/idl_assertion_db.h b/src/theory/idl/idl_assertion_db.h index 8d7edc87c..ac87282d9 100644 --- a/src/theory/idl/idl_assertion_db.h +++ b/src/theory/idl/idl_assertion_db.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/idl/idl_model.cpp b/src/theory/idl/idl_model.cpp index 98a7ed7c2..729a18ee4 100644 --- a/src/theory/idl/idl_model.cpp +++ b/src/theory/idl/idl_model.cpp @@ -2,9 +2,9 @@ /*! \file idl_model.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters + ** Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/idl/idl_model.h b/src/theory/idl/idl_model.h index a58c2d79c..87e67edea 100644 --- a/src/theory/idl/idl_model.h +++ b/src/theory/idl/idl_model.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/idl/theory_idl.cpp b/src/theory/idl/theory_idl.cpp index ab87cb1a9..12ac1e802 100644 --- a/src/theory/idl/theory_idl.cpp +++ b/src/theory/idl/theory_idl.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/idl/theory_idl.h b/src/theory/idl/theory_idl.h index 17f19ca4a..1d48d0785 100644 --- a/src/theory/idl/theory_idl.h +++ b/src/theory/idl/theory_idl.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/interrupted.h b/src/theory/interrupted.h index 8ab6f0ba7..905a98689 100644 --- a/src/theory/interrupted.h +++ b/src/theory/interrupted.h @@ -2,9 +2,9 @@ /*! \file interrupted.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -26,8 +26,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__INTERRUPTED_H -#define __CVC4__THEORY__INTERRUPTED_H +#ifndef CVC4__THEORY__INTERRUPTED_H +#define CVC4__THEORY__INTERRUPTED_H #include "base/exception.h" @@ -40,4 +40,4 @@ class Interrupted : public CVC4::Exception { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__INTERRUPTED_H */ +#endif /* CVC4__THEORY__INTERRUPTED_H */ diff --git a/src/theory/logic_info.cpp b/src/theory/logic_info.cpp index 7d41ff5e6..1712bb30a 100644 --- a/src/theory/logic_info.cpp +++ b/src/theory/logic_info.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/logic_info.h b/src/theory/logic_info.h index 2edc049c6..a765472dd 100644 --- a/src/theory/logic_info.h +++ b/src/theory/logic_info.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__LOGIC_INFO_H -#define __CVC4__LOGIC_INFO_H +#ifndef CVC4__LOGIC_INFO_H +#define CVC4__LOGIC_INFO_H #include <string> #include <vector> @@ -279,4 +279,4 @@ std::ostream& operator<<(std::ostream& out, const LogicInfo& logic) CVC4_PUBLIC; }/* CVC4 namespace */ -#endif /* __CVC4__LOGIC_INFO_H */ +#endif /* CVC4__LOGIC_INFO_H */ diff --git a/src/theory/output_channel.h b/src/theory/output_channel.h index bb8103891..347177b93 100644 --- a/src/theory/output_channel.h +++ b/src/theory/output_channel.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__OUTPUT_CHANNEL_H -#define __CVC4__THEORY__OUTPUT_CHANNEL_H +#ifndef CVC4__THEORY__OUTPUT_CHANNEL_H +#define CVC4__THEORY__OUTPUT_CHANNEL_H #include <memory> @@ -194,4 +194,4 @@ class OutputChannel { } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__OUTPUT_CHANNEL_H */ +#endif /* CVC4__THEORY__OUTPUT_CHANNEL_H */ diff --git a/src/theory/quantifiers/alpha_equivalence.cpp b/src/theory/quantifiers/alpha_equivalence.cpp index 577b2c31f..bb0cdde83 100644 --- a/src/theory/quantifiers/alpha_equivalence.cpp +++ b/src/theory/quantifiers/alpha_equivalence.cpp @@ -2,9 +2,9 @@ /*! \file alpha_equivalence.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/alpha_equivalence.h b/src/theory/quantifiers/alpha_equivalence.h index 4ab45b015..b5d68f233 100644 --- a/src/theory/quantifiers/alpha_equivalence.h +++ b/src/theory/quantifiers/alpha_equivalence.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__ALPHA_EQUIVALENCE_H -#define __CVC4__ALPHA_EQUIVALENCE_H +#ifndef CVC4__ALPHA_EQUIVALENCE_H +#define CVC4__ALPHA_EQUIVALENCE_H #include "theory/quantifiers_engine.h" diff --git a/src/theory/quantifiers/anti_skolem.cpp b/src/theory/quantifiers/anti_skolem.cpp index 08e215d72..5d1967bb4 100644 --- a/src/theory/quantifiers/anti_skolem.cpp +++ b/src/theory/quantifiers/anti_skolem.cpp @@ -2,9 +2,9 @@ /*! \file anti_skolem.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/anti_skolem.h b/src/theory/quantifiers/anti_skolem.h index 162140ff1..3a7dc2da8 100644 --- a/src/theory/quantifiers/anti_skolem.h +++ b/src/theory/quantifiers/anti_skolem.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANT_ANTI_SKOLEM_H -#define __CVC4__THEORY__QUANT_ANTI_SKOLEM_H +#ifndef CVC4__THEORY__QUANT_ANTI_SKOLEM_H +#define CVC4__THEORY__QUANT_ANTI_SKOLEM_H #include <map> #include <vector> diff --git a/src/theory/quantifiers/bv_inverter.cpp b/src/theory/quantifiers/bv_inverter.cpp index 2525f5d18..24e3a85b5 100644 --- a/src/theory/quantifiers/bv_inverter.cpp +++ b/src/theory/quantifiers/bv_inverter.cpp @@ -2,9 +2,9 @@ /*! \file bv_inverter.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Mathias Preiner, Andrew Reynolds + ** Aina Niemetz, Andrew Reynolds, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/bv_inverter.h b/src/theory/quantifiers/bv_inverter.h index ad16a2ed9..746bfba9a 100644 --- a/src/theory/quantifiers/bv_inverter.h +++ b/src/theory/quantifiers/bv_inverter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Mathias Preiner, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BV_INVERTER_H -#define __CVC4__BV_INVERTER_H +#ifndef CVC4__BV_INVERTER_H +#define CVC4__BV_INVERTER_H #include <map> #include <unordered_map> @@ -130,4 +130,4 @@ class BvInverter } // namespace theory } // namespace CVC4 -#endif /* __CVC4__BV_INVERTER_H */ +#endif /* CVC4__BV_INVERTER_H */ diff --git a/src/theory/quantifiers/bv_inverter_utils.cpp b/src/theory/quantifiers/bv_inverter_utils.cpp index 8ad26a422..e01af3f38 100644 --- a/src/theory/quantifiers/bv_inverter_utils.cpp +++ b/src/theory/quantifiers/bv_inverter_utils.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file bv_inverter.cpp +/*! \file bv_inverter_utils.cpp ** \verbatim ** Top contributors (to current version): ** Aina Niemetz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/bv_inverter_utils.h b/src/theory/quantifiers/bv_inverter_utils.h index 0fec00579..264b42ef5 100644 --- a/src/theory/quantifiers/bv_inverter_utils.h +++ b/src/theory/quantifiers/bv_inverter_utils.h @@ -1,10 +1,10 @@ /********************* */ -/*! \file bv_inverter.cpp +/*! \file bv_inverter_utils.h ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Mathias Preiner + ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BV_INVERTER_UTILS_H -#define __CVC4__BV_INVERTER_UTILS_H +#ifndef CVC4__BV_INVERTER_UTILS_H +#define CVC4__BV_INVERTER_UTILS_H #include "expr/node.h" diff --git a/src/theory/quantifiers/candidate_rewrite_database.cpp b/src/theory/quantifiers/candidate_rewrite_database.cpp index 2d2e9ce30..e00bc957f 100644 --- a/src/theory/quantifiers/candidate_rewrite_database.cpp +++ b/src/theory/quantifiers/candidate_rewrite_database.cpp @@ -2,9 +2,9 @@ /*! \file candidate_rewrite_database.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -69,9 +69,29 @@ void CandidateRewriteDatabase::initializeSygus(const std::vector<Node>& vars, } bool CandidateRewriteDatabase::addTerm(Node sol, + bool rec, std::ostream& out, bool& rew_print) { + // have we added this term before? + std::unordered_map<Node, bool, NodeHashFunction>::iterator itac = + d_add_term_cache.find(sol); + if (itac != d_add_term_cache.end()) + { + return itac->second; + } + + if (rec) + { + // if recursive, we first add all subterms + for (const Node& solc : sol) + { + // whether a candidate rewrite is printed for any subterm is irrelevant + bool rew_printc = false; + addTerm(solc, rec, out, rew_printc); + } + } + // register the term bool is_unique_term = true; Node eq_sol = d_sampler->registerTerm(sol); // eq_sol is a candidate solution that is equivalent to sol @@ -117,9 +137,9 @@ bool CandidateRewriteDatabase::addTerm(Node sol, // options as the SmtEngine we belong to, where we ensure that // produce-models is set. bool needExport = false; - ExprManagerMapCollection varMap; ExprManager em(nm->getOptions()); std::unique_ptr<SmtEngine> rrChecker; + ExprManagerMapCollection varMap; initializeChecker(rrChecker, em, varMap, crr, needExport); Result r = rrChecker->checkSat(); Trace("rr-check") << "...result : " << r << std::endl; @@ -252,13 +272,18 @@ bool CandidateRewriteDatabase::addTerm(Node sol, // it discards it as a redundant candidate rewrite rule before // checking its correctness. } + d_add_term_cache[sol] = is_unique_term; return is_unique_term; } -bool CandidateRewriteDatabase::addTerm(Node sol, std::ostream& out) +bool CandidateRewriteDatabase::addTerm(Node sol, bool rec, std::ostream& out) { bool rew_print = false; - return addTerm(sol, out, rew_print); + return addTerm(sol, rec, out, rew_print); +} +bool CandidateRewriteDatabase::addTerm(Node sol, std::ostream& out) +{ + return addTerm(sol, false, out); } void CandidateRewriteDatabase::setSilent(bool flag) { d_silent = flag; } @@ -298,7 +323,7 @@ bool CandidateRewriteDatabaseGen::addTerm(Node n, std::ostream& out) Trace("synth-rr-dbg") << "...finish." << std::endl; } Trace("synth-rr-dbg") << "Add term " << nr << " for " << tn << std::endl; - return itc->second.addTerm(nr, out); + return itc->second.addTerm(nr, false, out); } } /* CVC4::theory::quantifiers namespace */ diff --git a/src/theory/quantifiers/candidate_rewrite_database.h b/src/theory/quantifiers/candidate_rewrite_database.h index 5b8ffbd94..b68b20998 100644 --- a/src/theory/quantifiers/candidate_rewrite_database.h +++ b/src/theory/quantifiers/candidate_rewrite_database.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_DATABASE_H -#define __CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_DATABASE_H +#ifndef CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_DATABASE_H +#define CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_DATABASE_H #include <map> #include <memory> @@ -71,9 +71,13 @@ class CandidateRewriteDatabase : public ExprMiner * cause a candidate-rewrite to be printed on the output stream out. * We return true if the term sol is distinct (up to equivalence) with * all previous terms added to this class. The argument rew_print is set to - * true if this class printed a rewrite. + * true if this class printed a rewrite involving sol. + * + * If the flag rec is true, then we also recursively add all subterms of sol + * to this class as well. */ - bool addTerm(Node sol, std::ostream& out, bool& rew_print); + bool addTerm(Node sol, bool rec, std::ostream& out, bool& rew_print); + bool addTerm(Node sol, bool rec, std::ostream& out); bool addTerm(Node sol, std::ostream& out) override; /** sets whether this class should output candidate rewrites it finds */ void setSilent(bool flag); @@ -93,6 +97,8 @@ class CandidateRewriteDatabase : public ExprMiner bool d_using_sygus; /** candidate rewrite filter */ CandidateRewriteFilter d_crewrite_filter; + /** the cache for results of addTerm */ + std::unordered_map<Node, bool, NodeHashFunction> d_add_term_cache; /** if true, we silence the output of candidate rewrites */ bool d_silent; }; @@ -115,7 +121,8 @@ class CandidateRewriteDatabaseGen * This registers term n with this class. We generate the candidate rewrite * database of the appropriate type (if not allocated already), and register * n with this database. This may result in "candidate-rewrite" being - * printed on the output stream out. + * printed on the output stream out. We return true if the term sol is + * distinct (up to equivalence) with all previous terms added to this class. */ bool addTerm(Node n, std::ostream& out); @@ -138,4 +145,4 @@ class CandidateRewriteDatabaseGen } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_DATABASE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_DATABASE_H */ diff --git a/src/theory/quantifiers/candidate_rewrite_filter.cpp b/src/theory/quantifiers/candidate_rewrite_filter.cpp index 0d3878149..53c40464f 100644 --- a/src/theory/quantifiers/candidate_rewrite_filter.cpp +++ b/src/theory/quantifiers/candidate_rewrite_filter.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -290,6 +290,12 @@ bool CandidateRewriteFilter::filterPair(Node n, Node eq_n) // ----- check rewriting redundancy if (keep && options::sygusRewSynthFilterCong()) { + // When using sygus types, this filtering applies to the builtin versions + // of n and eq_n. This means that we may filter out a rewrite rule for one + // sygus type based on another, e.g. we won't report x=x+0 for both A and B + // in: + // A -> x | 0 | A+A + // B -> x | 0 | B+B Trace("cr-filter-debug") << "Check equal rewrite pair..." << std::endl; if (d_drewrite->areEqual(bn, beq_n)) { @@ -309,7 +315,9 @@ bool CandidateRewriteFilter::filterPair(Node n, Node eq_n) Node bni = d_drewrite->toInternal(bn); if (!bni.isNull()) { - if (!d_match_trie.getMatches(bni, &d_ssenm)) + // as with congruence filtering, we cache based on the builtin type + TypeNode tn = bn.getType(); + if (!d_match_trie[tn].getMatches(bni, &d_ssenm)) { keep = false; Trace("cr-filter") << "...redundant (matchable)" << std::endl; @@ -357,6 +365,8 @@ void CandidateRewriteFilter::registerRelevantPair(Node n, Node eq_n) } if (options::sygusRewSynthFilterMatch()) { + // cache based on the builtin type + TypeNode tn = bn.getType(); // add to match information for (unsigned r = 0; r < 2; r++) { @@ -369,7 +379,7 @@ void CandidateRewriteFilter::registerRelevantPair(Node n, Node eq_n) Node ti = d_drewrite->toInternal(t); if (!ti.isNull()) { - d_match_trie.addTerm(ti); + d_match_trie[tn].addTerm(ti); } } d_pairs[t].insert(to); diff --git a/src/theory/quantifiers/candidate_rewrite_filter.h b/src/theory/quantifiers/candidate_rewrite_filter.h index ca071faa4..af9ac6d87 100644 --- a/src/theory/quantifiers/candidate_rewrite_filter.h +++ b/src/theory/quantifiers/candidate_rewrite_filter.h @@ -2,9 +2,9 @@ /*! \file candidate_rewrite_filter.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_FILTER_H -#define __CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_FILTER_H +#ifndef CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_FILTER_H +#define CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_FILTER_H #include <map> #include "theory/quantifiers/dynamic_rewrite.h" @@ -165,14 +165,16 @@ class CandidateRewriteFilter * detail, if (t,s) is a relevant pair, then t in d_pairs[s]. */ std::map<Node, std::unordered_set<Node, NodeHashFunction> > d_pairs; - /** Match trie storing all terms in the domain of d_pairs. + /** + * For each (builtin) type, a match trie storing all terms in the domain of + * d_pairs. * * Notice that we store d_drewrite->toInternal(t) instead of t, for each * term t, so that polymorphism is handled properly. In particular, this * prevents matches between terms select( x, y ) and select( z, y ) where * the type of x and z are different. */ - MatchTrie d_match_trie; + std::map<TypeNode, MatchTrie> d_match_trie; /** Notify class */ class CandidateRewriteFilterNotifyMatch : public NotifyMatch { @@ -221,4 +223,4 @@ class CandidateRewriteFilter } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_FILTER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__CANDIDATE_REWRITE_FILTER_H */ diff --git a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp index 4ea006d54..fa02c6d09 100644 --- a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp @@ -2,9 +2,9 @@ /*! \file ceg_arith_instantiator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.h b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.h index b6e22329d..8799ce1cd 100644 --- a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.h +++ b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.h @@ -2,9 +2,9 @@ /*! \file ceg_arith_instantiator.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CEG_ARITH_INSTANTIATOR_H -#define __CVC4__THEORY__QUANTIFIERS__CEG_ARITH_INSTANTIATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__CEG_ARITH_INSTANTIATOR_H +#define CVC4__THEORY__QUANTIFIERS__CEG_ARITH_INSTANTIATOR_H #include <vector> #include "expr/node.h" @@ -203,4 +203,4 @@ class ArithInstantiator : public Instantiator } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__CEG_ARITH_INSTANTIATOR_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__CEG_ARITH_INSTANTIATOR_H */ diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp index 272914c25..28a24d884 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Mathias Preiner, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.h b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.h index 35bc6c042..466eba6a2 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.h +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.h @@ -2,9 +2,9 @@ /*! \file ceg_bv_instantiator.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner, Aina Niemetz + ** Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CEG_BV_INSTANTIATOR_H -#define __CVC4__THEORY__QUANTIFIERS__CEG_BV_INSTANTIATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__CEG_BV_INSTANTIATOR_H +#define CVC4__THEORY__QUANTIFIERS__CEG_BV_INSTANTIATOR_H #include <unordered_map> #include "theory/quantifiers/bv_inverter.h" @@ -211,4 +211,4 @@ class BvInstantiatorPreprocess : public InstantiatorPreprocess } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__CEG_BV_INSTANTIATOR_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__CEG_BV_INSTANTIATOR_H */ diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp index b74d358ac..b351dc83c 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp @@ -1,10 +1,10 @@ /********************* */ -/*! \file ceg_bv_instantiator.cpp +/*! \file ceg_bv_instantiator_utils.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner, Aina Niemetz + ** Mathias Preiner, Aina Niemetz, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h index 551ce08e0..7c72a29f2 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h @@ -1,10 +1,10 @@ /********************* */ -/*! \file ceg_bv_instantiator.cpp +/*! \file ceg_bv_instantiator_utils.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner, Aina Niemetz + ** Mathias Preiner, Aina Niemetz, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BV_INSTANTIATOR_UTILS_H -#define __CVC4__BV_INSTANTIATOR_UTILS_H +#ifndef CVC4__BV_INSTANTIATOR_UTILS_H +#define CVC4__BV_INSTANTIATOR_UTILS_H #include "expr/attribute.h" #include "expr/node.h" diff --git a/src/theory/quantifiers/cegqi/ceg_dt_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_dt_instantiator.cpp index e56d5f5db..0bdcbe0d7 100644 --- a/src/theory/quantifiers/cegqi/ceg_dt_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_dt_instantiator.cpp @@ -2,9 +2,9 @@ /*! \file ceg_dt_instantiator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/cegqi/ceg_dt_instantiator.h b/src/theory/quantifiers/cegqi/ceg_dt_instantiator.h index 6cf3bdf42..cf9736abe 100644 --- a/src/theory/quantifiers/cegqi/ceg_dt_instantiator.h +++ b/src/theory/quantifiers/cegqi/ceg_dt_instantiator.h @@ -2,9 +2,9 @@ /*! \file ceg_dt_instantiator.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CEG_DT_INSTANTIATOR_H -#define __CVC4__THEORY__QUANTIFIERS__CEG_DT_INSTANTIATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__CEG_DT_INSTANTIATOR_H +#define CVC4__THEORY__QUANTIFIERS__CEG_DT_INSTANTIATOR_H #include "expr/node.h" #include "theory/quantifiers/cegqi/ceg_instantiator.h" @@ -93,4 +93,4 @@ class DtInstantiator : public Instantiator } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__CEG_DT_INSTANTIATOR_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__CEG_DT_INSTANTIATOR_H */ diff --git a/src/theory/quantifiers/cegqi/ceg_epr_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_epr_instantiator.cpp index df6690273..f0ea7ab7b 100644 --- a/src/theory/quantifiers/cegqi/ceg_epr_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_epr_instantiator.cpp @@ -2,9 +2,9 @@ /*! \file ceg_epr_instantiator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/cegqi/ceg_epr_instantiator.h b/src/theory/quantifiers/cegqi/ceg_epr_instantiator.h index f5057ad86..05932de7e 100644 --- a/src/theory/quantifiers/cegqi/ceg_epr_instantiator.h +++ b/src/theory/quantifiers/cegqi/ceg_epr_instantiator.h @@ -2,9 +2,9 @@ /*! \file ceg_epr_instantiator.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CEG_EPR_INSTANTIATOR_H -#define __CVC4__THEORY__QUANTIFIERS__CEG_EPR_INSTANTIATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__CEG_EPR_INSTANTIATOR_H +#define CVC4__THEORY__QUANTIFIERS__CEG_EPR_INSTANTIATOR_H #include <map> #include <vector> @@ -106,4 +106,4 @@ class EprInstantiator : public Instantiator } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__CEG_EPR_INSTANTIATOR_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__CEG_EPR_INSTANTIATOR_H */ diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp index 46649154e..b11358543 100644 --- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp @@ -2,9 +2,9 @@ /*! \file ceg_instantiator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.h b/src/theory/quantifiers/cegqi/ceg_instantiator.h index ae191cf91..0a09f39c7 100644 --- a/src/theory/quantifiers/cegqi/ceg_instantiator.h +++ b/src/theory/quantifiers/cegqi/ceg_instantiator.h @@ -2,9 +2,9 @@ /*! \file ceg_instantiator.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Mathias Preiner + ** Andrew Reynolds, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CEG_INSTANTIATOR_H -#define __CVC4__THEORY__QUANTIFIERS__CEG_INSTANTIATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__CEG_INSTANTIATOR_H +#define CVC4__THEORY__QUANTIFIERS__CEG_INSTANTIATOR_H #include "theory/quantifiers_engine.h" #include "util/statistics_registry.h" diff --git a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp index 3ea3e72e4..7cfda5ba1 100644 --- a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp +++ b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp @@ -2,9 +2,9 @@ /*! \file inst_strategy_cegqi.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Morgan Deters + ** Andrew Reynolds, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h index 0a19727b8..ebebb808d 100644 --- a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h +++ b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h @@ -2,9 +2,9 @@ /*! \file inst_strategy_cegqi.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Mathias Preiner + ** Andrew Reynolds, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__INST_STRATEGY_CEGQI_H -#define __CVC4__THEORY__QUANTIFIERS__INST_STRATEGY_CEGQI_H +#ifndef CVC4__THEORY__QUANTIFIERS__INST_STRATEGY_CEGQI_H +#define CVC4__THEORY__QUANTIFIERS__INST_STRATEGY_CEGQI_H #include "theory/decision_manager.h" #include "theory/quantifiers/cegqi/ceg_instantiator.h" diff --git a/src/theory/quantifiers/conjecture_generator.cpp b/src/theory/quantifiers/conjecture_generator.cpp index 7408678e7..1d9ed1639 100644 --- a/src/theory/quantifiers/conjecture_generator.cpp +++ b/src/theory/quantifiers/conjecture_generator.cpp @@ -2,9 +2,9 @@ /*! \file conjecture_generator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Dejan Jovanovic + ** Andrew Reynolds, Aina Niemetz, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/conjecture_generator.h b/src/theory/quantifiers/conjecture_generator.h index 8fff7eafe..236c08138 100644 --- a/src/theory/quantifiers/conjecture_generator.h +++ b/src/theory/quantifiers/conjecture_generator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/dynamic_rewrite.cpp b/src/theory/quantifiers/dynamic_rewrite.cpp index f48f73aee..cd73ffe33 100644 --- a/src/theory/quantifiers/dynamic_rewrite.cpp +++ b/src/theory/quantifiers/dynamic_rewrite.cpp @@ -2,9 +2,9 @@ /*! \file dynamic_rewrite.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Andres Noetzli + ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/dynamic_rewrite.h b/src/theory/quantifiers/dynamic_rewrite.h index 50bae0268..969b6bf93 100644 --- a/src/theory/quantifiers/dynamic_rewrite.h +++ b/src/theory/quantifiers/dynamic_rewrite.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__DYNAMIC_REWRITER_H -#define __CVC4__THEORY__QUANTIFIERS__DYNAMIC_REWRITER_H +#ifndef CVC4__THEORY__QUANTIFIERS__DYNAMIC_REWRITER_H +#define CVC4__THEORY__QUANTIFIERS__DYNAMIC_REWRITER_H #include <map> @@ -121,4 +121,4 @@ class DynamicRewriter } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__DYNAMIC_REWRITER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__DYNAMIC_REWRITER_H */ diff --git a/src/theory/quantifiers/ematching/candidate_generator.cpp b/src/theory/quantifiers/ematching/candidate_generator.cpp index 612a1938a..cb0fcaf50 100644 --- a/src/theory/quantifiers/ematching/candidate_generator.cpp +++ b/src/theory/quantifiers/ematching/candidate_generator.cpp @@ -2,9 +2,9 @@ /*! \file candidate_generator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Morgan Deters + ** Andrew Reynolds, Morgan Deters, Francois Bobot ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/ematching/candidate_generator.h b/src/theory/quantifiers/ematching/candidate_generator.h index da4ec2d83..8cff12477 100644 --- a/src/theory/quantifiers/ematching/candidate_generator.h +++ b/src/theory/quantifiers/ematching/candidate_generator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CANDIDATE_GENERATOR_H -#define __CVC4__THEORY__QUANTIFIERS__CANDIDATE_GENERATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__CANDIDATE_GENERATOR_H +#define CVC4__THEORY__QUANTIFIERS__CANDIDATE_GENERATOR_H #include "theory/theory.h" #include "theory/uf/equality_engine.h" @@ -212,4 +212,4 @@ class CandidateGeneratorConsExpand : public CandidateGeneratorQE }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__CANDIDATE_GENERATOR_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__CANDIDATE_GENERATOR_H */ diff --git a/src/theory/quantifiers/ematching/ho_trigger.cpp b/src/theory/quantifiers/ematching/ho_trigger.cpp index 2fcfa19d9..7598e6fdc 100644 --- a/src/theory/quantifiers/ematching/ho_trigger.cpp +++ b/src/theory/quantifiers/ematching/ho_trigger.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -270,6 +270,11 @@ bool HigherOrderTrigger::sendInstantiation(InstMatch& m) // Assert( f==value ); for (unsigned k = 0, size = args.size(); k < size; k++) { + // must now subsitute back, to handle cases like + // (@ x y) matching (@ t (@ t s)) + // where the above substitution would produce (@ x (@ x s)), + // but the argument should be (@ t s). + args[k] = args[k].substitute(var, value); Node val = args[k]; std::map<unsigned, Node>::iterator itf = fixed_vals.find(k); if (itf == fixed_vals.end()) diff --git a/src/theory/quantifiers/ematching/ho_trigger.h b/src/theory/quantifiers/ematching/ho_trigger.h index 8840c949f..6f0ff0635 100644 --- a/src/theory/quantifiers/ematching/ho_trigger.h +++ b/src/theory/quantifiers/ematching/ho_trigger.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__HO_TRIGGER_H -#define __CVC4__THEORY__QUANTIFIERS__HO_TRIGGER_H +#ifndef CVC4__THEORY__QUANTIFIERS__HO_TRIGGER_H +#define CVC4__THEORY__QUANTIFIERS__HO_TRIGGER_H #include <map> #include <unordered_set> @@ -275,4 +275,4 @@ class HigherOrderTrigger : public Trigger } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__HO_TRIGGER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__HO_TRIGGER_H */ diff --git a/src/theory/quantifiers/ematching/inst_match_generator.cpp b/src/theory/quantifiers/ematching/inst_match_generator.cpp index f26df5b79..0a4386db9 100644 --- a/src/theory/quantifiers/ematching/inst_match_generator.cpp +++ b/src/theory/quantifiers/ematching/inst_match_generator.cpp @@ -2,9 +2,9 @@ /*! \file inst_match_generator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/ematching/inst_match_generator.h b/src/theory/quantifiers/ematching/inst_match_generator.h index 83d4ce82e..3995c67b4 100644 --- a/src/theory/quantifiers/ematching/inst_match_generator.h +++ b/src/theory/quantifiers/ematching/inst_match_generator.h @@ -2,9 +2,9 @@ /*! \file inst_match_generator.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Clark Barrett + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__INST_MATCH_GENERATOR_H -#define __CVC4__THEORY__QUANTIFIERS__INST_MATCH_GENERATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__INST_MATCH_GENERATOR_H +#define CVC4__THEORY__QUANTIFIERS__INST_MATCH_GENERATOR_H #include <map> #include "expr/node_trie.h" diff --git a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp index 6784fb8e3..8f671fb55 100644 --- a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp +++ b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp @@ -2,9 +2,9 @@ /*! \file inst_strategy_e_matching.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters + ** Andrew Reynolds, Morgan Deters, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/ematching/inst_strategy_e_matching.h b/src/theory/quantifiers/ematching/inst_strategy_e_matching.h index a8d53cf4b..5eb992368 100644 --- a/src/theory/quantifiers/ematching/inst_strategy_e_matching.h +++ b/src/theory/quantifiers/ematching/inst_strategy_e_matching.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__INST_STRATEGY_E_MATCHING_H -#define __CVC4__INST_STRATEGY_E_MATCHING_H +#ifndef CVC4__INST_STRATEGY_E_MATCHING_H +#define CVC4__INST_STRATEGY_E_MATCHING_H #include "context/context.h" #include "context/context_mm.h" diff --git a/src/theory/quantifiers/ematching/instantiation_engine.cpp b/src/theory/quantifiers/ematching/instantiation_engine.cpp index 2aa8af53d..d2650f01f 100644 --- a/src/theory/quantifiers/ematching/instantiation_engine.cpp +++ b/src/theory/quantifiers/ematching/instantiation_engine.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/ematching/instantiation_engine.h b/src/theory/quantifiers/ematching/instantiation_engine.h index c94320b74..139adcb04 100644 --- a/src/theory/quantifiers/ematching/instantiation_engine.h +++ b/src/theory/quantifiers/ematching/instantiation_engine.h @@ -2,9 +2,9 @@ /*! \file instantiation_engine.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Tim King + ** Andrew Reynolds, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H -#define __CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H +#ifndef CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H +#define CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H #include <memory> @@ -95,4 +95,4 @@ class InstantiationEngine : public QuantifiersModule { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H */ diff --git a/src/theory/quantifiers/ematching/trigger.cpp b/src/theory/quantifiers/ematching/trigger.cpp index b50deea11..31bd1aa96 100644 --- a/src/theory/quantifiers/ematching/trigger.cpp +++ b/src/theory/quantifiers/ematching/trigger.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/ematching/trigger.h b/src/theory/quantifiers/ematching/trigger.h index bbd7c386b..f276585d6 100644 --- a/src/theory/quantifiers/ematching/trigger.h +++ b/src/theory/quantifiers/ematching/trigger.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__TRIGGER_H -#define __CVC4__THEORY__QUANTIFIERS__TRIGGER_H +#ifndef CVC4__THEORY__QUANTIFIERS__TRIGGER_H +#define CVC4__THEORY__QUANTIFIERS__TRIGGER_H #include <map> @@ -464,4 +464,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__TRIGGER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__TRIGGER_H */ diff --git a/src/theory/quantifiers/equality_infer.cpp b/src/theory/quantifiers/equality_infer.cpp index f4a4a34a7..ef80af5f5 100644 --- a/src/theory/quantifiers/equality_infer.cpp +++ b/src/theory/quantifiers/equality_infer.cpp @@ -2,9 +2,9 @@ /*! \file equality_infer.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters, Tianyi Liang ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/equality_infer.h b/src/theory/quantifiers/equality_infer.h index 49d208d99..69cd12a70 100644 --- a/src/theory/quantifiers/equality_infer.h +++ b/src/theory/quantifiers/equality_infer.h @@ -2,9 +2,9 @@ /*! \file equality_infer.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Andres Noetzli + ** Andrew Reynolds, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__EQUALITY_INFER_H -#define __CVC4__THEORY__QUANTIFIERS__EQUALITY_INFER_H +#ifndef CVC4__THEORY__QUANTIFIERS__EQUALITY_INFER_H +#define CVC4__THEORY__QUANTIFIERS__EQUALITY_INFER_H #include <iostream> #include <map> diff --git a/src/theory/quantifiers/equality_query.cpp b/src/theory/quantifiers/equality_query.cpp index ae560c5e5..030b0dccb 100644 --- a/src/theory/quantifiers/equality_query.cpp +++ b/src/theory/quantifiers/equality_query.cpp @@ -2,9 +2,9 @@ /*! \file equality_query.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/equality_query.h b/src/theory/quantifiers/equality_query.h index 8f836f9c6..e4eeeffa7 100644 --- a/src/theory/quantifiers/equality_query.h +++ b/src/theory/quantifiers/equality_query.h @@ -2,9 +2,9 @@ /*! \file equality_query.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner + ** Andrew Reynolds, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS_EQUALITY_QUERY_H -#define __CVC4__THEORY__QUANTIFIERS_EQUALITY_QUERY_H +#ifndef CVC4__THEORY__QUANTIFIERS_EQUALITY_QUERY_H +#define CVC4__THEORY__QUANTIFIERS_EQUALITY_QUERY_H #include "context/cdo.h" #include "context/context.h" @@ -120,4 +120,4 @@ class EqualityQueryQuantifiersEngine : public EqualityQuery }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS_EQUALITY_QUERY_H */ +#endif /* CVC4__THEORY__QUANTIFIERS_EQUALITY_QUERY_H */ diff --git a/src/theory/quantifiers/expr_miner.cpp b/src/theory/quantifiers/expr_miner.cpp index b65d1c522..98d07fdea 100644 --- a/src/theory/quantifiers/expr_miner.cpp +++ b/src/theory/quantifiers/expr_miner.cpp @@ -2,9 +2,9 @@ /*! \file expr_miner.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -87,9 +87,11 @@ void ExprMiner::initializeChecker(std::unique_ptr<SmtEngine>& checker, try { checker.reset(new SmtEngine(&em)); + checker->setIsInternalSubsolver(); checker->setTimeLimit(options::sygusExprMinerCheckTimeout(), true); checker->setLogic(smt::currentSmtEngine()->getLogicInfo()); checker->setOption("sygus-rr-synth-input", false); + checker->setOption("sygus-abduct", false); checker->setOption("input-language", "smt2"); Expr equery = squery.toExpr().exportTo(&em, varMap); checker->assertFormula(equery); @@ -129,9 +131,9 @@ Result ExprMiner::doCheck(Node query) } NodeManager* nm = NodeManager::currentNM(); bool needExport = false; - ExprManagerMapCollection varMap; ExprManager em(nm->getOptions()); std::unique_ptr<SmtEngine> smte; + ExprManagerMapCollection varMap; initializeChecker(smte, em, varMap, queryr, needExport); return smte->checkSat(); } diff --git a/src/theory/quantifiers/expr_miner.h b/src/theory/quantifiers/expr_miner.h index 59d9989c5..233ef39f7 100644 --- a/src/theory/quantifiers/expr_miner.h +++ b/src/theory/quantifiers/expr_miner.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__EXPRESSION_MINER_H -#define __CVC4__THEORY__QUANTIFIERS__EXPRESSION_MINER_H +#ifndef CVC4__THEORY__QUANTIFIERS__EXPRESSION_MINER_H +#define CVC4__THEORY__QUANTIFIERS__EXPRESSION_MINER_H #include <map> #include <memory> @@ -106,4 +106,4 @@ class ExprMiner } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__EXPRESSION_MINER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__EXPRESSION_MINER_H */ diff --git a/src/theory/quantifiers/expr_miner_manager.cpp b/src/theory/quantifiers/expr_miner_manager.cpp index a808d386c..3db0e14ab 100644 --- a/src/theory/quantifiers/expr_miner_manager.cpp +++ b/src/theory/quantifiers/expr_miner_manager.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,6 +15,8 @@ #include "theory/quantifiers/expr_miner_manager.h" #include "theory/quantifiers_engine.h" +#include "options/quantifiers_options.h" + namespace CVC4 { namespace theory { namespace quantifiers { @@ -140,7 +142,7 @@ bool ExpressionMinerManager::addTerm(Node sol, bool ret = true; if (d_doRewSynth) { - ret = d_crd.addTerm(sol, out, rew_print); + ret = d_crd.addTerm(sol, options::sygusRewSynthRec(), out, rew_print); } // a unique term, let's try the query generator diff --git a/src/theory/quantifiers/expr_miner_manager.h b/src/theory/quantifiers/expr_miner_manager.h index d817d3775..1c8aab826 100644 --- a/src/theory/quantifiers/expr_miner_manager.h +++ b/src/theory/quantifiers/expr_miner_manager.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__EXPR_MINER_MANAGER_H -#define __CVC4__THEORY__QUANTIFIERS__EXPR_MINER_MANAGER_H +#ifndef CVC4__THEORY__QUANTIFIERS__EXPR_MINER_MANAGER_H +#define CVC4__THEORY__QUANTIFIERS__EXPR_MINER_MANAGER_H #include "expr/node.h" #include "theory/quantifiers/candidate_rewrite_database.h" @@ -120,4 +120,4 @@ class ExpressionMinerManager } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__EXPR_MINER_MANAGER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__EXPR_MINER_MANAGER_H */ diff --git a/src/theory/quantifiers/extended_rewrite.cpp b/src/theory/quantifiers/extended_rewrite.cpp index 46dcb7151..0fbd971fd 100644 --- a/src/theory/quantifiers/extended_rewrite.cpp +++ b/src/theory/quantifiers/extended_rewrite.cpp @@ -2,9 +2,9 @@ /*! \file extended_rewrite.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/extended_rewrite.h b/src/theory/quantifiers/extended_rewrite.h index da77bda51..836e15b7b 100644 --- a/src/theory/quantifiers/extended_rewrite.h +++ b/src/theory/quantifiers/extended_rewrite.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__EXTENDED_REWRITE_H -#define __CVC4__THEORY__QUANTIFIERS__EXTENDED_REWRITE_H +#ifndef CVC4__THEORY__QUANTIFIERS__EXTENDED_REWRITE_H +#define CVC4__THEORY__QUANTIFIERS__EXTENDED_REWRITE_H #include <unordered_map> @@ -250,4 +250,4 @@ class ExtendedRewriter } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__EXTENDED_REWRITE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__EXTENDED_REWRITE_H */ diff --git a/src/theory/quantifiers/first_order_model.cpp b/src/theory/quantifiers/first_order_model.cpp index 5eb65ed21..5428d9f1a 100644 --- a/src/theory/quantifiers/first_order_model.cpp +++ b/src/theory/quantifiers/first_order_model.cpp @@ -2,9 +2,9 @@ /*! \file first_order_model.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Morgan Deters + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/first_order_model.h b/src/theory/quantifiers/first_order_model.h index b96b42dc2..bdf1d7c15 100644 --- a/src/theory/quantifiers/first_order_model.h +++ b/src/theory/quantifiers/first_order_model.h @@ -2,9 +2,9 @@ /*! \file first_order_model.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Paul Meng + ** Andrew Reynolds, Paul Meng, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__FIRST_ORDER_MODEL_H -#define __CVC4__FIRST_ORDER_MODEL_H +#ifndef CVC4__FIRST_ORDER_MODEL_H +#define CVC4__FIRST_ORDER_MODEL_H #include "theory/theory_model.h" #include "theory/uf/theory_uf_model.h" @@ -218,4 +218,4 @@ class FirstOrderModelFmc : public FirstOrderModel }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__FIRST_ORDER_MODEL_H */ +#endif /* CVC4__FIRST_ORDER_MODEL_H */ diff --git a/src/theory/quantifiers/fmf/bounded_integers.cpp b/src/theory/quantifiers/fmf/bounded_integers.cpp index cafa4a749..e15fc85bb 100644 --- a/src/theory/quantifiers/fmf/bounded_integers.cpp +++ b/src/theory/quantifiers/fmf/bounded_integers.cpp @@ -2,9 +2,9 @@ /*! \file bounded_integers.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Tim King + ** Andrew Reynolds, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/fmf/bounded_integers.h b/src/theory/quantifiers/fmf/bounded_integers.h index b3132a4a7..55ed5bdd2 100644 --- a/src/theory/quantifiers/fmf/bounded_integers.h +++ b/src/theory/quantifiers/fmf/bounded_integers.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BOUNDED_INTEGERS_H -#define __CVC4__BOUNDED_INTEGERS_H +#ifndef CVC4__BOUNDED_INTEGERS_H +#define CVC4__BOUNDED_INTEGERS_H #include "theory/quantifiers_engine.h" diff --git a/src/theory/quantifiers/fmf/full_model_check.cpp b/src/theory/quantifiers/fmf/full_model_check.cpp index 481048105..ace5c2b26 100644 --- a/src/theory/quantifiers/fmf/full_model_check.cpp +++ b/src/theory/quantifiers/fmf/full_model_check.cpp @@ -2,9 +2,9 @@ /*! \file full_model_check.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Kshitij Bansal + ** Andrew Reynolds, Morgan Deters, Francois Bobot ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/fmf/full_model_check.h b/src/theory/quantifiers/fmf/full_model_check.h index f0f9a1798..7dd1991f5 100644 --- a/src/theory/quantifiers/fmf/full_model_check.h +++ b/src/theory/quantifiers/fmf/full_model_check.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__FULL_MODEL_CHECK_H -#define __CVC4__THEORY__QUANTIFIERS__FULL_MODEL_CHECK_H +#ifndef CVC4__THEORY__QUANTIFIERS__FULL_MODEL_CHECK_H +#define CVC4__THEORY__QUANTIFIERS__FULL_MODEL_CHECK_H #include "theory/quantifiers/fmf/model_builder.h" #include "theory/quantifiers/first_order_model.h" @@ -162,4 +162,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__FULL_MODEL_CHECK_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__FULL_MODEL_CHECK_H */ diff --git a/src/theory/quantifiers/fmf/model_builder.cpp b/src/theory/quantifiers/fmf/model_builder.cpp index 8ef30fc4d..51cd8481f 100644 --- a/src/theory/quantifiers/fmf/model_builder.cpp +++ b/src/theory/quantifiers/fmf/model_builder.cpp @@ -2,9 +2,9 @@ /*! \file model_builder.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Morgan Deters + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/fmf/model_builder.h b/src/theory/quantifiers/fmf/model_builder.h index b73716169..1b4d24779 100644 --- a/src/theory/quantifiers/fmf/model_builder.h +++ b/src/theory/quantifiers/fmf/model_builder.h @@ -2,9 +2,9 @@ /*! \file model_builder.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Mathias Preiner + ** Andrew Reynolds, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__MODEL_BUILDER_H -#define __CVC4__THEORY__QUANTIFIERS__MODEL_BUILDER_H +#ifndef CVC4__THEORY__QUANTIFIERS__MODEL_BUILDER_H +#define CVC4__THEORY__QUANTIFIERS__MODEL_BUILDER_H #include "theory/quantifiers_engine.h" #include "theory/theory_model_builder.h" @@ -60,4 +60,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__MODEL_BUILDER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__MODEL_BUILDER_H */ diff --git a/src/theory/quantifiers/fmf/model_engine.cpp b/src/theory/quantifiers/fmf/model_engine.cpp index d2579b4ee..5609cade6 100644 --- a/src/theory/quantifiers/fmf/model_engine.cpp +++ b/src/theory/quantifiers/fmf/model_engine.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -266,7 +266,8 @@ void ModelEngine::exhaustiveInstantiate( Node f, int effort ){ } d_triedLemmas += mb->getNumTriedLemmas()-prev_tlem; d_addedLemmas += mb->getNumAddedLemmas()-prev_alem; - d_quantEngine->d_statistics.d_instantiations_fmf_mbqi += mb->getNumAddedLemmas(); + d_quantEngine->d_statistics.d_instantiations_fmf_mbqi += + (mb->getNumAddedLemmas() - prev_alem); }else{ if( Trace.isOn("fmf-exh-inst-debug") ){ Trace("fmf-exh-inst-debug") << " Instantiation Constants: "; diff --git a/src/theory/quantifiers/fmf/model_engine.h b/src/theory/quantifiers/fmf/model_engine.h index a11115f33..41bc312e7 100644 --- a/src/theory/quantifiers/fmf/model_engine.h +++ b/src/theory/quantifiers/fmf/model_engine.h @@ -2,9 +2,9 @@ /*! \file model_engine.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Mathias Preiner + ** Andrew Reynolds, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__MODEL_ENGINE_H -#define __CVC4__THEORY__QUANTIFIERS__MODEL_ENGINE_H +#ifndef CVC4__THEORY__QUANTIFIERS__MODEL_ENGINE_H +#define CVC4__THEORY__QUANTIFIERS__MODEL_ENGINE_H #include "theory/quantifiers_engine.h" #include "theory/quantifiers/fmf/model_builder.h" @@ -67,4 +67,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__MODEL_ENGINE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__MODEL_ENGINE_H */ diff --git a/src/theory/quantifiers/fun_def_process.cpp b/src/theory/quantifiers/fun_def_process.cpp index 1671fa1a0..185a349c0 100644 --- a/src/theory/quantifiers/fun_def_process.cpp +++ b/src/theory/quantifiers/fun_def_process.cpp @@ -2,9 +2,9 @@ /*! \file fun_def_process.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/fun_def_process.h b/src/theory/quantifiers/fun_def_process.h index 78adc710c..0282f0e40 100644 --- a/src/theory/quantifiers/fun_def_process.h +++ b/src/theory/quantifiers/fun_def_process.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__QUANTIFIERS_FUN_DEF_PROCESS_H -#define __CVC4__QUANTIFIERS_FUN_DEF_PROCESS_H +#ifndef CVC4__QUANTIFIERS_FUN_DEF_PROCESS_H +#define CVC4__QUANTIFIERS_FUN_DEF_PROCESS_H #include <iostream> #include <string> diff --git a/src/theory/quantifiers/inst_match.cpp b/src/theory/quantifiers/inst_match.cpp index a16e03420..069d5b888 100644 --- a/src/theory/quantifiers/inst_match.cpp +++ b/src/theory/quantifiers/inst_match.cpp @@ -2,9 +2,9 @@ /*! \file inst_match.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Clark Barrett + ** Andrew Reynolds, Morgan Deters, Francois Bobot ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/inst_match.h b/src/theory/quantifiers/inst_match.h index 5695d1294..d298c43a8 100644 --- a/src/theory/quantifiers/inst_match.h +++ b/src/theory/quantifiers/inst_match.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Francois Bobot ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__INST_MATCH_H -#define __CVC4__THEORY__QUANTIFIERS__INST_MATCH_H +#ifndef CVC4__THEORY__QUANTIFIERS__INST_MATCH_H +#define CVC4__THEORY__QUANTIFIERS__INST_MATCH_H #include <vector> @@ -102,4 +102,4 @@ typedef CVC4::theory::inst::InstMatch InstMatch; }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__INST_MATCH_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__INST_MATCH_H */ diff --git a/src/theory/quantifiers/inst_match_trie.cpp b/src/theory/quantifiers/inst_match_trie.cpp index aba4a3b5e..8b8689835 100644 --- a/src/theory/quantifiers/inst_match_trie.cpp +++ b/src/theory/quantifiers/inst_match_trie.cpp @@ -2,9 +2,9 @@ /*! \file inst_match_trie.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/inst_match_trie.h b/src/theory/quantifiers/inst_match_trie.h index 50df50786..4854616db 100644 --- a/src/theory/quantifiers/inst_match_trie.h +++ b/src/theory/quantifiers/inst_match_trie.h @@ -2,9 +2,9 @@ /*! \file inst_match_trie.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__INST_MATCH_TRIE_H -#define __CVC4__THEORY__QUANTIFIERS__INST_MATCH_TRIE_H +#ifndef CVC4__THEORY__QUANTIFIERS__INST_MATCH_TRIE_H +#define CVC4__THEORY__QUANTIFIERS__INST_MATCH_TRIE_H #include <map> @@ -436,4 +436,4 @@ class InstMatchTrieOrdered } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__INST_MATCH_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__INST_MATCH_H */ diff --git a/src/theory/quantifiers/inst_propagator.cpp b/src/theory/quantifiers/inst_propagator.cpp index 15dd35c26..56be1506c 100644 --- a/src/theory/quantifiers/inst_propagator.cpp +++ b/src/theory/quantifiers/inst_propagator.cpp @@ -2,9 +2,9 @@ /*! \file inst_propagator.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/inst_propagator.h b/src/theory/quantifiers/inst_propagator.h index 1ba359228..d45b078ce 100644 --- a/src/theory/quantifiers/inst_propagator.h +++ b/src/theory/quantifiers/inst_propagator.h @@ -2,9 +2,9 @@ /*! \file inst_propagator.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner + ** Andrew Reynolds, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__QUANTIFIERS_INST_PROPAGATOR_H -#define __CVC4__QUANTIFIERS_INST_PROPAGATOR_H +#ifndef CVC4__QUANTIFIERS_INST_PROPAGATOR_H +#define CVC4__QUANTIFIERS_INST_PROPAGATOR_H #include <iostream> #include <map> diff --git a/src/theory/quantifiers/inst_strategy_enumerative.cpp b/src/theory/quantifiers/inst_strategy_enumerative.cpp index 9d70d0d4b..7a2f62864 100644 --- a/src/theory/quantifiers/inst_strategy_enumerative.cpp +++ b/src/theory/quantifiers/inst_strategy_enumerative.cpp @@ -2,9 +2,9 @@ /*! \file inst_strategy_enumerative.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -70,46 +70,89 @@ void InstStrategyEnum::check(Theory::Effort e, QEffort quant_e) doCheck = quant_e == QEFFORT_LAST_CALL; fullEffort = !d_quantEngine->hasAddedLemma(); } - if (doCheck) + if (!doCheck) { - double clSet = 0; - if (Trace.isOn("fs-engine")) - { - clSet = double(clock()) / double(CLOCKS_PER_SEC); - Trace("fs-engine") << "---Full Saturation Round, effort = " << e << "---" - << std::endl; - } - int addedLemmas = 0; - for (unsigned i = 0; - i < d_quantEngine->getModel()->getNumAssertedQuantifiers(); - i++) + return; + } + double clSet = 0; + if (Trace.isOn("fs-engine")) + { + clSet = double(clock()) / double(CLOCKS_PER_SEC); + Trace("fs-engine") << "---Full Saturation Round, effort = " << e << "---" + << std::endl; + } + unsigned rstart = options::fullSaturateQuantRd() ? 0 : 1; + unsigned rend = fullEffort ? 1 : rstart; + unsigned addedLemmas = 0; + // First try in relevant domain of all quantified formulas, if no + // instantiations exist, try arbitrary ground terms. + // Notice that this stratification of effort levels makes it so that some + // quantified formulas may not be instantiated (if they have no instances + // at effort level r=0 but another quantified formula does). We prefer + // this stratification since effort level r=1 may be highly expensive in the + // case where we have a quantified formula with many entailed instances. + FirstOrderModel* fm = d_quantEngine->getModel(); + RelevantDomain* rd = d_quantEngine->getRelevantDomain(); + unsigned nquant = fm->getNumAssertedQuantifiers(); + std::map<Node, bool> alreadyProc; + for (unsigned r = rstart; r <= rend; r++) + { + if (rd || r > 0) { - Node q = d_quantEngine->getModel()->getAssertedQuantifier(i, true); - if (d_quantEngine->hasOwnership(q, this) - && d_quantEngine->getModel()->isQuantifierActive(q)) + if (r == 0) + { + Trace("inst-alg") << "-> Relevant domain instantiate..." << std::endl; + Trace("inst-alg-debug") << "Compute relevant domain..." << std::endl; + rd->compute(); + Trace("inst-alg-debug") << "...finished" << std::endl; + } + else + { + Trace("inst-alg") << "-> Ground term instantiate..." << std::endl; + } + for (unsigned i = 0; i < nquant; i++) { - if (process(q, fullEffort)) + Node q = fm->getAssertedQuantifier(i, true); + bool doProcess = d_quantEngine->hasOwnership(q, this) + && fm->isQuantifierActive(q) + && alreadyProc.find(q) == alreadyProc.end(); + if (doProcess) { - // added lemma - addedLemmas++; - if (d_quantEngine->inConflict()) + if (process(q, fullEffort, r == 0)) { - break; + // don't need to mark this if we are not stratifying + if (!options::fullSaturateStratify()) + { + alreadyProc[q] = true; + } + // added lemma + addedLemmas++; + if (d_quantEngine->inConflict()) + { + break; + } } } } + if (d_quantEngine->inConflict() + || (addedLemmas > 0 && options::fullSaturateStratify())) + { + // we break if we are in conflict, or if we added any lemma at this + // effort level and we stratify effort levels. + break; + } } - if (Trace.isOn("fs-engine")) - { - Trace("fs-engine") << "Added lemmas = " << addedLemmas << std::endl; - double clSet2 = double(clock()) / double(CLOCKS_PER_SEC); - Trace("fs-engine") << "Finished full saturation engine, time = " - << (clSet2 - clSet) << std::endl; - } + } + if (Trace.isOn("fs-engine")) + { + Trace("fs-engine") << "Added lemmas = " << addedLemmas << std::endl; + double clSet2 = double(clock()) / double(CLOCKS_PER_SEC); + Trace("fs-engine") << "Finished full saturation engine, time = " + << (clSet2 - clSet) << std::endl; } } -bool InstStrategyEnum::process(Node f, bool fullEffort) +bool InstStrategyEnum::process(Node f, bool fullEffort, bool isRd) { // ignore if constant true (rare case of non-standard quantifier whose body is // rewritten to true) @@ -117,178 +160,156 @@ bool InstStrategyEnum::process(Node f, bool fullEffort) { return false; } - // first, try from relevant domain RelevantDomain* rd = d_quantEngine->getRelevantDomain(); - unsigned rstart = options::fullSaturateQuantRd() ? 0 : 1; - unsigned rend = fullEffort ? 1 : rstart; - for (unsigned r = rstart; r <= rend; r++) + unsigned final_max_i = 0; + std::vector<unsigned> maxs; + std::vector<bool> max_zero; + bool has_zero = false; + std::map<TypeNode, std::vector<Node> > term_db_list; + std::vector<TypeNode> ftypes; + TermDb* tdb = d_quantEngine->getTermDatabase(); + EqualityQuery* qy = d_quantEngine->getEqualityQuery(); + // iterate over substitutions for variables + for (unsigned i = 0; i < f[0].getNumChildren(); i++) { - if (rd || r > 0) + TypeNode tn = f[0][i].getType(); + ftypes.push_back(tn); + unsigned ts; + if (isRd) { - if (r == 0) + ts = rd->getRDomain(f, i)->d_terms.size(); + } + else + { + ts = tdb->getNumTypeGroundTerms(tn); + std::map<TypeNode, std::vector<Node> >::iterator ittd = + term_db_list.find(tn); + if (ittd == term_db_list.end()) { - Trace("inst-alg") << "-> Relevant domain instantiate " << f << "..." - << std::endl; - Trace("inst-alg-debug") << "Compute relevant domain..." << std::endl; - rd->compute(); - Trace("inst-alg-debug") << "...finished" << std::endl; + std::map<Node, Node> reps_found; + for (unsigned j = 0; j < ts; j++) + { + Node gt = tdb->getTypeGroundTerm(ftypes[i], j); + if (!options::cbqi() || !quantifiers::TermUtil::hasInstConstAttr(gt)) + { + Node rep = qy->getRepresentative(gt); + if (reps_found.find(rep) == reps_found.end()) + { + reps_found[rep] = gt; + term_db_list[tn].push_back(gt); + } + } + } + ts = term_db_list[tn].size(); } else { - Trace("inst-alg") << "-> Ground term instantiate " << f << "..." - << std::endl; + ts = ittd->second.size(); } - unsigned final_max_i = 0; - std::vector<unsigned> maxs; - std::vector<bool> max_zero; - bool has_zero = false; - std::map<TypeNode, std::vector<Node> > term_db_list; - std::vector<TypeNode> ftypes; - // iterate over substitutions for variables - for (unsigned i = 0; i < f[0].getNumChildren(); i++) + } + // consider a default value if at full effort + max_zero.push_back(fullEffort && ts == 0); + ts = (fullEffort && ts == 0) ? 1 : ts; + Trace("inst-alg-rd") << "Variable " << i << " has " << ts + << " in relevant domain." << std::endl; + if (ts == 0) + { + has_zero = true; + break; + } + maxs.push_back(ts); + if (ts > final_max_i) + { + final_max_i = ts; + } + } + if (!has_zero) + { + Trace("inst-alg-rd") << "Will do " << final_max_i + << " stages of instantiation." << std::endl; + unsigned max_i = 0; + bool success; + Instantiate* ie = d_quantEngine->getInstantiate(); + while (max_i <= final_max_i) + { + Trace("inst-alg-rd") << "Try stage " << max_i << "..." << std::endl; + std::vector<unsigned> childIndex; + int index = 0; + do { - TypeNode tn = f[0][i].getType(); - ftypes.push_back(tn); - unsigned ts; - if (r == 0) - { - ts = rd->getRDomain(f, i)->d_terms.size(); - } - else + while (index >= 0 && index < (int)f[0].getNumChildren()) { - ts = d_quantEngine->getTermDatabase()->getNumTypeGroundTerms(tn); - std::map<TypeNode, std::vector<Node> >::iterator ittd = - term_db_list.find(tn); - if (ittd == term_db_list.end()) + if (index == static_cast<int>(childIndex.size())) { - std::map<Node, Node> reps_found; - for (unsigned j = 0; j < ts; j++) - { - Node gt = d_quantEngine->getTermDatabase()->getTypeGroundTerm( - ftypes[i], j); - if (!options::cbqi() - || !quantifiers::TermUtil::hasInstConstAttr(gt)) - { - Node rep = - d_quantEngine->getEqualityQuery()->getRepresentative(gt); - if (reps_found.find(rep) == reps_found.end()) - { - reps_found[rep] = gt; - term_db_list[tn].push_back(gt); - } - } - } - ts = term_db_list[tn].size(); + childIndex.push_back(-1); } else { - ts = ittd->second.size(); + Assert(index == static_cast<int>(childIndex.size()) - 1); + unsigned nv = childIndex[index] + 1; + if (nv < maxs[index] && nv <= max_i) + { + childIndex[index] = nv; + index++; + } + else + { + childIndex.pop_back(); + index--; + } } } - // consider a default value if at full effort - max_zero.push_back(fullEffort && ts == 0); - ts = (fullEffort && ts == 0) ? 1 : ts; - Trace("inst-alg-rd") << "Variable " << i << " has " << ts - << " in relevant domain." << std::endl; - if (ts == 0) + success = index >= 0; + if (success) { - has_zero = true; - break; - } - else - { - maxs.push_back(ts); - if (ts > final_max_i) + if (Trace.isOn("inst-alg-rd")) { - final_max_i = ts; + Trace("inst-alg-rd") << "Try instantiation { "; + for (unsigned i : childIndex) + { + Trace("inst-alg-rd") << i << " "; + } + Trace("inst-alg-rd") << "}" << std::endl; } - } - } - if (!has_zero) - { - Trace("inst-alg-rd") << "Will do " << final_max_i - << " stages of instantiation." << std::endl; - unsigned max_i = 0; - bool success; - while (max_i <= final_max_i) - { - Trace("inst-alg-rd") << "Try stage " << max_i << "..." << std::endl; - std::vector<unsigned> childIndex; - int index = 0; - do + // try instantiation + std::vector<Node> terms; + for (unsigned i = 0, nchild = f[0].getNumChildren(); i < nchild; i++) { - while (index >= 0 && index < (int)f[0].getNumChildren()) + if (max_zero[i]) { - if (index == (int)childIndex.size()) - { - childIndex.push_back(-1); - } - else - { - Assert(index == (int)(childIndex.size()) - 1); - unsigned nv = childIndex[index] + 1; - if (nv < maxs[index] && nv <= max_i) - { - childIndex[index] = nv; - index++; - } - else - { - childIndex.pop_back(); - index--; - } - } + // no terms available, will report incomplete instantiation + terms.push_back(Node::null()); + Trace("inst-alg-rd") << " null" << std::endl; } - success = index >= 0; - if (success) + else if (isRd) { - Trace("inst-alg-rd") << "Try instantiation { "; - for (unsigned j = 0; j < childIndex.size(); j++) - { - Trace("inst-alg-rd") << childIndex[j] << " "; - } - Trace("inst-alg-rd") << "}" << std::endl; - // try instantiation - std::vector<Node> terms; - for (unsigned i = 0; i < f[0].getNumChildren(); i++) - { - if (max_zero[i]) - { - // no terms available, will report incomplete instantiation - terms.push_back(Node::null()); - Trace("inst-alg-rd") << " null" << std::endl; - } - else if (r == 0) - { - terms.push_back(rd->getRDomain(f, i)->d_terms[childIndex[i]]); - Trace("inst-alg-rd") - << " " << rd->getRDomain(f, i)->d_terms[childIndex[i]] - << std::endl; - } - else - { - Assert(childIndex[i] < term_db_list[ftypes[i]].size()); - terms.push_back(term_db_list[ftypes[i]][childIndex[i]]); - Trace("inst-alg-rd") << " " - << term_db_list[ftypes[i]][childIndex[i]] - << std::endl; - } - } - if (d_quantEngine->getInstantiate()->addInstantiation(f, terms)) - { - Trace("inst-alg-rd") << "Success!" << std::endl; - ++(d_quantEngine->d_statistics.d_instantiations_guess); - return true; - } - else - { - index--; - } + terms.push_back(rd->getRDomain(f, i)->d_terms[childIndex[i]]); + Trace("inst-alg-rd") + << " " << rd->getRDomain(f, i)->d_terms[childIndex[i]] + << std::endl; } - } while (success); - max_i++; + else + { + Assert(childIndex[i] < term_db_list[ftypes[i]].size()); + terms.push_back(term_db_list[ftypes[i]][childIndex[i]]); + Trace("inst-alg-rd") + << " " << term_db_list[ftypes[i]][childIndex[i]] + << std::endl; + } + } + if (ie->addInstantiation(f, terms)) + { + Trace("inst-alg-rd") << "Success!" << std::endl; + ++(d_quantEngine->d_statistics.d_instantiations_guess); + return true; + } + else + { + index--; + } } - } + } while (success); + max_i++; } } // TODO : term enumerator instantiation? diff --git a/src/theory/quantifiers/inst_strategy_enumerative.h b/src/theory/quantifiers/inst_strategy_enumerative.h index be0f452e4..920e643bc 100644 --- a/src/theory/quantifiers/inst_strategy_enumerative.h +++ b/src/theory/quantifiers/inst_strategy_enumerative.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__INST_STRATEGY_ENUMERATIVE_H -#define __CVC4__INST_STRATEGY_ENUMERATIVE_H +#ifndef CVC4__INST_STRATEGY_ENUMERATIVE_H +#define CVC4__INST_STRATEGY_ENUMERATIVE_H #include "context/context.h" #include "context/context_mm.h" @@ -92,8 +92,12 @@ class InstStrategyEnum : public QuantifiersModule * well-typed term *not* occurring in the current context. * This handles corner cases where there are no well-typed * ground terms in the current context to instantiate with. + * + * The flag isRd indicates whether we are trying relevant domain + * instantiations. If this flag is false, we are trying arbitrary ground + * term instantiations. */ - bool process(Node q, bool fullEffort); + bool process(Node q, bool fullEffort, bool isRd); }; /* class InstStrategyEnum */ } /* CVC4::theory::quantifiers namespace */ diff --git a/src/theory/quantifiers/instantiate.cpp b/src/theory/quantifiers/instantiate.cpp index 96a28cde6..623db032a 100644 --- a/src/theory/quantifiers/instantiate.cpp +++ b/src/theory/quantifiers/instantiate.cpp @@ -2,9 +2,9 @@ /*! \file instantiate.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/instantiate.h b/src/theory/quantifiers/instantiate.h index 62e0ddb55..2fdb494e9 100644 --- a/src/theory/quantifiers/instantiate.h +++ b/src/theory/quantifiers/instantiate.h @@ -2,9 +2,9 @@ /*! \file instantiate.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner + ** Andrew Reynolds, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__INSTANTIATE_H -#define __CVC4__THEORY__QUANTIFIERS__INSTANTIATE_H +#ifndef CVC4__THEORY__QUANTIFIERS__INSTANTIATE_H +#define CVC4__THEORY__QUANTIFIERS__INSTANTIATE_H #include <map> @@ -374,4 +374,4 @@ class Instantiate : public QuantifiersUtil } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__INSTANTIATE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__INSTANTIATE_H */ diff --git a/src/theory/quantifiers/lazy_trie.cpp b/src/theory/quantifiers/lazy_trie.cpp index 35049b8ba..a50352df5 100644 --- a/src/theory/quantifiers/lazy_trie.cpp +++ b/src/theory/quantifiers/lazy_trie.cpp @@ -2,9 +2,9 @@ /*! \file lazy_trie.cpp ** \verbatim ** Top contributors (to current version): - ** Haniel Barbosa + ** Haniel Barbosa, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/lazy_trie.h b/src/theory/quantifiers/lazy_trie.h index 156f1abde..8f822fcc0 100644 --- a/src/theory/quantifiers/lazy_trie.h +++ b/src/theory/quantifiers/lazy_trie.h @@ -2,9 +2,9 @@ /*! \file lazy_trie.h ** \verbatim ** Top contributors (to current version): - ** Haniel Barbosa + ** Haniel Barbosa, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -12,8 +12,8 @@ ** \brief lazy trie **/ -#ifndef __CVC4__THEORY__QUANTIFIERS__LAZY_TRIE_H -#define __CVC4__THEORY__QUANTIFIERS__LAZY_TRIE_H +#ifndef CVC4__THEORY__QUANTIFIERS__LAZY_TRIE_H +#define CVC4__THEORY__QUANTIFIERS__LAZY_TRIE_H #include "expr/node.h" @@ -170,4 +170,4 @@ class LazyTrieMulti } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__LAZY_TRIE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__LAZY_TRIE_H */ diff --git a/src/theory/quantifiers/local_theory_ext.cpp b/src/theory/quantifiers/local_theory_ext.cpp index 752d61489..520088328 100644 --- a/src/theory/quantifiers/local_theory_ext.cpp +++ b/src/theory/quantifiers/local_theory_ext.cpp @@ -2,9 +2,9 @@ /*! \file local_theory_ext.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Paul Meng + ** Andrew Reynolds, Morgan Deters, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/local_theory_ext.h b/src/theory/quantifiers/local_theory_ext.h index b8b0e34fa..9793ea0a7 100644 --- a/src/theory/quantifiers/local_theory_ext.h +++ b/src/theory/quantifiers/local_theory_ext.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__LOCAL_THEORY_EXT_H -#define __CVC4__THEORY__LOCAL_THEORY_EXT_H +#ifndef CVC4__THEORY__LOCAL_THEORY_EXT_H +#define CVC4__THEORY__LOCAL_THEORY_EXT_H #include "context/cdo.h" #include "expr/node_trie.h" diff --git a/src/theory/quantifiers/quant_conflict_find.cpp b/src/theory/quantifiers/quant_conflict_find.cpp index 5b57af14c..dc18a2005 100644 --- a/src/theory/quantifiers/quant_conflict_find.cpp +++ b/src/theory/quantifiers/quant_conflict_find.cpp @@ -2,9 +2,9 @@ /*! \file quant_conflict_find.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Morgan Deters + ** Andrew Reynolds, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -583,7 +583,9 @@ bool QuantInfo::isTConstraintSpurious( QuantConflictFind * p, std::vector< Node }else{ Node inst = p->d_quantEngine->getInstantiate()->getInstantiation(d_q, terms); - Node inst_eval = p->getTermDatabase()->evaluateTerm( inst, NULL, options::qcfTConstraint() ); + inst = Rewriter::rewrite(inst); + Node inst_eval = p->getTermDatabase()->evaluateTerm( + inst, nullptr, options::qcfTConstraint(), true); if( Trace.isOn("qcf-instance-check") ){ Trace("qcf-instance-check") << "Possible propagating instance for " << d_q << " : " << std::endl; for( unsigned i=0; i<terms.size(); i++ ){ @@ -591,10 +593,13 @@ bool QuantInfo::isTConstraintSpurious( QuantConflictFind * p, std::vector< Node } Trace("qcf-instance-check") << "...evaluates to " << inst_eval << std::endl; } - if( inst_eval.isNull() || inst_eval==p->getTermUtil()->d_true || !isPropagatingInstance( p, inst_eval ) ){ + if (inst_eval.isNull() + || (inst_eval.isConst() && inst_eval.getConst<bool>())) + { Trace("qcf-instance-check") << "...spurious." << std::endl; return true; }else{ + Assert(p->isPropagatingInstance(inst_eval)); Trace("qcf-instance-check") << "...not spurious." << std::endl; } } @@ -615,27 +620,6 @@ bool QuantInfo::isTConstraintSpurious( QuantConflictFind * p, std::vector< Node return p->d_quantEngine->inConflict(); } -bool QuantInfo::isPropagatingInstance( QuantConflictFind * p, Node n ) { - if( n.getKind()==FORALL ){ - //TODO? - return true; - }else if( n.getKind()==NOT || n.getKind()==AND || n.getKind()==OR || n.getKind()==EQUAL || n.getKind()==ITE || - ( n.getKind()==EQUAL && n[0].getType().isBoolean() ) ){ - for( unsigned i=0; i<n.getNumChildren(); i++ ){ - if( !isPropagatingInstance( p, n[i] ) ){ - return false; - } - } - return true; - }else{ - if( p->getEqualityEngine()->hasTerm( n ) || isGroundSubterm( n ) ){ - return true; - } - } - Trace("qcf-instance-check-debug") << "...not propagating instance because of " << n << std::endl; - return false; -} - bool QuantInfo::entailmentTest( QuantConflictFind * p, Node lit, bool chEnt ) { Trace("qcf-tconstraint-debug") << "Check : " << lit << std::endl; Node rew = Rewriter::rewrite( lit ); @@ -1047,7 +1031,6 @@ MatchGen::MatchGen( QuantInfo * qi, Node n, bool isVar ) else { d_qni_gterm[i] = d_n[i]; - qi->setGroundSubterm(d_n[i]); } } d_type = d_n.getKind() == EQUAL ? typ_eq : typ_tconstraint; @@ -1058,7 +1041,6 @@ MatchGen::MatchGen( QuantInfo * qi, Node n, bool isVar ) //we will just evaluate d_n = n; d_type = typ_ground; - qi->setGroundSubterm( d_n ); } } Trace("qcf-qregister-debug") << "Done make match gen " << n << ", type = "; @@ -2211,6 +2193,42 @@ std::ostream& operator<<(std::ostream& os, const QuantConflictFind::Effort& e) { return os; } +bool QuantConflictFind::isPropagatingInstance(Node n) const +{ + std::unordered_set<TNode, TNodeHashFunction> visited; + std::vector<TNode> visit; + TNode cur; + visit.push_back(n); + do + { + cur = visit.back(); + visit.pop_back(); + if (visited.find(cur) == visited.end()) + { + visited.insert(cur); + Kind ck = cur.getKind(); + if (ck == FORALL) + { + // do nothing + } + else if (TermUtil::isBoolConnective(ck)) + { + for (TNode cc : cur) + { + visit.push_back(cc); + } + } + else if (!getEqualityEngine()->hasTerm(cur)) + { + Trace("qcf-instance-check-debug") + << "...not propagating instance because of " << n << std::endl; + return false; + } + } + } while (!visit.empty()); + return true; +} + } /* namespace CVC4::theory::quantifiers */ } /* namespace CVC4::theory */ } /* namespace CVC4 */ diff --git a/src/theory/quantifiers/quant_conflict_find.h b/src/theory/quantifiers/quant_conflict_find.h index 9fa37a96c..f22910191 100644 --- a/src/theory/quantifiers/quant_conflict_find.h +++ b/src/theory/quantifiers/quant_conflict_find.h @@ -2,9 +2,9 @@ /*! \file quant_conflict_find.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Mathias Preiner + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -126,13 +126,9 @@ private: //for completing match void getPropagateVars( QuantConflictFind * p, std::vector< TNode >& vars, TNode n, bool pol, std::map< TNode, bool >& visited ); //optimization: number of variables set, to track when we can stop std::map< int, bool > d_vars_set; - std::map< Node, bool > d_ground_terms; std::vector< Node > d_extra_var; public: - void setGroundSubterm( Node t ) { d_ground_terms[t] = true; } - bool isGroundSubterm( Node t ) { return d_ground_terms.find( t )!=d_ground_terms.end(); } bool isBaseMatchComplete(); - bool isPropagatingInstance( QuantConflictFind * p, Node n ); public: QuantInfo(); ~QuantInfo(); @@ -272,6 +268,22 @@ public: Statistics d_statistics; /** Identify this module */ std::string identify() const override { return "QcfEngine"; } + /** is n a propagating instance? + * + * A propagating instance is any formula that consists of Boolean connectives, + * equality, quantified formulas, and terms that exist in the current + * context (those in the master equality engine). + * + * Notice the distinction that quantified formulas that do not appear in the + * current context are considered to be legal in propagating instances. This + * choice is significant for TPTP, where a net of ~200 benchmarks are gained + * due to this decision. + * + * Propagating instances are the second most useful kind of instantiation + * after conflicting instances and are used as a second effort in the + * algorithm performed by this class. + */ + bool isPropagatingInstance(Node n) const; }; std::ostream& operator<<(std::ostream& os, const QuantConflictFind::Effort& e); diff --git a/src/theory/quantifiers/quant_epr.cpp b/src/theory/quantifiers/quant_epr.cpp index eedea6767..e03a2c120 100644 --- a/src/theory/quantifiers/quant_epr.cpp +++ b/src/theory/quantifiers/quant_epr.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/quant_epr.h b/src/theory/quantifiers/quant_epr.h index 07569a09b..1284dde33 100644 --- a/src/theory/quantifiers/quant_epr.h +++ b/src/theory/quantifiers/quant_epr.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANT_EPR_H -#define __CVC4__THEORY__QUANT_EPR_H +#ifndef CVC4__THEORY__QUANT_EPR_H +#define CVC4__THEORY__QUANT_EPR_H #include <map> @@ -101,4 +101,4 @@ class QuantEPR } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANT_EPR_H */ +#endif /* CVC4__THEORY__QUANT_EPR_H */ diff --git a/src/theory/quantifiers/quant_relevance.cpp b/src/theory/quantifiers/quant_relevance.cpp index a05388d17..de54fa05f 100644 --- a/src/theory/quantifiers/quant_relevance.cpp +++ b/src/theory/quantifiers/quant_relevance.cpp @@ -2,9 +2,9 @@ /*! \file quant_relevance.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/quant_relevance.h b/src/theory/quantifiers/quant_relevance.h index 21017e783..26a4630cd 100644 --- a/src/theory/quantifiers/quant_relevance.h +++ b/src/theory/quantifiers/quant_relevance.h @@ -2,9 +2,9 @@ /*! \file quant_relevance.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner + ** Andrew Reynolds, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANT_RELEVANCE_H -#define __CVC4__THEORY__QUANT_RELEVANCE_H +#ifndef CVC4__THEORY__QUANT_RELEVANCE_H +#define CVC4__THEORY__QUANT_RELEVANCE_H #include <map> @@ -68,4 +68,4 @@ class QuantRelevance : public QuantifiersUtil } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANT_RELEVANCE_H */ +#endif /* CVC4__THEORY__QUANT_RELEVANCE_H */ diff --git a/src/theory/quantifiers/quant_split.cpp b/src/theory/quantifiers/quant_split.cpp index fb5492eb3..808c6006f 100644 --- a/src/theory/quantifiers/quant_split.cpp +++ b/src/theory/quantifiers/quant_split.cpp @@ -2,9 +2,9 @@ /*! \file quant_split.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/quant_split.h b/src/theory/quantifiers/quant_split.h index 6a752fe3f..1a2aaa6cf 100644 --- a/src/theory/quantifiers/quant_split.h +++ b/src/theory/quantifiers/quant_split.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANT_SPLIT_H -#define __CVC4__THEORY__QUANT_SPLIT_H +#ifndef CVC4__THEORY__QUANT_SPLIT_H +#define CVC4__THEORY__QUANT_SPLIT_H #include "theory/quantifiers_engine.h" #include "context/cdo.h" diff --git a/src/theory/quantifiers/quant_util.cpp b/src/theory/quantifiers/quant_util.cpp index b1b34fb98..01f362d25 100644 --- a/src/theory/quantifiers/quant_util.cpp +++ b/src/theory/quantifiers/quant_util.cpp @@ -2,9 +2,9 @@ /*! \file quant_util.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -30,27 +30,38 @@ QuantifiersModule::QEffort QuantifiersModule::needsModel(Theory::Effort e) return QEFFORT_NONE; } -eq::EqualityEngine * QuantifiersModule::getEqualityEngine() { +eq::EqualityEngine* QuantifiersModule::getEqualityEngine() const +{ return d_quantEngine->getActiveEqualityEngine(); } -bool QuantifiersModule::areEqual( TNode n1, TNode n2 ) { +bool QuantifiersModule::areEqual(TNode n1, TNode n2) const +{ return d_quantEngine->getEqualityQuery()->areEqual( n1, n2 ); } -bool QuantifiersModule::areDisequal( TNode n1, TNode n2 ) { +bool QuantifiersModule::areDisequal(TNode n1, TNode n2) const +{ return d_quantEngine->getEqualityQuery()->areDisequal( n1, n2 ); } -TNode QuantifiersModule::getRepresentative( TNode n ) { +TNode QuantifiersModule::getRepresentative(TNode n) const +{ return d_quantEngine->getEqualityQuery()->getRepresentative( n ); } -quantifiers::TermDb * QuantifiersModule::getTermDatabase() { +QuantifiersEngine* QuantifiersModule::getQuantifiersEngine() const +{ + return d_quantEngine; +} + +quantifiers::TermDb* QuantifiersModule::getTermDatabase() const +{ return d_quantEngine->getTermDatabase(); } -quantifiers::TermUtil * QuantifiersModule::getTermUtil() { +quantifiers::TermUtil* QuantifiersModule::getTermUtil() const +{ return d_quantEngine->getTermUtil(); } diff --git a/src/theory/quantifiers/quant_util.h b/src/theory/quantifiers/quant_util.h index e324bc36f..43861d6e9 100644 --- a/src/theory/quantifiers/quant_util.h +++ b/src/theory/quantifiers/quant_util.h @@ -2,9 +2,9 @@ /*! \file quant_util.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANT_UTIL_H -#define __CVC4__THEORY__QUANT_UTIL_H +#ifndef CVC4__THEORY__QUANT_UTIL_H +#define CVC4__THEORY__QUANT_UTIL_H #include <iostream> #include <map> @@ -138,19 +138,19 @@ class QuantifiersModule { virtual std::string identify() const = 0; //----------------------------general queries /** get currently used the equality engine */ - eq::EqualityEngine * getEqualityEngine(); + eq::EqualityEngine* getEqualityEngine() const; /** are n1 and n2 equal in the current used equality engine? */ - bool areEqual( TNode n1, TNode n2 ); + bool areEqual(TNode n1, TNode n2) const; /** are n1 and n2 disequal in the current used equality engine? */ - bool areDisequal(TNode n1, TNode n2); + bool areDisequal(TNode n1, TNode n2) const; /** get the representative of n in the current used equality engine */ - TNode getRepresentative( TNode n ); + TNode getRepresentative(TNode n) const; /** get quantifiers engine that owns this module */ - QuantifiersEngine* getQuantifiersEngine() { return d_quantEngine; } + QuantifiersEngine* getQuantifiersEngine() const; /** get currently used term database */ - quantifiers::TermDb * getTermDatabase(); + quantifiers::TermDb* getTermDatabase() const; /** get currently used term utility object */ - quantifiers::TermUtil * getTermUtil(); + quantifiers::TermUtil* getTermUtil() const; //----------------------------end general queries protected: /** pointer to the quantifiers engine that owns this module */ @@ -237,4 +237,4 @@ public: } } -#endif /* __CVC4__THEORY__QUANT_UTIL_H */ +#endif /* CVC4__THEORY__QUANT_UTIL_H */ diff --git a/src/theory/quantifiers/quantifiers_attributes.cpp b/src/theory/quantifiers/quantifiers_attributes.cpp index e3463df0d..d93de6a54 100644 --- a/src/theory/quantifiers/quantifiers_attributes.cpp +++ b/src/theory/quantifiers/quantifiers_attributes.cpp @@ -2,9 +2,9 @@ /*! \file quantifiers_attributes.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Paul Meng, Tim King + ** Andrew Reynolds, Paul Meng, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/quantifiers_attributes.h b/src/theory/quantifiers/quantifiers_attributes.h index d3acc9434..329f9d08a 100644 --- a/src/theory/quantifiers/quantifiers_attributes.h +++ b/src/theory/quantifiers/quantifiers_attributes.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_ATTRIBUTES_H -#define __CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_ATTRIBUTES_H +#ifndef CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_ATTRIBUTES_H +#define CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_ATTRIBUTES_H #include "expr/attribute.h" #include "expr/node.h" diff --git a/src/theory/quantifiers/quantifiers_rewriter.cpp b/src/theory/quantifiers/quantifiers_rewriter.cpp index e2a26f6e6..015bf9c5a 100644 --- a/src/theory/quantifiers/quantifiers_rewriter.cpp +++ b/src/theory/quantifiers/quantifiers_rewriter.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/quantifiers_rewriter.h b/src/theory/quantifiers/quantifiers_rewriter.h index a1d6d25c3..09f26b65b 100644 --- a/src/theory/quantifiers/quantifiers_rewriter.h +++ b/src/theory/quantifiers/quantifiers_rewriter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_REWRITER_H -#define __CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_REWRITER_H +#ifndef CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_REWRITER_H +#define CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_REWRITER_H #include "theory/rewriter.h" #include "theory/quantifiers_engine.h" @@ -188,6 +188,6 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_REWRITER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__QUANTIFIERS_REWRITER_H */ diff --git a/src/theory/quantifiers/query_generator.cpp b/src/theory/quantifiers/query_generator.cpp index e62f3513c..bc7538c1f 100644 --- a/src/theory/quantifiers/query_generator.cpp +++ b/src/theory/quantifiers/query_generator.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -185,9 +185,9 @@ void QueryGenerator::checkQuery(Node qy, unsigned spIndex) NodeManager* nm = NodeManager::currentNM(); // make the satisfiability query bool needExport = false; - ExprManagerMapCollection varMap; ExprManager em(nm->getOptions()); std::unique_ptr<SmtEngine> queryChecker; + ExprManagerMapCollection varMap; initializeChecker(queryChecker, em, varMap, qy, needExport); Result r = queryChecker->checkSat(); Trace("sygus-qgen-check") << " query: ...got : " << r << std::endl; diff --git a/src/theory/quantifiers/query_generator.h b/src/theory/quantifiers/query_generator.h index f0b3fa565..749c78c85 100644 --- a/src/theory/quantifiers/query_generator.h +++ b/src/theory/quantifiers/query_generator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__QUERY_GENERATOR_H -#define __CVC4__THEORY__QUANTIFIERS__QUERY_GENERATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__QUERY_GENERATOR_H +#define CVC4__THEORY__QUANTIFIERS__QUERY_GENERATOR_H #include <map> #include <unordered_set> @@ -113,4 +113,4 @@ class QueryGenerator : public ExprMiner } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS___H */ +#endif /* CVC4__THEORY__QUANTIFIERS___H */ diff --git a/src/theory/quantifiers/relevant_domain.cpp b/src/theory/quantifiers/relevant_domain.cpp index 849e73822..071bd7933 100644 --- a/src/theory/quantifiers/relevant_domain.cpp +++ b/src/theory/quantifiers/relevant_domain.cpp @@ -2,9 +2,9 @@ /*! \file relevant_domain.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -169,7 +169,9 @@ void RelevantDomain::computeRelevantDomain( Node q, Node n, bool hasPol, bool po computeRelevantDomainOpCh( rf, n[i] ); } } - if( n[i].getKind()!=FORALL ){ + // do not recurse under nested closures + if (!n[i].isClosure()) + { bool newHasPol; bool newPol; QuantPhaseReq::getPolarity( n, i, hasPol, pol, newHasPol, newPol ); diff --git a/src/theory/quantifiers/relevant_domain.h b/src/theory/quantifiers/relevant_domain.h index 78fe23890..8f348b471 100644 --- a/src/theory/quantifiers/relevant_domain.h +++ b/src/theory/quantifiers/relevant_domain.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__RELEVANT_DOMAIN_H -#define __CVC4__THEORY__QUANTIFIERS__RELEVANT_DOMAIN_H +#ifndef CVC4__THEORY__QUANTIFIERS__RELEVANT_DOMAIN_H +#define CVC4__THEORY__QUANTIFIERS__RELEVANT_DOMAIN_H #include "theory/quantifiers/first_order_model.h" #include "theory/quantifiers/quant_util.h" @@ -163,4 +163,4 @@ class RelevantDomain : public QuantifiersUtil }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__RELEVANT_DOMAIN_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__RELEVANT_DOMAIN_H */ diff --git a/src/theory/quantifiers/rewrite_engine.cpp b/src/theory/quantifiers/rewrite_engine.cpp index ed9666d80..ff42a9c89 100644 --- a/src/theory/quantifiers/rewrite_engine.cpp +++ b/src/theory/quantifiers/rewrite_engine.cpp @@ -2,9 +2,9 @@ /*! \file rewrite_engine.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/rewrite_engine.h b/src/theory/quantifiers/rewrite_engine.h index febcc0126..bbd6a1534 100644 --- a/src/theory/quantifiers/rewrite_engine.h +++ b/src/theory/quantifiers/rewrite_engine.h @@ -2,9 +2,9 @@ /*! \file rewrite_engine.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner, Tim King + ** Andrew Reynolds, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__REWRITE_ENGINE_H -#define __CVC4__REWRITE_ENGINE_H +#ifndef CVC4__REWRITE_ENGINE_H +#define CVC4__REWRITE_ENGINE_H #include "context/context.h" #include "context/context_mm.h" diff --git a/src/theory/quantifiers/single_inv_partition.cpp b/src/theory/quantifiers/single_inv_partition.cpp index 851204a84..153ab71cc 100644 --- a/src/theory/quantifiers/single_inv_partition.cpp +++ b/src/theory/quantifiers/single_inv_partition.cpp @@ -2,9 +2,9 @@ /*! \file single_inv_partition.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/single_inv_partition.h b/src/theory/quantifiers/single_inv_partition.h index 199ab29d4..0a4af3185 100644 --- a/src/theory/quantifiers/single_inv_partition.h +++ b/src/theory/quantifiers/single_inv_partition.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SINGLE_INV_PARTITION_H -#define __CVC4__THEORY__QUANTIFIERS__SINGLE_INV_PARTITION_H +#ifndef CVC4__THEORY__QUANTIFIERS__SINGLE_INV_PARTITION_H +#define CVC4__THEORY__QUANTIFIERS__SINGLE_INV_PARTITION_H #include <map> #include <vector> @@ -294,4 +294,4 @@ class SingleInvocationPartition } /* namespace CVC4::theory */ } /* namespace CVC4 */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SINGLE_INV_PARTITION_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SINGLE_INV_PARTITION_H */ diff --git a/src/theory/quantifiers/skolemize.cpp b/src/theory/quantifiers/skolemize.cpp index 2f12c000c..1d2b869c4 100644 --- a/src/theory/quantifiers/skolemize.cpp +++ b/src/theory/quantifiers/skolemize.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/skolemize.h b/src/theory/quantifiers/skolemize.h index 5605c8c5f..f07bbdfd3 100644 --- a/src/theory/quantifiers/skolemize.h +++ b/src/theory/quantifiers/skolemize.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SKOLEMIZE_H -#define __CVC4__THEORY__QUANTIFIERS__SKOLEMIZE_H +#ifndef CVC4__THEORY__QUANTIFIERS__SKOLEMIZE_H +#define CVC4__THEORY__QUANTIFIERS__SKOLEMIZE_H #include <unordered_map> #include <unordered_set> @@ -143,4 +143,4 @@ class Skolemize } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SKOLEMIZE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SKOLEMIZE_H */ diff --git a/src/theory/quantifiers/solution_filter.cpp b/src/theory/quantifiers/solution_filter.cpp index 19d39e997..2c6186372 100644 --- a/src/theory/quantifiers/solution_filter.cpp +++ b/src/theory/quantifiers/solution_filter.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/solution_filter.h b/src/theory/quantifiers/solution_filter.h index d162f41f0..bd4c62a09 100644 --- a/src/theory/quantifiers/solution_filter.h +++ b/src/theory/quantifiers/solution_filter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SOLUTION_FILTER_H -#define __CVC4__THEORY__QUANTIFIERS__SOLUTION_FILTER_H +#ifndef CVC4__THEORY__QUANTIFIERS__SOLUTION_FILTER_H +#define CVC4__THEORY__QUANTIFIERS__SOLUTION_FILTER_H #include <map> #include <unordered_set> @@ -72,4 +72,4 @@ class SolutionFilterStrength : public ExprMiner } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__SOLUTION_FILTER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SOLUTION_FILTER_H */ diff --git a/src/theory/quantifiers/sygus/ce_guided_single_inv.cpp b/src/theory/quantifiers/sygus/ce_guided_single_inv.cpp index aa20c1f76..00d040af5 100644 --- a/src/theory/quantifiers/sygus/ce_guided_single_inv.cpp +++ b/src/theory/quantifiers/sygus/ce_guided_single_inv.cpp @@ -2,9 +2,9 @@ /*! \file ce_guided_single_inv.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/ce_guided_single_inv.h b/src/theory/quantifiers/sygus/ce_guided_single_inv.h index 0de7b4290..4b24cbb1c 100644 --- a/src/theory/quantifiers/sygus/ce_guided_single_inv.h +++ b/src/theory/quantifiers/sygus/ce_guided_single_inv.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CE_GUIDED_SINGLE_INV_H -#define __CVC4__THEORY__QUANTIFIERS__CE_GUIDED_SINGLE_INV_H +#ifndef CVC4__THEORY__QUANTIFIERS__CE_GUIDED_SINGLE_INV_H +#define CVC4__THEORY__QUANTIFIERS__CE_GUIDED_SINGLE_INV_H #include "context/cdlist.h" #include "theory/quantifiers/sygus/ce_guided_single_inv_sol.h" diff --git a/src/theory/quantifiers/sygus/ce_guided_single_inv_sol.cpp b/src/theory/quantifiers/sygus/ce_guided_single_inv_sol.cpp index 7f7c56f84..074971622 100644 --- a/src/theory/quantifiers/sygus/ce_guided_single_inv_sol.cpp +++ b/src/theory/quantifiers/sygus/ce_guided_single_inv_sol.cpp @@ -2,9 +2,9 @@ /*! \file ce_guided_single_inv_sol.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/ce_guided_single_inv_sol.h b/src/theory/quantifiers/sygus/ce_guided_single_inv_sol.h index fb0862413..40117af6c 100644 --- a/src/theory/quantifiers/sygus/ce_guided_single_inv_sol.h +++ b/src/theory/quantifiers/sygus/ce_guided_single_inv_sol.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CE_GUIDED_SINGLE_INV_SOL_H -#define __CVC4__THEORY__QUANTIFIERS__CE_GUIDED_SINGLE_INV_SOL_H +#ifndef CVC4__THEORY__QUANTIFIERS__CE_GUIDED_SINGLE_INV_SOL_H +#define CVC4__THEORY__QUANTIFIERS__CE_GUIDED_SINGLE_INV_SOL_H #include "context/cdhashmap.h" #include "theory/quantifiers_engine.h" diff --git a/src/theory/quantifiers/sygus/cegis.cpp b/src/theory/quantifiers/sygus/cegis.cpp index 6aca71ca3..314b43711 100644 --- a/src/theory/quantifiers/sygus/cegis.cpp +++ b/src/theory/quantifiers/sygus/cegis.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/cegis.h b/src/theory/quantifiers/sygus/cegis.h index 849a39639..a295f6a40 100644 --- a/src/theory/quantifiers/sygus/cegis.h +++ b/src/theory/quantifiers/sygus/cegis.h @@ -2,9 +2,9 @@ /*! \file cegis.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Haniel Barbosa, Andres Noetzli + ** Andrew Reynolds, Haniel Barbosa, FabianWolff ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__CEGIS_H -#define __CVC4__THEORY__QUANTIFIERS__CEGIS_H +#ifndef CVC4__THEORY__QUANTIFIERS__CEGIS_H +#define CVC4__THEORY__QUANTIFIERS__CEGIS_H #include <map> #include "theory/quantifiers/sygus/sygus_module.h" @@ -209,4 +209,4 @@ class Cegis : public SygusModule } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__CEGIS_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__CEGIS_H */ diff --git a/src/theory/quantifiers/sygus/cegis_unif.cpp b/src/theory/quantifiers/sygus/cegis_unif.cpp index 18e313bf0..e34669425 100644 --- a/src/theory/quantifiers/sygus/cegis_unif.cpp +++ b/src/theory/quantifiers/sygus/cegis_unif.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/cegis_unif.h b/src/theory/quantifiers/sygus/cegis_unif.h index 972d07af7..a2e7be1c1 100644 --- a/src/theory/quantifiers/sygus/cegis_unif.h +++ b/src/theory/quantifiers/sygus/cegis_unif.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -13,8 +13,8 @@ **/ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS__CEGIS_UNIF_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS__CEGIS_UNIF_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS__CEGIS_UNIF_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS__CEGIS_UNIF_H #include <map> #include <vector> diff --git a/src/theory/quantifiers/sygus/enum_stream_substitution.cpp b/src/theory/quantifiers/sygus/enum_stream_substitution.cpp index e8daa4256..b568b8f53 100644 --- a/src/theory/quantifiers/sygus/enum_stream_substitution.cpp +++ b/src/theory/quantifiers/sygus/enum_stream_substitution.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/enum_stream_substitution.h b/src/theory/quantifiers/sygus/enum_stream_substitution.h index 476a364ea..687641e60 100644 --- a/src/theory/quantifiers/sygus/enum_stream_substitution.h +++ b/src/theory/quantifiers/sygus/enum_stream_substitution.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ **/ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS__ENUM_STREAM_SUBSTITUTION_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS__ENUM_STREAM_SUBSTITUTION_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS__ENUM_STREAM_SUBSTITUTION_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS__ENUM_STREAM_SUBSTITUTION_H #include "expr/node.h" #include "theory/quantifiers/sygus/synth_conjecture.h" diff --git a/src/theory/quantifiers/sygus/sygus_enumerator.cpp b/src/theory/quantifiers/sygus/sygus_enumerator.cpp index 9981b5141..bd85ea496 100644 --- a/src/theory/quantifiers/sygus/sygus_enumerator.cpp +++ b/src/theory/quantifiers/sygus/sygus_enumerator.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -476,6 +476,13 @@ bool SygusEnumerator::TermEnumSlave::validateIndex() { Assert(d_index == tc.getNumTerms()); Trace("sygus-enum-debug2") << "slave(" << d_tn << ") : force master...\n"; + // if the size of the master is larger than the size limit, then + // there is no use continuing, since there are no more terms that this + // slave enumerator can return. + if (d_master->getCurrentSize() > d_sizeLim) + { + return false; + } // must push the master index if (!d_master->increment()) { @@ -655,9 +662,14 @@ bool SygusEnumerator::TermEnumMaster::increment() { return false; } + Trace("sygus-enum-summary") << "SygusEnumerator::TermEnumMaster: increment " + << d_tn << "..." << std::endl; d_isIncrementing = true; bool ret = incrementInternal(); d_isIncrementing = false; + Trace("sygus-enum-summary") + << "SygusEnumerator::TermEnumMaster: finished increment " << d_tn + << std::endl; return ret; } @@ -789,7 +801,15 @@ bool SygusEnumerator::TermEnumMaster::incrementInternal() // restart with constructor class one (skip nullary constructors) d_consClassNum = 1; - return incrementInternal(); + + // We break for a round: return the null term when we cross a size + // boundary. This ensures that the necessary breaks are taken, e.g. + // in slave enumerators who may instead want to abandon this call to + // increment master when the size of the master makes their increment + // infeasible. + d_currTermSet = true; + d_currTerm = Node::null(); + return true; } bool incSuccess = false; @@ -819,6 +839,8 @@ bool SygusEnumerator::TermEnumMaster::incrementInternal() // the term was not unique based on rewriting Trace("sygus-enum-debug2") << "master(" << d_tn << "): failed addTerm\n"; + // we will return null (d_currTermSet is true at this point) + Assert(d_currTermSet); d_currTerm = Node::null(); } } diff --git a/src/theory/quantifiers/sygus/sygus_enumerator.h b/src/theory/quantifiers/sygus/sygus_enumerator.h index 716a047d2..d4c466b03 100644 --- a/src/theory/quantifiers/sygus/sygus_enumerator.h +++ b/src/theory/quantifiers/sygus/sygus_enumerator.h @@ -1,10 +1,10 @@ -/******************** */ +/********************* */ /*! \file sygus_enumerator.h ** \verbatim ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_ENUMERATOR_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_ENUMERATOR_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_ENUMERATOR_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_ENUMERATOR_H #include <map> #include <unordered_set> @@ -454,4 +454,4 @@ class SygusEnumerator : public EnumValGenerator } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_ENUMERATOR_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_ENUMERATOR_H */ diff --git a/src/theory/quantifiers/sygus/sygus_eval_unfold.cpp b/src/theory/quantifiers/sygus/sygus_eval_unfold.cpp index ac7467c00..e44b604d0 100644 --- a/src/theory/quantifiers/sygus/sygus_eval_unfold.cpp +++ b/src/theory/quantifiers/sygus/sygus_eval_unfold.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_eval_unfold.h b/src/theory/quantifiers/sygus/sygus_eval_unfold.h index 94f37c845..adc54c6a7 100644 --- a/src/theory/quantifiers/sygus/sygus_eval_unfold.h +++ b/src/theory/quantifiers/sygus/sygus_eval_unfold.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_EVAL_UNFOLD_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_EVAL_UNFOLD_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_EVAL_UNFOLD_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_EVAL_UNFOLD_H #include <map> #include "expr/node.h" @@ -113,4 +113,4 @@ class SygusEvalUnfold } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_EVAL_UNFOLD_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_EVAL_UNFOLD_H */ diff --git a/src/theory/quantifiers/sygus/sygus_explain.cpp b/src/theory/quantifiers/sygus/sygus_explain.cpp index ddf52001e..f55ce2097 100644 --- a/src/theory/quantifiers/sygus/sygus_explain.cpp +++ b/src/theory/quantifiers/sygus/sygus_explain.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_explain.h b/src/theory/quantifiers/sygus/sygus_explain.h index 3f18a65d6..ec29ab2a1 100644 --- a/src/theory/quantifiers/sygus/sygus_explain.h +++ b/src/theory/quantifiers/sygus/sygus_explain.h @@ -2,9 +2,9 @@ /*! \file sygus_explain.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, FabianWolff ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_EXPLAIN_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_EXPLAIN_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_EXPLAIN_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_EXPLAIN_H #include <vector> @@ -241,4 +241,4 @@ class SygusExplain } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_EXPLAIN_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_EXPLAIN_H */ diff --git a/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp b/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp index 67fa1398e..48da8e8e8 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp +++ b/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_grammar_cons.h b/src/theory/quantifiers/sygus/sygus_grammar_cons.h index bf377bd33..7dfa9b478 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_cons.h +++ b/src/theory/quantifiers/sygus/sygus_grammar_cons.h @@ -2,9 +2,9 @@ /*! \file sygus_grammar_cons.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_CONS_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_CONS_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_CONS_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_CONS_H #include "theory/quantifiers_engine.h" diff --git a/src/theory/quantifiers/sygus/sygus_grammar_norm.cpp b/src/theory/quantifiers/sygus/sygus_grammar_norm.cpp index 8e41b6b07..fb6b23132 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_norm.cpp +++ b/src/theory/quantifiers/sygus/sygus_grammar_norm.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_grammar_norm.h b/src/theory/quantifiers/sygus/sygus_grammar_norm.h index 993d41668..ae701113c 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_norm.h +++ b/src/theory/quantifiers/sygus/sygus_grammar_norm.h @@ -2,9 +2,9 @@ /*! \file sygus_grammar_norm.h ** \verbatim ** Top contributors (to current version): - ** Haniel Barbosa, Tim King, Andrew Reynolds + ** Haniel Barbosa, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ **/ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_NORM_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_NORM_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_NORM_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_NORM_H #include <map> #include <memory> diff --git a/src/theory/quantifiers/sygus/sygus_grammar_red.cpp b/src/theory/quantifiers/sygus/sygus_grammar_red.cpp index 24aa74c9e..6ad590f28 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_red.cpp +++ b/src/theory/quantifiers/sygus/sygus_grammar_red.cpp @@ -2,9 +2,9 @@ /*! \file sygus_grammar_red.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_grammar_red.h b/src/theory/quantifiers/sygus/sygus_grammar_red.h index ce83402c9..8ed080a30 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_red.h +++ b/src/theory/quantifiers/sygus/sygus_grammar_red.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_RED_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_RED_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_RED_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_RED_H #include <map> #include "theory/quantifiers_engine.h" @@ -116,4 +116,4 @@ class SygusRedundantCons } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_RED_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_GRAMMAR_RED_H */ diff --git a/src/theory/quantifiers/sygus/sygus_invariance.cpp b/src/theory/quantifiers/sygus/sygus_invariance.cpp index 5ea01ef57..b494e085e 100644 --- a/src/theory/quantifiers/sygus/sygus_invariance.cpp +++ b/src/theory/quantifiers/sygus/sygus_invariance.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_invariance.h b/src/theory/quantifiers/sygus/sygus_invariance.h index 02c249411..feb2d3313 100644 --- a/src/theory/quantifiers/sygus/sygus_invariance.h +++ b/src/theory/quantifiers/sygus/sygus_invariance.h @@ -2,9 +2,9 @@ /*! \file sygus_invariance.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Mathias Preiner + ** Andrew Reynolds, Mathias Preiner, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_INVARIANCE_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_INVARIANCE_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_INVARIANCE_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_INVARIANCE_H #include <unordered_map> #include <vector> @@ -300,4 +300,4 @@ class NegContainsSygusInvarianceTest : public SygusInvarianceTest } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_INVARIANCE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_INVARIANCE_H */ diff --git a/src/theory/quantifiers/sygus/sygus_module.cpp b/src/theory/quantifiers/sygus/sygus_module.cpp index 3471472fa..42a125ae5 100644 --- a/src/theory/quantifiers/sygus/sygus_module.cpp +++ b/src/theory/quantifiers/sygus/sygus_module.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_module.h b/src/theory/quantifiers/sygus/sygus_module.h index fef24e9bb..d5e1de3fc 100644 --- a/src/theory/quantifiers/sygus/sygus_module.h +++ b/src/theory/quantifiers/sygus/sygus_module.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_MODULE_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_MODULE_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_MODULE_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_MODULE_H #include <map> #include "expr/node.h" @@ -148,4 +148,4 @@ class SygusModule } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_MODULE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_MODULE_H */ diff --git a/src/theory/quantifiers/sygus/sygus_pbe.cpp b/src/theory/quantifiers/sygus/sygus_pbe.cpp index 7891814be..2ab51f1fb 100644 --- a/src/theory/quantifiers/sygus/sygus_pbe.cpp +++ b/src/theory/quantifiers/sygus/sygus_pbe.cpp @@ -2,9 +2,9 @@ /*! \file sygus_pbe.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Haniel Barbosa, Aina Niemetz + ** Andrew Reynolds, Haniel Barbosa, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_pbe.h b/src/theory/quantifiers/sygus/sygus_pbe.h index dc7f1cc51..e82ce01da 100644 --- a/src/theory/quantifiers/sygus/sygus_pbe.h +++ b/src/theory/quantifiers/sygus/sygus_pbe.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_PBE_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_PBE_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_PBE_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_PBE_H #include "context/cdhashmap.h" #include "theory/quantifiers/sygus/sygus_module.h" diff --git a/src/theory/quantifiers/sygus/sygus_process_conj.cpp b/src/theory/quantifiers/sygus/sygus_process_conj.cpp index a2454758a..2b9592d4d 100644 --- a/src/theory/quantifiers/sygus/sygus_process_conj.cpp +++ b/src/theory/quantifiers/sygus/sygus_process_conj.cpp @@ -2,9 +2,9 @@ /*! \file sygus_process_conj.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_process_conj.h b/src/theory/quantifiers/sygus/sygus_process_conj.h index 199619699..e9ee340f4 100644 --- a/src/theory/quantifiers/sygus/sygus_process_conj.h +++ b/src/theory/quantifiers/sygus/sygus_process_conj.h @@ -2,9 +2,9 @@ /*! \file sygus_process_conj.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_PROCESS_CONJ_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_PROCESS_CONJ_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_PROCESS_CONJ_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_PROCESS_CONJ_H #include <map> #include <unordered_map> diff --git a/src/theory/quantifiers/sygus/sygus_repair_const.cpp b/src/theory/quantifiers/sygus/sygus_repair_const.cpp index 09525712f..85a0a4bf8 100644 --- a/src/theory/quantifiers/sygus/sygus_repair_const.cpp +++ b/src/theory/quantifiers/sygus/sygus_repair_const.cpp @@ -2,9 +2,9 @@ /*! \file sygus_repair_const.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Haniel Barbosa, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -115,6 +115,7 @@ void SygusRepairConst::initializeChecker(std::unique_ptr<SmtEngine>& checker, try { checker.reset(new SmtEngine(&em)); + checker->setIsInternalSubsolver(); checker->setTimeLimit(options::sygusRepairConstTimeout(), true); checker->setLogic(smt::currentSmtEngine()->getLogicInfo()); // renable options disabled by sygus diff --git a/src/theory/quantifiers/sygus/sygus_repair_const.h b/src/theory/quantifiers/sygus/sygus_repair_const.h index c6bfd2806..bc3a58f9e 100644 --- a/src/theory/quantifiers/sygus/sygus_repair_const.h +++ b/src/theory/quantifiers/sygus/sygus_repair_const.h @@ -2,9 +2,9 @@ /*! \file sygus_repair_const.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_REPAIR_CONST_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_REPAIR_CONST_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_REPAIR_CONST_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_REPAIR_CONST_H #include <unordered_set> #include "expr/node.h" @@ -215,4 +215,4 @@ class SygusRepairConst } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_REPAIR_CONST_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_REPAIR_CONST_H */ diff --git a/src/theory/quantifiers/sygus/sygus_unif.cpp b/src/theory/quantifiers/sygus/sygus_unif.cpp index 5d7017a1c..2eb508fde 100644 --- a/src/theory/quantifiers/sygus/sygus_unif.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif.cpp @@ -2,9 +2,9 @@ /*! \file sygus_unif.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Haniel Barbosa + ** Andrew Reynolds, Aina Niemetz, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_unif.h b/src/theory/quantifiers/sygus/sygus_unif.h index 0784644f8..a5215628c 100644 --- a/src/theory/quantifiers/sygus/sygus_unif.h +++ b/src/theory/quantifiers/sygus/sygus_unif.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_H #include <map> #include "expr/node.h" @@ -196,4 +196,4 @@ class SygusUnif } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_H */ diff --git a/src/theory/quantifiers/sygus/sygus_unif_io.cpp b/src/theory/quantifiers/sygus/sygus_unif_io.cpp index c9db62735..207aa4c8e 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_io.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_io.cpp @@ -2,9 +2,9 @@ /*! \file sygus_unif_io.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Haniel Barbosa + ** Andrew Reynolds, Haniel Barbosa, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -161,7 +161,12 @@ bool UnifContextIo::getStringIncrement(SygusUnifIo* sui, if (d_vals[j] == sui->d_true) { // example is active in this context - Assert(vals[j].isConst()); + if (!vals[j].isConst()) + { + // the value is unknown, thus we cannot use it to increment the strings + // position + return false; + } String mystr = vals[j].getConst<String>(); ival = mystr.size(); if (mystr.size() <= ex_vals[j].size()) @@ -199,7 +204,11 @@ bool UnifContextIo::isStringSolved(SygusUnifIo* sui, if (d_vals[j] == sui->d_true) { // example is active in this context - Assert(vals[j].isConst()); + if (!vals[j].isConst()) + { + // value is unknown, thus it does not solve + return false; + } String mystr = vals[j].getConst<String>(); if (ex_vals[j] != mystr) { @@ -448,12 +457,23 @@ void SubsumeTrie::getLeavesInternal(const std::vector<Node>& vals, ++it) { int new_status = status; - // if the current value is true + bool success = true; + // If the current value is true, then this is a relevant point. + // We must consider the value of this child. if (curr_val_true) { - if (status != 0) + if (it->first.isNull()) { - Assert(it->first.isConst() && it->first.getType().isBoolean()); + // The value of this child is unknown on this point, hence we + // do not recurse + success = false; + } + else if (status != 0) + { + // if the status is not zero (indicating that we have a mix of T/F), + // then we must compute the new status. + Assert(it->first.getType().isBoolean()); + Assert(it->first.isConst()); new_status = (it->first.getConst<bool>() ? 1 : -1); if (status != -2 && new_status != status) { @@ -461,7 +481,10 @@ void SubsumeTrie::getLeavesInternal(const std::vector<Node>& vals, } } } - it->second.getLeavesInternal(vals, pol, v, index + 1, new_status); + if (success) + { + it->second.getLeavesInternal(vals, pol, v, index + 1, new_status); + } } } } @@ -641,23 +664,41 @@ void SygusUnifIo::notifyEnumeration(Node e, Node v, std::vector<Node>& lemmas) for (unsigned j = 0, size = itsr->second.size(); j < size; j++) { Node res = itsr->second[j]; - Assert(res.isConst()); + // The value of this term for this example, or the truth value of + // the I/O pair if the role of this enumerator is enum_io. Node resb; if (eiv.getRole() == enum_io) { Node out = d_examples_out[j]; Assert(out.isConst()); - resb = res == out ? d_true : d_false; + // If the result is not constant, then we assume that it does + // not satisfy the example. This is a safe underapproximation + // of the good behavior of the current term, that is, we only + // produce solutions whose values are fully evaluatable on all input + // points. Notice that terms may be used as leaves of decision + // trees that are fully evaluatable on points in that branch, but + // are not evaluatable on others, e.g. (head x) in the solution: + // (ite ((_ is cons) x) (head x) 5) + resb = (res.isConst() && res == out) ? d_true : d_false; } else { - resb = res; + // We only set resb if it is constant, otherwise it remains null. + // This indicates its value cannot be determined. + if (res.isConst()) + { + resb = res; + } } cond_vals[resb] = true; results.push_back(resb); if (Trace.isOn("sygus-sui-enum")) { - if (resb.getType().isBoolean()) + if (resb.isNull()) + { + Trace("sygus-sui-enum") << "_"; + } + else if (resb.getType().isBoolean()) { Trace("sygus-sui-enum") << (resb == d_true ? "1" : "0"); } @@ -677,6 +718,7 @@ void SygusUnifIo::notifyEnumeration(Node e, Node v, std::vector<Node>& lemmas) std::vector<Node> subsume; if (cond_vals.find(d_false) == cond_vals.end()) { + Assert(cond_vals.size() == 1); // it is the entire solution, we are done Trace("sygus-sui-enum") << " ...success, full solution added to PBE pool : " @@ -917,23 +959,27 @@ bool SygusUnifIo::getExplanationForEnumeratorExclude( std::vector<unsigned> cmp_indices; for (unsigned i = 0, size = results.size(); i < size; i++) { - Assert(results[i].isConst()); - Assert(d_examples_out[i].isConst()); - Trace("sygus-sui-cterm-debug") - << " " << results[i] << " <> " << d_examples_out[i]; - Node cont = nm->mkNode(STRING_STRCTN, d_examples_out[i], results[i]); - Node contr = Rewriter::rewrite(cont); - if (contr == d_false) - { - cmp_indices.push_back(i); - Trace("sygus-sui-cterm-debug") << "...not contained." << std::endl; - } - else + // If the result is not constant, then it is worthless. It does not + // impact whether the term is excluded. + if (results[i].isConst()) { - Trace("sygus-sui-cterm-debug") << "...contained." << std::endl; - if (isConditional) + Assert(d_examples_out[i].isConst()); + Trace("sygus-sui-cterm-debug") + << " " << results[i] << " <> " << d_examples_out[i]; + Node cont = nm->mkNode(STRING_STRCTN, d_examples_out[i], results[i]); + Node contr = Rewriter::rewrite(cont); + if (contr == d_false) { - return false; + cmp_indices.push_back(i); + Trace("sygus-sui-cterm-debug") << "...not contained." << std::endl; + } + else + { + Trace("sygus-sui-cterm-debug") << "...contained." << std::endl; + if (isConditional) + { + return false; + } } } } diff --git a/src/theory/quantifiers/sygus/sygus_unif_io.h b/src/theory/quantifiers/sygus/sygus_unif_io.h index 7f48645bf..7e9c5abd2 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_io.h +++ b/src/theory/quantifiers/sygus/sygus_unif_io.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_IO_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_IO_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_IO_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_IO_H #include <map> #include "theory/quantifiers/sygus/sygus_unif.h" @@ -218,7 +218,24 @@ class SubsumeTrie int status, bool checkExistsOnly, bool checkSubsume); - /** helper function for above functions */ + /** helper function for above functions + * + * This adds to v[-1], v[0], v[1] the children of the trie that occur + * along paths that contain only false (v[-1]), a mix of true/false (v[0]), + * and only true (v[1]) values for respectively for relevant points. + * + * vals/pol is used to determine the relevant points, which impacts which + * paths of the trie to traverse on this call. + * In particular, all points such that (pol ? vals[index] : !vals[index]) + * are relevant. + * + * Paths that contain an unknown value for any relevant point are not + * traversed. In the larger picture, this ensures that terms are not used in a + * way such that their unknown value is relevant to the overall behavior of + * a synthesis solution. + * + * status holds the current value of v (0,1,-1) that we will be adding to. + */ void getLeavesInternal(const std::vector<Node>& vals, bool pol, std::map<int, std::vector<Node>>& v, @@ -472,4 +489,4 @@ class SygusUnifIo : public SygusUnif } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_IO_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_IO_H */ diff --git a/src/theory/quantifiers/sygus/sygus_unif_rl.cpp b/src/theory/quantifiers/sygus/sygus_unif_rl.cpp index ee07efdfe..3514ccbeb 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_rl.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_rl.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_unif_rl.h b/src/theory/quantifiers/sygus/sygus_unif_rl.h index 179a5ac16..ada99dbaf 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_rl.h +++ b/src/theory/quantifiers/sygus/sygus_unif_rl.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Haniel Barbosa, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_RL_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_RL_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_RL_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_RL_H #include <map> #include "options/main_options.h" @@ -434,4 +434,4 @@ class SygusUnifRl : public SygusUnif } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_RL_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_RL_H */ diff --git a/src/theory/quantifiers/sygus/sygus_unif_strat.cpp b/src/theory/quantifiers/sygus/sygus_unif_strat.cpp index 3cbac1eaa..acf5a2d7f 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_strat.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_strat.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/sygus/sygus_unif_strat.h b/src/theory/quantifiers/sygus/sygus_unif_strat.h index 41923f7a1..1c691bd84 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_strat.h +++ b/src/theory/quantifiers/sygus/sygus_unif_strat.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Haniel Barbosa, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_STRAT_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_STRAT_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_STRAT_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_STRAT_H #include <map> #include "expr/node.h" @@ -429,4 +429,4 @@ class SygusUnifStrategy } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_UNIF_H */ diff --git a/src/theory/quantifiers/sygus/synth_conjecture.cpp b/src/theory/quantifiers/sygus/synth_conjecture.cpp index e25e8a225..756e1f791 100644 --- a/src/theory/quantifiers/sygus/synth_conjecture.cpp +++ b/src/theory/quantifiers/sygus/synth_conjecture.cpp @@ -2,9 +2,9 @@ /*! \file synth_conjecture.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Haniel Barbosa + ** Andrew Reynolds, Haniel Barbosa, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -540,6 +540,7 @@ bool SynthConjecture::doCheck(std::vector<Node>& lems) Trace("cegqi-engine") << "Check side condition..." << std::endl; Trace("cegqi-debug") << "Check side condition : " << sc << std::endl; SmtEngine scSmt(nm->toExprManager()); + scSmt.setIsInternalSubsolver(); scSmt.setLogic(smt::currentSmtEngine()->getLogicInfo()); scSmt.assertFormula(sc.toExpr()); Result r = scSmt.checkSat(); @@ -572,6 +573,7 @@ bool SynthConjecture::doCheck(std::vector<Node>& lems) { Trace("cegqi-engine") << " *** Verify with subcall..." << std::endl; SmtEngine verifySmt(nm->toExprManager()); + verifySmt.setIsInternalSubsolver(); verifySmt.setLogic(smt::currentSmtEngine()->getLogicInfo()); verifySmt.assertFormula(query.toExpr()); Result r = verifySmt.checkSat(); diff --git a/src/theory/quantifiers/sygus/synth_conjecture.h b/src/theory/quantifiers/sygus/synth_conjecture.h index cf6178fdb..83a7eaa45 100644 --- a/src/theory/quantifiers/sygus/synth_conjecture.h +++ b/src/theory/quantifiers/sygus/synth_conjecture.h @@ -2,9 +2,9 @@ /*! \file synth_conjecture.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Haniel Barbosa + ** Andrew Reynolds, Haniel Barbosa, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYNTH_CONJECTURE_H -#define __CVC4__THEORY__QUANTIFIERS__SYNTH_CONJECTURE_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYNTH_CONJECTURE_H +#define CVC4__THEORY__QUANTIFIERS__SYNTH_CONJECTURE_H #include <memory> diff --git a/src/theory/quantifiers/sygus/synth_engine.cpp b/src/theory/quantifiers/sygus/synth_engine.cpp index d3eff1750..fc1ed938d 100644 --- a/src/theory/quantifiers/sygus/synth_engine.cpp +++ b/src/theory/quantifiers/sygus/synth_engine.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -159,6 +159,7 @@ void SynthEngine::assignConjecture(Node q) { // create new smt engine to do quantifier elimination SmtEngine smt_qe(nm->toExprManager()); + smt_qe.setIsInternalSubsolver(); smt_qe.setLogic(smt::currentSmtEngine()->getLogicInfo()); Trace("cegqi-qep") << "Property is non-ground single invocation, run " "QE to obtain single invocation." diff --git a/src/theory/quantifiers/sygus/synth_engine.h b/src/theory/quantifiers/sygus/synth_engine.h index a7346b888..d5337e5d1 100644 --- a/src/theory/quantifiers/sygus/synth_engine.h +++ b/src/theory/quantifiers/sygus/synth_engine.h @@ -2,9 +2,9 @@ /*! \file synth_engine.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner, Tim King + ** Andrew Reynolds, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYNTH_ENGINE_H -#define __CVC4__THEORY__QUANTIFIERS__SYNTH_ENGINE_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYNTH_ENGINE_H +#define CVC4__THEORY__QUANTIFIERS__SYNTH_ENGINE_H #include "context/cdhashmap.h" #include "theory/quantifiers/sygus/synth_conjecture.h" diff --git a/src/theory/quantifiers/sygus/term_database_sygus.cpp b/src/theory/quantifiers/sygus/term_database_sygus.cpp index 9198f7e56..af820b0fc 100644 --- a/src/theory/quantifiers/sygus/term_database_sygus.cpp +++ b/src/theory/quantifiers/sygus/term_database_sygus.cpp @@ -2,9 +2,9 @@ /*! \file term_database_sygus.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Haniel Barbosa, Aina Niemetz + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -1633,6 +1633,33 @@ Node TermDbSygus::evaluateWithUnfolding( while (ret.getKind() == DT_SYGUS_EVAL && ret[0].getKind() == APPLY_CONSTRUCTOR) { + if (ret == n && ret[0].isConst()) + { + Trace("dt-eval-unfold-debug") + << "Optimize: evaluate constant head " << ret << std::endl; + // can just do direct evaluation here + std::vector<Node> args; + bool success = true; + for (unsigned i = 1, nchild = ret.getNumChildren(); i < nchild; i++) + { + if (!ret[i].isConst()) + { + success = false; + break; + } + args.push_back(ret[i]); + } + if (success) + { + TypeNode rt = ret[0].getType(); + Node bret = sygusToBuiltin(ret[0], rt); + Node rete = evaluateBuiltin(rt, bret, args); + visited[n] = rete; + Trace("dt-eval-unfold-debug") + << "Return " << rete << " for " << n << std::endl; + return rete; + } + } ret = unfold( ret ); } if( ret.getNumChildren()>0 ){ diff --git a/src/theory/quantifiers/sygus/term_database_sygus.h b/src/theory/quantifiers/sygus/term_database_sygus.h index 7a522ded6..0f3d650d3 100644 --- a/src/theory/quantifiers/sygus/term_database_sygus.h +++ b/src/theory/quantifiers/sygus/term_database_sygus.h @@ -2,9 +2,9 @@ /*! \file term_database_sygus.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_SYGUS_H -#define __CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_SYGUS_H +#ifndef CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_SYGUS_H +#define CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_SYGUS_H #include <unordered_set> @@ -599,4 +599,4 @@ class TermDbSygus { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_H */ diff --git a/src/theory/quantifiers/sygus_sampler.cpp b/src/theory/quantifiers/sygus_sampler.cpp index f1908fc19..10d7ef6ab 100644 --- a/src/theory/quantifiers/sygus_sampler.cpp +++ b/src/theory/quantifiers/sygus_sampler.cpp @@ -2,9 +2,9 @@ /*! \file sygus_sampler.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Haniel Barbosa + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -40,7 +40,6 @@ void SygusSampler::initialize(TypeNode tn, d_tds = nullptr; d_use_sygus_type = false; d_is_valid = true; - d_tn = tn; d_ftn = TypeNode::null(); d_type_vars.clear(); d_vars.clear(); @@ -95,7 +94,6 @@ void SygusSampler::initializeSygus(TermDbSygus* tds, Assert(d_ftn.isDatatype()); const Datatype& dt = static_cast<DatatypeType>(d_ftn.toType()).getDatatype(); Assert(dt.isSygus()); - d_tn = TypeNode::fromType(dt.getSygusType()); Trace("sygus-sample") << "Register sampler for " << f << std::endl; @@ -264,28 +262,30 @@ bool SygusSampler::PtTrie::add(std::vector<Node>& pt) Node SygusSampler::registerTerm(Node n, bool forceKeep) { - if (d_is_valid) + if (!d_is_valid) { - Node bn = n; - // if this is a sygus type, get its builtin analog - if (d_use_sygus_type) - { - Assert(!d_ftn.isNull()); - bn = d_tds->sygusToBuiltin(n); - Assert(d_builtin_to_sygus.find(bn) == d_builtin_to_sygus.end() - || d_builtin_to_sygus[bn] == n); - d_builtin_to_sygus[bn] = n; - } - Assert(bn.getType() == d_tn); - Node res = d_trie.add(bn, this, 0, d_samples.size(), forceKeep); - if (d_use_sygus_type) - { - Assert(d_builtin_to_sygus.find(res) != d_builtin_to_sygus.end()); - res = res != bn ? d_builtin_to_sygus[res] : n; - } - return res; + // do nothing + return n; + } + Node bn = n; + TypeNode tn = n.getType(); + // If we are using sygus types, get the builtin analog of n. + if (d_use_sygus_type) + { + bn = d_tds->sygusToBuiltin(n); + d_builtin_to_sygus[tn][bn] = n; + } + // cache based on the (original) type of n + Node res = d_trie[tn].add(bn, this, 0, d_samples.size(), forceKeep); + // If we are using sygus types, map back to an original. + // Notice that d_builtin_to_sygus is not necessarily bijective. + if (d_use_sygus_type) + { + std::map<Node, Node>& bts = d_builtin_to_sygus[tn]; + Assert(bts.find(res) != bts.end()); + res = res != bn ? bts[res] : n; } - return n; + return res; } bool SygusSampler::isContiguous(Node n) diff --git a/src/theory/quantifiers/sygus_sampler.h b/src/theory/quantifiers/sygus_sampler.h index 28f715b34..429b6f511 100644 --- a/src/theory/quantifiers/sygus_sampler.h +++ b/src/theory/quantifiers/sygus_sampler.h @@ -2,9 +2,9 @@ /*! \file sygus_sampler.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Mathias Preiner + ** Andrew Reynolds, FabianWolff, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__SYGUS_SAMPLER_H -#define __CVC4__THEORY__QUANTIFIERS__SYGUS_SAMPLER_H +#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS_SAMPLER_H +#define CVC4__THEORY__QUANTIFIERS__SYGUS_SAMPLER_H #include <map> #include "theory/evaluator.h" @@ -194,14 +194,15 @@ class SygusSampler : public LazyTrieEvaluator }; /** a trie for samples */ PtTrie d_samples_trie; - /** type of nodes we will be registering with this class */ - TypeNode d_tn; /** the sygus type for this sampler (if applicable). */ TypeNode d_ftn; - /** whether we are registering terms of type d_ftn */ + /** whether we are registering terms of sygus types with this sampler */ bool d_use_sygus_type; - /** map from builtin terms to the sygus term they correspond to */ - std::map<Node, Node> d_builtin_to_sygus; + /** + * For each (sygus) type, a map from builtin terms to the sygus term they + * correspond to. + */ + std::map<TypeNode, std::map<Node, Node> > d_builtin_to_sygus; /** all variables we are sampling values for */ std::vector<Node> d_vars; /** type variables @@ -235,8 +236,22 @@ class SygusSampler : public LazyTrieEvaluator * that type. */ std::map<TypeNode, std::vector<Node> > d_type_consts; - /** the lazy trie */ - LazyTrie d_trie; + /** a lazy trie for each type + * + * This stores the evaluation of all terms registered to this class. + * + * Notice if we are registering sygus terms with this class, then terms + * are grouped into this trie according to their sygus type, and not their + * builtin type. For example, for grammar: + * A -> x | B+1 + * B -> x | 0 | 1 | B+B + * If we register C^B_+( C^B_x(), C^B_0() ) and C^A_x() with this class, + * then x+0 is registered to d_trie[B] and x is registered to d_trie[A], + * and no rewrite rule is reported. The reason for this is that otherwise + * we would end up reporting many useless rewrites since the same builtin + * term can be generated by multiple sygus types (e.g. C^B_x() and C^A_x()). + */ + std::map<TypeNode, LazyTrie> d_trie; /** is this sampler valid? * * A sampler can be invalid if sample points cannot be generated for a type @@ -307,4 +322,4 @@ class SygusSampler : public LazyTrieEvaluator } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__SYGUS_SAMPLER_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS_SAMPLER_H */ diff --git a/src/theory/quantifiers/term_canonize.cpp b/src/theory/quantifiers/term_canonize.cpp index d257198d9..9817da5a1 100644 --- a/src/theory/quantifiers/term_canonize.cpp +++ b/src/theory/quantifiers/term_canonize.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/term_canonize.h b/src/theory/quantifiers/term_canonize.h index e23627271..8f7b8722e 100644 --- a/src/theory/quantifiers/term_canonize.h +++ b/src/theory/quantifiers/term_canonize.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__TERM_CANONIZE_H -#define __CVC4__THEORY__QUANTIFIERS__TERM_CANONIZE_H +#ifndef CVC4__THEORY__QUANTIFIERS__TERM_CANONIZE_H +#define CVC4__THEORY__QUANTIFIERS__TERM_CANONIZE_H #include <map> #include "expr/node.h" @@ -89,4 +89,4 @@ class TermCanonize } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__QUANTIFIERS__TERM_CANONIZE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__TERM_CANONIZE_H */ diff --git a/src/theory/quantifiers/term_database.cpp b/src/theory/quantifiers/term_database.cpp index 44c5586c3..abb84ccd7 100644 --- a/src/theory/quantifiers/term_database.cpp +++ b/src/theory/quantifiers/term_database.cpp @@ -2,9 +2,9 @@ /*! \file term_database.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Francois Bobot + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -228,7 +228,7 @@ void TermDb::addTerm(Node n, d_iclosure_processed.insert(n); rec = true; } - if (rec && n.getKind() != FORALL) + if (rec && !n.isClosure()) { for (const Node& nc : n) { @@ -509,88 +509,196 @@ bool TermDb::inRelevantDomain( TNode f, unsigned i, TNode r ) { } } -//return a term n' equivalent to n -// maximal subterms of n' are representatives in the equality engine qy -Node TermDb::evaluateTerm2( TNode n, std::map< TNode, Node >& visited, EqualityQuery * qy, bool useEntailmentTests ) { +Node TermDb::evaluateTerm2(TNode n, + std::map<TNode, Node>& visited, + std::vector<Node>& exp, + EqualityQuery* qy, + bool useEntailmentTests, + bool computeExp, + bool reqHasTerm) +{ std::map< TNode, Node >::iterator itv = visited.find( n ); if( itv != visited.end() ){ return itv->second; } + size_t prevSize = exp.size(); Trace("term-db-eval") << "evaluate term : " << n << std::endl; Node ret = n; if( n.getKind()==FORALL || n.getKind()==BOUND_VARIABLE ){ //do nothing - }else if( !qy->hasTerm( n ) ){ - //term is not known to be equal to a representative in equality engine, evaluate it - if( n.hasOperator() ){ - TNode f = getMatchOperator( n ); - std::vector< TNode > args; - bool ret_set = false; - for( unsigned i=0; i<n.getNumChildren(); i++ ){ - TNode c = evaluateTerm2( n[i], visited, qy, useEntailmentTests ); - if( c.isNull() ){ - ret = Node::null(); + } + else if (qy->hasTerm(n)) + { + Trace("term-db-eval") << "...exists in ee, return rep" << std::endl; + ret = qy->getRepresentative(n); + if (computeExp) + { + if (n != ret) + { + exp.push_back(n.eqNode(ret)); + } + } + reqHasTerm = false; + } + else if (n.hasOperator()) + { + std::vector<TNode> args; + bool ret_set = false; + Kind k = n.getKind(); + std::vector<Node> tempExp; + for (unsigned i = 0, nchild = n.getNumChildren(); i < nchild; i++) + { + TNode c = evaluateTerm2(n[i], + visited, + tempExp, + qy, + useEntailmentTests, + computeExp, + reqHasTerm); + if (c.isNull()) + { + ret = Node::null(); + ret_set = true; + break; + } + else if (c == d_true || c == d_false) + { + // short-circuiting + if ((k == AND && c == d_false) || (k == OR && c == d_true)) + { + ret = c; + ret_set = true; + reqHasTerm = false; + break; + } + else if (k == ITE && i == 0) + { + ret = evaluateTerm2(n[c == d_true ? 1 : 2], + visited, + tempExp, + qy, + useEntailmentTests, + computeExp, + reqHasTerm); ret_set = true; + reqHasTerm = false; break; - }else if( c==d_true || c==d_false ){ - //short-circuiting - if( ( n.getKind()==kind::AND && c==d_false ) || ( n.getKind()==kind::OR && c==d_true ) ){ - ret = c; - ret_set = true; - break; - }else if( n.getKind()==kind::ITE && i==0 ){ - ret = evaluateTerm2( n[ c==d_true ? 1 : 2], visited, qy, useEntailmentTests ); - ret_set = true; - break; + } + } + if (computeExp) + { + exp.insert(exp.end(), tempExp.begin(), tempExp.end()); + } + Trace("term-db-eval") << " child " << i << " : " << c << std::endl; + args.push_back(c); + } + if (ret_set) + { + // if we short circuited + if (computeExp) + { + exp.clear(); + exp.insert(exp.end(), tempExp.begin(), tempExp.end()); + } + } + else + { + // get the (indexed) operator of n, if it exists + TNode f = getMatchOperator(n); + // if it is an indexed term, return the congruent term + if (!f.isNull()) + { + // if f is congruent to a term indexed by this class + TNode nn = qy->getCongruentTerm(f, args); + Trace("term-db-eval") << " got congruent term " << nn + << " from DB for " << n << std::endl; + if (!nn.isNull()) + { + if (computeExp) + { + Assert(nn.getNumChildren() == n.getNumChildren()); + for (unsigned i = 0, nchild = nn.getNumChildren(); i < nchild; i++) + { + if (nn[i] != n[i]) + { + exp.push_back(nn[i].eqNode(n[i])); + } + } + } + ret = qy->getRepresentative(nn); + Trace("term-db-eval") << "return rep" << std::endl; + ret_set = true; + reqHasTerm = false; + Assert(!ret.isNull()); + if (computeExp) + { + if (n != ret) + { + exp.push_back(nn.eqNode(ret)); + } } } - Trace("term-db-eval") << " child " << i << " : " << c << std::endl; - args.push_back( c ); } if( !ret_set ){ - //if it is an indexed term, return the congruent term - if( !f.isNull() ){ - TNode nn = qy->getCongruentTerm( f, args ); - Trace("term-db-eval") << " got congruent term " << nn << " from DB for " << n << std::endl; - if( !nn.isNull() ){ - ret = qy->getRepresentative( nn ); - Trace("term-db-eval") << "return rep" << std::endl; - ret_set = true; - Assert( !ret.isNull() ); - } + Trace("term-db-eval") << "return rewrite" << std::endl; + // a theory symbol or a new UF term + if (n.getMetaKind() == metakind::PARAMETERIZED) + { + args.insert(args.begin(), n.getOperator()); } - if( !ret_set ){ - Trace("term-db-eval") << "return rewrite" << std::endl; - //a theory symbol or a new UF term - if( n.getMetaKind() == kind::metakind::PARAMETERIZED ){ - args.insert( args.begin(), n.getOperator() ); - } - ret = NodeManager::currentNM()->mkNode( n.getKind(), args ); - ret = Rewriter::rewrite( ret ); - if( ret.getKind()==kind::EQUAL ){ - if( qy->areDisequal( ret[0], ret[1] ) ){ - ret = d_false; - } + ret = NodeManager::currentNM()->mkNode(n.getKind(), args); + ret = Rewriter::rewrite(ret); + if (ret.getKind() == EQUAL) + { + if (qy->areDisequal(ret[0], ret[1])) + { + ret = d_false; } - if( useEntailmentTests ){ - if( ret.getKind()==kind::EQUAL || ret.getKind()==kind::GEQ ){ - for( unsigned j=0; j<2; j++ ){ - std::pair<bool, Node> et = d_quantEngine->getTheoryEngine()->entailmentCheck(THEORY_OF_TYPE_BASED, j==0 ? ret : ret.negate() ); - if( et.first ){ - ret = j==0 ? d_true : d_false; - break; + } + if (useEntailmentTests) + { + if (ret.getKind() == EQUAL || ret.getKind() == GEQ) + { + TheoryEngine* te = d_quantEngine->getTheoryEngine(); + for (unsigned j = 0; j < 2; j++) + { + std::pair<bool, Node> et = te->entailmentCheck( + THEORY_OF_TYPE_BASED, j == 0 ? ret : ret.negate()); + if (et.first) + { + ret = j == 0 ? d_true : d_false; + if (computeExp) + { + exp.push_back(et.second); } + break; } } } } } } - }else{ - Trace("term-db-eval") << "...exists in ee, return rep" << std::endl; - ret = qy->getRepresentative( n ); } - Trace("term-db-eval") << "evaluated term : " << n << ", got : " << ret << std::endl; + // must have the term + if (reqHasTerm && !ret.isNull()) + { + Kind k = ret.getKind(); + if (k != OR && k != AND && k != EQUAL && k != ITE && k != NOT + && k != FORALL) + { + if (!qy->hasTerm(ret)) + { + ret = Node::null(); + } + } + } + Trace("term-db-eval") << "evaluated term : " << n << ", got : " << ret + << ", reqHasTerm = " << reqHasTerm << std::endl; + // clear the explanation if failed + if (computeExp && ret.isNull()) + { + exp.resize(prevSize); + } visited[n] = ret; return ret; } @@ -645,12 +753,33 @@ TNode TermDb::getEntailedTerm2( TNode n, std::map< TNode, TNode >& subs, bool su return TNode::null(); } -Node TermDb::evaluateTerm( TNode n, EqualityQuery * qy, bool useEntailmentTests ) { +Node TermDb::evaluateTerm(TNode n, + EqualityQuery* qy, + bool useEntailmentTests, + bool reqHasTerm) +{ if( qy==NULL ){ qy = d_quantEngine->getEqualityQuery(); } std::map< TNode, Node > visited; - return evaluateTerm2( n, visited, qy, useEntailmentTests ); + std::vector<Node> exp; + return evaluateTerm2( + n, visited, exp, qy, useEntailmentTests, false, reqHasTerm); +} + +Node TermDb::evaluateTerm(TNode n, + std::vector<Node>& exp, + EqualityQuery* qy, + bool useEntailmentTests, + bool reqHasTerm) +{ + if (qy == NULL) + { + qy = d_quantEngine->getEqualityQuery(); + } + std::map<TNode, Node> visited; + return evaluateTerm2( + n, visited, exp, qy, useEntailmentTests, true, reqHasTerm); } TNode TermDb::getEntailedTerm( TNode n, std::map< TNode, TNode >& subs, bool subsRep, EqualityQuery * qy ) { diff --git a/src/theory/quantifiers/term_database.h b/src/theory/quantifiers/term_database.h index cc9a24d08..148a18958 100644 --- a/src/theory/quantifiers/term_database.h +++ b/src/theory/quantifiers/term_database.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_H -#define __CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_H +#ifndef CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_H +#define CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_H #include <map> #include <unordered_set> @@ -178,17 +178,37 @@ class TermDb : public QuantifiersUtil { bool inRelevantDomain(TNode f, unsigned i, TNode r); /** evaluate term * - * Returns a term n' such that n = n' is entailed based on the equality - * information qy. This function may generate new terms. In particular, - * we typically rewrite maximal - * subterms of n to terms that exist in the equality engine specified by qy. - * - * useEntailmentTests is whether to use the theory engine's entailmentCheck - * call, for increased precision. This is not frequently used. - */ + * Returns a term n' such that n = n' is entailed based on the equality + * information qy. This function may generate new terms. In particular, + * we typically rewrite subterms of n of maximal size to terms that exist in + * the equality engine specified by qy. + * + * useEntailmentTests is whether to call the theory engine's entailmentTest + * on literals n for which this call fails to find a term n' that is + * equivalent to n, for increased precision. This is not frequently used. + * + * The vector exp stores the explanation for why n evaluates to that term, + * that is, if this call returns a non-null node n', then: + * exp => n = n' + * + * If reqHasTerm, then we require that the returned term is a Boolean + * combination of terms that exist in the equality engine used by this call. + * If no such term is constructable, this call returns null. The motivation + * for setting this to true is to "fail fast" if we require the return value + * of this function to only involve existing terms. This is used e.g. in + * the "propagating instances" portion of conflict-based instantiation + * (quant_conflict_find.h). + */ + Node evaluateTerm(TNode n, + std::vector<Node>& exp, + EqualityQuery* qy = NULL, + bool useEntailmentTests = false, + bool reqHasTerm = false); + /** same as above, without exp */ Node evaluateTerm(TNode n, EqualityQuery* qy = NULL, - bool useEntailmentTests = false); + bool useEntailmentTests = false, + bool reqHasTerm = false); /** get entailed term * * If possible, returns a term n' such that: @@ -307,7 +327,13 @@ class TermDb : public QuantifiersUtil { /** set has term */ void setHasTerm( Node n ); /** helper for evaluate term */ - Node evaluateTerm2( TNode n, std::map< TNode, Node >& visited, EqualityQuery * qy, bool useEntailmentTests ); + Node evaluateTerm2(TNode n, + std::map<TNode, Node>& visited, + std::vector<Node>& exp, + EqualityQuery* qy, + bool useEntailmentTests, + bool computeExp, + bool reqHasTerm); /** helper for get entailed term */ TNode getEntailedTerm2( TNode n, std::map< TNode, TNode >& subs, bool subsRep, bool hasSubs, EqualityQuery * qy ); /** helper for is entailed */ @@ -383,4 +409,4 @@ class TermDb : public QuantifiersUtil { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__TERM_DATABASE_H */ diff --git a/src/theory/quantifiers/term_enumeration.cpp b/src/theory/quantifiers/term_enumeration.cpp index 8e3219768..0336700ad 100644 --- a/src/theory/quantifiers/term_enumeration.cpp +++ b/src/theory/quantifiers/term_enumeration.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -87,6 +87,26 @@ bool TermEnumeration::mayComplete(TypeNode tn, unsigned maxCard) return mc; } +bool TermEnumeration::getDomain(TypeNode tn, std::vector<Node>& dom) +{ + if (!mayComplete(tn)) + { + return false; + } + Node curre; + unsigned counter = 0; + do + { + curre = getEnumerateTerm(tn, counter); + counter++; + if (!curre.isNull()) + { + dom.push_back(curre); + } + } while (!curre.isNull()); + return true; +} + } /* CVC4::theory::quantifiers namespace */ } /* CVC4::theory namespace */ } /* CVC4 namespace */ diff --git a/src/theory/quantifiers/term_enumeration.h b/src/theory/quantifiers/term_enumeration.h index cf25335f4..279680b1f 100644 --- a/src/theory/quantifiers/term_enumeration.h +++ b/src/theory/quantifiers/term_enumeration.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__TERM_ENUMERATION_H -#define __CVC4__THEORY__QUANTIFIERS__TERM_ENUMERATION_H +#ifndef CVC4__THEORY__QUANTIFIERS__TERM_ENUMERATION_H +#define CVC4__THEORY__QUANTIFIERS__TERM_ENUMERATION_H #include <unordered_map> #include <vector> @@ -56,6 +56,14 @@ class TermEnumeration */ static bool mayComplete(TypeNode tn, unsigned cardMax); + /** get domain + * + * If tn is a type such that mayComplete(tn) returns true, this method + * adds all domain elements of tn to dom and returns true. Otherwise, this + * method returns false. + */ + bool getDomain(TypeNode tn, std::vector<Node>& dom); + private: /** ground terms enumerated for types */ std::unordered_map<TypeNode, std::vector<Node>, TypeNodeHashFunction> @@ -74,4 +82,4 @@ class TermEnumeration } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__TERM_ENUMERATION_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__TERM_ENUMERATION_H */ diff --git a/src/theory/quantifiers/term_util.cpp b/src/theory/quantifiers/term_util.cpp index 4c9cf2c8d..065096607 100644 --- a/src/theory/quantifiers/term_util.cpp +++ b/src/theory/quantifiers/term_util.cpp @@ -2,9 +2,9 @@ /*! \file term_util.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Paul Meng, Yoni Zohar + ** Andrew Reynolds, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers/term_util.h b/src/theory/quantifiers/term_util.h index 820821991..1f2eea1c5 100644 --- a/src/theory/quantifiers/term_util.h +++ b/src/theory/quantifiers/term_util.h @@ -2,9 +2,9 @@ /*! \file term_util.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner + ** Andrew Reynolds, Morgan Deters, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__TERM_UTIL_H -#define __CVC4__THEORY__QUANTIFIERS__TERM_UTIL_H +#ifndef CVC4__THEORY__QUANTIFIERS__TERM_UTIL_H +#define CVC4__THEORY__QUANTIFIERS__TERM_UTIL_H #include <map> #include <unordered_set> @@ -379,4 +379,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__TERM_UTIL_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__TERM_UTIL_H */ diff --git a/src/theory/quantifiers/theory_quantifiers.cpp b/src/theory/quantifiers/theory_quantifiers.cpp index 6f647aeb1..f24a4bb2b 100644 --- a/src/theory/quantifiers/theory_quantifiers.cpp +++ b/src/theory/quantifiers/theory_quantifiers.cpp @@ -2,9 +2,9 @@ /*! \file theory_quantifiers.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -38,8 +38,6 @@ using namespace CVC4::theory::quantifiers; TheoryQuantifiers::TheoryQuantifiers(Context* c, context::UserContext* u, OutputChannel& out, Valuation valuation, const LogicInfo& logicInfo) : Theory(THEORY_QUANTIFIERS, c, u, out, valuation, logicInfo) { - d_numInstantiations = 0; - d_baseDecLevel = -1; out.handleUserAttribute( "axiom", this ); out.handleUserAttribute( "conjecture", this ); out.handleUserAttribute( "fun-def", this ); @@ -71,13 +69,6 @@ void TheoryQuantifiers::preRegisterTerm(TNode n) { return; } Debug("quantifiers-prereg") << "TheoryQuantifiers::preRegisterTerm() " << n << endl; - if (options::cbqi() && !options::recurseCbqi() - && TermUtil::hasInstConstAttr(n)) - { - Debug("quantifiers-prereg") - << "TheoryQuantifiers::preRegisterTerm() done, unused " << n << endl; - return; - } // Preregister the quantified formula. // This initializes the modules used for handling n in this user context. getQuantifiersEngine()->preRegisterQuantifier(n); @@ -135,7 +126,7 @@ void TheoryQuantifiers::check(Effort e) { Trace("quantifiers-assert") << "quantifiers::assert(): " << assertion << std::endl; switch(assertion.getKind()) { case kind::FORALL: - assertUniversal( assertion ); + getQuantifiersEngine()->assertQuantifier(assertion, true); break; case kind::INST_CLOSURE: getQuantifiersEngine()->addTermToDatabase( assertion[0], false, true ); @@ -150,7 +141,7 @@ void TheoryQuantifiers::check(Effort e) { { switch( assertion[0].getKind()) { case kind::FORALL: - assertExistential( assertion ); + getQuantifiersEngine()->assertQuantifier(assertion[0], false); break; case kind::EQUAL: //do nothing @@ -171,20 +162,6 @@ void TheoryQuantifiers::check(Effort e) { getQuantifiersEngine()->check( e ); } -void TheoryQuantifiers::assertUniversal( Node n ){ - Assert( n.getKind()==FORALL ); - if( !options::cbqi() || options::recurseCbqi() || !TermUtil::hasInstConstAttr(n) ){ - getQuantifiersEngine()->assertQuantifier( n, true ); - } -} - -void TheoryQuantifiers::assertExistential( Node n ){ - Assert( n.getKind()== NOT && n[0].getKind()==FORALL ); - if( !options::cbqi() || options::recurseCbqi() || !TermUtil::hasInstConstAttr(n[0]) ){ - getQuantifiersEngine()->assertQuantifier( n[0], false ); - } -} - void TheoryQuantifiers::setUserAttribute(const std::string& attr, Node n, std::vector<Node> node_values, std::string str_value){ QuantAttributes::setUserAttribute( attr, n, node_values, str_value ); } diff --git a/src/theory/quantifiers/theory_quantifiers.h b/src/theory/quantifiers/theory_quantifiers.h index 55047fe2b..b5b07f2e6 100644 --- a/src/theory/quantifiers/theory_quantifiers.h +++ b/src/theory/quantifiers/theory_quantifiers.h @@ -2,9 +2,9 @@ /*! \file theory_quantifiers.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_H -#define __CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_H +#ifndef CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_H +#define CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_H #include "context/cdhashmap.h" #include "context/context.h" @@ -56,17 +56,10 @@ class TheoryQuantifiers : public Theory { std::vector<Node> node_values, std::string str_value) override; - private: - void assertUniversal( Node n ); - void assertExistential( Node n ); - /** number of instantiations */ - int d_numInstantiations; - int d_baseDecLevel; - };/* class TheoryQuantifiers */ }/* CVC4::theory::quantifiers namespace */ }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_H */ diff --git a/src/theory/quantifiers/theory_quantifiers_type_rules.h b/src/theory/quantifiers/theory_quantifiers_type_rules.h index bac3ca58f..ad1c4c69b 100644 --- a/src/theory/quantifiers/theory_quantifiers_type_rules.h +++ b/src/theory/quantifiers/theory_quantifiers_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_TYPE_RULES_H -#define __CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_TYPE_RULES_H +#ifndef CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_TYPE_RULES_H +#define CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_TYPE_RULES_H #include "expr/matcher.h" @@ -229,4 +229,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_TYPE_RULES_H */ +#endif /* CVC4__THEORY__QUANTIFIERS__THEORY_QUANTIFIERS_TYPE_RULES_H */ diff --git a/src/theory/quantifiers_engine.cpp b/src/theory/quantifiers_engine.cpp index 433621d31..f86d82874 100644 --- a/src/theory/quantifiers_engine.cpp +++ b/src/theory/quantifiers_engine.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/quantifiers_engine.h b/src/theory/quantifiers_engine.h index 512f0c651..61e9053f5 100644 --- a/src/theory/quantifiers_engine.h +++ b/src/theory/quantifiers_engine.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Haniel Barbosa ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__QUANTIFIERS_ENGINE_H -#define __CVC4__THEORY__QUANTIFIERS_ENGINE_H +#ifndef CVC4__THEORY__QUANTIFIERS_ENGINE_H +#define CVC4__THEORY__QUANTIFIERS_ENGINE_H #include <iostream> #include <map> @@ -431,4 +431,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__QUANTIFIERS_ENGINE_H */ +#endif /* CVC4__THEORY__QUANTIFIERS_ENGINE_H */ diff --git a/src/theory/rep_set.cpp b/src/theory/rep_set.cpp index dcd90c236..0530e7889 100644 --- a/src/theory/rep_set.cpp +++ b/src/theory/rep_set.cpp @@ -2,9 +2,9 @@ /*! \file rep_set.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/rep_set.h b/src/theory/rep_set.h index d5de1e520..d972a7a84 100644 --- a/src/theory/rep_set.h +++ b/src/theory/rep_set.h @@ -2,9 +2,9 @@ /*! \file rep_set.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Morgan Deters + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__REP_SET_H -#define __CVC4__THEORY__REP_SET_H +#ifndef CVC4__THEORY__REP_SET_H +#define CVC4__THEORY__REP_SET_H #include <map> #include <vector> @@ -313,4 +313,4 @@ class RepBoundExt }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__REP_SET_H */ +#endif /* CVC4__THEORY__REP_SET_H */ diff --git a/src/theory/rewriter.cpp b/src/theory/rewriter.cpp index 58f4832c0..3f9405785 100644 --- a/src/theory/rewriter.cpp +++ b/src/theory/rewriter.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Liana Hadarean, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/rewriter.h b/src/theory/rewriter.h index cc948ae7c..5a15d15fb 100644 --- a/src/theory/rewriter.h +++ b/src/theory/rewriter.h @@ -2,9 +2,9 @@ /*! \file rewriter.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters, Liana Hadarean + ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/rewriter_attributes.h b/src/theory/rewriter_attributes.h index 7fb6dbfaa..93120735e 100644 --- a/src/theory/rewriter_attributes.h +++ b/src/theory/rewriter_attributes.h @@ -2,9 +2,9 @@ /*! \file rewriter_attributes.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters, Tim King + ** Dejan Jovanovic, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/rewriter_tables_template.h b/src/theory/rewriter_tables_template.h index f34972781..531b62a49 100644 --- a/src/theory/rewriter_tables_template.h +++ b/src/theory/rewriter_tables_template.h @@ -2,9 +2,9 @@ /*! \file rewriter_tables_template.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Tim King, Morgan Deters + ** Dejan Jovanovic, Tim King, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sep/theory_sep.cpp b/src/theory/sep/theory_sep.cpp index d1ba65dd8..b787cd94f 100644 --- a/src/theory/sep/theory_sep.cpp +++ b/src/theory/sep/theory_sep.cpp @@ -2,9 +2,9 @@ /*! \file theory_sep.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tim King, Mathias Preiner + ** Andrew Reynolds, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sep/theory_sep.h b/src/theory/sep/theory_sep.h index f8bb58784..ae044f6d7 100644 --- a/src/theory/sep/theory_sep.h +++ b/src/theory/sep/theory_sep.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SEP__THEORY_SEP_H -#define __CVC4__THEORY__SEP__THEORY_SEP_H +#ifndef CVC4__THEORY__SEP__THEORY_SEP_H +#define CVC4__THEORY__SEP__THEORY_SEP_H #include "context/cdhashmap.h" #include "context/cdhashset.h" @@ -331,4 +331,4 @@ class TheorySep : public Theory { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SEP__THEORY_SEP_H */ +#endif /* CVC4__THEORY__SEP__THEORY_SEP_H */ diff --git a/src/theory/sep/theory_sep_rewriter.cpp b/src/theory/sep/theory_sep_rewriter.cpp index 614d4f7c4..92e7db7aa 100644 --- a/src/theory/sep/theory_sep_rewriter.cpp +++ b/src/theory/sep/theory_sep_rewriter.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sep/theory_sep_rewriter.h b/src/theory/sep/theory_sep_rewriter.h index 8ed8c3de2..f4639efa3 100644 --- a/src/theory/sep/theory_sep_rewriter.h +++ b/src/theory/sep/theory_sep_rewriter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SEP__THEORY_SEP_REWRITER_H -#define __CVC4__THEORY__SEP__THEORY_SEP_REWRITER_H +#ifndef CVC4__THEORY__SEP__THEORY_SEP_REWRITER_H +#define CVC4__THEORY__SEP__THEORY_SEP_REWRITER_H #include "theory/rewriter.h" #include "theory/type_enumerator.h" @@ -49,4 +49,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SEP__THEORY_SEP_REWRITER_H */ +#endif /* CVC4__THEORY__SEP__THEORY_SEP_REWRITER_H */ diff --git a/src/theory/sep/theory_sep_type_rules.h b/src/theory/sep/theory_sep_type_rules.h index f5a59c41c..29adeda5a 100644 --- a/src/theory/sep/theory_sep_type_rules.h +++ b/src/theory/sep/theory_sep_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SEP__THEORY_SEP_TYPE_RULES_H -#define __CVC4__THEORY__SEP__THEORY_SEP_TYPE_RULES_H +#ifndef CVC4__THEORY__SEP__THEORY_SEP_TYPE_RULES_H +#define CVC4__THEORY__SEP__THEORY_SEP_TYPE_RULES_H namespace CVC4 { namespace theory { @@ -112,4 +112,4 @@ struct SepNilTypeRule { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SEP__THEORY_SEP_TYPE_RULES_H */ +#endif /* CVC4__THEORY__SEP__THEORY_SEP_TYPE_RULES_H */ diff --git a/src/theory/sets/normal_form.h b/src/theory/sets/normal_form.h index 16a32d989..d7c68a574 100644 --- a/src/theory/sets/normal_form.h +++ b/src/theory/sets/normal_form.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SETS__NORMAL_FORM_H -#define __CVC4__THEORY__SETS__NORMAL_FORM_H +#ifndef CVC4__THEORY__SETS__NORMAL_FORM_H +#define CVC4__THEORY__SETS__NORMAL_FORM_H namespace CVC4 { namespace theory { diff --git a/src/theory/sets/rels_utils.h b/src/theory/sets/rels_utils.h index 39175bf0f..1bbbb359b 100644 --- a/src/theory/sets/rels_utils.h +++ b/src/theory/sets/rels_utils.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sets/theory_sets.cpp b/src/theory/sets/theory_sets.cpp index 188523a10..563a981b1 100644 --- a/src/theory/sets/theory_sets.cpp +++ b/src/theory/sets/theory_sets.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sets/theory_sets.h b/src/theory/sets/theory_sets.h index e679d33c3..414ba4b28 100644 --- a/src/theory/sets/theory_sets.h +++ b/src/theory/sets/theory_sets.h @@ -2,9 +2,9 @@ /*! \file theory_sets.h ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Tim King, Andrew Reynolds + ** Tim King, Kshitij Bansal, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SETS__THEORY_SETS_H -#define __CVC4__THEORY__SETS__THEORY_SETS_H +#ifndef CVC4__THEORY__SETS__THEORY_SETS_H +#define CVC4__THEORY__SETS__THEORY_SETS_H #include <memory> @@ -71,4 +71,4 @@ class TheorySets : public Theory }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SETS__THEORY_SETS_H */ +#endif /* CVC4__THEORY__SETS__THEORY_SETS_H */ diff --git a/src/theory/sets/theory_sets_private.cpp b/src/theory/sets/theory_sets_private.cpp index 1c302573e..a62a235c3 100644 --- a/src/theory/sets/theory_sets_private.cpp +++ b/src/theory/sets/theory_sets_private.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Kshitij Bansal, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -700,9 +700,11 @@ void TheorySetsPrivate::fullEffortCheck(){ checkUpwardsClosure( lemmas ); flushLemmas( lemmas ); if( !hasProcessed() ){ - std::vector< Node > intro_sets; - //for cardinality - if( d_card_enabled ){ + checkDisequalities(lemmas); + flushLemmas(lemmas); + if (!hasProcessed() && d_card_enabled) + { + // for cardinality checkCardBuildGraph( lemmas ); flushLemmas( lemmas ); if( !hasProcessed() ){ @@ -712,28 +714,24 @@ void TheorySetsPrivate::fullEffortCheck(){ checkCardCycles( lemmas ); flushLemmas( lemmas ); if( !hasProcessed() ){ + std::vector<Node> intro_sets; checkNormalForms( lemmas, intro_sets ); flushLemmas( lemmas ); + if (!hasProcessed() && !intro_sets.empty()) + { + Assert(intro_sets.size() == 1); + Trace("sets-intro") + << "Introduce term : " << intro_sets[0] << std::endl; + Trace("sets-intro") << " Actual Intro : "; + debugPrintSet(intro_sets[0], "sets-nf"); + Trace("sets-nf") << std::endl; + Node k = getProxy(intro_sets[0]); + d_sentLemma = true; + } } } } } - if( !hasProcessed() ){ - checkDisequalities( lemmas ); - flushLemmas( lemmas ); - if( !hasProcessed() ){ - //introduce splitting on venn regions (absolute last resort) - if( d_card_enabled && !hasProcessed() && !intro_sets.empty() ){ - Assert( intro_sets.size()==1 ); - Trace("sets-intro") << "Introduce term : " << intro_sets[0] << std::endl; - Trace("sets-intro") << " Actual Intro : "; - debugPrintSet( intro_sets[0], "sets-nf" ); - Trace("sets-nf") << std::endl; - Node k = getProxy( intro_sets[0] ); - d_sentLemma = true; - } - } - } } } } @@ -1380,8 +1378,8 @@ void TheorySetsPrivate::checkNormalForm( Node eqc, std::vector< Node >& intro_se Assert( d_nf.find( eqc )==d_nf.end() ); bool success = true; + Node emp_set = getEmptySet(tn); if( !base.isNull() ){ - Node emp_set = getEmptySet( tn ); for( unsigned j=0; j<comps.size(); j++ ){ //compare if equal std::vector< Node > c; @@ -1491,12 +1489,24 @@ void TheorySetsPrivate::checkNormalForm( Node eqc, std::vector< Node >& intro_se Trace("sets-nf") << "----> N " << eqc << " => F " << base << std::endl; }else{ Trace("sets-nf") << "failed to build N " << eqc << std::endl; - Assert( false ); } }else{ - //normal form is this equivalence class - d_nf[eqc].push_back( eqc ); - Trace("sets-nf") << "----> N " << eqc << " => { " << eqc << " }" << std::endl; + // must ensure disequal from empty + if (!eqc.isConst() && !ee_areDisequal(eqc, emp_set) + && (d_pol_mems[0].find(eqc) == d_pol_mems[0].end() + || d_pol_mems[0][eqc].empty())) + { + Trace("sets-nf-debug") << "Split on leaf " << eqc << std::endl; + split(eqc.eqNode(emp_set)); + success = false; + } + else + { + // normal form is this equivalence class + d_nf[eqc].push_back(eqc); + Trace("sets-nf") << "----> N " << eqc << " => { " << eqc << " }" + << std::endl; + } } if( success ){ //send to parents diff --git a/src/theory/sets/theory_sets_private.h b/src/theory/sets/theory_sets_private.h index 447ac33a1..3014b2f2a 100644 --- a/src/theory/sets/theory_sets_private.h +++ b/src/theory/sets/theory_sets_private.h @@ -2,9 +2,9 @@ /*! \file theory_sets_private.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Kshitij Bansal, Mathias Preiner + ** Andrew Reynolds, Kshitij Bansal, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SETS__THEORY_SETS_PRIVATE_H -#define __CVC4__THEORY__SETS__THEORY_SETS_PRIVATE_H +#ifndef CVC4__THEORY__SETS__THEORY_SETS_PRIVATE_H +#define CVC4__THEORY__SETS__THEORY_SETS_PRIVATE_H #include "context/cdhashset.h" #include "context/cdqueue.h" @@ -334,4 +334,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SETS__THEORY_SETS_PRIVATE_H */ +#endif /* CVC4__THEORY__SETS__THEORY_SETS_PRIVATE_H */ diff --git a/src/theory/sets/theory_sets_rels.cpp b/src/theory/sets/theory_sets_rels.cpp index ebfa6f8bb..74d0e5bd8 100644 --- a/src/theory/sets/theory_sets_rels.cpp +++ b/src/theory/sets/theory_sets_rels.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Paul Meng, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sets/theory_sets_rels.h b/src/theory/sets/theory_sets_rels.h index 161b5195e..7cad0f18d 100644 --- a/src/theory/sets/theory_sets_rels.h +++ b/src/theory/sets/theory_sets_rels.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Paul Meng, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sets/theory_sets_rewriter.cpp b/src/theory/sets/theory_sets_rewriter.cpp index 2a2015319..15cec0856 100644 --- a/src/theory/sets/theory_sets_rewriter.cpp +++ b/src/theory/sets/theory_sets_rewriter.cpp @@ -2,9 +2,9 @@ /*! \file theory_sets_rewriter.cpp ** \verbatim ** Top contributors (to current version): - ** Kshitij Bansal, Andrew Reynolds, Paul Meng + ** Andrew Reynolds, Kshitij Bansal, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sets/theory_sets_rewriter.h b/src/theory/sets/theory_sets_rewriter.h index c506f19a5..463d02d6d 100644 --- a/src/theory/sets/theory_sets_rewriter.h +++ b/src/theory/sets/theory_sets_rewriter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SETS__THEORY_SETS_REWRITER_H -#define __CVC4__THEORY__SETS__THEORY_SETS_REWRITER_H +#ifndef CVC4__THEORY__SETS__THEORY_SETS_REWRITER_H +#define CVC4__THEORY__SETS__THEORY_SETS_REWRITER_H #include "theory/rewriter.h" @@ -89,4 +89,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SETS__THEORY_SETS_REWRITER_H */ +#endif /* CVC4__THEORY__SETS__THEORY_SETS_REWRITER_H */ diff --git a/src/theory/sets/theory_sets_type_enumerator.h b/src/theory/sets/theory_sets_type_enumerator.h index 65a614f9a..5a6745367 100644 --- a/src/theory/sets/theory_sets_type_enumerator.h +++ b/src/theory/sets/theory_sets_type_enumerator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Tim King, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SETS__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__SETS__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__SETS__TYPE_ENUMERATOR_H +#define CVC4__THEORY__SETS__TYPE_ENUMERATOR_H #include "theory/type_enumerator.h" #include "expr/type_node.h" @@ -183,4 +183,4 @@ class SetEnumerator : public TypeEnumeratorBase<SetEnumerator> { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SETS__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__SETS__TYPE_ENUMERATOR_H */ diff --git a/src/theory/sets/theory_sets_type_rules.h b/src/theory/sets/theory_sets_type_rules.h index 8cbb62883..7e6038423 100644 --- a/src/theory/sets/theory_sets_type_rules.h +++ b/src/theory/sets/theory_sets_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Kshitij Bansal, Andrew Reynolds, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SETS__THEORY_SETS_TYPE_RULES_H -#define __CVC4__THEORY__SETS__THEORY_SETS_TYPE_RULES_H +#ifndef CVC4__THEORY__SETS__THEORY_SETS_TYPE_RULES_H +#define CVC4__THEORY__SETS__THEORY_SETS_TYPE_RULES_H #include "theory/sets/normal_form.h" @@ -428,4 +428,4 @@ struct SetsProperties { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SETS__THEORY_SETS_TYPE_RULES_H */ +#endif /* CVC4__THEORY__SETS__THEORY_SETS_TYPE_RULES_H */ diff --git a/src/theory/shared_terms_database.cpp b/src/theory/shared_terms_database.cpp index ca10314e8..a13ac207a 100644 --- a/src/theory/shared_terms_database.cpp +++ b/src/theory/shared_terms_database.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/shared_terms_database.h b/src/theory/shared_terms_database.h index 5389c021f..0c73195c5 100644 --- a/src/theory/shared_terms_database.h +++ b/src/theory/shared_terms_database.h @@ -2,9 +2,9 @@ /*! \file shared_terms_database.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters, Mathias Preiner + ** Dejan Jovanovic, Mathias Preiner, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sort_inference.cpp b/src/theory/sort_inference.cpp index 74f2e4803..6c141cf2a 100644 --- a/src/theory/sort_inference.cpp +++ b/src/theory/sort_inference.cpp @@ -2,9 +2,9 @@ /*! \file sort_inference.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Paul Meng, Tim King + ** Andrew Reynolds, Paul Meng, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/sort_inference.h b/src/theory/sort_inference.h index b93d5531c..5b28f669d 100644 --- a/src/theory/sort_inference.h +++ b/src/theory/sort_inference.h @@ -2,9 +2,9 @@ /*! \file sort_inference.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Paul Meng, Tim King + ** Andrew Reynolds, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__SORT_INFERENCE_H -#define __CVC4__SORT_INFERENCE_H +#ifndef CVC4__SORT_INFERENCE_H +#define CVC4__SORT_INFERENCE_H #include <iostream> #include <string> diff --git a/src/theory/strings/normal_form.cpp b/src/theory/strings/normal_form.cpp new file mode 100644 index 000000000..c70845d64 --- /dev/null +++ b/src/theory/strings/normal_form.cpp @@ -0,0 +1,163 @@ +/********************* */ +/*! \file normal_form.cpp + ** \verbatim + ** Top contributors (to current version): + ** Andrew Reynolds + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Implementation of normal form data structure for the theory of + ** strings. + **/ + +#include "theory/strings/normal_form.h" + +#include "options/strings_options.h" +#include "theory/rewriter.h" + +using namespace std; +using namespace CVC4::kind; + +namespace CVC4 { +namespace theory { +namespace strings { + +void NormalForm::init(Node base) +{ + Assert(base.getType().isString()); + Assert(base.getKind() != STRING_CONCAT); + d_base = base; + d_nf.clear(); + d_isRev = false; + d_exp.clear(); + d_expDep.clear(); + + // add to normal form + if (!base.isConst() || !base.getConst<String>().isEmptyString()) + { + d_nf.push_back(base); + } +} + +void NormalForm::reverse() +{ + std::reverse(d_nf.begin(), d_nf.end()); + d_isRev = !d_isRev; +} + +void NormalForm::splitConstant(unsigned index, Node c1, Node c2) +{ + Assert(Rewriter::rewrite(NodeManager::currentNM()->mkNode( + STRING_CONCAT, d_isRev ? c2 : c1, d_isRev ? c1 : c2)) + == d_nf[index]); + d_nf.insert(d_nf.begin() + index + 1, c2); + d_nf[index] = c1; + // update the dependency indices + // notice this is not critical for soundness: not doing the below incrementing + // will only lead to overapproximating when antecedants are required in + // explanations + for (const std::pair<Node, std::map<bool, unsigned> >& pe : d_expDep) + { + for (const std::pair<bool, unsigned>& pep : pe.second) + { + // See if this can be incremented: it can if this literal is not relevant + // to the current index, and hence it is not relevant for both c1 and c2. + Assert(pep.second >= 0 && pep.second <= d_nf.size()); + bool increment = (pep.first == d_isRev) + ? pep.second > index + : (d_nf.size() - 1 - pep.second) < index; + if (increment) + { + d_expDep[pe.first][pep.first] = pep.second + 1; + } + } + } +} + +void NormalForm::addToExplanation(Node exp, + unsigned new_val, + unsigned new_rev_val) +{ + if (std::find(d_exp.begin(), d_exp.end(), exp) == d_exp.end()) + { + d_exp.push_back(exp); + } + for (unsigned k = 0; k < 2; k++) + { + unsigned val = k == 0 ? new_val : new_rev_val; + std::map<bool, unsigned>::iterator itned = d_expDep[exp].find(k == 1); + if (itned == d_expDep[exp].end()) + { + Trace("strings-process-debug") + << "Deps : set dependency on " << exp << " to " << val + << " isRev=" << (k == 0) << std::endl; + d_expDep[exp][k == 1] = val; + } + else + { + Trace("strings-process-debug") + << "Deps : Multiple dependencies on " << exp << " : " << itned->second + << " " << val << " isRev=" << (k == 0) << std::endl; + // if we already have a dependency (in the case of non-linear string + // equalities), it is min/max + bool cmp = val > itned->second; + if (cmp == (k == 1)) + { + d_expDep[exp][k == 1] = val; + } + } + } +} + +void NormalForm::getExplanation(int index, std::vector<Node>& curr_exp) +{ + if (index == -1 || !options::stringMinPrefixExplain()) + { + curr_exp.insert(curr_exp.end(), d_exp.begin(), d_exp.end()); + return; + } + for (const Node& exp : d_exp) + { + int dep = static_cast<int>(d_expDep[exp][d_isRev]); + if (dep <= index) + { + curr_exp.push_back(exp); + Trace("strings-explain-prefix-debug") << " include : "; + } + else + { + Trace("strings-explain-prefix-debug") << " exclude : "; + } + Trace("strings-explain-prefix-debug") << exp << std::endl; + } +} + +void NormalForm::getExplanationForPrefixEq(NormalForm& nfi, + NormalForm& nfj, + int index_i, + int index_j, + std::vector<Node>& curr_exp) +{ + Assert(nfi.d_isRev == nfj.d_isRev); + Trace("strings-explain-prefix") + << "Get explanation for prefix " << index_i << ", " << index_j + << ", reverse = " << nfi.d_isRev << std::endl; + // get explanations + nfi.getExplanation(index_i, curr_exp); + nfj.getExplanation(index_j, curr_exp); + Trace("strings-explain-prefix") + << "Included " << curr_exp.size() << " / " + << (nfi.d_exp.size() + nfj.d_exp.size()) << std::endl; + if (nfi.d_base != nfj.d_base) + { + Node eq = nfi.d_base.eqNode(nfj.d_base); + curr_exp.push_back(eq); + } +} + +} // namespace strings +} // namespace theory +} // namespace CVC4 diff --git a/src/theory/strings/normal_form.h b/src/theory/strings/normal_form.h new file mode 100644 index 000000000..3d1326570 --- /dev/null +++ b/src/theory/strings/normal_form.h @@ -0,0 +1,159 @@ +/********************* */ +/*! \file normal_form.h + ** \verbatim + ** Top contributors (to current version): + ** Andrew Reynolds + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Normal form datastructure for the theory of strings. + **/ + +#include "cvc4_private.h" + +#ifndef CVC4__THEORY__STRINGS__NORMAL_FORM_H +#define CVC4__THEORY__STRINGS__NORMAL_FORM_H + +#include <map> +#include <vector> +#include "expr/node.h" + +namespace CVC4 { +namespace theory { +namespace strings { + +/** normal forms + * + * Stores information regarding the "normal form" of terms t in the current + * context. Normal forms can be associated with terms, or with string + * equivalence classes. For the latter, the normal form of an equivalence class + * exists if exactly one unique normal form is associated to a subset of its + * terms. + * + * In the following we use example where assertions are: + * { x = y, y = z, y = u ++ v, u = u1 ++ u2 } + * and equivalence class [x] = { x, y, z, u ++ v }, whose normal form is + * (u1, u2, v) + */ +class NormalForm +{ + public: + NormalForm() : d_isRev(false) {} + /** + * The "base" of the normal form. This is some term in the equivalence + * class of t that the normal form is based on. This is an arbitrary term + * which is used as the reference point for explanations. In the above + * running example, let us assume the base of [x] is y. + */ + Node d_base; + /** the normal form, (u1, u2, v), in the above example */ + std::vector<Node> d_nf; + /** is the normal form d_nf stored in reverse order? */ + bool d_isRev; + /** + * The explanation for the normal form, this is a set of literals such that + * d_exp => d_base = d_nf + * In the above example, this is the set of equalities + * { y = u ++ v, u = u1 ++ u2 } + * If u ++ v was chosen as the base, then the first literal could be omitted. + */ + std::vector<Node> d_exp; + /** + * Map from literals in the vector d_exp to integers indicating indices in + * d_nf for which that literal L is relevant for explaining d_base = d_nf. + * + * In particular: + * - false maps to an (ideally maximal) index relative to the start of d_nf + * such that L is required for explaining why d_base has a prefix that + * includes the term at that index, + * - true maps to an (ideally maximal) index relative to the end of d_nf + * such that L is required for explaining why d_base has a suffix that + * includes the term at that index. + * We call these the forward and backwards dependency indices. + * + * In the above example: + * y = u ++ v : false -> 0, true -> 0 + * u = u1 ++ u2 : false -> 0, true -> 1 + * When explaining y = u1 ++ u2 ++ v, the equality y = u ++ v is required + * for explaining any prefix/suffix of y and its normal form. More + * interestingly, the equality u = u1 ++ u2 is not required for explaining + * that v is a suffix of y, since its reverse index in this map is 1, + * indicating that "u2" is the first position in u1 ++ u2 ++ v that it is + * required for explaining. + * + * This information is used to minimize explanations when conflicts arise, + * thereby strengthening conflict clauses and lemmas. + * + * For example, say u ++ v = y = x = u ++ w and w and v are distinct + * constants, using this dependency information, we could construct a + * conflict: + * x = y ^ y = u ++ v ^ x = u ++ w + * that does not include u = u1 ++ u2, because the conflict only pertains + * to the last position in the normal form of y. + */ + std::map<Node, std::map<bool, unsigned> > d_expDep; + /** initialize + * + * Initialize the normal form with base node base. If base is not the empty + * string, then d_nf is set to the singleton list containing base, otherwise + * d_nf is empty. + */ + void init(Node base); + /** reverse the content of normal form d_nf + * + * This operation is done in contexts where the normal form is being scanned + * in reverse order. + */ + void reverse(); + /** split constant + * + * Splits the constant in d_nf at index to constants c1 and c2. + * + * Notice this function depends on whether the normal form has been reversed + * d_isRev, as this impacts how the dependency indices are updated. + */ + void splitConstant(unsigned index, Node c1, Node c2); + /** add to explanation + * + * This adds exp to the explanation vector d_exp with new forward and + * backwards dependency indices new_val and new_rev_val. + * + * If exp already has dependencies, we update the forward dependency + * index to the minimum of the previous value and the new value, and + * similarly update the backwards dependency index to the maximum. + */ + void addToExplanation(Node exp, unsigned new_val, unsigned new_rev_val); + /** get explanation + * + * This gets the explanation for the prefix (resp. suffix) of the normal + * form up to index when d_isRev is false (resp. true). In particular; + * + * If index is -1, then this method adds all literals in d_exp to curr_exp. + * + * If index>=0, this method adds all literals in d_exp to curr_exp whose + * forward (resp. backwards) dependency index is less than index + * when isRev is false (resp. true). + */ + void getExplanation(int index, std::vector<Node>& curr_exp); + /** get explanation for prefix equality + * + * This adds to curr_exp the reason why the prefix of nfi up to index index_i + * is equivalent to the prefix of nfj up to index_j. The values of + * nfi.d_isRev and nfj.d_isRev affect how dependency indices are updated + * during this call. + */ + static void getExplanationForPrefixEq(NormalForm& nfi, + NormalForm& nfj, + int index_i, + int index_j, + std::vector<Node>& curr_exp); +}; + +} // namespace strings +} // namespace theory +} // namespace CVC4 + +#endif /* CVC4__THEORY__STRINGS__NORMAL_FORM_H */ diff --git a/src/theory/strings/regexp_elim.cpp b/src/theory/strings/regexp_elim.cpp index 749816280..b6a997629 100644 --- a/src/theory/strings/regexp_elim.cpp +++ b/src/theory/strings/regexp_elim.cpp @@ -2,9 +2,9 @@ /*! \file regexp_elim.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Tianyi Liang ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -347,10 +347,10 @@ Node RegExpElimination::eliminateConcat(Node atom) for (unsigned r = 0; r < 2; r++) { unsigned index = r == 0 ? 0 : nchildren - 1; - Assert(children[index + (r == 0 ? 1 : -1)].getKind() != STRING_TO_REGEXP); Node c = children[index]; if (c.getKind() == STRING_TO_REGEXP) { + Assert(children[index + (r == 0 ? 1 : -1)].getKind() != STRING_TO_REGEXP); Node s = c[0]; Node lens = nm->mkNode(STRING_LENGTH, s); Node sss = r == 0 ? d_zero : nm->mkNode(MINUS, lenx, lens); @@ -375,9 +375,9 @@ Node RegExpElimination::eliminateConcat(Node atom) rexpElimChildren.push_back(c); } } - Assert(rexpElimChildren.size() + sConstraints.size() == nchildren); if (!sConstraints.empty()) { + Assert(rexpElimChildren.size() + sConstraints.size() == nchildren); Node ss = nm->mkNode(STRING_SUBSTR, x, sStartIndex, sLength); Assert(!rexpElimChildren.empty()); Node regElim = @@ -412,7 +412,7 @@ Node RegExpElimination::eliminateConcat(Node atom) Node bound = nm->mkNode(AND, nm->mkNode(LEQ, d_zero, k), - nm->mkNode(LT, k, nm->mkNode(MINUS, lenx, lens))); + nm->mkNode(LEQ, k, nm->mkNode(MINUS, lenx, lens))); echildren.push_back(bound); } Node substrEq = nm->mkNode(STRING_SUBSTR, x, k, lens).eqNode(s); diff --git a/src/theory/strings/regexp_elim.h b/src/theory/strings/regexp_elim.h index eddf33e71..dbd4102b6 100644 --- a/src/theory/strings/regexp_elim.h +++ b/src/theory/strings/regexp_elim.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ **/ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__STRINGS__REGEXP_ELIM_H -#define __CVC4__THEORY__STRINGS__REGEXP_ELIM_H +#ifndef CVC4__THEORY__STRINGS__REGEXP_ELIM_H +#define CVC4__THEORY__STRINGS__REGEXP_ELIM_H #include "expr/node.h" @@ -63,4 +63,4 @@ class RegExpElimination } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__STRINGS__REGEXP_ELIM_H */ +#endif /* CVC4__THEORY__STRINGS__REGEXP_ELIM_H */ diff --git a/src/theory/strings/regexp_operation.cpp b/src/theory/strings/regexp_operation.cpp index f53f82cc4..91beb1ab5 100644 --- a/src/theory/strings/regexp_operation.cpp +++ b/src/theory/strings/regexp_operation.cpp @@ -2,9 +2,9 @@ /*! \file regexp_operation.cpp ** \verbatim ** Top contributors (to current version): - ** Tianyi Liang, Tim King, Andrew Reynolds + ** Tianyi Liang, Andrew Reynolds, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/strings/regexp_operation.h b/src/theory/strings/regexp_operation.h index 57e68abfb..b2e3667fc 100644 --- a/src/theory/strings/regexp_operation.h +++ b/src/theory/strings/regexp_operation.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tianyi Liang, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__STRINGS__REGEXP__OPERATION_H -#define __CVC4__THEORY__STRINGS__REGEXP__OPERATION_H +#ifndef CVC4__THEORY__STRINGS__REGEXP__OPERATION_H +#define CVC4__THEORY__STRINGS__REGEXP__OPERATION_H #include <vector> #include <set> @@ -100,4 +100,4 @@ class RegExpOpr { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__STRINGS__REGEXP__OPERATION_H */ +#endif /* CVC4__THEORY__STRINGS__REGEXP__OPERATION_H */ diff --git a/src/theory/strings/regexp_solver.cpp b/src/theory/strings/regexp_solver.cpp new file mode 100644 index 000000000..f0e68890a --- /dev/null +++ b/src/theory/strings/regexp_solver.cpp @@ -0,0 +1,547 @@ +/********************* */ +/*! \file regexp_solver.cpp + ** \verbatim + ** Top contributors (to current version): + ** Andrew Reynolds, Tianyi Liang, Morgan Deters + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Implementation of the regular expression solver for the theory of + ** strings. + ** + **/ + +#include "theory/strings/regexp_solver.h" + +#include <cmath> + +#include "options/strings_options.h" +#include "theory/strings/theory_strings.h" +#include "theory/strings/theory_strings_rewriter.h" +#include "theory/theory_model.h" + +using namespace std; +using namespace CVC4::context; +using namespace CVC4::kind; + +namespace CVC4 { +namespace theory { +namespace strings { + +RegExpSolver::RegExpSolver(TheoryStrings& p, + context::Context* c, + context::UserContext* u) + : d_parent(p), + d_regexp_memberships(c), + d_regexp_ucached(u), + d_regexp_ccached(c), + d_pos_memberships(c), + d_neg_memberships(c), + d_inter_cache(c), + d_inter_index(c), + d_processed_memberships(c) +{ + d_emptyString = NodeManager::currentNM()->mkConst(::CVC4::String("")); + std::vector<Node> nvec; + d_emptyRegexp = NodeManager::currentNM()->mkNode(REGEXP_EMPTY, nvec); + d_true = NodeManager::currentNM()->mkConst(true); + d_false = NodeManager::currentNM()->mkConst(false); +} + +unsigned RegExpSolver::getNumMemberships(Node n, bool isPos) +{ + if (isPos) + { + NodeUIntMap::const_iterator it = d_pos_memberships.find(n); + if (it != d_pos_memberships.end()) + { + return (*it).second; + } + } + else + { + NodeUIntMap::const_iterator it = d_neg_memberships.find(n); + if (it != d_neg_memberships.end()) + { + return (*it).second; + } + } + return 0; +} + +Node RegExpSolver::getMembership(Node n, bool isPos, unsigned i) +{ + return isPos ? d_pos_memberships_data[n][i] : d_neg_memberships_data[n][i]; +} + +Node RegExpSolver::mkAnd(Node c1, Node c2) +{ + return NodeManager::currentNM()->mkNode(AND, c1, c2); +} + +void RegExpSolver::check() +{ + bool addedLemma = false; + bool changed = false; + std::vector<Node> processed; + std::vector<Node> cprocessed; + + Trace("regexp-debug") << "Checking Memberships ... " << std::endl; + for (NodeUIntMap::const_iterator itr_xr = d_pos_memberships.begin(); + itr_xr != d_pos_memberships.end(); + ++itr_xr) + { + bool spflag = false; + Node x = (*itr_xr).first; + Trace("regexp-debug") << "Checking Memberships for " << x << std::endl; + if (d_inter_index.find(x) == d_inter_index.end()) + { + d_inter_index[x] = 0; + } + int cur_inter_idx = d_inter_index[x]; + unsigned n_pmem = (*itr_xr).second; + Assert(getNumMemberships(x, true) == n_pmem); + if (cur_inter_idx != (int)n_pmem) + { + if (n_pmem == 1) + { + d_inter_cache[x] = getMembership(x, true, 0); + d_inter_index[x] = 1; + Trace("regexp-debug") << "... only one choice " << std::endl; + } + else if (n_pmem > 1) + { + Node r; + if (d_inter_cache.find(x) != d_inter_cache.end()) + { + r = d_inter_cache[x]; + } + if (r.isNull()) + { + r = getMembership(x, true, 0); + cur_inter_idx = 1; + } + + unsigned k_start = cur_inter_idx; + Trace("regexp-debug") << "... staring from : " << cur_inter_idx + << ", we have " << n_pmem << std::endl; + for (unsigned k = k_start; k < n_pmem; k++) + { + Node r2 = getMembership(x, true, k); + r = d_regexp_opr.intersect(r, r2, spflag); + if (spflag) + { + break; + } + else if (r == d_emptyRegexp) + { + std::vector<Node> vec_nodes; + for (unsigned kk = 0; kk <= k; kk++) + { + Node rr = getMembership(x, true, kk); + Node n = + NodeManager::currentNM()->mkNode(STRING_IN_REGEXP, x, rr); + vec_nodes.push_back(n); + } + Node conc; + d_parent.sendInference(vec_nodes, conc, "INTERSECT CONFLICT", true); + addedLemma = true; + break; + } + if (d_parent.inConflict()) + { + break; + } + } + // updates + if (!d_parent.inConflict() && !spflag) + { + d_inter_cache[x] = r; + d_inter_index[x] = (int)n_pmem; + } + } + } + } + + Trace("regexp-debug") + << "... No Intersect Conflict in Memberships, addedLemma: " << addedLemma + << std::endl; + if (!addedLemma) + { + NodeManager* nm = NodeManager::currentNM(); + for (unsigned i = 0; i < d_regexp_memberships.size(); i++) + { + // check regular expression membership + Node assertion = d_regexp_memberships[i]; + Trace("regexp-debug") + << "Check : " << assertion << " " + << (d_regexp_ucached.find(assertion) == d_regexp_ucached.end()) << " " + << (d_regexp_ccached.find(assertion) == d_regexp_ccached.end()) + << std::endl; + if (d_regexp_ucached.find(assertion) == d_regexp_ucached.end() + && d_regexp_ccached.find(assertion) == d_regexp_ccached.end()) + { + Trace("strings-regexp") + << "We have regular expression assertion : " << assertion + << std::endl; + Node atom = assertion.getKind() == NOT ? assertion[0] : assertion; + bool polarity = assertion.getKind() != NOT; + bool flag = true; + Node x = atom[0]; + Node r = atom[1]; + std::vector<Node> rnfexp; + + if (!x.isConst()) + { + x = d_parent.getNormalString(x, rnfexp); + changed = true; + } + if (!d_regexp_opr.checkConstRegExp(r)) + { + r = getNormalSymRegExp(r, rnfexp); + changed = true; + } + Trace("strings-regexp-nf") << "Term " << atom << " is normalized to " + << x << " IN " << r << std::endl; + if (changed) + { + Node tmp = Rewriter::rewrite(nm->mkNode(STRING_IN_REGEXP, x, r)); + if (!polarity) + { + tmp = tmp.negate(); + } + if (tmp == d_true) + { + d_regexp_ccached.insert(assertion); + continue; + } + else if (tmp == d_false) + { + std::vector<Node> exp_n; + exp_n.push_back(assertion); + Node conc = Node::null(); + d_parent.sendInference(rnfexp, exp_n, conc, "REGEXP NF Conflict"); + addedLemma = true; + break; + } + } + + if (polarity) + { + flag = checkPDerivative(x, r, atom, addedLemma, rnfexp); + } + else + { + if (!options::stringExp()) + { + throw LogicException( + "Strings Incomplete (due to Negative Membership) by default, " + "try --strings-exp option."); + } + } + if (flag) + { + // check if the term is atomic + Node xr = d_parent.getRepresentative(x); + Trace("strings-regexp") + << "Unroll/simplify membership of atomic term " << xr + << std::endl; + // if so, do simple unrolling + std::vector<Node> nvec; + if (nvec.empty()) + { + d_regexp_opr.simplify(atom, nvec, polarity); + } + std::vector<Node> exp_n; + exp_n.push_back(assertion); + Node conc = nvec.size() == 1 ? nvec[0] : nm->mkNode(AND, nvec); + conc = Rewriter::rewrite(conc); + d_parent.sendInference(rnfexp, exp_n, conc, "REGEXP_Unfold"); + addedLemma = true; + if (changed) + { + cprocessed.push_back(assertion); + } + else + { + processed.push_back(assertion); + } + } + } + if (d_parent.inConflict()) + { + break; + } + } + } + if (addedLemma) + { + if (!d_parent.inConflict()) + { + for (unsigned i = 0; i < processed.size(); i++) + { + Trace("strings-regexp") + << "...add " << processed[i] << " to u-cache." << std::endl; + d_regexp_ucached.insert(processed[i]); + } + for (unsigned i = 0; i < cprocessed.size(); i++) + { + Trace("strings-regexp") + << "...add " << cprocessed[i] << " to c-cache." << std::endl; + d_regexp_ccached.insert(cprocessed[i]); + } + } + } +} + +bool RegExpSolver::checkPDerivative( + Node x, Node r, Node atom, bool& addedLemma, std::vector<Node>& nf_exp) +{ + if (d_parent.areEqual(x, d_emptyString)) + { + Node exp; + switch (d_regexp_opr.delta(r, exp)) + { + case 0: + { + std::vector<Node> exp_n; + exp_n.push_back(atom); + exp_n.push_back(x.eqNode(d_emptyString)); + d_parent.sendInference(nf_exp, exp_n, exp, "RegExp Delta"); + addedLemma = true; + d_regexp_ccached.insert(atom); + return false; + } + case 1: + { + d_regexp_ccached.insert(atom); + break; + } + case 2: + { + std::vector<Node> exp_n; + exp_n.push_back(atom); + exp_n.push_back(x.eqNode(d_emptyString)); + Node conc; + d_parent.sendInference(nf_exp, exp_n, conc, "RegExp Delta CONFLICT"); + addedLemma = true; + d_regexp_ccached.insert(atom); + return false; + } + default: + // Impossible + break; + } + } + else + { + if (deriveRegExp(x, r, atom, nf_exp)) + { + addedLemma = true; + d_regexp_ccached.insert(atom); + return false; + } + } + return true; +} + +CVC4::String RegExpSolver::getHeadConst(Node x) +{ + if (x.isConst()) + { + return x.getConst<String>(); + } + else if (x.getKind() == STRING_CONCAT) + { + if (x[0].isConst()) + { + return x[0].getConst<String>(); + } + } + return d_emptyString.getConst<String>(); +} + +bool RegExpSolver::deriveRegExp(Node x, + Node r, + Node atom, + std::vector<Node>& ant) +{ + Assert(x != d_emptyString); + Trace("regexp-derive") << "RegExpSolver::deriveRegExp: x=" << x + << ", r= " << r << std::endl; + CVC4::String s = getHeadConst(x); + if (!s.isEmptyString() && d_regexp_opr.checkConstRegExp(r)) + { + Node conc = Node::null(); + Node dc = r; + bool flag = true; + for (unsigned i = 0; i < s.size(); ++i) + { + CVC4::String c = s.substr(i, 1); + Node dc2; + int rt = d_regexp_opr.derivativeS(dc, c, dc2); + dc = dc2; + if (rt == 2) + { + // CONFLICT + flag = false; + break; + } + } + // send lemma + if (flag) + { + if (x.isConst()) + { + Assert(false, + "Impossible: RegExpSolver::deriveRegExp: const string in const " + "regular expression."); + return false; + } + else + { + Assert(x.getKind() == STRING_CONCAT); + std::vector<Node> vec_nodes; + for (unsigned int i = 1; i < x.getNumChildren(); ++i) + { + vec_nodes.push_back(x[i]); + } + Node left = TheoryStringsRewriter::mkConcat(STRING_CONCAT, vec_nodes); + left = Rewriter::rewrite(left); + conc = NodeManager::currentNM()->mkNode(STRING_IN_REGEXP, left, dc); + } + } + std::vector<Node> exp_n; + exp_n.push_back(atom); + d_parent.sendInference(ant, exp_n, conc, "RegExp-Derive"); + return true; + } + return false; +} + +void RegExpSolver::addMembership(Node assertion) +{ + bool polarity = assertion.getKind() != NOT; + TNode atom = polarity ? assertion : assertion[0]; + Node x = atom[0]; + Node r = atom[1]; + if (polarity) + { + unsigned index = 0; + NodeUIntMap::const_iterator it = d_pos_memberships.find(x); + if (it != d_pos_memberships.end()) + { + index = (*it).second; + for (unsigned k = 0; k < index; k++) + { + if (k < d_pos_memberships_data[x].size()) + { + if (d_pos_memberships_data[x][k] == r) + { + return; + } + } + else + { + break; + } + } + } + d_pos_memberships[x] = index + 1; + if (index < d_pos_memberships_data[x].size()) + { + d_pos_memberships_data[x][index] = r; + } + else + { + d_pos_memberships_data[x].push_back(r); + } + } + else if (!options::stringIgnNegMembership()) + { + unsigned index = 0; + NodeUIntMap::const_iterator it = d_neg_memberships.find(x); + if (it != d_neg_memberships.end()) + { + index = (*it).second; + for (unsigned k = 0; k < index; k++) + { + if (k < d_neg_memberships_data[x].size()) + { + if (d_neg_memberships_data[x][k] == r) + { + return; + } + } + else + { + break; + } + } + } + d_neg_memberships[x] = index + 1; + if (index < d_neg_memberships_data[x].size()) + { + d_neg_memberships_data[x][index] = r; + } + else + { + d_neg_memberships_data[x].push_back(r); + } + } + // old + if (polarity || !options::stringIgnNegMembership()) + { + d_regexp_memberships.push_back(assertion); + } +} + +Node RegExpSolver::getNormalSymRegExp(Node r, std::vector<Node>& nf_exp) +{ + Node ret = r; + switch (r.getKind()) + { + case REGEXP_EMPTY: + case REGEXP_SIGMA: break; + case STRING_TO_REGEXP: + { + if (!r[0].isConst()) + { + Node tmp = d_parent.getNormalString(r[0], nf_exp); + if (tmp != r[0]) + { + ret = NodeManager::currentNM()->mkNode(STRING_TO_REGEXP, tmp); + } + } + break; + } + case REGEXP_CONCAT: + case REGEXP_UNION: + case REGEXP_INTER: + case REGEXP_STAR: + { + std::vector<Node> vec_nodes; + for (const Node& cr : r) + { + vec_nodes.push_back(getNormalSymRegExp(cr, nf_exp)); + } + ret = Rewriter::rewrite( + NodeManager::currentNM()->mkNode(r.getKind(), vec_nodes)); + break; + } + default: + { + Trace("strings-error") << "Unsupported term: " << r + << " in normalization SymRegExp." << std::endl; + Assert(false); + } + } + return ret; +} + +} // namespace strings +} // namespace theory +} // namespace CVC4 diff --git a/src/theory/strings/regexp_solver.h b/src/theory/strings/regexp_solver.h new file mode 100644 index 000000000..13b66557a --- /dev/null +++ b/src/theory/strings/regexp_solver.h @@ -0,0 +1,106 @@ +/********************* */ +/*! \file regexp_solver.h + ** \verbatim + ** Top contributors (to current version): + ** Andrew Reynolds, Tianyi Liang, Andres Noetzli + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Regular expression solver for the theory of strings. + ** + **/ + +#include "cvc4_private.h" + +#ifndef CVC4__THEORY__STRINGS__REGEXP_SOLVER_H +#define CVC4__THEORY__STRINGS__REGEXP_SOLVER_H + +#include <map> +#include "context/cdhashset.h" +#include "context/cdlist.h" +#include "context/context.h" +#include "expr/node.h" +#include "theory/strings/regexp_operation.h" +#include "util/regexp.h" + +namespace CVC4 { +namespace theory { +namespace strings { + +class TheoryStrings; + +class RegExpSolver +{ + typedef context::CDList<Node> NodeList; + typedef context::CDHashMap<Node, bool, NodeHashFunction> NodeBoolMap; + typedef context::CDHashMap<Node, int, NodeHashFunction> NodeIntMap; + typedef context::CDHashMap<Node, unsigned, NodeHashFunction> NodeUIntMap; + typedef context::CDHashMap<Node, Node, NodeHashFunction> NodeNodeMap; + typedef context::CDHashSet<Node, NodeHashFunction> NodeSet; + + public: + RegExpSolver(TheoryStrings& p, context::Context* c, context::UserContext* u); + ~RegExpSolver() {} + + /** add membership + * + * This informs this class that assertion is asserted in the current context. + * We expect that assertion is a (possibly negated) regular expression + * membership. + */ + void addMembership(Node assertion); + /** check + * + * Tells this solver to check whether the regular expressions asserted to it + * are consistent. If they are not, then this class will call the + * sendInference method of its parent TheoryString object, indicating that + * it requires a conflict or lemma to be processed. + */ + void check(); + + private: + // Constants + Node d_emptyString; + Node d_emptyRegexp; + Node d_true; + Node d_false; + /** the parent of this object */ + TheoryStrings& d_parent; + // check membership constraints + Node mkAnd(Node c1, Node c2); + bool checkPDerivative( + Node x, Node r, Node atom, bool& addedLemma, std::vector<Node>& nf_exp); + Node getMembership(Node n, bool isPos, unsigned i); + unsigned getNumMemberships(Node n, bool isPos); + CVC4::String getHeadConst(Node x); + bool deriveRegExp(Node x, Node r, Node atom, std::vector<Node>& ant); + Node getNormalSymRegExp(Node r, std::vector<Node>& nf_exp); + // regular expression memberships + NodeList d_regexp_memberships; + NodeSet d_regexp_ucached; + NodeSet d_regexp_ccached; + // stored assertions + NodeUIntMap d_pos_memberships; + std::map<Node, std::vector<Node> > d_pos_memberships_data; + NodeUIntMap d_neg_memberships; + std::map<Node, std::vector<Node> > d_neg_memberships_data; + // semi normal forms for symbolic expression + std::map<Node, Node> d_nf_regexps; + std::map<Node, std::vector<Node> > d_nf_regexps_exp; + // intersection + NodeNodeMap d_inter_cache; + NodeIntMap d_inter_index; + // processed memberships + NodeSet d_processed_memberships; + /** regular expression operation module */ + RegExpOpr d_regexp_opr; +}; /* class TheoryStrings */ + +} // namespace strings +} // namespace theory +} // namespace CVC4 + +#endif /* CVC4__THEORY__STRINGS__THEORY_STRINGS_H */ diff --git a/src/theory/strings/skolem_cache.cpp b/src/theory/strings/skolem_cache.cpp index 276cb70d6..669b424a4 100644 --- a/src/theory/strings/skolem_cache.cpp +++ b/src/theory/strings/skolem_cache.cpp @@ -2,9 +2,9 @@ /*! \file skolem_cache.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/strings/skolem_cache.h b/src/theory/strings/skolem_cache.h index a6e91a246..c1e3c7214 100644 --- a/src/theory/strings/skolem_cache.h +++ b/src/theory/strings/skolem_cache.h @@ -2,9 +2,9 @@ /*! \file skolem_cache.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__STRINGS__SKOLEM_CACHE_H -#define __CVC4__THEORY__STRINGS__SKOLEM_CACHE_H +#ifndef CVC4__THEORY__STRINGS__SKOLEM_CACHE_H +#define CVC4__THEORY__STRINGS__SKOLEM_CACHE_H #include <map> #include <tuple> @@ -168,4 +168,4 @@ class SkolemCache } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__STRINGS__SKOLEM_CACHE_H */ +#endif /* CVC4__THEORY__STRINGS__SKOLEM_CACHE_H */ diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp index 23b818984..33fbbb174 100644 --- a/src/theory/strings/theory_strings.cpp +++ b/src/theory/strings/theory_strings.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tianyi Liang, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -121,15 +121,7 @@ TheoryStrings::TheoryStrings(context::Context* c, d_functionsTerms(c), d_has_extf(c, false), d_has_str_code(false), - d_regexp_memberships(c), - d_regexp_ucached(u), - d_regexp_ccached(c), - d_pos_memberships(c), - d_neg_memberships(c), - d_inter_cache(c), - d_inter_index(c), - d_processed_memberships(c), - d_regexp_ant(c), + d_regexp_solver(*this, c, u), d_input_vars(u), d_input_var_lsum(u), d_cardinality_lits(u), @@ -169,8 +161,6 @@ TheoryStrings::TheoryStrings(context::Context* c, d_one = NodeManager::currentNM()->mkConst( Rational( 1 ) ); d_neg_one = NodeManager::currentNM()->mkConst(Rational(-1)); d_emptyString = NodeManager::currentNM()->mkConst( ::CVC4::String("") ); - std::vector< Node > nvec; - d_emptyRegexp = NodeManager::currentNM()->mkNode( kind::REGEXP_EMPTY, nvec ); d_true = NodeManager::currentNM()->mkConst( true ); d_false = NodeManager::currentNM()->mkConst( false ); @@ -258,6 +248,39 @@ Node TheoryStrings::getLength( Node t, std::vector< Node >& exp ) { return getLengthExp( t, exp, t ); } +Node TheoryStrings::getNormalString(Node x, std::vector<Node>& nf_exp) +{ + if (!x.isConst()) + { + Node xr = getRepresentative(x); + std::map<Node, NormalForm>::iterator it = d_normal_form.find(xr); + if (it != d_normal_form.end()) + { + NormalForm& nf = it->second; + Node ret = mkConcat(nf.d_nf); + nf_exp.insert(nf_exp.end(), nf.d_exp.begin(), nf.d_exp.end()); + addToExplanation(x, nf.d_base, nf_exp); + Trace("strings-debug") + << "Term: " << x << " has a normal form " << ret << std::endl; + return ret; + } + // if x does not have a normal form, then it should not occur in the + // equality engine and hence should be its own representative. + Assert(xr == x); + if (x.getKind() == kind::STRING_CONCAT) + { + std::vector<Node> vec_nodes; + for (unsigned i = 0; i < x.getNumChildren(); i++) + { + Node nc = getNormalString(x[i], nf_exp); + vec_nodes.push_back(nc); + } + return mkConcat(vec_nodes); + } + } + return x; +} + void TheoryStrings::setMasterEqualityEngine(eq::EqualityEngine* eq) { d_equalityEngine.setMasterEqualityEngine(eq); } @@ -377,11 +400,14 @@ bool TheoryStrings::getCurrentSubstitution( int effort, std::vector< Node >& var } }else if( effort>=1 && effort<3 && n.getType().isString() ){ //normal forms - Node ns = getNormalString( d_normal_forms_base[nr], exp[n] ); + NormalForm& nfnr = getNormalForm(nr); + Node ns = getNormalString(nfnr.d_base, exp[n]); subs.push_back( ns ); - Trace("strings-subs") << " normal eqc : " << ns << " " << d_normal_forms_base[nr] << " " << nr << std::endl; - if( !d_normal_forms_base[nr].isNull() ) { - addToExplanation( n, d_normal_forms_base[nr], exp[n] ); + Trace("strings-subs") << " normal eqc : " << ns << " " << nfnr.d_base + << " " << nr << std::endl; + if (!nfnr.d_base.isNull()) + { + addToExplanation(n, nfnr.d_base, exp[n]); } }else{ //representative? @@ -648,8 +674,8 @@ bool TheoryStrings::collectModelInfo(TheoryModel* m) //check if col[i][j] has only variables if (!eqc.isConst()) { - Assert(d_normal_forms.find(eqc) != d_normal_forms.end()); - if (d_normal_forms[eqc].size() == 1) + NormalForm& nfe = getNormalForm(eqc); + if (nfe.d_nf.size() == 1) { // does it have a code and the length of these equivalence classes are // one? @@ -772,20 +798,31 @@ bool TheoryStrings::collectModelInfo(TheoryModel* m) //step 4 : assign constants to all other equivalence classes for( unsigned i=0; i<nodes.size(); i++ ){ if( processed.find( nodes[i] )==processed.end() ){ - Assert( d_normal_forms.find( nodes[i] )!=d_normal_forms.end() ); - Trace("strings-model") << "Construct model for " << nodes[i] << " based on normal form "; - for( unsigned j=0; j<d_normal_forms[nodes[i]].size(); j++ ) { - if( j>0 ) Trace("strings-model") << " ++ "; - Trace("strings-model") << d_normal_forms[nodes[i]][j]; - Node r = getRepresentative( d_normal_forms[nodes[i]][j] ); - if( !r.isConst() && processed.find( r )==processed.end() ){ - Trace("strings-model") << "(UNPROCESSED)"; + NormalForm& nf = getNormalForm(nodes[i]); + if (Trace.isOn("strings-model")) + { + Trace("strings-model") + << "Construct model for " << nodes[i] << " based on normal form "; + for (unsigned j = 0, size = nf.d_nf.size(); j < size; j++) + { + Node n = nf.d_nf[j]; + if (j > 0) + { + Trace("strings-model") << " ++ "; + } + Trace("strings-model") << n; + Node r = getRepresentative(n); + if (!r.isConst() && processed.find(r) == processed.end()) + { + Trace("strings-model") << "(UNPROCESSED)"; + } } } Trace("strings-model") << std::endl; std::vector< Node > nc; - for( unsigned j=0; j<d_normal_forms[nodes[i]].size(); j++ ) { - Node r = getRepresentative( d_normal_forms[nodes[i]][j] ); + for (const Node& n : nf.d_nf) + { + Node r = getRepresentative(n); Assert( r.isConst() || processed.find( r )!=processed.end() ); nc.push_back(r.isConst() ? r : processed[r]); } @@ -885,8 +922,15 @@ void TheoryStrings::preRegisterTerm(TNode n) { // Function applications/predicates d_equalityEngine.addTerm(n); } - //concat terms do not contribute to theory combination? TODO: verify - if (n.hasOperator() && kindToTheoryId(k) == THEORY_STRINGS + // Set d_functionsTerms stores all function applications that are + // relevant to theory combination. Notice that this is a subset of + // the applications whose kinds are function kinds in the equality + // engine. This means it does not include applications of operators + // like re.++, which is not a function kind in the equality engine. + // Concatenation terms do not need to be considered here because + // their arguments have string type and do not introduce any shared + // terms. + if (n.hasOperator() && d_equalityEngine.isFunctionKind(k) && k != kind::STRING_CONCAT) { d_functionsTerms.push_back( n ); @@ -1023,6 +1067,30 @@ void TheoryStrings::checkExtfReductions( int effort ) { } } +void TheoryStrings::checkMemberships() +{ + // add the memberships + std::vector<Node> mems = getExtTheory()->getActive(kind::STRING_IN_REGEXP); + for (unsigned i = 0; i < mems.size(); i++) + { + Node n = mems[i]; + Assert(d_extf_info_tmp.find(n) != d_extf_info_tmp.end()); + if (!d_extf_info_tmp[n].d_const.isNull()) + { + bool pol = d_extf_info_tmp[n].d_const.getConst<bool>(); + Trace("strings-process-debug") + << " add membership : " << n << ", pol = " << pol << std::endl; + d_regexp_solver.addMembership(pol ? n : n.negate()); + } + else + { + Trace("strings-process-debug") + << " irrelevant (non-asserted) membership : " << n << std::endl; + } + } + d_regexp_solver.check(); +} + TheoryStrings::EqcInfo::EqcInfo(context::Context* c) : d_length_term(c), d_code_term(c), @@ -1572,7 +1640,6 @@ void TheoryStrings::checkExtfEval( int effort ) { einfo.d_exp.insert(einfo.d_exp.end(), exp[i].begin(), exp[i].end()); // inference is rewriting the substituted node Node nrc = Rewriter::rewrite( sn ); - Kind nrck = nrc.getKind(); //if rewrites to a constant, then do the inference and mark as reduced if( nrc.isConst() ){ if( effort<3 ){ @@ -1649,24 +1716,28 @@ void TheoryStrings::checkExtfEval( int effort ) { einfo.d_model_active = false; } } - //if it reduces to a conjunction, infer each and reduce } - else if ((nrck == OR && einfo.d_const == d_false) - || (nrck == AND && einfo.d_const == d_true)) + else { - Assert( effort<3 ); - getExtTheory()->markReduced( n ); - einfo.d_exp.push_back(einfo.d_const == d_false ? n.negate() : n); - Trace("strings-extf-debug") << " decomposable..." << std::endl; - Trace("strings-extf") << " resolve extf : " << sn << " -> " << nrc - << ", const = " << einfo.d_const << std::endl; - for (const Node& nrcc : nrc) + // if this was a predicate which changed after substitution + rewriting + if (!einfo.d_const.isNull() && nrc.getType().isBoolean() && nrc != n) { - sendInternalInference(einfo.d_exp, - einfo.d_const == d_false ? nrcc.negate() : nrcc, - effort == 0 ? "EXTF_d" : "EXTF_d-N"); + bool pol = einfo.d_const == d_true; + Node nrcAssert = pol ? nrc : nrc.negate(); + Node nAssert = pol ? n : n.negate(); + Assert(effort < 3); + einfo.d_exp.push_back(nAssert); + Trace("strings-extf-debug") << " decomposable..." << std::endl; + Trace("strings-extf") << " resolve extf : " << sn << " -> " << nrc + << ", const = " << einfo.d_const << std::endl; + // We send inferences internal here, which may help show unsat. + // However, we do not make a determination whether n can be marked + // reduced since this argument may be circular: we may infer than n + // can be reduced to something else, but that thing may argue that it + // can be reduced to n, in theory. + sendInternalInference( + einfo.d_exp, nrcAssert, effort == 0 ? "EXTF_d" : "EXTF_d-N"); } - }else{ to_reduce = nrc; } }else{ @@ -2418,8 +2489,7 @@ void TheoryStrings::checkNormalFormsEq() } // calculate normal forms for each equivalence class, possibly adding // splitting lemmas - d_normal_forms.clear(); - d_normal_forms_exp.clear(); + d_normal_form.clear(); std::map<Node, Node> nf_to_eqc; std::map<Node, Node> eqc_to_nf; std::map<Node, Node> eqc_to_exp; @@ -2433,16 +2503,17 @@ void TheoryStrings::checkNormalFormsEq() { return; } - Node nf_term = mkConcat(d_normal_forms[eqc]); + NormalForm& nfe = getNormalForm(eqc); + Node nf_term = mkConcat(nfe.d_nf); std::map<Node, Node>::iterator itn = nf_to_eqc.find(nf_term); if (itn != nf_to_eqc.end()) { + NormalForm& nfe_eq = getNormalForm(itn->second); // two equivalence classes have same normal form, merge std::vector<Node> nf_exp; - nf_exp.push_back(mkAnd(d_normal_forms_exp[eqc])); + nf_exp.push_back(mkAnd(nfe.d_exp)); nf_exp.push_back(eqc_to_exp[itn->second]); - Node eq = - d_normal_forms_base[eqc].eqNode(d_normal_forms_base[itn->second]); + Node eq = nfe.d_base.eqNode(nfe_eq.d_base); sendInference(nf_exp, eq, "Normal_Form"); if( hasProcessed() ){ return; @@ -2452,7 +2523,7 @@ void TheoryStrings::checkNormalFormsEq() { nf_to_eqc[nf_term] = eqc; eqc_to_nf[eqc] = nf_term; - eqc_to_exp[eqc] = mkAnd(d_normal_forms_exp[eqc]); + eqc_to_exp[eqc] = mkAnd(nfe.d_exp); } Trace("strings-process-debug") << "Done verifying normal forms are the same for " << eqc << std::endl; @@ -2464,8 +2535,8 @@ void TheoryStrings::checkNormalFormsEq() it != eqc_to_exp.end(); ++it) { - Trace("strings-nf") << " N[" << it->first << "] (base " - << d_normal_forms_base[it->first] + NormalForm& nf = getNormalForm(it->first); + Trace("strings-nf") << " N[" << it->first << "] (base " << nf.d_base << ") = " << eqc_to_nf[it->first] << std::endl; Trace("strings-nf") << " exp: " << it->second << std::endl; } @@ -2488,9 +2559,10 @@ void TheoryStrings::checkCodes() std::vector<Node> const_codes; for (const Node& eqc : d_strings_eqc) { - if (d_normal_forms[eqc].size() == 1 && d_normal_forms[eqc][0].isConst()) + NormalForm& nfe = getNormalForm(eqc); + if (nfe.d_nf.size() == 1 && nfe.d_nf[0].isConst()) { - Node c = d_normal_forms[eqc][0]; + Node c = nfe.d_nf[0]; Trace("strings-code-debug") << "Get proxy variable for " << c << std::endl; Node cc = nm->mkNode(kind::STRING_CODE, c); @@ -2559,83 +2631,65 @@ void TheoryStrings::normalizeEquivalenceClass( Node eqc ) { #endif //do nothing Trace("strings-process-debug") << "Return process equivalence class " << eqc << " : empty." << std::endl; - d_normal_forms_base[eqc] = d_emptyString; - d_normal_forms[eqc].clear(); - d_normal_forms_exp[eqc].clear(); + d_normal_form[eqc].init(d_emptyString); } else { - Assert( d_normal_forms.find(eqc)==d_normal_forms.end() ); - //phi => t = s1 * ... * sn - // normal form for each non-variable term in this eqc (s1...sn) - std::vector< std::vector< Node > > normal_forms; - // explanation for each normal form (phi) - std::vector< std::vector< Node > > normal_forms_exp; - // dependency information - std::vector< std::map< Node, std::map< bool, int > > > normal_forms_exp_depend; - // record terms for each normal form (t) - std::vector< Node > normal_form_src; - // get normal forms - getNormalForms(eqc, normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend); + // should not have computed the normal form of this equivalence class yet + Assert(d_normal_form.find(eqc) == d_normal_form.end()); + // Normal forms for the relevant terms in the equivalence class of eqc + std::vector<NormalForm> normal_forms; + // map each term to its index in the above vector + std::map<Node, unsigned> term_to_nf_index; + // get the normal forms + getNormalForms(eqc, normal_forms, term_to_nf_index); if( hasProcessed() ){ return; } // process the normal forms - processNEqc( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend ); + processNEqc(normal_forms); if( hasProcessed() ){ return; } - //debugPrintNormalForms( "strings-solve", eqc, normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend ); - + // debugPrintNormalForms( "strings-solve", eqc, normal_forms ); + //construct the normal form Assert( !normal_forms.empty() ); - - int nf_index = 0; - std::vector< Node >::iterator itn = std::find( normal_form_src.begin(), normal_form_src.end(), eqc ); - if( itn!=normal_form_src.end() ){ - nf_index = itn - normal_form_src.begin(); - Trace("strings-solve-debug2") << "take normal form " << nf_index << std::endl; - Assert( normal_form_src[nf_index]==eqc ); - }else{ - //just take the first normal form - Trace("strings-solve-debug2") << "take the first normal form" << std::endl; - } - d_normal_forms[eqc].insert( d_normal_forms[eqc].end(), normal_forms[nf_index].begin(), normal_forms[nf_index].end() ); - d_normal_forms_exp[eqc].insert( d_normal_forms_exp[eqc].end(), normal_forms_exp[nf_index].begin(), normal_forms_exp[nf_index].end() ); - Trace("strings-solve-debug2") << "take normal form ... done" << std::endl; - d_normal_forms_base[eqc] = normal_form_src[nf_index]; - //track dependencies - for( unsigned i=0; i<normal_forms_exp[nf_index].size(); i++ ){ - Node exp = normal_forms_exp[nf_index][i]; - for( unsigned r=0; r<2; r++ ){ - d_normal_forms_exp_depend[eqc][exp][r==0] = normal_forms_exp_depend[nf_index][exp][r==0]; - } + unsigned nf_index = 0; + std::map<Node, unsigned>::iterator it = term_to_nf_index.find(eqc); + // we prefer taking the normal form whose base is the equivalence + // class representative, since this leads to shorter explanations in + // some cases. + if (it != term_to_nf_index.end()) + { + nf_index = it->second; } - Trace("strings-process-debug") << "Return process equivalence class " << eqc << " : returned, size = " << d_normal_forms[eqc].size() << std::endl; + d_normal_form[eqc] = normal_forms[nf_index]; + Trace("strings-process-debug") + << "Return process equivalence class " << eqc + << " : returned, size = " << d_normal_form[eqc].d_nf.size() + << std::endl; } } -void trackNfExpDependency( std::vector< Node >& nf_exp_n, std::map< Node, std::map< bool, int > >& nf_exp_depend_n, Node exp, int new_val, int new_rev_val ){ - if( std::find( nf_exp_n.begin(), nf_exp_n.end(), exp )==nf_exp_n.end() ){ - nf_exp_n.push_back( exp ); - } - for( unsigned k=0; k<2; k++ ){ - int val = k==0 ? new_val : new_rev_val; - std::map< bool, int >::iterator itned = nf_exp_depend_n[exp].find( k==1 ); - if( itned==nf_exp_depend_n[exp].end() ){ - Trace("strings-process-debug") << "Deps : set dependency on " << exp << " to " << val << " isRev=" << (k==0) << std::endl; - nf_exp_depend_n[exp][k==1] = val; - }else{ - Trace("strings-process-debug") << "Deps : Multiple dependencies on " << exp << " : " << itned->second << " " << val << " isRev=" << (k==0) << std::endl; - //if we already have a dependency (in the case of non-linear string equalities), it is min/max - bool cmp = val > itned->second; - if( cmp==(k==1) ){ - nf_exp_depend_n[exp][k==1] = val; - } - } +NormalForm& TheoryStrings::getNormalForm(Node n) +{ + std::map<Node, NormalForm>::iterator itn = d_normal_form.find(n); + if (itn == d_normal_form.end()) + { + Trace("strings-warn") << "WARNING: returning empty normal form for " << n + << std::endl; + // Shouln't ask for normal forms of strings that weren't computed. This + // likely means that n is not a representative or not a term in the current + // context. We simply return a default normal form here in this case. + Assert(false); + return d_normal_form[n]; } + return itn->second; } -void TheoryStrings::getNormalForms( Node &eqc, std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend ) { +void TheoryStrings::getNormalForms(Node eqc, + std::vector<NormalForm>& normal_forms, + std::map<Node, unsigned>& term_to_nf_index) +{ //constant for equivalence class Node eqc_non_c = eqc; Trace("strings-process-debug") << "Get normal forms " << eqc << std::endl; @@ -2643,79 +2697,115 @@ void TheoryStrings::getNormalForms( Node &eqc, std::vector< std::vector< Node > while( !eqc_i.isFinished() ){ Node n = (*eqc_i); if( d_congruent.find( n )==d_congruent.end() ){ - if( n.getKind() == kind::CONST_STRING || n.getKind() == kind::STRING_CONCAT ){ + if (n.getKind() == CONST_STRING || n.getKind() == STRING_CONCAT) + { Trace("strings-process-debug") << "Get Normal Form : Process term " << n << " in eqc " << eqc << std::endl; - std::vector< Node > nf_n; - std::vector< Node > nf_exp_n; - std::map< Node, std::map< bool, int > > nf_exp_depend_n; - if( n.getKind()==kind::CONST_STRING ){ - if( n!=d_emptyString ) { - nf_n.push_back( n ); - } - }else if( n.getKind()==kind::STRING_CONCAT ){ + NormalForm nf_curr; + if (n.getKind() == CONST_STRING) + { + nf_curr.init(n); + } + else if (n.getKind() == STRING_CONCAT) + { + // set the base to n, we construct the other portions of nf_curr in + // the following. + nf_curr.d_base = n; for( unsigned i=0; i<n.getNumChildren(); i++ ) { Node nr = d_equalityEngine.getRepresentative( n[i] ); + // get the normal form for the component + NormalForm& nfr = getNormalForm(nr); + std::vector<Node>& nfrv = nfr.d_nf; Trace("strings-process-debug") << "Normalizing subterm " << n[i] << " = " << nr << std::endl; - Assert( d_normal_forms.find( nr )!=d_normal_forms.end() ); - unsigned orig_size = nf_n.size(); - unsigned add_size = d_normal_forms[nr].size(); + unsigned orig_size = nf_curr.d_nf.size(); + unsigned add_size = nfrv.size(); //if not the empty string, add to current normal form - if( !d_normal_forms[nr].empty() ){ - for( unsigned r=0; r<d_normal_forms[nr].size(); r++ ) { - if( Trace.isOn("strings-error") ) { - if( d_normal_forms[nr][r].getKind()==kind::STRING_CONCAT ){ - Trace("strings-error") << "Strings::Error: From eqc = " << eqc << ", " << n << " index " << i << ", bad normal form : "; - for( unsigned rr=0; rr<d_normal_forms[nr].size(); rr++ ) { - Trace("strings-error") << d_normal_forms[nr][rr] << " "; + if (!nfrv.empty()) + { + // if in a build with assertions, we run the following block, + // which checks that normal forms do not have concat terms. + if (Configuration::isAssertionBuild()) + { + for (const Node& nn : nfrv) + { + if (Trace.isOn("strings-error")) + { + if (nn.getKind() == STRING_CONCAT) + { + Trace("strings-error") + << "Strings::Error: From eqc = " << eqc << ", " << n + << " index " << i << ", bad normal form : "; + for (unsigned rr = 0; rr < nfrv.size(); rr++) + { + Trace("strings-error") << nfrv[rr] << " "; + } + Trace("strings-error") << std::endl; } - Trace("strings-error") << std::endl; } + Assert(nn.getKind() != kind::STRING_CONCAT); } - Assert( d_normal_forms[nr][r].getKind()!=kind::STRING_CONCAT ); } - nf_n.insert( nf_n.end(), d_normal_forms[nr].begin(), d_normal_forms[nr].end() ); + nf_curr.d_nf.insert(nf_curr.d_nf.end(), nfrv.begin(), nfrv.end()); } - - for( unsigned j=0; j<d_normal_forms_exp[nr].size(); j++ ){ - Node exp = d_normal_forms_exp[nr][j]; - //track depends - trackNfExpDependency( nf_exp_n, nf_exp_depend_n, exp, - orig_size + d_normal_forms_exp_depend[nr][exp][false], - orig_size + ( add_size - d_normal_forms_exp_depend[nr][exp][true] ) ); + // Track explanation for the normal form. This is in two parts. + // First, we must carry the explanation of the normal form computed + // for the representative nr. + for (const Node& exp : nfr.d_exp) + { + // The explanation is only relevant for the subsegment it was + // previously relevant for, shifted now based on its relative + // placement in the normal form of n. + nf_curr.addToExplanation( + exp, + orig_size + nfr.d_expDep[exp][false], + orig_size + (add_size - nfr.d_expDep[exp][true])); } - if( d_normal_forms_base[nr]!=n[i] ){ - Assert( d_normal_forms_base.find( nr )!=d_normal_forms_base.end() ); - Node eq = n[i].eqNode( d_normal_forms_base[nr] ); - //track depends : entire current segment is dependent upon base equality - trackNfExpDependency( nf_exp_n, nf_exp_depend_n, eq, orig_size, orig_size + add_size ); + // Second, must explain that the component n[i] is equal to the + // base of the normal form for nr. + Node base = nfr.d_base; + if (base != n[i]) + { + Node eq = n[i].eqNode(base); + // The equality is relevant for the entire current segment + nf_curr.addToExplanation(eq, orig_size, orig_size + add_size); } } - //convert forward indices to reverse indices - int total_size = nf_n.size(); - for( std::map< Node, std::map< bool, int > >::iterator it = nf_exp_depend_n.begin(); it != nf_exp_depend_n.end(); ++it ){ - it->second[true] = total_size - it->second[true]; - Assert( it->second[true]>=0 ); + // Now that we are finished with the loop, we convert forward indices + // to reverse indices in the explanation dependency information + int total_size = nf_curr.d_nf.size(); + for (std::pair<const Node, std::map<bool, unsigned> >& ed : + nf_curr.d_expDep) + { + ed.second[true] = total_size - ed.second[true]; + Assert(ed.second[true] >= 0); } } //if not equal to self - if( nf_n.size()>1 || ( nf_n.size()==1 && nf_n[0].getKind()==kind::CONST_STRING ) ){ - if( nf_n.size()>1 ) { - for( unsigned i=0; i<nf_n.size(); i++ ){ - if( Trace.isOn("strings-error") ){ - Trace("strings-error") << "Cycle for normal form "; - printConcat(nf_n,"strings-error"); - Trace("strings-error") << "..." << nf_n[i] << std::endl; + std::vector<Node>& currv = nf_curr.d_nf; + if (currv.size() > 1 + || (currv.size() == 1 && currv[0].getKind() == CONST_STRING)) + { + // if in a build with assertions, check that normal form is acyclic + if (Configuration::isAssertionBuild()) + { + if (currv.size() > 1) + { + for (unsigned i = 0; i < currv.size(); i++) + { + if (Trace.isOn("strings-error")) + { + Trace("strings-error") << "Cycle for normal form "; + printConcat(currv, "strings-error"); + Trace("strings-error") << "..." << currv[i] << std::endl; + } + Assert(!areEqual(currv[i], n)); } - Assert( !areEqual( nf_n[i], n ) ); } } - normal_forms.push_back(nf_n); - normal_form_src.push_back(n); - normal_forms_exp.push_back(nf_exp_n); - normal_forms_exp_depend.push_back(nf_exp_depend_n); + term_to_nf_index[n] = normal_forms.size(); + normal_forms.push_back(nf_curr); }else{ //this was redundant: combination of self + empty string(s) - Node nn = nf_n.size()==0 ? d_emptyString : nf_n[0]; + Node nn = currv.size() == 0 ? d_emptyString : currv[0]; Assert( areEqual( nn, eqc ) ); } }else{ @@ -2727,41 +2817,56 @@ void TheoryStrings::getNormalForms( Node &eqc, std::vector< std::vector< Node > if( normal_forms.empty() ) { Trace("strings-solve-debug2") << "construct the normal form" << std::endl; - //do not choose a concat here use "eqc_non_c" (in this case they have non-trivial explanation why they normalize to self) - std::vector< Node > eqc_non_c_nf; - getConcatVec( eqc_non_c, eqc_non_c_nf ); - normal_forms.push_back( eqc_non_c_nf ); - normal_form_src.push_back( eqc_non_c ); - normal_forms_exp.push_back( std::vector< Node >() ); - normal_forms_exp_depend.push_back( std::map< Node, std::map< bool, int > >() ); + // This case happens when there are no non-trivial normal forms for this + // equivalence class. For example, given assertions: + // { x = y ++ z, x = y, z = "" } + // The equivalence class of { x, y, y ++ z } is such that the normal form + // of all terms is a variable (either x or y) in the equivalence class + // itself. Thus, the normal form of this equivalence class can be assigned + // to one of these variables. + // We use a non-concatenation term among the terms in this equivalence + // class, which is stored in eqc_non_c. The reason is this does not require + // an explanation, whereas e.g. y ++ z would require the explanation z = "" + // to justify its normal form is y. + Assert(eqc_non_c.getKind() != STRING_CONCAT); + NormalForm nf_triv; + nf_triv.init(eqc_non_c); + normal_forms.push_back(nf_triv); }else{ if(Trace.isOn("strings-solve")) { Trace("strings-solve") << "--- Normal forms for equivalance class " << eqc << " : " << std::endl; - for( unsigned i=0; i<normal_forms.size(); i++ ) { - Trace("strings-solve") << "#" << i << " (from " << normal_form_src[i] << ") : "; - for( unsigned j=0; j<normal_forms[i].size(); j++ ) { + for (unsigned i = 0, size = normal_forms.size(); i < size; i++) + { + NormalForm& nf = normal_forms[i]; + Trace("strings-solve") << "#" << i << " (from " << nf.d_base << ") : "; + for (unsigned j = 0, sizej = nf.d_nf.size(); j < sizej; j++) + { if(j>0) { Trace("strings-solve") << ", "; } - Trace("strings-solve") << normal_forms[i][j]; + Trace("strings-solve") << nf.d_nf[j]; } Trace("strings-solve") << std::endl; Trace("strings-solve") << " Explanation is : "; - if(normal_forms_exp[i].size() == 0) { + if (nf.d_exp.size() == 0) + { Trace("strings-solve") << "NONE"; } else { - for( unsigned j=0; j<normal_forms_exp[i].size(); j++ ) { + for (unsigned j = 0, sizej = nf.d_exp.size(); j < sizej; j++) + { if(j>0) { Trace("strings-solve") << " AND "; } - Trace("strings-solve") << normal_forms_exp[i][j]; + Trace("strings-solve") << nf.d_exp[j]; } Trace("strings-solve") << std::endl; Trace("strings-solve") << "WITH DEPENDENCIES : " << std::endl; - for( unsigned j=0; j<normal_forms_exp[i].size(); j++ ) { - Trace("strings-solve") << " " << normal_forms_exp[i][j] << " -> "; - Trace("strings-solve") << normal_forms_exp_depend[i][normal_forms_exp[i][j]][false] << ","; - Trace("strings-solve") << normal_forms_exp_depend[i][normal_forms_exp[i][j]][true] << std::endl; + for (unsigned j = 0, sizej = nf.d_exp.size(); j < sizej; j++) + { + Node exp = nf.d_exp[j]; + Trace("strings-solve") << " " << exp << " -> "; + Trace("strings-solve") << nf.d_expDep[exp][false] << ","; + Trace("strings-solve") << nf.d_expDep[exp][true] << std::endl; } } Trace("strings-solve") << std::endl; @@ -2775,10 +2880,14 @@ void TheoryStrings::getNormalForms( Node &eqc, std::vector< std::vector< Node > Node c = getConstantEqc( eqc ); if( !c.isNull() ){ Trace("strings-solve") << "Eqc is constant " << c << std::endl; - for( unsigned i=0; i<normal_forms.size(); i++ ) { + for (unsigned i = 0, size = normal_forms.size(); i < size; i++) + { + NormalForm& nf = normal_forms[i]; int firstc, lastc; - if( !TheoryStringsRewriter::canConstantContainList( c, normal_forms[i], firstc, lastc ) ){ - Node n = normal_form_src[i]; + if (!TheoryStringsRewriter::canConstantContainList( + c, nf.d_nf, firstc, lastc)) + { + Node n = nf.d_base; //conflict Trace("strings-solve") << "Normal form for " << n << " cannot be contained in constant " << c << std::endl; //conflict, explanation is n = base ^ base = c ^ relevant porition of ( n = N[n] ) @@ -2790,7 +2899,7 @@ void TheoryStrings::getNormalForms( Node &eqc, std::vector< std::vector< Node > exp.push_back( d_eqc_to_const_exp[eqc] ); } //TODO: this can be minimized based on firstc/lastc, normal_forms_exp_depend - exp.insert( exp.end(), normal_forms_exp[i].begin(), normal_forms_exp[i].end() ); + exp.insert(exp.end(), nf.d_exp.begin(), nf.d_exp.end()); Node conc = d_false; sendInference( exp, conc, "N_NCTN" ); } @@ -2799,52 +2908,29 @@ void TheoryStrings::getNormalForms( Node &eqc, std::vector< std::vector< Node > } } -void TheoryStrings::getExplanationVectorForPrefix( std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend, - unsigned i, int index, bool isRev, std::vector< Node >& curr_exp ) { - if( index==-1 || !options::stringMinPrefixExplain() ){ - curr_exp.insert(curr_exp.end(), normal_forms_exp[i].begin(), normal_forms_exp[i].end() ); - }else{ - for( unsigned k=0; k<normal_forms_exp[i].size(); k++ ){ - Node exp = normal_forms_exp[i][k]; - int dep = normal_forms_exp_depend[i][exp][isRev]; - if( dep<=index ){ - curr_exp.push_back( exp ); - Trace("strings-explain-prefix-debug") << " include : " << exp << std::endl; - }else{ - Trace("strings-explain-prefix-debug") << " exclude : " << exp << std::endl; - } - } - } -} - -void TheoryStrings::getExplanationVectorForPrefixEq( std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend, - unsigned i, unsigned j, int index_i, int index_j, bool isRev, std::vector< Node >& curr_exp ) { - Trace("strings-explain-prefix") << "Get explanation for prefix " << index_i << ", " << index_j << " of normal forms " << i << " and " << j << ", reverse = " << isRev << std::endl; - for( unsigned r=0; r<2; r++ ){ - getExplanationVectorForPrefix( normal_forms_exp, normal_forms_exp_depend, r==0 ? i : j, r==0 ? index_i : index_j, isRev, curr_exp ); - } - Trace("strings-explain-prefix") << "Included " << curr_exp.size() << " / " << ( normal_forms_exp[i].size() + normal_forms_exp[j].size() ) << std::endl; - addToExplanation( normal_form_src[i], normal_form_src[j], curr_exp ); -} - - -void TheoryStrings::processNEqc( std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend ){ +void TheoryStrings::processNEqc(std::vector<NormalForm>& normal_forms) +{ //the possible inferences std::vector< InferInfo > pinfer; // loop over all pairs for(unsigned i=0; i<normal_forms.size()-1; i++) { //unify each normalform[j] with normal_forms[i] for(unsigned j=i+1; j<normal_forms.size(); j++ ) { + NormalForm& nfi = normal_forms[i]; + NormalForm& nfj = normal_forms[j]; //ensure that normal_forms[i] and normal_forms[j] are the same modulo equality, add to pinfer if not Trace("strings-solve") << "Strings: Process normal form #" << i << " against #" << j << "..." << std::endl; - if( isNormalFormPair( normal_form_src[i], normal_form_src[j] ) ) { + if (isNormalFormPair(nfi.d_base, nfj.d_base)) + { Trace("strings-solve") << "Strings: Already cached." << std::endl; }else{ //process the reverse direction first (check for easy conflicts and inferences) unsigned rindex = 0; - processReverseNEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, rindex, 0, pinfer ); + nfi.reverse(); + nfj.reverse(); + processSimpleNEq(nfi, nfj, rindex, true, 0, pinfer); + nfi.reverse(); + nfj.reverse(); if( hasProcessed() ){ return; }else if( !pinfer.empty() && pinfer.back().d_id==1 ){ @@ -2854,7 +2940,7 @@ void TheoryStrings::processNEqc( std::vector< std::vector< Node > > &normal_form //rindex = 0; unsigned index = 0; - processSimpleNEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, index, false, rindex, pinfer ); + processSimpleNEq(nfi, nfj, index, false, rindex, pinfer); if( hasProcessed() ){ return; }else if( !pinfer.empty() && pinfer.back().d_id==1 ){ @@ -2920,86 +3006,92 @@ bool TheoryStrings::InferInfo::sendAsLemma() { return true; } -void TheoryStrings::processReverseNEq( std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend, - unsigned i, unsigned j, unsigned& index, unsigned rproc, std::vector< InferInfo >& pinfer ) { - //reverse normal form of i, j - std::reverse( normal_forms[i].begin(), normal_forms[i].end() ); - std::reverse( normal_forms[j].begin(), normal_forms[j].end() ); - - processSimpleNEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, index, true, rproc, pinfer ); - - //reverse normal form of i, j - std::reverse( normal_forms[i].begin(), normal_forms[i].end() ); - std::reverse( normal_forms[j].begin(), normal_forms[j].end() ); -} - -//rproc is the # is the size of suffix that is identical -void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend, - unsigned i, unsigned j, unsigned& index, bool isRev, unsigned rproc, std::vector< InferInfo >& pinfer ) { - Assert( rproc<=normal_forms[i].size() && rproc<=normal_forms[j].size() ); +void TheoryStrings::processSimpleNEq(NormalForm& nfi, + NormalForm& nfj, + unsigned& index, + bool isRev, + unsigned rproc, + std::vector<InferInfo>& pinfer) +{ + std::vector<Node>& nfiv = nfi.d_nf; + std::vector<Node>& nfjv = nfj.d_nf; + NodeManager* nm = NodeManager::currentNM(); + Assert(rproc <= nfiv.size() && rproc <= nfjv.size()); bool success; do { success = false; //if we are at the end - if( index==(normal_forms[i].size()-rproc) || index==(normal_forms[j].size()-rproc) ){ - if( index==(normal_forms[i].size()-rproc) && index==(normal_forms[j].size()-rproc) ){ + if (index == (nfiv.size() - rproc) || index == (nfjv.size() - rproc)) + { + if (index == (nfiv.size() - rproc) && index == (nfjv.size() - rproc)) + { //we're done }else{ //the remainder must be empty - unsigned k = index==(normal_forms[i].size()-rproc) ? j : i; + NormalForm& nfk = index == (nfiv.size() - rproc) ? nfj : nfi; + std::vector<Node>& nfkv = nfk.d_nf; unsigned index_k = index; //Node eq_exp = mkAnd( curr_exp ); std::vector< Node > curr_exp; - getExplanationVectorForPrefixEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, -1, -1, isRev, curr_exp ); - while( !d_conflict && index_k<(normal_forms[k].size()-rproc) ){ + NormalForm::getExplanationForPrefixEq(nfi, nfj, -1, -1, curr_exp); + while (!d_conflict && index_k < (nfkv.size() - rproc)) + { //can infer that this string must be empty - Node eq = normal_forms[k][index_k].eqNode( d_emptyString ); + Node eq = nfkv[index_k].eqNode(d_emptyString); //Trace("strings-lemma") << "Strings: Infer " << eq << " from " << eq_exp << std::endl; - Assert( !areEqual( d_emptyString, normal_forms[k][index_k] ) ); + Assert(!areEqual(d_emptyString, nfkv[index_k])); sendInference( curr_exp, eq, "N_EndpointEmp" ); index_k++; } } }else{ - Trace("strings-solve-debug") << "Process " << normal_forms[i][index] << " ... " << normal_forms[j][index] << std::endl; - if( normal_forms[i][index]==normal_forms[j][index] ){ + Trace("strings-solve-debug") + << "Process " << nfiv[index] << " ... " << nfjv[index] << std::endl; + if (nfiv[index] == nfjv[index]) + { Trace("strings-solve-debug") << "Simple Case 1 : strings are equal" << std::endl; index++; success = true; }else{ - Assert( !areEqual(normal_forms[i][index], normal_forms[j][index]) ); + Assert(!areEqual(nfiv[index], nfjv[index])); std::vector< Node > temp_exp; - Node length_term_i = getLength( normal_forms[i][index], temp_exp ); - Node length_term_j = getLength( normal_forms[j][index], temp_exp ); - //check length(normal_forms[i][index]) == length(normal_forms[j][index]) + Node length_term_i = getLength(nfiv[index], temp_exp); + Node length_term_j = getLength(nfjv[index], temp_exp); + // check length(nfiv[index]) == length(nfjv[index]) if( areEqual( length_term_i, length_term_j ) ){ Trace("strings-solve-debug") << "Simple Case 2 : string lengths are equal" << std::endl; - Node eq = normal_forms[i][index].eqNode( normal_forms[j][index] ); + Node eq = nfiv[index].eqNode(nfjv[index]); //eq = Rewriter::rewrite( eq ); Node length_eq = length_term_i.eqNode( length_term_j ); //temp_exp.insert(temp_exp.end(), curr_exp.begin(), curr_exp.end() ); - getExplanationVectorForPrefixEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, index, index, isRev, temp_exp ); + NormalForm::getExplanationForPrefixEq( + nfi, nfj, index, index, temp_exp); temp_exp.push_back(length_eq); sendInference( temp_exp, eq, "N_Unify" ); return; - }else if( ( normal_forms[i][index].getKind()!=kind::CONST_STRING && index==normal_forms[i].size()-rproc-1 ) || - ( normal_forms[j][index].getKind()!=kind::CONST_STRING && index==normal_forms[j].size()-rproc-1 ) ){ + } + else if ((nfiv[index].getKind() != CONST_STRING + && index == nfiv.size() - rproc - 1) + || (nfjv[index].getKind() != CONST_STRING + && index == nfjv.size() - rproc - 1)) + { Trace("strings-solve-debug") << "Simple Case 3 : at endpoint" << std::endl; std::vector< Node > antec; //antec.insert(antec.end(), curr_exp.begin(), curr_exp.end() ); - getExplanationVectorForPrefixEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, -1, -1, isRev, antec ); + NormalForm::getExplanationForPrefixEq(nfi, nfj, -1, -1, antec); std::vector< Node > eqn; for( unsigned r=0; r<2; r++ ) { - int index_k = index; - int k = r==0 ? i : j; + NormalForm& nfk = r == 0 ? nfi : nfj; + std::vector<Node>& nfkv = nfk.d_nf; std::vector< Node > eqnc; - for( unsigned index_l=index_k; index_l<(normal_forms[k].size()-rproc); index_l++ ) { + for (unsigned index_l = index, size = (nfkv.size() - rproc); + index_l < size; + index_l++) + { if(isRev) { - eqnc.insert(eqnc.begin(), normal_forms[k][index_l] ); + eqnc.insert(eqnc.begin(), nfkv[index_l]); } else { - eqnc.push_back( normal_forms[k][index_l] ); + eqnc.push_back(nfkv[index_l]); } } eqn.push_back( mkConcat( eqnc ) ); @@ -3008,49 +3100,46 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal sendInference( antec, eqn[0].eqNode( eqn[1] ), "N_EndpointEq", true ); return; }else{ - Assert( normal_forms[i].size()==normal_forms[j].size() ); - index = normal_forms[i].size()-rproc; + Assert(nfiv.size() == nfjv.size()); + index = nfiv.size() - rproc; } - }else if( normal_forms[i][index].isConst() && normal_forms[j][index].isConst() ){ - Node const_str = normal_forms[i][index]; - Node other_str = normal_forms[j][index]; + } + else if (nfiv[index].isConst() && nfjv[index].isConst()) + { + Node const_str = nfiv[index]; + Node other_str = nfjv[index]; Trace("strings-solve-debug") << "Simple Case 3 : Const Split : " << const_str << " vs " << other_str << " at index " << index << ", isRev = " << isRev << std::endl; unsigned len_short = const_str.getConst<String>().size() <= other_str.getConst<String>().size() ? const_str.getConst<String>().size() : other_str.getConst<String>().size(); bool isSameFix = isRev ? const_str.getConst<String>().rstrncmp(other_str.getConst<String>(), len_short): const_str.getConst<String>().strncmp(other_str.getConst<String>(), len_short); if( isSameFix ) { //same prefix/suffix + bool constCmp = const_str.getConst<String>().size() + < other_str.getConst<String>().size(); //k is the index of the string that is shorter - int k = const_str.getConst<String>().size()<other_str.getConst<String>().size() ? i : j; - int l = const_str.getConst<String>().size()<other_str.getConst<String>().size() ? j : i; - //update the nf exp dependencies - //notice this is not critical for soundness: not doing the below incrementing will only lead to overapproximating when antecedants are required in explanations - for( std::map< Node, std::map< bool, int > >::iterator itnd = normal_forms_exp_depend[l].begin(); itnd != normal_forms_exp_depend[l].end(); ++itnd ){ - for( std::map< bool, int >::iterator itnd2 = itnd->second.begin(); itnd2 != itnd->second.end(); ++itnd2 ){ - //see if this can be incremented: it can if it is not relevant to the current index - Assert( itnd2->second>=0 && itnd2->second<=(int)normal_forms[l].size() ); - bool increment = (itnd2->first==isRev) ? itnd2->second>(int)index : ( (int)normal_forms[l].size()-1-itnd2->second )<(int)index; - if( increment ){ - normal_forms_exp_depend[l][itnd->first][itnd2->first] = itnd2->second + 1; - } - } - } + NormalForm& nfk = constCmp ? nfi : nfj; + std::vector<Node>& nfkv = nfk.d_nf; + NormalForm& nfl = constCmp ? nfj : nfi; + std::vector<Node>& nflv = nfl.d_nf; + Node remainderStr; if( isRev ){ - int new_len = normal_forms[l][index].getConst<String>().size() - len_short; - Node remainderStr = NodeManager::currentNM()->mkConst( normal_forms[l][index].getConst<String>().substr(0, new_len) ); - Trace("strings-solve-debug-test") << "Break normal form of " << normal_forms[l][index] << " into " << normal_forms[k][index] << ", " << remainderStr << std::endl; - normal_forms[l].insert( normal_forms[l].begin()+index + 1, remainderStr ); + int new_len = nflv[index].getConst<String>().size() - len_short; + remainderStr = nm->mkConst( + nflv[index].getConst<String>().substr(0, new_len)); }else{ - Node remainderStr = NodeManager::currentNM()->mkConst(normal_forms[l][index].getConst<String>().substr(len_short)); - Trace("strings-solve-debug-test") << "Break normal form of " << normal_forms[l][index] << " into " << normal_forms[k][index] << ", " << remainderStr << std::endl; - normal_forms[l].insert( normal_forms[l].begin()+index + 1, remainderStr ); + remainderStr = + nm->mkConst(nflv[index].getConst<String>().substr(len_short)); } - normal_forms[l][index] = normal_forms[k][index]; + Trace("strings-solve-debug-test") + << "Break normal form of " << nflv[index] << " into " + << nfkv[index] << ", " << remainderStr << std::endl; + nfl.splitConstant(index, nfkv[index], remainderStr); index++; success = true; }else{ //conflict std::vector< Node > antec; - getExplanationVectorForPrefixEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, index, index, isRev, antec ); + NormalForm::getExplanationForPrefixEq( + nfi, nfj, index, index, antec); sendInference( antec, d_false, "N_Const", true ); return; } @@ -3059,17 +3148,19 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal InferInfo info; info.d_index = index; //for debugging - info.d_i = i; - info.d_j = j; + info.d_i = nfi.d_base; + info.d_j = nfj.d_base; info.d_rev = isRev; bool info_valid = false; - Assert( index<normal_forms[i].size()-rproc && index<normal_forms[j].size()-rproc ); + Assert(index < nfiv.size() - rproc && index < nfjv.size() - rproc); std::vector< Node > lexp; - Node length_term_i = getLength( normal_forms[i][index], lexp ); - Node length_term_j = getLength( normal_forms[j][index], lexp ); + Node length_term_i = getLength(nfiv[index], lexp); + Node length_term_j = getLength(nfjv[index], lexp); //split on equality between string lengths (note that splitting on equality between strings is worse since it is harder to process) - if( !areDisequal( length_term_i, length_term_j ) && !areEqual( length_term_i, length_term_j ) && - normal_forms[i][index].getKind()!=kind::CONST_STRING && normal_forms[j][index].getKind()!=kind::CONST_STRING ){ //AJR: remove the latter 2 conditions? + if (!areDisequal(length_term_i, length_term_j) + && !areEqual(length_term_i, length_term_j) + && !nfiv[index].isConst() && !nfjv[index].isConst()) + { // AJR: remove the latter 2 conditions? Trace("strings-solve-debug") << "Non-simple Case 1 : string lengths neither equal nor disequal" << std::endl; //try to make the lengths equal via splitting on demand Node length_eq = NodeManager::currentNM()->mkNode( kind::EQUAL, length_term_i, length_term_j ); @@ -3084,33 +3175,34 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal int loop_in_i = -1; int loop_in_j = -1; ProcessLoopResult plr = ProcessLoopResult::SKIPPED; - if( detectLoop( normal_forms, i, j, index, loop_in_i, loop_in_j, rproc ) ){ + if (detectLoop(nfi, nfj, index, loop_in_i, loop_in_j, rproc)) + { if( !isRev ){ //FIXME - getExplanationVectorForPrefixEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, -1, -1, isRev, info.d_ant ); - //set info - plr = processLoop(normal_forms, - normal_form_src, - i, - j, - loop_in_i != -1 ? i : j, - loop_in_i != -1 ? j : i, - loop_in_i != -1 ? loop_in_i : loop_in_j, - index, - info); - if (plr == ProcessLoopResult::INFERENCE) - { - info_valid = true; - } + NormalForm::getExplanationForPrefixEq( + nfi, nfj, -1, -1, info.d_ant); + // set info + plr = processLoop(loop_in_i != -1 ? nfi : nfj, + loop_in_i != -1 ? nfj : nfi, + loop_in_i != -1 ? loop_in_i : loop_in_j, + index, + info); + if (plr == ProcessLoopResult::INFERENCE) + { + info_valid = true; + } } } if (plr == ProcessLoopResult::SKIPPED) { //AJR: length entailment here? - if( normal_forms[i][index].getKind() == kind::CONST_STRING || normal_forms[j][index].getKind() == kind::CONST_STRING ){ - unsigned const_k = normal_forms[i][index].getKind() == kind::CONST_STRING ? i : j; - unsigned nconst_k = normal_forms[i][index].getKind() == kind::CONST_STRING ? j : i; - Node other_str = normal_forms[nconst_k][index]; + if (nfiv[index].isConst() || nfjv[index].isConst()) + { + NormalForm& nfc = nfiv[index].isConst() ? nfi : nfj; + std::vector<Node>& nfcv = nfc.d_nf; + NormalForm& nfnc = nfiv[index].isConst() ? nfj : nfi; + std::vector<Node>& nfncv = nfnc.d_nf; + Node other_str = nfncv[index]; Assert( other_str.getKind()!=kind::CONST_STRING, "Other string is not constant." ); Assert( other_str.getKind()!=kind::STRING_CONCAT, "Other string is not CONCAT." ); if( !d_equalityEngine.areDisequal( other_str, d_emptyString, true ) ){ @@ -3123,12 +3215,15 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal if( !isRev ){ //FIXME Node xnz = other_str.eqNode( d_emptyString ).negate(); unsigned index_nc_k = index+1; - //Node next_const_str = TheoryStringsRewriter::collectConstantStringAt( normal_forms[nconst_k], index_nc_k, false ); unsigned start_index_nc_k = index+1; - Node next_const_str = TheoryStringsRewriter::getNextConstantAt( normal_forms[nconst_k], start_index_nc_k, index_nc_k, false ); + Node next_const_str = + TheoryStringsRewriter::getNextConstantAt( + nfncv, start_index_nc_k, index_nc_k, false); if( !next_const_str.isNull() ) { unsigned index_c_k = index; - Node const_str = TheoryStringsRewriter::collectConstantStringAt( normal_forms[const_k], index_c_k, false ); + Node const_str = + TheoryStringsRewriter::collectConstantStringAt( + nfcv, index_c_k, false); Assert( !const_str.isNull() ); CVC4::String stra = const_str.getConst<String>(); CVC4::String strb = next_const_str.getConst<String>(); @@ -3151,9 +3246,9 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal } if( p>1 ){ if( start_index_nc_k==index+1 ){ - info.d_ant.push_back( xnz ); - getExplanationVectorForPrefixEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, - const_k, nconst_k, index_c_k, index_nc_k, isRev, info.d_ant ); + info.d_ant.push_back(xnz); + NormalForm::getExplanationForPrefixEq( + nfc, nfnc, index_c_k, index_nc_k, info.d_ant); Node prea = p==stra.size() ? const_str : NodeManager::currentNM()->mkConst( isRev ? stra.suffix( p ) : stra.prefix( p ) ); Node sk = d_sk_cache.mkSkolemCached( other_str, @@ -3168,24 +3263,13 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal info.d_id = INFER_SSPLIT_CST_PROP; info_valid = true; } - /* FIXME for isRev, speculative - else if( options::stringLenPropCsp() ){ - //propagate length constraint - std::vector< Node > cc; - for( unsigned i=index; i<start_index_nc_k; i++ ){ - cc.push_back( normal_forms[nconst_k][i] ); - } - Node lt = NodeManager::currentNM()->mkNode( kind::STRING_LENGTH, mkConcat( cc ) ); - conc = NodeManager::currentNM()->mkNode( kind::GEQ, lt, NodeManager::currentNM()->mkConst( Rational(p) ) ); - sendInference( ant, conc, "S-Split(CSP-P)-lprop", true ); - } - */ } } if( !info_valid ){ info.d_ant.push_back( xnz ); - Node const_str = normal_forms[const_k][index]; - getExplanationVectorForPrefixEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, index, index, isRev, info.d_ant ); + Node const_str = nfcv[index]; + NormalForm::getExplanationForPrefixEq( + nfi, nfj, index, index, info.d_ant); CVC4::String stra = const_str.getConst<String>(); if( options::stringBinaryCsp() && stra.size()>3 ){ //split string in half @@ -3227,7 +3311,7 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal if( options::stringCheckEntailLen() ){ //check entailment for( unsigned e=0; e<2; e++ ){ - Node t = e==0 ? normal_forms[i][index] : normal_forms[j][index]; + Node t = e == 0 ? nfiv[index] : nfjv[index]; //do not infer constants are larger than variables if( t.getKind()!=kind::CONST_STRING ){ Node lt1 = e==0 ? length_term_i : length_term_j; @@ -3244,11 +3328,12 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal } } } - - getExplanationVectorForPrefixEq( normal_forms, normal_form_src, normal_forms_exp, normal_forms_exp_depend, i, j, index, index, isRev, info.d_ant ); + + NormalForm::getExplanationForPrefixEq( + nfi, nfj, index, index, info.d_ant); //x!=e /\ y!=e for(unsigned xory=0; xory<2; xory++) { - Node x = xory==0 ? normal_forms[i][index] : normal_forms[j][index]; + Node x = xory == 0 ? nfiv[index] : nfjv[index]; Node xgtz = x.eqNode( d_emptyString ).negate(); if( d_equalityEngine.areDisequal( x, d_emptyString, true ) ) { info.d_ant.push_back( xgtz ); @@ -3257,15 +3342,19 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal } } Node sk = d_sk_cache.mkSkolemCached( - normal_forms[i][index], - normal_forms[j][index], + nfiv[index], + nfjv[index], isRev ? SkolemCache::SK_ID_V_SPT_REV : SkolemCache::SK_ID_V_SPT, "v_spt"); // must add length requirement info.d_new_skolem[LENGTH_GEQ_ONE].push_back(sk); - Node eq1 = normal_forms[i][index].eqNode( isRev ? mkConcat(sk, normal_forms[j][index]) : mkConcat(normal_forms[j][index], sk) ); - Node eq2 = normal_forms[j][index].eqNode( isRev ? mkConcat(sk, normal_forms[i][index]) : mkConcat(normal_forms[i][index], sk) ); + Node eq1 = + nfiv[index].eqNode(isRev ? mkConcat(sk, nfjv[index]) + : mkConcat(nfjv[index], sk)); + Node eq2 = + nfjv[index].eqNode(isRev ? mkConcat(sk, nfiv[index]) + : mkConcat(nfiv[index], sk)); if( lentTestSuccess!=-1 ){ info.d_antn.push_back( lentTestExp ); @@ -3297,15 +3386,26 @@ void TheoryStrings::processSimpleNEq( std::vector< std::vector< Node > > &normal }while( success ); } -bool TheoryStrings::detectLoop( std::vector< std::vector< Node > > &normal_forms, int i, int j, int index, int &loop_in_i, int &loop_in_j, unsigned rproc ){ +bool TheoryStrings::detectLoop(NormalForm& nfi, + NormalForm& nfj, + int index, + int& loop_in_i, + int& loop_in_j, + unsigned rproc) +{ int has_loop[2] = { -1, -1 }; if( options::stringLB() != 2 ) { for( unsigned r=0; r<2; r++ ) { - int n_index = (r==0 ? i : j); - int other_n_index = (r==0 ? j : i); - if( normal_forms[other_n_index][index].getKind() != kind::CONST_STRING ) { - for( unsigned lp = index+1; lp<normal_forms[n_index].size()-rproc; lp++ ){ - if( normal_forms[n_index][lp]==normal_forms[other_n_index][index] ){ + NormalForm& nf = r == 0 ? nfi : nfj; + NormalForm& nfo = r == 0 ? nfj : nfi; + std::vector<Node>& nfv = nf.d_nf; + std::vector<Node>& nfov = nfo.d_nf; + if (!nfov[index].isConst()) + { + for (unsigned lp = index + 1; lp < nfv.size() - rproc; lp++) + { + if (nfv[lp] == nfov[index]) + { has_loop[r] = lp; break; } @@ -3324,16 +3424,11 @@ bool TheoryStrings::detectLoop( std::vector< std::vector< Node > > &normal_forms } //xs(zy)=t(yz)xr -TheoryStrings::ProcessLoopResult TheoryStrings::processLoop( - const std::vector<std::vector<Node> >& normal_forms, - const std::vector<Node>& normal_form_src, - int i, - int j, - int loop_n_index, - int other_n_index, - int loop_index, - int index, - InferInfo& info) +TheoryStrings::ProcessLoopResult TheoryStrings::processLoop(NormalForm& nfi, + NormalForm& nfj, + int loop_index, + int index, + InferInfo& info) { if (options::stringProcessLoopMode() == ProcessLoopMode::ABORT) { @@ -3347,18 +3442,17 @@ TheoryStrings::ProcessLoopResult TheoryStrings::processLoop( NodeManager* nm = NodeManager::currentNM(); Node conc; - Trace("strings-loop") << "Detected possible loop for " - << normal_forms[loop_n_index][loop_index] << std::endl; - Trace("strings-loop") << " ... (X)= " << normal_forms[other_n_index][index] - << std::endl; + const std::vector<Node>& veci = nfi.d_nf; + const std::vector<Node>& vecoi = nfj.d_nf; + Trace("strings-loop") << "Detected possible loop for " << veci[loop_index] + << std::endl; + Trace("strings-loop") << " ... (X)= " << vecoi[index] << std::endl; Trace("strings-loop") << " ... T(Y.Z)= "; - const std::vector<Node>& veci = normal_forms[loop_n_index]; std::vector<Node> vec_t(veci.begin() + index, veci.begin() + loop_index); Node t_yz = mkConcat(vec_t); Trace("strings-loop") << " (" << t_yz << ")" << std::endl; Trace("strings-loop") << " ... S(Z.Y)= "; - const std::vector<Node>& vecoi = normal_forms[other_n_index]; std::vector<Node> vec_s(vecoi.begin() + index + 1, vecoi.end()); Node s_zy = mkConcat(vec_s); Trace("strings-loop") << s_zy << std::endl; @@ -3395,7 +3489,7 @@ TheoryStrings::ProcessLoopResult TheoryStrings::processLoop( Node split_eq; for (unsigned r = 0; r < 2; r++) { - Node t = r == 0 ? normal_forms[loop_n_index][loop_index] : t_yz; + Node t = r == 0 ? veci[loop_index] : t_yz; split_eq = t.eqNode(d_emptyString); Node split_eqr = Rewriter::rewrite(split_eq); // the equality could rewrite to false @@ -3428,16 +3522,14 @@ TheoryStrings::ProcessLoopResult TheoryStrings::processLoop( && s_zy.getConst<String>().isRepeated()) { Node rep_c = nm->mkConst(s_zy.getConst<String>().substr(0, 1)); - Trace("strings-loop") << "Special case (X)=" - << normal_forms[other_n_index][index] << " " + Trace("strings-loop") << "Special case (X)=" << vecoi[index] << " " << std::endl; Trace("strings-loop") << "... (C)=" << rep_c << " " << std::endl; // special case - str_in_re = - nm->mkNode(kind::STRING_IN_REGEXP, - normal_forms[other_n_index][index], - nm->mkNode(kind::REGEXP_STAR, - nm->mkNode(kind::STRING_TO_REGEXP, rep_c))); + str_in_re = nm->mkNode( + STRING_IN_REGEXP, + vecoi[index], + nm->mkNode(REGEXP_STAR, nm->mkNode(STRING_TO_REGEXP, rep_c))); conc = str_in_re; } else if (t_yz.isConst()) @@ -3470,14 +3562,13 @@ TheoryStrings::ProcessLoopResult TheoryStrings::processLoop( continue; } Node conc2 = nm->mkNode( - kind::STRING_IN_REGEXP, - normal_forms[other_n_index][index], - nm->mkNode(kind::REGEXP_CONCAT, - nm->mkNode(kind::STRING_TO_REGEXP, y), - nm->mkNode(kind::REGEXP_STAR, - nm->mkNode(kind::STRING_TO_REGEXP, restr)))); + STRING_IN_REGEXP, + vecoi[index], + nm->mkNode( + REGEXP_CONCAT, + nm->mkNode(STRING_TO_REGEXP, y), + nm->mkNode(REGEXP_STAR, nm->mkNode(STRING_TO_REGEXP, restr)))); cc = cc == d_true ? conc2 : nm->mkNode(kind::AND, cc, conc2); - d_regexp_ant[conc2] = ant; vconc.push_back(cc); } conc = vconc.size() == 0 ? Node::null() : vconc.size() == 1 @@ -3509,8 +3600,7 @@ TheoryStrings::ProcessLoopResult TheoryStrings::processLoop( vec_r.insert(vec_r.begin(), sk_y); vec_r.insert(vec_r.begin(), sk_z); Node conc2 = s_zy.eqNode(mkConcat(vec_r)); - Node conc3 = - normal_forms[other_n_index][index].eqNode(mkConcat(sk_y, sk_w)); + Node conc3 = vecoi[index].eqNode(mkConcat(sk_y, sk_w)); Node restr = r == d_emptyString ? s_zy : mkConcat(sk_z, sk_y); str_in_re = nm->mkNode(kind::STRING_IN_REGEXP, @@ -3527,27 +3617,25 @@ TheoryStrings::ProcessLoopResult TheoryStrings::processLoop( conc = nm->mkNode(kind::AND, vec_conc); } // normal case - // set its antecedant to ant, to say when it is relevant - if (!str_in_re.isNull()) - { - d_regexp_ant[str_in_re] = ant; - } // we will be done info.d_conc = conc; info.d_id = INFER_FLOOP; - info.d_nf_pair[0] = normal_form_src[i]; - info.d_nf_pair[1] = normal_form_src[j]; + info.d_nf_pair[0] = nfi.d_base; + info.d_nf_pair[1] = nfj.d_base; return ProcessLoopResult::INFERENCE; } //return true for lemma, false if we succeed void TheoryStrings::processDeq( Node ni, Node nj ) { //Assert( areDisequal( ni, nj ) ); - if( d_normal_forms[ni].size()>1 || d_normal_forms[nj].size()>1 ){ + NormalForm& nfni = getNormalForm(ni); + NormalForm& nfnj = getNormalForm(nj); + if (nfni.d_nf.size() > 1 || nfnj.d_nf.size() > 1) + { std::vector< Node > nfi; - nfi.insert( nfi.end(), d_normal_forms[ni].begin(), d_normal_forms[ni].end() ); + nfi.insert(nfi.end(), nfni.d_nf.begin(), nfni.d_nf.end()); std::vector< Node > nfj; - nfj.insert( nfj.end(), d_normal_forms[nj].begin(), d_normal_forms[nj].end() ); + nfj.insert(nfj.end(), nfnj.d_nf.begin(), nfnj.d_nf.end()); int revRet = processReverseDeq( nfi, nfj, ni, nj ); if( revRet!=0 ){ @@ -3555,9 +3643,9 @@ void TheoryStrings::processDeq( Node ni, Node nj ) { } nfi.clear(); - nfi.insert( nfi.end(), d_normal_forms[ni].begin(), d_normal_forms[ni].end() ); + nfi.insert(nfi.end(), nfni.d_nf.begin(), nfni.d_nf.end()); nfj.clear(); - nfj.insert( nfj.end(), d_normal_forms[nj].begin(), d_normal_forms[nj].end() ); + nfj.insert(nfj.end(), nfnj.d_nf.begin(), nfnj.d_nf.end()); unsigned index = 0; while( index<nfi.size() || index<nfj.size() ){ @@ -3612,8 +3700,10 @@ void TheoryStrings::processDeq( Node ni, Node nj ) { eq1 = Rewriter::rewrite( eq1 ); Node eq2 = nconst_k.eqNode( NodeManager::currentNM()->mkNode( kind::STRING_CONCAT, firstChar, skr ) ); std::vector< Node > antec; - antec.insert( antec.end(), d_normal_forms_exp[ni].begin(), d_normal_forms_exp[ni].end() ); - antec.insert( antec.end(), d_normal_forms_exp[nj].begin(), d_normal_forms_exp[nj].end() ); + antec.insert( + antec.end(), nfni.d_exp.begin(), nfni.d_exp.end()); + antec.insert( + antec.end(), nfnj.d_exp.begin(), nfnj.d_exp.end()); antec.push_back( nconst_k.eqNode( d_emptyString ).negate() ); sendInference( antec, NodeManager::currentNM()->mkNode( kind::OR, NodeManager::currentNM()->mkNode( kind::AND, eq1, sk.eqNode( firstChar ).negate() ), eq2 ), "D-DISL-CSplit" ); @@ -3626,8 +3716,8 @@ void TheoryStrings::processDeq( Node ni, Node nj ) { //must add lemma std::vector< Node > antec; std::vector< Node > antec_new_lits; - antec.insert( antec.end(), d_normal_forms_exp[ni].begin(), d_normal_forms_exp[ni].end() ); - antec.insert( antec.end(), d_normal_forms_exp[nj].begin(), d_normal_forms_exp[nj].end() ); + antec.insert(antec.end(), nfni.d_exp.begin(), nfni.d_exp.end()); + antec.insert(antec.end(), nfnj.d_exp.begin(), nfnj.d_exp.end()); //check disequal if( areDisequal( ni, nj ) ){ antec.push_back( ni.eqNode( nj ).negate() ); @@ -3714,16 +3804,18 @@ int TheoryStrings::processSimpleDeq( std::vector< Node >& nfi, std::vector< Node } } } + NormalForm& nfni = getNormalForm(ni); + NormalForm& nfnj = getNormalForm(nj); while( index<nfi.size() || index<nfj.size() ) { if( index>=nfi.size() || index>=nfj.size() ){ Trace("strings-solve-debug") << "Disequality normalize empty" << std::endl; std::vector< Node > ant; //we have a conflict : because the lengths are equal, the remainder needs to be empty, which will lead to a conflict - Node lni = getLengthExp( ni, ant, d_normal_forms_base[ni] ); - Node lnj = getLengthExp( nj, ant, d_normal_forms_base[nj] ); + Node lni = getLengthExp(ni, ant, nfni.d_base); + Node lnj = getLengthExp(nj, ant, nfnj.d_base); ant.push_back( lni.eqNode( lnj ) ); - ant.insert( ant.end(), d_normal_forms_exp[ni].begin(), d_normal_forms_exp[ni].end() ); - ant.insert( ant.end(), d_normal_forms_exp[nj].begin(), d_normal_forms_exp[nj].end() ); + ant.insert(ant.end(), nfni.d_exp.begin(), nfni.d_exp.end()); + ant.insert(ant.end(), nfnj.d_exp.begin(), nfnj.d_exp.end()); std::vector< Node > cc; std::vector< Node >& nfk = index>=nfi.size() ? nfj : nfi; for( unsigned index_k=index; index_k<nfk.size(); index_k++ ){ @@ -3924,36 +4016,24 @@ void TheoryStrings::registerTerm( Node n, int effort ) { Trace("strings-assert") << "(assert " << lem << ")" << std::endl; d_out->lemma(lem); } - else if (n.getKind() == STRING_STRIDOF) - { - Node lower = n[2]; - if (!TheoryStringsRewriter::checkEntailArith(lower)) { - lower = d_zero; - } - Node neg = Rewriter::rewrite(nm->mkNode(EQUAL, n, d_neg_one)); - Node geq = Rewriter::rewrite(nm->mkNode(GEQ, n, lower)); - Node lem = nm->mkNode(OR, neg, geq); - Trace("strings-lemma") << "Strings::Lemma STRIDOF : " << lem << std::endl; - Trace("strings-assert") << "(assert " << lem << ")" << std::endl; - //d_out->lemma(lem); - //d_out->requirePhase(neg, true); - - lem = Rewriter::rewrite(nm->mkNode(GT, nm->mkNode(STRING_LENGTH, n[0]), n)); - d_out->lemma(lem); - } } -void TheoryStrings::sendInternalInference(std::vector<Node>& exp, +bool TheoryStrings::sendInternalInference(std::vector<Node>& exp, Node conc, const char* c) { - if (conc.getKind() == AND) + if (conc.getKind() == AND + || (conc.getKind() == NOT && conc[0].getKind() == OR)) { - for (const Node& cc : conc) + Node conj = conc.getKind() == AND ? conc : conc[0]; + bool pol = conc.getKind() == AND; + bool ret = true; + for (const Node& cc : conj) { - sendInternalInference(exp, cc, c); + bool retc = sendInternalInference(exp, pol ? cc : cc.negate(), c); + ret = ret && retc; } - return; + return ret; } bool pol = conc.getKind() != NOT; Node lit = pol ? conc : conc[0]; @@ -3964,13 +4044,13 @@ void TheoryStrings::sendInternalInference(std::vector<Node>& exp, if (!lit[i].isConst() && !hasTerm(lit[i])) { // introduces a new non-constant term, do not infer - return; + return false; } } // does it already hold? if (pol ? areEqual(lit[0], lit[1]) : areDisequal(lit[0], lit[1])) { - return; + return true; } } else if (lit.isConst()) @@ -3979,20 +4059,21 @@ void TheoryStrings::sendInternalInference(std::vector<Node>& exp, { Assert(pol); // trivially holds - return; + return true; } } else if (!hasTerm(lit)) { // introduces a new non-constant term, do not infer - return; + return false; } else if (areEqual(lit, pol ? d_true : d_false)) { // already holds - return; + return true; } sendInference(exp, conc, c); + return true; } void TheoryStrings::sendInference( std::vector< Node >& exp, std::vector< Node >& exp_n, Node eq, const char * c, bool asLemma ) { @@ -4334,18 +4415,6 @@ Node TheoryStrings::mkAnd( std::vector< Node >& a ) { } } -void TheoryStrings::getConcatVec( Node n, std::vector< Node >& c ) { - if( n.getKind()==kind::STRING_CONCAT ) { - for( unsigned i=0; i<n.getNumChildren(); i++ ) { - if( !areEqual( n[i], d_emptyString ) ) { - c.push_back( n[i] ); - } - } - }else{ - c.push_back( n ); - } -} - void TheoryStrings::checkNormalFormsDeq() { std::vector< std::vector< Node > > cols; @@ -4380,20 +4449,28 @@ void TheoryStrings::checkNormalFormsDeq() separateByLength( d_strings_eqc, cols, lts ); for( unsigned i=0; i<cols.size(); i++ ){ if( cols[i].size()>1 && d_lemma_cache.empty() ){ - Trace("strings-solve") << "- Verify disequalities are processed for " << cols[i][0] << ", normal form : "; - printConcat( d_normal_forms[cols[i][0]], "strings-solve" ); - Trace("strings-solve") << "... #eql = " << cols[i].size() << std::endl; + if (Trace.isOn("strings-solve")) + { + Trace("strings-solve") << "- Verify disequalities are processed for " + << cols[i][0] << ", normal form : "; + printConcat(getNormalForm(cols[i][0]).d_nf, "strings-solve"); + Trace("strings-solve") + << "... #eql = " << cols[i].size() << std::endl; + } //must ensure that normal forms are disequal for( unsigned j=0; j<cols[i].size(); j++ ){ for( unsigned k=(j+1); k<cols[i].size(); k++ ){ //for strings that are disequal, but have the same length if( areDisequal( cols[i][j], cols[i][k] ) ){ Assert( !d_conflict ); - Trace("strings-solve") << "- Compare " << cols[i][j] << " "; - printConcat( d_normal_forms[cols[i][j]], "strings-solve" ); - Trace("strings-solve") << " against " << cols[i][k] << " "; - printConcat( d_normal_forms[cols[i][k]], "strings-solve" ); - Trace("strings-solve") << "..." << std::endl; + if (Trace.isOn("strings-solve")) + { + Trace("strings-solve") << "- Compare " << cols[i][j] << " "; + printConcat(getNormalForm(cols[i][j]).d_nf, "strings-solve"); + Trace("strings-solve") << " against " << cols[i][k] << " "; + printConcat(getNormalForm(cols[i][k]).d_nf, "strings-solve"); + Trace("strings-solve") << "..." << std::endl; + } processDeq( cols[i][j], cols[i][k] ); if( hasProcessed() ){ return; @@ -4409,7 +4486,7 @@ void TheoryStrings::checkNormalFormsDeq() void TheoryStrings::checkLengthsEqc() { if( options::stringLenNorm() ){ for( unsigned i=0; i<d_strings_eqc.size(); i++ ){ - //if( d_normal_forms[nodes[i]].size()>1 ) { + NormalForm& nfi = getNormalForm(d_strings_eqc[i]); Trace("strings-process-debug") << "Process length constraints for " << d_strings_eqc[i] << std::endl; //check if there is a length term for this equivalence class EqcInfo* ei = getOrMakeEqcInfo( d_strings_eqc[i], false ); @@ -4418,19 +4495,22 @@ void TheoryStrings::checkLengthsEqc() { Node llt = NodeManager::currentNM()->mkNode( kind::STRING_LENGTH, lt ); //now, check if length normalization has occurred if( ei->d_normalized_length.get().isNull() ) { - Node nf = mkConcat( d_normal_forms[d_strings_eqc[i]] ); + Node nf = mkConcat(nfi.d_nf); if( Trace.isOn("strings-process-debug") ){ - Trace("strings-process-debug") << " normal form is " << nf << " from base " << d_normal_forms_base[d_strings_eqc[i]] << std::endl; + Trace("strings-process-debug") + << " normal form is " << nf << " from base " << nfi.d_base + << std::endl; Trace("strings-process-debug") << " normal form exp is: " << std::endl; - for( unsigned j=0; j<d_normal_forms_exp[d_strings_eqc[i]].size(); j++ ){ - Trace("strings-process-debug") << " " << d_normal_forms_exp[d_strings_eqc[i]][j] << std::endl; + for (const Node& exp : nfi.d_exp) + { + Trace("strings-process-debug") << " " << exp << std::endl; } } //if not, add the lemma std::vector< Node > ant; - ant.insert( ant.end(), d_normal_forms_exp[d_strings_eqc[i]].begin(), d_normal_forms_exp[d_strings_eqc[i]].end() ); - ant.push_back( d_normal_forms_base[d_strings_eqc[i]].eqNode( lt ) ); + ant.insert(ant.end(), nfi.d_exp.begin(), nfi.d_exp.end()); + ant.push_back(nfi.d_base.eqNode(lt)); Node lc = NodeManager::currentNM()->mkNode( kind::STRING_LENGTH, nf ); Node lcr = Rewriter::rewrite( lc ); Trace("strings-process-debug") << "Rewrote length " << lc << " to " << lcr << std::endl; @@ -4443,7 +4523,7 @@ void TheoryStrings::checkLengthsEqc() { }else{ Trace("strings-process-debug") << "No length term for eqc " << d_strings_eqc[i] << " " << d_eqc_to_len_term[d_strings_eqc[i]] << std::endl; if( !options::stringEagerLen() ){ - Node c = mkConcat( d_normal_forms[d_strings_eqc[i]] ); + Node c = mkConcat(nfi.d_nf); registerTerm( c, 3 ); /* if( !c.isConst() ){ @@ -4712,525 +4792,6 @@ TheoryStrings::Statistics::~Statistics(){ smtStatisticsRegistry()->unregisterStat(&d_loop_lemmas); } - - - - - - - - - - - - - - - - - - - -//// Regular Expressions - - -unsigned TheoryStrings::getNumMemberships( Node n, bool isPos ) { - if( isPos ){ - NodeIntMap::const_iterator it = d_pos_memberships.find( n ); - if( it!=d_pos_memberships.end() ){ - return (*it).second; - } - }else{ - NodeIntMap::const_iterator it = d_neg_memberships.find( n ); - if( it!=d_neg_memberships.end() ){ - return (*it).second; - } - } - return 0; -} - -Node TheoryStrings::getMembership( Node n, bool isPos, unsigned i ) { - return isPos ? d_pos_memberships_data[n][i] : d_neg_memberships_data[n][i]; -} - -Node TheoryStrings::mkRegExpAntec(Node atom, Node ant) { - if(d_regexp_ant.find(atom) == d_regexp_ant.end()) { - return NodeManager::currentNM()->mkNode(kind::AND, ant, atom); - } else { - Node n = d_regexp_ant[atom]; - return NodeManager::currentNM()->mkNode(kind::AND, ant, n); - } -} - -void TheoryStrings::checkMemberships() { - //add the memberships - std::vector<Node> mems = getExtTheory()->getActive(kind::STRING_IN_REGEXP); - for (unsigned i = 0; i < mems.size(); i++) { - Node n = mems[i]; - Assert( d_extf_info_tmp.find( n )!=d_extf_info_tmp.end() ); - if (!d_extf_info_tmp[n].d_const.isNull()) - { - bool pol = d_extf_info_tmp[n].d_const.getConst<bool>(); - Trace("strings-process-debug") << " add membership : " << n << ", pol = " << pol << std::endl; - addMembership( pol ? n : n.negate() ); - }else{ - Trace("strings-process-debug") << " irrelevant (non-asserted) membership : " << n << std::endl; - } - } - - bool addedLemma = false; - bool changed = false; - std::vector< Node > processed; - std::vector< Node > cprocessed; - - Trace("regexp-debug") << "Checking Memberships ... " << std::endl; - //if(options::stringEIT()) { - //TODO: Opt for normal forms - for( NodeIntMap::const_iterator itr_xr = d_pos_memberships.begin(); itr_xr != d_pos_memberships.end(); ++itr_xr ){ - bool spflag = false; - Node x = (*itr_xr).first; - Trace("regexp-debug") << "Checking Memberships for " << x << std::endl; - if(d_inter_index.find(x) == d_inter_index.end()) { - d_inter_index[x] = 0; - } - int cur_inter_idx = d_inter_index[x]; - unsigned n_pmem = (*itr_xr).second; - Assert( getNumMemberships( x, true )==n_pmem ); - if( cur_inter_idx != (int)n_pmem ) { - if( n_pmem == 1) { - d_inter_cache[x] = getMembership( x, true, 0 ); - d_inter_index[x] = 1; - Trace("regexp-debug") << "... only one choice " << std::endl; - } else if(n_pmem > 1) { - Node r; - if(d_inter_cache.find(x) != d_inter_cache.end()) { - r = d_inter_cache[x]; - } - if(r.isNull()) { - r = getMembership( x, true, 0 ); - cur_inter_idx = 1; - } - - unsigned k_start = cur_inter_idx; - Trace("regexp-debug") << "... staring from : " << cur_inter_idx << ", we have " << n_pmem << std::endl; - for(unsigned k = k_start; k<n_pmem; k++) { - Node r2 = getMembership( x, true, k ); - r = d_regexp_opr.intersect(r, r2, spflag); - if(spflag) { - break; - } else if(r == d_emptyRegexp) { - std::vector< Node > vec_nodes; - for( unsigned kk=0; kk<=k; kk++ ){ - Node rr = getMembership( x, true, kk ); - Node n = NodeManager::currentNM()->mkNode(kind::STRING_IN_REGEXP, x, rr); - vec_nodes.push_back( n ); - } - Node conc; - sendInference(vec_nodes, conc, "INTERSECT CONFLICT", true); - addedLemma = true; - break; - } - if(d_conflict) { - break; - } - } - //updates - if(!d_conflict && !spflag) { - d_inter_cache[x] = r; - d_inter_index[x] = (int)n_pmem; - } - } - } - } - //} - - Trace("regexp-debug") << "... No Intersect Conflict in Memberships, addedLemma: " << addedLemma << std::endl; - if(!addedLemma) { - NodeManager* nm = NodeManager::currentNM(); - for( unsigned i=0; i<d_regexp_memberships.size(); i++ ) { - //check regular expression membership - Node assertion = d_regexp_memberships[i]; - Trace("regexp-debug") << "Check : " << assertion << " " << (d_regexp_ucached.find(assertion) == d_regexp_ucached.end()) << " " << (d_regexp_ccached.find(assertion) == d_regexp_ccached.end()) << std::endl; - if( d_regexp_ucached.find(assertion) == d_regexp_ucached.end() - && d_regexp_ccached.find(assertion) == d_regexp_ccached.end() ) { - Trace("strings-regexp") << "We have regular expression assertion : " << assertion << std::endl; - Node atom = assertion.getKind()==kind::NOT ? assertion[0] : assertion; - bool polarity = assertion.getKind()!=kind::NOT; - bool flag = true; - Node x = atom[0]; - Node r = atom[1]; - std::vector< Node > rnfexp; - - if (!x.isConst()) - { - x = getNormalString(x, rnfexp); - changed = true; - } - if (!d_regexp_opr.checkConstRegExp(r)) - { - r = getNormalSymRegExp(r, rnfexp); - changed = true; - } - Trace("strings-regexp-nf") << "Term " << atom << " is normalized to " - << x << " IN " << r << std::endl; - if (changed) - { - Node tmp = - Rewriter::rewrite(nm->mkNode(kind::STRING_IN_REGEXP, x, r)); - if (!polarity) - { - tmp = tmp.negate(); - } - if (tmp == d_true) - { - d_regexp_ccached.insert(assertion); - continue; - } - else if (tmp == d_false) - { - Node antec = mkRegExpAntec(assertion, mkExplain(rnfexp)); - Node conc = Node::null(); - sendLemma(antec, conc, "REGEXP NF Conflict"); - addedLemma = true; - break; - } - } - - if( polarity ) { - flag = checkPDerivative(x, r, atom, addedLemma, rnfexp); - } else { - if(! options::stringExp()) { - throw LogicException("Strings Incomplete (due to Negative Membership) by default, try --strings-exp option."); - } - } - if(flag) { - //check if the term is atomic - Node xr = getRepresentative( x ); - //Trace("strings-regexp") << xr << " is rep of " << x << std::endl; - //Assert( d_normal_forms.find( xr )!=d_normal_forms.end() ); - Trace("strings-regexp") - << "Unroll/simplify membership of atomic term " << xr - << std::endl; - // if so, do simple unrolling - std::vector<Node> nvec; - - if (nvec.empty()) - { - d_regexp_opr.simplify(atom, nvec, polarity); - } - Node antec = assertion; - if (d_regexp_ant.find(assertion) != d_regexp_ant.end()) - { - antec = d_regexp_ant[assertion]; - for (std::vector<Node>::const_iterator itr = nvec.begin(); - itr < nvec.end(); - itr++) - { - if (itr->getKind() == kind::STRING_IN_REGEXP) - { - if (d_regexp_ant.find(*itr) == d_regexp_ant.end()) - { - d_regexp_ant[*itr] = antec; - } - } - } - } - antec = NodeManager::currentNM()->mkNode( - kind::AND, antec, mkExplain(rnfexp)); - Node conc = nvec.size() == 1 - ? nvec[0] - : NodeManager::currentNM()->mkNode(kind::AND, nvec); - conc = Rewriter::rewrite(conc); - sendLemma(antec, conc, "REGEXP_Unfold"); - addedLemma = true; - if (changed) - { - cprocessed.push_back(assertion); - } - else - { - processed.push_back(assertion); - } - // d_regexp_ucached[assertion] = true; - } - } - if(d_conflict) { - break; - } - } - } - if( addedLemma ) { - if( !d_conflict ){ - for( unsigned i=0; i<processed.size(); i++ ) { - Trace("strings-regexp") << "...add " << processed[i] << " to u-cache." << std::endl; - d_regexp_ucached.insert(processed[i]); - } - for( unsigned i=0; i<cprocessed.size(); i++ ) { - Trace("strings-regexp") << "...add " << cprocessed[i] << " to c-cache." << std::endl; - d_regexp_ccached.insert(cprocessed[i]); - } - } - } -} - -bool TheoryStrings::checkPDerivative( Node x, Node r, Node atom, bool &addedLemma, std::vector< Node > &nf_exp ) { - - Node antnf = mkExplain(nf_exp); - - if(areEqual(x, d_emptyString)) { - Node exp; - switch(d_regexp_opr.delta(r, exp)) { - case 0: { - Node antec = mkRegExpAntec(atom, x.eqNode(d_emptyString)); - antec = NodeManager::currentNM()->mkNode(kind::AND, antec, antnf); - sendLemma(antec, exp, "RegExp Delta"); - addedLemma = true; - d_regexp_ccached.insert(atom); - return false; - } - case 1: { - d_regexp_ccached.insert(atom); - break; - } - case 2: { - Node antec = mkRegExpAntec(atom, x.eqNode(d_emptyString)); - antec = NodeManager::currentNM()->mkNode(kind::AND, antec, antnf); - Node conc = Node::null(); - sendLemma(antec, conc, "RegExp Delta CONFLICT"); - addedLemma = true; - d_regexp_ccached.insert(atom); - return false; - } - default: - //Impossible - break; - } - } else { - /*Node xr = getRepresentative( x ); - if(x != xr) { - Node n = NodeManager::currentNM()->mkNode(kind::STRING_IN_REGEXP, xr, r); - Node nn = Rewriter::rewrite( n ); - if(nn == d_true) { - d_regexp_ccached.insert(atom); - return false; - } else if(nn == d_false) { - Node antec = mkRegExpAntec(atom, x.eqNode(xr)); - Node conc = Node::null(); - sendLemma(antec, conc, "RegExp Delta CONFLICT"); - addedLemma = true; - d_regexp_ccached.insert(atom); - return false; - } - }*/ - Node sREant = mkRegExpAntec(atom, d_true); - sREant = NodeManager::currentNM()->mkNode(kind::AND, sREant, antnf); - if(deriveRegExp( x, r, sREant )) { - addedLemma = true; - d_regexp_ccached.insert(atom); - return false; - } - } - return true; -} - -CVC4::String TheoryStrings::getHeadConst( Node x ) { - if( x.isConst() ) { - return x.getConst< String >(); - } else if( x.getKind() == kind::STRING_CONCAT ) { - if( x[0].isConst() ) { - return x[0].getConst< String >(); - } else { - return d_emptyString.getConst< String >(); - } - } else { - return d_emptyString.getConst< String >(); - } -} - -bool TheoryStrings::deriveRegExp( Node x, Node r, Node ant ) { - // TODO cstr in vre - Assert(x != d_emptyString); - Trace("regexp-derive") << "TheoryStrings::deriveRegExp: x=" << x << ", r= " << r << std::endl; - //if(x.isConst()) { - // Node n = NodeManager::currentNM()->mkNode( kind::STRING_IN_REGEXP, x, r ); - // Node r = Rewriter::rewrite( n ); - // if(n != r) { - // sendLemma(ant, r, "REGEXP REWRITE"); - // return true; - // } - //} - CVC4::String s = getHeadConst( x ); - if( !s.isEmptyString() && d_regexp_opr.checkConstRegExp( r ) ) { - Node conc = Node::null(); - Node dc = r; - bool flag = true; - for(unsigned i=0; i<s.size(); ++i) { - CVC4::String c = s.substr(i, 1); - Node dc2; - int rt = d_regexp_opr.derivativeS(dc, c, dc2); - dc = dc2; - if(rt == 0) { - //TODO - } else if(rt == 2) { - // CONFLICT - flag = false; - break; - } - } - // send lemma - if(flag) { - if(x.isConst()) { - Assert(false, "Impossible: TheoryStrings::deriveRegExp: const string in const regular expression."); - return false; - } else { - Assert( x.getKind() == kind::STRING_CONCAT ); - std::vector< Node > vec_nodes; - for(unsigned int i=1; i<x.getNumChildren(); ++i ) { - vec_nodes.push_back( x[i] ); - } - Node left = mkConcat( vec_nodes ); - left = Rewriter::rewrite( left ); - conc = NodeManager::currentNM()->mkNode( kind::STRING_IN_REGEXP, left, dc ); - - /*std::vector< Node > sdc; - d_regexp_opr.simplify(conc, sdc, true); - if(sdc.size() == 1) { - conc = sdc[0]; - } else { - conc = Rewriter::rewrite(NodeManager::currentNM()->mkNode(kind::AND, conc)); - }*/ - } - } - sendLemma(ant, conc, "RegExp-Derive"); - return true; - } else { - return false; - } -} - -void TheoryStrings::addMembership(Node assertion) { - bool polarity = assertion.getKind() != kind::NOT; - TNode atom = polarity ? assertion : assertion[0]; - Node x = atom[0]; - Node r = atom[1]; - if(polarity) { - int index = 0; - NodeIntMap::const_iterator it = d_pos_memberships.find( x ); - if( it!=d_nf_pairs.end() ){ - index = (*it).second; - for( int k=0; k<index; k++ ){ - if( k<(int)d_pos_memberships_data[x].size() ){ - if( d_pos_memberships_data[x][k]==r ){ - return; - } - }else{ - break; - } - } - } - d_pos_memberships[x] = index + 1; - if( index<(int)d_pos_memberships_data[x].size() ){ - d_pos_memberships_data[x][index] = r; - }else{ - d_pos_memberships_data[x].push_back( r ); - } - } else if(!options::stringIgnNegMembership()) { - /*if(options::stringEIT() && d_regexp_opr.checkConstRegExp(r)) { - int rt; - Node r2 = d_regexp_opr.complement(r, rt); - Node a = NodeManager::currentNM()->mkNode(kind::STRING_IN_REGEXP, x, r2); - }*/ - int index = 0; - NodeIntMap::const_iterator it = d_neg_memberships.find( x ); - if( it!=d_nf_pairs.end() ){ - index = (*it).second; - for( int k=0; k<index; k++ ){ - if( k<(int)d_neg_memberships_data[x].size() ){ - if( d_neg_memberships_data[x][k]==r ){ - return; - } - }else{ - break; - } - } - } - d_neg_memberships[x] = index + 1; - if( index<(int)d_neg_memberships_data[x].size() ){ - d_neg_memberships_data[x][index] = r; - }else{ - d_neg_memberships_data[x].push_back( r ); - } - } - // old - if(polarity || !options::stringIgnNegMembership()) { - d_regexp_memberships.push_back( assertion ); - } -} - -Node TheoryStrings::getNormalString( Node x, std::vector< Node >& nf_exp ){ - if( !x.isConst() ){ - Node xr = getRepresentative( x ); - if( d_normal_forms.find( xr ) != d_normal_forms.end() ){ - Node ret = mkConcat( d_normal_forms[xr] ); - nf_exp.insert( nf_exp.end(), d_normal_forms_exp[xr].begin(), d_normal_forms_exp[xr].end() ); - addToExplanation( x, d_normal_forms_base[xr], nf_exp ); - Trace("strings-debug") << "Term: " << x << " has a normal form " << ret << std::endl; - return ret; - } else { - if(x.getKind() == kind::STRING_CONCAT) { - std::vector< Node > vec_nodes; - for(unsigned i=0; i<x.getNumChildren(); i++) { - Node nc = getNormalString( x[i], nf_exp ); - vec_nodes.push_back( nc ); - } - return mkConcat( vec_nodes ); - } - } - } - return x; -} - -Node TheoryStrings::getNormalSymRegExp(Node r, std::vector<Node> &nf_exp) { - Node ret = r; - switch( r.getKind() ) { - case kind::REGEXP_EMPTY: - case kind::REGEXP_SIGMA: - break; - case kind::STRING_TO_REGEXP: { - if(!r[0].isConst()) { - Node tmp = getNormalString( r[0], nf_exp ); - if(tmp != r[0]) { - ret = NodeManager::currentNM()->mkNode(kind::STRING_TO_REGEXP, tmp); - } - } - break; - } - case kind::REGEXP_CONCAT: - case kind::REGEXP_UNION: - case kind::REGEXP_INTER: - case kind::REGEXP_STAR: - { - std::vector< Node > vec_nodes; - for (const Node& cr : r) - { - vec_nodes.push_back(getNormalSymRegExp(cr, nf_exp)); - } - ret = Rewriter::rewrite( - NodeManager::currentNM()->mkNode(r.getKind(), vec_nodes)); - break; - } - //case kind::REGEXP_PLUS: - //case kind::REGEXP_OPT: - //case kind::REGEXP_RANGE: - default: { - Trace("strings-error") << "Unsupported term: " << r << " in normalization SymRegExp." << std::endl; - Assert( false ); - //return Node::null(); - } - } - return ret; -} - /** run the given inference step */ void TheoryStrings::runInferStep(InferStep s, int effort) { diff --git a/src/theory/strings/theory_strings.h b/src/theory/strings/theory_strings.h index 70e75db54..8371a27ea 100644 --- a/src/theory/strings/theory_strings.h +++ b/src/theory/strings/theory_strings.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tianyi Liang, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,16 +16,18 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__STRINGS__THEORY_STRINGS_H -#define __CVC4__THEORY__STRINGS__THEORY_STRINGS_H +#ifndef CVC4__THEORY__STRINGS__THEORY_STRINGS_H +#define CVC4__THEORY__STRINGS__THEORY_STRINGS_H #include "context/cdhashset.h" #include "context/cdlist.h" #include "expr/attribute.h" #include "expr/node_trie.h" #include "theory/decision_manager.h" +#include "theory/strings/normal_form.h" #include "theory/strings/regexp_elim.h" #include "theory/strings/regexp_operation.h" +#include "theory/strings/regexp_solver.h" #include "theory/strings/skolem_cache.h" #include "theory/strings/theory_strings_preprocess.h" #include "theory/theory.h" @@ -235,27 +237,63 @@ class TheoryStrings : public Theory { } };/* class TheoryStrings::NotifyClass */ -private: + //--------------------------- equality engine + /** + * Get the representative of t in the equality engine of this class, or t + * itself if it is not registered as a term. + */ + Node getRepresentative(Node t); + /** Is t registered as a term in the equality engine of this class? */ + bool hasTerm(Node a); + /** + * Are a and b equal according to the equality engine of this class? Also + * returns true if a and b are identical. + */ + bool areEqual(Node a, Node b); + /** + * Are a and b disequal according to the equality engine of this class? Also + * returns true if the representative of a and b are distinct constants. + */ + bool areDisequal(Node a, Node b); + //--------------------------- end equality engine + + //--------------------------- helper functions + /** get length with explanation + * + * If possible, this returns an arithmetic term that exists in the current + * context that is equal to the length of te, or otherwise returns the + * length of t. It adds to exp literals that hold in the current context that + * explain why that term is equal to the length of t. For example, if + * we have assertions: + * len( x ) = 5 ^ z = x ^ x = y, + * then getLengthExp( z, exp, y ) returns len( x ) and adds { z = x } to + * exp. On the other hand, getLengthExp( z, exp, x ) returns len( x ) and + * adds nothing to exp. + */ + Node getLengthExp(Node t, std::vector<Node>& exp, Node te); + /** shorthand for getLengthExp(t, exp, t) */ + Node getLength(Node t, std::vector<Node>& exp); + /** get normal string + * + * This method returns the node that is equivalent to the normal form of x, + * and adds the corresponding explanation to nf_exp. + * + * For example, if x = y ++ z is an assertion in the current context, then + * this method returns the term y ++ z and adds x = y ++ z to nf_exp. + */ + Node getNormalString(Node x, std::vector<Node>& nf_exp); + //-------------------------- end helper functions + + private: // Constants Node d_emptyString; - Node d_emptyRegexp; Node d_true; Node d_false; Node d_zero; Node d_one; Node d_neg_one; + /** the cardinality of the alphabet */ unsigned d_card_size; - // Helper functions - Node getRepresentative( Node t ); - bool hasTerm( Node a ); - bool areEqual( Node a, Node b ); - bool areDisequal( Node a, Node b ); - bool areCareDisequal( TNode x, TNode y ); - // t is representative, te = t, add lt = te to explanation exp - Node getLengthExp( Node t, std::vector< Node >& exp, Node te ); - Node getLength( Node t, std::vector< Node >& exp ); - -private: /** The notify class */ NotifyClass d_notify; /** Equaltity engine */ @@ -270,11 +308,10 @@ private: /** inferences: maintained to ensure ref count for internally introduced nodes */ NodeList d_infer; NodeList d_infer_exp; - /** normal forms */ - std::map< Node, Node > d_normal_forms_base; - std::map< Node, std::vector< Node > > d_normal_forms; - std::map< Node, std::vector< Node > > d_normal_forms_exp; - std::map< Node, std::map< Node, std::map< bool, int > > > d_normal_forms_exp_depend; + /** map from terms to their normal forms */ + std::map<Node, NormalForm> d_normal_form; + /** get normal form */ + NormalForm& getNormalForm(Node n); //map of pairs of terms that have the same normal form NodeIntMap d_nf_pairs; std::map< Node, std::vector< Node > > d_nf_pairs_data; @@ -431,8 +468,14 @@ private: class InferInfo { public: - unsigned d_i; - unsigned d_j; + /** for debugging + * + * The base pair of strings d_i/d_j that led to the inference, and whether + * (d_rev) we were processing the normal forms of these strings in reverse + * direction. + */ + Node d_i; + Node d_j; bool d_rev; std::vector<Node> d_ant; std::vector<Node> d_antn; @@ -517,10 +560,77 @@ private: //--------------------------end for checkCycles //--------------------------for checkNormalFormsEq + /** normalize equivalence class + * + * This method attempts to build a "normal form" for the equivalence class + * of string term n (for more details on normal forms, see normal_form.h + * or see Liang et al CAV 2014). In particular, this method checks whether the + * current normal form for each term in this equivalence class is identical. + * If it is not, then we add an inference via sendInference and abort the + * call. + */ void normalizeEquivalenceClass( Node n ); - void getNormalForms( Node &eqc, std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend ); - bool detectLoop( std::vector< std::vector< Node > > &normal_forms, int i, int j, int index, int &loop_in_i, int &loop_in_j, unsigned rproc ); + /** + * For each term in the equivalence class of eqc, this adds data regarding its + * normal form to normal_forms. The map term_to_nf_index maps terms to the + * index in normal_forms where their normal form data is located. + */ + void getNormalForms(Node eqc, + std::vector<NormalForm>& normal_forms, + std::map<Node, unsigned>& term_to_nf_index); + /** process normalize equivalence class + * + * This is called when an equivalence class contains a set of terms that + * have normal forms given by the argument normal_forms. It either + * verifies that all normal forms in this vector are identical, or otherwise + * adds a conflict, lemma, or inference via the sendInference method. + * + * To prioritize one inference versus another, it builds a set of possible + * inferences, at most two for each pair of distinct normal forms, + * corresponding to processing the normal form pair in the (forward, reverse) + * directions. Once all possible inferences are recorded, it executes the + * one with highest priority based on the enumeration type Inference. + */ + void processNEqc(std::vector<NormalForm>& normal_forms); + /** process simple normal equality + * + * This method is called when two equal terms have normal forms nfi and nfj. + * It adds (typically at most one) possible inference to the vector pinfer. + * This inference is in the form of an InferInfo object, which stores the + * necessary information regarding how to process the inference. + * + * index: The index in the normal form vectors (nfi.d_nf and nfj.d_nf) that + * we are currently checking. This method will increment this index until + * it finds an index where these vectors differ, or until it reaches the + * end of these vectors. + * isRev: Whether we are processing the normal forms in reverse direction. + * Notice in this case the normal form vectors have been reversed, hence, + * many operations are identical to the forward case, e.g. index is + * incremented not decremented, while others require special care, e.g. + * constant strings "ABC" in the normal form vectors are not reversed to + * "CBA" and hence all operations should assume a flipped semantics for + * constants when isRev is true, + * rproc: the number of string components on the suffix of the normal form of + * nfi and nfj that were already processed. This is used when using + * fowards/backwards traversals of normal forms to ensure that duplicate + * inferences are not processed. + * pinfer: the set of possible inferences we add to. + */ + void processSimpleNEq(NormalForm& nfi, + NormalForm& nfj, + unsigned& index, + bool isRev, + unsigned rproc, + std::vector<InferInfo>& pinfer); + //--------------------------end for checkNormalFormsEq + + //--------------------------for checkNormalFormsEq with loops + bool detectLoop(NormalForm& nfi, + NormalForm& nfj, + int index, + int& loop_in_i, + int& loop_in_j, + unsigned rproc); /** * Result of processLoop() below. @@ -535,36 +645,17 @@ private: SKIPPED, }; - ProcessLoopResult processLoop( - const std::vector<std::vector<Node> >& normal_forms, - const std::vector<Node>& normal_form_src, - int i, - int j, - int loop_n_index, - int other_n_index, - int loop_index, - int index, - InferInfo& info); - - void processNEqc( std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend ); - void processReverseNEq( std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend, - unsigned i, unsigned j, unsigned& index, unsigned rproc, std::vector< InferInfo >& pinfer ); - void processSimpleNEq( std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend, - unsigned i, unsigned j, unsigned& index, bool isRev, unsigned rproc, std::vector< InferInfo >& pinfer ); - //--------------------------end for checkNormalFormsEq + ProcessLoopResult processLoop(NormalForm& nfi, + NormalForm& nfj, + int loop_index, + int index, + InferInfo& info); + //--------------------------end for checkNormalFormsEq with loops //--------------------------for checkNormalFormsDeq void processDeq( Node n1, Node n2 ); int processReverseDeq( std::vector< Node >& nfi, std::vector< Node >& nfj, Node ni, Node nj ); int processSimpleDeq( std::vector< Node >& nfi, std::vector< Node >& nfj, Node ni, Node nj, unsigned& index, bool isRev ); - void getExplanationVectorForPrefix( std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend, - unsigned i, int index, bool isRev, std::vector< Node >& curr_exp ); - void getExplanationVectorForPrefixEq( std::vector< std::vector< Node > > &normal_forms, std::vector< Node > &normal_form_src, - std::vector< std::vector< Node > > &normal_forms_exp, std::vector< std::map< Node, std::map< bool, int > > >& normal_forms_exp_depend, - unsigned i, unsigned j, int index_i, int index_j, bool isRev, std::vector< Node >& curr_exp ); //--------------------------end for checkNormalFormsDeq //--------------------------------for checkMemberships @@ -607,6 +698,11 @@ private: protected: /** compute care graph */ void computeCareGraph() override; + /** + * Are x and y shared terms that are not equal? This is used for constructing + * the care graph in the above function. + */ + bool areCareDisequal(TNode x, TNode y); // do pending merges void assertPendingFact(Node atom, bool polarity, Node exp); @@ -641,6 +737,7 @@ private: */ void registerTerm(Node n, int effort); //-------------------------------------send inferences + public: /** send internal inferences * * This is called when we have inferred exp => conc, where exp is a set @@ -652,21 +749,81 @@ private: * sendInference below in that it does not introduce any new non-constant * terms to the state. * - * The argument c is a string identifying the reason for the interference. + * The argument c is a string identifying the reason for the inference. * This string is used for debugging purposes. + * + * Return true if the inference is complete, in the sense that we infer + * inferences that are equivalent to conc. This returns false e.g. if conc + * (or one of its conjuncts if it is a conjunction) was not inferred due + * to the criteria mentioned above. + */ + bool sendInternalInference(std::vector<Node>& exp, Node conc, const char* c); + /** send inference + * + * This function should be called when ( exp ^ exp_n ) => eq. The set exp + * contains literals that are explainable by this class, i.e. those that + * hold in the equality engine of this class. On the other hand, the set + * exp_n ("explanations new") contain nodes that are not explainable by this + * class. This method may call sendInfer or sendLemma. Overall, the result + * of this method is one of the following: + * + * [1] (No-op) Do nothing if eq is true, + * + * [2] (Infer) Indicate that eq should be added to the equality engine of this + * class with explanation EXPLAIN(exp), where EXPLAIN returns the + * explanation of the node in exp in terms of the literals asserted to this + * class, + * + * [3] (Lemma) Indicate that the lemma ( EXPLAIN(exp) ^ exp_n ) => eq should + * be sent on the output channel of this class, or + * + * [4] (Conflict) Immediately report a conflict EXPLAIN(exp) on the output + * channel of this class. + * + * Determining which case to apply depends on the form of eq and whether + * exp_n is empty. In particular, lemmas must be used whenever exp_n is + * non-empty, conflicts are used when exp_n is empty and eq is false. + * + * The argument c is a string identifying the reason for inference, used for + * debugging. + * + * If the flag asLemma is true, then this method will send a lemma instead + * of an inference whenever applicable. */ - void sendInternalInference(std::vector<Node>& exp, Node conc, const char* c); - // send lemma void sendInference(std::vector<Node>& exp, std::vector<Node>& exp_n, Node eq, const char* c, bool asLemma = false); + /** same as above, but where exp_n is empty */ void sendInference(std::vector<Node>& exp, Node eq, const char* c, bool asLemma = false); + /** + * Are we in conflict? This returns true if this theory has called its output + * channel's conflict method in the current SAT context. + */ + bool inConflict() const { return d_conflict; } + + protected: + /** + * Indicates that ant => conc should be sent on the output channel of this + * class. This will either trigger an immediate call to the conflict + * method of the output channel of this class of conc is false, or adds the + * above lemma to the lemma cache d_lemma_cache, which may be flushed + * later within the current call to TheoryStrings::check. + * + * The argument c is a string identifying the reason for inference, used for + * debugging. + */ void sendLemma(Node ant, Node conc, const char* c); + /** + * Indicates that conc should be added to the equality engine of this class + * with explanation eq_exp. It must be the case that eq_exp is a (conjunction + * of) literals that each are explainable, i.e. they already hold in the + * equality engine of this class. + */ void sendInfer(Node eq_exp, Node eq, const char* c); bool sendSplit(Node a, Node b, const char* c, bool preq = true); //-------------------------------------end send inferences @@ -680,10 +837,10 @@ private: /** mkExplain **/ Node mkExplain(std::vector<Node>& a); Node mkExplain(std::vector<Node>& a, std::vector<Node>& an); + + protected: /** mkAnd **/ Node mkAnd(std::vector<Node>& a); - /** get concat vector */ - void getConcatVec(Node n, std::vector<Node>& c); /** get equivalence classes * @@ -711,39 +868,11 @@ private: // Symbolic Regular Expression private: - // regular expression memberships - NodeList d_regexp_memberships; - NodeSet d_regexp_ucached; - NodeSet d_regexp_ccached; - // stored assertions - NodeIntMap d_pos_memberships; - std::map< Node, std::vector< Node > > d_pos_memberships_data; - NodeIntMap d_neg_memberships; - std::map< Node, std::vector< Node > > d_neg_memberships_data; - unsigned getNumMemberships( Node n, bool isPos ); - Node getMembership( Node n, bool isPos, unsigned i ); - // semi normal forms for symbolic expression - std::map< Node, Node > d_nf_regexps; - std::map< Node, std::vector< Node > > d_nf_regexps_exp; - // intersection - NodeNodeMap d_inter_cache; - NodeIntMap d_inter_index; - // processed memberships - NodeSet d_processed_memberships; - // antecedant for why regexp membership must be true - NodeNodeMap d_regexp_ant; - /** regular expression operation module */ - RegExpOpr d_regexp_opr; + /** regular expression solver module */ + RegExpSolver d_regexp_solver; /** regular expression elimination module */ RegExpElimination d_regexp_elim; - CVC4::String getHeadConst( Node x ); - bool deriveRegExp( Node x, Node r, Node ant ); - void addMembership(Node assertion); - Node getNormalString(Node x, std::vector<Node> &nf_exp); - Node getNormalSymRegExp(Node r, std::vector<Node> &nf_exp); - - // Finite Model Finding private: NodeSet d_input_vars; @@ -1037,4 +1166,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__STRINGS__THEORY_STRINGS_H */ +#endif /* CVC4__THEORY__STRINGS__THEORY_STRINGS_H */ diff --git a/src/theory/strings/theory_strings_preprocess.cpp b/src/theory/strings/theory_strings_preprocess.cpp index d095d6801..6ceeff6f2 100644 --- a/src/theory/strings/theory_strings_preprocess.cpp +++ b/src/theory/strings/theory_strings_preprocess.cpp @@ -2,9 +2,9 @@ /*! \file theory_strings_preprocess.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tianyi Liang, Tim King + ** Andrew Reynolds, Tianyi Liang ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/strings/theory_strings_preprocess.h b/src/theory/strings/theory_strings_preprocess.h index ff0195dc1..b96d619ef 100644 --- a/src/theory/strings/theory_strings_preprocess.h +++ b/src/theory/strings/theory_strings_preprocess.h @@ -2,9 +2,9 @@ /*! \file theory_strings_preprocess.h ** \verbatim ** Top contributors (to current version): - ** Tianyi Liang, Andrew Reynolds, Morgan Deters + ** Andrew Reynolds, Tianyi Liang ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__STRINGS__PREPROCESS_H -#define __CVC4__THEORY__STRINGS__PREPROCESS_H +#ifndef CVC4__THEORY__STRINGS__PREPROCESS_H +#define CVC4__THEORY__STRINGS__PREPROCESS_H #include <vector> #include "context/cdhashmap.h" @@ -86,4 +86,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__STRINGS__PREPROCESS_H */ +#endif /* CVC4__THEORY__STRINGS__PREPROCESS_H */ diff --git a/src/theory/strings/theory_strings_rewriter.cpp b/src/theory/strings/theory_strings_rewriter.cpp index cbb298c5f..35e966b78 100644 --- a/src/theory/strings/theory_strings_rewriter.cpp +++ b/src/theory/strings/theory_strings_rewriter.cpp @@ -2,9 +2,9 @@ /*! \file theory_strings_rewriter.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Tianyi Liang, Andres Noetzli + ** Andrew Reynolds, Andres Noetzli, Tianyi Liang ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -592,6 +592,106 @@ Node TheoryStringsRewriter::rewriteStrEqualityExt(Node node) } } + if (node[0].getKind() == STRING_CONCAT && node[1].getKind() == STRING_CONCAT) + { + // (= (str.++ x_1 ... x_i x_{i + 1} ... x_n) + // (str.++ y_1 ... y_j y_{j + 1} ... y_m)) ---> + // (and (= (str.++ x_1 ... x_i) (str.++ y_1 ... y_j)) + // (= (str.++ x_{i + 1} ... x_n) (str.++ y_{j + 1} ... y_m))) + // + // if (str.len (str.++ x_1 ... x_i)) = (str.len (str.++ y_1 ... y_j)) + // + // This rewrite performs length-based equality splitting: If we can show + // that two prefixes have the same length, we can split an equality into + // two equalities, one over the prefixes and another over the suffixes. + std::vector<Node> v0, v1; + getConcat(node[0], v0); + getConcat(node[1], v1); + size_t startRhs = 0; + for (size_t i = 0, size0 = v0.size(); i <= size0; i++) + { + std::vector<Node> pfxv0(v0.begin(), v0.begin() + i); + Node pfx0 = mkConcat(STRING_CONCAT, pfxv0); + for (size_t j = startRhs, size1 = v1.size(); j <= size1; j++) + { + if (!(i == 0 && j == 0) && !(i == v0.size() && j == v1.size())) + { + std::vector<Node> pfxv1(v1.begin(), v1.begin() + j); + Node pfx1 = mkConcat(STRING_CONCAT, pfxv1); + Node lenPfx0 = nm->mkNode(STRING_LENGTH, pfx0); + Node lenPfx1 = nm->mkNode(STRING_LENGTH, pfx1); + + if (checkEntailArithEq(lenPfx0, lenPfx1)) + { + std::vector<Node> sfxv0(v0.begin() + i, v0.end()); + std::vector<Node> sfxv1(v1.begin() + j, v1.end()); + Node ret = nm->mkNode(kind::AND, + pfx0.eqNode(pfx1), + mkConcat(STRING_CONCAT, sfxv0) + .eqNode(mkConcat(STRING_CONCAT, sfxv1))); + return returnRewrite(node, ret, "split-eq"); + } + else if (checkEntailArith(lenPfx1, lenPfx0, true)) + { + // The prefix on the right-hand side is strictly longer than the + // prefix on the left-hand side, so we try to strip the right-hand + // prefix by the length of the left-hand prefix + // + // Example: + // (= (str.++ "A" x y) (str.++ x "AB" z)) ---> + // (and (= (str.++ "A" x) (str.++ x "A")) (= y (str.++ "B" z))) + std::vector<Node> rpfxv1; + if (stripSymbolicLength(pfxv1, rpfxv1, 1, lenPfx0)) + { + std::vector<Node> sfxv0(v0.begin() + i, v0.end()); + pfxv1.insert(pfxv1.end(), v1.begin() + j, v1.end()); + Node ret = + nm->mkNode(kind::AND, + pfx0.eqNode(mkConcat(STRING_CONCAT, rpfxv1)), + mkConcat(STRING_CONCAT, sfxv0) + .eqNode(mkConcat(STRING_CONCAT, pfxv1))); + return returnRewrite(node, ret, "split-eq-strip-r"); + } + + // If the prefix of the right-hand side is (strictly) longer than + // the prefix of the left-hand side, we can advance the left-hand + // side (since the length of the right-hand side is only increasing + // in the inner loop) + break; + } + else if (checkEntailArith(lenPfx0, lenPfx1, true)) + { + // The prefix on the left-hand side is strictly longer than the + // prefix on the right-hand side, so we try to strip the left-hand + // prefix by the length of the right-hand prefix + // + // Example: + // (= (str.++ x "AB" z) (str.++ "A" x y)) ---> + // (and (= (str.++ x "A") (str.++ "A" x)) (= (str.++ "B" z) y)) + std::vector<Node> rpfxv0; + if (stripSymbolicLength(pfxv0, rpfxv0, 1, lenPfx1)) + { + pfxv0.insert(pfxv0.end(), v0.begin() + i, v0.end()); + std::vector<Node> sfxv1(v1.begin() + j, v1.end()); + Node ret = + nm->mkNode(kind::AND, + mkConcat(STRING_CONCAT, rpfxv0).eqNode(pfx1), + mkConcat(STRING_CONCAT, pfxv0) + .eqNode(mkConcat(STRING_CONCAT, sfxv1))); + return returnRewrite(node, ret, "split-eq-strip-l"); + } + + // If the prefix of the left-hand side is (strictly) longer than + // the prefix of the right-hand side, then we don't need to check + // that right-hand prefix for future left-hand prefixes anymore + // (since they are increasing in length) + startRhs = j + 1; + } + } + } + } + } + return node; } @@ -599,31 +699,11 @@ Node TheoryStringsRewriter::rewriteArithEqualityExt(Node node) { Assert(node.getKind() == EQUAL && node[0].getType().isInteger()); - NodeManager* nm = NodeManager::currentNM(); - // cases where we can solve the equality - for (unsigned i = 0; i < 2; i++) - { - if (node[i].isConst()) - { - Node on = node[1 - i]; - Kind onk = on.getKind(); - if (onk == STRING_STOI) - { - Rational r = node[i].getConst<Rational>(); - int sgn = r.sgn(); - Node onEq; - std::stringstream ss; - if (sgn >= 0) - { - ss << r.getNumerator(); - } - Node new_ret = on[0].eqNode(nm->mkConst(String(ss.str()))); - return returnRewrite(node, new_ret, "stoi-solve"); - } - } - } + // notice we cannot rewrite str.to.int(x)=n to x="n" due to leading zeroes. + + NodeManager* nm = NodeManager::currentNM(); if (checkEntailArith(node[0], node[1], true) || checkEntailArith(node[1], node[0], true)) { @@ -1497,7 +1577,7 @@ RewriteResponse TheoryStringsRewriter::postRewrite(TNode node) { if(s.isNumber()) { retNode = nm->mkConst(s.toNumber()); } else { - retNode = nm->mkConst(::CVC4::Rational(-1)); + retNode = nm->mkConst(Rational(-1)); } } else if(node[0].getKind() == kind::STRING_CONCAT) { for(unsigned i=0; i<node[0].getNumChildren(); ++i) { @@ -2314,6 +2394,22 @@ Node TheoryStringsRewriter::rewriteIndexof( Node node ) { Node ret = nm->mkNode(kind::STRING_STRIDOF, nn, node[1], node[2]); return returnRewrite(node, ret, "idof-def-ctn"); } + + // Strip components from the beginning that are guaranteed not to match + if (stripConstantEndpoints(children0, children1, nb, ne, 1)) + { + // str.indexof(str.++("AB", x, "C"), "C", 0) ---> + // 2 + str.indexof(str.++(x, "C"), "C", 0) + Node ret = + nm->mkNode(kind::PLUS, + nm->mkNode(kind::STRING_LENGTH, + mkConcat(kind::STRING_CONCAT, nb)), + nm->mkNode(kind::STRING_STRIDOF, + mkConcat(kind::STRING_CONCAT, children0), + node[1], + node[2])); + return returnRewrite(node, ret, "idof-strip-cnst-endpts"); + } } // strip symbolic length @@ -3621,6 +3717,8 @@ bool TheoryStringsRewriter::stripConstantEndpoints(std::vector<Node>& n1, Assert(nb.empty()); Assert(ne.empty()); + + NodeManager* nm = NodeManager::currentNM(); bool changed = false; // for ( forwards, backwards ) direction for (unsigned r = 0; r < 2; r++) @@ -3670,6 +3768,14 @@ bool TheoryStringsRewriter::stripConstantEndpoints(std::vector<Node>& n1, // str.contains( str.++( "c", x ), str.++( "cd", y ) ) overlap = r == 0 ? s.overlap(t) : t.overlap(s); } + else + { + // if we are looking at a substring, we can remove the component + // if there is no overlap + // e.g. str.contains( str.++( str.substr( "c", i, j ), x), "a" ) + // --> str.contains( x, "a" ) + removeComponent = ((r == 0 ? s.overlap(t) : t.overlap(s)) == 0); + } } else if (sss.empty()) // only if not substr { @@ -3701,15 +3807,13 @@ bool TheoryStringsRewriter::stripConstantEndpoints(std::vector<Node>& n1, // component if (r == 0) { - nb.push_back( - NodeManager::currentNM()->mkConst(s.prefix(overlap))); - n1[index0] = NodeManager::currentNM()->mkConst(s.suffix(overlap)); + nb.push_back(nm->mkConst(s.prefix(s.size() - overlap))); + n1[index0] = nm->mkConst(s.suffix(overlap)); } else { - ne.push_back( - NodeManager::currentNM()->mkConst(s.suffix(overlap))); - n1[index0] = NodeManager::currentNM()->mkConst(s.prefix(overlap)); + ne.push_back(nm->mkConst(s.suffix(s.size() - overlap))); + n1[index0] = nm->mkConst(s.prefix(overlap)); } } } diff --git a/src/theory/strings/theory_strings_rewriter.h b/src/theory/strings/theory_strings_rewriter.h index 81bc29ad6..e8886d43b 100644 --- a/src/theory/strings/theory_strings_rewriter.h +++ b/src/theory/strings/theory_strings_rewriter.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Andres Noetzli, Tianyi Liang ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__STRINGS__THEORY_STRINGS_REWRITER_H -#define __CVC4__THEORY__STRINGS__THEORY_STRINGS_REWRITER_H +#ifndef CVC4__THEORY__STRINGS__THEORY_STRINGS_REWRITER_H +#define CVC4__THEORY__STRINGS__THEORY_STRINGS_REWRITER_H #include <utility> #include <vector> @@ -751,4 +751,4 @@ class TheoryStringsRewriter { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__STRINGS__THEORY_STRINGS_REWRITER_H */ +#endif /* CVC4__THEORY__STRINGS__THEORY_STRINGS_REWRITER_H */ diff --git a/src/theory/strings/theory_strings_type_rules.h b/src/theory/strings/theory_strings_type_rules.h index 9357a8f98..91de8ac01 100644 --- a/src/theory/strings/theory_strings_type_rules.h +++ b/src/theory/strings/theory_strings_type_rules.h @@ -2,9 +2,9 @@ /*! \file theory_strings_type_rules.h ** \verbatim ** Top contributors (to current version): - ** Tianyi Liang, Tim King, Andrew Reynolds + ** Tianyi Liang, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" #include "options/strings_options.h" -#ifndef __CVC4__THEORY__STRINGS__THEORY_STRINGS_TYPE_RULES_H -#define __CVC4__THEORY__STRINGS__THEORY_STRINGS_TYPE_RULES_H +#ifndef CVC4__THEORY__STRINGS__THEORY_STRINGS_TYPE_RULES_H +#define CVC4__THEORY__STRINGS__THEORY_STRINGS_TYPE_RULES_H namespace CVC4 { namespace theory { @@ -490,4 +490,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__STRINGS__THEORY_STRINGS_TYPE_RULES_H */ +#endif /* CVC4__THEORY__STRINGS__THEORY_STRINGS_TYPE_RULES_H */ diff --git a/src/theory/strings/type_enumerator.h b/src/theory/strings/type_enumerator.h index 108b1edc4..5ca0b624d 100644 --- a/src/theory/strings/type_enumerator.h +++ b/src/theory/strings/type_enumerator.h @@ -2,9 +2,9 @@ /*! \file type_enumerator.h ** \verbatim ** Top contributors (to current version): - ** Tianyi Liang, Tim King, Andres Noetzli + ** Tianyi Liang, Tim King, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__STRINGS__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__STRINGS__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__STRINGS__TYPE_ENUMERATOR_H +#define CVC4__THEORY__STRINGS__TYPE_ENUMERATOR_H #include <sstream> @@ -128,4 +128,4 @@ class StringEnumeratorLength { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__STRINGS__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__STRINGS__TYPE_ENUMERATOR_H */ diff --git a/src/theory/subs_minimize.cpp b/src/theory/subs_minimize.cpp index 58daf5c75..c16fab4a9 100644 --- a/src/theory/subs_minimize.cpp +++ b/src/theory/subs_minimize.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/subs_minimize.h b/src/theory/subs_minimize.h index bf6ccffae..3ffd588f1 100644 --- a/src/theory/subs_minimize.h +++ b/src/theory/subs_minimize.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SUBS_MINIMIZE_H -#define __CVC4__THEORY__SUBS_MINIMIZE_H +#ifndef CVC4__THEORY__SUBS_MINIMIZE_H +#define CVC4__THEORY__SUBS_MINIMIZE_H #include <vector> @@ -97,4 +97,4 @@ class SubstitutionMinimize } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__SUBS_MINIMIZE_H */ +#endif /* CVC4__THEORY__SUBS_MINIMIZE_H */ diff --git a/src/theory/substitutions.cpp b/src/theory/substitutions.cpp index 036bb4ada..9007386c4 100644 --- a/src/theory/substitutions.cpp +++ b/src/theory/substitutions.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Clark Barrett, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -57,8 +57,8 @@ Node SubstitutionMap::internalSubstitute(TNode t, NodeCache& cache) { continue; } - if (!d_substituteUnderQuantifiers && - (current.getKind() == kind::FORALL || current.getKind() == kind::EXISTS)) { + if (!d_substituteUnderQuantifiers && current.isClosure()) + { Debug("substitution::internal") << "--not substituting under quantifier" << endl; cache[current] = current; toVisit.pop_back(); diff --git a/src/theory/substitutions.h b/src/theory/substitutions.h index 6d6875ba3..c19fb12f6 100644 --- a/src/theory/substitutions.h +++ b/src/theory/substitutions.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__SUBSTITUTIONS_H -#define __CVC4__THEORY__SUBSTITUTIONS_H +#ifndef CVC4__THEORY__SUBSTITUTIONS_H +#define CVC4__THEORY__SUBSTITUTIONS_H //#include <algorithm> #include <utility> @@ -199,4 +199,4 @@ std::ostream& operator<<(std::ostream& out, const theory::SubstitutionMap::itera }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__SUBSTITUTIONS_H */ +#endif /* CVC4__THEORY__SUBSTITUTIONS_H */ diff --git a/src/theory/term_registration_visitor.cpp b/src/theory/term_registration_visitor.cpp index fdab93375..3b11d8e54 100644 --- a/src/theory/term_registration_visitor.cpp +++ b/src/theory/term_registration_visitor.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -35,10 +35,7 @@ bool PreRegisterVisitor::alreadyVisited(TNode current, TNode parent) { Debug("register::internal") << "PreRegisterVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl; - if ((parent.getKind() == kind::FORALL || parent.getKind() == kind::EXISTS - || parent.getKind() == kind::LAMBDA - || parent.getKind() == kind::CHOICE - || parent.getKind() == kind::REWRITE_RULE + if ((parent.isClosure() || parent.getKind() == kind::REWRITE_RULE || parent.getKind() == kind::SEP_STAR || parent.getKind() == kind::SEP_WAND || (parent.getKind() == kind::SEP_LABEL && current.getType().isBoolean()) @@ -181,10 +178,7 @@ bool SharedTermsVisitor::alreadyVisited(TNode current, TNode parent) const { Debug("register::internal") << "SharedTermsVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl; - if ((parent.getKind() == kind::FORALL || parent.getKind() == kind::EXISTS - || parent.getKind() == kind::LAMBDA - || parent.getKind() == kind::CHOICE - || parent.getKind() == kind::REWRITE_RULE + if ((parent.isClosure() || parent.getKind() == kind::REWRITE_RULE || parent.getKind() == kind::SEP_STAR || parent.getKind() == kind::SEP_WAND || (parent.getKind() == kind::SEP_LABEL && current.getType().isBoolean()) diff --git a/src/theory/term_registration_visitor.h b/src/theory/term_registration_visitor.h index b12cef064..cdb411c16 100644 --- a/src/theory/term_registration_visitor.h +++ b/src/theory/term_registration_visitor.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/theory.cpp b/src/theory/theory.cpp index a4e814e8c..5108e312a 100644 --- a/src/theory/theory.cpp +++ b/src/theory/theory.cpp @@ -2,9 +2,9 @@ /*! \file theory.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andrew Reynolds, Dejan Jovanovic + ** Tim King, Dejan Jovanovic, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/theory.h b/src/theory/theory.h index 8a0c87c9e..cabb17f48 100644 --- a/src/theory/theory.h +++ b/src/theory/theory.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__THEORY_H -#define __CVC4__THEORY__THEORY_H +#ifndef CVC4__THEORY__THEORY_H +#define CVC4__THEORY__THEORY_H #include <iosfwd> #include <map> @@ -915,4 +915,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__THEORY_H */ +#endif /* CVC4__THEORY__THEORY_H */ diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index fb4075d82..78db1718e 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -2,9 +2,9 @@ /*! \file theory_engine.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters, Guy Katz + ** Dejan Jovanovic, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -1061,9 +1061,7 @@ Node TheoryEngine::ppTheoryRewrite(TNode term) { Node newTerm; // do not rewrite inside quantifiers - if (term.getKind() == kind::FORALL || term.getKind() == kind::EXISTS - || term.getKind() == kind::CHOICE - || term.getKind() == kind::LAMBDA) + if (term.isClosure()) { newTerm = Rewriter::rewrite(term); } diff --git a/src/theory/theory_engine.h b/src/theory/theory_engine.h index c3281c9ba..701d5cefb 100644 --- a/src/theory/theory_engine.h +++ b/src/theory/theory_engine.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY_ENGINE_H -#define __CVC4__THEORY_ENGINE_H +#ifndef CVC4__THEORY_ENGINE_H +#define CVC4__THEORY_ENGINE_H #include <deque> #include <memory> @@ -932,4 +932,4 @@ private: }/* CVC4 namespace */ -#endif /* __CVC4__THEORY_ENGINE_H */ +#endif /* CVC4__THEORY_ENGINE_H */ diff --git a/src/theory/theory_model.cpp b/src/theory/theory_model.cpp index 2ccc48a6a..8d6511854 100644 --- a/src/theory/theory_model.cpp +++ b/src/theory/theory_model.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Clark Barrett, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/theory_model.h b/src/theory/theory_model.h index 3ffd1e8c1..baf3a401c 100644 --- a/src/theory/theory_model.h +++ b/src/theory/theory_model.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__THEORY_MODEL_H -#define __CVC4__THEORY__THEORY_MODEL_H +#ifndef CVC4__THEORY__THEORY_MODEL_H +#define CVC4__THEORY__THEORY_MODEL_H #include <unordered_map> #include <unordered_set> @@ -351,4 +351,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__THEORY_MODEL_H */ +#endif /* CVC4__THEORY__THEORY_MODEL_H */ diff --git a/src/theory/theory_model_builder.cpp b/src/theory/theory_model_builder.cpp index a9742b2ba..b032dfec4 100644 --- a/src/theory/theory_model_builder.cpp +++ b/src/theory/theory_model_builder.cpp @@ -2,9 +2,9 @@ /*! \file theory_model_builder.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Clark Barrett, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -47,6 +47,14 @@ bool TheoryEngineModelBuilder::isAssignable(TNode n) return !n.getType().isFunction(); } } + else if (n.getKind() == kind::FLOATINGPOINT_COMPONENT_SIGN) + { + // Extracting the sign of a floating-point number acts similar to a + // selector on a datatype, i.e. if `(sign x)` wasn't assigned a value, we + // can pick an arbitrary one. Note that the other components of a + // floating-point number should always be assigned a value. + return true; + } else { // non-function variables, and fully applied functions @@ -72,7 +80,7 @@ void TheoryEngineModelBuilder::addAssignableSubterms(TNode n, TheoryModel* tm, NodeSet& cache) { - if (n.getKind() == FORALL || n.getKind() == EXISTS) + if (n.isClosure()) { return; } diff --git a/src/theory/theory_model_builder.h b/src/theory/theory_model_builder.h index bff230b5c..ce090b14d 100644 --- a/src/theory/theory_model_builder.h +++ b/src/theory/theory_model_builder.h @@ -2,9 +2,9 @@ /*! \file theory_model_builder.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Mathias Preiner + ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__THEORY_MODEL_BUILDER_H -#define __CVC4__THEORY__THEORY_MODEL_BUILDER_H +#ifndef CVC4__THEORY__THEORY_MODEL_BUILDER_H +#define CVC4__THEORY__THEORY_MODEL_BUILDER_H #include <unordered_map> #include <unordered_set> @@ -259,4 +259,4 @@ class TheoryEngineModelBuilder : public ModelBuilder } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__THEORY_MODEL_BUILDER_H */ +#endif /* CVC4__THEORY__THEORY_MODEL_BUILDER_H */ diff --git a/src/theory/theory_registrar.h b/src/theory/theory_registrar.h index 10b90e522..822ae086c 100644 --- a/src/theory/theory_registrar.h +++ b/src/theory/theory_registrar.h @@ -2,9 +2,9 @@ /*! \file theory_registrar.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Liana Hadarean, Morgan Deters + ** Liana Hadarean, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__THEORY_REGISTRAR_H -#define __CVC4__THEORY__THEORY_REGISTRAR_H +#ifndef CVC4__THEORY__THEORY_REGISTRAR_H +#define CVC4__THEORY__THEORY_REGISTRAR_H #include "prop/registrar.h" #include "theory/theory_engine.h" @@ -44,4 +44,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__THEORY_REGISTRAR_H */ +#endif /* CVC4__THEORY__THEORY_REGISTRAR_H */ diff --git a/src/theory/theory_test_utils.h b/src/theory/theory_test_utils.h index e0db2fdeb..ecda12dee 100644 --- a/src/theory/theory_test_utils.h +++ b/src/theory/theory_test_utils.h @@ -2,9 +2,9 @@ /*! \file theory_test_utils.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Liana Hadarean + ** Tim King, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__THEORY__THEORY_TEST_UTILS_H -#define __CVC4__THEORY__THEORY_TEST_UTILS_H +#ifndef CVC4__THEORY__THEORY_TEST_UTILS_H +#define CVC4__THEORY__THEORY_TEST_UTILS_H #include <iostream> #include <memory> @@ -124,4 +124,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__THEORY_TEST_UTILS_H */ +#endif /* CVC4__THEORY__THEORY_TEST_UTILS_H */ diff --git a/src/theory/theory_traits_template.h b/src/theory/theory_traits_template.h index e046da408..00ad7656d 100644 --- a/src/theory/theory_traits_template.h +++ b/src/theory/theory_traits_template.h @@ -2,9 +2,9 @@ /*! \file theory_traits_template.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters, Tim King + ** Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/type_enumerator.h b/src/theory/type_enumerator.h index 58961646c..a92cfd2af 100644 --- a/src/theory/type_enumerator.h +++ b/src/theory/type_enumerator.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__TYPE_ENUMERATOR_H -#define __CVC4__THEORY__TYPE_ENUMERATOR_H +#ifndef CVC4__THEORY__TYPE_ENUMERATOR_H +#define CVC4__THEORY__TYPE_ENUMERATOR_H #include "base/exception.h" #include "base/cvc4_assert.h" @@ -185,4 +185,4 @@ class TypeEnumerator { }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__TYPE_ENUMERATOR_H */ +#endif /* CVC4__THEORY__TYPE_ENUMERATOR_H */ diff --git a/src/theory/type_enumerator_template.cpp b/src/theory/type_enumerator_template.cpp index 14f3e9e87..8ccf27302 100644 --- a/src/theory/type_enumerator_template.cpp +++ b/src/theory/type_enumerator_template.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/type_set.cpp b/src/theory/type_set.cpp index 95c672f69..616245e2b 100644 --- a/src/theory/type_set.cpp +++ b/src/theory/type_set.cpp @@ -2,9 +2,9 @@ /*! \file type_set.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds + ** Andrew Reynolds, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/type_set.h b/src/theory/type_set.h index 633c8b04d..aed7ad80c 100644 --- a/src/theory/type_set.h +++ b/src/theory/type_set.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__TYPE_SET_H -#define __CVC4__THEORY__TYPE_SET_H +#ifndef CVC4__THEORY__TYPE_SET_H +#define CVC4__THEORY__TYPE_SET_H #include <unordered_map> #include <unordered_set> @@ -87,4 +87,4 @@ class TypeSet } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__TYPE_SET_H */ +#endif /* CVC4__THEORY__TYPE_SET_H */ diff --git a/src/theory/uf/equality_engine.cpp b/src/theory/uf/equality_engine.cpp index bd2fe9f9f..3e321bf29 100644 --- a/src/theory/uf/equality_engine.cpp +++ b/src/theory/uf/equality_engine.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Guy Katz, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -929,9 +929,9 @@ std::string EqualityEngine::edgesToString(EqualityEdgeId edgeId) const { void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, std::vector<TNode>& equalities, EqProof* eqp) const { - Debug("equality") << d_name << "::eq::explainEquality(" << t1 << ", " << t2 - << ", " << (polarity ? "true" : "false") << ")" - << ", proof = " << (eqp ? "ON" : "OFF") << std::endl; + Debug("pf::ee") << d_name << "::eq::explainEquality(" << t1 << ", " << t2 + << ", " << (polarity ? "true" : "false") << ")" + << ", proof = " << (eqp ? "ON" : "OFF") << std::endl; // The terms must be there already Assert(hasTerm(t1) && hasTerm(t2));; @@ -940,9 +940,10 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, EqualityNodeId t1Id = getNodeId(t1); EqualityNodeId t2Id = getNodeId(t2); + std::map<std::pair<EqualityNodeId, EqualityNodeId>, EqProof*> cache; if (polarity) { // Get the explanation - getExplanation(t1Id, t2Id, equalities, eqp); + getExplanation(t1Id, t2Id, equalities, cache, eqp); } else { if (eqp) { eqp->d_id = eq::MERGED_THROUGH_TRANS; @@ -964,12 +965,15 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, eqpc = std::make_shared<EqProof>(); } - getExplanation(toExplain.first, toExplain.second, equalities, eqpc.get()); + getExplanation( + toExplain.first, toExplain.second, equalities, cache, eqpc.get()); if (eqpc) { - Debug("pf::ee") << "Child proof is:" << std::endl; - eqpc->debug_print("pf::ee", 1); - + if (Debug.isOn("pf::ee")) + { + Debug("pf::ee") << "Child proof is:" << std::endl; + eqpc->debug_print("pf::ee", 1); + } if (eqpc->d_id == eq::MERGED_THROUGH_TRANS) { std::vector<std::shared_ptr<EqProof>> orderedChildren; bool nullCongruenceFound = false; @@ -987,8 +991,13 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, if (nullCongruenceFound) { eqpc->d_children = orderedChildren; - Debug("pf::ee") << "Child proof's children have been reordered. It is now:" << std::endl; - eqpc->debug_print("pf::ee", 1); + if (Debug.isOn("pf::ee")) + { + Debug("pf::ee") + << "Child proof's children have been reordered. It is now:" + << std::endl; + eqpc->debug_print("pf::ee", 1); + } } } @@ -1011,8 +1020,11 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, *eqp = *temp; } - Debug("pf::ee") << "Disequality explanation final proof: " << std::endl; - eqp->debug_print("pf::ee", 1); + if (Debug.isOn("pf::ee")) + { + Debug("pf::ee") << "Disequality explanation final proof: " << std::endl; + eqp->debug_print("pf::ee", 1); + } } } } @@ -1024,15 +1036,65 @@ void EqualityEngine::explainPredicate(TNode p, bool polarity, << std::endl; // Must have the term Assert(hasTerm(p)); + std::map<std::pair<EqualityNodeId, EqualityNodeId>, EqProof*> cache; // Get the explanation - getExplanation(getNodeId(p), polarity ? d_trueId : d_falseId, assertions, - eqp); + getExplanation( + getNodeId(p), polarity ? d_trueId : d_falseId, assertions, cache, eqp); } -void EqualityEngine::getExplanation(EqualityNodeId t1Id, EqualityNodeId t2Id, - std::vector<TNode>& equalities, - EqProof* eqp) const { - Debug("equality") << d_name << "::eq::getExplanation(" << d_nodes[t1Id] << "," << d_nodes[t2Id] << ")" << std::endl; +void EqualityEngine::getExplanation( + EqualityNodeId t1Id, + EqualityNodeId t2Id, + std::vector<TNode>& equalities, + std::map<std::pair<EqualityNodeId, EqualityNodeId>, EqProof*>& cache, + EqProof* eqp) const +{ + Trace("eq-exp") << d_name << "::eq::getExplanation(" << d_nodes[t1Id] << "," + << d_nodes[t2Id] << ") size = " << cache.size() << std::endl; + + // determine if we have already computed the explanation. + std::pair<EqualityNodeId, EqualityNodeId> cacheKey; + std::map<std::pair<EqualityNodeId, EqualityNodeId>, EqProof*>::iterator it; + if (!eqp) + { + // If proofs are disabled, we order the ids, since explaining t1 = t2 is the + // same as explaining t2 = t1. + cacheKey = std::minmax(t1Id, t2Id); + it = cache.find(cacheKey); + if (it != cache.end()) + { + return; + } + } + else + { + // If proofs are enabled, note that proofs are sensitive to the order of t1 + // and t2, so we don't sort the ids in this case. TODO: Depending on how + // issue #2965 is resolved, we may be able to revisit this, if it is the + // case that proof/uf_proof.h,cpp is robust to equality ordering. + cacheKey = std::pair<EqualityNodeId, EqualityNodeId>(t1Id, t2Id); + it = cache.find(cacheKey); + if (it != cache.end()) + { + if (it->second) + { + eqp->d_id = it->second->d_id; + eqp->d_children.insert(eqp->d_children.end(), + it->second->d_children.begin(), + it->second->d_children.end()); + eqp->d_node = it->second->d_node; + } + else + { + // We may have cached null in its place, create the trivial proof now. + Assert(d_nodes[t1Id] == d_nodes[t2Id]); + Assert(eqp->d_id == MERGED_THROUGH_REFLEXIVITY); + eqp->d_node = d_nodes[t1Id]; + } + return; + } + } + cache[cacheKey] = eqp; // We can only explain the nodes that got merged #ifdef CVC4_ASSERTIONS @@ -1136,11 +1198,11 @@ void EqualityEngine::getExplanation(EqualityNodeId t1Id, EqualityNodeId t2Id, Debug("equality") << "Explaining left hand side equalities" << std::endl; std::shared_ptr<EqProof> eqpc1 = eqpc ? std::make_shared<EqProof>() : nullptr; - getExplanation(f1.a, f2.a, equalities, eqpc1.get()); + getExplanation(f1.a, f2.a, equalities, cache, eqpc1.get()); Debug("equality") << "Explaining right hand side equalities" << std::endl; std::shared_ptr<EqProof> eqpc2 = eqpc ? std::make_shared<EqProof>() : nullptr; - getExplanation(f1.b, f2.b, equalities, eqpc2.get()); + getExplanation(f1.b, f2.b, equalities, cache, eqpc2.get()); if( eqpc ){ eqpc->d_children.push_back( eqpc1 ); eqpc->d_children.push_back( eqpc2 ); @@ -1185,7 +1247,7 @@ void EqualityEngine::getExplanation(EqualityNodeId t1Id, EqualityNodeId t2Id, Debug("equality") << push; std::shared_ptr<EqProof> eqpc1 = eqpc ? std::make_shared<EqProof>() : nullptr; - getExplanation(eq.a, eq.b, equalities, eqpc1.get()); + getExplanation(eq.a, eq.b, equalities, cache, eqpc1.get()); if( eqpc ){ eqpc->d_children.push_back( eqpc1 ); } @@ -1211,13 +1273,20 @@ void EqualityEngine::getExplanation(EqualityNodeId t1Id, EqualityNodeId t2Id, Assert(isConstant(childId)); std::shared_ptr<EqProof> eqpcc = eqpc ? std::make_shared<EqProof>() : nullptr; - getExplanation(childId, getEqualityNode(childId).getFind(), - equalities, eqpcc.get()); + getExplanation(childId, + getEqualityNode(childId).getFind(), + equalities, + cache, + eqpcc.get()); if( eqpc ) { eqpc->d_children.push_back( eqpcc ); - - Debug("pf::ee") << "MERGED_THROUGH_CONSTANTS. Dumping the child proof" << std::endl; - eqpc->debug_print("pf::ee", 1); + if (Debug.isOn("pf::ee")) + { + Debug("pf::ee") + << "MERGED_THROUGH_CONSTANTS. Dumping the child proof" + << std::endl; + eqpc->debug_print("pf::ee", 1); + } } } @@ -1255,7 +1324,6 @@ void EqualityEngine::getExplanation(EqualityNodeId t1Id, EqualityNodeId t2Id, } eqpc->d_id = reasonType; } - equalities.push_back(reason); break; } @@ -1288,8 +1356,10 @@ void EqualityEngine::getExplanation(EqualityNodeId t1Id, EqualityNodeId t2Id, eqp->d_children.insert( eqp->d_children.end(), eqp_trans.begin(), eqp_trans.end() ); eqp->d_node = NodeManager::currentNM()->mkNode(kind::EQUAL, d_nodes[t1Id], d_nodes[t2Id]); } - - eqp->debug_print("pf::ee", 1); + if (Debug.isOn("pf::ee")) + { + eqp->debug_print("pf::ee", 1); + } } // Done @@ -2236,27 +2306,48 @@ bool EqClassIterator::isFinished() const { } void EqProof::debug_print(const char* c, unsigned tb, PrettyPrinter* prettyPrinter) const { - for(unsigned i=0; i<tb; i++) { Debug( c ) << " "; } + std::stringstream ss; + debug_print(ss, tb, prettyPrinter); + Debug(c) << ss.str(); +} +void EqProof::debug_print(std::ostream& os, + unsigned tb, + PrettyPrinter* prettyPrinter) const +{ + for (unsigned i = 0; i < tb; i++) + { + os << " "; + } if (prettyPrinter) - Debug( c ) << prettyPrinter->printTag(d_id); + { + os << prettyPrinter->printTag(d_id); + } else - Debug( c ) << d_id; + { + os << d_id; + } - Debug( c ) << "("; + os << "("; if( !d_children.empty() || !d_node.isNull() ){ if( !d_node.isNull() ){ - Debug( c ) << std::endl; - for( unsigned i=0; i<tb+1; i++ ) { Debug( c ) << " "; } - Debug( c ) << d_node; + os << std::endl; + for (unsigned i = 0; i < tb + 1; i++) + { + os << " "; + } + os << d_node; } for( unsigned i=0; i<d_children.size(); i++ ){ - if( i>0 || !d_node.isNull() ) Debug( c ) << ","; - Debug( c ) << std::endl; - d_children[i]->debug_print( c, tb+1, prettyPrinter ); + if (i > 0 || !d_node.isNull()) + { + os << ","; + } + os << std::endl; + d_children[i]->debug_print(os, tb + 1, prettyPrinter); } } - Debug( c ) << ")" << std::endl; + os << ")" << std::endl; } } // Namespace uf diff --git a/src/theory/uf/equality_engine.h b/src/theory/uf/equality_engine.h index 15abf7251..73d8bd4e9 100644 --- a/src/theory/uf/equality_engine.h +++ b/src/theory/uf/equality_engine.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -516,11 +516,24 @@ private: bool d_inPropagate; /** - * Get an explanation of the equality t1 = t2. Returns the asserted equalities that - * imply t1 = t2. Returns TNodes as the assertion equalities should be hashed somewhere - * else. + * Get an explanation of the equality t1 = t2. Returns the asserted equalities + * that imply t1 = t2. Returns TNodes as the assertion equalities should be + * hashed somewhere else. + * + * This call refers to terms t1 and t2 by their ids t1Id and t2Id. + * + * If eqp is non-null, then this method populates eqp's information and + * children such that it is a proof of t1 = t2. + * + * We cache results of this call in cache, where cache[t1Id][t2Id] stores + * a proof of t1 = t2. */ - void getExplanation(EqualityEdgeId t1Id, EqualityNodeId t2Id, std::vector<TNode>& equalities, EqProof* eqp) const; + void getExplanation( + EqualityEdgeId t1Id, + EqualityNodeId t2Id, + std::vector<TNode>& equalities, + std::map<std::pair<EqualityNodeId, EqualityNodeId>, EqProof*>& cache, + EqProof* eqp) const; /** * Print the equality graph. @@ -941,8 +954,19 @@ public: unsigned d_id; Node d_node; std::vector<std::shared_ptr<EqProof>> d_children; + /** + * Debug print this proof on debug trace c with tabulation tb and pretty + * printer prettyPrinter. + */ void debug_print(const char* c, unsigned tb = 0, PrettyPrinter* prettyPrinter = nullptr) const; + /** + * Debug print this proof on output stream os with tabulation tb and pretty + * printer prettyPrinter. + */ + void debug_print(std::ostream& os, + unsigned tb = 0, + PrettyPrinter* prettyPrinter = nullptr) const; };/* class EqProof */ } // Namespace eq diff --git a/src/theory/uf/equality_engine_types.h b/src/theory/uf/equality_engine_types.h index 724ab423c..3813bb697 100644 --- a/src/theory/uf/equality_engine_types.h +++ b/src/theory/uf/equality_engine_types.h @@ -2,9 +2,9 @@ /*! \file equality_engine_types.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Andres Noetzli, Andrew Reynolds + ** Dejan Jovanovic, Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H -#define __CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H +#ifndef CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H +#define CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H #include <string> #include <iostream> @@ -360,4 +360,4 @@ struct TriggerInfo { } // namespace theory } // namespace CVC4 -#endif /* __CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H */ +#endif /* CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H */ diff --git a/src/theory/uf/symmetry_breaker.cpp b/src/theory/uf/symmetry_breaker.cpp index 0313fabab..9c1d4c2f1 100644 --- a/src/theory/uf/symmetry_breaker.cpp +++ b/src/theory/uf/symmetry_breaker.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/uf/symmetry_breaker.h b/src/theory/uf/symmetry_breaker.h index 434ddd93b..d528e948f 100644 --- a/src/theory/uf/symmetry_breaker.h +++ b/src/theory/uf/symmetry_breaker.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -41,8 +41,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__UF__SYMMETRY_BREAKER_H -#define __CVC4__THEORY__UF__SYMMETRY_BREAKER_H +#ifndef CVC4__THEORY__UF__SYMMETRY_BREAKER_H +#define CVC4__THEORY__UF__SYMMETRY_BREAKER_H #include <iostream> #include <list> @@ -176,4 +176,4 @@ std::ostream& operator<<(std::ostream& out, const ::CVC4::theory::uf::SymmetryBr }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__UF__SYMMETRY_BREAKER_H */ +#endif /* CVC4__THEORY__UF__SYMMETRY_BREAKER_H */ diff --git a/src/theory/uf/theory_uf.cpp b/src/theory/uf/theory_uf.cpp index 645e1f656..508bd5002 100644 --- a/src/theory/uf/theory_uf.cpp +++ b/src/theory/uf/theory_uf.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -19,17 +19,18 @@ #include <memory> +#include "expr/node_algorithm.h" #include "options/quantifiers_options.h" #include "options/smt_options.h" +#include "options/theory_options.h" #include "options/uf_options.h" #include "proof/proof_manager.h" #include "proof/theory_proof.h" #include "proof/uf_proof.h" #include "theory/theory_model.h" #include "theory/type_enumerator.h" -#include "theory/uf/theory_uf_strong_solver.h" -#include "options/theory_options.h" #include "theory/uf/theory_uf_rewriter.h" +#include "theory/uf/theory_uf_strong_solver.h" using namespace std; @@ -186,22 +187,67 @@ Node TheoryUF::getApplyUfForHoApply( Node node ) { std::vector< TNode > args; Node f = TheoryUfRewriter::decomposeHoApply( node, args, true ); Node new_f = f; + NodeManager* nm = NodeManager::currentNM(); if( !TheoryUfRewriter::canUseAsApplyUfOperator( f ) ){ NodeNodeMap::const_iterator itus = d_uf_std_skolem.find( f ); if( itus==d_uf_std_skolem.end() ){ - // introduce skolem to make a standard APPLY_UF - new_f = NodeManager::currentNM()->mkSkolem( "app_uf", f.getType() ); - Node lem = new_f.eqNode( f ); + std::unordered_set<Node, NodeHashFunction> fvs; + expr::getFreeVariables(f, fvs); + Node lem; + if (!fvs.empty()) + { + std::vector<TypeNode> newTypes; + std::vector<Node> vs; + std::vector<Node> nvs; + for (const Node& v : fvs) + { + TypeNode vt = v.getType(); + newTypes.push_back(vt); + Node nv = nm->mkBoundVar(vt); + vs.push_back(v); + nvs.push_back(nv); + } + TypeNode ft = f.getType(); + std::vector<TypeNode> argTypes = ft.getArgTypes(); + TypeNode rangeType = ft.getRangeType(); + + newTypes.insert(newTypes.end(), argTypes.begin(), argTypes.end()); + TypeNode nft = nm->mkFunctionType(newTypes, rangeType); + new_f = nm->mkSkolem("app_uf", nft); + for (const Node& v : vs) + { + new_f = nm->mkNode(kind::HO_APPLY, new_f, v); + } + Assert(new_f.getType() == f.getType()); + Node eq = new_f.eqNode(f); + Node seq = eq.substitute(vs.begin(), vs.end(), nvs.begin(), nvs.end()); + lem = nm->mkNode( + kind::FORALL, nm->mkNode(kind::BOUND_VAR_LIST, nvs), seq); + } + else + { + // introduce skolem to make a standard APPLY_UF + new_f = nm->mkSkolem("app_uf", f.getType()); + lem = new_f.eqNode(f); + } Trace("uf-ho-lemma") << "uf-ho-lemma : Skolem definition for apply-conversion : " << lem << std::endl; d_out->lemma( lem ); d_uf_std_skolem[f] = new_f; }else{ new_f = (*itus).second; } + // unroll the HO_APPLY, adding to the first argument position + // Note arguments in the vector args begin at position 1. + while (new_f.getKind() == kind::HO_APPLY) + { + args.insert(args.begin() + 1, new_f[1]); + new_f = new_f[0]; + } } Assert( TheoryUfRewriter::canUseAsApplyUfOperator( new_f ) ); args[0] = new_f; - Node ret = NodeManager::currentNM()->mkNode( kind::APPLY_UF, args ); + Node ret = nm->mkNode(kind::APPLY_UF, args); + Assert(ret.getType() == node.getType()); return ret; } @@ -409,7 +455,8 @@ void TheoryUF::ppStaticLearn(TNode n, NodeBuilder<>& learned) { while(!workList.empty()) { n = workList.back(); - if(n.getKind() == kind::FORALL || n.getKind() == kind::EXISTS) { + if (n.isClosure()) + { // unsafe to go under quantifiers; we might pull bound vars out of scope! processed.insert(n); workList.pop_back(); diff --git a/src/theory/uf/theory_uf.h b/src/theory/uf/theory_uf.h index a0380f73a..72dc04b10 100644 --- a/src/theory/uf/theory_uf.h +++ b/src/theory/uf/theory_uf.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__UF__THEORY_UF_H -#define __CVC4__THEORY__UF__THEORY_UF_H +#ifndef CVC4__THEORY__UF__THEORY_UF_H +#define CVC4__THEORY__UF__THEORY_UF_H #include "context/cdhashset.h" #include "context/cdo.h" @@ -315,4 +315,4 @@ private: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__UF__THEORY_UF_H */ +#endif /* CVC4__THEORY__UF__THEORY_UF_H */ diff --git a/src/theory/uf/theory_uf_model.cpp b/src/theory/uf/theory_uf_model.cpp index 42847dfd4..f279aebaf 100644 --- a/src/theory/uf/theory_uf_model.cpp +++ b/src/theory/uf/theory_uf_model.cpp @@ -2,9 +2,9 @@ /*! \file theory_uf_model.cpp ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Tim King + ** Andrew Reynolds, Morgan Deters, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/uf/theory_uf_model.h b/src/theory/uf/theory_uf_model.h index ac57bde27..4454b7e8c 100644 --- a/src/theory/uf/theory_uf_model.h +++ b/src/theory/uf/theory_uf_model.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY_UF_MODEL_H -#define __CVC4__THEORY_UF_MODEL_H +#ifndef CVC4__THEORY_UF_MODEL_H +#define CVC4__THEORY_UF_MODEL_H #include "theory/theory_model.h" diff --git a/src/theory/uf/theory_uf_rewriter.h b/src/theory/uf/theory_uf_rewriter.h index 3eb59e5fc..bad4189d6 100644 --- a/src/theory/uf/theory_uf_rewriter.h +++ b/src/theory/uf/theory_uf_rewriter.h @@ -2,9 +2,9 @@ /*! \file theory_uf_rewriter.h ** \verbatim ** Top contributors (to current version): - ** Andrew Reynolds, Morgan Deters, Dejan Jovanovic + ** Andrew Reynolds, Haniel Barbosa, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,11 +17,13 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__UF__THEORY_UF_REWRITER_H -#define __CVC4__THEORY__UF__THEORY_UF_REWRITER_H +#ifndef CVC4__THEORY__UF__THEORY_UF_REWRITER_H +#define CVC4__THEORY__UF__THEORY_UF_REWRITER_H +#include "expr/node_algorithm.h" #include "theory/rewriter.h" #include "theory/substitutions.h" +#include "options/uf_options.h" namespace CVC4 { namespace theory { @@ -46,19 +48,52 @@ public: } if(node.getKind() == kind::APPLY_UF) { if( node.getOperator().getKind() == kind::LAMBDA ){ + Trace("uf-ho-beta") + << "uf-ho-beta : beta-reducing all args of : " << node << "\n"; TNode lambda = node.getOperator(); - std::vector<TNode> vars; - std::vector<TNode> subs; - for (const TNode& v : lambda[0]) + Node ret; + // build capture-avoiding substitution since in HOL shadowing may have + // been introduced + if (options::ufHo()) { - vars.push_back(v); + std::vector<Node> vars; + std::vector<Node> subs; + for (const Node& v : lambda[0]) + { + vars.push_back(v); + } + for (const Node& s : node) + { + subs.push_back(s); + } + if (Trace.isOn("uf-ho-beta")) + { + Trace("uf-ho-beta") << "uf-ho-beta: ..sub of " << subs.size() + << " vars into " << subs.size() << " terms :\n"; + for (unsigned i = 0, size = subs.size(); i < size; ++i) + { + Trace("uf-ho-beta") << "uf-ho-beta: .... " << vars[i] << " |-> " + << subs[i] << "\n"; + } + } + ret = expr::substituteCaptureAvoiding(lambda[1], vars, subs); + Trace("uf-ho-beta") << "uf-ho-beta : ..result : " << ret << "\n"; } - for (const TNode& s : node) + else { - subs.push_back(s); + std::vector<TNode> vars; + std::vector<TNode> subs; + for (const TNode& v : lambda[0]) + { + vars.push_back(v); + } + for (const TNode& s : node) + { + subs.push_back(s); + } + ret = lambda[1].substitute( + vars.begin(), vars.end(), subs.begin(), subs.end()); } - Node ret = lambda[1].substitute( - vars.begin(), vars.end(), subs.begin(), subs.end()); return RewriteResponse(REWRITE_AGAIN_FULL, ret); }else if( !canUseAsApplyUfOperator( node.getOperator() ) ){ return RewriteResponse(REWRITE_AGAIN_FULL, getHoApplyForApplyUf(node)); @@ -66,9 +101,12 @@ public: }else if( node.getKind() == kind::HO_APPLY ){ if( node[0].getKind() == kind::LAMBDA ){ // resolve one argument of the lambda - TNode arg = Rewriter::rewrite( node[1] ); - TNode var = node[0][0][0]; - Node new_body = node[0][1].substitute( var, arg ); + Trace("uf-ho-beta") + << "uf-ho-beta : beta-reducing one argument of : " << node[0] + << " with " << node[1] << "\n"; + + // reconstruct the lambda first to avoid variable shadowing + Node new_body = node[0][1]; if( node[0][0].getNumChildren()>1 ){ std::vector< Node > new_vars; for( unsigned i=1; i<node[0][0].getNumChildren(); i++ ){ @@ -78,7 +116,26 @@ public: largs.push_back( NodeManager::currentNM()->mkNode( kind::BOUND_VAR_LIST, new_vars ) ); largs.push_back( new_body ); new_body = NodeManager::currentNM()->mkNode( kind::LAMBDA, largs ); + Trace("uf-ho-beta") + << "uf-ho-beta : ....new lambda : " << new_body << "\n"; + } + + // build capture-avoiding substitution since in HOL shadowing may have + // been introduced + if (options::ufHo()) + { + Node arg = Rewriter::rewrite(node[1]); + Node var = node[0][0][0]; + new_body = expr::substituteCaptureAvoiding(new_body, var, arg); + } + else + { + TNode arg = Rewriter::rewrite(node[1]); + TNode var = node[0][0][0]; + new_body = new_body.substitute(var, arg); } + Trace("uf-ho-beta") + << "uf-ho-beta : ..new body : " << new_body << "\n"; return RewriteResponse( REWRITE_AGAIN_FULL, new_body ); } } @@ -156,4 +213,4 @@ public: //conversion between HO_APPLY AND APPLY_UF }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__UF__THEORY_UF_REWRITER_H */ +#endif /* CVC4__THEORY__UF__THEORY_UF_REWRITER_H */ diff --git a/src/theory/uf/theory_uf_strong_solver.cpp b/src/theory/uf/theory_uf_strong_solver.cpp index a19298b64..a21edd8eb 100644 --- a/src/theory/uf/theory_uf_strong_solver.cpp +++ b/src/theory/uf/theory_uf_strong_solver.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/uf/theory_uf_strong_solver.h b/src/theory/uf/theory_uf_strong_solver.h index 286c7391a..5dac994aa 100644 --- a/src/theory/uf/theory_uf_strong_solver.h +++ b/src/theory/uf/theory_uf_strong_solver.h @@ -2,9 +2,9 @@ /*! \file theory_uf_strong_solver.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Andrew Reynolds, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -14,8 +14,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY_UF_STRONG_SOLVER_H -#define __CVC4__THEORY_UF_STRONG_SOLVER_H +#ifndef CVC4__THEORY_UF_STRONG_SOLVER_H +#define CVC4__THEORY_UF_STRONG_SOLVER_H #include "context/cdhashmap.h" #include "context/context.h" @@ -476,4 +476,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY_UF_STRONG_SOLVER_H */ +#endif /* CVC4__THEORY_UF_STRONG_SOLVER_H */ diff --git a/src/theory/uf/theory_uf_type_rules.h b/src/theory/uf/theory_uf_type_rules.h index 2dbfae388..cb373b535 100644 --- a/src/theory/uf/theory_uf_type_rules.h +++ b/src/theory/uf/theory_uf_type_rules.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__UF__THEORY_UF_TYPE_RULES_H -#define __CVC4__THEORY__UF__THEORY_UF_TYPE_RULES_H +#ifndef CVC4__THEORY__UF__THEORY_UF_TYPE_RULES_H +#define CVC4__THEORY__UF__THEORY_UF_TYPE_RULES_H namespace CVC4 { namespace theory { @@ -178,4 +178,4 @@ class HoApplyTypeRule { } /* CVC4::theory namespace */ } /* CVC4 namespace */ -#endif /* __CVC4__THEORY__UF__THEORY_UF_TYPE_RULES_H */ +#endif /* CVC4__THEORY__UF__THEORY_UF_TYPE_RULES_H */ diff --git a/src/theory/valuation.cpp b/src/theory/valuation.cpp index 62b3fc196..83a7e3bff 100644 --- a/src/theory/valuation.cpp +++ b/src/theory/valuation.cpp @@ -2,9 +2,9 @@ /*! \file valuation.cpp ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters, Andrew Reynolds + ** Dejan Jovanovic, Andrew Reynolds, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/theory/valuation.h b/src/theory/valuation.h index 93b33cfdf..89f286a5e 100644 --- a/src/theory/valuation.h +++ b/src/theory/valuation.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__THEORY__VALUATION_H -#define __CVC4__THEORY__VALUATION_H +#ifndef CVC4__THEORY__VALUATION_H +#define CVC4__THEORY__VALUATION_H #include "expr/node.h" #include "options/theoryof_mode.h" @@ -151,4 +151,4 @@ public: }/* CVC4::theory namespace */ }/* CVC4 namespace */ -#endif /* __CVC4__THEORY__VALUATION_H */ +#endif /* CVC4__THEORY__VALUATION_H */ diff --git a/src/util/abstract_value.cpp b/src/util/abstract_value.cpp index 472fd8127..7c3ce6aaf 100644 --- a/src/util/abstract_value.cpp +++ b/src/util/abstract_value.cpp @@ -2,9 +2,9 @@ /*! \file abstract_value.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/abstract_value.h b/src/util/abstract_value.h index 7117a58d2..8091a7ee5 100644 --- a/src/util/abstract_value.h +++ b/src/util/abstract_value.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/bin_heap.h b/src/util/bin_heap.h index d547530b1..d6a7c95d7 100644 --- a/src/util/bin_heap.h +++ b/src/util/bin_heap.h @@ -2,9 +2,9 @@ /*! \file bin_heap.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters + ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__BIN_HEAP_H -#define __CVC4__BIN_HEAP_H +#ifndef CVC4__BIN_HEAP_H +#define CVC4__BIN_HEAP_H #include <limits> #include <functional> @@ -365,4 +365,4 @@ const size_t BinaryHeap<Elem,CmpFcn>::MAX_SIZE = (std::numeric_limits<size_t>::m }/* CVC4 namespace */ -#endif /* __CVC4__BIN_HEAP_H */ +#endif /* CVC4__BIN_HEAP_H */ diff --git a/src/util/bitvector.cpp b/src/util/bitvector.cpp index def9fd90f..a561fe088 100644 --- a/src/util/bitvector.cpp +++ b/src/util/bitvector.cpp @@ -2,9 +2,9 @@ /*! \file bitvector.cpp ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Andres Noetzli + ** Aina Niemetz, Liana Hadarean, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/bitvector.h b/src/util/bitvector.h index 13c1f14dd..f13db5417 100644 --- a/src/util/bitvector.h +++ b/src/util/bitvector.h @@ -2,9 +2,9 @@ /*! \file bitvector.h ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz, Dejan Jovanovic, Liana Hadarean + ** Aina Niemetz, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__BITVECTOR_H -#define __CVC4__BITVECTOR_H +#ifndef CVC4__BITVECTOR_H +#define CVC4__BITVECTOR_H #include <cstdint> #include <iosfwd> @@ -66,11 +66,29 @@ class CVC4_PUBLIC BitVector { } + /** + * BitVector constructor. + * + * The value of the bit-vector is passed in as string of base 2, 10 or 16. + * The size of resulting bit-vector is + * - base 2: the size of the binary string + * - base 10: the min. size required to represent the decimal as a bit-vector + * - base 16: the max. size required to represent the hexadecimal as a + * bit-vector (4 * size of the given value string) + * + * @param num The value of the bit-vector in string representation. + * @param base The base of the string representation. + */ BitVector(const std::string& num, unsigned base = 2) { - CheckArgument(base == 2 || base == 16, base); - d_size = base == 2 ? num.size() : num.size() * 4; + CheckArgument(base == 2 || base == 10 || base == 16, base); d_value = Integer(num, base); + switch (base) + { + case 10: d_size = d_value.length(); break; + case 16: d_size = num.size() * 4; break; + default: d_size = num.size(); + } } ~BitVector() {} @@ -416,4 +434,4 @@ inline std::ostream& operator<<(std::ostream& os, const IntToBitVector& bv) } // namespace CVC4 -#endif /* __CVC4__BITVECTOR_H */ +#endif /* CVC4__BITVECTOR_H */ diff --git a/src/util/bool.h b/src/util/bool.h index 68a416f94..32f3741f8 100644 --- a/src/util/bool.h +++ b/src/util/bool.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__BOOL_H -#define __CVC4__BOOL_H +#ifndef CVC4__BOOL_H +#define CVC4__BOOL_H namespace CVC4 { @@ -29,4 +29,4 @@ struct BoolHashFunction { }/* CVC4 namespace */ -#endif /* __CVC4__BOOL_H */ +#endif /* CVC4__BOOL_H */ diff --git a/src/util/cardinality.cpp b/src/util/cardinality.cpp index 4584c46ab..ce1763ba1 100644 --- a/src/util/cardinality.cpp +++ b/src/util/cardinality.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/cardinality.h b/src/util/cardinality.h index 956468e30..b06d72286 100644 --- a/src/util/cardinality.h +++ b/src/util/cardinality.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__CARDINALITY_H -#define __CVC4__CARDINALITY_H +#ifndef CVC4__CARDINALITY_H +#define CVC4__CARDINALITY_H #include <iostream> #include <utility> @@ -225,4 +225,4 @@ std::ostream& operator<<(std::ostream& out, const Cardinality& c) CVC4_PUBLIC; } /* CVC4 namespace */ -#endif /* __CVC4__CARDINALITY_H */ +#endif /* CVC4__CARDINALITY_H */ diff --git a/src/util/channel.h b/src/util/channel.h index 8587800c1..00776921f 100644 --- a/src/util/channel.h +++ b/src/util/channel.h @@ -22,8 +22,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__CHANNEL_H -#define __CVC4__CHANNEL_H +#ifndef CVC4__CHANNEL_H +#define CVC4__CHANNEL_H #include <boost/circular_buffer.hpp> #include <boost/thread/mutex.hpp> @@ -118,4 +118,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__CHANNEL_H */ +#endif /* CVC4__CHANNEL_H */ diff --git a/src/util/debug.h b/src/util/debug.h index ef887ef24..e25ca8168 100644 --- a/src/util/debug.h +++ b/src/util/debug.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -20,8 +20,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__DEBUG_H -#define __CVC4__DEBUG_H +#ifndef CVC4__DEBUG_H +#define CVC4__DEBUG_H #include <cassert> @@ -34,4 +34,4 @@ # define cvc4assert(x) /*__builtin_expect( ( x ), true )*/ #endif /* CVC4_ASSERTIONS */ -#endif /* __CVC4__DEBUG_H */ +#endif /* CVC4__DEBUG_H */ diff --git a/src/util/dense_map.h b/src/util/dense_map.h index 410fcc8fa..cc1a094eb 100644 --- a/src/util/dense_map.h +++ b/src/util/dense_map.h @@ -2,9 +2,9 @@ /*! \file dense_map.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Dejan Jovanovic + ** Tim King, Dejan Jovanovic, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/divisible.cpp b/src/util/divisible.cpp index 33437b91e..f336a318c 100644 --- a/src/util/divisible.cpp +++ b/src/util/divisible.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/divisible.h b/src/util/divisible.h index 65731fcaa..a0c730436 100644 --- a/src/util/divisible.h +++ b/src/util/divisible.h @@ -2,9 +2,9 @@ /*! \file divisible.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__DIVISIBLE_H -#define __CVC4__DIVISIBLE_H +#ifndef CVC4__DIVISIBLE_H +#define CVC4__DIVISIBLE_H #include <iosfwd> @@ -60,4 +60,4 @@ inline std::ostream& operator <<(std::ostream& os, const Divisible& d) { }/* CVC4 namespace */ -#endif /* __CVC4__DIVISIBLE_H */ +#endif /* CVC4__DIVISIBLE_H */ diff --git a/src/util/floatingpoint.cpp b/src/util/floatingpoint.cpp index 1de5e358a..4aed27c30 100644 --- a/src/util/floatingpoint.cpp +++ b/src/util/floatingpoint.cpp @@ -2,10 +2,10 @@ /*! \file floatingpoint.cpp ** \verbatim ** Top contributors (to current version): - ** Martin Brain, Tim King + ** Martin Brain, Martin Brain, Tim King ** Copyright (c) 2013 University of Oxford ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/floatingpoint.h.in b/src/util/floatingpoint.h.in index d283d985f..bac0fbd59 100644 --- a/src/util/floatingpoint.h.in +++ b/src/util/floatingpoint.h.in @@ -2,10 +2,10 @@ /*! \file floatingpoint.h.in ** \verbatim ** Top contributors (to current version): - ** Martin Brain, Tim King, Andres Noetzli + ** Martin Brain, Martin Brain, Tim King ** Copyright (c) 2013 University of Oxford ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ **/ #include "cvc4_public.h" -#ifndef __CVC4__FLOATINGPOINT_H -#define __CVC4__FLOATINGPOINT_H +#ifndef CVC4__FLOATINGPOINT_H +#define CVC4__FLOATINGPOINT_H #include "util/bitvector.h" #include "util/rational.h" @@ -551,4 +551,4 @@ namespace CVC4 { }/* CVC4 namespace */ -#endif /* __CVC4__FLOATINGPOINT_H */ +#endif /* CVC4__FLOATINGPOINT_H */ diff --git a/src/util/gmp_util.h b/src/util/gmp_util.h index d09174b47..3ba388564 100644 --- a/src/util/gmp_util.h +++ b/src/util/gmp_util.h @@ -2,9 +2,9 @@ /*! \file gmp_util.h ** \verbatim ** Top contributors (to current version): - ** Dejan Jovanovic, Morgan Deters, Andres Noetzli + ** Tim King, Andres Noetzli, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__GMP_UTIL_H -#define __CVC4__GMP_UTIL_H +#ifndef CVC4__GMP_UTIL_H +#define CVC4__GMP_UTIL_H /* * Older versions of GMP in combination with newer versions of GCC and C++11 @@ -44,4 +44,4 @@ inline size_t gmpz_hash(const mpz_t toHash) { }/* CVC4 namespace */ -#endif /* __CVC4__GMP_UTIL_H */ +#endif /* CVC4__GMP_UTIL_H */ diff --git a/src/util/hash.h b/src/util/hash.h index af604dc3a..14167bc82 100644 --- a/src/util/hash.h +++ b/src/util/hash.h @@ -2,9 +2,9 @@ /*! \file hash.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andres Noetzli, Christopher L. Conway + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__HASH_H -#define __CVC4__HASH_H +#ifndef CVC4__HASH_H +#define CVC4__HASH_H #include <cstdint> #include <functional> @@ -67,4 +67,4 @@ struct PairHashFunction { }/* CVC4 namespace */ -#endif /* __CVC4__HASH_H */ +#endif /* CVC4__HASH_H */ diff --git a/src/util/index.cpp b/src/util/index.cpp index e48cea6b5..6f036d537 100644 --- a/src/util/index.cpp +++ b/src/util/index.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/index.h b/src/util/index.h index 5ddc8fcf0..2ee6ff19e 100644 --- a/src/util/index.h +++ b/src/util/index.h @@ -2,9 +2,9 @@ /*! \file index.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters + ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__INDEX_H -#define __CVC4__INDEX_H +#ifndef CVC4__INDEX_H +#define CVC4__INDEX_H #include <cstdint> @@ -28,4 +28,4 @@ using Index = uint32_t; }/* CVC4 namespace */ -#endif /* __CVC4__INDEX_H */ +#endif /* CVC4__INDEX_H */ diff --git a/src/util/integer.h.in b/src/util/integer.h.in index ad6c059ed..87a5e35d3 100644 --- a/src/util/integer.h.in +++ b/src/util/integer.h.in @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/integer_cln_imp.cpp b/src/util/integer_cln_imp.cpp index 15d517f72..6439708b9 100644 --- a/src/util/integer_cln_imp.cpp +++ b/src/util/integer_cln_imp.cpp @@ -2,9 +2,9 @@ /*! \file integer_cln_imp.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Aina Niemetz, Clark Barrett + ** Tim King, Aina Niemetz, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/integer_cln_imp.h b/src/util/integer_cln_imp.h index 49f625425..aba5b6a3a 100644 --- a/src/util/integer_cln_imp.h +++ b/src/util/integer_cln_imp.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__INTEGER_H -#define __CVC4__INTEGER_H +#ifndef CVC4__INTEGER_H +#define CVC4__INTEGER_H #include <cln/input.h> #include <cln/integer.h> @@ -559,4 +559,4 @@ inline std::ostream& operator<<(std::ostream& os, const Integer& n) { }/* CVC4 namespace */ -#endif /* __CVC4__INTEGER_H */ +#endif /* CVC4__INTEGER_H */ diff --git a/src/util/integer_gmp_imp.cpp b/src/util/integer_gmp_imp.cpp index 50e23a572..ed206bb45 100644 --- a/src/util/integer_gmp_imp.cpp +++ b/src/util/integer_gmp_imp.cpp @@ -2,9 +2,9 @@ /*! \file integer_gmp_imp.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Aina Niemetz, Clark Barrett + ** Tim King, Aina Niemetz, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h index a93888e31..144e88536 100644 --- a/src/util/integer_gmp_imp.h +++ b/src/util/integer_gmp_imp.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Liana Hadarean, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__INTEGER_H -#define __CVC4__INTEGER_H +#ifndef CVC4__INTEGER_H +#define CVC4__INTEGER_H #include <string> #include <iosfwd> @@ -540,4 +540,4 @@ inline std::ostream& operator<<(std::ostream& os, const Integer& n) { }/* CVC4 namespace */ -#endif /* __CVC4__INTEGER_H */ +#endif /* CVC4__INTEGER_H */ diff --git a/src/util/maybe.h b/src/util/maybe.h index dff0b4dea..33c6c6511 100644 --- a/src/util/maybe.h +++ b/src/util/maybe.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -24,8 +24,8 @@ **/ #include "cvc4_public.h" -#ifndef __CVC4__UTIL__MAYBE_H -#define __CVC4__UTIL__MAYBE_H +#ifndef CVC4__UTIL__MAYBE_H +#define CVC4__UTIL__MAYBE_H #include <ostream> @@ -86,4 +86,4 @@ inline std::ostream& operator<<(std::ostream& out, const Maybe<T>& m){ }/* CVC4 namespace */ -#endif /* __CVC4__UTIL__MAYBE_H */ +#endif /* CVC4__UTIL__MAYBE_H */ diff --git a/src/util/ostream_util.cpp b/src/util/ostream_util.cpp index 6cbaa530e..3ada604ca 100644 --- a/src/util/ostream_util.cpp +++ b/src/util/ostream_util.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/ostream_util.h b/src/util/ostream_util.h index a295dd273..45d30a01c 100644 --- a/src/util/ostream_util.h +++ b/src/util/ostream_util.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__UTIL__OSTREAM_UTIL_H -#define __CVC4__UTIL__OSTREAM_UTIL_H +#ifndef CVC4__UTIL__OSTREAM_UTIL_H +#define CVC4__UTIL__OSTREAM_UTIL_H #include <ios> #include <ostream> @@ -46,4 +46,4 @@ class StreamFormatScope } // namespace CVC4 -#endif /* __CVC4__UTIL__OSTREAM_UTIL_H */ +#endif /* CVC4__UTIL__OSTREAM_UTIL_H */ diff --git a/src/util/proof.h b/src/util/proof.h index 98afe19b3..ac129e3aa 100644 --- a/src/util/proof.h +++ b/src/util/proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__PROOF_H -#define __CVC4__PROOF_H +#ifndef CVC4__PROOF_H +#define CVC4__PROOF_H #include <iosfwd> #include <unordered_map> @@ -41,4 +41,4 @@ class CVC4_PUBLIC Proof }/* CVC4 namespace */ -#endif /* __CVC4__PROOF_H */ +#endif /* CVC4__PROOF_H */ diff --git a/src/util/random.cpp b/src/util/random.cpp index 7c6abd33e..72a8fbc24 100644 --- a/src/util/random.cpp +++ b/src/util/random.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/random.h b/src/util/random.h index e6443c3da..0b46a1f04 100644 --- a/src/util/random.h +++ b/src/util/random.h @@ -2,9 +2,9 @@ /*! \file random.h ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -18,8 +18,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__UTIL__RANDOM_H -#define __CVC4__UTIL__RANDOM_H +#ifndef CVC4__UTIL__RANDOM_H +#define CVC4__UTIL__RANDOM_H namespace CVC4 { diff --git a/src/util/rational.h.in b/src/util/rational.h.in index 1b67dbf0e..5da7a501e 100644 --- a/src/util/rational.h.in +++ b/src/util/rational.h.in @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/rational_cln_imp.cpp b/src/util/rational_cln_imp.cpp index 3dc76f1a4..ca67dd6cb 100644 --- a/src/util/rational_cln_imp.cpp +++ b/src/util/rational_cln_imp.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Christopher L. Conway, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/rational_cln_imp.h b/src/util/rational_cln_imp.h index 826f6ff3f..660c4b075 100644 --- a/src/util/rational_cln_imp.h +++ b/src/util/rational_cln_imp.h @@ -2,9 +2,9 @@ /*! \file rational_cln_imp.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Aina Niemetz + ** Tim King, Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__RATIONAL_H -#define __CVC4__RATIONAL_H +#ifndef CVC4__RATIONAL_H +#define CVC4__RATIONAL_H #include <gmp.h> #include <string> @@ -373,4 +373,4 @@ CVC4_PUBLIC std::ostream& operator<<(std::ostream& os, const Rational& n); }/* CVC4 namespace */ -#endif /* __CVC4__RATIONAL_H */ +#endif /* CVC4__RATIONAL_H */ diff --git a/src/util/rational_gmp_imp.cpp b/src/util/rational_gmp_imp.cpp index 7e9cc67f8..229b51db7 100644 --- a/src/util/rational_gmp_imp.cpp +++ b/src/util/rational_gmp_imp.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Christopher L. Conway, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/rational_gmp_imp.h b/src/util/rational_gmp_imp.h index 1d47cb1ba..ff8a0f776 100644 --- a/src/util/rational_gmp_imp.h +++ b/src/util/rational_gmp_imp.h @@ -2,9 +2,9 @@ /*! \file rational_gmp_imp.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Aina Niemetz + ** Tim King, Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__RATIONAL_H -#define __CVC4__RATIONAL_H +#ifndef CVC4__RATIONAL_H +#define CVC4__RATIONAL_H /* * Older versions of GMP in combination with newer versions of GCC and C++11 @@ -358,4 +358,4 @@ CVC4_PUBLIC std::ostream& operator<<(std::ostream& os, const Rational& n); }/* CVC4 namespace */ -#endif /* __CVC4__RATIONAL_H */ +#endif /* CVC4__RATIONAL_H */ diff --git a/src/util/regexp.cpp b/src/util/regexp.cpp index 34175a775..ed9455e6d 100644 --- a/src/util/regexp.cpp +++ b/src/util/regexp.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Tianyi Liang, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/regexp.h b/src/util/regexp.h index 1588b5174..f7c6fb2ae 100644 --- a/src/util/regexp.h +++ b/src/util/regexp.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andrew Reynolds, Tim King, Tianyi Liang ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__REGEXP_H -#define __CVC4__REGEXP_H +#ifndef CVC4__REGEXP_H +#define CVC4__REGEXP_H #include <cstddef> #include <functional> @@ -246,4 +246,4 @@ std::ostream& operator<<(std::ostream& os, const String& s) CVC4_PUBLIC; } // namespace CVC4 -#endif /* __CVC4__REGEXP_H */ +#endif /* CVC4__REGEXP_H */ diff --git a/src/util/resource_manager.cpp b/src/util/resource_manager.cpp index 041d765cb..6d7e08736 100644 --- a/src/util/resource_manager.cpp +++ b/src/util/resource_manager.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/resource_manager.h b/src/util/resource_manager.h index 3ca2babcf..264565a76 100644 --- a/src/util/resource_manager.h +++ b/src/util/resource_manager.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__RESOURCE_MANAGER_H -#define __CVC4__RESOURCE_MANAGER_H +#ifndef CVC4__RESOURCE_MANAGER_H +#define CVC4__RESOURCE_MANAGER_H #include <cstddef> #include <sys/time.h> @@ -197,4 +197,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__RESOURCE_MANAGER_H */ +#endif /* CVC4__RESOURCE_MANAGER_H */ diff --git a/src/util/result.cpp b/src/util/result.cpp index 69598074a..e76f428a5 100644 --- a/src/util/result.cpp +++ b/src/util/result.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/result.h b/src/util/result.h index 31d997c21..f34a9bb5a 100644 --- a/src/util/result.h +++ b/src/util/result.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__RESULT_H -#define __CVC4__RESULT_H +#ifndef CVC4__RESULT_H +#define CVC4__RESULT_H #include <iostream> #include <string> @@ -151,4 +151,4 @@ bool operator!=(enum Result::Validity v, const Result& r) CVC4_PUBLIC; } /* CVC4 namespace */ -#endif /* __CVC4__RESULT_H */ +#endif /* CVC4__RESULT_H */ diff --git a/src/util/safe_print.cpp b/src/util/safe_print.cpp index 00dedd3bc..beb1a1673 100644 --- a/src/util/safe_print.cpp +++ b/src/util/safe_print.cpp @@ -2,9 +2,9 @@ /*! \file safe_print.cpp ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Andres Noetzli, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/safe_print.h b/src/util/safe_print.h index 8cd1b7367..75a517b18 100644 --- a/src/util/safe_print.h +++ b/src/util/safe_print.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -29,8 +29,8 @@ #include "cvc4_private_library.h" -#ifndef __CVC4__SAFE_PRINT_H -#define __CVC4__SAFE_PRINT_H +#ifndef CVC4__SAFE_PRINT_H +#define CVC4__SAFE_PRINT_H #if __cplusplus >= 201103L // For c++11 and newer @@ -96,4 +96,4 @@ void safe_print_right_aligned(int fd, uint64_t i, ssize_t width); } /* CVC4 namespace */ -#endif /* __CVC4__SAFE_PRINT_H */ +#endif /* CVC4__SAFE_PRINT_H */ diff --git a/src/util/sampler.cpp b/src/util/sampler.cpp index e64ab56df..948b4dfd3 100644 --- a/src/util/sampler.cpp +++ b/src/util/sampler.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/sampler.h b/src/util/sampler.h index f8f11dff2..aa473ba0c 100644 --- a/src/util/sampler.h +++ b/src/util/sampler.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__UTIL_FLOATINGPOINT_SAMPLER_H -#define __CVC4__UTIL_FLOATINGPOINT_SAMPLER_H +#ifndef CVC4__UTIL_FLOATINGPOINT_SAMPLER_H +#define CVC4__UTIL_FLOATINGPOINT_SAMPLER_H #include "util/floatingpoint.h" #include "util/random.h" @@ -55,4 +55,4 @@ class Sampler } // namespace CVC4 -#endif /* __CVC4__UTIL_FLOATINGPOINT_SAMPLER_H */ +#endif /* CVC4__UTIL_FLOATINGPOINT_SAMPLER_H */ diff --git a/src/util/sexpr.cpp b/src/util/sexpr.cpp index a7e38ee61..9de42a4e6 100644 --- a/src/util/sexpr.cpp +++ b/src/util/sexpr.cpp @@ -2,9 +2,9 @@ /*! \file sexpr.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andrew Reynolds + ** Tim King, Morgan Deters, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/sexpr.h b/src/util/sexpr.h index bad6cdb2b..bdc85df41 100644 --- a/src/util/sexpr.h +++ b/src/util/sexpr.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -23,8 +23,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__SEXPR_H -#define __CVC4__SEXPR_H +#ifndef CVC4__SEXPR_H +#define CVC4__SEXPR_H #include <iomanip> #include <iosfwd> @@ -301,4 +301,4 @@ std::ostream& operator<<(std::ostream& out, PrettySExprs ps); } /* CVC4 namespace */ -#endif /* __CVC4__SEXPR_H */ +#endif /* CVC4__SEXPR_H */ diff --git a/src/util/smt2_quote_string.cpp b/src/util/smt2_quote_string.cpp index fec0962ae..626767f5f 100644 --- a/src/util/smt2_quote_string.cpp +++ b/src/util/smt2_quote_string.cpp @@ -2,9 +2,9 @@ /*! \file smt2_quote_string.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Morgan Deters, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/smt2_quote_string.h b/src/util/smt2_quote_string.h index c1fcfe2a4..f91874a2e 100644 --- a/src/util/smt2_quote_string.h +++ b/src/util/smt2_quote_string.h @@ -2,9 +2,9 @@ /*! \file smt2_quote_string.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters + ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__UTIL__SMT2_QUOTE_STRING_H -#define __CVC4__UTIL__SMT2_QUOTE_STRING_H +#ifndef CVC4__UTIL__SMT2_QUOTE_STRING_H +#define CVC4__UTIL__SMT2_QUOTE_STRING_H #include <string> @@ -30,4 +30,4 @@ std::string quoteSymbol(const std::string& s); }/* CVC4 namespace */ -#endif /* __CVC4__UTIL__SMT2_QUOTE_STRING_H */ +#endif /* CVC4__UTIL__SMT2_QUOTE_STRING_H */ diff --git a/src/util/statistics.cpp b/src/util/statistics.cpp index d078473ad..c61520df9 100644 --- a/src/util/statistics.cpp +++ b/src/util/statistics.cpp @@ -2,9 +2,9 @@ /*! \file statistics.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andres Noetzli + ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/util/statistics.h b/src/util/statistics.h index eee4ce6fd..68d8d6fda 100644 --- a/src/util/statistics.h +++ b/src/util/statistics.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -17,8 +17,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__STATISTICS_H -#define __CVC4__STATISTICS_H +#ifndef CVC4__STATISTICS_H +#define CVC4__STATISTICS_H #include <iterator> #include <ostream> @@ -132,4 +132,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__STATISTICS_H */ +#endif /* CVC4__STATISTICS_H */ diff --git a/src/util/statistics_registry.cpp b/src/util/statistics_registry.cpp index 53f18f07b..2ccbc2971 100644 --- a/src/util/statistics_registry.cpp +++ b/src/util/statistics_registry.cpp @@ -2,9 +2,9 @@ /*! \file statistics_registry.cpp ** \verbatim ** Top contributors (to current version): - ** Tim King, Andres Noetzli, Aina Niemetz + ** Morgan Deters, Tim King, Kshitij Bansal ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -26,9 +26,9 @@ #include "util/ostream_util.h" #ifdef CVC4_STATISTICS_ON -# define __CVC4_USE_STATISTICS true +# define CVC4_USE_STATISTICS true #else -# define __CVC4_USE_STATISTICS false +# define CVC4_USE_STATISTICS false #endif @@ -148,7 +148,7 @@ std::ostream& operator<<(std::ostream& os, const timespec& t) { StatisticsRegistry::StatisticsRegistry(const std::string& name) : Stat(name) { d_prefix = name; - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { PrettyCheckArgument(d_name.find(s_regDelim) == std::string::npos, name, "StatisticsRegistry names cannot contain the string \"%s\"", s_regDelim.c_str()); @@ -194,7 +194,7 @@ void StatisticsRegistry::safeFlushInformation(int fd) const { } void TimerStat::start() { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { PrettyCheckArgument(!d_running, *this, "timer already running"); clock_gettime(CLOCK_MONOTONIC, &d_start); d_running = true; @@ -202,7 +202,7 @@ void TimerStat::start() { }/* TimerStat::start() */ void TimerStat::stop() { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { CVC4_CHECK(d_running) << "timer not running"; ::timespec end; clock_gettime(CLOCK_MONOTONIC, &end); @@ -217,7 +217,7 @@ bool TimerStat::running() const { timespec TimerStat::getData() const { ::timespec data = d_data; - if(__CVC4_USE_STATISTICS && d_running) { + if(CVC4_USE_STATISTICS && d_running) { ::timespec end; clock_gettime(CLOCK_MONOTONIC, &end); data += end - d_start; @@ -227,7 +227,7 @@ timespec TimerStat::getData() const { SExpr TimerStat::getValue() const { ::timespec data = d_data; - if(__CVC4_USE_STATISTICS && d_running) { + if(CVC4_USE_STATISTICS && d_running) { ::timespec end; clock_gettime(CLOCK_MONOTONIC, &end); data += end - d_start; @@ -253,4 +253,4 @@ RegisterStatistic::~RegisterStatistic() { }/* CVC4 namespace */ -#undef __CVC4_USE_STATISTICS +#undef CVC4_USE_STATISTICS diff --git a/src/util/statistics_registry.h b/src/util/statistics_registry.h index d7f105b65..a369be272 100644 --- a/src/util/statistics_registry.h +++ b/src/util/statistics_registry.h @@ -2,9 +2,9 @@ /*! \file statistics_registry.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andres Noetzli + ** Morgan Deters, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -33,8 +33,8 @@ #include "cvc4_private_library.h" -#ifndef __CVC4__STATISTICS_REGISTRY_H -#define __CVC4__STATISTICS_REGISTRY_H +#ifndef CVC4__STATISTICS_REGISTRY_H +#define CVC4__STATISTICS_REGISTRY_H #include <stdint.h> @@ -60,9 +60,9 @@ namespace CVC4 { std::ostream& operator<<(std::ostream& os, const timespec& t) CVC4_PUBLIC; #ifdef CVC4_STATISTICS_ON -# define __CVC4_USE_STATISTICS true +# define CVC4_USE_STATISTICS true #else -# define __CVC4_USE_STATISTICS false +# define CVC4_USE_STATISTICS false #endif @@ -93,7 +93,7 @@ public: */ Stat(const std::string& name) : d_name(name) { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { CheckArgument(d_name.find(", ") == std::string::npos, name, "Statistics names cannot include a comma (',')"); } @@ -122,7 +122,7 @@ public: * May be redefined by a child class */ virtual void flushStat(std::ostream& out) const { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { out << d_name << ", "; flushInformation(out); } @@ -135,7 +135,7 @@ public: * May be redefined by a child class */ virtual void safeFlushStat(int fd) const { - if (__CVC4_USE_STATISTICS) { + if (CVC4_USE_STATISTICS) { safe_print(fd, d_name); safe_print(fd, ", "); safeFlushInformation(fd); @@ -230,14 +230,14 @@ public: /** Flush the value of the statistic to the given output stream. */ void flushInformation(std::ostream& out) const override { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { out << getData(); } } void safeFlushInformation(int fd) const override { - if (__CVC4_USE_STATISTICS) { + if (CVC4_USE_STATISTICS) { safe_print<T>(fd, getDataRef()); } } @@ -317,7 +317,7 @@ public: /** Set this reference statistic to refer to the given data cell. */ void setData(const T& t) override { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { d_data = &t; } } @@ -352,14 +352,14 @@ public: /** Set the underlying data value to the given value. */ void setData(const T& t) override { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { d_data = t; } } /** Identical to setData(). */ BackedStat<T>& operator=(const T& t) { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { d_data = t; } return *this; @@ -443,7 +443,7 @@ public: /** Increment the underlying integer statistic. */ IntStat& operator++() { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { ++d_data; } return *this; @@ -451,7 +451,7 @@ public: /** Increment the underlying integer statistic by the given amount. */ IntStat& operator+=(int64_t val) { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { d_data += val; } return *this; @@ -459,7 +459,7 @@ public: /** Keep the maximum of the current statistic value and the given one. */ void maxAssign(int64_t val) { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { if(d_data < val) { d_data = val; } @@ -468,7 +468,7 @@ public: /** Keep the minimum of the current statistic value and the given one. */ void minAssign(int64_t val) { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { if(d_data > val) { d_data = val; } @@ -530,7 +530,7 @@ public: /** Add an entry to the running-average calculation. */ void addEntry(double e) { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { ++d_count; d_sum += e; setData(d_sum / d_count); @@ -589,7 +589,7 @@ public: void flushInformation(std::ostream& out) const override { - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { typename Histogram::const_iterator i = d_hist.begin(); typename Histogram::const_iterator end = d_hist.end(); out << "["; @@ -608,7 +608,7 @@ public: void safeFlushInformation(int fd) const override { - if (__CVC4_USE_STATISTICS) { + if (CVC4_USE_STATISTICS) { typename Histogram::const_iterator i = d_hist.begin(); typename Histogram::const_iterator end = d_hist.end(); safe_print(fd, "["); @@ -630,7 +630,7 @@ public: } HistogramStat& operator<<(const T& val){ - if(__CVC4_USE_STATISTICS) { + if(CVC4_USE_STATISTICS) { if(d_hist.find(val) == d_hist.end()){ d_hist.insert(std::make_pair(val,0)); } @@ -797,8 +797,8 @@ private: };/* class RegisterStatistic */ -#undef __CVC4_USE_STATISTICS +#undef CVC4_USE_STATISTICS }/* CVC4 namespace */ -#endif /* __CVC4__STATISTICS_REGISTRY_H */ +#endif /* CVC4__STATISTICS_REGISTRY_H */ diff --git a/src/util/tuple.h b/src/util/tuple.h index a60393ca0..13b605794 100644 --- a/src/util/tuple.h +++ b/src/util/tuple.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__TUPLE_H -#define __CVC4__TUPLE_H +#ifndef CVC4__TUPLE_H +#define CVC4__TUPLE_H #include <iostream> #include <string> @@ -50,4 +50,4 @@ inline std::ostream& operator<<(std::ostream& out, const TupleUpdate& t) { }/* CVC4 namespace */ -#endif /* __CVC4__TUPLE_H */ +#endif /* CVC4__TUPLE_H */ diff --git a/src/util/unsafe_interrupt_exception.h b/src/util/unsafe_interrupt_exception.h index 1cf54b7f1..5c8360cdf 100644 --- a/src/util/unsafe_interrupt_exception.h +++ b/src/util/unsafe_interrupt_exception.h @@ -2,9 +2,9 @@ /*! \file unsafe_interrupt_exception.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Tim King + ** Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -15,8 +15,8 @@ #include "cvc4_public.h" -#ifndef __CVC4__UNSAFE_INTERRUPT_EXCEPTION_H -#define __CVC4__UNSAFE_INTERRUPT_EXCEPTION_H +#ifndef CVC4__UNSAFE_INTERRUPT_EXCEPTION_H +#define CVC4__UNSAFE_INTERRUPT_EXCEPTION_H #include "base/exception.h" @@ -40,4 +40,4 @@ public: }/* CVC4 namespace */ -#endif /* __CVC4__UNSAFE_INTERRUPT_EXCEPTION_H */ +#endif /* CVC4__UNSAFE_INTERRUPT_EXCEPTION_H */ diff --git a/src/util/utility.h b/src/util/utility.h index 56a68ca40..275efd9d0 100644 --- a/src/util/utility.h +++ b/src/util/utility.h @@ -2,9 +2,9 @@ /*! \file utility.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Aina Niemetz + ** Morgan Deters, Andres Noetzli, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -16,8 +16,8 @@ #include "cvc4_private.h" -#ifndef __CVC4__UTILITY_H -#define __CVC4__UTILITY_H +#ifndef CVC4__UTILITY_H +#define CVC4__UTILITY_H #include <algorithm> #include <utility> @@ -87,4 +87,4 @@ void container_to_stream(std::ostream& out, }/* CVC4 namespace */ -#endif /* __CVC4__UTILITY_H */ +#endif /* CVC4__UTILITY_H */ diff --git a/test/java/BitVectors.java b/test/java/BitVectors.java index f24861322..1a750ff23 100644 --- a/test/java/BitVectors.java +++ b/test/java/BitVectors.java @@ -2,9 +2,9 @@ /*! \file BitVectors.java ** \verbatim ** Top contributors (to current version): - ** Pat Hawks + ** Pat Hawks, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/java/BitVectorsAndArrays.java b/test/java/BitVectorsAndArrays.java index baf9e3b77..de016a2cc 100644 --- a/test/java/BitVectorsAndArrays.java +++ b/test/java/BitVectorsAndArrays.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Pat Hawks ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/java/Combination.java b/test/java/Combination.java index 9034b5714..5b22945a1 100644 --- a/test/java/Combination.java +++ b/test/java/Combination.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Pat Hawks ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/java/HelloWorld.java b/test/java/HelloWorld.java index 72546e884..f1e0768e2 100644 --- a/test/java/HelloWorld.java +++ b/test/java/HelloWorld.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Pat Hawks ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/java/LinearArith.java b/test/java/LinearArith.java index 3180b318f..8f90b4a6d 100644 --- a/test/java/LinearArith.java +++ b/test/java/LinearArith.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Pat Hawks ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 6f147db3c..714459a85 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -363,6 +363,7 @@ set(regress_0_tests regress0/datatypes/example-dailler-min.smt2 regress0/datatypes/is_test.smt2 regress0/datatypes/issue1433.smt2 + regress0/datatypes/issue2838.cvc regress0/datatypes/jsat-2.6.smt2 regress0/datatypes/model-subterms-min.smt2 regress0/datatypes/mutually-recursive.cvc @@ -413,6 +414,7 @@ set(regress_0_tests regress0/decision/wchains010ue.delta02.smt regress0/declare-fun-is-match.smt2 regress0/declare-funs.smt2 + regress0/define-fun-model.smt2 regress0/distinct.smt regress0/expect/scrub.01.smt regress0/expect/scrub.02.smt @@ -450,6 +452,7 @@ set(regress_0_tests regress0/fp/abs-unsound2.smt2 regress0/fp/ext-rew-test.smt2 regress0/fp/simple.smt2 + regress0/fp/wrong-model.smt2 regress0/fuzz_1.smt regress0/fuzz_3.smt regress0/get-value-incremental.smt2 @@ -475,6 +478,7 @@ set(regress_0_tests regress0/ho/ite-apply-eq.smt2 regress0/ho/lambda-equality-non-canon.smt2 regress0/ho/modulo-func-equality.smt2 + regress0/ho/shadowing-defs.smt2 regress0/ho/simple-matching-partial.smt2 regress0/ho/simple-matching.smt2 regress0/ho/trans.smt2 @@ -517,6 +521,7 @@ set(regress_0_tests regress0/nl/nta/cos-sig-value.smt2 regress0/nl/nta/exp-n0.5-lb.smt2 regress0/nl/nta/exp-n0.5-ub.smt2 + regress0/nl/nta/exp-neg2-unsat-unsound.smt2 regress0/nl/nta/exp1-ub.smt2 regress0/nl/nta/real-pi.smt2 regress0/nl/nta/sin-sym.smt2 @@ -530,6 +535,7 @@ set(regress_0_tests regress0/options/invalid_dump.smt2 regress0/parallel-let.smt2 regress0/parser/as.smt2 + regress0/parser/bv_arity_smt2.6.smt2 regress0/parser/constraint.smt2 regress0/parser/declarefun-emptyset-uf.smt2 regress0/parser/shadow_fun_symbol_all.smt2 @@ -827,6 +833,7 @@ set(regress_0_tests regress0/strings/ilc-like.smt2 regress0/strings/indexof-sym-simp.smt2 regress0/strings/issue1189.smt2 + regress0/strings/issue2958.smt2 regress0/strings/itos-entail.smt2 regress0/strings/leadingzero001.smt2 regress0/strings/loop001.smt2 @@ -839,7 +846,6 @@ set(regress_0_tests regress0/strings/rewrites-re-concat.smt2 regress0/strings/rewrites-v2.smt2 regress0/strings/std2.6.1.smt2 - regress0/strings/stoi-solve.smt2 regress0/strings/str003.smt2 regress0/strings/str004.smt2 regress0/strings/str005.smt2 @@ -876,6 +882,7 @@ set(regress_0_tests regress0/test9.cvc regress0/tptp/ARI086=1.p regress0/tptp/DAT001=1.p + regress0/tptp/is_rat_simple.p regress0/tptp/KRS018+1.p regress0/tptp/KRS063+1.p regress0/tptp/MGT019+2.p @@ -928,6 +935,7 @@ set(regress_0_tests regress0/uf/euf_simp12.smt regress0/uf/euf_simp13.smt regress0/uf/iso_brn001.smt + regress0/uf/issue2947.smt2 regress0/uf/pred.smt regress0/uf/simple.01.cvc regress0/uf/simple.02.cvc @@ -1172,7 +1180,6 @@ set(regress_1_tests regress1/lemmas/clocksynchro_5clocks.main_invar.base.smt regress1/lemmas/pursuit-safety-8.smt regress1/lemmas/simple_startup_9nodes.abstract.base.smt - regress1/nl/NAVIGATION2.smt2 regress1/nl/approx-sqrt-unsat.smt2 regress1/nl/approx-sqrt.smt2 regress1/nl/arctan2-expdef.smt2 @@ -1491,6 +1498,7 @@ set(regress_1_tests regress1/sets/fuzz31811.smt2 regress1/sets/insert_invariant_37_2.smt2 regress1/sets/issue2568.smt2 + regress1/sets/issue2904.smt2 regress1/sets/lemmabug-ListElts317minimized.smt2 regress1/sets/remove_check_free_31_6.smt2 regress1/sets/sets-disequal.smt2 @@ -1528,6 +1536,8 @@ set(regress_1_tests regress1/strings/issue1684-regex.smt2 regress1/strings/issue2060.smt2 regress1/strings/issue2429-code.smt2 + regress1/strings/issue2981.smt2 + regress1/strings/issue2982.smt2 regress1/strings/kaluza-fl.smt2 regress1/strings/loop002.smt2 regress1/strings/loop003.smt2 @@ -1560,6 +1570,7 @@ set(regress_1_tests regress1/strings/replaceall-replace.smt2 regress1/strings/rew-020618.smt2 regress1/strings/stoi-400million.smt2 + regress1/strings/stoi-solve.smt2 regress1/strings/str-code-sat.smt2 regress1/strings/str-code-unsat-2.smt2 regress1/strings/str-code-unsat-3.smt2 @@ -1579,6 +1590,7 @@ set(regress_1_tests regress1/strings/type002.smt2 regress1/strings/type003.smt2 regress1/strings/username_checker_min.smt2 + regress1/sygus-abduct-test.smt2 regress1/sygus/VC22_a.sy regress1/sygus/abv.sy regress1/sygus/array_search_2.sy @@ -1600,8 +1612,11 @@ set(regress_1_tests regress1/sygus/crci-ssb-unk.sy regress1/sygus/crcy-si-rcons.sy regress1/sygus/crcy-si.sy + regress1/sygus/cube-nia.sy + regress1/sygus/double.sy regress1/sygus/dt-test-ns.sy regress1/sygus/dup-op.sy + regress1/sygus/extract.sy regress1/sygus/fg_polynomial3.sy regress1/sygus/find_sc_bvult_bvnot.sy regress1/sygus/hd-01-d1-prog.sy @@ -1615,6 +1630,8 @@ set(regress_1_tests regress1/sygus/inv-example.sy regress1/sygus/inv-missed-sol-true.sy regress1/sygus/inv-unused.sy + regress1/sygus/issue2914.sy + regress1/sygus/issue2935.sy regress1/sygus/large-const-simp.sy regress1/sygus/let-bug-simp.sy regress1/sygus/list-head-x.sy @@ -1649,6 +1666,7 @@ set(regress_1_tests regress1/sygus/sygus-uf-ex.sy regress1/sygus/t8.sy regress1/sygus/temp_input_to_synth_ic-error-121418.sy + regress1/sygus/tester.sy regress1/sygus/tl-type-0.sy regress1/sygus/tl-type-4x.sy regress1/sygus/tl-type.sy @@ -1735,12 +1753,12 @@ set(regress_2_tests regress2/quantifiers/mutualrec2.cvc regress2/quantifiers/net-policy-no-time.smt2 regress2/quantifiers/nunchaku2309663.nun.min.smt2 + regress2/quantifiers/syn874-1.smt2 regress2/simplify.javafe.ast.ArrayInit.35_without_quantification2.smt2 regress2/strings/cmu-dis-0707-3.smt2 regress2/strings/cmu-disagree-0707-dd.smt2 regress2/strings/cmu-prereg-fmf.smt2 regress2/strings/cmu-repl-len-nterm.smt2 - regress2/strings/extf_d_perf.smt2 regress2/strings/issue918.smt2 regress2/strings/non_termination_regular_expression6.smt2 regress2/strings/norn-dis-0707-3.smt2 @@ -1789,6 +1807,7 @@ set(regress_3_tests regress3/pp-regfile.smt regress3/qwh.35.405.shuffled-as.sat03-1651.smt regress3/sixfuncs.sy + regress3/strings/extf_d_perf.smt2 ) #-----------------------------------------------------------------------------# @@ -2073,6 +2092,8 @@ set(regression_disabled_tests regress1/ho/hoa0102.smt2 # issue1048-arrays-int-real.smt2 -- different errors on debug and production. regress1/issue1048-arrays-int-real.smt2 + # times out after update to tangent planes + regress1/nl/NAVIGATION2.smt2 # ajreynol: disabled these since they give different error messages on # production and debug: regress1/quantifiers/macro-subtype-param.smt2 diff --git a/test/regress/regress0/bv/ackermann2.smt2 b/test/regress/regress0/bv/ackermann2.smt2 index b1aaa7d64..1799df63c 100644 --- a/test/regress/regress0/bv/ackermann2.smt2 +++ b/test/regress/regress0/bv/ackermann2.smt2 @@ -1,4 +1,9 @@ ; COMMAND-LINE: --bitblast=eager --no-check-models --no-check-unsat-cores +; REQUIRES: cryptominisat +; REQUIRES: drat2er +; COMMAND-LINE: --bitblast=eager --bv-sat-solver=cryptominisat --bv-proof-format=lrat --check-proofs --no-check-unsat-cores +; COMMAND-LINE: --bitblast=eager --bv-sat-solver=cryptominisat --bv-proof-format=drat --check-proofs --no-check-unsat-cores +; COMMAND-LINE: --bitblast=eager --bv-sat-solver=cryptominisat --bv-proof-format=er --check-proofs --no-check-unsat-cores ; EXPECT: unsat (set-logic QF_UFBV) (set-info :smt-lib-version 2.0) diff --git a/test/regress/regress0/bv/core/slice-12.smt b/test/regress/regress0/bv/core/slice-12.smt index 998dee663..261d55ec9 100644 --- a/test/regress/regress0/bv/core/slice-12.smt +++ b/test/regress/regress0/bv/core/slice-12.smt @@ -1,3 +1,9 @@ +; REQUIRES: cryptominisat +; REQUIRES: drat2er +; COMMAND-LINE: --bitblast=eager --bv-sat-solver=cryptominisat --bv-proof-format=lrat --check-proofs --no-check-unsat-cores +; COMMAND-LINE: --bitblast=eager --bv-sat-solver=cryptominisat --bv-proof-format=drat --check-proofs --no-check-unsat-cores +; COMMAND-LINE: --bitblast=eager --bv-sat-solver=cryptominisat --bv-proof-format=er --check-proofs --no-check-unsat-cores +; EXPECT: unsat (benchmark slice :status unsat :logic QF_BV diff --git a/test/regress/regress0/bv/temp.lrat b/test/regress/regress0/bv/temp.lrat new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/regress/regress0/bv/temp.lrat diff --git a/test/regress/regress0/datatypes/issue2838.cvc b/test/regress/regress0/datatypes/issue2838.cvc new file mode 100644 index 000000000..95e1c898a --- /dev/null +++ b/test/regress/regress0/datatypes/issue2838.cvc @@ -0,0 +1,14 @@ +% EXPECT: sat +Ints_0 : ARRAY INT OF INT; +C : TYPE = [# i : INT #]; +CType : TYPE = ARRAY INT OF C; +C_0 : CType; +x : INT; +C_1 : CType = C_0 WITH [0].i := 2; + +ASSERT C_0[0].i = 0; +ASSERT C_0[1].i = 1; +ASSERT Ints_0[2] = Ints_0[0]; +ASSERT x = Ints_0[C_1[0].i]; +ASSERT x /= Ints_0[C_1[1].i]; +CHECKSAT; diff --git a/test/regress/regress0/define-fun-model.smt2 b/test/regress/regress0/define-fun-model.smt2 new file mode 100644 index 000000000..c6ca206fc --- /dev/null +++ b/test/regress/regress0/define-fun-model.smt2 @@ -0,0 +1,16 @@ +; SCRUBBER: sed -e 's/BOUND_VARIABLE_[0-9]*/BOUND_VARIABLE/' +; EXPECT: sat +; EXPECT: (((f 4) 7)) +; EXPECT: ((g (lambda ((BOUND_VARIABLE Int)) 7))) +; EXPECT: ((f (lambda ((BOUND_VARIABLE Int)) 7))) +(set-logic UFLIA) +(set-option :produce-models true) +(define-fun f ((x Int)) Int 7) +(declare-fun g (Int) Int) + +(assert (= (g 5) (f 5))) + +(check-sat) +(get-value ((f 4))) +(get-value (g)) +(get-value (f)) diff --git a/test/regress/regress0/fp/abs-unsound.smt2 b/test/regress/regress0/fp/abs-unsound.smt2 index 4ac53b830..b5aa0452e 100644 --- a/test/regress/regress0/fp/abs-unsound.smt2 +++ b/test/regress/regress0/fp/abs-unsound.smt2 @@ -1,4 +1,5 @@ ; REQUIRES: symfpu +; COMMAND-LINE: --fp-exp ; EXPECT: sat (set-logic QF_FP) (set-info :status sat) diff --git a/test/regress/regress0/fp/abs-unsound2.smt2 b/test/regress/regress0/fp/abs-unsound2.smt2 index a6172b157..ad603f8c9 100644 --- a/test/regress/regress0/fp/abs-unsound2.smt2 +++ b/test/regress/regress0/fp/abs-unsound2.smt2 @@ -1,4 +1,5 @@ ; REQUIRES: symfpu +; COMMAND-LINE: --fp-exp ; EXPECT: unsat (set-logic QF_FP) (set-info :status unsat) diff --git a/test/regress/regress0/fp/wrong-model.smt2 b/test/regress/regress0/fp/wrong-model.smt2 new file mode 100644 index 000000000..7694d8a35 --- /dev/null +++ b/test/regress/regress0/fp/wrong-model.smt2 @@ -0,0 +1,12 @@ +; REQUIRES: symfpu +; COMMAND-LINE: --fp-exp +; EXPECT: sat + +; NOTE: the (set-logic ALL) is on purpose because the problem was not triggered +; with QF_FP. +(set-logic ALL) +(declare-const r RoundingMode) +(declare-const x (_ FloatingPoint 5 11)) +(declare-const y (_ FloatingPoint 5 11)) +(assert (not (= (fp.isSubnormal x) false))) +(check-sat) diff --git a/test/regress/regress0/ho/shadowing-defs.smt2 b/test/regress/regress0/ho/shadowing-defs.smt2 new file mode 100644 index 000000000..722e970b6 --- /dev/null +++ b/test/regress/regress0/ho/shadowing-defs.smt2 @@ -0,0 +1,41 @@ +; COMMAND-LINE: --uf-ho +; EXPECT: unknown +(set-logic ALL) +(declare-sort $$unsorted 0) +(declare-sort mu 0) + +(declare-fun mnot ((-> $$unsorted Bool) $$unsorted) Bool) +(assert (= mnot (lambda ((Phi (-> $$unsorted Bool)) (W $$unsorted)) (not (Phi W))))) + +(declare-fun mor ((-> $$unsorted Bool) (-> $$unsorted Bool) $$unsorted) Bool) +(assert (= mor (lambda ((Phi (-> $$unsorted Bool)) (Psi (-> $$unsorted Bool)) (W $$unsorted)) (or (Phi W) (Psi W))))) + +(declare-fun mand ((-> $$unsorted Bool) (-> $$unsorted Bool) $$unsorted) Bool) +(assert (= mand (lambda ((Phi (-> $$unsorted Bool)) (Psi (-> $$unsorted Bool)) (__flatten_var_0 $$unsorted)) (mnot (mor (mnot Phi) (mnot Psi)) __flatten_var_0)))) + +(declare-fun mimplies ((-> $$unsorted Bool) (-> $$unsorted Bool) $$unsorted) Bool) +(assert (= mimplies (lambda ((Phi (-> $$unsorted Bool)) (Psi (-> $$unsorted Bool)) (__flatten_var_0 $$unsorted)) (mor (mnot Phi) Psi __flatten_var_0)))) + +(declare-fun mforall_ind ((-> mu $$unsorted Bool) $$unsorted) Bool) +(assert (= mforall_ind (lambda ((Phi (-> mu $$unsorted Bool)) (W $$unsorted)) (forall ((X mu)) (Phi X W) )))) + +(declare-fun mbox ((-> $$unsorted $$unsorted Bool) (-> $$unsorted Bool) $$unsorted) Bool) +(assert (= mbox (lambda ((R (-> $$unsorted $$unsorted Bool)) (Phi (-> $$unsorted Bool)) (W $$unsorted)) (forall ((V $$unsorted)) (or (not (R W V)) (Phi V)) )))) + +(declare-fun mvalid ((-> $$unsorted Bool)) Bool) +(assert (= mvalid (lambda ((Phi (-> $$unsorted Bool))) (forall ((W $$unsorted)) (Phi W) )))) + +(declare-fun a1 ($$unsorted $$unsorted) Bool) +(declare-fun a2 ($$unsorted $$unsorted) Bool) +(declare-fun a3 ($$unsorted $$unsorted) Bool) + +(declare-fun jan () mu) +(declare-fun cola () mu) + +(declare-fun likes (mu mu $$unsorted) Bool) + +(declare-fun very_much_likes (mu mu $$unsorted) Bool) + +(assert (mvalid (mforall_ind (lambda ((X mu) (__flatten_var_0 $$unsorted)) (mforall_ind (lambda ((Y mu) (__flatten_var_0 $$unsorted)) (mbox a3 (mimplies (mand (likes X Y) (mand (mbox a1 (likes X Y)) (mbox a2 (likes X Y)))) (very_much_likes X Y)) __flatten_var_0)) __flatten_var_0))))) + +(check-sat)
\ No newline at end of file diff --git a/test/regress/regress0/nl/nta/exp-neg2-unsat-unsound.smt2 b/test/regress/regress0/nl/nta/exp-neg2-unsat-unsound.smt2 new file mode 100644 index 000000000..69c36179a --- /dev/null +++ b/test/regress/regress0/nl/nta/exp-neg2-unsat-unsound.smt2 @@ -0,0 +1,10 @@ +; COMMAND-LINE: --nl-ext-tf-tplanes --no-check-models +; EXPECT: sat +(set-logic QF_NRAT) +(declare-fun x () Real) +(assert (or +(and (<= (exp x) 0.01) (= x (- 2.0))) +(and (> (exp x) 0.2) (= x (- 1.0))) +) +) +(check-sat) diff --git a/test/regress/regress0/parser/bv_arity_smt2.6.smt2 b/test/regress/regress0/parser/bv_arity_smt2.6.smt2 new file mode 100644 index 000000000..437d80f56 --- /dev/null +++ b/test/regress/regress0/parser/bv_arity_smt2.6.smt2 @@ -0,0 +1,13 @@ +; COMMAND-LINE: --strict-parsing +(set-info :status unsat) +(set-logic QF_BV) +(declare-const x (_ BitVec 8)) +(declare-const y (_ BitVec 8)) +(declare-const z (_ BitVec 8)) +(assert (or (not (= (bvadd x y z) (bvadd (bvadd x y) z))) + (not (= (bvmul x y z) (bvmul (bvmul x y) z))) + (not (= (bvand x y z) (bvand (bvand x y) z))) + (not (= (bvor x y z) (bvor (bvor x y) z))) + (not (= (bvxor x y z) (bvxor (bvxor x y) z))) + (not (= (bvxnor x y z) (bvxnor (bvxnor x y) z))))) +(check-sat) diff --git a/test/regress/regress0/quantifiers/ARI176e1.smt2 b/test/regress/regress0/quantifiers/ARI176e1.smt2 index caed9c603..36dccc21f 100644 --- a/test/regress/regress0/quantifiers/ARI176e1.smt2 +++ b/test/regress/regress0/quantifiers/ARI176e1.smt2 @@ -1,5 +1,4 @@ -; COMMAND-LINE: --cbqi-recurse -; EXPECT: unsat (set-logic LIA) +(set-info :status unsat) (assert (forall ((U Int) (V Int)) (not (= (* 3 U) (+ 22 (* (- 5) V)))) ) ) (check-sat) diff --git a/test/regress/regress0/quantifiers/nested-delta.smt2 b/test/regress/regress0/quantifiers/nested-delta.smt2 index 9352f0410..137a5eee3 100644 --- a/test/regress/regress0/quantifiers/nested-delta.smt2 +++ b/test/regress/regress0/quantifiers/nested-delta.smt2 @@ -1,6 +1,4 @@ -; COMMAND-LINE: --cbqi-recurse -; EXPECT: sat (set-logic LRA) (set-info :status sat) (assert (forall ((x Real)) (or (exists ((y Real)) (and (< y 0) (< y x))) (<= x 0)))) -(check-sat)
\ No newline at end of file +(check-sat) diff --git a/test/regress/regress0/quantifiers/nested-inf.smt2 b/test/regress/regress0/quantifiers/nested-inf.smt2 index f27a876db..ea397f8db 100644 --- a/test/regress/regress0/quantifiers/nested-inf.smt2 +++ b/test/regress/regress0/quantifiers/nested-inf.smt2 @@ -1,6 +1,4 @@ -; COMMAND-LINE: --cbqi-recurse -; EXPECT: sat (set-logic LRA) (set-info :status sat) (assert (forall ((x Real)) (exists ((y Real)) (> y x)))) -(check-sat)
\ No newline at end of file +(check-sat) diff --git a/test/regress/regress0/rels/rel_join_5.cvc b/test/regress/regress0/rels/rel_join_5.cvc index 5209d8131..590e581a7 100644 --- a/test/regress/regress0/rels/rel_join_5.cvc +++ b/test/regress/regress0/rels/rel_join_5.cvc @@ -14,6 +14,6 @@ ASSERT (3, 4) IS_IN z; a : IntPair; ASSERT a = (1,4); -ASSERT r = (((TRANSPOSE x) JOIN y) JOIN z); +ASSERT r = ((TRANSPOSE(x) JOIN y) JOIN z); ASSERT NOT (a IS_IN r); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tc_11.cvc b/test/regress/regress0/rels/rel_tc_11.cvc index 7edeb0efb..813b8235b 100644 --- a/test/regress/regress0/rels/rel_tc_11.cvc +++ b/test/regress/regress0/rels/rel_tc_11.cvc @@ -12,7 +12,7 @@ ASSERT z = (x PRODUCT y); ASSERT (1, 2, 3, 4) IS_IN z; ASSERT NOT ((5, 9) IS_IN x); ASSERT (3, 8) IS_IN y; -ASSERT y = (TCLOSURE x); +ASSERT y = TCLOSURE(x); ASSERT NOT ((1, 2) IS_IN y); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tc_3.cvc b/test/regress/regress0/rels/rel_tc_3.cvc index 39564c4cf..dc2138357 100644 --- a/test/regress/regress0/rels/rel_tc_3.cvc +++ b/test/regress/regress0/rels/rel_tc_3.cvc @@ -15,8 +15,8 @@ ASSERT (b = d); ASSERT (b > (d -1)); ASSERT (b < (d+1)); %ASSERT (2,3) IS_IN ((x JOIN x) JOIN x); -%ASSERT NOT (2, 3) IS_IN (TCLOSURE x); -ASSERT y = (TCLOSURE x); +%ASSERT NOT (2, 3) IS_IN TCLOSURE(x); +ASSERT y = TCLOSURE(x); ASSERT NOT ((1, 1) IS_IN y); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tc_3_1.cvc b/test/regress/regress0/rels/rel_tc_3_1.cvc index 7f5535656..a9b2e8b98 100644 --- a/test/regress/regress0/rels/rel_tc_3_1.cvc +++ b/test/regress/regress0/rels/rel_tc_3_1.cvc @@ -13,6 +13,6 @@ ASSERT (1, d) IS_IN x; ASSERT (b, 1) IS_IN x; ASSERT (b = d); -ASSERT y = (TCLOSURE x); +ASSERT y = TCLOSURE(x); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tc_7.cvc b/test/regress/regress0/rels/rel_tc_7.cvc index 15c0510a6..1958c0eee 100644 --- a/test/regress/regress0/rels/rel_tc_7.cvc +++ b/test/regress/regress0/rels/rel_tc_7.cvc @@ -3,8 +3,8 @@ OPTION "logic" "ALL_SUPPORTED"; IntPair: TYPE = [INT, INT]; x : SET OF IntPair; y : SET OF IntPair; -ASSERT y = ((TCLOSURE x) JOIN x); +ASSERT y = (TCLOSURE(x) JOIN x); ASSERT (1,2) IS_IN ((x JOIN x) JOIN x); -ASSERT NOT (y <= TCLOSURE x); +ASSERT NOT (y <= TCLOSURE(x)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tc_8.cvc b/test/regress/regress0/rels/rel_tc_8.cvc index 9f5879c6d..ecf938c23 100644 --- a/test/regress/regress0/rels/rel_tc_8.cvc +++ b/test/regress/regress0/rels/rel_tc_8.cvc @@ -4,7 +4,7 @@ IntPair: TYPE = [INT, INT]; x : SET OF IntPair; y : SET OF IntPair; -ASSERT (2, 2) IS_IN (TCLOSURE x); +ASSERT (2, 2) IS_IN TCLOSURE(x); ASSERT x = {}::SET OF IntPair; CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tp_3_1.cvc b/test/regress/regress0/rels/rel_tp_3_1.cvc index 46806b432..00c83e2d2 100644 --- a/test/regress/regress0/rels/rel_tp_3_1.cvc +++ b/test/regress/regress0/rels/rel_tp_3_1.cvc @@ -7,8 +7,8 @@ z: SET OF IntPair; ASSERT (1, 3) IS_IN x; ASSERT ((2,3) IS_IN z OR (2,1) IS_IN z); -ASSERT y = (TRANSPOSE x); +ASSERT y = TRANSPOSE(x); ASSERT NOT (1,2) IS_IN y; ASSERT x = z; -CHECKSAT;
\ No newline at end of file +CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tp_join_0.cvc b/test/regress/regress0/rels/rel_tp_join_0.cvc index a03f0e3fd..9aaf6d9b1 100644 --- a/test/regress/regress0/rels/rel_tp_join_0.cvc +++ b/test/regress/regress0/rels/rel_tp_join_0.cvc @@ -28,5 +28,5 @@ ASSERT (4, 7) IS_IN y; ASSERT r = (x JOIN y); ASSERT z IS_IN x; ASSERT zt IS_IN y; -ASSERT NOT (a IS_IN (TRANSPOSE r)); +ASSERT NOT (a IS_IN TRANSPOSE(r)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tp_join_1.cvc b/test/regress/regress0/rels/rel_tp_join_1.cvc index 60b6edf58..5d9b5447f 100644 --- a/test/regress/regress0/rels/rel_tp_join_1.cvc +++ b/test/regress/regress0/rels/rel_tp_join_1.cvc @@ -28,5 +28,5 @@ ASSERT a = (4,1); ASSERT r = ((x JOIN y) JOIN z); -ASSERT NOT (a IS_IN (TRANSPOSE r)); +ASSERT NOT (a IS_IN TRANSPOSE(r)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tp_join_2.cvc b/test/regress/regress0/rels/rel_tp_join_2.cvc index cc851f622..40471c1f9 100644 --- a/test/regress/regress0/rels/rel_tp_join_2.cvc +++ b/test/regress/regress0/rels/rel_tp_join_2.cvc @@ -14,6 +14,6 @@ ASSERT (3, 4) IS_IN z; a : IntPair; ASSERT a = (4,1); -ASSERT r = (((TRANSPOSE x) JOIN y) JOIN z); -ASSERT NOT (a IS_IN (TRANSPOSE r)); +ASSERT r = ((TRANSPOSE(x) JOIN y) JOIN z); +ASSERT NOT (a IS_IN TRANSPOSE(r)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tp_join_3.cvc b/test/regress/regress0/rels/rel_tp_join_3.cvc index 25277f43a..008b2aa1e 100644 --- a/test/regress/regress0/rels/rel_tp_join_3.cvc +++ b/test/regress/regress0/rels/rel_tp_join_3.cvc @@ -17,11 +17,11 @@ ASSERT (3, 3) IS_IN w; a : IntPair; ASSERT a = (4,1); -%ASSERT r = (((TRANSPOSE x) JOIN y) JOIN (w JOIN z)); -ASSERT NOT (a IS_IN (TRANSPOSE r)); +%ASSERT r = ((TRANSPOSE(x) JOIN y) JOIN (w JOIN z)); +ASSERT NOT (a IS_IN TRANSPOSE(r)); zz : SET OF IntPair; -ASSERT zz = ((TRANSPOSE x) JOIN y); +ASSERT zz = (TRANSPOSE(x) JOIN y); ASSERT NOT ((1,3) IS_IN w); ASSERT NOT ((1,3) IS_IN (w | zz) ); diff --git a/test/regress/regress0/rels/rel_tp_join_eq_0.cvc b/test/regress/regress0/rels/rel_tp_join_eq_0.cvc index 54e16dd51..c5a90ff29 100644 --- a/test/regress/regress0/rels/rel_tp_join_eq_0.cvc +++ b/test/regress/regress0/rels/rel_tp_join_eq_0.cvc @@ -24,5 +24,5 @@ ASSERT a = (4,1); ASSERT r = ((x JOIN y) JOIN z); -ASSERT NOT (a IS_IN (TRANSPOSE r)); +ASSERT NOT (a IS_IN TRANSPOSE(r)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_tp_join_pro_0.cvc b/test/regress/regress0/rels/rel_tp_join_pro_0.cvc index b05026bc9..77de6b829 100644 --- a/test/regress/regress0/rels/rel_tp_join_pro_0.cvc +++ b/test/regress/regress0/rels/rel_tp_join_pro_0.cvc @@ -16,6 +16,6 @@ ASSERT (3, 4) IS_IN z; v : IntTup; ASSERT v = (4,3,2,1); -ASSERT r = (((TRANSPOSE x) JOIN y) PRODUCT z); -ASSERT NOT (v IS_IN (TRANSPOSE r)); +ASSERT r = ((TRANSPOSE(x) JOIN y) PRODUCT z); +ASSERT NOT (v IS_IN TRANSPOSE(r)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_transpose_0.cvc b/test/regress/regress0/rels/rel_transpose_0.cvc index 49fb87569..d46cacead 100644 --- a/test/regress/regress0/rels/rel_transpose_0.cvc +++ b/test/regress/regress0/rels/rel_transpose_0.cvc @@ -11,8 +11,8 @@ zt : IntPair; ASSERT zt = (2,1); ASSERT z IS_IN x; -ASSERT NOT (zt IS_IN (TRANSPOSE x)); +ASSERT NOT (zt IS_IN TRANSPOSE(x)); -ASSERT y = (TRANSPOSE x); +ASSERT y = TRANSPOSE(x); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_transpose_1.cvc b/test/regress/regress0/rels/rel_transpose_1.cvc index bdcf31bb8..bbd6e5743 100644 --- a/test/regress/regress0/rels/rel_transpose_1.cvc +++ b/test/regress/regress0/rels/rel_transpose_1.cvc @@ -8,5 +8,5 @@ ASSERT z = (1,2,3); zt : IntTup; ASSERT zt = (3,2,1); ASSERT z IS_IN x; -ASSERT NOT (zt IS_IN (TRANSPOSE x)); +ASSERT NOT (zt IS_IN TRANSPOSE(x)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_transpose_1_1.cvc b/test/regress/regress0/rels/rel_transpose_1_1.cvc index fa6ee5069..627e20fbf 100644 --- a/test/regress/regress0/rels/rel_transpose_1_1.cvc +++ b/test/regress/regress0/rels/rel_transpose_1_1.cvc @@ -9,6 +9,6 @@ ASSERT z = (1,2,a); zt : IntTup; ASSERT zt = (3,2,2); ASSERT z IS_IN x; -ASSERT zt IS_IN (TRANSPOSE x); -ASSERT y = (TRANSPOSE x); +ASSERT zt IS_IN TRANSPOSE(x); +ASSERT y = TRANSPOSE(x); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_transpose_3.cvc b/test/regress/regress0/rels/rel_transpose_3.cvc index 5dfe3b031..06cc82c45 100644 --- a/test/regress/regress0/rels/rel_transpose_3.cvc +++ b/test/regress/regress0/rels/rel_transpose_3.cvc @@ -10,6 +10,6 @@ zt : IntPair; ASSERT zt = (2,1); ASSERT (x = y); ASSERT z IS_IN x; -ASSERT NOT (zt IS_IN (TRANSPOSE y)); +ASSERT NOT (zt IS_IN TRANSPOSE(y)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_transpose_4.cvc b/test/regress/regress0/rels/rel_transpose_4.cvc index b260147c8..882148013 100644 --- a/test/regress/regress0/rels/rel_transpose_4.cvc +++ b/test/regress/regress0/rels/rel_transpose_4.cvc @@ -8,6 +8,6 @@ z : IntPair; ASSERT z = (1,2); ASSERT z IS_IN x; -ASSERT NOT ((2, 1) IS_IN (TRANSPOSE x)); +ASSERT NOT ((2, 1) IS_IN TRANSPOSE(x)); CHECKSAT; diff --git a/test/regress/regress0/rels/rel_transpose_6.cvc b/test/regress/regress0/rels/rel_transpose_6.cvc index a2e8bcf10..3923e26b6 100644 --- a/test/regress/regress0/rels/rel_transpose_6.cvc +++ b/test/regress/regress0/rels/rel_transpose_6.cvc @@ -19,6 +19,6 @@ ASSERT x = TRANSPOSE(y); ASSERT NOT (zt IS_IN y); ASSERT z IS_IN y; -ASSERT NOT (zt IS_IN (TRANSPOSE y)); +ASSERT NOT (zt IS_IN TRANSPOSE(y)); CHECKSAT; diff --git a/test/regress/regress0/strings/issue2958.smt2 b/test/regress/regress0/strings/issue2958.smt2 new file mode 100644 index 000000000..7ed5ef7f3 --- /dev/null +++ b/test/regress/regress0/strings/issue2958.smt2 @@ -0,0 +1,7 @@ +(set-info :smt-lib-version 2.5) +(set-logic QF_SLIA) +(set-info :status unsat) +(declare-const x String) +(assert (not (str.prefixof "ab" x))) +(assert (str.in.re (str.substr x 0 2) (re.++ (str.to.re "ab") (re.* (str.to.re "dcab"))))) +(check-sat) diff --git a/test/regress/regress0/tptp/is_rat_simple.p b/test/regress/regress0/tptp/is_rat_simple.p new file mode 100644 index 000000000..c983033b9 --- /dev/null +++ b/test/regress/regress0/tptp/is_rat_simple.p @@ -0,0 +1,8 @@ +% states that all reals are not rational (countersatisfiable) +% Status : CounterSatisfiable +%------------------------------------------------------------------------------ +tff(the,conjecture,( + ! [X: $real] : + ~ $is_rat(X) ) ). + +%------------------------------------------------------------------------------ diff --git a/test/regress/regress0/uf/issue2947.smt2 b/test/regress/regress0/uf/issue2947.smt2 new file mode 100644 index 000000000..6bb60b9d7 --- /dev/null +++ b/test/regress/regress0/uf/issue2947.smt2 @@ -0,0 +1,11 @@ +(set-logic QF_UF) +(set-info :status unsat) +(declare-fun f (Bool) Bool) +(assert + (not (f true)) +) +(assert + (f (ite (f true) true (f false))) +) +(check-sat) +(exit) diff --git a/test/regress/regress1/rels/rel_pressure_0.cvc b/test/regress/regress1/rels/rel_pressure_0.cvc index 6cdf03600..0e9646f95 100644 --- a/test/regress/regress1/rels/rel_pressure_0.cvc +++ b/test/regress/regress1/rels/rel_pressure_0.cvc @@ -611,7 +611,7 @@ ASSERT (1, 9) IS_IN z; a : IntPair; ASSERT a = (9,1); -ASSERT r = (((TRANSPOSE x) JOIN y) JOIN z); -ASSERT NOT (a IS_IN (TRANSPOSE r)); +ASSERT r = ((TRANSPOSE(x) JOIN y) JOIN z); +ASSERT NOT (a IS_IN TRANSPOSE(r)); CHECKSAT; diff --git a/test/regress/regress1/rels/rel_tc_10_1.cvc b/test/regress/regress1/rels/rel_tc_10_1.cvc index 67c444070..65686ef08 100644 --- a/test/regress/regress1/rels/rel_tc_10_1.cvc +++ b/test/regress/regress1/rels/rel_tc_10_1.cvc @@ -12,7 +12,7 @@ ASSERT a = d; ASSERT (1, c) IS_IN x; ASSERT (2, d) IS_IN x; ASSERT (a, 5) IS_IN y; -ASSERT y = (TCLOSURE x); +ASSERT y = TCLOSURE(x); ASSERT ((2, 5) IS_IN y); CHECKSAT; diff --git a/test/regress/regress1/rels/rel_tc_4.cvc b/test/regress/regress1/rels/rel_tc_4.cvc index decd38fe1..a32e8b66d 100644 --- a/test/regress/regress1/rels/rel_tc_4.cvc +++ b/test/regress/regress1/rels/rel_tc_4.cvc @@ -13,7 +13,7 @@ ASSERT (1, d) IS_IN x; ASSERT (b, 1) IS_IN x; ASSERT (b = d); ASSERT (2,b) IS_IN ((x JOIN x) JOIN x); -ASSERT NOT (2, 1) IS_IN (TCLOSURE x); +ASSERT NOT (2, 1) IS_IN TCLOSURE(x); CHECKSAT; diff --git a/test/regress/regress1/rels/rel_tc_4_1.cvc b/test/regress/regress1/rels/rel_tc_4_1.cvc index 8ee75f7e9..484d09ec3 100644 --- a/test/regress/regress1/rels/rel_tc_4_1.cvc +++ b/test/regress/regress1/rels/rel_tc_4_1.cvc @@ -4,7 +4,7 @@ IntPair: TYPE = [INT, INT]; x : SET OF IntPair; y : SET OF IntPair; z : SET OF IntPair; -ASSERT y = ((TCLOSURE x) JOIN x); -ASSERT NOT (y = TCLOSURE x); +ASSERT y = (TCLOSURE(x) JOIN x); +ASSERT NOT (y = TCLOSURE(x)); CHECKSAT; diff --git a/test/regress/regress1/rels/rel_tc_5_1.cvc b/test/regress/regress1/rels/rel_tc_5_1.cvc index fd9caeade..a4b2fe1db 100644 --- a/test/regress/regress1/rels/rel_tc_5_1.cvc +++ b/test/regress/regress1/rels/rel_tc_5_1.cvc @@ -3,7 +3,7 @@ OPTION "logic" "ALL_SUPPORTED"; IntPair: TYPE = [INT, INT]; x : SET OF IntPair; y : SET OF IntPair; -ASSERT y = (TCLOSURE x); +ASSERT y = TCLOSURE(x); ASSERT NOT ( y = ((x JOIN x) JOIN x)); CHECKSAT; diff --git a/test/regress/regress1/rels/rel_tc_6.cvc b/test/regress/regress1/rels/rel_tc_6.cvc index 4570c5a8d..2bc552170 100644 --- a/test/regress/regress1/rels/rel_tc_6.cvc +++ b/test/regress/regress1/rels/rel_tc_6.cvc @@ -3,7 +3,7 @@ OPTION "logic" "ALL_SUPPORTED"; IntPair: TYPE = [INT, INT]; x : SET OF IntPair; y : SET OF IntPair; -ASSERT y = (TCLOSURE x); +ASSERT y = TCLOSURE(x); ASSERT NOT (((x JOIN x) JOIN x) <= y); CHECKSAT; diff --git a/test/regress/regress1/rels/rel_tc_9_1.cvc b/test/regress/regress1/rels/rel_tc_9_1.cvc index f884349b1..8a9e8eeca 100644 --- a/test/regress/regress1/rels/rel_tc_9_1.cvc +++ b/test/regress/regress1/rels/rel_tc_9_1.cvc @@ -6,7 +6,7 @@ y : SET OF IntPair; z : SET OF IntPair; w : SET OF IntPair; -ASSERT z = (TCLOSURE x); +ASSERT z = TCLOSURE(x); ASSERT w = (x JOIN y); ASSERT (2, 2) IS_IN z; ASSERT (0,3) IS_IN y; diff --git a/test/regress/regress1/rels/rel_tp_join_2_1.cvc b/test/regress/regress1/rels/rel_tp_join_2_1.cvc index acf3dbccf..9a79582b7 100644 --- a/test/regress/regress1/rels/rel_tp_join_2_1.cvc +++ b/test/regress/regress1/rels/rel_tp_join_2_1.cvc @@ -14,6 +14,6 @@ ASSERT (3, 4) IS_IN z; a : IntPair; ASSERT a = (4,1); -ASSERT r = (((TRANSPOSE x) JOIN y) JOIN z); -ASSERT a IS_IN (TRANSPOSE r); +ASSERT r = ((TRANSPOSE(x) JOIN y) JOIN z); +ASSERT a IS_IN TRANSPOSE(r); CHECKSAT; diff --git a/test/regress/regress1/rr-verify/bv-term.sy b/test/regress/regress1/rr-verify/bv-term.sy index 278c10339..f310396d2 100644 --- a/test/regress/regress1/rr-verify/bv-term.sy +++ b/test/regress/regress1/rr-verify/bv-term.sy @@ -1,4 +1,3 @@ -; REQUIRES: no-asan ; COMMAND-LINE: --sygus-rr --sygus-samples=1000 --sygus-abort-size=2 --sygus-rr-verify-abort --no-sygus-sym-break ; COMMAND-LINE: --sygus-rr-synth --sygus-samples=1000 --sygus-abort-size=2 --sygus-rr-verify-abort --sygus-rr-synth-check ; EXPECT: (error "Maximum term size (2) for enumerative SyGuS exceeded.") diff --git a/test/regress/regress1/rr-verify/fp-arith.sy b/test/regress/regress1/rr-verify/fp-arith.sy index 61dc19fbb..e8b97d610 100644 --- a/test/regress/regress1/rr-verify/fp-arith.sy +++ b/test/regress/regress1/rr-verify/fp-arith.sy @@ -1,6 +1,5 @@ -; REQUIRES: no-asan ; REQUIRES: symfpu -; COMMAND-LINE: --sygus-rr --sygus-samples=0 --sygus-rr-synth-check --sygus-abort-size=1 --sygus-rr-verify-abort --no-sygus-sym-break +; COMMAND-LINE: --sygus-rr --sygus-samples=0 --sygus-rr-synth-check --sygus-abort-size=1 --sygus-rr-verify-abort --no-sygus-sym-break --fp-exp ; EXPECT: (error "Maximum term size (1) for enumerative SyGuS exceeded.") ; SCRUBBER: grep -v -E '(\(define-fun|\(rewrite)' ; EXIT: 1 diff --git a/test/regress/regress1/rr-verify/fp-bool.sy b/test/regress/regress1/rr-verify/fp-bool.sy index 8e404668e..bf0692f7d 100644 --- a/test/regress/regress1/rr-verify/fp-bool.sy +++ b/test/regress/regress1/rr-verify/fp-bool.sy @@ -1,6 +1,5 @@ -; REQUIRES: no-asan ; REQUIRES: symfpu -; COMMAND-LINE: --sygus-rr --sygus-samples=0 --sygus-rr-synth-check --sygus-abort-size=1 --sygus-rr-verify-abort --no-sygus-sym-break +; COMMAND-LINE: --sygus-rr --sygus-samples=0 --sygus-rr-synth-check --sygus-abort-size=1 --sygus-rr-verify-abort --no-sygus-sym-break --fp-exp ; EXPECT: (error "Maximum term size (1) for enumerative SyGuS exceeded.") ; SCRUBBER: grep -v -E '(\(define-fun|\(rewrite)' ; EXIT: 1 diff --git a/test/regress/regress1/sets/issue2904.smt2 b/test/regress/regress1/sets/issue2904.smt2 new file mode 100644 index 000000000..13ca789f6 --- /dev/null +++ b/test/regress/regress1/sets/issue2904.smt2 @@ -0,0 +1,27 @@ +(set-logic ALL_SUPPORTED)
+(set-info :status unsat)
+
+; conjecture set nonempty(~b & ~c)
+
+(declare-fun n () Int)
+(declare-fun f () Int)
+(declare-fun m () Int)
+
+(declare-fun b () (Set Int))
+(declare-fun c () (Set Int))
+(declare-fun UNIVERALSET () (Set Int))
+(assert (subset b UNIVERALSET))
+(assert (subset c UNIVERALSET))
+
+(assert (> n 0))
+(assert (= (card UNIVERALSET) n))
+(assert (= (card b) m))
+(assert (= (card c) (- f m)))
+(assert (>= m 0))
+(assert (>= f m))
+(assert (> n (+ (* 2 f) m)))
+
+
+(assert (>= (card (setminus UNIVERALSET (intersection (setminus UNIVERALSET b) (setminus UNIVERALSET c)))) n))
+
+(check-sat)
diff --git a/test/regress/regress1/strings/issue2981.smt2 b/test/regress/regress1/strings/issue2981.smt2 new file mode 100644 index 000000000..78cdb2a8c --- /dev/null +++ b/test/regress/regress1/strings/issue2981.smt2 @@ -0,0 +1,20 @@ +(set-info :smt-lib-version 2.6) +(set-logic QF_SLIA) +(set-option :strings-exp true) +(set-info :status sat) +(declare-const x String) +(declare-const y String) +(declare-const m String) +(declare-const n String) +(assert (str.in.re x (re.+ (re.range "0" "9")))) +(assert (= 0 (str.to.int x))) +(assert (not (= x ""))) +(assert (not (= x "0"))) +(assert (not (= x "3"))) +(assert (not (= x "T"))) +(assert (not (= x "8"))) +(assert (not (= x ""))) +(assert (not (= x "5"))) +(assert (not (= x "<"))) +(assert (not (= x "N"))) +(check-sat) diff --git a/test/regress/regress1/strings/issue2982.smt2 b/test/regress/regress1/strings/issue2982.smt2 new file mode 100644 index 000000000..41be8d1fd --- /dev/null +++ b/test/regress/regress1/strings/issue2982.smt2 @@ -0,0 +1,23 @@ +; COMMAND-LINE: --strings-exp --re-elim --re-elim-agg +; EXPECT: unsat +(set-logic QF_SLIA) + +(declare-fun var_0 () String) +(declare-fun var_1 () String) +(declare-fun var_2 () String) +(declare-fun var_3 () String) +(declare-fun var_4 () String) +(declare-fun var_5 () String) +(declare-fun var_6 () String) +(declare-fun var_7 () String) +(declare-fun var_8 () String) +(declare-fun var_9 () String) +(declare-fun var_10 () String) +(declare-fun var_11 () String) +(declare-fun var_12 () String) + +(assert (str.in.re (str.++ var_7 "z" var_7 ) (re.* (str.to.re "z")))) +(assert (str.in.re var_7 (re.* (re.range "a" "u")))) +(assert (not (str.in.re (str.++ "a" var_7 "z" "a" var_7 ) (re.++ (re.* (re.union (str.to.re "z") (re.++ (str.to.re "a") (re.++ (re.* (str.to.re "a")) (str.to.re "z"))))) (re.++ (str.to.re "a") (re.* (str.to.re "a"))))))) +(assert (and (<= (str.len var_7) 0 ) (<= 0 (str.len var_7)))) +(check-sat) diff --git a/test/regress/regress0/strings/stoi-solve.smt2 b/test/regress/regress1/strings/stoi-solve.smt2 index 4fbbdcfc1..4fbbdcfc1 100644 --- a/test/regress/regress0/strings/stoi-solve.smt2 +++ b/test/regress/regress1/strings/stoi-solve.smt2 diff --git a/test/regress/regress1/sygus-abduct-test.smt2 b/test/regress/regress1/sygus-abduct-test.smt2 new file mode 100644 index 000000000..4ac90870c --- /dev/null +++ b/test/regress/regress1/sygus-abduct-test.smt2 @@ -0,0 +1,16 @@ +; COMMAND-LINE: --sygus-abduct --sygus-abort-size=2 +; EXPECT: (error "Maximum term size (2) for enumerative SyGuS exceeded.") +; SCRUBBER: grep -v -E '(\(define-fun)' +; EXIT: 1 + +(set-logic QF_UFLIRA) +(declare-fun n () Int) +(declare-fun m () Int) +(declare-fun x () Int) +(declare-fun y () Int) + +(assert (>= n 1)) +(assert (and (<= n x)(<= x (+ n 5)))) +(assert (and (<= 1 y)(<= y m))) + +(check-sat-assuming ((< x y))) diff --git a/test/regress/regress1/sygus/cube-nia.sy b/test/regress/regress1/sygus/cube-nia.sy new file mode 100644 index 000000000..da7d98e66 --- /dev/null +++ b/test/regress/regress1/sygus/cube-nia.sy @@ -0,0 +1,27 @@ +; EXPECT: unsat +; COMMAND-LINE: --sygus-out=status + +(set-logic NIA) + +(synth-fun cube ((x Int)) Int + ( + (Start Int (ntInt)) + + (ntBool Bool + ( + (> ntInt ntInt) + (= ntInt ntInt) + ) + ) + (ntInt Int + (1 x + (* ntInt ntInt) + (ite ntBool ntInt ntInt) + ) + ) + ) +) + +(constraint (= (cube 1) 1)) +(constraint (= (cube 2) 8)) +(check-synth) diff --git a/test/regress/regress1/sygus/double.sy b/test/regress/regress1/sygus/double.sy new file mode 100644 index 000000000..f3fea3122 --- /dev/null +++ b/test/regress/regress1/sygus/double.sy @@ -0,0 +1,26 @@ +; EXPECT: unsat
+; COMMAND-LINE: --sygus-out=status
+
+(set-logic SLIA)
+(declare-datatype Ex ((Ex2 (ex Int))))
+
+(synth-fun double ((x1 Ex)) Int
+ (
+ (Start Int (ntInt))
+ (ntInt Int
+ (
+ (ex ntEx)
+ (+ ntInt ntInt)
+ )
+ )
+ (ntEx Ex
+ (
+ x1
+ (Ex2 ntInt)
+ )
+ )
+ )
+)
+(constraint (= (double (Ex2 1)) 2))
+(constraint (= (double (Ex2 4)) 8))
+(check-synth)
diff --git a/test/regress/regress1/sygus/extract.sy b/test/regress/regress1/sygus/extract.sy new file mode 100644 index 000000000..d1541fa87 --- /dev/null +++ b/test/regress/regress1/sygus/extract.sy @@ -0,0 +1,19 @@ +; EXPECT: unsat
+; COMMAND-LINE: --sygus-out=status
+
+(set-logic ALL_SUPPORTED)
+(declare-datatype Ex ((Ex2 (ex Int))))
+
+(synth-fun ident ((x1 Ex)) Int
+ (
+ (Start Int (ntInt))
+ (ntInt Int
+ (
+ (ex ntEx)
+ )
+ )
+ (ntEx Ex ( x1 ) )
+ )
+)
+(constraint (= (ident (Ex2 1)) 1))
+(check-synth)
diff --git a/test/regress/regress1/sygus/issue2914.sy b/test/regress/regress1/sygus/issue2914.sy new file mode 100644 index 000000000..0f125a870 --- /dev/null +++ b/test/regress/regress1/sygus/issue2914.sy @@ -0,0 +1,26 @@ +; EXPECT: unsat +; COMMAND-LINE: --sygus-out=status +(set-logic SLIA) +(declare-datatype JSIdentifier ((JSString (jsString String)) (Error ))) + +(synth-fun substring ((x1 String) (x3 Int))String + ((Start String (ntString)) + (ntInt Int + (0 x3) + ) + (ntJSIdentifier JSIdentifier + ( + Error + ) + ) + (ntString String + (x1 + (str.substr ntString ntInt ntInt) + (jsString ntJSIdentifier) + (str.++ ntString ntString) + ) + ) + ) +) +(constraint (= (substring "ey" 1) "e")) +(check-synth) diff --git a/test/regress/regress1/sygus/issue2935.sy b/test/regress/regress1/sygus/issue2935.sy new file mode 100644 index 000000000..5616d19f5 --- /dev/null +++ b/test/regress/regress1/sygus/issue2935.sy @@ -0,0 +1,36 @@ +; EXPECT: unsat +; COMMAND-LINE: --sygus-out=status +(set-logic SLIA) +(declare-datatype JSIdentifier ((JSInt (jsInt Int)) (JSString (jsString String)) )) + +(synth-fun f ((x1_ JSIdentifier)(x2_ String)) JSIdentifier + ((Start JSIdentifier (ntJSIdentifier)) + (ntInt Int + (1 + (+ ntInt ntInt) + (jsInt ntJSIdentifier) + ) + ) + (ntString String + (x2_ + (str.substr ntString ntInt ntInt) + (jsString ntJSIdentifier) + ) + ) + (ntBool Bool + ( + (= ntString ntString) + ) + ) + (ntJSIdentifier JSIdentifier + ( x1_ + (ite ntBool ntJSIdentifier ntJSIdentifier) + (JSString ntString) + ) + ) + ) +) +(constraint (= (f (JSString "") "") (JSString ""))) +(constraint (= (f (JSString "M") "W") (JSString "M"))) +(constraint (= (f (JSString "Moon") "") (JSString "on"))) +(check-synth) diff --git a/test/regress/regress1/sygus/tester.sy b/test/regress/regress1/sygus/tester.sy new file mode 100644 index 000000000..261666dd4 --- /dev/null +++ b/test/regress/regress1/sygus/tester.sy @@ -0,0 +1,37 @@ +; EXPECT: unsat +; COMMAND-LINE: --sygus-out=status + +(set-logic SLIA) +(declare-datatype DT ((A (a Int)) (B (b String)) (JSBool (jsBool Bool)))) + +(define-fun isA ((i DT)) Bool ((_ is A) i) ) +(define-fun isB ((i DT)) Bool ((_ is B) i) ) + +(synth-fun add ((x1 DT)) DT + ( + (Start DT (ntDT)) + (ntDT DT + ( x1 x2 + (JSBool ntBool) + (A ntInt) + (ite ntBool ntDT ntDT) + ) + ) + (ntBool Bool + ( + (isA ntDT) + (isB ntDT) + (jsBool ntDT) + ) + ) + (ntInt Int + (1 + (a ntDT) + (+ ntInt ntInt) + ) + ) + ) +) +(constraint (= (add (A 6)) (A 7))) +(constraint (= (add (B "j")) (B "j"))) +(check-synth) diff --git a/test/regress/regress2/quantifiers/syn874-1.smt2 b/test/regress/regress2/quantifiers/syn874-1.smt2 new file mode 100644 index 000000000..93de3aca6 --- /dev/null +++ b/test/regress/regress2/quantifiers/syn874-1.smt2 @@ -0,0 +1,129 @@ +; COMMAND-LINE: --full-saturate-quant --fs-stratify +; EXPECT: unsat +(set-logic ALL) +(declare-sort $$unsorted 0) +(declare-fun ssNder1_0 () Bool) +(declare-fun ssNder1_1r1 ($$unsorted) Bool) +(declare-fun ssNder1_2r1r1 ($$unsorted $$unsorted) Bool) +(declare-fun ssNder1_3r1r1r1 ($$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssNder1_4r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc30 () $$unsorted) +(declare-fun ssPv16_5r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc31 () $$unsorted) +(declare-fun ssNder1_5r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc28 () $$unsorted) +(declare-fun ssPv15_6r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc29 () $$unsorted) +(declare-fun ssNder1_6r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc26 () $$unsorted) +(declare-fun ssPv14_7r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc27 () $$unsorted) +(declare-fun ssNder1_7r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc24 () $$unsorted) +(declare-fun ssPv13_8r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc25 () $$unsorted) +(declare-fun ssNder1_8r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssNder1_9r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssNder1_10r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc22 () $$unsorted) +(declare-fun ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc23 () $$unsorted) +(declare-fun ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc20 () $$unsorted) +(declare-fun ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc21 () $$unsorted) +(declare-fun ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc18 () $$unsorted) +(declare-fun ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc19 () $$unsorted) +(declare-fun ssPv10_11r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv20_1r1 ($$unsorted) Bool) +(declare-fun ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc16 () $$unsorted) +(declare-fun ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun skc17 () $$unsorted) +(declare-fun ssPv12_9r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv9_12r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv19_2r1r1 ($$unsorted $$unsorted) Bool) +(declare-fun ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv17_4r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv18_3r1r1r1 ($$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssNder1_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv3_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv11_10r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(declare-fun ssPv1_20r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 ($$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted $$unsorted) Bool) +(meta-info :filename "SYN874-1") +(assert true) +(assert (forall ((U $$unsorted)) (ssNder1_1r1 U) )) +(assert (forall ((U $$unsorted) (V $$unsorted)) (or (not (ssNder1_1r1 U)) (ssNder1_2r1r1 U V)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted)) (or (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_3r1r1r1 U V W)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted)) (or (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_4r1r1r1r1 U V W X)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted)) (or (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv16_5r1r1r1r1r1 U V W X skc30)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted)) (or (not (ssPv16_5r1r1r1r1r1 U V W X skc31)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted)) (or (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_5r1r1r1r1r1 U V W X Y)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted)) (or (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv15_6r1r1r1r1r1r1 U V W X Y skc28)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted)) (or (not (ssPv15_6r1r1r1r1r1r1 U V W X Y skc29)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted)) (or (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted)) (or (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv14_7r1r1r1r1r1r1r1 U V W X Y Z skc26)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted)) (or (not (ssPv14_7r1r1r1r1r1r1r1 U V W X Y Z skc27)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted)) (or (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted)) (or (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 skc24)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted)) (or (not (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 skc25)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted)) (or (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted)) (or (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted)) (or (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted)) (or (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted)) (or (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted)) (or (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 skc22)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted)) (or (not (ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 skc23)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted)) (or (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted)) (or (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 skc20)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted)) (or (not (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 skc21)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted)) (or (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted)) (or (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 skc18)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted)) (or (not (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 skc19)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted)) (or (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv10_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssPv15_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv20_1r1 U)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted)) (or (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted)) (or (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 skc16)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted)) (or (not (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 skc17)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted)) (or (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssPv12_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssPv20_1r1 U)) (not (ssNder1_1r1 U)) (ssPv16_5r1r1r1r1r1 U V W X Y)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted)) (or (not (ssPv9_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv10_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted)) (or (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssPv10_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssPv19_2r1r1 U V)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted)) (or (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted)) (or (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssPv20_1r1 U)) (not (ssNder1_1r1 U)) (ssPv19_2r1r1 U V)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted)) (or (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssPv15_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssPv20_1r1 U)) (not (ssNder1_1r1 U)) (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10) (ssPv17_4r1r1r1r1 U V W X)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted)) (or (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted)) (or (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv9_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssPv12_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9) (ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted)) (or (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssPv12_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssPv14_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10) (ssPv20_1r1 U)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted)) (or (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv9_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssPv17_4r1r1r1r1 U V W X)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U))) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted)) (or (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted)) (or (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssPv20_1r1 U)) (not (ssNder1_1r1 U)) (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11) (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9) (ssPv15_6r1r1r1r1r1r1 U V W X Y Z)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted)) (or (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssPv19_2r1r1 U V)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10) (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11) (ssPv16_5r1r1r1r1r1 U V W X Y)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted)) (or (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8) (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2) (ssPv18_3r1r1r1 U V W)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted)) (or (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssPv18_3r1r1r1 U V W)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted)) (or (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11) (ssPv10_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssNder1_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted)) (or (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10) (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9) (ssPv12_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted)) (or (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv9_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted)) (or (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv9_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv3_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12) (ssPv15_6r1r1r1r1r1r1 U V W X Y Z) (ssPv16_5r1r1r1r1r1 U V W X Y)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted)) (or (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssPv3_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv15_6r1r1r1r1r1r1 U V W X Y Z) (ssPv17_4r1r1r1r1 U V W X)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssPv15_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssPv16_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssPv17_4r1r1r1r1 U V W X)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8) (ssPv15_6r1r1r1r1r1r1 U V W X Y Z) (ssPv20_1r1 U)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted)) (or (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssPv3_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssPv9_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssPv14_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13) (ssPv9_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6) (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssPv20_1r1 U)) (not (ssNder1_1r1 U)) (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssPv18_3r1r1r1 U V W)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13) (ssPv14_7r1r1r1r1r1r1r1 U V W X Y Z X1)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13) (ssPv11_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4) (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssPv17_4r1r1r1r1 U V W X)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9) (ssPv7_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssPv15_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11) (ssPv8_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted)) (or (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssPv4_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv2_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13) (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted) (X14 $$unsorted)) (or (not (ssNder1_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13)) (not (ssPv1_20r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14)) (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssPv12_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssPv14_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv13_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) )) +(assert (forall ((U $$unsorted) (V $$unsorted) (W $$unsorted) (X $$unsorted) (Y $$unsorted) (Z $$unsorted) (X1 $$unsorted) (X2 $$unsorted) (X3 $$unsorted) (X4 $$unsorted) (X5 $$unsorted) (X6 $$unsorted) (X7 $$unsorted) (X8 $$unsorted) (X9 $$unsorted) (X10 $$unsorted) (X11 $$unsorted) (X12 $$unsorted) (X13 $$unsorted) (X14 $$unsorted)) (or (not (ssNder1_19r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13)) (not (ssPv1_20r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14)) (not (ssNder1_18r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12)) (not (ssNder1_17r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11)) (not (ssNder1_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10)) (not (ssNder1_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9)) (not (ssNder1_14r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8)) (not (ssNder1_13r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7)) (not (ssNder1_12r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6)) (not (ssNder1_11r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5)) (not (ssNder1_10r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4)) (not (ssNder1_9r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3)) (not (ssNder1_8r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2)) (not (ssNder1_7r1r1r1r1r1r1r1 U V W X Y Z X1)) (not (ssNder1_6r1r1r1r1r1r1 U V W X Y Z)) (not (ssNder1_5r1r1r1r1r1 U V W X Y)) (not (ssNder1_4r1r1r1r1 U V W X)) (not (ssNder1_3r1r1r1 U V W)) (not (ssNder1_2r1r1 U V)) (not (ssNder1_1r1 U)) (ssPv5_16r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9 X10) (ssPv6_15r1r1r1r1r1r1r1r1r1r1r1r1r1r1r1 U V W X Y Z X1 X2 X3 X4 X5 X6 X7 X8 X9) (ssPv19_2r1r1 U V)) )) +(assert true) +(check-sat) diff --git a/test/regress/regress2/sygus/min_IC_1.sy b/test/regress/regress2/sygus/min_IC_1.sy index 92e171312..a36a00019 100644 --- a/test/regress/regress2/sygus/min_IC_1.sy +++ b/test/regress/regress2/sygus/min_IC_1.sy @@ -1,6 +1,6 @@ ; REQUIRES: symfpu ; EXPECT: unsat -; COMMAND-LINE: --sygus-out=status +; COMMAND-LINE: --sygus-out=status --fp-exp (set-logic ALL) (define-sort FP () (_ FloatingPoint 3 5)) (define-fun IC ((t FP)) Bool (=> (fp.isInfinite t) (fp.isNegative t))) @@ -12,7 +12,7 @@ (fp.isInfinite StartFP) (fp.isNegative StartFP) - + (ite Start Start Start) )) (StartFP FP ( diff --git a/test/regress/regress2/strings/extf_d_perf.smt2 b/test/regress/regress3/strings/extf_d_perf.smt2 index 7ad094dcb..7ad094dcb 100644 --- a/test/regress/regress2/strings/extf_d_perf.smt2 +++ b/test/regress/regress3/strings/extf_d_perf.smt2 diff --git a/test/system/CVC4JavaTest.java b/test/system/CVC4JavaTest.java index 8ac7035f3..aff50ba76 100644 --- a/test/system/CVC4JavaTest.java +++ b/test/system/CVC4JavaTest.java @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/system/boilerplate.cpp b/test/system/boilerplate.cpp index e8947dbaf..141db4eea 100644 --- a/test/system/boilerplate.cpp +++ b/test/system/boilerplate.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/system/ouroborous.cpp b/test/system/ouroborous.cpp index a135e6c6c..3075e358d 100644 --- a/test/system/ouroborous.cpp +++ b/test/system/ouroborous.cpp @@ -2,9 +2,9 @@ /*! \file ouroborous.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Aina Niemetz + ** Morgan Deters, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/system/reset_assertions.cpp b/test/system/reset_assertions.cpp index 4588c7563..e4f5c46ff 100644 --- a/test/system/reset_assertions.cpp +++ b/test/system/reset_assertions.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/system/sep_log_api.cpp b/test/system/sep_log_api.cpp index 354cd37b2..c4bf2d507 100644 --- a/test/system/sep_log_api.cpp +++ b/test/system/sep_log_api.cpp @@ -1,12 +1,11 @@ -/******************************************************************************/ +/********************* */ /*! \file sep_log_api.cpp ** \verbatim ** Top contributors (to current version): ** Andrew V. Jones ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS or file - ** THANKS (in the top-level source directory) and their institutional - ** affiliations. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim ** diff --git a/test/system/smt2_compliance.cpp b/test/system/smt2_compliance.cpp index 8a14094d3..c91b7a0d1 100644 --- a/test/system/smt2_compliance.cpp +++ b/test/system/smt2_compliance.cpp @@ -2,9 +2,9 @@ /*! \file smt2_compliance.cpp ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Aina Niemetz, Tim King + ** Aina Niemetz, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/system/statistics.cpp b/test/system/statistics.cpp index 888ed47b6..fb9714d4b 100644 --- a/test/system/statistics.cpp +++ b/test/system/statistics.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/system/two_smt_engines.cpp b/test/system/two_smt_engines.cpp index ce98a722b..a7266e0b0 100644 --- a/test/system/two_smt_engines.cpp +++ b/test/system/two_smt_engines.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/api/datatype_api_black.h b/test/unit/api/datatype_api_black.h index bca6a35ce..6a5f3eb7b 100644 --- a/test/unit/api/datatype_api_black.h +++ b/test/unit/api/datatype_api_black.h @@ -2,7 +2,7 @@ /*! \file datatype_api_black.h ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli + ** Andres Noetzli, Aina Niemetz ** This file is part of the CVC4 project. ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. diff --git a/test/unit/api/opterm_black.h b/test/unit/api/opterm_black.h index 637301dd3..395ee8451 100644 --- a/test/unit/api/opterm_black.h +++ b/test/unit/api/opterm_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/api/solver_black.h b/test/unit/api/solver_black.h index fcc68d981..289fc26f0 100644 --- a/test/unit/api/solver_black.h +++ b/test/unit/api/solver_black.h @@ -2,9 +2,9 @@ /*! \file solver_black.h ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -76,7 +76,10 @@ class SolverBlack : public CxxTest::TestSuite void testMkUniverseSet(); void testMkVar(); + void testDeclareDatatype(); void testDeclareFun(); + void testDeclareSort(); + void testDefineFun(); void testDefineFunRec(); void testDefineFunsRec(); @@ -263,16 +266,23 @@ void SolverBlack::testMkBitVector() { uint32_t size0 = 0, size1 = 8, size2 = 32, val1 = 2; uint64_t val2 = 2; + TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector(size1, val1)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector(size2, val2)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector("1010", 2)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector("1010", 10)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector("1234", 10)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector("1010", 16)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector("a09f", 16)); TS_ASSERT_THROWS(d_solver->mkBitVector(size0, val1), CVC4ApiException&); TS_ASSERT_THROWS(d_solver->mkBitVector(size0, val2), CVC4ApiException&); TS_ASSERT_THROWS(d_solver->mkBitVector("", 2), CVC4ApiException&); TS_ASSERT_THROWS(d_solver->mkBitVector("10", 3), CVC4ApiException&); TS_ASSERT_THROWS(d_solver->mkBitVector("20", 2), CVC4ApiException&); - TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector(size1, val1)); - TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector(size2, val2)); - TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector("1010", 2)); - TS_ASSERT_THROWS_NOTHING(d_solver->mkBitVector("1010", 16)); TS_ASSERT_THROWS(d_solver->mkBitVector(8, "101010101", 2), CVC4ApiException&); + TS_ASSERT_EQUALS(d_solver->mkBitVector("1010", 2), + d_solver->mkBitVector("10", 10)); + TS_ASSERT_EQUALS(d_solver->mkBitVector("1010", 2), + d_solver->mkBitVector("a", 16)); TS_ASSERT_EQUALS(d_solver->mkBitVector(8, "01010101", 2).toString(), "0bin01010101"); TS_ASSERT_EQUALS(d_solver->mkBitVector(8, "F", 16).toString(), @@ -284,12 +294,12 @@ void SolverBlack::testMkBoundVar() Sort boolSort = d_solver->getBooleanSort(); Sort intSort = d_solver->getIntegerSort(); Sort funSort = d_solver->mkFunctionSort(intSort, boolSort); - TS_ASSERT_THROWS(d_solver->mkBoundVar(Sort()), CVC4ApiException&); - TS_ASSERT_THROWS_NOTHING(d_solver->mkBoundVar(boolSort)); - TS_ASSERT_THROWS_NOTHING(d_solver->mkBoundVar(funSort)); - TS_ASSERT_THROWS(d_solver->mkBoundVar("a", Sort()), CVC4ApiException&); - TS_ASSERT_THROWS_NOTHING(d_solver->mkBoundVar(std::string("b"), boolSort)); - TS_ASSERT_THROWS_NOTHING(d_solver->mkBoundVar("", funSort)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkVar(boolSort)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkVar(funSort)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkVar(boolSort, std::string("b"))); + TS_ASSERT_THROWS_NOTHING(d_solver->mkVar(funSort, "")); + TS_ASSERT_THROWS(d_solver->mkVar(Sort()), CVC4ApiException&); + TS_ASSERT_THROWS(d_solver->mkVar(Sort(), "a"), CVC4ApiException&); } void SolverBlack::testMkBoolean() @@ -440,6 +450,8 @@ void SolverBlack::testMkOpTerm() // mkOpTerm(Kind kind, uint32_t arg) TS_ASSERT_THROWS_NOTHING(d_solver->mkOpTerm(DIVISIBLE_OP, 1)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkOpTerm(BITVECTOR_ROTATE_LEFT_OP, 1)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkOpTerm(BITVECTOR_ROTATE_RIGHT_OP, 1)); TS_ASSERT_THROWS(d_solver->mkOpTerm(BITVECTOR_EXTRACT_OP, 1), CVC4ApiException&); @@ -499,7 +511,7 @@ void SolverBlack::testMkReal() void SolverBlack::testMkRegexpEmpty() { Sort strSort = d_solver->getStringSort(); - Term s = d_solver->mkVar("s", strSort); + Term s = d_solver->mkConst(strSort, "s"); TS_ASSERT_THROWS_NOTHING( d_solver->mkTerm(STRING_IN_REGEXP, s, d_solver->mkRegexpEmpty())); } @@ -507,7 +519,7 @@ void SolverBlack::testMkRegexpEmpty() void SolverBlack::testMkRegexpSigma() { Sort strSort = d_solver->getStringSort(); - Term s = d_solver->mkVar("s", strSort); + Term s = d_solver->mkConst(strSort, "s"); TS_ASSERT_THROWS_NOTHING( d_solver->mkTerm(STRING_IN_REGEXP, s, d_solver->mkRegexpSigma())); } @@ -531,8 +543,8 @@ void SolverBlack::testMkString() void SolverBlack::testMkTerm() { Sort bv32 = d_solver->mkBitVectorSort(32); - Term a = d_solver->mkVar("a", bv32); - Term b = d_solver->mkVar("b", bv32); + Term a = d_solver->mkConst(bv32, "a"); + Term b = d_solver->mkConst(bv32, "b"); std::vector<Term> v1 = {a, b}; std::vector<Term> v2 = {a, Term()}; std::vector<Term> v3 = {a, d_solver->mkTrue()}; @@ -546,11 +558,6 @@ void SolverBlack::testMkTerm() TS_ASSERT_THROWS_NOTHING(d_solver->mkTerm(REGEXP_SIGMA)); TS_ASSERT_THROWS(d_solver->mkTerm(CONST_BITVECTOR), CVC4ApiException&); - // mkTerm(Kind kind, Sort sort) const - TS_ASSERT_THROWS_NOTHING( - d_solver->mkTerm(SEP_NIL, d_solver->getBooleanSort())); - TS_ASSERT_THROWS_NOTHING(d_solver->mkTerm(SEP_NIL, Sort())); - // mkTerm(Kind kind, Term child) const TS_ASSERT_THROWS_NOTHING(d_solver->mkTerm(NOT, d_solver->mkTrue())); TS_ASSERT_THROWS(d_solver->mkTerm(NOT, Term()), CVC4ApiException&); @@ -589,8 +596,8 @@ void SolverBlack::testMkTerm() void SolverBlack::testMkTermFromOpTerm() { Sort bv32 = d_solver->mkBitVectorSort(32); - Term a = d_solver->mkVar("a", bv32); - Term b = d_solver->mkVar("b", bv32); + Term a = d_solver->mkConst(bv32, "a"); + Term b = d_solver->mkConst(bv32, "b"); std::vector<Term> v1 = {d_solver->mkReal(1), d_solver->mkReal(2)}; std::vector<Term> v2 = {d_solver->mkReal(1), Term()}; std::vector<Term> v3 = {}; @@ -612,7 +619,7 @@ void SolverBlack::testMkTermFromOpTerm() Sort listSort = d_solver->mkDatatypeSort(listDecl); Sort intListSort = listSort.instantiate(std::vector<Sort>{d_solver->getIntegerSort()}); - Term c = d_solver->declareFun("c", intListSort); + Term c = d_solver->mkConst(intListSort, "c"); Datatype list = listSort.getDatatype(); // list datatype constructor and selector operator terms OpTerm consTerm1 = list.getConstructorTerm("cons"); @@ -725,12 +732,30 @@ void SolverBlack::testMkVar() Sort boolSort = d_solver->getBooleanSort(); Sort intSort = d_solver->getIntegerSort(); Sort funSort = d_solver->mkFunctionSort(intSort, boolSort); - TS_ASSERT_THROWS(d_solver->mkVar(Sort()), CVC4ApiException&); - TS_ASSERT_THROWS_NOTHING(d_solver->mkVar(boolSort)); - TS_ASSERT_THROWS_NOTHING(d_solver->mkVar(funSort)); - TS_ASSERT_THROWS(d_solver->mkVar("a", Sort()), CVC4ApiException&); - TS_ASSERT_THROWS_NOTHING(d_solver->mkVar(std::string("b"), boolSort)); - TS_ASSERT_THROWS_NOTHING(d_solver->mkVar("", funSort)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkConst(boolSort)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkConst(funSort)); + TS_ASSERT_THROWS_NOTHING(d_solver->mkConst(boolSort, std::string("b"))); + TS_ASSERT_THROWS_NOTHING(d_solver->mkConst(intSort, std::string("i"))); + TS_ASSERT_THROWS_NOTHING(d_solver->mkConst(funSort, "f")); + TS_ASSERT_THROWS_NOTHING(d_solver->mkConst(funSort, "")); + TS_ASSERT_THROWS(d_solver->mkConst(Sort()), CVC4ApiException&); + TS_ASSERT_THROWS(d_solver->mkConst(Sort(), "a"), CVC4ApiException&); +} + +void SolverBlack::testDeclareDatatype() +{ + DatatypeConstructorDecl cons("cons"); + DatatypeConstructorDecl nil("nil"); + std::vector<DatatypeConstructorDecl> ctors1 = {nil}; + std::vector<DatatypeConstructorDecl> ctors2 = {cons, nil}; + std::vector<DatatypeConstructorDecl> ctors3; + TS_ASSERT_THROWS_NOTHING(d_solver->declareDatatype(std::string("a"), ctors1)); + TS_ASSERT_THROWS_NOTHING(d_solver->declareDatatype(std::string("b"), ctors2)); + TS_ASSERT_THROWS_NOTHING(d_solver->declareDatatype(std::string(""), ctors2)); + TS_ASSERT_THROWS(d_solver->declareDatatype(std::string("c"), ctors3), + CVC4ApiException&); + TS_ASSERT_THROWS(d_solver->declareDatatype(std::string(""), ctors3), + CVC4ApiException&); } void SolverBlack::testDeclareFun() @@ -738,32 +763,39 @@ void SolverBlack::testDeclareFun() Sort bvSort = d_solver->mkBitVectorSort(32); Sort funSort = d_solver->mkFunctionSort(d_solver->mkUninterpretedSort("u"), d_solver->getIntegerSort()); - TS_ASSERT_THROWS_NOTHING(d_solver->declareFun("f1", bvSort)); - TS_ASSERT_THROWS_NOTHING(d_solver->declareFun("f2", funSort)); + TS_ASSERT_THROWS_NOTHING(d_solver->declareFun("f1", {}, bvSort)); TS_ASSERT_THROWS_NOTHING( d_solver->declareFun("f3", {bvSort, d_solver->getIntegerSort()}, bvSort)); + TS_ASSERT_THROWS(d_solver->declareFun("f2", {}, funSort), CVC4ApiException&); TS_ASSERT_THROWS(d_solver->declareFun("f4", {bvSort, funSort}, bvSort), CVC4ApiException&); TS_ASSERT_THROWS(d_solver->declareFun("f5", {bvSort, bvSort}, funSort), CVC4ApiException&); } +void SolverBlack::testDeclareSort() +{ + TS_ASSERT_THROWS_NOTHING(d_solver->declareSort("s", 0)); + TS_ASSERT_THROWS_NOTHING(d_solver->declareSort("s", 2)); + TS_ASSERT_THROWS_NOTHING(d_solver->declareSort("", 2)); +} + void SolverBlack::testDefineFun() { Sort bvSort = d_solver->mkBitVectorSort(32); Sort funSort1 = d_solver->mkFunctionSort({bvSort, bvSort}, bvSort); Sort funSort2 = d_solver->mkFunctionSort(d_solver->mkUninterpretedSort("u"), d_solver->getIntegerSort()); - Term b1 = d_solver->mkBoundVar("b1", bvSort); - Term b11 = d_solver->mkBoundVar("b1", bvSort); - Term b2 = d_solver->mkBoundVar("b2", d_solver->getIntegerSort()); - Term b3 = d_solver->mkBoundVar("b3", funSort2); - Term v1 = d_solver->mkBoundVar("v1", bvSort); - Term v2 = d_solver->mkBoundVar("v2", d_solver->getIntegerSort()); - Term v3 = d_solver->mkVar("v3", funSort2); - Term f1 = d_solver->declareFun("f1", funSort1); - Term f2 = d_solver->declareFun("f2", funSort2); - Term f3 = d_solver->declareFun("f3", bvSort); + Term b1 = d_solver->mkVar(bvSort, "b1"); + Term b11 = d_solver->mkVar(bvSort, "b1"); + Term b2 = d_solver->mkVar(d_solver->getIntegerSort(), "b2"); + Term b3 = d_solver->mkVar(funSort2, "b3"); + Term v1 = d_solver->mkVar(bvSort, "v1"); + Term v2 = d_solver->mkVar(d_solver->getIntegerSort(), "v2"); + Term v3 = d_solver->mkConst(funSort2, "v3"); + Term f1 = d_solver->mkConst(funSort1, "f1"); + Term f2 = d_solver->mkConst(funSort2, "f2"); + Term f3 = d_solver->mkConst(bvSort, "f3"); TS_ASSERT_THROWS_NOTHING(d_solver->defineFun("f", {}, bvSort, v1)); TS_ASSERT_THROWS_NOTHING(d_solver->defineFun("ff", {b1, b2}, bvSort, v1)); TS_ASSERT_THROWS_NOTHING(d_solver->defineFun(f1, {b1, b11}, v1)); @@ -786,16 +818,16 @@ void SolverBlack::testDefineFunRec() Sort funSort1 = d_solver->mkFunctionSort({bvSort, bvSort}, bvSort); Sort funSort2 = d_solver->mkFunctionSort(d_solver->mkUninterpretedSort("u"), d_solver->getIntegerSort()); - Term b1 = d_solver->mkBoundVar("b1", bvSort); - Term b11 = d_solver->mkBoundVar("b1", bvSort); - Term b2 = d_solver->mkBoundVar("b2", d_solver->getIntegerSort()); - Term b3 = d_solver->mkBoundVar("b3", funSort2); - Term v1 = d_solver->mkBoundVar("v1", bvSort); - Term v2 = d_solver->mkBoundVar("v2", d_solver->getIntegerSort()); - Term v3 = d_solver->mkVar("v3", funSort2); - Term f1 = d_solver->declareFun("f1", funSort1); - Term f2 = d_solver->declareFun("f2", funSort2); - Term f3 = d_solver->declareFun("f3", bvSort); + Term b1 = d_solver->mkVar(bvSort, "b1"); + Term b11 = d_solver->mkVar(bvSort, "b1"); + Term b2 = d_solver->mkVar(d_solver->getIntegerSort(), "b2"); + Term b3 = d_solver->mkVar(funSort2, "b3"); + Term v1 = d_solver->mkVar(bvSort, "v1"); + Term v2 = d_solver->mkVar(d_solver->getIntegerSort(), "v2"); + Term v3 = d_solver->mkConst(funSort2, "v3"); + Term f1 = d_solver->mkConst(funSort1, "f1"); + Term f2 = d_solver->mkConst(funSort2, "f2"); + Term f3 = d_solver->mkConst(bvSort, "f3"); TS_ASSERT_THROWS_NOTHING(d_solver->defineFunRec("f", {}, bvSort, v1)); TS_ASSERT_THROWS_NOTHING(d_solver->defineFunRec("ff", {b1, b2}, bvSort, v1)); TS_ASSERT_THROWS_NOTHING(d_solver->defineFunRec(f1, {b1, b11}, v1)); @@ -820,18 +852,18 @@ void SolverBlack::testDefineFunsRec() Sort bvSort = d_solver->mkBitVectorSort(32); Sort funSort1 = d_solver->mkFunctionSort({bvSort, bvSort}, bvSort); Sort funSort2 = d_solver->mkFunctionSort(uSort, d_solver->getIntegerSort()); - Term b1 = d_solver->mkBoundVar("b1", bvSort); - Term b11 = d_solver->mkBoundVar("b1", bvSort); - Term b2 = d_solver->mkBoundVar("b2", d_solver->getIntegerSort()); - Term b3 = d_solver->mkBoundVar("b3", funSort2); - Term b4 = d_solver->mkBoundVar("b4", uSort); - Term v1 = d_solver->mkBoundVar("v1", bvSort); - Term v2 = d_solver->mkBoundVar("v2", d_solver->getIntegerSort()); - Term v3 = d_solver->mkVar("v3", funSort2); - Term v4 = d_solver->mkVar("v4", uSort); - Term f1 = d_solver->declareFun("f1", funSort1); - Term f2 = d_solver->declareFun("f2", funSort2); - Term f3 = d_solver->declareFun("f3", bvSort); + Term b1 = d_solver->mkVar(bvSort, "b1"); + Term b11 = d_solver->mkVar(bvSort, "b1"); + Term b2 = d_solver->mkVar(d_solver->getIntegerSort(), "b2"); + Term b3 = d_solver->mkVar(funSort2, "b3"); + Term b4 = d_solver->mkVar(uSort, "b4"); + Term v1 = d_solver->mkVar(bvSort, "v1"); + Term v2 = d_solver->mkVar(d_solver->getIntegerSort(), "v2"); + Term v3 = d_solver->mkConst(funSort2, "v3"); + Term v4 = d_solver->mkConst(uSort, "v4"); + Term f1 = d_solver->mkConst(funSort1, "f1"); + Term f2 = d_solver->mkConst(funSort2, "f2"); + Term f3 = d_solver->mkConst(bvSort, "f3"); TS_ASSERT_THROWS_NOTHING( d_solver->defineFunsRec({f1, f2}, {{b1, b11}, {b4}}, {v1, v2})); TS_ASSERT_THROWS( diff --git a/test/unit/api/sort_black.h b/test/unit/api/sort_black.h index d9337e627..73eb3df88 100644 --- a/test/unit/api/sort_black.h +++ b/test/unit/api/sort_black.h @@ -1,10 +1,10 @@ /********************* */ -/*! \file api_guards_black.h +/*! \file sort_black.h ** \verbatim ** Top contributors (to current version): ** Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/api/term_black.h b/test/unit/api/term_black.h index a7f735651..e8128ef7e 100644 --- a/test/unit/api/term_black.h +++ b/test/unit/api/term_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -45,8 +45,8 @@ class TermBlack : public CxxTest::TestSuite void TermBlack::testEq() { Sort uSort = d_solver.mkUninterpretedSort("u"); - Term x = d_solver.mkVar("x", uSort); - Term y = d_solver.mkVar("y", uSort); + Term x = d_solver.mkVar(uSort, "x"); + Term y = d_solver.mkVar(uSort, "y"); Term z; TS_ASSERT(x == x); @@ -67,14 +67,14 @@ void TermBlack::testGetKind() Term n; TS_ASSERT_THROWS(n.getKind(), CVC4ApiException&); - Term x = d_solver.mkVar("x", uSort); + Term x = d_solver.mkVar(uSort, "x"); TS_ASSERT_THROWS_NOTHING(x.getKind()); - Term y = d_solver.mkVar("y", uSort); + Term y = d_solver.mkVar(uSort, "y"); TS_ASSERT_THROWS_NOTHING(y.getKind()); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS_NOTHING(f.getKind()); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS_NOTHING(p.getKind()); Term zero = d_solver.mkReal(0); @@ -102,17 +102,17 @@ void TermBlack::testGetSort() Term n; TS_ASSERT_THROWS(n.getSort(), CVC4ApiException&); - Term x = d_solver.mkVar("x", bvSort); + Term x = d_solver.mkVar(bvSort, "x"); TS_ASSERT_THROWS_NOTHING(x.getSort()); TS_ASSERT(x.getSort() == bvSort); - Term y = d_solver.mkVar("y", bvSort); + Term y = d_solver.mkVar(bvSort, "y"); TS_ASSERT_THROWS_NOTHING(y.getSort()); TS_ASSERT(y.getSort() == bvSort); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS_NOTHING(f.getSort()); TS_ASSERT(f.getSort() == funSort1); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS_NOTHING(p.getSort()); TS_ASSERT(p.getSort() == funSort2); @@ -141,7 +141,7 @@ void TermBlack::testIsNull() { Term x; TS_ASSERT(x.isNull()); - x = d_solver.mkVar("x", d_solver.mkBitVectorSort(4)); + x = d_solver.mkVar(d_solver.mkBitVectorSort(4), "x"); TS_ASSERT(!x.isNull()); } @@ -155,11 +155,11 @@ void TermBlack::testNotTerm() Term b = d_solver.mkTrue(); TS_ASSERT_THROWS_NOTHING(b.notTerm()); - Term x = d_solver.mkVar("x", d_solver.mkBitVectorSort(8)); + Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x"); TS_ASSERT_THROWS(x.notTerm(), CVC4ApiException&); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS(f.notTerm(), CVC4ApiException&); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS(p.notTerm(), CVC4ApiException&); Term zero = d_solver.mkReal(0); TS_ASSERT_THROWS(zero.notTerm(), CVC4ApiException&); @@ -183,14 +183,14 @@ void TermBlack::testAndTerm() Term b = d_solver.mkTrue(); TS_ASSERT_THROWS_NOTHING(b.andTerm(b)); - Term x = d_solver.mkVar("x", d_solver.mkBitVectorSort(8)); + Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x"); TS_ASSERT_THROWS(x.andTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(x.andTerm(x), CVC4ApiException&); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS(f.andTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(f.andTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(f.andTerm(f), CVC4ApiException&); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS(p.andTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(p.andTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(p.andTerm(f), CVC4ApiException&); @@ -247,14 +247,14 @@ void TermBlack::testOrTerm() Term b = d_solver.mkTrue(); TS_ASSERT_THROWS_NOTHING(b.orTerm(b)); - Term x = d_solver.mkVar("x", d_solver.mkBitVectorSort(8)); + Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x"); TS_ASSERT_THROWS(x.orTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(x.orTerm(x), CVC4ApiException&); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS(f.orTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(f.orTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(f.orTerm(f), CVC4ApiException&); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS(p.orTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(p.orTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(p.orTerm(f), CVC4ApiException&); @@ -311,14 +311,14 @@ void TermBlack::testXorTerm() Term b = d_solver.mkTrue(); TS_ASSERT_THROWS_NOTHING(b.xorTerm(b)); - Term x = d_solver.mkVar("x", d_solver.mkBitVectorSort(8)); + Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x"); TS_ASSERT_THROWS(x.xorTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(x.xorTerm(x), CVC4ApiException&); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS(f.xorTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(f.xorTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(f.xorTerm(f), CVC4ApiException&); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS(p.xorTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(p.xorTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(p.xorTerm(f), CVC4ApiException&); @@ -375,14 +375,14 @@ void TermBlack::testEqTerm() Term b = d_solver.mkTrue(); TS_ASSERT_THROWS_NOTHING(b.eqTerm(b)); - Term x = d_solver.mkVar("x", d_solver.mkBitVectorSort(8)); + Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x"); TS_ASSERT_THROWS(x.eqTerm(b), CVC4ApiException&); TS_ASSERT_THROWS_NOTHING(x.eqTerm(x)); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS(f.eqTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(f.eqTerm(x), CVC4ApiException&); TS_ASSERT_THROWS_NOTHING(f.eqTerm(f)); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS(p.eqTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(p.eqTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(p.eqTerm(f), CVC4ApiException&); @@ -439,14 +439,14 @@ void TermBlack::testImpTerm() Term b = d_solver.mkTrue(); TS_ASSERT_THROWS_NOTHING(b.impTerm(b)); - Term x = d_solver.mkVar("x", d_solver.mkBitVectorSort(8)); + Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x"); TS_ASSERT_THROWS(x.impTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(x.impTerm(x), CVC4ApiException&); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS(f.impTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(f.impTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(f.impTerm(f), CVC4ApiException&); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS(p.impTerm(b), CVC4ApiException&); TS_ASSERT_THROWS(p.impTerm(x), CVC4ApiException&); TS_ASSERT_THROWS(p.impTerm(f), CVC4ApiException&); @@ -503,16 +503,16 @@ void TermBlack::testIteTerm() Term b = d_solver.mkTrue(); TS_ASSERT_THROWS_NOTHING(b.iteTerm(b, b)); - Term x = d_solver.mkVar("x", d_solver.mkBitVectorSort(8)); + Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x"); TS_ASSERT_THROWS_NOTHING(b.iteTerm(x, x)); TS_ASSERT_THROWS_NOTHING(b.iteTerm(b, b)); TS_ASSERT_THROWS(b.iteTerm(x, b), CVC4ApiException&); TS_ASSERT_THROWS(x.iteTerm(x, x), CVC4ApiException&); TS_ASSERT_THROWS(x.iteTerm(x, b), CVC4ApiException&); - Term f = d_solver.mkVar("f", funSort1); + Term f = d_solver.mkVar(funSort1, "f"); TS_ASSERT_THROWS(f.iteTerm(b, b), CVC4ApiException&); TS_ASSERT_THROWS(x.iteTerm(b, x), CVC4ApiException&); - Term p = d_solver.mkVar("p", funSort2); + Term p = d_solver.mkVar(funSort2, "p"); TS_ASSERT_THROWS(p.iteTerm(b, b), CVC4ApiException&); TS_ASSERT_THROWS(p.iteTerm(x, b), CVC4ApiException&); Term zero = d_solver.mkReal(0); diff --git a/test/unit/base/map_util_black.h b/test/unit/base/map_util_black.h index 39567d6ac..159c5fa9f 100644 --- a/test/unit/base/map_util_black.h +++ b/test/unit/base/map_util_black.h @@ -2,9 +2,9 @@ /*! \file map_util_black.h ** \verbatim ** Top contributors (to current version): - ** Tim King + ** Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/context/cdlist_black.h b/test/unit/context/cdlist_black.h index b6b7f436c..8c5a23934 100644 --- a/test/unit/context/cdlist_black.h +++ b/test/unit/context/cdlist_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/context/cdmap_black.h b/test/unit/context/cdmap_black.h index 1cb7e50e7..6c5ecdf08 100644 --- a/test/unit/context/cdmap_black.h +++ b/test/unit/context/cdmap_black.h @@ -2,9 +2,9 @@ /*! \file cdmap_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Dejan Jovanovic + ** Morgan Deters, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/context/cdmap_white.h b/test/unit/context/cdmap_white.h index 53d523c82..1a1f683bc 100644 --- a/test/unit/context/cdmap_white.h +++ b/test/unit/context/cdmap_white.h @@ -2,9 +2,9 @@ /*! \file cdmap_white.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Dejan Jovanovic, Tim King + ** Morgan Deters, Andres Noetzli, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/context/cdo_black.h b/test/unit/context/cdo_black.h index 2838ae322..4f927abfc 100644 --- a/test/unit/context/cdo_black.h +++ b/test/unit/context/cdo_black.h @@ -2,9 +2,9 @@ /*! \file cdo_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Dejan Jovanovic, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/context/context_black.h b/test/unit/context/context_black.h index 4f867525d..3659d3494 100644 --- a/test/unit/context/context_black.h +++ b/test/unit/context/context_black.h @@ -2,9 +2,9 @@ /*! \file context_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Dejan Jovanovic, Tim King + ** Morgan Deters, Dejan Jovanovic, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/context/context_mm_black.h b/test/unit/context/context_mm_black.h index 2684d643c..15f9b09de 100644 --- a/test/unit/context/context_mm_black.h +++ b/test/unit/context/context_mm_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Dejan Jovanovic, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/context/context_white.h b/test/unit/context/context_white.h index 2c1ef8e71..515ffb848 100644 --- a/test/unit/context/context_white.h +++ b/test/unit/context/context_white.h @@ -2,9 +2,9 @@ /*! \file context_white.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Andres Noetzli, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/attribute_black.h b/test/unit/expr/attribute_black.h index 58defe07d..c8b0df1bc 100644 --- a/test/unit/expr/attribute_black.h +++ b/test/unit/expr/attribute_black.h @@ -2,9 +2,9 @@ /*! \file attribute_black.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Dejan Jovanovic, Morgan Deters + ** Tim King, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/attribute_white.h b/test/unit/expr/attribute_white.h index 847cbf929..d109efdfd 100644 --- a/test/unit/expr/attribute_white.h +++ b/test/unit/expr/attribute_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Christopher L. Conway, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/expr_manager_public.h b/test/unit/expr/expr_manager_public.h index c2a33cc59..8c297232c 100644 --- a/test/unit/expr/expr_manager_public.h +++ b/test/unit/expr/expr_manager_public.h @@ -2,9 +2,9 @@ /*! \file expr_manager_public.h ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Tim King, Morgan Deters + ** Christopher L. Conway, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/expr_public.h b/test/unit/expr/expr_public.h index 9ff5e6578..82cf10a9b 100644 --- a/test/unit/expr/expr_public.h +++ b/test/unit/expr/expr_public.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/kind_black.h b/test/unit/expr/kind_black.h index 900f5dac6..047042191 100644 --- a/test/unit/expr/kind_black.h +++ b/test/unit/expr/kind_black.h @@ -2,9 +2,9 @@ /*! \file kind_black.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters + ** Tim King, Andres Noetzli, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/kind_map_black.h b/test/unit/expr/kind_map_black.h index 33af64580..e03b11b1e 100644 --- a/test/unit/expr/kind_map_black.h +++ b/test/unit/expr/kind_map_black.h @@ -2,9 +2,9 @@ /*! \file kind_map_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/node_black.h b/test/unit/expr/node_black.h index 2415bd5e4..287704f39 100644 --- a/test/unit/expr/node_black.h +++ b/test/unit/expr/node_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/node_builder_black.h b/test/unit/expr/node_builder_black.h index 963219291..2ece96cb8 100644 --- a/test/unit/expr/node_builder_black.h +++ b/test/unit/expr/node_builder_black.h @@ -2,9 +2,9 @@ /*! \file node_builder_black.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Christopher L. Conway + ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/node_manager_black.h b/test/unit/expr/node_manager_black.h index d04e69446..e568fc9df 100644 --- a/test/unit/expr/node_manager_black.h +++ b/test/unit/expr/node_manager_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Dejan Jovanovic, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/node_manager_white.h b/test/unit/expr/node_manager_white.h index a0716671f..c2888a708 100644 --- a/test/unit/expr/node_manager_white.h +++ b/test/unit/expr/node_manager_white.h @@ -2,9 +2,9 @@ /*! \file node_manager_white.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -70,4 +70,24 @@ class NodeManagerWhite : public CxxTest::TestSuite { TS_ASSERT_THROWS(nb.realloc(67108863), AssertionException&); #endif /* CVC4_ASSERTIONS */ } + + void testTopologicalSort() + { + TypeNode boolType = d_nm->booleanType(); + Node i = d_nm->mkSkolem("i", boolType); + Node j = d_nm->mkSkolem("j", boolType); + Node n1 = d_nm->mkNode(kind::AND, j, j); + Node n2 = d_nm->mkNode(kind::AND, i, n1); + + { + std::vector<NodeValue*> roots = {n1.d_nv}; + TS_ASSERT_EQUALS(NodeManager::TopologicalSort(roots), roots); + } + + { + std::vector<NodeValue*> roots = {n2.d_nv, n1.d_nv}; + std::vector<NodeValue*> result = {n1.d_nv, n2.d_nv}; + TS_ASSERT_EQUALS(NodeManager::TopologicalSort(roots), result); + } + } }; diff --git a/test/unit/expr/node_self_iterator_black.h b/test/unit/expr/node_self_iterator_black.h index cfc4a6b7a..d4e9e551a 100644 --- a/test/unit/expr/node_self_iterator_black.h +++ b/test/unit/expr/node_self_iterator_black.h @@ -2,9 +2,9 @@ /*! \file node_self_iterator_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Christopher L. Conway, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/node_white.h b/test/unit/expr/node_white.h index 09d015e42..e9a3112cf 100644 --- a/test/unit/expr/node_white.h +++ b/test/unit/expr/node_white.h @@ -2,9 +2,9 @@ /*! \file node_white.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Dejan Jovanovic + ** Morgan Deters, Andres Noetzli, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/symbol_table_black.h b/test/unit/expr/symbol_table_black.h index 99799544f..ef65e8773 100644 --- a/test/unit/expr/symbol_table_black.h +++ b/test/unit/expr/symbol_table_black.h @@ -2,9 +2,9 @@ /*! \file symbol_table_black.h ** \verbatim ** Top contributors (to current version): - ** Christopher L. Conway, Morgan Deters, Dejan Jovanovic + ** Christopher L. Conway, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/type_cardinality_public.h b/test/unit/expr/type_cardinality_public.h index 51cb6a881..39e528c43 100644 --- a/test/unit/expr/type_cardinality_public.h +++ b/test/unit/expr/type_cardinality_public.h @@ -2,9 +2,9 @@ /*! \file type_cardinality_public.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/expr/type_node_white.h b/test/unit/expr/type_node_white.h index 32b5ca7cb..ebd2a718a 100644 --- a/test/unit/expr/type_node_white.h +++ b/test/unit/expr/type_node_white.h @@ -2,9 +2,9 @@ /*! \file type_node_white.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/main/interactive_shell_black.h b/test/unit/main/interactive_shell_black.h index cf76bb05a..be66f3678 100644 --- a/test/unit/main/interactive_shell_black.h +++ b/test/unit/main/interactive_shell_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Aina Niemetz, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/memory.h b/test/unit/memory.h index 8f4eca371..49b0885b1 100644 --- a/test/unit/memory.h +++ b/test/unit/memory.h @@ -2,9 +2,9 @@ /*! \file memory.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters + ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/parser/parser_black.h b/test/unit/parser/parser_black.h index 58ed12a60..33ad3740a 100644 --- a/test/unit/parser/parser_black.h +++ b/test/unit/parser/parser_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Morgan Deters, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/parser/parser_builder_black.h b/test/unit/parser/parser_builder_black.h index d83d2681b..78e1be748 100644 --- a/test/unit/parser/parser_builder_black.h +++ b/test/unit/parser/parser_builder_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Aina Niemetz, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/preprocessing/pass_bv_gauss_white.h b/test/unit/preprocessing/pass_bv_gauss_white.h index 8ba6da0bf..e027fb5e8 100644 --- a/test/unit/preprocessing/pass_bv_gauss_white.h +++ b/test/unit/preprocessing/pass_bv_gauss_white.h @@ -2,9 +2,9 @@ /*! \file pass_bv_gauss_white.h ** \verbatim ** Top contributors (to current version): - ** Aina Niemetz + ** Aina Niemetz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/proof/CMakeLists.txt b/test/unit/proof/CMakeLists.txt index 00c893bdb..315c78d6f 100644 --- a/test/unit/proof/CMakeLists.txt +++ b/test/unit/proof/CMakeLists.txt @@ -2,5 +2,6 @@ # Add unit tests cvc4_add_unit_test_black(drat_proof_black proof) +cvc4_add_unit_test_black(er_proof_black proof) cvc4_add_unit_test_black(lrat_proof_black proof) cvc4_add_unit_test_black(lfsc_proof_printer_black proof) diff --git a/test/unit/proof/drat_proof_black.h b/test/unit/proof/drat_proof_black.h index 946597bea..6fdb55593 100644 --- a/test/unit/proof/drat_proof_black.h +++ b/test/unit/proof/drat_proof_black.h @@ -2,9 +2,9 @@ /*! \file drat_proof_black.h ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -170,8 +170,8 @@ void DratProofBlack::testOutputTwoAsLfsc() } } std::string expectedLfsc = - "(DRATProofd (clc (neg .v62) (clc (neg .v8192) cln))" - "(DRATProofa (clc (pos .v128) (clc (neg .v8190) cln))" + "(DRATProofd (clc (neg bb.v62) (clc (neg bb.v8192) cln))" + "(DRATProofa (clc (pos bb.v128) (clc (neg bb.v8190) cln))" "DRATProofn))"; std::ostringstream expectedLfscWithoutWhitespace; for (char c : expectedLfsc) diff --git a/test/unit/proof/er_proof_black.h b/test/unit/proof/er_proof_black.h new file mode 100644 index 000000000..1620bb113 --- /dev/null +++ b/test/unit/proof/er_proof_black.h @@ -0,0 +1,406 @@ +/********************* */ +/*! \file er_proof_black.h + ** \verbatim + ** Top contributors (to current version): + ** Alex Ozdemir + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Black box testing of the ER proof class + ** + ** In particular, tests TRACECHECK parsing and ER LFSC output. + **/ + +#include <cxxtest/TestSuite.h> + +#include <algorithm> +#include <cctype> +#include <iostream> +#include <iterator> +#include <vector> + +#include "proof/clause_id.h" +#include "proof/er/er_proof.h" +#include "prop/sat_solver_types.h" +#include "utils.h" + +using namespace CVC4; +using namespace CVC4::proof::er; +using namespace CVC4::prop; + +class ErProofBlack : public CxxTest::TestSuite +{ + public: + void setUp() override {} + void tearDown() override {} + + void testTraceCheckParse1Line(); + void testTraceCheckParse5Lines(); + void testErTraceCheckParse(); + void testErTraceCheckOutput(); + void testErTraceCheckOutputMedium(); +}; + +void ErProofBlack::testTraceCheckParse1Line() +{ + std::string tracecheckText = "1 -2 3 0 4 2 0\n"; + std::istringstream stream(tracecheckText); + TraceCheckProof pf = TraceCheckProof::fromText(stream); + TS_ASSERT_EQUALS(pf.d_lines.size(), 1); + + TS_ASSERT_EQUALS(pf.d_lines[0].d_idx, 1); + TS_ASSERT_EQUALS(pf.d_lines[0].d_clause.size(), 2); + TS_ASSERT_EQUALS(pf.d_lines[0].d_clause[0], SatLiteral(1, true)); + TS_ASSERT_EQUALS(pf.d_lines[0].d_clause[1], SatLiteral(2, false)); + TS_ASSERT_EQUALS(pf.d_lines[0].d_chain.size(), 2); + TS_ASSERT_EQUALS(pf.d_lines[0].d_chain[0], 4); + TS_ASSERT_EQUALS(pf.d_lines[0].d_chain[1], 2); +} + +void ErProofBlack::testTraceCheckParse5Lines() +{ + std::string tracecheckText = + "1 1 -2 3 0 0\n" + "2 -1 0 0\n" + "3 2 0 0\n" + "4 -3 0 0\n" + "5 0 1 2 4 3 0\n"; + std::istringstream stream(tracecheckText); + TraceCheckProof pf = TraceCheckProof::fromText(stream); + TS_ASSERT_EQUALS(pf.d_lines.size(), 5); + + TS_ASSERT_EQUALS(pf.d_lines[0].d_idx, 1); + TS_ASSERT_EQUALS(pf.d_lines[4].d_idx, 5); + + TS_ASSERT_EQUALS(pf.d_lines[0].d_clause.size(), 3); + TS_ASSERT_EQUALS(pf.d_lines[0].d_clause[0], SatLiteral(0, false)); + TS_ASSERT_EQUALS(pf.d_lines[0].d_clause[1], SatLiteral(1, true)); + TS_ASSERT_EQUALS(pf.d_lines[0].d_clause[2], SatLiteral(2, false)); + TS_ASSERT_EQUALS(pf.d_lines[0].d_chain.size(), 0); + + TS_ASSERT_EQUALS(pf.d_lines[4].d_chain.size(), 4); + TS_ASSERT_EQUALS(pf.d_lines[4].d_chain[0], 1); + TS_ASSERT_EQUALS(pf.d_lines[4].d_chain[1], 2); + TS_ASSERT_EQUALS(pf.d_lines[4].d_chain[2], 4); + TS_ASSERT_EQUALS(pf.d_lines[4].d_chain[3], 3); + TS_ASSERT_EQUALS(pf.d_lines[4].d_clause.size(), 0); +} + +void ErProofBlack::testErTraceCheckParse() +{ + std::string tracecheckText = + "1 1 2 -3 0 0\n" + "2 -1 -2 3 0 0\n" + "3 2 3 -4 0 0\n" + "4 -2 -3 4 0 0\n" + "5 -1 -3 -4 0 0\n" + "6 1 3 4 0 0\n" + "7 -1 2 4 0 0\n" + "8 1 -2 -4 0 0\n" + "9 5 0 0\n" + "10 5 1 0 0\n" + "11 4 5 2 0 10 7 0\n" + "12 -4 5 -3 0 10 5 0\n" + "13 3 5 -2 0 10 2 0\n" + "14 -2 -4 0 2 5 8 0\n" + "15 4 3 0 7 2 6 0\n" + "16 2 -3 0 7 5 1 0\n" + "17 2 0 3 15 16 0\n" + "18 0 4 15 14 17 0\n"; + std::istringstream stream(tracecheckText); + TraceCheckProof tc = TraceCheckProof::fromText(stream); + + std::vector<std::pair<ClauseId, SatClause>> usedClauses; + usedClauses.emplace_back( + 1, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(1, false), SatLiteral(2, true)}); + usedClauses.emplace_back( + 2, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(1, true), SatLiteral(2, false)}); + usedClauses.emplace_back( + 3, + std::vector<SatLiteral>{ + SatLiteral(1, false), SatLiteral(2, false), SatLiteral(3, true)}); + usedClauses.emplace_back( + 4, + std::vector<SatLiteral>{ + SatLiteral(1, true), SatLiteral(2, true), SatLiteral(3, false)}); + usedClauses.emplace_back( + 5, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(2, true), SatLiteral(3, true)}); + usedClauses.emplace_back( + 6, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(2, false), SatLiteral(3, false)}); + usedClauses.emplace_back( + 7, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(1, false), SatLiteral(3, false)}); + usedClauses.emplace_back( + 8, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(1, true), SatLiteral(3, true)}); + ErProof pf(usedClauses, std::move(tc)); + + TS_ASSERT_EQUALS(pf.getInputClauseIds()[0], 1); + TS_ASSERT_EQUALS(pf.getInputClauseIds()[7], 8); + + TS_ASSERT_EQUALS(pf.getDefinitions().size(), 1) + TS_ASSERT_EQUALS(pf.getDefinitions()[0].d_newVariable, SatVariable(4)); + TS_ASSERT_EQUALS(pf.getDefinitions()[0].d_oldLiteral, SatLiteral(0, true)); + TS_ASSERT_EQUALS(pf.getDefinitions()[0].d_otherLiterals.size(), 0); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines.size(), 18); + + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[0].d_idx, 1); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[16].d_idx, 17); + + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[0].d_clause.size(), 3); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[0].d_clause[0], SatLiteral(0, false)); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[0].d_clause[1], SatLiteral(1, false)); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[0].d_clause[2], SatLiteral(2, true)); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[0].d_chain.size(), 0); + + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[16].d_clause.size(), 1); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[16].d_clause[0], SatLiteral(1, false)); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[16].d_chain.size(), 3); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[16].d_chain[0], 3); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[16].d_chain[1], 15); + TS_ASSERT_EQUALS(pf.getTraceCheckProof().d_lines[16].d_chain[2], 16); +} + +void ErProofBlack::testErTraceCheckOutput() +{ + std::string tracecheckText = + "1 1 2 -3 0 0\n" + "2 -1 -2 3 0 0\n" + "3 2 3 -4 0 0\n" + "4 -2 -3 4 0 0\n" + "5 -1 -3 -4 0 0\n" + "6 1 3 4 0 0\n" + "7 -1 2 4 0 0\n" + "8 1 -2 -4 0 0\n" + "9 5 0 0\n" + "10 5 1 0 0\n" + "11 4 5 2 0 10 7 0\n" + "12 -4 5 -3 0 10 5 0\n" + "13 3 5 -2 0 10 2 0\n" + "14 -2 -4 0 2 5 8 0\n" + "15 4 3 0 7 2 6 0\n" + "16 2 -3 0 7 5 1 0\n" + "17 2 0 3 15 16 0\n" + "18 0 4 15 14 17 0\n"; + std::istringstream stream(tracecheckText); + TraceCheckProof tc = TraceCheckProof::fromText(stream); + + std::vector<std::pair<ClauseId, SatClause>> usedClauses; + usedClauses.emplace_back( + 1, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(1, false), SatLiteral(2, true)}); + usedClauses.emplace_back( + 2, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(1, true), SatLiteral(2, false)}); + usedClauses.emplace_back( + 3, + std::vector<SatLiteral>{ + SatLiteral(1, false), SatLiteral(2, false), SatLiteral(3, true)}); + usedClauses.emplace_back( + 4, + std::vector<SatLiteral>{ + SatLiteral(1, true), SatLiteral(2, true), SatLiteral(3, false)}); + usedClauses.emplace_back( + 5, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(2, true), SatLiteral(3, true)}); + usedClauses.emplace_back( + 6, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(2, false), SatLiteral(3, false)}); + usedClauses.emplace_back( + 7, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(1, false), SatLiteral(3, false)}); + usedClauses.emplace_back( + 8, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(1, true), SatLiteral(3, true)}); + ErProof pf(usedClauses, std::move(tc)); + + std::ostringstream lfsc; + pf.outputAsLfsc(lfsc); + + std::string out = R"EOF( + (decl_rat_elimination_def + (neg bb.v0) + cln + (\ er.v4 + (\ er.def4 + (clausify_rat_elimination_def _ _ _ er.def4 _ _ + (\ er.c9 + (\ er.c10 + (\ er.cnf4 + (satlem_simplify _ _ _ + (R _ _ er.c10 bb.pb7 bb.v0) (\ er.c11 + (satlem_simplify _ _ _ + (R _ _ er.c10 bb.pb5 bb.v0) (\ er.c12 + (satlem_simplify _ _ _ + (R _ _ er.c10 bb.pb2 bb.v0) (\ er.c13 + (satlem_simplify _ _ _ + (Q _ _ (R _ _ bb.pb2 bb.pb5 bb.v2) bb.pb8 bb.v0) (\ er.c14 + (satlem_simplify _ _ _ + (Q _ _ (R _ _ bb.pb7 bb.pb2 bb.v1) bb.pb6 bb.v0) (\ er.c15 + (satlem_simplify _ _ _ + (Q _ _ (R _ _ bb.pb7 bb.pb5 bb.v3) bb.pb1 bb.v0) (\ er.c16 + (satlem_simplify _ _ _ + (R _ _ (Q _ _ bb.pb3 er.c15 bb.v3) er.c16 bb.v2) (\ er.c17 + (satlem_simplify _ _ _ + (Q _ _ (R _ _ (Q _ _ bb.pb4 er.c15 bb.v2) er.c14 bb.v3) + er.c17 bb.v1) (\ er.c18 + er.c18 ; (holds cln) + )))))))))))))))) + ))) + ) + )) + ) + )EOF"; + + TS_ASSERT_EQUALS(filterWhitespace(lfsc.str()), filterWhitespace(out)); +} + +/** + * This proof has been specially constructed to stress-test the proof + * machinery, while still being short. It's a bit meandering... + */ +void ErProofBlack::testErTraceCheckOutputMedium() +{ + std::string tracecheckText = + "1 1 2 -3 0 0\n" + "2 -1 -2 3 0 0\n" + "3 2 3 -4 0 0\n" + "4 -2 -3 4 0 0\n" + "5 -1 -3 -4 0 0\n" + "6 1 3 4 0 0\n" + "7 -1 2 4 0 0\n" + "8 1 -2 -4 0 0\n" + + "9 5 2 4 0 0\n" // Definition with 2 other variables + "10 5 1 0 0\n" + "11 2 -5 -1 0 0\n" + "12 4 -5 -1 0 0\n" + + "13 6 0 0\n" // Definition with no other variables + "14 6 -3 0 0\n" + + "15 -3 4 0 11 1 10 7 4 0\n" // Chain w/ both def. and input clauses + + "16 -2 -4 0 2 5 8 0\n" // The useful bit of the proof + "17 4 3 0 7 2 6 0\n" + "18 2 -3 0 7 5 1 0\n" + "19 2 0 3 17 18 0\n" + "20 0 4 17 16 19 0\n"; + + std::istringstream stream(tracecheckText); + TraceCheckProof tc = TraceCheckProof::fromText(stream); + + std::vector<std::pair<ClauseId, SatClause>> usedClauses; + usedClauses.emplace_back( + 1, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(1, false), SatLiteral(2, true)}); + usedClauses.emplace_back( + 2, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(1, true), SatLiteral(2, false)}); + usedClauses.emplace_back( + 3, + std::vector<SatLiteral>{ + SatLiteral(1, false), SatLiteral(2, false), SatLiteral(3, true)}); + usedClauses.emplace_back( + 4, + std::vector<SatLiteral>{ + SatLiteral(1, true), SatLiteral(2, true), SatLiteral(3, false)}); + usedClauses.emplace_back( + 5, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(2, true), SatLiteral(3, true)}); + usedClauses.emplace_back( + 6, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(2, false), SatLiteral(3, false)}); + usedClauses.emplace_back( + 7, + std::vector<SatLiteral>{ + SatLiteral(0, true), SatLiteral(1, false), SatLiteral(3, false)}); + usedClauses.emplace_back( + 8, + std::vector<SatLiteral>{ + SatLiteral(0, false), SatLiteral(1, true), SatLiteral(3, true)}); + ErProof pf(usedClauses, std::move(tc)); + + std::ostringstream lfsc; + pf.outputAsLfsc(lfsc); + + std::string out = R"EOF( + (decl_rat_elimination_def + (neg bb.v0) + (clc (pos bb.v1) (clc (pos bb.v3) cln)) + (\ er.v4 + (\ er.def4 + (decl_rat_elimination_def + (pos bb.v2) + cln + (\ er.v5 + (\ er.def5 + (clausify_rat_elimination_def _ _ _ er.def4 _ _ + (\ er.c9 + (\ er.c10 + (\ er.cnf4 + (clausify_rat_elimination_def _ _ _ er.def5 _ _ + (\ er.c13 + (\ er.c14 + (\ er.cnf5 + (cnfc_unroll _ _ er.cnf4 + (\ er.c11 + (\ er.cnf4.u1 + (cnfc_unroll _ _ er.cnf4.u1 + (\ er.c12 + (\ er.cnf4.u2 + (satlem_simplify _ _ _ + (R _ _ (R _ _ (Q _ _ (Q _ _ er.c11 bb.pb1 bb.v0) + er.c10 er.v4) + bb.pb7 bb.v0) + bb.pb4 bb.v1) (\ er.c15 + (satlem_simplify _ _ _ + (Q _ _ (R _ _ bb.pb2 bb.pb5 bb.v2) bb.pb8 bb.v0) (\ er.c16 + (satlem_simplify _ _ _ + (Q _ _ (R _ _ bb.pb7 bb.pb2 bb.v1) bb.pb6 bb.v0) (\ er.c17 + (satlem_simplify _ _ _ + (Q _ _ (R _ _ bb.pb7 bb.pb5 bb.v3) bb.pb1 bb.v0) (\ er.c18 + (satlem_simplify _ _ _ + (R _ _ (Q _ _ bb.pb3 er.c17 bb.v3) er.c18 bb.v2) (\ er.c19 + (satlem_simplify _ _ _ + (Q _ _ (R _ _ (Q _ _ bb.pb4 er.c17 bb.v2) er.c16 bb.v3) + er.c19 bb.v1) (\ er.c20 + er.c20 ; (holds cln) + )))))))))))) + ))) + ))) + ))) + ) + ))) + ) + )) + ) + )) + ) + )EOF"; + + TS_ASSERT_EQUALS(filterWhitespace(lfsc.str()), filterWhitespace(out)); +} diff --git a/test/unit/proof/lfsc_proof_printer_black.h b/test/unit/proof/lfsc_proof_printer_black.h index 27372b62d..bac50c777 100644 --- a/test/unit/proof/lfsc_proof_printer_black.h +++ b/test/unit/proof/lfsc_proof_printer_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/proof/lrat_proof_black.h b/test/unit/proof/lrat_proof_black.h index 49d18ac53..398c551fe 100644 --- a/test/unit/proof/lrat_proof_black.h +++ b/test/unit/proof/lrat_proof_black.h @@ -16,13 +16,11 @@ #include <cxxtest/TestSuite.h> -#include <algorithm> -#include <cctype> #include <iostream> -#include <iterator> #include "proof/lrat/lrat_proof.h" #include "prop/sat_solver_types.h" +#include "utils.h" using namespace CVC4::proof::lrat; using namespace CVC4::prop; @@ -36,22 +34,6 @@ class LfscProofBlack : public CxxTest::TestSuite void testOutputAsLfsc(); }; -/** - * Creates a new stream with whitespace removed. - * - * @param s the source string - * - * @return a string without whitespace - */ -std::string filterWhitespace(const std::string& s) -{ - std::string out; - std::copy_if(s.cbegin(), s.cend(), std::inserter(out, out.end()), [](char c) { - return !std::isspace(c); - }); - return out; -} - void LfscProofBlack::testOutputAsLfsc() { std::vector<std::unique_ptr<LratInstruction>> instructions; @@ -109,5 +91,6 @@ void LfscProofBlack::testOutputAsLfsc() " RATHintsn)) " "LRATProofn)))"; - TS_ASSERT_EQUALS(filterWhitespace(lfsc.str()), filterWhitespace(expectedLfsc)); + TS_ASSERT_EQUALS(filterWhitespace(lfsc.str()), + filterWhitespace(expectedLfsc)); } diff --git a/test/unit/proof/utils.h b/test/unit/proof/utils.h new file mode 100644 index 000000000..19b24f4c3 --- /dev/null +++ b/test/unit/proof/utils.h @@ -0,0 +1,34 @@ +/********************* */ +/*! \file utils.h + ** \verbatim + ** Top contributors (to current version): + ** Alex Ozdemir + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Utilities for proof testing + **/ + +#include <algorithm> +#include <string> +#include <cctype> +#include <iterator> + +/** + * Creates a new stream with whitespace removed. + * + * @param s the source string + * + * @return a string without whitespace + */ +std::string filterWhitespace(const std::string& s) +{ + std::string out; + std::copy_if(s.cbegin(), s.cend(), std::inserter(out, out.end()), [](char c) { + return !std::isspace(c); + }); + return out; +} diff --git a/test/unit/prop/cnf_stream_white.h b/test/unit/prop/cnf_stream_white.h index 35eb240a2..7aaf1f4de 100644 --- a/test/unit/prop/cnf_stream_white.h +++ b/test/unit/prop/cnf_stream_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway, Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/CMakeLists.txt b/test/unit/theory/CMakeLists.txt index 3d29c4de1..963466b09 100644 --- a/test/unit/theory/CMakeLists.txt +++ b/test/unit/theory/CMakeLists.txt @@ -2,6 +2,7 @@ cvc4_add_unit_test_black(theory_black theory) cvc4_add_unit_test_white(evaluator_white theory) cvc4_add_unit_test_white(logic_info_white theory) cvc4_add_unit_test_white(theory_arith_white theory) +cvc4_add_unit_test_white(theory_bv_rewriter_white theory) cvc4_add_unit_test_white(theory_bv_white theory) cvc4_add_unit_test_white(theory_engine_white theory) cvc4_add_unit_test_white(theory_quantifiers_bv_instantiator_white theory) diff --git a/test/unit/theory/evaluator_white.h b/test/unit/theory/evaluator_white.h index 9dc6f9520..cfdab7c9e 100644 --- a/test/unit/theory/evaluator_white.h +++ b/test/unit/theory/evaluator_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/logic_info_white.h b/test/unit/theory/logic_info_white.h index 427bcc34d..b55197e50 100644 --- a/test/unit/theory/logic_info_white.h +++ b/test/unit/theory/logic_info_white.h @@ -2,9 +2,9 @@ /*! \file logic_info_white.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Mathias Preiner, Andres Noetzli + ** Morgan Deters, Andres Noetzli, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/theory_arith_white.h b/test/unit/theory/theory_arith_white.h index d81406dac..235931efd 100644 --- a/test/unit/theory/theory_arith_white.h +++ b/test/unit/theory/theory_arith_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/theory_black.h b/test/unit/theory/theory_black.h index 569d7e30b..8ae90c4c3 100644 --- a/test/unit/theory/theory_black.h +++ b/test/unit/theory/theory_black.h @@ -2,9 +2,9 @@ /*! \file theory_black.h ** \verbatim ** Top contributors (to current version): - ** Clark Barrett, Tim King + ** Clark Barrett, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/theory_bv_rewriter_white.h b/test/unit/theory/theory_bv_rewriter_white.h new file mode 100644 index 000000000..1f4cc0c2c --- /dev/null +++ b/test/unit/theory/theory_bv_rewriter_white.h @@ -0,0 +1,94 @@ +/********************* */ +/*! \file theory_bv_rewriter_white.h + ** \verbatim + ** Top contributors (to current version): + ** Andres Noetzli + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief Unit tests for the bit-vector rewriter + ** + ** Unit tests for the bit-vector rewriter. + **/ + +#include "expr/node.h" +#include "expr/node_manager.h" +#include "smt/smt_engine.h" +#include "smt/smt_engine_scope.h" +#include "theory/rewriter.h" +#include "util/bitvector.h" + +#include <cxxtest/TestSuite.h> +#include <iostream> +#include <memory> +#include <vector> + +using namespace CVC4; +using namespace CVC4::kind; +using namespace CVC4::smt; +using namespace CVC4::theory; + +class TheoryBvRewriterWhite : public CxxTest::TestSuite +{ + public: + TheoryBvRewriterWhite() {} + + void setUp() override + { + Options opts; + opts.setOutputLanguage(language::output::LANG_SMTLIB_V2); + d_em = new ExprManager(opts); + d_smt = new SmtEngine(d_em); + d_scope = new SmtScope(d_smt); + + d_nm = NodeManager::currentNM(); + } + + void tearDown() override + { + delete d_scope; + delete d_smt; + delete d_em; + } + + Node boolToBv(Node b) + { + return d_nm->mkNode(ITE, + b, + d_nm->mkConst(BitVector(1, 1u)), + d_nm->mkConst(BitVector(1, 0u))); + } + + void testRewriteToFixpoint() + { + TypeNode boolType = d_nm->booleanType(); + TypeNode bvType = d_nm->mkBitVectorType(1); + + Node zero = d_nm->mkConst(BitVector(1, 0u)); + Node b1 = d_nm->mkVar("b1", boolType); + Node b2 = d_nm->mkVar("b2", boolType); + Node b3 = d_nm->mkVar("b3", boolType); + Node bv = d_nm->mkVar("bv", bvType); + + Node n = d_nm->mkNode( + BITVECTOR_ITE, + boolToBv(b1), + d_nm->mkNode(BITVECTOR_ITE, + boolToBv(b2), + d_nm->mkNode(BITVECTOR_ITE, boolToBv(b3), zero, bv), + bv), + bv); + Node nr = Rewriter::rewrite(n); + TS_ASSERT_EQUALS(nr, Rewriter::rewrite(nr)); + } + + private: + ExprManager* d_em; + SmtEngine* d_smt; + SmtScope* d_scope; + + NodeManager* d_nm; +}; diff --git a/test/unit/theory/theory_bv_white.h b/test/unit/theory/theory_bv_white.h index 9b0d56998..bc5f73435 100644 --- a/test/unit/theory/theory_bv_white.h +++ b/test/unit/theory/theory_bv_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Aina Niemetz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/theory_engine_white.h b/test/unit/theory/theory_engine_white.h index 50057f9fd..d357b200e 100644 --- a/test/unit/theory/theory_engine_white.h +++ b/test/unit/theory/theory_engine_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Dejan Jovanovic, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/theory_quantifiers_bv_instantiator_white.h b/test/unit/theory/theory_quantifiers_bv_instantiator_white.h index 5d50490c0..2b61aeb00 100644 --- a/test/unit/theory/theory_quantifiers_bv_instantiator_white.h +++ b/test/unit/theory/theory_quantifiers_bv_instantiator_white.h @@ -2,9 +2,9 @@ /*! \file theory_quantifiers_bv_instantiator_white.h ** \verbatim ** Top contributors (to current version): - ** Mathias Preiner, Andrew Reynolds + ** Mathias Preiner, Andres Noetzli, Aina Niemetz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/theory_quantifiers_bv_inverter_white.h b/test/unit/theory/theory_quantifiers_bv_inverter_white.h index ee643bcf6..5be92b19e 100644 --- a/test/unit/theory/theory_quantifiers_bv_inverter_white.h +++ b/test/unit/theory/theory_quantifiers_bv_inverter_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Aina Niemetz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/theory_strings_rewriter_white.h b/test/unit/theory/theory_strings_rewriter_white.h index 5b4846a12..e6bd8671b 100644 --- a/test/unit/theory/theory_strings_rewriter_white.h +++ b/test/unit/theory/theory_strings_rewriter_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -445,6 +445,8 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite Node abcd = d_nm->mkConst(::CVC4::String("ABCD")); Node aaad = d_nm->mkConst(::CVC4::String("AAAD")); Node b = d_nm->mkConst(::CVC4::String("B")); + Node c = d_nm->mkConst(::CVC4::String("C")); + Node ccc = d_nm->mkConst(::CVC4::String("CCC")); Node x = d_nm->mkVar("x", strType); Node y = d_nm->mkVar("y", strType); Node negOne = d_nm->mkConst(Rational(-1)); @@ -453,6 +455,7 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite Node two = d_nm->mkConst(Rational(2)); Node three = d_nm->mkConst(Rational(3)); Node i = d_nm->mkVar("i", intType); + Node j = d_nm->mkVar("j", intType); // Same normal form for: // @@ -487,6 +490,54 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite a, i); sameNormalForm(idof_substr, negOne); + + { + // Same normal form for: + // + // (str.indexof (str.++ "B" (str.substr "CCC" i j) x "A") "A" 0) + // + // (+ 1 (str.len (str.substr "CCC" i j)) + // (str.indexof (str.++ "A" x y) "A" 0)) + Node lhs = d_nm->mkNode( + kind::STRING_STRIDOF, + d_nm->mkNode(kind::STRING_CONCAT, + b, + d_nm->mkNode(kind::STRING_SUBSTR, ccc, i, j), + x, + a), + a, + zero); + Node rhs = d_nm->mkNode( + kind::PLUS, + one, + d_nm->mkNode(kind::STRING_LENGTH, + d_nm->mkNode(kind::STRING_SUBSTR, ccc, i, j)), + d_nm->mkNode(kind::STRING_STRIDOF, + d_nm->mkNode(kind::STRING_CONCAT, x, a), + a, + zero)); + sameNormalForm(lhs, rhs); + } + + { + // Same normal form for: + // + // (str.indexof (str.++ "B" "C" "A" x y) "A" 0) + // + // (+ 2 (str.indexof (str.++ "A" x y) "A" 0)) + Node lhs = d_nm->mkNode(kind::STRING_STRIDOF, + d_nm->mkNode(kind::STRING_CONCAT, b, c, a, x, y), + a, + zero); + Node rhs = + d_nm->mkNode(kind::PLUS, + two, + d_nm->mkNode(kind::STRING_STRIDOF, + d_nm->mkNode(kind::STRING_CONCAT, a, x, y), + a, + zero)); + sameNormalForm(lhs, rhs); + } } void testRewriteReplace() @@ -650,6 +701,7 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite Node empty = d_nm->mkConst(::CVC4::String("")); Node a = d_nm->mkConst(::CVC4::String("A")); Node aac = d_nm->mkConst(::CVC4::String("AAC")); + Node ab = d_nm->mkConst(::CVC4::String("AB")); Node b = d_nm->mkConst(::CVC4::String("B")); Node c = d_nm->mkConst(::CVC4::String("C")); Node abc = d_nm->mkConst(::CVC4::String("ABC")); @@ -934,6 +986,22 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite rhs = d_nm->mkNode(kind::STRING_STRCTN, x, abc); differentNormalForms(lhs, rhs); } + + { + // Same normal form for: + // + // (str.contains (str.++ (str.substr "DEF" n m) x) "AB") + // + // (str.contains x "AB") + lhs = d_nm->mkNode( + kind::STRING_STRCTN, + d_nm->mkNode(kind::STRING_CONCAT, + d_nm->mkNode(kind::STRING_SUBSTR, def, n, m), + x), + ab); + rhs = d_nm->mkNode(kind::STRING_STRCTN, x, ab); + sameNormalForm(lhs, rhs); + } } void testInferEqsFromContains() @@ -1027,8 +1095,11 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite Node a = d_nm->mkConst(::CVC4::String("A")); Node aaa = d_nm->mkConst(::CVC4::String("AAA")); Node b = d_nm->mkConst(::CVC4::String("B")); + Node ba = d_nm->mkConst(::CVC4::String("BA")); + Node w = d_nm->mkVar("w", strType); Node x = d_nm->mkVar("x", strType); Node y = d_nm->mkVar("y", strType); + Node z = d_nm->mkVar("z", strType); Node xxa = d_nm->mkNode(kind::STRING_CONCAT, x, x, a); Node f = d_nm->mkConst(false); Node n = d_nm->mkVar("n", intType); @@ -1228,9 +1299,55 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite { // (= (str.++ "A" (int.to.str n)) "A") -/-> false Node eq = d_nm->mkNode( - kind::EQUAL, d_nm->mkNode(kind::STRING_CONCAT, a, d_nm->mkNode(kind::STRING_ITOS, n)), a); + kind::EQUAL, + d_nm->mkNode( + kind::STRING_CONCAT, a, d_nm->mkNode(kind::STRING_ITOS, n)), + a); differentNormalForms(eq, f); } + + { + // (= (str.++ "A" x y) (str.++ x "B" z)) --> false + Node eq = d_nm->mkNode( + kind::EQUAL, + d_nm->mkNode(kind::STRING_CONCAT, a, x, y), + d_nm->mkNode(kind::STRING_CONCAT, x, b, z)); + sameNormalForm(eq, f); + } + + { + // (= (str.++ "B" x y) (str.++ x "AAA" z)) --> false + Node eq = d_nm->mkNode(kind::EQUAL, + d_nm->mkNode(kind::STRING_CONCAT, b, x, y), + d_nm->mkNode(kind::STRING_CONCAT, x, aaa, z)); + sameNormalForm(eq, f); + } + + { + Node xrepl = d_nm->mkNode(kind::STRING_STRREPL, x, a, b); + + // Same normal form for: + // + // (= (str.++ "B" (str.replace x "A" "B") z y w) + // (str.++ z (str.replace x "A" "B") "BA" z)) + // + // (and (= (str.++ "B" (str.replace x "A" "B") z) + // (str.++ z (str.replace x "A" "B") "B")) + // (= (str.++ y w) (str.++ "A" z))) + Node lhs = + d_nm->mkNode(kind::EQUAL, + d_nm->mkNode(kind::STRING_CONCAT, b, xrepl, z, y, w), + d_nm->mkNode(kind::STRING_CONCAT, z, x, ba, z)); + Node rhs = d_nm->mkNode( + kind::AND, + d_nm->mkNode(kind::EQUAL, + d_nm->mkNode(kind::STRING_CONCAT, b, xrepl, z), + d_nm->mkNode(kind::STRING_CONCAT, z, x, b)), + d_nm->mkNode(kind::EQUAL, + d_nm->mkNode(kind::STRING_CONCAT, y, w), + d_nm->mkNode(kind::STRING_CONCAT, a, z))); + sameNormalForm(lhs, rhs); + } } void testStripConstantEndpoints() @@ -1241,6 +1358,10 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite Node empty = d_nm->mkConst(::CVC4::String("")); Node a = d_nm->mkConst(::CVC4::String("A")); Node ab = d_nm->mkConst(::CVC4::String("AB")); + Node abc = d_nm->mkConst(::CVC4::String("ABC")); + Node abcd = d_nm->mkConst(::CVC4::String("ABCD")); + Node bc = d_nm->mkConst(::CVC4::String("BC")); + Node c = d_nm->mkConst(::CVC4::String("C")); Node cd = d_nm->mkConst(::CVC4::String("CD")); Node x = d_nm->mkVar("x", strType); Node y = d_nm->mkVar("y", strType); @@ -1268,6 +1389,78 @@ class TheoryStringsRewriterWhite : public CxxTest::TestSuite TheoryStringsRewriter::stripConstantEndpoints(n1, n2, nb, ne, 0); TS_ASSERT(!res); } + + { + // stripConstantEndpoints({ "ABCD" }, { "C" }, {}, {}, 1) + // ---> true + // n1 is updated to { "CD" } + // nb is updated to { "AB" } + std::vector<Node> n1 = {abcd}; + std::vector<Node> n2 = {c}; + std::vector<Node> nb; + std::vector<Node> ne; + std::vector<Node> n1r = {cd}; + std::vector<Node> nbr = {ab}; + bool res = + TheoryStringsRewriter::stripConstantEndpoints(n1, n2, nb, ne, 1); + TS_ASSERT(res); + TS_ASSERT_EQUALS(n1, n1r); + TS_ASSERT_EQUALS(nb, nbr); + } + + { + // stripConstantEndpoints({ "ABC", x }, { "CD" }, {}, {}, 1) + // ---> true + // n1 is updated to { "C", x } + // nb is updated to { "AB" } + std::vector<Node> n1 = {abc, x}; + std::vector<Node> n2 = {cd}; + std::vector<Node> nb; + std::vector<Node> ne; + std::vector<Node> n1r = {c, x}; + std::vector<Node> nbr = {ab}; + bool res = + TheoryStringsRewriter::stripConstantEndpoints(n1, n2, nb, ne, 1); + TS_ASSERT(res); + TS_ASSERT_EQUALS(n1, n1r); + TS_ASSERT_EQUALS(nb, nbr); + } + + { + // stripConstantEndpoints({ "ABC" }, { "A" }, {}, {}, -1) + // ---> true + // n1 is updated to { "A" } + // nb is updated to { "BC" } + std::vector<Node> n1 = {abc}; + std::vector<Node> n2 = {a}; + std::vector<Node> nb; + std::vector<Node> ne; + std::vector<Node> n1r = {a}; + std::vector<Node> ner = {bc}; + bool res = + TheoryStringsRewriter::stripConstantEndpoints(n1, n2, nb, ne, -1); + TS_ASSERT(res); + TS_ASSERT_EQUALS(n1, n1r); + TS_ASSERT_EQUALS(ne, ner); + } + + { + // stripConstantEndpoints({ x, "ABC" }, { y, "A" }, {}, {}, -1) + // ---> true + // n1 is updated to { x, "A" } + // nb is updated to { "BC" } + std::vector<Node> n1 = {x, abc}; + std::vector<Node> n2 = {y, a}; + std::vector<Node> nb; + std::vector<Node> ne; + std::vector<Node> n1r = {x, a}; + std::vector<Node> ner = {bc}; + bool res = + TheoryStringsRewriter::stripConstantEndpoints(n1, n2, nb, ne, -1); + TS_ASSERT(res); + TS_ASSERT_EQUALS(n1, n1r); + TS_ASSERT_EQUALS(ne, ner); + } } void testRewriteMembership() diff --git a/test/unit/theory/theory_strings_skolem_cache_black.h b/test/unit/theory/theory_strings_skolem_cache_black.h index aaf50f219..34e8d88c6 100644 --- a/test/unit/theory/theory_strings_skolem_cache_black.h +++ b/test/unit/theory/theory_strings_skolem_cache_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/theory_white.h b/test/unit/theory/theory_white.h index 4ff11014b..3c6721857 100644 --- a/test/unit/theory/theory_white.h +++ b/test/unit/theory/theory_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters, Clark Barrett ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/theory/type_enumerator_white.h b/test/unit/theory/type_enumerator_white.h index b0f69d32e..2c3f09ce0 100644 --- a/test/unit/theory/type_enumerator_white.h +++ b/test/unit/theory/type_enumerator_white.h @@ -2,9 +2,9 @@ /*! \file type_enumerator_white.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Andres Noetzli, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/array_store_all_black.h b/test/unit/util/array_store_all_black.h index 21274389b..0b8313222 100644 --- a/test/unit/util/array_store_all_black.h +++ b/test/unit/util/array_store_all_black.h @@ -2,9 +2,9 @@ /*! \file array_store_all_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Tim King, Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/assert_white.h b/test/unit/util/assert_white.h index e45d15296..47acbcc6d 100644 --- a/test/unit/util/assert_white.h +++ b/test/unit/util/assert_white.h @@ -2,9 +2,9 @@ /*! \file assert_white.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Mathias Preiner, Tim King + ** Morgan Deters, Andres Noetzli, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/binary_heap_black.h b/test/unit/util/binary_heap_black.h index ce7e854d8..192237b49 100644 --- a/test/unit/util/binary_heap_black.h +++ b/test/unit/util/binary_heap_black.h @@ -2,9 +2,9 @@ /*! \file binary_heap_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/bitvector_black.h b/test/unit/util/bitvector_black.h index 1446008e6..7bec02158 100644 --- a/test/unit/util/bitvector_black.h +++ b/test/unit/util/bitvector_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli, Christopher L. Conway, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/boolean_simplification_black.h b/test/unit/util/boolean_simplification_black.h index 445103407..239d3f21a 100644 --- a/test/unit/util/boolean_simplification_black.h +++ b/test/unit/util/boolean_simplification_black.h @@ -2,9 +2,9 @@ /*! \file boolean_simplification_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King, Andrew Reynolds + ** Morgan Deters, Andres Noetzli, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/cardinality_public.h b/test/unit/util/cardinality_public.h index ee4a23fd3..6a8b062ea 100644 --- a/test/unit/util/cardinality_public.h +++ b/test/unit/util/cardinality_public.h @@ -2,9 +2,9 @@ /*! \file cardinality_public.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/check_white.h b/test/unit/util/check_white.h index d0e1b8bac..26a816163 100644 --- a/test/unit/util/check_white.h +++ b/test/unit/util/check_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/configuration_black.h b/test/unit/util/configuration_black.h index c5495609e..119947616 100644 --- a/test/unit/util/configuration_black.h +++ b/test/unit/util/configuration_black.h @@ -2,9 +2,9 @@ /*! \file configuration_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/datatype_black.h b/test/unit/util/datatype_black.h index 160f25e6f..e48d04a7f 100644 --- a/test/unit/util/datatype_black.h +++ b/test/unit/util/datatype_black.h @@ -2,9 +2,9 @@ /*! \file datatype_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Tim King + ** Morgan Deters, Andrew Reynolds, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/exception_black.h b/test/unit/util/exception_black.h index ba17d28da..264297e35 100644 --- a/test/unit/util/exception_black.h +++ b/test/unit/util/exception_black.h @@ -2,9 +2,9 @@ /*! \file exception_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/integer_black.h b/test/unit/util/integer_black.h index 9297429b4..31894d892 100644 --- a/test/unit/util/integer_black.h +++ b/test/unit/util/integer_black.h @@ -2,9 +2,9 @@ /*! \file integer_black.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Morgan Deters, Aina Niemetz + ** Tim King, Aina Niemetz, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/integer_white.h b/test/unit/util/integer_white.h index b666512d5..7c513d575 100644 --- a/test/unit/util/integer_white.h +++ b/test/unit/util/integer_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/listener_black.h b/test/unit/util/listener_black.h index 7296de060..69be11b14 100644 --- a/test/unit/util/listener_black.h +++ b/test/unit/util/listener_black.h @@ -2,9 +2,9 @@ /*! \file listener_black.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Paul Meng + ** Tim King, Andres Noetzli, Paul Meng ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/output_black.h b/test/unit/util/output_black.h index cea30f360..9fee218a2 100644 --- a/test/unit/util/output_black.h +++ b/test/unit/util/output_black.h @@ -2,9 +2,9 @@ /*! \file output_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Tim King + ** Morgan Deters, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/rational_black.h b/test/unit/util/rational_black.h index caadccb3c..88f856592 100644 --- a/test/unit/util/rational_black.h +++ b/test/unit/util/rational_black.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Christopher L. Conway ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/rational_white.h b/test/unit/util/rational_white.h index 7f4fcc2b1..884059b48 100644 --- a/test/unit/util/rational_white.h +++ b/test/unit/util/rational_white.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Morgan Deters ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/test/unit/util/stats_black.h b/test/unit/util/stats_black.h index ab51b8d74..5cb6c2099 100644 --- a/test/unit/util/stats_black.h +++ b/test/unit/util/stats_black.h @@ -2,9 +2,9 @@ /*! \file stats_black.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andres Noetzli, Tim King + ** Andres Noetzli, Morgan Deters, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim |