summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-05-23remove unused field d_emp_exp in TheorySetsPrivate (#4521)mudathirmahgoub
Remove unused field d_emp_exp in TheorySetsPrivate
2020-05-23Add the sequence datatype (#4153)Andrew Reynolds
This class is the Node-level representation of a sequence. It is analogous to CVC4::String.
2020-05-22Refactor operator elimination in arithmetic (#4519)Andrew Reynolds
This is a major refactor of how operators are eliminated in arithmetic. Currently there were (at least) two things wrong: (1) ppRewriteTerm sent lemmas on the output channel. This behavior is incompatible with how preprocessing works. In particular, this caused unconstrained simplification to be unaware of terms from such lemmas, leading to incorrect "sat" answers. (2) Lemmas used to eliminate certain "div-like" terms were processed in a context-independent way. However, lemmas should be cached in a user-context-dependent way. This was leading to incorrect "sat" answers in incremental. The solution to these issues is to eliminate operators via the construction of witness terms. No lemmas are sent out, and instead these lemmas are the consequence of term formula removal in the standard way. As a result of the refactor, 2 quantifiers regressions time out due to infinite branch and bound issues (one only during --check-unsat-cores). These appear to be random and I've changed the options to avoid these issues. 3 others now have check-model warnings, which I've added --quiet to. Improving check-model will be addressed on a future PR. This PR is not required for SMT COMP since we have workarounds that avoid both the incorrect behaviors in our scripts. Also notice that --rewrite-divk is effectively now enabled by default always. Fixes #4484, fixes #4486, fixes #4481.
2020-05-22CaDiCaL: Clean up initialization on creation. (#4516)Aina Niemetz
2020-05-22(proof-new) Add rewrite corresponding to regular expression inclusion (#4513)Andrew Reynolds
This introduces a rewrite based on regular expression inclusion (using calls to the RegExpEntail utility function). This allows us to justify the regular expression inclusion inference as a rewrite.
2020-05-22Cryptominisat: Clean up initialization on creation. (#4515)Aina Niemetz
2020-05-22Add support for SAT solver Kissat. (#4514)Aina Niemetz
2020-05-22(proof-new) Proof node to SExpr utility. (#4512)Andrew Reynolds
This is required for dag-ifying ProofNode output.
2020-05-21Update string kind names in new API (#4509)Andrew Reynolds
To match the smt2 Unicode standard. The internal ones are left unchanged for now.
2020-05-21(proof-new) Minor update to strings solver state (#4510)Andrew Reynolds
2020-05-21Disable re-elim by default (#4508)Andrew Reynolds
Disabling re-elim performs better overall in many recent experiments.
2020-05-21Make Grammar reusable. (#4506)Abdalrhman Mohamed
This PR modifies the Grammar implementation to make it reusable (i.e., can be copied or passed multiple times to synthFun/synthInv) with the catch that it becomes read-only after the first use.
2020-05-20Throw logic exception for equality between regular expressions (#4505)Andrew Reynolds
Fixes #4503.
2020-05-20Fix missing check for cardinality one in unconstrained simplifier (#4504)Andrew Reynolds
Fixes #4482.
2020-05-20Normal form equality conflicts and uniqueness check (#4497)Andrew Reynolds
This adds a new inference schema to strings that was discovered by the internal proof checker. It says that we are in conflict when an equality between the normal forms of two terms in the same equivalence class rewrites to false. It also improves the efficiency of processing normal forms by only considering normal forms that are unique up to rewriting.
2020-05-20Add proof skolem cache (#4485)Andrew Reynolds
This adds the general utility for maintaining mappings from Skolems to their witness form via attributes. I am sending this as a PR now since it would be helpful to use this class for fixing some of the recent unconstrained-simp bugs.
2020-05-20Fix parametric datatype instantiation (#4493)Andrew Reynolds
A bug was introduced when adding the Node-level datatype implementation in d803e7f. The code did not probably get the arity of a sort constructor. This adds TypeNode::getSortConstructorArity and uses it during parametric datatype type resolution.
2020-05-20CegqiBv: Clean up after renaming options. (#4487)Aina Niemetz
2020-05-20Use debug-check-model to enable internal debugging in check-model (#4480)Andrew Reynolds
Notice this also updates our regression script to use --debug-check-model, preserving previous behavior. Fixes #4461, fixes #4470, fixes #4471, fixes #4475, fixes #4448, fixes #4466, fixes #4460, fixes #4458, fixes #4455, fixes #4456, fixes #4386, fixes #4385, fixes #4478, fixes #4474.
2020-05-19Do not eliminate variables that are equal to unevaluatable terms (#4267)Andrew Reynolds
When we eliminate a variable x -> v during simplification, it may be the case that v contains "unevaluated" operators like forall, choice, etc. Thus, we do not produce correct models for such inputs unless simplification is disabled. This PR ensures we only eliminate variables when v contains only evaluated operators. Additionally, the kinds registered as unevaluated were slightly modified so that when we are in a logic like QF_LIA, there are no registered unevaluated operators, hence the check above is unnecessary. This is to minimize the performance impact of this change. Fixes #4500.
2020-05-19Fix cached free variable identifiers in sygus term database (#4394)Andrew Reynolds
Fixes an issue with over-pruning in SyGuS where using multiple sygus types that map to the same builtin type. Our mapping sygusToBuiltin did not ensure that free variables were unique. Fixes #4383.
2020-05-19Renamed operator CHOICE to WITNESS (#4207)mudathirmahgoub
Renamed operator CHOICE to WITNESS, and removed it from the front end
2020-05-19Use fresh variables when miniscoping (#4296)Andrew Reynolds
Fixes #4288. When applying miniscoping, we previously were reusing variables across quantified formulas in the resulting conjunction. This ensures our miniscoping ensures fresh variables.
2020-05-19Update enum and option names for sygus languages (#4388)Andrew Reynolds
This ensures sygus is interpreted as sygus version 2; sygus1 must be used to specify sygus version 1. Required for the 1.8 release.
2020-05-19Make SolveEq and PlusCombineLikeTerms idempotent (#4438)Andres Noetzli
Fixes #3692 and an assertion failure that came up during the test runs for SMT-COMP. The bit-vector rewrites `SolveEq` and `PlusCombineLikeTerms` were not always idempotent. At a high level, `SolveEq` combines common terms from two sides of an equality and `PlusCombineLikeTerms` combines common terms within an addition. However, in doing so, these rewrites were reordering the operands of the bit-vector addition based on the node ids of the terms that were multiplied with their coefficients. Consider the addition `3 * x * y + 5 * y * z` (the bit-width does not matter). `PlusCombineLikeTerms` would reorder this addition to `5 * y * z + 3 * x * y` if the node id of `y * z` was smaller than the node id of `x * y`. The issue is that node ids are not fixed for a given term: If we have a term `x * y` and that term reaches ref count 0, we may get a different id for that same term if we recreate it later on. When terms reach ref count 0, we don't immediately delete them but add them to our set of zombies to be deleted whenever the list of zombies grows larger than some fixed size. When applying `SolveEq` and `PlusCombineLikeTerms` multiple times (even in direct succession without doing anything else), the node order may change because some of the terms like `x * y` may be zombies while others have been deleted and get new ids, leading to the relative order of node ids changing. I suspect that we could construct a case where we get into an infinite rewrite loop. This commit addresses the issue as follows: It does not perform the rewrites `SolveEq` and `PlusCombineLikeTerms` if none of the operands change. This makes the rewrites idempotent. Note however that we are still not guaranteeing that a term has the same rewritten form throughout an execution because the node ids may change if the term has been freed in the meantime. However, this limitation is consistent with other rewrites such as the reordering of equalities. I am including the minimized test case from our run on SMT-LIB. I am ommittin the test case from #3692 because I couldn't trigger it on master (not surprising since the issue requires very specific circumstances to actually occur). However, I was able to reproduce the issue on the CVC4 version mentioned in the issue and confirmed that this fix worked for that older version.
2020-05-12Do not enable unconstrained simplification if arithmetic is present (#4489)Andrew Reynolds
For now we do not enable unconstrained simplification when arithmetic is present. Post SMT COMP, we should investigate making arithmetic not output lemmas during preprocessing (CVC4/cvc4-wishues#71).
2020-05-05Always introduce fresh variable for unconstrained APPLY_UF (#4472)Andrew Reynolds
Fixes an unsoundness in unconstrained simplification, fixes #4469.
2020-05-05Update copyright year and AUTHORS/THANKS files. (#4468)Aina Niemetz
2020-04-30Remove skolem share involving pre_first_ctn. (#4423)Andrew Reynolds
This fixes a soundness issue in strings caused by an incorrect skolem share. This adds a regression that corresponds to the rewrite that this skolem share was justified by, which is "sat" (the rewrite does not hold). This benchmark in fact was answered "unsat" by CVC4 prior to this PR.
2020-04-30Do not mark congruent terms are reduced (#4419)Andrew Reynolds
This fixes a potential model soundness issue in strings where a justification for why a string term was reduced relied on a circular argument. The issue involved "reduced by congruence" which states that when f(a) = f(b) ^ a = b in the current context, then one of f(a) or f(b) can be ignored. However, it may be the case that a is an extended function whose reduction relies on f(b). If we were to assume that f(b) can be ignored due to f(a), then our reduction of f(a) is circular: the reduction of f(a) in the context where a=b relies on itself. This was causing an incorrect model for QF_S/2020-sygus-qgen/queries/query3214.smt2. The sequence of dependencies was: [1] (str.contains (str.substr x 1 (+ (- 1) (str.len x))) "CA") is congruent to (str.contains (str.substr x (+ 2 (str.indexof x "CA" 1)) (+ (- 2) (str.len x) (* (- 1) (str.indexof x "CA" 1)))) "CA") in the current context since they are equal and their arguments are equal. [2] (str.substr x (+ 2 (str.indexof x "CA" 1)) (+ (- 2) (str.len x) (* (- 1) (str.indexof x "CA" 1)))) reduction relies on the length constraint: (= (str.indexof x "CA" 1) (+ (- 2) (str.len sspre_66))) [3] (str.indexof x "CA" 1) reduction relies on: (not (str.contains (str.substr x 1 (+ (- 1) (str.len x))) "CA")) which was marked congruent above. The benchmark now solves in 5 minutes 30 seconds (sat, with a correct model): andrew@andrew-Latitude-7480:~/misc/strings$ time ajr-cvc4 query3214.smt2 --strings-exp --rewrite-divk --check-models --dump-models sat (model (define-fun x () String "QACOACA") )
2020-04-29Avoid circular dependencies for justifying reductions in strings extf eval ↵Andrew Reynolds
(#4415) An incorrect answer of "sat" could be found after 8 seconds on the given benchmark (with --strings-fmf) due to a circular justification for why an extended function was reduced. In particular, we ran checkExtfInference on the same term twice and then marked it as reduced since we had already seen it. This makes the code more conservative. Notice I'm making the code doubly conservative in case there is any chance for duplication again (e.g. if ExtTheory provides duplicate terms).
2020-04-28Register lower bound for str.to_int (#4408)Andres Noetzli
This commit changes the term registration for str.to_int terms. Before, we were not sending out any lemmas when registering str.to_int terms. Now, we send a simple lemma that asserts that the value is greater or equal to negative one.
2020-04-28Support the SMT-LIB Unicode string standard by default (#4378)Andrew Reynolds
This PR merges --lang=smt2.6.1 and --lang=smt2.6 (default). It makes it so that 2.6 always expects the syntax of the string standard http://smtlib.cs.uiowa.edu/theories-UnicodeStrings.shtml. I've updated the regressions so that the 2.6 benchmarks are now compliant with the standard. Some of the <=2.5 benchmarks I've updated to 2.6. Others I have left for now, in particular the ones that rely on special characters or ad-hoc escape sequences. The old formats will be supported in the release but removed shortly afterwards. This PR is a prerequisite for the release, but not necessarily SMT-COMP (which will use --lang=smt2.6.1 if needed). Notice that we still do not have parsing support for str.replace_re or str.replace_re_all. This is required to be fully compliant.
2020-04-28Update cardinality in strings to unicode standard (#4402)Andrew Reynolds
This updates the default cardinality in strings to match the Unicode standard, 196608. This avoids a check-model failure from 25 benchmarks in SMT-LIB, which were related to a split due to insufficient constants being required during collectModelInfo. This also makes a few places throw an AlwaysAssert(false) that otherwise would lead to incorrect models. These regardless should never throw, but it would be better to have an assertion failure.
2020-04-25 Fix sets cardinality cycle rule (#4392)Andrew Reynolds
Fixes #4391. The sets cardinality cycle rule is analogous to the S-Cycle rule for strings (see Liang et al CAV 2014). This rule is typically never applied but can be applied in rare cases where theory combination does not determine a correct arrangement of equalities over sets terms that is consistent with the arithmetic arrangement of their cardinalities at full effort. Notice the regression from #4391 has non-linear arithmetic, (mod 0 d), which is translated to UF. The cardinality cycle rule had a bug: it assumed that cycles that were encountered were loops e1 = e2 = ... = e1 but in general they can be lassos e1 = ... = e2 = ... = e2. This ensures the Venn region cycle e2 = ... = e2 is the conclusion in this case, instead of unsoundly concluding e1 = ... = e2. Strings does not have a similar issue: https://github.com/CVC4/CVC4/blob/master/src/theory/strings/core_solver.cpp#L488 Here, when a cycle is encountered, it is processed at the point in traversal where the loop is closed. This is not critical for SMT-COMP but should be in the 1.8 release.
2020-04-23Introduce best content heuristic for strings (#4382)Andres Noetzli
* Introduce best content heuristic for strings This commit introduces a "best content heuristic" to perform context-dependent simplifications. The high-level idea is that for each equivalence class for strings, we compute a representation that is a string concatentation of constants and other string terms. For this representation, we try to get as many letters in the string constants as we can (i.e. the best approximation of the content). This "best content" representation is then used by `EXTF_EVAL` to perform simplifications. Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com>
2020-04-22Strings: Register skolems before sending lemma (#4381)Andres Noetzli
This commit fixes a performance regression introduced by commit 6255c03. The issue seems to be that registering terms manually after sending the lemma on the output channel is too late because the output channel processes the lemma eagerly.
2020-04-22Ensure disequality splits are processed as lemmas (#4380)Andrew Reynolds
Fixes #4379. This was caused by a splitting lemma rewriting to a conjunction, being processed as a fact, and having a pending phase requirement sent out assuming the inference was to be processed as a lemma. This forces 2 of the splits in the core solver to be always processed as lemmas.
2020-04-22Allow eager bitblasting with solve bv as int in QF_NIA (#4373)Andrew Reynolds
This also updates the SMT COMP script to revert to our previous behavior. This is required for SMT COMP. It should be beneficial for satisfiable QF_NIA instances. I will revisit/test this independently.
2020-04-22Reinstantiate support for conjunctions in facts (#4377)Andres Noetzli
Fixes #4376. Commit 6255c0356bd78140a9cf075491c1d4608ac27704 removed support for conjunctions in the conclusion of facts. However, `F_ENDPOINT_EMP` generates a conjunction in the conclusion of the inference if multiple components are inferred to be empty. This commit reinstantiates support for conjunctions in the conclusion of facts.
2020-04-21Update to sygus version 2 (#4372)Andrew Reynolds
2020-04-21Fix for parse options related to binary name (#4368)Andrew Reynolds
Possible fix for the nightlies. In some configurations, a unit test fails when using the function for parsing options via manual argv construction https://github.com/CVC4/CVC4/blob/master/test/unit/expr/expr_public.h#L58 This reverts a behavior change from 3dfb48b. In particular, we always parse and ignore the binary name instead of skipping it outright. This more accurately reflects the original code.
2020-04-20Introduce a public interface for Sygus commands. (#4204)Abdalrhman Mohamed
This commit addresses issue #38 in cvc4-projects by introducing public API for Sygus commands. It also includes two simple examples of how to use the API.
2020-04-20Make option names related to CEGQI consistent (#4316)Andrew Reynolds
This updates option names to be consistent across uses of counterexample-guided quantifier instantiation (ceqgi), which was previously called "counterexample-based quantifier instantiation" (cbqi), and sygus. Notably, the trace "cegqi-engine" is changed to "sygus-engine" by this commit. The changes were done by these commands in the given directories: src/: for f in $(find -name '.'); do sed -i 's/options::cbqi/options::cegqi/g' $f;sed -i 's/cegqi-engine/sygus-engine/g' $f; done;sed -i 's/"cbqi/"cegqi/g' $f; done test/regress/: for f in $(find -name '.'); do sed -i 's/--cbqi/--cegqi/g' $f; done src/: and test/regress/: for f in $(find -name '.'); do sed -i 's/cegqi-si/sygus-si/g' $f; done test/regress/: for f in $(find -name '.'); do sed -i 's/no-cbqi/no-cegqi/g' $f; done test/regress/: for f in $(find -name '.'); do sed -i 's/:cbqi/:cegqi/g' $f; done And a few minor fixes afterwards. This should be merged close to the time of the next stable release.
2020-04-20Refactor inference manager in strings to be amenable to proofs (#4363)Andrew Reynolds
This is a key refactoring towards proofs for strings. This ensures that InferInfo is maintained until just before facts, lemmas and conflicts are processed. This allows us both to: (1) track more accurate stats and debug information, (2) have enough information to ensure that proofs can be constructed at the moment facts, lemmas, and conflicts are processed. Changes in this PR: PendingInfer and InferInfo were merged, CoreInferInfo is now the previous equivalent of InferInfo, extended with core-solver-specific information, which is only used by CoreSolver. sendInference( const InferInfo& info, ... ) is now the central method for sending inferences which is called by the other variants, not the other way around. sendLemma is inlined into sendInference(...) for clarity. doPendingLemmas and doPendingFacts are extended to process the side effects of the inference infos. There is actually a further issue with pending inferences related to eagerly processing the side effect of CoreInferInfo before we know the lemma is sent. I believe this issue does not occur in practice based on our strategy. Further refactoring could tighten this, e.g. virtual void InferInfo::processSideEffect. I will do this in another PR. Further refactoring can address whether asLemma should be a field of InferInfo (it probably should), and whether we should explicitly check for AND in conclusions instead of making it the responsibility of the user of this class.
2020-04-20Add SCOPE proof rule (#4332)Andrew Reynolds
This rule is dual to ASSUME. It is a way of closing free assumptions to conclude an implication. It also changes getId -> getRule.
2020-04-18Track inference id for pending facts in strings (#4331)Andrew Reynolds
This improves our tracking of pending inferences in strings so that we record pending inferences as a triple (id, fact, exp). This will ensure that proof steps can be constructed at the time we decide to process facts. It also inlines the sendInfer method into sendInference for simplicity. This also improves the policy for reference counting facts and their explanations: we add them to d_keep when they are added to the equality engine. Previously, we were adding them when they were registered as pending. This means we would collect facts in this pending set that were added but later abandoned, which is unnecessary.
2020-04-18Improving EqProof printing (#4329)Haniel Barbosa
2020-04-17Add (context-dependent) Proof (#4323)Andrew Reynolds
A (context-dependent) collection of proof steps that are linked to together to form a ProofNode dag. Note that the name "Proof" is currently taken. I am calling this class "CDProof", although it is optionally context dependent.
2020-04-16SyGuS instantiation quantifiers module (#3910)Mathias Preiner
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback