56 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
06d065a604 theory_bv_utils: Refactor to not use NodeManager::currentNM() (#11617)
Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com>
2025-02-27 22:12:25 +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
Aina Niemetz
fdf9ce7138 Update copyright headers. (#10459) 2024-03-12 09:35:09 -07:00
Andrew Reynolds
8880609801 Miniscope top-level AND in assertions pipeline (#10208)
This makes it so that top-level AND assertions are immediately miniscoped upon insertion in the assertions pipeline.

The motivation for this is to minimize proof dependencies. In particular, currently for an input:
(assert (and A B C))
(assert (not B))

Our proof is roughly:

Rewriting (and A B C) to (and A' B' C'), B to B'.
And-elim to extract B' from (and A' B' C')
Conclude false
The key point is that the rewriting A -> A' and C -> C' is irrelevant.

This furthermore eliminates any use of "conjoin" in preprocessing for similar reasons.

With this change, our proofs become roughly 6% smaller (measured on regressions). Our overall proof overhead decreases 4.4x -> 4.1x in my latest experiments.
2024-01-25 19:19:19 +00: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
Andrew Reynolds
101dec8720 Minor simplification to solver engine interface (#9138)
Also removes spurious includes of solver_engine.h
2022-09-26 16:59:31 +00:00
Andrew Reynolds
fd470cca6a Eliminate SolverEngineScope and OptionsScope (#8984)
It also eliminates various utilities that depend on these, e.g. `options::X()` for all options `X` and the static accessor for the SMT statistics registry and resource manager.
2022-07-22 16:45:47 +00:00
Andrew Reynolds
52bdeff9ad Make Rewriter::rewrite non-static (#8828)
This furthermore eliminates smt::currentSolverEngine.
2022-05-27 10:53:07 -05: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
Andrew Reynolds
cee1b99e1a Remove more static calls to rewrite (#8025) 2022-02-02 16:37:03 +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
Aina Niemetz
9c49dc9383 Rename SmtScope to SolverEngineScope. (#7284) 2021-10-11 19:13:46 +00:00
Andrew Reynolds
4d8e954c95 Move preprocessor to smt solver (#7321)
This breaks the circular dependency of preprocessing pass context of solver engine.

It also moves the preprocessor to be owned by SMT solver, instead of Solver engine.

It also changes the behavior of reset assertions: now, the preprocessing pass context is reset, whereas previously it was not. I believe this is the right behavior, as it eliminates stale data (e.g. learned literals, symbols in assertion cache).
2021-10-07 20:10:26 +00: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
Andrew Reynolds
7179be03b0 Eliminate calls to Rewriter::rewrite from strings entailment checks (#7203)
There are a few further circular references that prevent us from not passing Rewriter to the strings TheoryRewriter constructor, this can be cleaned in future PRs.
2021-09-24 05:11:24 +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
Aina Niemetz
44657985f2 pp passes: Use EnvObj::rewrite() instead of Rewriter::rewrite(). (#7164) 2021-09-09 21:33:08 +00:00
Aina Niemetz
eb47226400 pp: Derive PreprocessingPass from EnvObj. (#7112) 2021-09-02 03:44:06 +00:00
Andres Noetzli
a24d6c8cf7 More precise includes of Node constants (#6617)
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-26 14:30:17 +00:00