Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * This file is part of the cvc5 project. 3 : : * 4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS 5 : : * in the top-level source directory and their institutional affiliations. 6 : : * All rights reserved. See the file COPYING in the top-level source 7 : : * directory for licensing information. 8 : : * **************************************************************************** 9 : : * 10 : : * The solver for SMT queries in an SolverEngine. 11 : : */ 12 : : 13 : : #include "cvc5_private.h" 14 : : 15 : : #ifndef CVC5__SMT__SMT_DRIVER_DEEP_RESTARTS_H 16 : : #define CVC5__SMT__SMT_DRIVER_DEEP_RESTARTS_H 17 : : 18 : : #include "smt/smt_driver.h" 19 : : #include "util/result.h" 20 : : 21 : : namespace cvc5::internal { 22 : : namespace smt { 23 : : 24 : : class SmtSolver; 25 : : class ContextManager; 26 : : 27 : : /** 28 : : * An SMT driver that is based on deep restarts. 29 : : * 30 : : * The idea of this SMT driver is to call the SMT solver with all assertions 31 : : * with learned literal tracking enabled, and where it terminates with 32 : : * "unknown" if: 33 : : * - at least one literal has been learned, and 34 : : * - no literal has been learned after some threshold. 35 : : * In this case, we preprocess and checkSat again where the SMT solver has 36 : : * its PropEngine and TheoryEngine reset. 37 : : */ 38 : : class SmtDriverDeepRestarts : public SmtDriver 39 : : { 40 : : public: 41 : : SmtDriverDeepRestarts(Env& env, SmtSolver& smt, ContextManager* ctx); 42 : 16 : virtual ~SmtDriverDeepRestarts(){} 43 : : 44 : : protected: 45 : : Result checkSatNext(preprocessing::AssertionPipeline& ap) override; 46 : : void getNextAssertions(preprocessing::AssertionPipeline& ap) override; 47 : : 48 : : private: 49 : : /** first time? */ 50 : : bool d_firstTime; 51 : : /** The current learned literals */ 52 : : std::vector<Node> d_zll; 53 : : /** All learned literals, used for debugging */ 54 : : std::unordered_set<Node> d_allLearnedLits; 55 : : }; 56 : : 57 : : } // namespace smt 58 : : } // namespace cvc5::internal 59 : : 60 : : #endif