summaryrefslogtreecommitdiff
path: root/src/theory/arith/constraint.h
AgeCommit message (Collapse)Author
2021-04-02Remove template argument from `NodeBuilder`an/refactor/NodeBuilderAndres Noetzli
Currently, `NodeBuilder` takes a single template argument: An integer that determines the expected number of arguments. This argument is used to determine the size of the `d_inlineNvChildSpace` array. This array is used to construct nodes inline. The advantage of this is that we don't have to allocate a `NodeValue` on the heap for the node under construction until we are sure that the node is new. While templating the array size may save some stack space (or avoid a heap allocation if we statically know that we a fixed number of children and that number is greater than 10), it complicates the code and leads to longer compile times. Thus, this commit removes the template argument and moves some of the `NodeBuilder` code to a source file for faster compilation. CPU build time before change (debug build): 2429.68s CPU build time after change (debug build): 2228.44s
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-09Some more cleanup of includes (#6083)Gereon Kremer
This PR does some more cleanup of the includes.
2021-03-09Update copyright headers to 2021. (#6081)Aina Niemetz
2020-12-18Bugfix: proofs for props of non-normal arith lits (#5702)Alex Ozdemir
Arith has a normal form for literals, which the rewriter computes. Nonetheless, arith sometimes gets (and ultimately propagates) non-normal literals. It normalizes them internally and goes about its business. However, when asked for an explanation, it must prove the non-normal literal, rather than the normal one. Also includes a regression for the bug, courtesy of Andy. Co-authored-by: Andrew Reynolds andrew-reynolds@uiowa.edu
2020-10-13(proof-new) Prove lemmas in Constraint (#5254)Alex Ozdemir
Includes: T/F splitting lemmas for any arith constraint Unate lemmas produced early on The hard part is proving the unate lemmas. In general, they are all implied by 2-constraint farkas proofs, so we ultimately map them all down to proveOr, which constructs that proof. make check was happy with this change. Hopefully the CI agrees :).
2020-10-09(proof-new) proofs for arith-constraint explanations (#5224)Alex Ozdemir
Threads proofs through arith::Constraint's machinery for explaining constraints. Changes, by function: externalExplainByAssertions: introduce scope to prove the implication externalExplainForPropagation: introduce scope to prove the implication externalExplainConflict: use other machinery to prove conflicting constraints use the CONTRA rule introduce scope to close the conflict proof Future commits will pick up these proofs in theory_arith_private.cpp. Future commits will prove the "split" lemmas produced in constraint.cpp
2020-10-06(proof-new) proofs for ArithCongMan -> ee facts (#5207)Alex Ozdemir
Threads proof production through the ArithCongruenceManager's pipeline of information to the equality engine. The idea is to define a method: ArithCongruenceManager::assertLitToEqualityEngine(literal, reason, pf) This method asserts a literal to the equality engine with the given proof and reason. It stores the proof of the literal for the equality engine's future reference, and is smart about symmetric literals. This machinery uses proofs that are not closed over the reason, as the equality engine requires. Other functions in the pipeline: assertionToEqualityEngine equalsCostant construct proofs and call assertLitToEqualityEngine. Future commits will address the ee -> ArithCongruenceManager pipeline, and the relationship between ArithCongruenceManager and the rest of arithmetic.
2020-10-02(proof-new) New proofs in arith::Constraint::externalExplain (#5176)Alex Ozdemir
This commit threads proofs through the core of arith: Constraint::externalExplain, which recursively explain arith literals. One of the base cases here is asking the EE for an explanation, through the congruence manager. To delay implementing proofs in ArithCongruenceManager to a separate commit, we stub out proof production in ArithCongruenceManager::explain for now.
2020-09-29(proof-new) Add proof managers and eager gens to arith (#5159)Alex Ozdemir
This commit threads ProofNodeManager, EagerProofGenerator, etc throughout the arith theory into the appropriate locations. These objects are currently unused, but will be used in future commits. Crediting Andy, since he set up some of this. Co-authored-by: Andrew Reynolds andrew.j.reynolds@gmail.com
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-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-07-27Consider negation's proof before triggering arith pfs. (#4776)Alex Ozdemir
The current arith proof machinery can prove conflicts which are explained by assumptions and tightened assumptions. Previously we verified that the conflict constraint was explained in terms of assumptions and tightened assumptions, before trying to save/produce a proof. We did not verify that the negated constraint was an assumption or tightened assumption. This caused us to attempt to prove conflicts around constraints whose negations where proven by general means (in the case of #4714, by the equality engine), which the proof machinery was not prepared to handle. This PR also checks that the negate constraint is an assumption or tightened assumption, before saving the proof. Thanks, Gereon, for doing the initial investigation into this! fixes 4714 Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2020-06-16Update copyright headers.Aina Niemetz
2020-03-16Expand the definition of a "simple" farkas proof.Alex Ozdemir
Before, a "simple farkas proof" was one that just applied the farkas lemma. Now it allows for the antecedents to (optionally) be tightened. Note that hasSimpleFarkasProof was (and is) dead code. We will use it to decide whether to print a proof or a hole.
2020-03-05Add a new arith constraint proof rule: IntTightenAP (#3818)Alex Ozdemir
This rule is used when a bound on an integer expression is tightened because of integer reasoning. Before this rule was subsumed by IntHoleAP, a catch-all rule for integer reasoning. We are now articulating IntTightenAP separately, because we can produce proofs for it. For IntHoleAP, we will have to omit a hole.
2020-03-05Revert "Add a new arith constraint proof rule: IntTightenAP (#3818)"Alex Ozdemir
This reverts commit c360b3af4371cf871935a8bae96be5f8fecf741b.
2020-03-05Add a new arith constraint proof rule: IntTightenAP (#3818)Andres Noetzli
This rule is used when a bound on an integer expression is tightened because of integer reasoning. Before this rule was subsumed by IntHoleAP, a catch-all rule for integer reasoning. We are now articulating IntTightenAP separately, because we can produce proofs for it. For IntHoleAP, we will have to omit a hole.
2020-02-04Articulate proof-related debug statements in arith (#3700)Alex Ozdemir
2019-04-24Do not use __ prefix for header guards. (#2974)Mathias Preiner
Fixes 2887.
2019-03-26Update copyright headers.Aina Niemetz
2019-01-03[LRA proof] Recording & Printing LRA Proofs (#2758)Alex Ozdemir
* [LRA proof] Recording & Printing LRA Proofs Now we use the ArithProofRecorder to record and later print arithmetic proofs. If an LRA lemma can be proven by a single farkas proof, then that is done. Otherwise, we `trust` the lemma. I haven't **really** enabled LRA proofs yet, so `--check-proofs` still is a no-op for LRA. To test, do ``` lfsccvc4 <(./bin/cvc4 --dump-proofs ../test/regress/regress0/lemmas/mode_cntrl.induction.smt | tail -n +2) ``` where `lfsccvc4` is an alias invoking `lfscc` with all the necessary signatures. On my machine that is: ``` alias lfsccvc4="/home/aozdemir/repos/LFSC/build/src/lfscc \ /home/aozdemir/repos/CVC4/proofs/signatures/sat.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/smt.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/lrat.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_base.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_bv.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_bv_bitblast.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_arrays.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_int.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_quant.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_real.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_real.plf" ``` * Added guards to proof recording Also reverted some small, unintentional changes. Also had to add printing for STRING_SUBSTR?? * Responding to Yoni's review * SimpleFarkasProof examples * Respond to Aina's comments * Reorder Constraint declarations * fix build * Moved friend declaration in Constraint * Trichotomy example * Lift getNumChildren invocation in PLUS case Credits to aina for spotting it. * Clang-format
2018-12-06Arith Constraint Proof Loggin (#2732)Alex Ozdemir
* Arith Constraint Proof Logging Also a tiny documentation update. * Debug.isOn check around iterated output * reference iteratees
2018-06-25Updated copyright headers.Aina Niemetz
2017-07-20Moving from the gnu extensions for hash maps to the c++11 hash mapsTim King
* Replacing __gnu_cxx::hash_map with std::unordered_map. * Replacing __gnu_cxx::hash_set with std::unordered_set. * Replacing __gnu_cxx::hash with std::hash. * Adding missing includes.
2017-07-07Update copyright headers.Mathias Preiner
2016-04-20update from the masterPaulMeng
2016-01-28Adding listeners to Options.Tim King
- Options -- Added the new option attribute :notify. One can get a notify() call on the Listener after a the option's value is updated. This is the new preferred way to achieve dynamic dispatch for options. -- Removed SmtOptionsHandler and pushed its functionality into OptionsHandler and Listeners. -- Added functions to Options for registering listeners of the notify calls. -- Changed a number of options to use the new listener infrastructure. -- Fixed a number of warnings in options. -- Added the ArgumentExtender class to better capture how arguments are inserted while parsing options and ease memory management. Previously this was the "preemptGetopt" procedure. -- Moved options/options_handler_interface.{cpp,h} to options/options_handler.{cpp,h}. - Theories -- Reimplemented alternative theories to use a datastructure stored on TheoryEngine instead of on Options. - Ostream Handling: -- Added new functionality that generalized how ostreams are opened, options/open_stream.h. -- Simplified the memory management for different ostreams, smt/managed_ostreams.h. -- Had the SmtEnginePrivate manage the memory for the ostreams set by options. -- Simplified how the setting of ostreams are updated, smt/update_ostream.h. - Configuration and Tags: -- Configuration can now be used during predicates and handlers for options. -- Moved configuration.{cpp,h,i} and configuration_private.h from util/ into base/. -- Moved {Debug,Trace}_tags.* from being generated in options/ into base/. - cvc4_private.h -- Upgraded #warning's in cvc4_private.h and cvc4_private_library.h to #error's. -- Added public first-order (non-templatized) member functions for options get and set the value of options outside of libcvc4. Fixed all of the use locations. -- Made lib/lib/clock_gettime.h a cvc4_private_library.h header. - Antlr -- Fixed antlr and cvc4 macro definition conflicts that caused warnings. - SmtGlobals -- Refactored replayStream and replayLog out of SmtGlobals. -- Renamed SmtGlobals to LemmaChannels and moved the implementation into smt_util/lemma_channels.{h,cpp}.
2015-10-26This commit fixes a bug related to a public header depending on a compiler ↵Tim King
flag. This resulted in user code seeing a different size for the SmtEngine class than what was compiled in the library. Proofs are enabled by default again. See http://cvc4.cs.nyu.edu/bugs/show_bug.cgi?id=688 for more information.
2015-06-14Fixes for shared term normalization in replay for constraint construction.Tim King
2015-04-18Farkas proof coefficients.Tim King
This commit adds tracking of Farkas coefficients to proof enabled builds in the theory of linear real arithmetic when proofs are enabled. There could be some performance changes due to subtly different search paths being taken. Additional bug fixes: - Polynomial::exactDivide did not satisfy preconditions to the Monomial constructor. To prevent future problems, Monomials should now be made via one of the mkMonomial functions. - Fixes a bug in SumOfInfeasibilitiesSPD::greedyConflictSubsets(). There was a way to use a row twice in the construction of the conflicts. This was violating an assumption in the Tableau when constructing the intermediate rows. Constraints: - To enable proofs, all conflicts and propagations are designed to go through the Constraint system before they are converted to externally understandable conflicts and propagations in the form of Node. - Constraints must now be given a reason for marking them as true that corresponds to a proof. - Constraints should now be marked as being true by one of the impliedbyX functions. - Each impliedByX function has an ArithProofType associated with it. - Each call to an impliedByX function stores a context dependent ConstraintRule object to track the proof. - After marking the node as true the caller should either try to propagate the constraint or raise a conflict. - There are no more special cases for marking a node as being true when its negation has a proof vs. when the negation does not have a proof. One must now explicitly pass in a inConflict flag to the impliedByX (and similar functions). For example,this is now longer both: void setAssertedToTheTheory(TNode witness); void setAssertedToTheTheoryWithNegationTrue(TNode witness); There is just: void setAssertedToTheTheory(TNode witness, bool inConflict);
2014-07-01Update copyrights.Morgan Deters
2014-03-07Merging a squash of the branch timothy-king/CVC4/glpknecfix c95bf7d4f1 into ↵Tim King
master. See the CAV14 submission for an explanation of the changes to the integer solver's behavior. If compiled against the our custom extension of glpk, https://github.com/timothy-king/glpk-cut-log, this should have substantial differences in behavior. This should have moderate performance differences for linear real and integer arithmetic even if these features are disabled.
2013-05-01Working on the new explanation system.Tim King
2013-04-26FCSimplex branch mergeTim King
2013-04-02Regenerated copyrights: canonicalized names, no emailsMorgan Deters
2013-04-01update copyrightsMorgan Deters
2013-02-16Some cleanup and copyright updatingMorgan Deters
* update some copyrights for 2013 * cleaned up some comments/ifdefs, indentation * some spelling corrections * add some missing makefiles
2012-12-05Improved garbage collection for TheoryArith. The merges all of the code ↵Tim King
over from branches/arithmetic/converge except for the new code for simplex.
2012-11-25This commit fixes two incompleteness bugs (461, 459) introduced in r4611 ↵Tim King
dues to a problem of not correctly handling disequalities. Performance implications are uncertain.
2012-11-24Adds ensureConstraint(...) to ConstraintDatabase. This is a slightly ↵Tim King
optimized way of doing getConstraint() if the user already has a ValueCollection&.
2012-10-11Standardizing copyright notice. Touches **ALL** sources, guys, sorry.. it'sMorgan Deters
just the header comments at the top, though. Don't update to this rev if you don't have time for a complete rebuild, and exclude this rev if you want to see what's new across a range of commits. (this commit was certified error- and warning-free by the test-and-commit script.)
2012-07-07Various fixes to documentation---typos, some incomplete documentation fixed, ↵Morgan Deters
\file tags corrected, copyright added to files that had it missing, etc. I ensured that I didn't change any code with this commit, and even tested on the cluster to be doubly sure: http://church.cims.nyu.edu/regress-results/compare_jobs.php?job_id=4655&reference_id=4646&p=0
2012-06-13Added witnesses to Constraints.Tim King
2012-06-13- Added a loop to internally assert constraints that are marked as true.Tim King
- Changes how CongruenceManager reports conflicts. - ConstraintDatabase can now detect and raise conflicts when doing unate propagation.
2012-05-22This commit merges in the branch arithmetic/cprop.Tim King
2012-05-04- This fixes a problem where simplex produced the same conflict in the ↵Tim King
single check call. - This increases the number of substitutions that ppAssert can solve on integer equations.
2012-04-24This commit merges in the branch branches/arithmetic/congruence into trunk. ↵Tim King
Here are a summary of the changes: - Adds CDMaybe and CDRaised in cdmaybe.h - Add test for congruence over arithmetic terms and constants - Renames DifferenceManager to CongruenceManager - Changes a number of internal details for CongruenceManager
2012-04-17Merges branches/arithmetic/atom-database r2979 through 3247 into trunk. ↵Tim King
Below is a highlight of the changes: - This introduces a new normal form to arithmetic. -- Equalities and disequalities are in solved form. Roughly speaking this means: (= x (+ y z)) is in normal form. (See the comments in normal_form.h for what this formally requires.) -- The normal form for inequality atoms always uses GEQ and GT instead of GEQ and LEQ. Integer atoms always use GEQ. - Constraint was added to TheoryArith. -- A constraint is a triple of (k x v) where: --- k is the type of the constraint (either LowerBound, UpperBound, Equality or Disequality), --- x is an ArithVar, and --- v is a DeltaRational value. -- Constraints are always attached to a ConstraintDatabase. -- A Constraint has its negation in the ConstraintDatabase [at least for now]. -- Every constraint belongs to a set of constraints for each ArithVar sorted by the delta rational values. -- This set can be iterated over and provides efficient access to other constraints for this variable. -- A literal may be attached to a constraint. -- Constraints with attached literals may be marked as being asserted to the theory (sat context dependent). -- Constraints can be propagated. -- Every constraint has a proof (sat context dependent). -- Proofs can be explained for either conflicts or propagations (if the node was propagated). (These proofs may be different.) -- Equalities and disequalities can be marked as being split (user context dependent) - This removes and replaces: -- src/theory/arith/arith_prop_manager.* -- src/theory/arith/atom_database.* -- src/theory/arith/ordered_set.h - Added isZero(), isOne() and isNegativeOne() to Rational and Integer. - Added operator+ to CDList::const_iterator. - Added const_iterator to CDQueue. - Changes to regression tests.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback