summaryrefslogtreecommitdiff
path: root/src/smt
AgeCommit message (Collapse)Author
2020-10-02(proof-new) Fixes for theory preprocessing proofs (#5171)Andrew Reynolds
This fixes several subtle issues with theory preprocessing. The main fix is to ensure proofs are correct for cases where the theory preprocessor applies either with or without theory preprocessing (calling Theory::ppRewrite on subterms) enabled, see argument doTheoryPreprocess of preprocess. If disabled, it applies term formula removal and rewriting only. This is required for processing lemmas that are marked as "do not preprocess", which is an optimization, but is also necessary since theory combination may e.g. split on equality that was solved during ppRewrite. The solution is to use 2 separate term conversion sequences for these 2 cases. It also fixes an issue where preprocessing is term-context-sensitive: terms underneath quantifiers are treated differently. This is now handled by a new TermContext callback "InQuantTermContext".
2020-10-02Allow for theory combination of strings with nonlinear real arithmetic. (#5111)Gereon Kremer
This PR makes sure that enabling strings and nonlinear real arithmetic at the same time works fine. Right now, the configuration for strings enforces linear arithmetic if no integers are enabled, in particular for NRA. Fixed #5109.
2020-10-01(proof-new) Preprocessing passes use proper interfaces to assertions ↵Andrew Reynolds
pipeline (#5164) This PR eliminates all uses of assertions pipeline that are not proper, which two-fold: (1) The assertion list should never be modified in a custom way (without going through replace / push_back), (2) Places where an assertion is "conjoined" to an existing spot in the vector should use conjoin instead of replace. This is required for proper proof generation. This fixes CVC4/cvc4-projects#75.
2020-10-01Make SygusSolver use sygus attributes directly (#5172)Andrew Reynolds
Previously, the SmtEngine was using an interface through TheoryEngine to set user attributes to indicate that e.g. a synth-fun is associated with a given grammar. Since SmtEngine and its members are internal now, this can simply be done directly via attributes. This makes it so that SygusSolver does not depend on TheoryEngine nor does it require the TheoryEngine to be initialized at the time a synth-fun is created.
2020-09-30Remove too strict assertion to allow for approximate models (#5168)Gereon Kremer
This PR simply removes an assertion that would trigger whenever the arithmetic theory asserts a model that contains something else than a constant. This can be the case with witness terms. In offline discussion we concluded that this discussion was overly strict. Note that these examples may still hit an error during model validation (Cannot run check-model on a model with approximate values.). This PR also fixes a debug output I found during debugging. Fixes #5113.
2020-09-29(proof-new) Fixes for preprocess proof generator and proofs in assertion ↵Andrew Reynolds
pipeline (#5136) This PR makes several fixes to preprocess proof generator, making it user-context dependent and making it avoid cyclic proofs. It additionally makes assertion pipeline a new interface "conjoin" which should always be used when we conjoin a new assertion to an old position in the assertion vector. It also removes an unnecessary interface to assertion pipeline. Next PRs will clean up the use of assertions pipeline in all preprocessing passes to use the proper interfaces. This includes removing non-constant references to assertions, which has been fixed on proof-new.
2020-09-29[proof-new] Updates to proof node updater (#5156)Haniel Barbosa
2020-09-28Reset assertions on resetAssertions (#5153)Andrew Reynolds
The assertions object is currently not cleared on resetAssertions, only the prop engine is reset. This means that if a user added assertion, did not use them in a check-sat, and then called reset-assertions, they would not be removed from the assertions pipeline (storing the pending assertions before they are sent to the prop engine). This fixes #5144.
2020-09-24 Function definition fmf preprocessing pass (#5064)Andrew Reynolds
This defines the function definition finite model finding as a proper preprocessing pass. This is required for cleaning/fixing bugs in the preprocessor on proof-new. There are no intended behavior changes in this PR, although the code for the pass was updated to the new style guidelines.
2020-09-23Disable cegqi-bv when using sygus (#5124)Andrew Reynolds
This disables the CAV 2018 techniques for BV quantifier instantiation when solving sygus since they may generate terms with witness in them. This adds a regression where this occurs. I've opened an cvc4 projects issue to revisit this (CVC4/cvc4-projects#227).
2020-09-22Allow E-matching by default when strings are enabled (#5117)Andrew Reynolds
This does not disable E-matching when strings are enabled with --strings-exp, due to potential applications where strings are combined with user-provided quantified formulas. Notice that by default, we do not want E-matching applied to quantified formulas corresponding to reductions for extended string functions. To correct this, all quantified formulas generated by strings are marked with an "internal quantified formula" attribute, which causes E-matching to ignore them. This feature can in theory be generalized later for other internal sources of quantified formulas.
2020-09-22Refactor Commands to use the Public API. (#5105)Abdalrhman Mohamed
This is work towards eliminating the Expr layer. This PR does the following: Replace Expr/Type with Term/Sort in the API for commands. Remove the command export functionality which is not supported. Since many commands now call the Solver functions instead of the SmtEngine ones, their behavior may be a slightly different. For example, (get-unsat-assumptions) now only works in incremental mode. In some cases, CVC4 will not recover from non-fatal errors.
2020-09-22Fix type issue with term formula removal (#5107)Andrew Reynolds
We currently are using lookups with uint32_t but storing with int32_t. Somehow the compilers don't complain, but I noticed this was mismatched.
2020-09-22Add simple BV solver (#5065)Mathias Preiner
This PR adds a simple BV solver that sends bit-blasting lemmas to the internal MiniSat.
2020-09-22Add skeleton for theory of bags (multisets) (#5100)mudathirmahgoub
This PR adds initial headers and mostly empty source files for the theory of bags (multisets). It acts as a basis for future commits. It includes straightforward implementation for typing rules an enumerator for bags.
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-18Fix assertion list for globally defined recursive functions (#5084)Andrew Reynolds
This was uncovered by a (spurious) proof checking failure on proof-new.
2020-09-18Fix muzzled builds (#5093)Andres Noetzli
Commit 2c2f05c moved some function definitions from dump.h to dump.cpp, which is good. However, the corresponding definitions for muzzled builds weren't moved, so muzzled builds defined the operator << multiple times. This made our nightly competition build fail. This commit fixes the issue by moving the alternative definitions to the source file as well.
2020-09-17(proof-new) Updates to proof node updater algorithm (#5088)Andrew Reynolds
This updates the proof node updater so that we apply updates to a fixed point, stopping if the proof node is not updated or if the callback explicitly tells us not to continue. This also fixes an issue where proof nodes would be updated to SCOPE and incorrectly traversed after updating. This additionally adds debugging feature to proof node updater to track the moment at which an unexpected free assumption is introduced by an update.
2020-09-17(proof-new) Rewrites involving operators in term conversion proof generator ↵Andrew Reynolds
(#5072) In some cases, e.g. witness form conversion, we require traversing to operators in term conversion proofs. This updates the term conversion generator to support (term-context-sensitive) rewrites involving operators using HO_CONG. This requires updating the term context utilities with support for operators.
2020-09-17Reduce recursion in term formula removal (#5052)Andrew Reynolds
This reduces the use of recursion in term formula removal module. The recursion depth is now limited to the number of term positions on a path where a formula must be removed, instead of being limited to the overall formula depth. This PR also fixes some documentation. Notice for its main cache d_tfCache, this class uses a CDInsertHashMap (instead of a CDHashMap) which does not allow inserting more than once, hence an auxliary "processedChildren" vector had to be introduced to track whether we have processed children. It's not clear to me whether we should just use the more standard CDHashMap, which would simplify this. One non-linear arithmetic regression went unsat -> unknown, I added --nl-ext-tplanes to fix this. This should fix #4889. It is possible to further reduce the recursion in this pass, which can be done on a followup PR if needed.
2020-09-16Dumping internal define-funs with no arguments (#5077)yoni206
Currently, --dump=assertions:... fails if a define-fun command is executed internally (an example for this can be found here. The failure occurs because the printer expects a range type whenever a define-fun command is executed. However, when this command is used for 0-ary functions (variables), the getter for the range fails. This PR fixes this by asking for a range only if the type is indeed a function. Otherwise, the original type is printed. A test that currently fails but passes with this PR is included.
2020-09-16Dump commands in internal code using command printing functions. (#5040)Abdalrhman Mohamed
This is work towards migrating commands to the new API. Internal code that creates command objects just for dumping is replaced with direct calls to functions that print the those commands.
2020-09-14Interpolation: Add implementation for SyGuS interpolation module (final) (#5063)Ying Sheng
Add interface for SyGuS Interpolation module. Adding the API for (get-interpol s B), which is aim for computes an I that A->I and I->B. Here A is the assertions in the stack.
2020-09-11(proof-new) Add SMT proof manager (#5054)Andrew Reynolds
This module is responsible for constructing the proof checker, proof node manager, and implementing dumping and checking of the final proof. This PR includes setting up some connections into the various modules for proof production.
2020-09-09(proof-new) Minor changes to proof node updater (#5011)Andrew Reynolds
This includes some changes to proof node updater that are not currently on master. This includes: (1) Explicitly passing the result of the current proof node we are updating, (2) Caching the results of updates based on Node. In other words, proofs (in the same scope) that we have already seen that prove the same thing as the current proof node are reused. It also enables the compilation of proof post-processor, which was missing on master and makes Rewriter of SmtEngine public which is required for doing so.
2020-09-09(proof-new) Make proofs in term formula removal term context sensitive (#5008)Andrew Reynolds
Previously term formula removal proofs didnt not take the term context into account. This updates it to make use of the term context sensitive support in TConvProofGenerator. More generally, it uses the term context computation as the standard way of caching the results of rewrites in this class (regardless of proofs).
2020-09-08Make CVC/API BV div/mod semantics match SMT-LIB (#4997)Andres Noetzli
This commit changes the semantics of the CVC language and with the default semantics of the API for `BVUDIV`, `BVUREM`, `BVSDIV`, `BVSREM`, and `BVSMOD` to match the semantics of SMT-LIB >=2.6. Relatedly, the commit also adds comments to our API documentation for the different semantics enabled by the `bv-div-zero-const` option.
2020-09-08Eliminate a custom use of TheorySep in quantifiers engine for EPR (#5039)Andrew Reynolds
This moves the initialization of the connection between separation logic and EPR to the separation logic theory, which is a more logical place for this. This eliminates a backwards reference to theory engine from quantifiers engine.
2020-09-04Use Result::Sat instead of BenchmarkStatus in printers. (#5026)Abdalrhman Mohamed
This PR modifies the printers to use Result::Sat, "internal" version of BenchmarkStatus, for printing benchmark status commands.
2020-09-02Introduce an internal version of Commands. (#4988)Abdalrhman Mohamed
This PR is a step towards the migration of Commands to the public API. Node versions of some Commands are introduced for internal use (as necessary). The DumpManager is refactored to make use of those commands.
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-08-28Incremental support for bv_to_int (#4967)yoni206
This PR adds support for incremental solving in bv_to_int. This amounts to: using context dependent data structures adding a test In addition, we check for parametrized operations in a more robust way (using kind::metakind::PARAMETERIZED) and rename some tests for convenience.
2020-08-28(proof-new) Add the SMT proof post processor (#4913)Andrew Reynolds
This PR adds the proof post-processor, which is the final authority on putting together the overall proof. It additionally implements lazy pedantic failures and statistics. This PR also corrects a subtle bug in the elimination of SUBS which requires a TRUE_INTRO/FALSE_INTRO in certain cases.
2020-08-25Replace Expr-level datatype with Node-level DType (#4875)Andrew Reynolds
This PR makes two simultaneous changes: The new API uses Node-level DType instead of Expr-level Datatype. This required converting 2 of the last remaining calls in the parser that used Expr to use the new API. Internally constructed datatypes (e.g. for sygus) use Node-level DType instead of Expr-level Datatype. Note this required moving a block of code for handling a corner case of sygus from Datatype -> DType. This PR removes : ExprManger::mkDatatypeType. The Expr-level datatype itself. This PR removes all references to its include file. It also updates one remaining unit test from Expr -> Node. This PR will enable further removal of other datatype-specific things in the Expr layer.
2020-08-25Eliminating spurious replay of commands for define funs expansion when ↵Haniel Barbosa
checking unsat cores (#4941) Doing it via commands being added to the coreChecker SMT engine is not necessary since we can directly add assertions after expansion from the original SMT engine.
2020-08-21Remove unecessary theory model builder base class (#4933)Andrew Reynolds
2020-08-21Connect the relevance manager to TheoryEngine and use it in non-linear ↵Andrew Reynolds
arithmetic (#4930) This PR activates the use of the relevance manager in TheoryEngine and makes use of it (via Valuation) in the non-linear extension in arith. It removes a deprecated hack (addTautology) for doing this. This addresses CVC4/cvc4-projects#113. Note that the best method for relevance is interleaving, where roughly you gain on SMT-LIB: QF_NIA: +484-53 unsat +792-440 sat QF_NRA: +32-19 unsat +57-23 sat However, this PR does not (yet) enable this method by default. Note that more work is necessary to determine which lemmas require NEEDS_JUSTIFY, this PR identifies 2 cases of lemmas that need justification (skolemization and strings reductions). Regardless, the use of the relevance manager is limited to non-linear arithmetic for now, which is only able to answer "sat" when only arithmetic is present in assertions.
2020-08-21Remove BV equality slicer (#4928)Andrew Reynolds
This class is not used based on our coverage tests (although it appears to be possibly enabled based on non-standard runtime checking of assertions), and uses the equality engine in a highly nonstandard way that will be a burden to the new standardization of equality engine in theory solvers. FYI @aniemetz @mpreiner
2020-08-20Split QuantElimSolver from SmtEngine (#4919)Andrew Reynolds
Towards refactoring SmtEngine / converting Expr -> Node.
2020-08-19Fix SmtEngine::reset() (#4917)Gereon Kremer
Calling (reset) multiple times produced parsing problems (#4866) and could probably lead to all kinds of interesting issues. In a nutshell, reset() failed to properly reset d_initialOptions (which is used to properly reset d_options) so that all options defaulted after the second call to reset(). This PR properly sets d_initialOptions after a reset (and the filename as well). Fixes #4866.
2020-08-18Refactor functions that print commands (Part 2) (#4905)Abdalrhman Mohamed
This PR is a step towards migrating commands to the Term/Sort level. It replaces the dynamic casts for printing commands with direct calls to corresponding functions. Those functions now take node level arguments instead of commands to make them available for internal code.
2020-08-18(proof-new) SMT proof postprocess callback (#4883)Andrew Reynolds
This is the callback class for processing the final proof, which connects proofs of preprocessing and expands unwanted macro steps based on proof granularity mode. The next step will be to add the ProofNodeUpdater that uses this callback and runs final sanity checks for checking proofs.
2020-08-18Split SygusSolver from SmtEngine (#4891)Andrew Reynolds
This is the solver for standard SyGuS queries. Notice it now depends only on SmtSolver and not SmtEngine. This PR updates Expr -> Node for the sygus interface in SmtEngine. SmtEnginePrivate is no longer needed and is deleted with this PR.
2020-08-15Add finishInit method to PropEngine (#4895)Andrew Reynolds
This changes an initialization issue in regarding PropEngine and TheoryEngine. In the constructor for PropEngine, we convert and assert literals for true and false to CNF stream. Doing so triggers several things, including calls that preregister these literals with the associated TheoryEngine. This means that literals are preregistered to TheoryEngine before it has been fully initialized (TheoryEngine::finishInit). This is not currently an issue since this only involves modules that are constructed statically (e.g. SharedTermsDatabase), but this will lead to issues when the TheoryEngine is more configurable. The solution is to additionally have a PropEngine::finishInit, which is called after TheoryEngine::finishInit, which does this step. The PropEngine should not assert anything to CNF before this method is called.
2020-08-13Split SmtSolver from SmtEngine (#4880)Andrew Reynolds
This class is responsible for maintaining TheoryEngine and PropEngine and implementing the check-sat command. It also has an interface for processing/pushing the current assertions into the PropEngine. This class will be used directly by other extension solvers (for abduction, interpolation, qe, sygus, etc.).
2020-08-13More basic fix for dumping synth-fun (#4886)Andrew Reynolds
The commit (079a04b) appears to have broken the nightlies due to compile issues related a necessary addition to the Dump class (so that std::string could be printing on Dump streams). This changes the temporary solution so that we simply print a string on the standard output, when the Dump is enabled. This is required for temporarily keeping dump=raw-benchmark working for synth-fun commands.
2020-08-12Refactor functions that print commands (Part 1) (#4869)Abdalrhman Mohamed
This PR is a step towards migrating commands to the Term/Sort level. The functions for printing synth-fun command and its grammar were modified to remove their dependency on command objects and use nodes instead of exprs and types. Similar changes to other functions that print commands will follow.
2020-08-12(proof-new) Improve interfaces to proof generators (#4803)Andrew Reynolds
This includes configurable naming and a caching policy for term conversion proof generator. Also corrects a subtle issue in LazyCDProof related to making getProofFor idempotent using the notion of owned proofs.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback