summaryrefslogtreecommitdiff
path: root/src/smt
AgeCommit message (Collapse)Author
2020-10-29Update api::Sort to use TypeNode instead of Type (#5363)Andrew Reynolds
This is work towards removing the old API. This makes TypeNode the backend for Sort instead of Type. It also updates a unit test for methods isUninterpretedSortParameterized and getUninterpretedSortParamSorts whose implementation was previously buggy due to the implementation of Type-level SortType.
2020-10-28Remove more uses of Expr (#5357)Andrew Reynolds
This PR removes more uses of Expr, mostly related to UnsatCore. It makes UnsatCore a cvc4_private object storing Node instead of Expr.
2020-10-27Refactor DeclareSygusVarCommand and SynthFunCommand to use the API. (#5334)Abdalrhman Mohamed
This PR is part of migrating commands. DeclareSygusVarCommand and SynthFunCommand now call public API function instead of their corresponding SmtEngine functions. Those two commands don't fully initialize the solver anymore. Some operations in SygusInterpol::solveInterpolation, which creates an interpolation sub-solver, depend on the solver being fully initialized and were affected by this change. Those operations are now executed by the main solver instead of the sub-solver, which is not fully initialized by the time they are needed.
2020-10-27Disable --nl-cad option by default (#5350)Gereon Kremer
This PR disables the `--nl-cad` option by default. It was erroneously enabled with #5345 but leads to errors on, e.g., QF_NIA. Enabling for QF_NRA is done in set_defaults.
2020-10-27Enable --nl-cad by default (#5345)Gereon Kremer
This PR enables `--nl-cad` for QF_NRA (and QF_UFNRA) by default to improve nonlinear arithmetic solving. Furthermore, it takes care of disabling it when libpoly is not available. It also adds a fix to the CadSolver that avoids incorrect SATs in the presence of theory combination.
2020-10-22Use theoryof-mode=type for QF_NRA (#5326)Gereon Kremer
We've observed that our QF_NRA solving benefits significantly from --theoryof-mode=type across the board (of other options that influence QF_NRA solving). This PR sets type as the new default for QF_NRA solving.
2020-10-20Add finishInit for getInterpol and getAbduct. (#5316)Abdalrhman Mohamed
This PR removes d_subSolver from SygusInterpol class. findInterpol function now receives the sub-solver as input (possibly through solveInterpolation function). In addition, finishInit is now called for getAbduct and getInterpol functions in smt_engine.cpp.
2020-10-20(proof-new) Fixes for proofs in rewriter (#5307)Andrew Reynolds
This PR fixes proofs in the rewriter so that we use attributes for marking whether a node has been rewritten with proofs instead of consulting the provided TConvProofGenerator for hasRewriteStep. This additionally marks TRUST_REWRITE steps if a rewriter happens to be nondeterministic (e.g. quantifiers). It furthermore decouples rewriteWithProof from reconstruction for theory rewrite steps. The proof postprocessor is additionally updated so that extended equality REWRITE steps are converted to THEORY_REWRITE steps with identifier RW_REWRITE_EQ_EXT for consistency, since eliminating REWRITE should result in THEORY_REWRITE only. This required generalizing the argument to THEORY_REWRITE to be a MethodId instead of a Boolean.
2020-10-20(proof-new) Update add lazy step interface in LazyCDProof (#5299)Andrew Reynolds
Ensuring closed proofs should not be enabled by default, it is actually not used very often as a whole. Moreover, the "trust id" argument is the most useful argument and hence should come as the 3rd argument. This updates all uses of addLazyStep for the change in interface, also changes term conversion generator which had a similar issue with default arguments. Notice that some calls to addLazyStep were checking closed but without providing a debug string, these I've left alone (they no longer check closed).
2020-10-20Remove some Commands from the API. (#5268)Abdalrhman Mohamed
This PR removes Solver::getAssignment command from the API as there is no way to assign names to terms in the API. It also removes ExpandDefinitionsCommand, an internal functionality in CVC4.
2020-10-20Fix miscellaneous warnings (#5256)Andrew Reynolds
Mostly in cardinality extension, which was cleaned in the previous PR.
2020-10-20Split CheckModels utility to its own file (#5303)Andrew Reynolds
This utility will be undergoing major additions to make it more robust. Thus it should be moved to its own file. There are no major code changes in this PR, a few things were changed to be consistent to the coding standard.
2020-10-19(proof-new) Updates to assertions pipeline and preprocess generator (#5300)Andrew Reynolds
This updates and improves assertions pipeline and preprocess generator so that they avoid cyclic proofs and have better infrastructure for catching pedantic failures. This is in preparation for making the non-clausal-simplification pass proof producing.
2020-10-19(proof-new) Update preprocessing pass context for proofs (#5298)Andrew Reynolds
This sets up the preprocessing pass context in preparation for proof production. This PR makes the top level substitutions map into a TrustSubstitutionMap, the data structure that applies substitutions in a way that tracks proofs. This PR also makes the "apply subst" preprocessing pass proof producing.
2020-10-18 (proof-new) Witness axiom reconstruction for purification skolems (#5289)Andrew Reynolds
This formalizes the proofs of existentials that justify purification variables, e.g. those with witness form witness x. x = t for the term t they purify. This PR generalizes EXISTS_INTRO to do this, and makes some simplifications to SkolemManager.
2020-10-18(proof-new) More features for SMT proof post-processor (#5246)Andrew Reynolds
This updates the SMT proof postprocessor with additional stats. It also adds the feature to handle conjunctions as substitution, e.g. a child proof concluding (and (= x t) (= y s)) is interpreted as a substitution for x, y, whereas previously we insisted they must be provided separately.
2020-10-16Refactor SMT-level model object (#5277)Andrew Reynolds
This refactors the SMT-level model object so that it is a wrapper around TheoryModel instead of a base class. This inheritance was unnecessary. Moreover, it removes the virtual base models of the SMT-level model which were based on Expr. Now the interface is more minimal and in terms of Node only. This PR further simplifies a few places in the code that interface with the SmtEngine with things related to models.
2020-10-13(proof-new) Generalize preprocess proof generator (#5245)Andrew Reynolds
This class is of general use, not just as the overall maintainer of proofs of preprocessing, but also locally within preprocessing passes. This generalizes the interface slightly and also does some minor cleaning.
2020-10-12Eliminate uses of Expr in SmtEngine interface (#5240)Andrew Reynolds
This eliminates all use of Expr in the SmtEngine except in a few interfaces (setUserAttribute, getAssignment) whose signature is currently in question. The next steps will be to (1) eliminate Expr from the smt/model.h interface, (2) replace Type by TypeNode in Sort.
2020-10-12Ensure uninterpreted sort owner is UF if uf-ho or finite-model-find is ↵Andrew Reynolds
enabled. (#5248) This ensures that arrays is not the owner of uninterpreted sorts if uf-ho or finite-model-find are enabled. In these cases, the UF solver implements special techniques (cardinality, ho reasoning) that should take priority. Fixes #5233.
2020-10-10Provide API version of some SMT Commands. (#5222)Abdalrhman Mohamed
This PR provides an SMT version of the following SMT commands: get-instantiations block-model block-model-values get-qe get-qe-disjunct command.cpp now calls those functions instead of their SmtEngine counterparts. In addition, SEXPR is now an API kind.
2020-10-08(proof-new) Theory engine proof producing (#5195)Andrew Reynolds
This completes proof support in TheoryEngine. The main addition in this PR is to make its getExplanation method proof producing.
2020-10-08(proof-new) Fixes and improvements for smt proof postprocessor (#5197)Andrew Reynolds
This includes several subtle issues encountered in the past month based on our regressions. It also improves the expansion forms of MACRO_ rules to use EQ_RESOLVE instead of a TRUE_INTRO/TRUE_ELIM scheme. This is both more compact and avoids cyclic proofs for some corner cases of proofs with Boolean constant equalites.
2020-10-06bv-to-int: change order of passes (#5208)yoni206
Closes #5095 and replaces #5110. There are two tests in #5095 that produce two different assertion failures when using bv-to-int. The first happens because the substitution map wasn't applied after the pass. The second happens because div (that is introduced in the pass) is not rewritten using witness. Both problems are solved by making sure that apply-substs, theory-preprocess and ite-removal are executed after bv-to-int. The two tests from #5095 are included as regressions.
2020-10-05Recover from some exceptions. (#5203)Abdalrhman Mohamed
This PR replaces more calls to SmtEngine functions with calls to corresponding Solver functions in command.cpp. The PR also adds CVC4_API_RECOVERABLE_CHECK macro to use for recoverable exceptions.
2020-10-05Make sygus more robust to unknown responses in solution verification (#5199)Andrew Reynolds
This makes it so that an "unknown" response in a CEGIS verification step causes the sygus solver to exclude the current solution and mark incomplete. Previously, the sygus solver was non-terminating in such cases, trying the same solution continously. This also removes the option "sygusVerifySubcall", as this option should always be used. It also makes --nl-ext-tplanes enabled by default when sygus is enabled.
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.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback