cvc5.git
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.

2 years ago[Unit Tests] Fix shell test for Editline (#7117)
Andres Noetzli [Thu, 2 Sep 2021 20:05:59 +0000 (13:05 -0700)]
[Unit Tests] Fix shell test for Editline (#7117)

When using --editline, our interactive_shell_black unit test was not
working because the unit test was redirecting std::cin and std::cout
to std::stringstreams, which does not work with Editline. This commit
refactors our InteractiveShell class to explicitly take the input and
output streams as arguments, which fixes the issue because we do not use
Editline for input streams that are not std::cin. Additionally, the
commit updates the unit test to use SMT-LIB syntax instead of the
deprecated CVC language.

2 years agoDisable sygus-inst for regression close to time limit. (#7122)
Aina Niemetz [Thu, 2 Sep 2021 19:55:08 +0000 (12:55 -0700)]
Disable sygus-inst for regression close to time limit. (#7122)

2 years agoEnvObj: Restrict access. (#7121)
Aina Niemetz [Thu, 2 Sep 2021 19:04:11 +0000 (12:04 -0700)]
EnvObj: Restrict access. (#7121)

This makes all members of EnvObj protected in order to prevent creating
EnvObj instances and call member functions. It further uses protected
inheritance (instead of public) for derived classes in order to disallow
`EnvObj* a = new DerivedObj();`.

2 years agoAdd API check whether option in getOptionInfo() exists (#7093)
Gereon Kremer [Thu, 2 Sep 2021 18:50:18 +0000 (11:50 -0700)]
Add API check whether option in getOptionInfo() exists (#7093)

This PR adds a missing check in the API for getOptionInfo().

2 years agoDriver & Options cleanup (#7109)
Gereon Kremer [Thu, 2 Sep 2021 18:21:56 +0000 (11:21 -0700)]
Driver & Options cleanup (#7109)

This PR does some cleanup in the driver and the options. It removes the now obsolete public attribute that allowed using the options in the driver, and removes a bunch of includes from the driver that are no longer necessary.

2 years agoRemove more instances of ufHo (#7087)
Andrew Reynolds [Thu, 2 Sep 2021 18:06:46 +0000 (13:06 -0500)]
Remove more instances of ufHo (#7087)

Towards replacing that option with a logic check throughout.

2 years agoRemove options::getAll() (#7111)
Gereon Kremer [Thu, 2 Sep 2021 17:46:47 +0000 (10:46 -0700)]
Remove options::getAll() (#7111)

options::getAll() returns a list of all options and their current values as strings. The same functionality can be obtained by using options::getNames() and options::get(). This PR does exactly this replacement, getting rid of a large chunk of generated code. Calling getInfo("all-options") may suffer a minor performance hit, but not noticeable in practice.

2 years ago[CI] Add step for running unit/API tests (#7116)
Andres Noetzli [Thu, 2 Sep 2021 17:19:35 +0000 (10:19 -0700)]
[CI] Add step for running unit/API tests (#7116)

Currently, we configure one of our builds to include unit tests but then
do not compile and run them. This commit adds a step to compile and run
the unit/API tests.

2 years agoImplement lazy proof checking modes (#7106)
Andrew Reynolds [Thu, 2 Sep 2021 17:02:46 +0000 (12:02 -0500)]
Implement lazy proof checking modes (#7106)

This implements several variants of lazy proof checking in the core proof checker.

Note this extends the ProofNode class with an additional Boolean d_provenChecked indicating whether the d_proven field was checked by the underlying proof checker.

This PR updates the default proof checking mode to lazy. The previous default can now be enabled by --proof-check=eager-simple.

2 years agoRemove PreprocessingPassContext::getSmt(). (#7118)
Aina Niemetz [Thu, 2 Sep 2021 16:43:29 +0000 (09:43 -0700)]
Remove PreprocessingPassContext::getSmt().  (#7118)

2 years agoRemove unused `Backtracker` (#7115)
Andres Noetzli [Thu, 2 Sep 2021 12:26:28 +0000 (05:26 -0700)]
Remove unused `Backtracker` (#7115)

backtrackable.h was defining a datastructure Backtracker, which was
a member in ArrayInfo and Info but it was not doing anything.

2 years ago[Unit Tests] Fix bags rewrite test (#7114)
Andres Noetzli [Thu, 2 Sep 2021 04:14:56 +0000 (21:14 -0700)]
[Unit Tests] Fix bags rewrite test (#7114)

PR #7103 did not quite fix the unit test: The types of the lambda and
the expected bags were still off. This fixes the unit test.

2 years agopp: Derive PreprocessingPass from EnvObj. (#7112)
Aina Niemetz [Thu, 2 Sep 2021 03:44:06 +0000 (20:44 -0700)]
pp: Derive PreprocessingPass from EnvObj. (#7112)

2 years agoEnable sygus-inst for FP, NIA and NRA. (#7098)
Aina Niemetz [Thu, 2 Sep 2021 03:22:57 +0000 (20:22 -0700)]
Enable sygus-inst for FP, NIA and NRA. (#7098)

2 years agorewriter: Make rewriteEqualityExt non-static. (#7110)
Aina Niemetz [Thu, 2 Sep 2021 02:57:21 +0000 (19:57 -0700)]
rewriter: Make rewriteEqualityExt non-static. (#7110)

More work towards getting rid of SmtEngine::currentSmtEngine and
closing #3468.

2 years agoAdd class EnvObj. (#7113)
Aina Niemetz [Thu, 2 Sep 2021 02:10:42 +0000 (19:10 -0700)]
Add class EnvObj. (#7113)

This class will serve as base class for classes that need access to the
environment. This does not yet have classes derive from this base class.

Will update #7110 and #7112 to use this after this is in.

2 years agoUpdate CI to macOS 11 (#7104)
Andres Noetzli [Thu, 2 Sep 2021 00:42:59 +0000 (17:42 -0700)]
Update CI to macOS 11 (#7104)

`macos-latest` is currently using macOS 10.15, so this updates the CI to use `mac-11` (Big Sur).

2 years agoClean up and document PP context. (#7102)
Aina Niemetz [Wed, 1 Sep 2021 23:54:47 +0000 (16:54 -0700)]
Clean up and document PP context. (#7102)

This marks methods const where possible and adds missing documentation.

2 years agoClean up TheoryEngine header according to code style guidelines. (#7107)
Aina Niemetz [Wed, 1 Sep 2021 19:24:03 +0000 (12:24 -0700)]
Clean up TheoryEngine header according to code style guidelines. (#7107)

2 years ago[proof] [sat] Fix lost reference to reason when processing redundant literals (#7108)
Haniel Barbosa [Wed, 1 Sep 2021 18:31:56 +0000 (15:31 -0300)]
[proof] [sat] Fix lost reference to reason when processing redundant literals (#7108)

Similarly to the issue when explaining literals, it's necassary to save the
reference to the reason for propagating a redundant literal, as adding
explanations that may be added to the SAT solver during the recursive
elimination of redundant literals may change the original reference.

2 years agoPrint response to get-model using the API (#7084)
Andrew Reynolds [Wed, 1 Sep 2021 18:05:48 +0000 (13:05 -0500)]
Print response to get-model using the API (#7084)

This changes our implementation of GetModelCommand so that we use the API to print the model.

It simplifies smt::Model so that this is a pretty printing utility, and not a layer on top of TheoryModel.

It adds getModel as an API method for returning the string representation of the model, analogous to our current support for getProof.

This eliminates the last call to getSmtEngine() from the command layer.