summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-11-09Migrate some documentation about attributes (#5390)Andrew Reynolds
From old wiki.
2020-11-09Add symbol manager (#5380)Andrew Reynolds
This add the symbol manager class, which is a Term-level utility, separate of the API. This class manages things like expression and assertion names, which is intentionally done outside the solver. The symbol manager is intended to live at the same level as the Solver. When parsing input, the symbol manager will be used to model any interaction of e.g. named expressions and assertions. It also stores the symbol table of the parser. This PR adds the basic interface for the symbol manager and passes it to the parser. Later PRs will migrate the functionality for named expression out of e.g. SmtEngine and into SymbolManager. Commands will take Solver+SymbolManager instead of Solver. This will allow the parser to be fully migrated to the new API. Marking "complex" since this impacts further design of the parser and the code that lives in src/main. FYI @4tXJ7f
2020-11-09Simplify handling of subtypes in smt2 printer (#5401)Andrew Reynolds
This makes major simplifications to how subtypes are enforced in the smt2 printer. It is now the principle that the smt2 prints things faithfully to the AST, regardless of whether it conforms to the smt2 standard. It also fixes the current smt2 printing of to_real. Conversely, this removes a hack from GetValueCommand which forced casting via x -> (/ x 1). This is now properly handled in Solver::getValue. Some regressions change expected output as a result. Notice that internally generated Node may not conform to the smt2 standard, but user-level terms will.
2020-11-09Properly clear interrupt for solve() as well. (#5403)Gereon Kremer
The minisat solver stores whether it has been interrupted in asynch_interrupt and expects it to be reset before another call to solve(). MinisatSatSolver::solve() failed to do this, leading to incorrect unknown results as observed in CVC4/cvc4-projects#106. The alternative MinisatSatSolver::solve(unsigned long& resource) already did the correct thing. Fixes CVC4/cvc4-projects#106.
2020-11-09Do not regress explanations of datatype lemmas (#5376)Andrew Reynolds
This modifies datatypes to not regress explanations for lemmas. This avoids segfaults in some corner cases of sygus (see attached) and leads to slightly better performance on Facebook verification benchmarks.
2020-11-06Fix issue #5342 (#5349)mudathirmahgoub
This PR fixes issue #5342 by adding the rewrite rule (setminus A (setminus A B)) = (intersection A B).
2020-11-06(proof-new) Miscellaneous changes to strings for proofs (#5362)Andrew Reynolds
This includes all minor remaining changes from proof-new for strings that were not merged to master. This includes mostly minor changes to make proofs pass, including reordering assertions. It also removes some non-standard pedantic checks as these are now subsumed by standard ones. It also makes the strings rewriter slightly more safe when checking arithmetic entailment under assumptions. This code used substitution, which was not safe when quantifiers were involved. This is replaced by capture avoiding substitution here.
2020-11-05Split sygus template inference to its own file (#5388)Andrew Reynolds
This splits techniques for inferring templates for functions-to-synthesize to their own file. This is work towards cleaning up the single invocation utility, which will be undergoing some additions.
2020-11-05Simplify printing with respect to expression types (#5394)Andrew Reynolds
This removes infrastructure for stream property related to printing type annotations on all variables. This is towards refactoring the printers.
2020-11-05Remove mkSingleton from the API (#5366)mudathirmahgoub
This PR removes mkSingleton from the API after removing subtyping from set theory and introducing mkInteger to the API. Instead the user needs to use Solver::mkTerm(api::SINGLETON, element) where element has the right type. Internally NodeManager::mkSingleton(type, element) is still needed to determine the type of the set. Other changes: Renamed Solver::mkTerm(Op op, .. functions to Solver::mkTermFromOp(Op op, ... Added mkTermFromOp to the python API
2020-11-03Add constants from equality engine evaluation to model (#5391)Andres Noetzli
Fixes #5330. The issue mentions to related model checking failures: When the theory of strings computes a model, there is a step that chooses a constant that is different from other constants of the same length in other equivalence classes. In the example, the issue was that the constant "A" was introduced by doing evaluation in the equality engine of the theory of strings. The constant was then not added to the term set and was skipped while asserting the equality engine to the theory model. As a result, an equivalence class was assigned "A" even though it already existed, which made the model invalid. The fix ensures that all constants in the equality engine are added to the theory model. It should be ok to handle the issue during model construction because other theories shouldn't have to care about the constants that we computed internally within the theory of strings. When an equivalence class has a normal form that consists of a single seq.unit, then we need to make sure that the value for the argument is consistent with the rest of the model and we have to make sure that we choose different values for different equivalence classes. The commit adds code for retrieving the value of the argument to seq.unit from the model and adds the resulting constant to the theory model to block it for other equivalence classes. Previously, this was not done and we ended up with two different equivalence classes being assigned the same constant.
2020-11-03Add scope methods constructing types in API (#5393)Andrew Reynolds
This addresses the nightly failures. It ensures a node manager is in scope when constructing type nodes. It also simplifies the construction of atomic type nodes to avoid an extra TypeNode(...) constructor.
2020-11-03Add support for printing `re.loop` and `re.^` (#5392)Andres Noetzli
In the new SMT-LIB string standard, re.loop and re.^ are indexed operators but the printer was not updated to print them correctly. This commit adds support for printing re.loop and re.^.
2020-11-03Reset built model flag at presolve in nonlinear (#5386)Andrew Reynolds
Fixes a bug in incremental with non-linear where the built model flag would still be true on the first call to check in a 2nd call to check-sat in incremental mode. This occurs when we are under the same SAT context when the model was built (likely level 0) on the subsequent check-sat call. Fixes #5372
2020-11-02Move sygus qe preproc to its own file (#5375)Andrew Reynolds
2020-11-02Run python tests during make check (#5226)makaimann
If building with python bindings, check the pytest is installed, and adds a command to run pytest after the existing make check tests. If built without python bindings, it just uses a null command. Note: the current semantics are such that the pytest tests will not run if the ctest run fails (unless you pass the correct flag to make to continue --ignore-errors I believe). I can look into changing this semantics if that would be preferred.
2020-11-02contrib: Remove dependency directories. (#5367)Aina Niemetz
This automatically removes dependency directories for scripts that get external dependencies instead of aborting with an error.
2020-11-02Update strings proxy variable map to be context independent (#5377)Andrew Reynolds
This makes strings proxy variables map to be context-independent. They should be context independent since we are using attributes to mark proxy variables, which are context-independent. This led to the crash reported on #5374 since proxy variables would persist across multiple user contexts, but would be missing in the user-context dependent map. This fixes #5374.
2020-11-02Miscellaneous cleaning of parser (#5369)Andrew Reynolds
2020-11-02Avoid dynamic allocation in symbol table implementation (#5368)Andrew Reynolds
Encountered this while debugging the new symbol manager. This is not essential but probably a good idea to refactor.
2020-10-30Use BoundInference in nonlinear extension (#5359)Gereon Kremer
Currently the NonlinearExtensions uses a custom logic to eliminate redundant bounds and perform tightening on bound integer terms. As these replacements are not recorded, incorrect conflicts are being sent to the InferenceManager. This PR replaces this logic by the BoundInference class and fixes the issues with conflicts by - allowing BoundInference to collect bounds on arbitrary left hand sides (instead of only variables), - improving origin tracking in BoundInference by explicitly constructing the new bound constraints, - adding tightening of integer bounds, - emitting lemmas instead of conflicts, and finally - replacing the current logic by using the BoundInference class.
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-29Set strings pending conflict flag (#5364)Andrew Reynolds
While addressing the review on 6898ab9, strings eager conflicts were accidentally disabled, this reenables them.
2020-10-29Add mkInteger to the API (#5274)mudathirmahgoub
This PR adds mkInteger to the API and update mkReal to ensure that the returned term has real sort. The parsers are modified to parse numbers like "0" "5" as integers and "0.0" and "15.0" as reals. This means subtyping is effectively eliminated from all theories except arithmetic. Other changes: Term::isValue is removed which was introduced to support parsing for constant arrays. It is no longer needed after this PR. Benchmarks are updated to match the changes in the parsers Co-authored-by: Andrew Reynolds andrew-reynolds@uiowa.edu
2020-10-29(proof-new) Update the strings inference manager for proofs (#5220)Andrew Reynolds
This updates the inference manager in strings in two ways: (1) It now inherits from InferenceManagerBuffered, meaning that the custom methods for process the current pending lemma/fact vectors are removed in favor of the standard ones. (2) It has support for proof generation via the InferProofCons utility. This PR standardizes three methods processFact, processLemma, and processConflict which take InferInfo and processes any string-specific behavior pertaining to processing facts, lemmas and conflicts with the inference manager. These methods are intended to preserve the previous behavior of this class.
2020-10-29Add NodeManager::mkOr() (#5360)Gereon Kremer
This PR adds a convenience method mkOr() just like mkAnd().
2020-10-28run_regression.py to fail on invalid requirements (#5264)yoni206
Currently, the following test is skipped when running ctest: ; REQUIRES: symfpuuuu ; EXPECT: sat (set-logic ALL) (assert true) (check-sat) I think it is better for such a test to fail, because otherwise it might never run without anyone noticing (this almost happened to me here: c7e277b). This PR makes such tests to fail by checking whether the REQUIRES value is valid. No regressions fail as a result. Co-authored-by: Mathias Preiner mathias.preiner@gmail.com
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-28Fixes for unconstrained variables in nonlinear model (#5351)Andrew Reynolds
This ensures that we explicitly mark x -> 0 as part of the arithmetic model coming from nonlinear for unconstrained variables x that nonlinear extension assumes to be 0. This fixes #5348.
2020-10-28Convert symbol table from Expr-level to Term-level (#5355)Andrew Reynolds
This task is left over from parser migration. This PR also drops support for a case of symbol overloading, in particular symbols (constructors, selectors) for parametric datatypes cannot be overloaded. One regression is disabled as a result.
2020-10-28Split NlSolver in multiple subsolvers (#5315)Gereon Kremer
The NlSolver started as one place for nonlinear reasoning, but has grown significantly since. This PR splits the NlSolver class into multiple smaller classes.
2020-10-28Add rewrites for div/mod in the arithmetic rewriter (#5352)Andrew Reynolds
This adds some basic rewrites for integer div/mod in the rewriter. This is in preparation for improved preprocessing and rewriting for NIA problems with heavy use of div/mod.
2020-10-27run_regression: Add --skip-timeout option, lower timeout to 600 seconds. ↵Mathias Preiner
(#5353)
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-27Add missing methods involving datatype sorts to the API (#5290)Andrew Reynolds
This is required for migrating the parser's symbol table from Expr -> Term.
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-26Add DUPICATE_REMOVAL operator to bags (#5336)mudathirmahgoub
This PR adds duplicate removal operator to bags (also known as delta or squash). Other changes: print MK_BAG operator as "bag" in smt2 instead of "mkBag" renamed BAG_IS_INCLUDED operator to SUBBAG.
2020-10-26(proof-new) Add datatypes proof checker (#5340)Andrew Reynolds
This adds the proof rules and proof checker for datatypes.
2020-10-26Send external equalities from collapse selector as lemmas (#5346)Andrew Reynolds
In 20e58d4, a policy change was made for datatypes to keep more inferences as internal facts. This leads to a crash (issue #5344) where the equality status of two BV terms is asked by TheoryDatatypes, where the TheoryBV was not informed of the term, as datatypes kept it internal. This refines the policy further such that the collapse selector rule is processed as a lemma for terms of external type. The reason is that this rule may generate new terms of external type. Other rules like unification retain the internal fact policy, as they do not generate new terms. Fixes #5344. FYI @barrettcw
2020-10-24Fix issue 5271 (#5335)mudathirmahgoub
This PR fixes #5271 by splitting on the equality of set members which ensures members are distinct when collectModelInfo is called. Co-authored-by: Andrew Reynolds andrew-reynolds@uiowa.edu
2020-10-23[proof-new] Fix n-ary kind handling in EqEngine explanations (#5332)Haniel Barbosa
Adding missing cases of kinds that are n-ary but whose partial applications are not true terms in the equality engine. This in the case not only for APPLY_UF but also for the APPLY_* kinds for datatypes.
2020-10-23Apply alpha equivalence to annotated quantified formulas (#5324)Andrew Reynolds
Previously, alpha equivalence was not applied to quantified formulas with attributes, likely motivated by keeping alpha equivalent quantified formulas with different user patterns. It's not clear this is a good a idea. Moreover, this also implies that quantified formulas with user-provided names (which happens in e.g. Boogie benchmarks) also do not have alpha equivalence applied. This makes it so that we apply alpha equivalence regardless of annotations. FYI @barrettcw
2020-10-23Change datatypes lemma policy for equalities not coming from instantiate (#5325)Andrew Reynolds
Recently, the policy for lemma vs fact changed for instantiate rule in datatypes to ensure that other theories were notified of terms having external finite type. This PR further refines the policy so that the instantiate rule is the only rule whose conclusion is an equality that is sent out as a lemma. This means that equalities from unification and collapsing selectors are always kept internal. The justification for this is that the instantiate rule is applied for all terms with the proper policy, and hence it already covers all cases where we may need to introduce new terms.
2020-10-23Fix related to preregistering boolean term variables in strings (#5331)Andrew Reynolds
We should only add trigger predicates for string predicates, and not arbitrary Boolean terms (which can now occur since we are handling parametric sequences). This avoids a debug assertion failure reported on as a followup to #4370. In that benchmark BOOLEAN_TERM_VARIABLE was being added as a trigger predicate.
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-22Remove unused equality engine types (#5319)Andrew Reynolds
This is leftover from the old proof infrastructure.
2020-10-22Fix issue 5309 (#5327)mudathirmahgoub
This PR fixes #5309 by ensuring singleton terms are added to the model builder as representatives. Co-authored-by: Andrew Reynolds andrew-reynolds@uiowa.edu
2020-10-21(proof-new) Make theory preprocessor user-context dependent (#5296)Andrew Reynolds
Previously, theory preprocessing cache was manually cleared whenever the theory preprocess pass was run. However, proofs for theory preprocessing required to be alive for the remainder of the user context. This PR changes theory preprocessing so that both the cache and proofs in theory preprocessing are user-context dependent. This PR also makes the theory preprocess pass proof producing.
2020-10-21(proof-new) Make circuit propagator proof producing (#5318)Gereon Kremer
This PR uses the proofs from #5301 to actually produce proofs from the circuit propagator.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback