summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-05-17Split parser state from parser classparser-stateAndres Noetzli
This commit splits the parser state from the parser class.
2021-05-17Add new interface for parsing inputsAndres Noetzli
This commit introduces the `InputParser` class, which is now the main interface for retrieving commands and expressions from parsers for a given input. The idea is that a `Parser` can be used to parse multiple inputs (e.g., in the interactive shell) and that the commands/expressions in each input can be retrieved using an `InputParser`.
2021-05-17Decouple parser creation from input selectionAndres Noetzli
This commit decouples the creation of a `Parser` instance from creating an `Input` and setting the `Input` on the parser. This is a first step in refactoring the parser infrastructure. A future PR will split the parser class into three classes: `Parser`, `ParserState`, and `InputParser`. The `Parser` and `InputParser` classes will be the public-facing classes. The new `Parser` class will have methods to create `InputParser`s from files, streams, and strings. `InputParser`s will have methods to get commands/exprs from a given input. The `ParserState` class will keep track of the state of the parser and will be the internal interface for the parsers. The current `Parser` class is used both publicly and internally, which is messy.
2021-05-17Always parse streams with line bufferAndres Noetzli
When cvc5 was compiled in competition mode (but not for the application track), then it had a special behavior when reading from stdin. When it received input from stdin, it would read all of stdin and then parse the input as a string because it assumed that the full input is directly available on stdin. However, the non-application tracks of SMT-COMP do not use stdin anymore. They pass a filename to the solver. This special case is not used as a result. Usually, cvc5 parses from stdin using the line buffer, so this commit makes it so that this is always the case, which simplifies the code.
2021-05-14Add new interface for parsing inputsinput-parserAndres Noetzli
This commit introduces the `InputParser` class, which is now the main interface for retrieving commands and expressions from parsers for a given input. The idea is that a `Parser` can be used to parse multiple inputs (e.g., in the interactive shell) and that the commands/expressions in each input can be retrieved using an `InputParser`.
2021-05-14Decouple parser creation from input selection (#6533)Andres Noetzli
This commit decouples the creation of a `Parser` instance from creating an `Input` and setting the `Input` on the parser. This is a first step in refactoring the parser infrastructure. A future PR will split the parser class into three classes: `Parser`, `ParserState`, and `InputParser`. The `Parser` and `InputParser` classes will be the public-facing classes. The new `Parser` class will have methods to create `InputParser`s from files, streams, and strings. `InputParser`s will have methods to get commands/exprs from a given input. The `ParserState` class will keep track of the state of the parser and will be the internal interface for the parsers. The current `Parser` class is used both publicly and internally, which is messy.
2021-05-14Add Result.java to the java API (#6385)mudathirmahgoub
This PR adds Result.java ResultTest.java and cvc5_Result.cpp to the java api.
2021-05-14bv: Assert input facts on user-level 0. (#6515)Mathias Preiner
The bitblast solver currently uses solving under assumptions for all facts that are sent to the bit-vector solver. For input facts on user-level 0 we can however assert the fact to the SAT solver, which allows the SAT solver to do more preprocessing. This PR adds the option to assert user-level 0 input facts, which is disabled by default.
2021-05-13Always parse streams with line buffer (#6532)Andres Noetzli
When cvc5 was compiled in competition mode (but not for the application track), then it had a special behavior when reading from stdin. When it received input from stdin, it would read all of stdin and then parse the input as a string because it assumed that the full input is directly available on stdin. However, the non-application tracks of SMT-COMP do not use stdin anymore. They pass a filename to the solver. This special case is not used as a result. Usually, cvc5 parses from stdin using the line buffer, so this commit makes it so that this is always the case, which simplifies the code.
2021-05-13Add std::hash overloads for Node, TNode and TypeNode. (#6534)Mathias Preiner
Eliminates NodeHashFunction, TNodeHashFunction and TypeNodeHashFunction.
2021-05-13Split options holder class (#6527)Gereon Kremer
This PR splits the OptionsHolder class into separate holder classes for every options module and makes them directly accessible via appropriate Options::<module>() methods. We forward declare these new holder classes and thereby retain that we only need to recompile when we change an option module that is explicitly included. All (generated) methods that previously accessed the old holder object are changed to instead use the new holder objects. This PR does the bare minimum to do this change, further PRs will eventually get rid of all template specializations that currently surround our options class.
2021-05-13Adding functions to the python API and testing them -- part 2 (#6517)yoni206
This PR adds some functions that are missing in the python API, along with unit tests for them. The unit tests are translated from https://github.com/cvc5/cvc5/blob/master/test/unit/api/term_black.cpp
2021-05-13Fix error message in toPythonObj (#6524)Alex Ozdemir
2021-05-12Ensure sequences of Booleans generate Boolean term variable skolems when ↵Andrew Reynolds
applicable (#6529) Fixes #6510. This PR also eliminates a deprecated variant mkBooleanTermVariable from SkolemManager.
2021-05-12Use signal(sig, SIG_DFL); raise(sig); instead of abort() (#6518)Gereon Kremer
As discussed in #6484 (and https://www.gnu.org/software/libc/manual/html_node/Termination-in-Handler.html), simply calling std::abort at the end of a custom signal handler seems to be bad practice. As suggested, this PR changes these calls to instead first reset to the default signal handler for the given signal, and then calling it. Fixes #6484.
2021-05-10Remove header for option modules (#6514)Gereon Kremer
This PR further simplifies the option declaration by removing the header attribute from module options. Instead of specifying it manually, it is now automatically generated from the filename of the toml file. The header files and the toml files use matching names already, so this PR simply removes another mechanism that is not used anyway. This PR also does a minor cleanup of the Options class in the mkoptions.py script.
2021-05-10Remove read_only from options. (#6513)Gereon Kremer
This PR removes the possibility of declaring options read_only. It's only effect is making an attempts to disallow changing the respective option from within our internal code (by not providing a setter method). However, a "read-only" option can still be set via the setOption() methods that is also used by the API, and by SMT-LIB's set-option.
2021-05-10Unify top-level substitutions and model substitutions (#6499)Andrew Reynolds
This unifies top-level substitutions and theory model substitutions. Env is now passed to the TheoryModel, which has access to top-level substitutions. The former was used for simplfying assertions in the preprocessor, the latter was used for evaluating terms in the model. There is no reason to have these two things be separate.
2021-05-10Add doc to Kind.java (#6498)mudathirmahgoub
This PR adds documentation to java kinds.
2021-05-08Adding functions to the python API and testing them (#6477)yoni206
This PR adds some functions that are missing in the python API, along with unit tests for them. Subsequent PR will include additional missing functions. Also includes a yapf run to reformat the test file. Co-authored-by: Makai Mann makaim@stanford.edu
2021-05-07Add support for datatype update (#6449)Andrew Reynolds
This removes the special case of TUPLE_UPDATE and RECORD_UPDATE in favor of the more general datatype update. Datatype update is handled analogously to APPLY_SELECTOR / APPLY_TESTER.
2021-05-07Properly printing INST_PATTERN_LIST by itself (#6507)Haniel Barbosa
Previously the SMT2 printer would print pattern lists wrong when they were not printed as part of a binder containing it. This commit fixes this by removing an unused hardcoded restriction that led to issues when printing the ASTs of proof nodes containing patterns.
2021-05-07Simplifications to expand definitions (#6487)Andrew Reynolds
This removes the expandOnly flag from expandDefinitions. The use of expandOnly = true is equivalent to applying top-level substitutions only, which should be done explicitly via Env::getTopLevelSubstitutions. It updates the trust substitutions utility to distinguish apply vs applyTrusted for convenience for this purpose. This also breaks several dependencies in e.g. expand definitions module.
2021-05-07Fix for toPythonObj of integer value with real sort (#6505)makaimann
2021-05-06[proof-new] Updating documentation for Subs/Rw ids (#6502)Haniel Barbosa
2021-05-06Discard duplicate terms in patterns (#6501)Andrew Reynolds
Fixes #6495.
2021-05-06Use constant folding for evaluating BV eager atom (#6494)Andrew Reynolds
This is work towards unifying top-level substitutions with model substitutions. Currently, for model evaluation, BV eager atom preprocessing pass adds mappings (BV_EAGER_ATOM X) -> X to say how (BV_EAGER_ATOM X) should be evaluated in the model. This is not necessary since a rewrite rule (BV_EAGER_ATOM c) -> c for constant c would suffice. This eliminates the call to addModelSubstitution in that preprocessing pass. It also makes it so that we don't make true/false themselves into eager atoms.
2021-05-05Do not have quantifiers model inherit from theory model (#6493)Andrew Reynolds
This is work towards making the initialization of theory engine, theory models, quantifiers engine more flexible. This makes it so that the specialized quantifiers models classes (FirstOrderModel) do not inherit from TheoryModel. There is no longer any reason for this, since FirstOrderModel does not have any override methods. As a result of this PR, there is only one kind of TheoryModel and it is constructed immediately when ModelManager is constructed. This required refactoring the initialization of when FirstOrderModel is constructed in ModelBuilder classes in quantifiers. This also avoids the need for casting TheoryModel to FirstOrderModel.
2021-05-05Save block comments associated with each kind when parsing kinds file (#6489)makaimann
This PR adds features to the KindsParser for saving and looking up the documentation comment associated with each Kind. This PR does not make use of it yet, but future PRs can query for the comment to automatically add it to language binding documentation (e.g., Python / Java bindings).
2021-05-05Add helper functions for multi-objective optimization + refactoring (#6473)Ouyancheng
add 3 helper functions judge whether a node is optimizable make strong improvement expression according to optimization objective make weak improvement expression according to optimization objective optChecker is now created by optimizationSolver instead of the minimize/maximize functions Slightly refactors function signatures so that they are accepting OptimizationObjective instead of accepting target, type in separate parameters.
2021-05-04Move current decision engine to decision engine old (#6466)Andrew Reynolds
The decision engine is the class that contains strategies for doing e.g. justification heuristic. The current implementation is hardcoded for the old implementation of justification heuristic. Since both implementations will be maintained in the short term, this splits the parts of DecisionEngine that are specific to the old implementation to a class DecisionEngineOld. It refactors the interface of DecisionEngine in a way that is compatible with both implementations.
2021-05-04Move env into smt solver, theory engine, prop engine (#6486)Andrew Reynolds
This is work towards eliminating singletons. Also, TheoryModel should use the same substitution map as the preprocessor. This is work towards unifying these things, which will be done in a future PR.
2021-05-04Do not use proof CNF stream with assumptions-based cores (#6488)Haniel Barbosa
Previously using proof CNF stream together with assumptions-based unsat cores added unnecessary performance overhead. Co-authored-by: Mathias Preiner mathias.preiner@gmail.com
2021-05-04Improve generation of python API documentation (#6482)Gereon Kremer
This PR makes generating the python part of our API documentation more reliable. If python bindings are enabled, it makes the docs target depend on pycvc5 and renders a warning into the documentation if python bindings are disabled. To make the dependency on pycvc5 work properly, it changes the python bindings build so that the library is directly put in the right place and avoid the manual rename, so that the pycvc5 target actually points to the correct file. Unfortunately, this means we need to build libcvc5 when building docs with python bindings enabled.
2021-05-04FP: Move removal of generic to_fp operations to rewriter. (#6480)Aina Niemetz
2021-05-04FP: Move type check from expandDefinitions. (#6479)Aina Niemetz
2021-05-03FP: Rewrite to_fp conversion from signed bit-vector. (#6472)Aina Niemetz
SymFPU does not allow to_fp conversion from signed bv of size 1. This adds rewrites for this case. Rewrites for the constant and the non-constant cases were tested in isolation.
2021-04-30bv: Refactor ppAssert and move to TheoryBV. (#6470)Mathias Preiner
This PR refactors ppAssert from the lazy BV solver and moves it to TheoryBV.
2021-04-30Add parameter name for argument `isPreRewrite` for FP rewrites. (#6469)Aina Niemetz
2021-04-30Refactor optimization result and objective classes + add preliminary support ↵Ouyancheng
for multiple objectives (#6459) This PR is one part of multiple. Preliminary support means currently only supports single objective. It supports queue-ing up objectives and it always optimizes the first. Multiple-obj optimization algorithm will be up next. * Refactor optimization result and objective classes * Add preliminary support for multiple objectives * The unit tests are now comparing node values instead of node addresses
2021-04-30Use substitutions for implementing defined functions (#6437)Andrew Reynolds
This eliminates explicit tracking of defined functions, and instead makes define-fun add to preprocessing substitutions. In other words, the effect of: (define-fun f X t) is to add f -> (lambda X t) to the set of substitutions known by the preprocessor. This is essentially the same as when (= f (lambda X t)) was an equality solved by non-clausal simplification The motivation for this change is both uniformity and for performance, as fewer traversals of the input formula. In this PR: define-fun are now conceptually higher-order equalities provided to smt::Assertions. These assertions are always added as substitutions instead of being pushed to AssertionPipeline. Top-level substitutions are moved from PreprocessingContext to Env, since they must be accessed by Assertions. Proofs for this class are enabled dynamically during SmtEngine::finishInit. The expandDefinitions preprocessing step is replaced by apply-substs. The process assertions module no longer needs access to expand definitions. The proof manager does not require a special case of using the define-function maps. Define-function maps are eliminated from SmtEngine. Further work will reorganize the relationship between the expand definitions module and the rewriter, after which global calls to SmtEngine::expandDefinitions can be cleaned up. There is also further work necessary to better integrate theory expand definitions and top-level substitutions, which will be done on a followup PR.
2021-04-29Add assertion list utility for justification heuristic (#6414)Andrew Reynolds
2021-04-29Simplify generated code for getOption() and setOption() (#6462)Gereon Kremer
This PR simplifies the generated code for Options::getOption() and Options::setOption(). It now uses less string streams, less temporary vectors and the new options[...] syntax (instead of options::...().
2021-04-29Add missing include. (#6463)Gereon Kremer
This PR fixes an issue with one of our nightlies.
2021-04-29Avoid exponential explosion of small constant in CEGQI (#6461)Gereon Kremer
This PR fixes an issue that can lead to an exponential explosion of a rational constant for repeated calls to the cegqi instantiation strategy. The d_small_const variable was squared regularly, we now simply multiply it with its original value.
2021-04-28Fix BV Optimization Boundary Condition when lower bound = upper bound + 1 ↵Ouyancheng
(#6452) If lb = ub + 1 then (lb+ub)/2 =pivot == lb since it's rounding to -infinity. and lb <= x < pivot will always be UNSAT. We need to handle this differently. And this only happens in minimization.
2021-04-28Refactor resource manager options (#6446)Gereon Kremer
This PR refactors how the resource manager options are used. It moves options relevant for the resource manager into its own file (making the number of smt options a bit smaller) and uses the Options object directly instead of using the old static accessors.
2021-04-28Remove exception headers from options.h (#6456)Gereon Kremer
This PR removes two headers for exceptions from options.h, and instead pushes the includes to a couple of source files.
2021-04-28Make sure reference stats are reset properly (#6457)Gereon Kremer
This PR adds a reset() method to the ReferenceStat class. It then uses it to properly reset such statistics in the minisat solvers where lifetime is an issue.
2021-04-28Clean up options holder class (#6458)Gereon Kremer
This PR does some cleanup on the options class: it puts the option defaults into the member declaration and removes the explicit constructor; it puts the holder into a unique_ptr; it uses the regular struct copy operation instead of reconstructing the holder object; it moves some macros required for option defaults into the option holder header. Also, this PR removes some obsolete code related to suggestions for typos.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback