cvc5.git
2 years agoarrays: Move type enumerator implementation to .cpp. (#7216)
Aina Niemetz [Wed, 22 Sep 2021 17:08:34 +0000 (10:08 -0700)]
arrays: Move type enumerator implementation to .cpp. (#7216)

This further cleans up the class declaration in the header to comply
with code style guidelines.

2 years agoEliminate arithmetic proof macros (#7226)
Gereon Kremer [Wed, 22 Sep 2021 05:39:32 +0000 (22:39 -0700)]
Eliminate arithmetic proof macros (#7226)

This PR eliminates some macros for arithmetic proofs, that only slightly simplified access to the produce-proofs option. Now that static access is deprecated, these checks needed to be implemented differently anyway.

2 years agoMinimal fixing version for tuple update parsing (#7228)
Andrew Reynolds [Wed, 22 Sep 2021 05:28:22 +0000 (00:28 -0500)]
Minimal fixing version for tuple update parsing (#7228)

This takes the essential changes from #7218 so that the current ANTLR issues are avoided.

2 years ago[Proofs] Alethe: Translate ASSUME rule (#7213)
Lachnitt [Tue, 21 Sep 2021 19:59:27 +0000 (12:59 -0700)]
[Proofs] Alethe: Translate ASSUME rule (#7213)

Implementation of the translation of ASSUME rules into the Alethe calculus.

Co-authored-by: Haniel Barbosa <hanielbbarbosa@gmail.com>
2 years ago[proofs] Alethe: Implementation of AletheProofPostprocessCallback (#7212)
Lachnitt [Tue, 21 Sep 2021 18:17:14 +0000 (11:17 -0700)]
[proofs] Alethe: Implementation of AletheProofPostprocessCallback (#7212)

Implementation of addAletheStep and addAletheStepFromOr. Added stub for AletheProofPostprocessCallback update function that will be populated by subsequent PRs.

Co-authored-by: Haniel Barbosa <hanielbbarbosa@gmail.com>
2 years agoREADME: Fix link to INSTALL.rst. (#7222)
Aina Niemetz [Tue, 21 Sep 2021 00:23:43 +0000 (17:23 -0700)]
README: Fix link to INSTALL.rst. (#7222)

2 years agoFix handling of conversions between FP and reals (#7149)
Andres Noetzli [Tue, 21 Sep 2021 00:10:46 +0000 (17:10 -0700)]
Fix handling of conversions between FP and reals (#7149)

Fixes #7056. Currently, we introduce a UF for conversions between FP
numbers and reals. This is done as part of `ppRewrite()`. The problem is
that terms sent to `ppRewrite()` are not fully preprocessed yet and the
FP theory solver was storing terms that were not fully preprocessed in a
map for later lookup. For the issue at hand, the conversion term
contained an `ite`, which was later removed. As a result, the theory
solver did not consider the term to be relevant when refining
abstractions. This commit changes the handling of conversion functions
to instead adding purification lemmas for conversion terms when they are
registered. The purification lemmas are needed, because otherwise, we
can't retrieve the model values for the term without the rewriter
interferring.

2 years agoStart python API Solver documentation (#7064)
Alex Ozdemir [Mon, 20 Sep 2021 22:12:17 +0000 (15:12 -0700)]
Start python API Solver documentation (#7064)

2 years ago[proofs] Alethe: adds a node converter
Haniel Barbosa [Mon, 20 Sep 2021 19:49:22 +0000 (16:49 -0300)]
[proofs] Alethe: adds a node converter

Currently the only transformation it applies is removing attributes from quantifiers. Others may be added later.

2 years agoAdd the LFSC proof post-processor (#7134)
Andrew Reynolds [Mon, 20 Sep 2021 18:02:59 +0000 (13:02 -0500)]
Add the LFSC proof post-processor (#7134)

Includes the necessary conversions to LFSC for the core rules of the internal calculus.

2 years agoTheoryModel: Use EnvObj::rewrite instead of Rewriter::rewrite. (#7215)
Aina Niemetz [Mon, 20 Sep 2021 17:51:15 +0000 (10:51 -0700)]
TheoryModel: Use EnvObj::rewrite instead of Rewriter::rewrite. (#7215)

2 years agoOptionally enable interprocedural optimization (#7209)
Andres Noetzli [Mon, 20 Sep 2021 16:22:57 +0000 (09:22 -0700)]
Optionally enable interprocedural optimization (#7209)

This commit adds support for enabling interprocedural optimization. The
option is enabled by default for --best builds and cuts down our
executable size from about 33M to 20M.

2 years agoAdd anchors to cmdline options (#7210)
Gereon Kremer [Mon, 20 Sep 2021 16:12:57 +0000 (18:12 +0200)]
Add anchors to cmdline options (#7210)

This PR adds anchors to the auto-generates command line option documentation. This allows to link to specific options from other parts of the documentation.

2 years agoFix printer for datatype udpater (#7208)
Andrew Reynolds [Sat, 18 Sep 2021 00:49:51 +0000 (19:49 -0500)]
Fix printer for datatype udpater (#7208)

2 years agoRefactor tag suggestion mechanism (#7199)
Gereon Kremer [Sat, 18 Sep 2021 00:13:16 +0000 (02:13 +0200)]
Refactor tag suggestion mechanism (#7199)

This refactors the internal tag suggestion mechanism to no longer rely on C-style char arrays, but use a C++ vector of strings instead.

2 years agoUse a single `NodeManager` per thread (#7204)
Andres Noetzli [Fri, 17 Sep 2021 23:14:42 +0000 (16:14 -0700)]
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.

2 years ago[proofs] Alethe: Added Proof Postprocessor to alethe_proof_processor (#7202)
Lachnitt [Fri, 17 Sep 2021 21:03:01 +0000 (14:03 -0700)]
[proofs] Alethe: Added Proof Postprocessor to alethe_proof_processor (#7202)

Added proof postprocessor class to alethe_proof_processor header file.

Co-authored-by: Haniel Barbosa <hanielbbarbosa@gmail.com>
2 years ago[proofs] Alethe: Added Final Callback Function to alethe_proof_processor (#7200)
Lachnitt [Fri, 17 Sep 2021 20:37:53 +0000 (13:37 -0700)]
[proofs] Alethe: Added Final Callback Function to alethe_proof_processor (#7200)

Added final callback class to alethe_proof_processor header file.

Co-authored-by: Haniel Barbosa <hanielbbarbosa@gmail.com>
2 years agoReplace write access to options by a local variable (#7207)
Gereon Kremer [Fri, 17 Sep 2021 18:14:24 +0000 (20:14 +0200)]
Replace write access to options by a local variable (#7207)

This PR replaces a write to the options object by a local variable in the simplex procedure base class. The write was used to temporarily lower a limit for a single simplex call.

2 years agoMinor cleanup related to EnvObj (#7206)
Gereon Kremer [Fri, 17 Sep 2021 18:03:37 +0000 (20:03 +0200)]
Minor cleanup related to EnvObj (#7206)

This PR does a bit of cleanup in the nonlinear arithmetic code related to the usage of EnvObj.

2 years agoFix relevant domain for parametric operators (#7198)
Andrew Reynolds [Thu, 16 Sep 2021 17:14:07 +0000 (12:14 -0500)]
Fix relevant domain for parametric operators (#7198)

Fixes #6531.

This issue also occurs when using `--full-saturate-quant` on facebook benchmarks that combine multiple sequence types.

It does some cleanup on relevant domain in the process.

2 years ago[proofs] Alethe: Added Callback Function to alethe_proof_processor (#7186)
Lachnitt [Wed, 15 Sep 2021 18:19:53 +0000 (11:19 -0700)]
[proofs] Alethe: Added Callback Function to alethe_proof_processor (#7186)

Added alethe_proof_processor header file and introduced callback class.

Co-authored-by: Haniel Barbosa <hanielbbarbosa@gmail.com>
2 years agoMinor changes to E-matching utilities (#7062)
Andrew Reynolds [Wed, 15 Sep 2021 18:08:27 +0000 (13:08 -0500)]
Minor changes to E-matching utilities (#7062)

2 years agoremove options that are no longer used (#7197)
Gereon Kremer [Wed, 15 Sep 2021 17:06:51 +0000 (19:06 +0200)]
remove options that are no longer used (#7197)

This PR removes a handful of options that are no longer used anywhere.

2 years ago[proof] Added printer for proof rule names (#7185)
Lachnitt [Wed, 15 Sep 2021 14:01:33 +0000 (07:01 -0700)]
[proof] Added printer for proof rule names (#7185)

Implementation file for Alethe proof rules.

2 years ago[proof] Alethe proof rules (#7180)
Lachnitt [Wed, 15 Sep 2021 13:25:54 +0000 (06:25 -0700)]
[proof] Alethe proof rules (#7180)

Adds header for Alethe proof rules

Co-authored-by: Haniel Barbosa <hanielbbarbosa@gmail.com>
2 years agoEliminate global access to options:: from quantifiers rewriter (#7192)
Andrew Reynolds [Wed, 15 Sep 2021 02:04:11 +0000 (21:04 -0500)]
Eliminate global access to options:: from quantifiers rewriter (#7192)

2 years agoAdd get-difficulty to the API (#7194)
Andrew Reynolds [Tue, 14 Sep 2021 23:29:22 +0000 (18:29 -0500)]
Add get-difficulty to the API (#7194)

Adds smt2 parsing, printing and API support for get-difficulty. Adds unit tests.

2 years agoFinal cleanup (#7193)
Gereon Kremer [Tue, 14 Sep 2021 22:09:19 +0000 (00:09 +0200)]
Final cleanup (#7193)

This PR does some final cleanup on the options generation code.

2 years agoMake `-o raw-benchmark` work with `--parse-only` (#7195)
Andres Noetzli [Tue, 14 Sep 2021 21:54:42 +0000 (14:54 -0700)]
Make `-o raw-benchmark` work with `--parse-only` (#7195)

Before, cvc5 was returning with --parse-only before the code could
reach the code responsible for dumping the raw benchmark. This moves the
check for --parse-only to the appropriate place and updates the
run_regression.py script to use --parse-only.

2 years agoSupport sygus version 2.1 command assume (#7081)
Andrew Reynolds [Tue, 14 Sep 2021 21:29:32 +0000 (16:29 -0500)]
Support sygus version 2.1 command assume (#7081)

Adds support for global assumptions in sygus files.

Also guards against cases of declare-const, which should be prohibited in sygus.

2 years agoUtilities in preparation for print benchmark utility (#7190)
Andrew Reynolds [Tue, 14 Sep 2021 20:43:47 +0000 (15:43 -0500)]
Utilities in preparation for print benchmark utility (#7190)

This adds a few utilities in preparation for the print benchmark utility, which will replace our own dumping infrastructure.

2 years agoAdd proof manager method to translate difficulty map (#7159)
Andrew Reynolds [Tue, 14 Sep 2021 19:58:01 +0000 (14:58 -0500)]
Add proof manager method to translate difficulty map (#7159)

This method will be called from SmtEngine in the implementation for (get-difficulty).

2 years agoRefactor code generation for option modules (#7182)
Gereon Kremer [Tue, 14 Sep 2021 18:19:29 +0000 (20:19 +0200)]
Refactor code generation for option modules (#7182)

This PR refactors the code generation for options/<module>_options.(h|cpp).

2 years agoTurn sphinx generation into a function (#7181)
Gereon Kremer [Tue, 14 Sep 2021 18:09:27 +0000 (20:09 +0200)]
Turn sphinx generation into a function (#7181)

This PR refactors the generation of the command line help for sphinx to a function, just like all the other code generation methods.

2 years agobv: Unify bit-blasting code for udiv and urem. (#7188)
Mathias Preiner [Tue, 14 Sep 2021 18:00:13 +0000 (11:00 -0700)]
bv: Unify bit-blasting code for udiv and urem. (#7188)

This refactor additionally removes the caching for urem/udiv cases when
bit-blasting udiv/urem and eliminates the only rewrite() calls in the
bit-blaster. Caching is not required since repeated calls to udiv/urem
with the same arguments will produce the same circuit. Further, the rewrite()
calls during bit-blasting would further complicate the recording of
bit-blasting proofs and hence is removed.

2 years agoproofs: Properly track pre- and post-rewrites in bbAtom(). (#7147)
Mathias Preiner [Tue, 14 Sep 2021 17:39:43 +0000 (10:39 -0700)]
proofs: Properly track pre- and post-rewrites in bbAtom(). (#7147)

This commit refactors the proof bit-blaster to properly track the pre- and post-rewrites in bbAtom(). The individual bit-blast steps are recorded in a term conversion proof generator. The overall bit-blast proof is stored in a BitblastProofGenerator, which tracks the pre- and post-rewrite and includes the bit-blast proof of the TCPG.

2 years agoReimplement `--dump=raw-benchmark` as `-o raw-benchmark` (#7191)
Andrew Reynolds [Tue, 14 Sep 2021 15:31:07 +0000 (10:31 -0500)]
Reimplement `--dump=raw-benchmark` as `-o raw-benchmark` (#7191)

Printing the original benchmark is simple, as it is exactly the commands we execute.

This removes the previous code from SmtEngine, which is currently broken.

2 years agoRemove context getters from `TheoryState` (#7174)
Andres Noetzli [Mon, 13 Sep 2021 23:14:54 +0000 (16:14 -0700)]
Remove context getters from `TheoryState` (#7174)

This removes TheoryState::getSatContext() and
TheoryState::getUserContext().

2 years agoConnect difficulty manager to TheoryEngine (#7161)
Andrew Reynolds [Mon, 13 Sep 2021 20:04:09 +0000 (15:04 -0500)]
Connect difficulty manager to TheoryEngine (#7161)

This also introduces the produceDifficulty option which is analogous to produceUnsatCores.

It requires another unsat cores mode PP_ONLY, indicating that we are only tracking proofs of preprocessing. This option should perhaps be renamed to proofMode instead of unsatCoresMode, since its use is more general than for unsat cores. This will be addressed in a future refactoring.

2 years agoAdd Solver::isOutputOn() (#7187)
Gereon Kremer [Mon, 13 Sep 2021 19:21:50 +0000 (21:21 +0200)]
Add Solver::isOutputOn() (#7187)

This PR adds a new api::Solver::isOutputOn() method, including unit tests for both isOutputOn() and getOutput().

2 years agoFP: Rename FpConverter to FpWordBlaster. (#7170)
Aina Niemetz [Mon, 13 Sep 2021 16:39:19 +0000 (09:39 -0700)]
FP: Rename FpConverter to FpWordBlaster. (#7170)

2 years agoRefactor generation code for getInfo() (#7176)
Gereon Kremer [Mon, 13 Sep 2021 16:29:32 +0000 (18:29 +0200)]
Refactor generation code for getInfo() (#7176)

This PR refactors the code generation for options::getInfo()

2 years agoAdd main options to cmake (#7178)
Gereon Kremer [Mon, 13 Sep 2021 16:14:58 +0000 (18:14 +0200)]
Add main options to cmake (#7178)

This PR adds main/options.cpp to cmake. Also, it removes the old (now obsolete and unused) options script.

2 years agoReorder code (#7175)
Gereon Kremer [Mon, 13 Sep 2021 16:05:11 +0000 (18:05 +0200)]
Reorder code (#7175)

This PR reorders some options generation code that is out of order after some merges.

2 years agoRefactor options parsing (#7143)
Gereon Kremer [Mon, 13 Sep 2021 15:54:55 +0000 (17:54 +0200)]
Refactor options parsing (#7143)

This PR refactors the code for options parsing.

2 years agoUse StatisticsRegistry from Env (#7166)
Gereon Kremer [Sat, 11 Sep 2021 19:13:34 +0000 (21:13 +0200)]
Use StatisticsRegistry from Env (#7166)

This commit better integrates the StatisticsRegistry with the environment. It makes the registry an `EnvObj` itself and adds a getter to `EnvObj` to get the registry. It also refactors parts of cvc5 to use this new mechanism to obtain the registry instead of using the (global, static) `smtStatisticsRegistry()` function.

2 years agocheckModel: Extend documentation. (#7177)
Aina Niemetz [Sat, 11 Sep 2021 04:33:19 +0000 (21:33 -0700)]
checkModel: Extend documentation. (#7177)

Add comment that partial operators are one reason that the current
assertion cannot be checked.

2 years agobv: Move IsPowerOfTwo rule to preprocessing pass and use EnvObj. (#7179)
Mathias Preiner [Sat, 11 Sep 2021 03:23:47 +0000 (20:23 -0700)]
bv: Move IsPowerOfTwo rule to preprocessing pass and use EnvObj. (#7179)

IsPowerOfTwo rule is specific to the BvIntroPow2 preprocessing pass and should not be a general bit-vector rewrite rule.

2 years agoAdd casc 28 scripts (#7070)
Andrew Reynolds [Sat, 11 Sep 2021 02:54:40 +0000 (21:54 -0500)]
Add casc 28 scripts (#7070)

2 years agoFP: Enable caching in the theory inference manager. (#7168)
Aina Niemetz [Fri, 10 Sep 2021 19:27:52 +0000 (12:27 -0700)]
FP: Enable caching in the theory inference manager. (#7168)

2 years agobv: Use EnvObj::rewrite() and EnvObj::options() in NodeBitblaster. (#7172)
Mathias Preiner [Fri, 10 Sep 2021 17:58:35 +0000 (10:58 -0700)]
bv: Use EnvObj::rewrite() and EnvObj::options() in NodeBitblaster. (#7172)

This PR is based on #7171

2 years agoFP: Use EnvObj::rewrite() and options() in theory_fp. (#7169)
Aina Niemetz [Fri, 10 Sep 2021 17:47:10 +0000 (10:47 -0700)]
FP: Use EnvObj::rewrite() and options() in theory_fp. (#7169)

2 years agoFP: Do not send trivial lemmas. (#7167)
Aina Niemetz [Fri, 10 Sep 2021 17:19:32 +0000 (10:19 -0700)]
FP: Do not send trivial lemmas. (#7167)

Fixes #7002.

2 years agoAdd Op.java to the java API (#6387)
mudathirmahgoub [Fri, 10 Sep 2021 03:28:48 +0000 (22:28 -0500)]
Add Op.java to the java API (#6387)

This commit adds Op.java OpTest.java and cvc5_Op.cpp to the java api.

2 years agoUse C++17 attributes (#7154)
Andres Noetzli [Fri, 10 Sep 2021 02:58:42 +0000 (19:58 -0700)]
Use C++17 attributes (#7154)

Currently, we are using non-standard attributes. With C++17, all the
attributes that we use regularly are now standardized. This commit
replaces the compiler-specific attributes with standard ones.

2 years agoMore refactoring of set defaults (#7160)
Andrew Reynolds [Fri, 10 Sep 2021 02:47:57 +0000 (21:47 -0500)]
More refactoring of set defaults (#7160)

This moves a large portion of the `finalizeLogic` method to more appropriate places.

It also fixes an issue : `opts.datatypes.dtSharedSelectorsWasSetByUser` was checked with wrong polarity, making a previous commit not effective.

2 years agobv: Use EnvObj::rewrite() and EnvObj::options() in BvSolver. (#7171)
Mathias Preiner [Fri, 10 Sep 2021 01:54:12 +0000 (18:54 -0700)]
bv: Use EnvObj::rewrite() and EnvObj::options() in BvSolver. (#7171)

2 years agoRefactor command-line help (#7157)
Gereon Kremer [Fri, 10 Sep 2021 01:18:56 +0000 (03:18 +0200)]
Refactor command-line help (#7157)

This PR refactors how we generate the command-line help message.

2 years agoUse EnvObj-based options in preprocessing (#7165)
Gereon Kremer [Fri, 10 Sep 2021 00:21:57 +0000 (17:21 -0700)]
Use EnvObj-based options in preprocessing (#7165)

This PR is the first step in replacing options access via options::foo() to using the environment (via EnvObj and options().module.foo). It replaces all such options accesses in the preprocessing passes.

2 years agopp passes: Use EnvObj::rewrite() instead of Rewriter::rewrite(). (#7164)
Aina Niemetz [Thu, 9 Sep 2021 21:33:08 +0000 (14:33 -0700)]
pp passes: Use EnvObj::rewrite() instead of Rewriter::rewrite(). (#7164)

2 years agoRemove `TheoryState::getEnv()` (#7163)
Andres Noetzli [Thu, 9 Sep 2021 18:37:49 +0000 (11:37 -0700)]
Remove `TheoryState::getEnv()` (#7163)

2 years agoAdd Solver::getOutput() (#7162)
Gereon Kremer [Thu, 9 Sep 2021 17:34:43 +0000 (10:34 -0700)]
Add Solver::getOutput() (#7162)

Allow access to the Output() macro via the API.

2 years agoAdd difficulty manager (#7151)
Andrew Reynolds [Thu, 9 Sep 2021 15:26:34 +0000 (10:26 -0500)]
Add difficulty manager (#7151)

Towards supporting a (get-difficulty) command.

This tracks an estimate of the difficulty of preprocessed assertions during solving. It will be connected to TheoryEngine (via RelevanceManager) in a followup PR.

2 years agoAdd difficulty post-processor (#7150)
Andrew Reynolds [Thu, 9 Sep 2021 03:05:42 +0000 (22:05 -0500)]
Add difficulty post-processor (#7150)

This is work towards supporting a (get-difficulty) command.

This is a helper class for transforming the difficulty of preprocessed assertions to difficulty of the input assertions.

2 years agoDisable shared selectors for quantified logics without SyGuS (#7156)
Andrew Reynolds [Thu, 9 Sep 2021 01:50:09 +0000 (20:50 -0500)]
Disable shared selectors for quantified logics without SyGuS (#7156)

The use of shared selectors may have fairly negative effects when combined with E-matching. The issue is that it allows too many things to match. When shared selectors are disabled, a selector trigger like s(x) will only match terms that access the field of the constructor associated with s. When we use shared selectors, s(x) is converted to e.g. shared_selector_D_Int_1(x), which in turn matches applications of selectors of the same type over any constructor.

This PR disables shared selectors when quantifiers are present and SyGuS is not used.
It also disables shared selectors in single invocation subcalls, thus fixes #3109.
It further makes a minor fix to the datatypes rewriter to ensure that rewritten form does not depend on options.

2 years agoRemove `TheoryState::options()` (#7148)
Andres Noetzli [Thu, 9 Sep 2021 01:28:25 +0000 (18:28 -0700)]
Remove `TheoryState::options()` (#7148)

This commit removes TheoryState::options() by changing more classes to
EnvObjs.

2 years agoRemove deprecated SyGuS method evaluateWithUnfolding (#7155)
Andrew Reynolds [Thu, 9 Sep 2021 01:16:11 +0000 (20:16 -0500)]
Remove deprecated SyGuS method evaluateWithUnfolding (#7155)

This was a predecessor to the evaluator and TermDbSygus::rewriteNode that is no longer necessary.

This refactors the code so that evaluateWithUnfolding is replaced by rewriteNode as necessary throughout the SyGuS solver.

Note that in a few places, the extended rewriter was being used where TermDbSygus::rewriteNode (which also evaluates recursive function definitions) should have been used.

2 years agoAdd Lfsc print channel utilities (#7123)
Andrew Reynolds [Wed, 8 Sep 2021 21:42:30 +0000 (16:42 -0500)]
Add Lfsc print channel utilities (#7123)

These are utilities used for two-pass printing of LFSC proofs.

2 years agoImprove pre-skolemization, move quantifiers preprocess to own file (#7153)
Andrew Reynolds [Wed, 8 Sep 2021 20:54:22 +0000 (15:54 -0500)]
Improve pre-skolemization, move quantifiers preprocess to own file (#7153)

This also heavily refactors the preskolemization method (now in QuantifiersPreprocess), in preparation for it being enabled by default. This method previously was doing a tree traversal, it now maintains a visited cache.

It makes minor cleanup to the dependencies of this method.

2 years agoRefactor options::set() (#7138)
Gereon Kremer [Wed, 8 Sep 2021 19:36:50 +0000 (12:36 -0700)]
Refactor options::set() (#7138)

This PR refactors the code generation and the generate code for options::set().

2 years agoWork on comments (#7139)
Gereon Kremer [Wed, 8 Sep 2021 19:14:24 +0000 (12:14 -0700)]
Work on comments (#7139)

This PR fixes / improves the comments in the options scripts.

2 years agoA couple of minor cleanups (#7141)
Gereon Kremer [Wed, 8 Sep 2021 18:59:53 +0000 (11:59 -0700)]
A couple of minor cleanups (#7141)

This PR does a couple of minor cleanups related to options.

2 years agoRefactor code generation for options.h/.cpp (#7126)
Gereon Kremer [Wed, 8 Sep 2021 18:41:50 +0000 (11:41 -0700)]
Refactor code generation for options.h/.cpp (#7126)

This PR refactors the options code generation for the options/options.h/.cpp files.

2 years agoTowards standard usage of ExtendedRewriter (#7145)
Andrew Reynolds [Wed, 8 Sep 2021 17:30:31 +0000 (12:30 -0500)]
Towards standard usage of ExtendedRewriter (#7145)

This PR:

Adds extendedRewrite to EnvObj and Rewriter.
Eliminates static calls to Rewriter::rewrite from within the extended rewriter. Instead, the use of extended rewriter is always through Rewriter, which passes itself to the ExtendedRewriter.
Make most uses of extended rewriter non-static. I've added a placeholder method Rewriter::callExtendedRewrite for places in the code that call the extended rewriter are currently difficult to eliminate.

2 years agoAdd option for using bound inference for relevant assertions (#7152)
Andrew Reynolds [Wed, 8 Sep 2021 16:33:40 +0000 (11:33 -0500)]
Add option for using bound inference for relevant assertions (#7152)

The method for discarding assertions based on bound inference is quite expensive (40% of runtime) for some benchmarks with quantified formulas from Facebook. This adds an option to disable this, which is done by default for quantified logics.

2 years agoAdd LFSC side condition conversion utility for list variables (#7131)
Andrew Reynolds [Wed, 8 Sep 2021 13:39:31 +0000 (08:39 -0500)]
Add LFSC side condition conversion utility for list variables (#7131)

Required for automatic generation of side conditions from DSL rewrite rules.

2 years agoAdd Datatype.java to the Java API (#6389)
mudathirmahgoub [Wed, 8 Sep 2021 08:33:16 +0000 (03:33 -0500)]
Add Datatype.java to the Java API (#6389)

This commit adds Datatype.java DatatypeTest.java and cvc5_Datatype.cpp to the java api.

2 years agoAdd DatatypeConstructor.java, DatatypeConstructorDecl.java, DatatypeDecl.java, Dataty...
mudathirmahgoub [Wed, 8 Sep 2021 08:25:23 +0000 (03:25 -0500)]
Add DatatypeConstructor.java, DatatypeConstructorDecl.java, DatatypeDecl.java, DatatypeSelector.java (#6390)

Add DatatypeConstructor.java, DatatypeConstructorDecl.java, DatatypeDecl.java, DatatypeSelector.java and their corresponding c++ files

2 years agoUse rewriteViaMethod instead of accessing builtin proof checker (#7146)
Andrew Reynolds [Wed, 8 Sep 2021 07:00:23 +0000 (02:00 -0500)]
Use rewriteViaMethod instead of accessing builtin proof checker (#7146)

2 years agoRefactoring of proof manager initialization (#7073)
Andrew Reynolds [Tue, 7 Sep 2021 21:39:52 +0000 (16:39 -0500)]
Refactoring of proof manager initialization (#7073)

No longer takes a backwards reference to SmtEngine.

Also takes minor changes to proof post-processor from proof-new.

2 years agoUse `EnvObj` methods instead of `Theory` methods (#7144)
Andres Noetzli [Tue, 7 Sep 2021 20:52:23 +0000 (13:52 -0700)]
Use `EnvObj` methods instead of `Theory` methods (#7144)

This removes the methods `getEnv()`, `options()`, `getSatContext()`, and
`getUserContext()` from the `Theory` class because they are now part of
`EnvObj`. Additionally, this commit converts the inference managers to
`EnvObj` because of there were some calls to retrieve the contexts from
`Theory` in those classes.

2 years agosygus: Eliminate calls to Rewriter::rewrite. (#7142)
Aina Niemetz [Tue, 7 Sep 2021 18:23:29 +0000 (11:23 -0700)]
sygus: Eliminate calls to Rewriter::rewrite. (#7142)

This derives sygus unification utility objects from EnvObj where
necessary. There's one remaining occurrence of Rewriter::rewrite in
sygus_unif_rl.cpp, which is a bit tricky to address and thus subject to
a future PR.

2 years agoRefactoring and fixes of set defaults for quantifiers (#7120)
Andrew Reynolds [Tue, 7 Sep 2021 03:41:04 +0000 (22:41 -0500)]
Refactoring and fixes of set defaults for quantifiers (#7120)

This PR further refactors set defaults for incompatibility issues related to quantifiers.

It adds a new restriction that was discovered recently: --nl-rlv should not be used in quantified logics. Some regressions are modified that are impacted by this restriction.

Also does minor rearrangements to the order in which default options are set.

2 years agoEnvObj: Add options(), context(), userContext(). (#7137)
Aina Niemetz [Fri, 3 Sep 2021 23:33:33 +0000 (16:33 -0700)]
EnvObj: Add options(), context(), userContext(). (#7137)

This further renames EnvObj::getLogicInfo to EnvObj::logicInfo.

2 years agoAvoiding duplicate search in maps (#7055)
MikolasJanota [Fri, 3 Sep 2021 22:59:46 +0000 (00:59 +0200)]
Avoiding duplicate search in maps (#7055)

This commit identifies a couple of scenarios where an operation required
2 searches into a map/hashmap and replaces them with a single search.
This also makes the code shorter.

Signed-off-by: Mikolas Janota <mikolas.janota@gmail.com>
2 years agosygus: Make more classes derive from EnvObj. (#7140)
Aina Niemetz [Fri, 3 Sep 2021 22:36:44 +0000 (15:36 -0700)]
sygus: Make more classes derive from EnvObj. (#7140)

2 years agoRefactor option sanitizations (#7129)
Gereon Kremer [Fri, 3 Sep 2021 19:12:13 +0000 (12:12 -0700)]
Refactor option sanitizations (#7129)

This PR refactors the code that performs sanity checks on the parsed option data.

2 years agoStandardize Rewriter::rewriteViaMethod call (#7119)
Andrew Reynolds [Fri, 3 Sep 2021 18:42:18 +0000 (13:42 -0500)]
Standardize Rewriter::rewriteViaMethod call (#7119)

This moves the standard method for rewrites in proofs from TheoryBuiltinProofRuleChecker to Rewriter.  The motivation for this change is to make various kinds of rewrite methods (standard rewrite, extended rewrite, extended equality rewrite, evaluate) accessible throughout the code in a standard way.  After this PR, it is possible to know variants of the REWRITE proof rule application by having access to the rewriter, instead of having to get the builtin proof rule checker.  Note that TheoryBuiltinProofRuleChecker::applyRewrite *cannot* be static since access to the rewriter is not longer permitted to be static.

It also removes some unused infrastructure from Rewriter.

Followup PRs will remove applyRewrite for TheoryBuiltinProofRuleChecker in favor of calling the rewriter directly.

2 years agoCheck that alternate is only set for bool (#7125)
Gereon Kremer [Fri, 3 Sep 2021 18:26:29 +0000 (11:26 -0700)]
Check that alternate is only set for bool (#7125)

This PR slightly changes how the alternate option property is handled and explicitly checks that alternate is only set for bool options.

2 years agoRefactor options::get() and options::getNames() (#7135)
Gereon Kremer [Fri, 3 Sep 2021 18:02:58 +0000 (11:02 -0700)]
Refactor options::get() and options::getNames() (#7135)

This PR refactors the code generation and the generated code for options::get() and options::getNames().

2 years agoMake quantifier module classes derive from EnvObj (#7132)
Andrew Reynolds [Fri, 3 Sep 2021 17:09:57 +0000 (12:09 -0500)]
Make quantifier module classes derive from EnvObj (#7132)

2 years agosygus: Make CeSingleInv derive from EnvObj. (#7136)
Aina Niemetz [Fri, 3 Sep 2021 16:54:41 +0000 (09:54 -0700)]
sygus: Make CeSingleInv derive from EnvObj. (#7136)

This further reorders the header according to the code style guidelines.

2 years agoEliminate backwards ref to SmtEngine from abduction and interpol solvers (#7133)
Andrew Reynolds [Fri, 3 Sep 2021 16:33:27 +0000 (11:33 -0500)]
Eliminate backwards ref to SmtEngine from abduction and interpol solvers (#7133)

2 years agotheory: Have more classes in theory with reference to Env derive from EnvObj. (#7130)
Aina Niemetz [Fri, 3 Sep 2021 12:34:27 +0000 (05:34 -0700)]
theory: Have more classes in theory with reference to Env derive from EnvObj. (#7130)

2 years agotheory: Have Theory and TheoryArith* derive from EnvObj. (#7128)
Aina Niemetz [Fri, 3 Sep 2021 01:27:30 +0000 (18:27 -0700)]
theory: Have Theory and TheoryArith* derive from EnvObj. (#7128)

Note: the diff in theory.h is only huge because of small changes that caused huge reformat. The effective change is only that it now derives from EnvObj, does not have a member d_env (because it inherits it) and does not need getLogicInfo (because that's in EnvObj).

2 years agoRemove "experimental" options (#7124)
Gereon Kremer [Fri, 3 Sep 2021 00:42:00 +0000 (17:42 -0700)]
Remove "experimental" options (#7124)

This PR changes all options from experimental to expert and adds a check that only the well-defined option categories are used (common, regular, expert, undocumented).

2 years agopp: Have PreprocessingPassContext derive from EnvObj. (#7127)
Aina Niemetz [Fri, 3 Sep 2021 00:31:25 +0000 (17:31 -0700)]
pp: Have PreprocessingPassContext derive from EnvObj. (#7127)

2 years agoAdd LFSC node converter (#6944)
Andrew Reynolds [Thu, 2 Sep 2021 22:32:49 +0000 (17:32 -0500)]
Add LFSC node converter (#6944)

This utility converts from terms used in the internal calculus to terms that capture how they should be printed in LFSC.

2 years agoRefactor options handlers (#7080)
Gereon Kremer [Thu, 2 Sep 2021 21:34:40 +0000 (14:34 -0700)]
Refactor options handlers (#7080)

This PR does a major refactoring to the default option handlers (i.e. the piece of code that converts strings to the respective option types). It gets rid of the current multi-layer template specialization in favor of a simple overloaded template function.