summaryrefslogtreecommitdiff
path: root/src/util
AgeCommit message (Collapse)Author
2021-09-01Make driver::totalTime a TimerStat (#7089)Gereon Kremer
This makes the `driver::totalTime` statistic a `TimerStat`. This eliminates the need to obtain the overall runtime in the driver and write it to the statistics towards the end of the runtime. This not only eliminates some code in the driver, but also gets rid of the call to `getSmtEngine()` that goes around the API. One disclaimer: The statistics output changes from seconds as a double (i.e. `1.234`) to milliseconds (i.e. `1234ms`).
2021-08-30Refactor filename handling (#7088)Gereon Kremer
This PR simplifies how we store the current input file name and handle setting and getting it. It is now an option, that can also be set and get via setInfo() and getInfo().
2021-08-26Consolidate language types (#7065)Gereon Kremer
This PR combines the two enums InputLanguage and OutputLanguage into a single Language type. It makes sure that AST is not used as input language using a predicate whenever the option is set.
2021-08-17Replace `Maybe` with `std::optional` (#7005)Andres Noetzli
Because we are now using C++17, we can get rid of Maybe and instead use std::optional, which offers the same functionality.
2021-08-05Normalize val in BitVector(val_str, base) (#6955)Alex Ozdemir
Fixes cpp API's mkBitVector(val_str, base) constructor.
2021-07-27Minor changes from proof-new (#6937)Andrew Reynolds
Note the change to the unit test makes it so the test is not dependent on Node ID order.
2021-06-16Make symfpu a required dependency. (#6749)Aina Niemetz
2021-06-15Remove public option wrappers (#6716)Gereon Kremer
This PR gets rid of almost all remaining public option wrappers. It does so by - making base, main and parser options public such that they can directly be used from the driver and the parser - moving incremental and the resource limiting options to base - moving dumping options to main After this PR, the only option wrapper left is becoming obsolete as well after (the follow-up of) #6697.
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.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback