40 Commits

Author SHA1 Message Date
Aina Niemetz
cf8c5f3ade NodeManager as a static thread_local singleton is no more. (#11816)
Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2025-04-16 01:39:01 +00:00
Daniel Larraz
9ffcde27f9 smt: Refactor to not use NodeManager::currentNM() (#11806) 2025-04-11 14:15:52 +00:00
Aina Niemetz
0647c4c107 Update copyright headers. (#11561)
Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2025-01-23 17:54:20 +00:00
Daniel Larraz
2a1d74a0a9 Remove NodeBuilder constructors with implicit NodeManager (#11392)
This change introduces some calls to `NodeManager::currentNM()`, which
will be removed in a follow-up PR.
2024-12-09 21:22:44 +00:00
Andrew Reynolds
1d50fb8ba4 Eliminate some of the calls to Node::getNodeManager (#11412)
Also makes another method statically available in NodeManager
(mkDummySkolem).

---------

Co-authored-by: Daniel Larraz <daniel-larraz@users.noreply.github.com>
2024-12-06 14:33:44 +00:00
Aina Niemetz
fdf9ce7138 Update copyright headers. (#10459) 2024-03-12 09:35:09 -07:00
Aina Niemetz
3d8ce5a158 Convert enum Kind_t to an enum class. (#10070) 2023-09-28 08:37:06 -05:00
Aina Niemetz
0a8baa0f0a Update copyright headers. (#9736) 2023-05-09 18:06:18 +00:00
Mathias Preiner
56e14c4639 Move public headers into top-level include directory. (#9555)
This PR moves the public API headers into a top-level include directory. This makes it easier to find the public API of cvc5 and makes the install headers script obsolete.

Fixes #9553
Fixes #9556
2023-03-07 23:39:29 +00:00
Andrew Reynolds
70a81677f0 Remove NodeManager from constructors of Env and SolverEngine (#8967)
NodeManager is a singleton, thus does not need to be passed around.
2022-07-21 16:25:58 +00:00
Gereon Kremer
735cbadb13 Refactor how options are passed to the printer (#8827)
Right now, the printers expect some options to be passed explicitly and read other options statically from the options object.
This refactors this, using the `ioutils` utility which we already use to store option values in the private storage associated with output streams. In detail, does a couple of things:
- the `mkoptions.py` script now generates the `options/io_utils.*` files to handle all options defined in the `printer` options module
- reading the necessary options from the ostreams is pushed into the printers themselves
- explicit options are removed from (almost) all `toStream()` functions
- a few options are moved to the `printer` options module (making the `printSuccess` utility obsolete)
2022-06-01 03:57:52 +00:00
Gereon Kremer
97a870f131 Make regular options access const (#8754)
One of the loose ends of the options refactor is that internal code can write to options at will, even when the accessing it via Env::getOptions() which returns a const reference. There are technical reasons for this, C++ does not propagate the constness into reference members.
This PR changes this behaviour by making the references members we use all over the place (options().smt.foo) const references and adding new functions writeSmt() which allow write access -- if you have a non-const handle to the options object.
In order to do that, this PR also changes all places that legitimately change the options (options handlers, set defaults, solver engine and places where we spawn subsolvers) to use the new syntax. After that, only a single place remains: the solver engine attempts to write the filename (from Solver::setInfo("filename", "...");) into the original options (that are restored to the new solver object after a reset. As only the API solver has write access to this, it is moved to the Solver::setInfo() method.

With this PR, all internal code is properly guarded against erroneous (and reckless) changing of options.
Fixes cvc5/cvc5-projects#12.
2022-05-11 21:52:31 -07:00
Andrew Reynolds
2b364e03e5 Final preparation for CONST_INTEGER (#8700)
With this PR, CI passes when using CONST_INTEGER instead of (all) integral CONST_RATIONAL.

This does not make this change yet, so CONST_RATIONAL is still used throughout.
2022-05-02 21:36:33 -05:00
Mathias Preiner
d01e59c13b Update copyright headers for release 1.0 (#8539) 2022-04-05 20:38:57 +00:00
Mathias Preiner
bbcd471ed4 Introduce internal namespace and remove api namespace. (#8443)
The public cvc5 API now lives in the cvc5 namespace. All internal parts were moved into the (new) internal namespace.
The final hierarchy will be as follows:

cvc5
  ~~ public API
  ::context
  ::internal
  ::parser
  ::main

After this PR it will be:

cvc5
  ~~ public API
  ::internal
      ::context
      ::main
  ::parser
2022-03-29 23:23:01 +00:00
Aina Niemetz
c335e4d3fa Rename kind PLUS -> ADD. (#8036)
This renames the arithmetic internal and API kind PLUS to ADD for
consistency with our naming scheme for other operators (e.g.,
BITVECTOR_ADD, FLOATINGPOINT_ADD).
2022-02-03 04:25:14 +00:00
Aina Niemetz
eab7bf6702 Rename kinds MINUS -> SUB and UMINUS -> NEG. (#8035)
This renames the internal arithmetic kinds MINUS and UMINUS for
consistency with our naming scheme for other operators (e.g.,
BITVECTOR_SUB, FLOATINGPOINT_SUB).
2022-02-02 22:27:14 +00:00
Gereon Kremer
561b989855 Refactor IO stream manipulators (#7555)
This PR consolidates SetLanguage, ExprSetDepth and ExprDag into a single consistent utility. Also, it makes it play more nicely with users setting these options and removes some obsolete code.
2021-11-22 22:31:31 +00:00
Andres Noetzli
ad340126a7 Remove ConstantMap<Rational> (#7635)
This is in preparation of having two different kinds (CONST_RATIONAL
and CONST_INT) share the same payload. To do so, we cannot rely on
ConstantMap<Rational> anymore to map the payload type to a kind. This
commit extends support in the mkmetakind script to deal with such
payloads by adding a + suffix to the type. The commit also does some
minor refactoring of NodeManager::mkConst() and
NodeManager::mkConstInternal() to support setting the kind explicitly.
Finally, the commit addresses all instances where mkConst<Rational>()
is used, including the API.
2021-11-12 08:14:49 -06:00
Andrew Reynolds
25b8d01a98 Refactor skolem construction (#7561)
This makes all methods for constructing skolems local to SkolemManager.

It removes infrastructure for node manager listeners being notified when skolems are constructed. This was used for 2 things:
(1) The old dumping infrastructure, where skolems could contribute in part to traces to print benchmarks. This code will be deleted soon.
(2) The miplib preprocessing pass, which used this functionality to listen to what skolems were constructed, and subsequently assumed these skolems coincided with what Boolean variables appeared in assertions. This is highly error prone, and has been replaced by a simple traversal to collect Boolean variables in assertions.

This is in preparation for a lazy lambda lifting technique, which will require more infrastructure in SkolemManager.
2021-11-03 12:43:02 -05:00
Aina Niemetz
19f223e580 Rename SmtEngine to SolverEngine. (#7282) 2021-09-30 18:57:24 -07:00
Aina Niemetz
56cd2e8f58 Rename files smt_engine.(cpp|h) to solver_engine.(cpp|h). (#7279)
This is in preparation for renaming SmtEngine to SolverEngine.
2021-09-30 21:14:59 +00:00
Mathias Preiner
e116c00719 Remove CVC language support (#7219)
This commit removes the support for the CVC language and converts all *.cvc regression tests to SMT-LIBv2.
2021-09-22 20:38:46 +00:00
Andres Noetzli
4209fb71c9 Use a single NodeManager per thread (#7204)
This changes cvc5 to use a single `NodeManager` per thread (using
`thread_local`). We have decided that this is more convenient because
nodes between solvers in the same thread could be exchanged and that
there isn't really an advantage of having multiple `NodeManager`s per
thread.

One wrinkle of this change is that `NodeManager::init()` must be called
explicitly before the `NodeManager` can be used. This code can currently
not be moved to the constructor of `NodeManager` because the code
indirectly calls `NodeManager::currentNM()`, which leads to a loop
because the `NodeManager` is created in `NodeManager::currentNM()`.
Further refactoring is required to get rid of this restriction.
2021-09-17 23:14:42 +00:00
Gereon Kremer
71f025753f Consolidate language types (#7065)
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-26 00:19:41 +00:00