summaryrefslogtreecommitdiff
path: root/src/util
AgeCommit message (Collapse)Author
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.
2020-12-15Add getters to retrieve constants from api::Term (#5677)Gereon Kremer
This PR adds method to obtain constant values from api::Term that are either integers or strings.
2020-12-02Update copyright headers.Aina Niemetz
2020-12-01Remove use of this-> in FP literal. (#5565)Aina Niemetz
2020-11-30floatingpoint: Use unique_ptr for FloatingPointLiteral pointer. (#5503)Aina Niemetz
2020-11-20Rename symfpu_literal.(h.in|cpp) -> floatingpoint_literal_symfpu.(h.in|cpp). ↵Aina Niemetz
(#5502)
2020-11-20Rename floatingpoint.h.in -> floatingpoin.h. (#5500)Aina Niemetz
2020-11-20RoundingMode: Rename enum values to conform to code style guidelines. (#5494)Aina Niemetz
2020-11-20FloatingPoint: Separate out symFPU glue code. (#5492)Aina Niemetz
This works towards having the symFPU headers only included where it's absolutely needed (only in the .cpp files, not in any other headers). Note: src/util/floatingpoint.h.in will be converted to a regular .h file in the next step to simplify reviewing.
2020-11-19floatingpoint.h: Split in preparation to cleanly separate symFPU glue code. ↵Aina Niemetz
(#5478)
2020-11-19Include stddef.h (needed for size_t) in cvc4_public.h (#5476)Aina Niemetz
This further removes obsolete explicit includes of stdint.h.
2020-11-17FloatingPoint: Use uint32_t instead of unsigned. (#5459)Aina Niemetz
2020-11-17FloatingPoint: Clean up and document header, format. (#5453)Aina Niemetz
This cleans up the src/util/floatingpoint.h.in header to conform to the code style guidelines of CVC4. This further attempts to fully document the header. The main changes (except for added documentation) are renames of member variables, getting rid of the redundant functions FloatingPointSize::exponent() and FloatingPointSize::significand(), and a more explicit naming of CVC4 wrapper types vs symFPU trait types. Else, it's mainly reordering and formatting.
2020-11-16Improve accuracy of resource limitation (#4763)Gereon Kremer
The main goal of the resource limitation mechanism (via `--rlimit`) is to have a deterministic limitation on runtime. The ultimate goal would be that the actual runtime grows linearly with the spent resources. To achieve this, this PR does the following: - introduce new resources spent in places that are not yet covered - find resource weights that best approximate the runtime It provides a contrib script `learn_resource_weights.py` that uses statistics from a given benchmark run and uses linear regression to find good resource weights. The script also evaluates this estimate and identifies outliers, benchmarks for which this approximation is particularly bad. This probably indicates that on such a benchmark, some part of the code takes a significant amount of time but is not yet represented by a resource. Eventually, we should use the resulting resource weights as defaults for the options like `--rewrite-step`, `--theory-check-step`, etc.
2020-10-20Integer (CLN): Minor improvements. (#5306)Aina Niemetz
Review comments by @nafur from #5304.
2020-10-19Integer: CLN: Move implementation of member functions to .cpp file. (#5304)Aina Niemetz
This moves the CLN implementation of member functions of class Integer from the header to the .cpp file. This only moves code, and adds documentation for previously undocumented or poorly documented functions. Analogous to #5190.
2020-10-05Integer: GMP: Move implementation of member functions to .cpp file. (#5190)Aina Niemetz
This moves the GMP implementation of member functions of class Integer from the header to the .cpp file. This only moves code, and adds documentation for previously undocumented or poorly documented functions. I ran a performance check on the cluster on non-incremental QF_BV, QF_BVFP, QF_FP, QF_LIA, QF_LIRA and QF_LRA (BV and FP logics heavily rely on class Integer since class BitVector is implemented on top of Integer). This change has no impact on performance.
2020-10-01FloatingPoint: Add utility functions for largest and smallest normal. (#5174)Aina Niemetz
2020-09-30BitVector: Extend interface of setBit to set it to a specific value. (#5173)Aina Niemetz
Previously, BitVector::setBit only allowed to set the bit at the given index to 1. This changes its behavior to be also able to set it to 0.
2020-09-30FloatingPoint: Add utility functions for largest and smallest subnormal. (#5166)Aina Niemetz
2020-09-22FP: Use Assert instead of AlwaysAssert in traits::(pre|post)condition. (#5121)Aina Niemetz
For the same reason as in #5119.
2020-09-22[Python API] Conversion to/from Unicode strings (#5120)Andres Noetzli
Fixes #5024. This commit adds a conversion from constant string terms to native Python Unicode strings in Term.toPythonObj() and improves Solver.mkString() to accept strings containing characters outside of the printable range.
2020-09-22Update copyright header script to support CMake and Python files (#5067)Mathias Preiner
This PR updates the update-copyright.pl script to also update/add copyright headers to CMake specific files. It further fixes a small typo in the header.
2020-09-08Fix printing of fp values. (#5041)Mathias Preiner
Fixes #5032
2020-09-01Removes old proof code (#4964)Haniel Barbosa
This deletes much of the old proof code. Basically everything but the minimal necessary infra-structure for producing unsat cores. That includes dependency tracking in preprocessing, the prop engine proof and the unsat core computation code in the old proof manager. These should also go once we fully integrate into master the new proof infrastructure. It also cleans interfaces that were using old-proof-code-specific constructs (such as LemmaProofRecipe). When possible or when it made sense standalone local proof production code was kept, but deactivated (such is in the equality engine and in the arithmetic solver).
2020-08-31Fix spelling errors (#4977)FabianWolff
Signed-off-by: Fabian Wolff <fabi.wolff@arcor.de>
2020-07-21Preparations for a CAD-based arithmetic solver (#4762)Gereon Kremer
Based on #4679, this PR contains further preparations for a CAD-based arithmetic solver that extends the current NonlinearExtension. In detail, it provides: a Constraints class that manages all (polynomial) constraints visible to the cad solver, a collection of methods used for cad projections, a VariableOrdering class that provides different variable ordering heuristics tailored to cad, an extension to the NlModel class, allowing for witness terms, further conversion methods, in particular between Node and poly::Polynomial, poly::Value and RealAlgebraicNumber.
2020-07-17Replace options listener infrastructure (#4764)Andrew Reynolds
This replaces the old options listener infrastructure with the OptionsManager introduced in cb8d041. It eliminates a "beforeSearchListener", which was a custom way of some options throwing a modal exception if they were set after initialization. Now all options are consistent: no option can be set after initialization. It also moves managed ostream objects to the OptionsManager. @mpreiner The next step will be to remove the "notifies" field from the Options build system and then proceed with cleaning src/options/.
2020-07-17Integration of libpoly (#4679)Gereon Kremer
This commit integrates LibPoly into CVC4. It adds `contrib/get-poly`, adds it to the configure script, cmake and places where CVC4 inspects its own build configuration. Furthermore, it adds `CVC4::RealAlgebraicNumber` (which wraps `poly::AlgebraicNumber`) including some basic unit tests and some utilities.
2020-07-16Resource manager cleanup (#4732)Gereon Kremer
This PR performs some general cleanup in and around the ResourceManager class. In detail, it does remove --hard-limit (we decided to always leave the solver in a usable state, i.e. always do a soft limit), remove --cpu-time (we decided to always use wall-clock time for time limiting) replace old gettimeofday-based Timer by new std::chrono-based WallClockTimer clean up the logic around beginCall() and endCall()
2020-07-16Remove cumulative time limits and cpu time limits (#4711)Gereon Kremer
This PR removes two things from the resource manager: cumulative time limits cpu time limits Cumulative time limiting has been moved to the binary and is (as before) accessible via --tlimit. As per discussion among the devs, we no longer support time limits based on CPU time and thus everything related to that is removed as well. Note that this includes the option --cpu-time, removes an argument from SmtEngine::setTimeLimit() and the method SmtEngine::getTimeRemaining() .
2020-07-12Add support for string/sequence update (#4725)Andrew Reynolds
This adds basic support for string/sequence updating, which has a semantics that is length preserving.
2020-07-02Remove SWIG bindings (#4683)Andres Noetzli
This commit removes support for SWIG bindings for the legacy API. The bindings were already broken by 19054b3b1d427e662d30d4322df2b2f2361353da and we are not planning on using SWIG for the Java API for the new API.
2020-06-29Add internal support for integer and operator (#4668)Andrew Reynolds
Towards merging iand branch to master. This adds internal support for an "integer AND" operator.
2020-06-25Remove sygus1 parser (#4651)Andrew Reynolds
We no longer support sygus v1 inputs. This PR removes support for sygus v1 (as well as a deprecated "z3str" variant of smt lib 2 which is subsumed by the new strings standard). As mentioned in the release notes, CVC4 1.8 supports a conversion from sygus v1 to v2 script. This removal is required for further updates to the new API. Further infrastructure (e.g. the sygus print callback) will be removed in a separate PR. FYI @abdoo8080 .
2020-06-22get-authors: Add alias for nafur. (#4646)Aina Niemetz
2020-06-22Allow for better interaction of Integer/Rational with mpz_class/mpq_class. ↵nafur
(#4612)
2020-06-18Improve memory management in Java bindings (#4629)Andres Noetzli
Fixes #2846. One of the challenges of the Java bindings is that the garbage collector can delete unused objects at any time in any order. This is an issue with CVC4's API because we require all `Expr`s to be deleted before the corresponding `ExprManager`. In the past, we were using `NewGlobalRef`/`DeleteGlobalRef` on the wrapper object of `ExprManager`. The problem is that we can have multiple instances of the wrapper that internally all refer to the same `ExprManager`. This commit implements a different approach where the Java wrappers hold an explicit reference to the `ExprManager`. The commit also removes some unused or unimportant API bits from the bindings.
2020-06-16Update copyright headers.Aina Niemetz
2020-06-05Printing FP values as binary or indexed BVs according to option (#4554)Haniel Barbosa
2020-05-27Tweak the use of static_assert to support older compilers. (#4536)Martin
C++11 introduces static_assert(bool, string). C++17 introduces static_assert(bool) By adding a message we can support older compilers such as those used by our nightly build system...
2020-05-26Fix an incorrect limit in conversion from real to float (#4418)Martin
This error is a bit inexplicable but very very definitely wrong. A test case from the original bug report is included.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback