summaryrefslogtreecommitdiff
path: root/src/util
AgeCommit message (Collapse)Author
2021-06-02Remove `Options::operator[]` (#6649)Gereon Kremer
This PR removes the next heavily specialized template function Options::operator[] in favor of direct access to the option data.
2021-05-27FP: Rename FLOATINGPOINT_PLUS to FLOATINGPOINT_ADD. (#6628)Aina Niemetz
This is to make it consistent with the name of the SMT-LIB operator (fp.add).
2021-05-26 More precise includes of `Node` constants (#6617)Andres Noetzli
We store constants, e.g., BitVector and Rational, in our node infrastructure. As a result, we were indirectly including some headers in almost all files, e.g., the GMP headers. This commit changes that by forward-declaring the classes for the constants. As a result, we have to include headers like util/rational.h explicitly when we use Rational but it saves about 3 minutes in compile time (CPU time). The commit changes RoundingMode from an enum to an enum class such that it can be forward declared.
2021-05-20Add more getters for api::Term (#6496)Gereon Kremer
This PR adds more getter functions for api::Term to retrieve values from constant terms (and terms that the average API use might consider constant). It also introduces std::wstring as regular representation for string constants instead of std::vector<uint32> for the SMT-LIB parser and the String class.
2021-05-07Add support for datatype update (#6449)Andrew Reynolds
This removes the special case of TUPLE_UPDATE and RECORD_UPDATE in favor of the more general datatype update. Datatype update is handled analogously to APPLY_SELECTOR / APPLY_TESTER.
2021-04-28Refactor resource manager options (#6446)Gereon Kremer
This PR refactors how the resource manager options are used. It moves options relevant for the resource manager into its own file (making the number of smt options a bit smaller) and uses the Options object directly instead of using the old static accessors.
2021-04-28Remove exception headers from options.h (#6456)Gereon Kremer
This PR removes two headers for exceptions from options.h, and instead pushes the includes to a couple of source files.
2021-04-28Make sure reference stats are reset properly (#6457)Gereon Kremer
This PR adds a reset() method to the ReferenceStat class. It then uses it to properly reset such statistics in the minisat solvers where lifetime is an issue.
2021-04-26Protect int stats methods (#6442)Gereon Kremer
This PR protects two methods of the IntStat class in case statistics are disabled.
2021-04-23Make sure a ReferenceStat is set to values of the correct type (#6430)Gereon Kremer
This PR fixes a very subtle issue with setting the values a ReferenceStat refers to. ReferenceStat::set() would take a variable by const& and then store the pointer to it. When giving it a different, but implicitly convertible, type, the pointer would assume the wrong type and consequently read incorrect values from it. This PR makes set() a template function that explicitly checks that the given type is the correct one. As we can only export int64_t to the API, this forces users of ReferenceStat to use int64_t stats.
2021-04-21Goodbye CVC4, hello cvc5! (#6371)Mathias Preiner
This commits changes the build system to cvc5 and removes the remaining occurrences of CVC4. It further cleans up outdated/unused scripts in contrib/.
2021-04-20Add InferenceId as resources (#6339)Gereon Kremer
This PR extends the resource manager to consider theory::InferenceId a resource we can spend. This should give us a robust way to have the resource limiting cover a lot of theory reasoning. To make use of this, TheoryInferenceManager now spends these resources. Also, it makes the ResourceManager properly use the options from the Env class.
2021-04-16Replace SExpr class by simpler conversion routines (#6363)Gereon Kremer
This PR finally removes the SExpr class. SMT-LIB compatible output is retained by using new on-the-fly conversion to s-expression strings. This finally allows us to remove includes to integer and rational from smt_engine.h. In detail: - a new set of toSExpr() methods is implemented that converts certain types to s-expression strings (without an intermediate class representing s-expressions) - SmtEngine::getInfo() returns a string instead of SExpr and uses the new toSExpr methods - SmtEngine::getStatistic() is removed - SExpr class is removed - d_commandVerbosity uses int instead of Integer
2021-04-15Avoid options listener for resource manager. (#6366)Gereon Kremer
This PR simplifies how the resource manager interacts with the options. Instead of using some notification mechanism, the resource manager simply retrieves the options via options::xyz(). This simplifies the options handler, the resource manager interface and the options. When instructed to do so by the API, the SmtEngine now overwrites the respective option instead of calling out to the resource manager.
2021-04-15Rename occurrences of CVC4 to CVC5. (#6351)Aina Niemetz
This renames everything but GitHub links and build system related macros. Switching the build system to cvc5 will be the last step in the renaming process.
2021-04-15Fix printing of stats when aborted. (#6362)Gereon Kremer
This PR improves/fixes printing of statistics when the solver has been aborted, i.e. when we use printSafe(), and a few other minor issues with the new statistics setup. add toString() methods for TypeConstant, api::Kind to allow for automatic printing by print_safe<>() improve kindToString() to avoid std::stringstream fix newlines between statistics in printSafe() make printing of histograms consistent make --stats-all, --stats-expert and --stats-every-check automatically enable --stats (and vice versa)
2021-04-14Refactor / reimplement statistics (#6162)Gereon Kremer
This PR refactors how we collect statistics. It splits the current statistic values into the values and a proxy object. The actual values now live inside the registry (making the ownership model way easier) while the proxy object are handed to whoever wants to collect a new statistic. It also extends the C++ API to obtain and inspect the statistics. To change the ownership, this PR needs to touch every single statistic in the whole codebase and change how it is registered.
2021-04-14Rename public and private headers in src/include. (#6352)Aina Niemetz
2021-04-12Fix computation of whether a type is finite (#6312)Andrew Reynolds
This PR generalizes TypeNode::isFinite / TypeNode::isInterpretedFinite with TypeNode::getCardinalityClass. It then uses this method to fix our computation of when a type should be treated as finite. Fixes #4260, fixes #6100 (that benchmark now says unknown without an error).
2021-04-12Refactor resource manager (#6322)Gereon Kremer
This PR does another round of refactoring of the resource manager and related code. - it moves the Resource enum out of the ResourceManager class - it treats the resources in a generic way (storing the statistics in a vector) instead of the manual treatment we had before - weights no longer live in the options, but in the ResourceManager and are changed accordingly in the ResourceManager constructor - following the generic treatment of resources, it also removes all the resource-specific options --x-step in favor of a generic --rweight name=weight - removed several unused methods from the ResourceManager Note that we handle the Resource enum in a way that allows to easily use other enums as additional resources, for example InferenceId. The general idea is that we will at some point have sensible default weights (so that the cumulative resources somewhat simulate the solver runtime) and users (almost) never need to modify them.
2021-04-12Refactor and update copyright headers. (#6316)Aina Niemetz
2021-04-09Rename CVC4_ macros to CVC5_. (#6327)Aina Niemetz
2021-04-09Rename CVC4__ header guards to CVC5__. (#6326)Aina Niemetz
2021-04-07Add cardinality class definition (#6302)Andrew Reynolds
This is work towards correcting our computation of whether a type is finite. Currently, arrays/functions with uninterpreted sorts as element/range types are always considered infinite. This is incorrect if finite model finding is enabled, since the interpretation of the uninterpreted sort can be one. This leads to errors during model building due to exhausted values (#4260, #6100). This PR adds a new concept of a cardinality class, which is required for properly categorizing types with/without finite model finding. A followup PR will replace TypeNode::isFinite with TypeNode::getCardinalityClass. Calls to TypeNode::isFinite will be replaced by calls to TheoryState::isTypeFinite, which will properly take cardinality classes into account.
2021-04-02New statistics registry (#6210)Gereon Kremer
This PR adds the next part of the new statistics setup: the registry. The new statistics registry owns the actual data and only issues proxy objects that can be used to modify the internally stored data. Once we replace the old statistics setup, the files should be renamed from statistics_reg.* to statistics_registry.*.
2021-04-01Add utility classes for new statistics (#6178)Gereon Kremer
This PR introduces two new sets of classes used for the new statistics setup. The first set are the statistic values that hold the actual data and will live in the new statistics registry itself. The second set are proxy objects: they only hold a pointer to the value classes and implement all the modifiers. The code is not used yet, but replaces the code in the stats_* files in a subsequent PR.
2021-04-01FP: Factor out symfpu traits. (#6246)Aina Niemetz
This is in preparation for a MPFR floating-point literal implementation. We will need to have both literal kinds return a symFPU unpacked float via `getSymUF()` in order to be able to plug it into the fp_converter. For this, it makes sense to have the traits implemented and to be included separately, so that they can also be included in the MPFR implementation.
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-29FloatingPointLiteral: Constructor for special consts. (#6220)Aina Niemetz
This replaces static helpers for creating special consts with constructors. This is in preparation for a FP literal implementation using MPFR. In the next step, I'll introduce a FloatingPointLiteral base class, from which the specialization FloatingPointSymFPULiteral is derived. The MPFR implementation will also be derived from the base class. This is in order to make unit tests that compare between the two possible. Further, in the worst case, MPFR will have to use SymFPU for unsupported cases (to be determined).
2021-03-26FloatingPointLiteral: Make constructors that shouldn't be used outside of ↵Aina Niemetz
FloatingPoint(Literal) private. (#6211)
2021-03-25FP: Refactor FloatingPointLiteral in preparation for MPFR. (#6206)Aina Niemetz
This pushes all symfpu specific parts from FloatingPoint into FloatingPointLiteral. FloatingPoint is now generic. An additional FloatingPointLiteral implementation using MPFR will be made configurable similiarly to how we handle Integers with either GMP or CLN backend.
2021-03-22FP: Add documentation for FloatingPointLiteral constructors. (#6183)Aina Niemetz
2021-03-19BitVector: Change setBit to set the bit in place. (#6176)Aina Niemetz
Creating BitVectors (and deleting them) is in general expensive because of the underlying multi-precision Integer. If possible, unnecessary constructions and desctructions of BitVectors should be avoided. The most common use case for `setBit` is that for an existing BitVector, a given bit should be set to a certain value. Not doing this in place generates unnecessary constructions and destructions of BitVectors.
2021-03-19FP: Use setBit instead of bv or in conversion from Real. (#6177)Aina Niemetz
This is a minor optimization that goes into effect as soon as #6176 goes in.
2021-03-16cmake: Generate cvc4_export.h and set visibility to hidden. (#6139)Mathias Preiner
The build system (cmake) will automatically generate an export header cvc4_export.h, which makes sure that the correct export features are defined depending on the compiler and target platform. The macro CVC4_EXPORT replaces CVC4_PUBLIC and its usage is reduced by 2/3. Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2021-03-15Replace HistogramStat by IntegralHistogramStat (#6126)Gereon Kremer
This PR uses IntegralHistogramStat instead of HistogramStat when appropriate, that is everywhere.
2021-03-11First refactoring of statistics classes (#6105)Gereon Kremer
This PR does a first round of refactoring on the statistics, in particular the Stat class and derived classes. It significantly shrinks the class hierarchy, modernizes some code (e.g. use std::chrono instead of clock_gettime), removes unused features (e.g. nesting of statistics) and does some general cleanup and consolidation. Subsequent PRs are planned to change the ownership model (right now every module owns the Stat object) which makes the whole register / unregister mechanism obsolete.
2021-03-11Use CVC4_ASSERTIONS instead of NDEBUG. (#6099)Mathias Preiner
Ensures that all checks are performed in production builds with enabled assertions.
2021-03-10Use Assert instead of assert. (#6095)Mathias Preiner
This commit replaces all uses of assert with Assert from base/check.h to ensure that all assertions get checked in production builds with enabled assertions.
2021-03-09Update copyright headers to 2021. (#6081)Aina Niemetz
2021-03-04New C++ API: Clean up usage of internal Result. (#6043)Aina Niemetz
This disables the temporarily available internals of Result. It further changes the interface for getUnknownExplanation, which now returns an enum value instead of a string.
2021-03-03More cleanup of includes to reduce compilation times (#6037)Gereon Kremer
Similar to #6031, this PR implements suggestions from iwyu to reduce the number of includes in header files by introducing forward declarations and moving includes to source files.
2021-03-02Remove non-ASCII characters from source files. (#6039)Mathias Preiner
Make collect_tags.py more robust for non-ASCII characters.
2021-03-02Clean up includes to reduce compile times (#6031)Gereon Kremer
This PR cleans up a ton of includes, based on the suggestions of iwyu. Mostly, it removes includes from header files in favor of forward declarations and adds includes to source files.
2021-02-24Enable -Werror. (#5969)Mathias Preiner
2021-02-23Switch to C++17. (#5959)Mathias Preiner
Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2021-02-22(proof-new) Add new arithmetic kind INDEXED_ROOT_PREDICATE. (#5949)Gereon Kremer
This PR introduces a new arithmetic kind for indexed root predicates. An indexed root predicate compares a real variable to the k'th root of a given polynomial as follows: Let IRP_k(x ~ 0, p) an indexed root predicate with k a non-negative number, x some real variable, ~ an arithmetic relation (e.g. =, <, ...), and p a polynomial over x (and possibly other variables). If p contains variables apart from x, we can only evaluate the expression over a suitable assignment for at least these variables. The evaluation of this expression is equivalent to computing the k'th real root of p in x (with all other variables evaluated over a given assignment) and comparing this real root to zero (according to the relation symbol ~). Note that we currently do not intend to use this structure for solving, but require it for representing and printing CAD proofs.
2021-02-17Add new IntegralHistogramStat (#5898)Gereon Kremer
This PR adds a new statistics class that improves on HistogramStat if we know that the type is integral (also supporting enums). Instead of using a comparably slow std::map like HistogramStat, IntegralHistogramStat uses a std::vector that is resized appropriately. The integral values are simply cast to std::int64_t and used as indices into the vector.
2021-02-01Avoid calling the printers while converting sexpr to string. (#5842)Abdalrhman Mohamed
This PR modifies sexprToString to use Term::getString to get string constants instead of Term::toString, which depends on the output language. The previous behavior caused CVC4 to crash when AST is picked as the output language.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback