1 /******************************************************************************
2 * Top contributors (to current version):
5 * This file is part of the cvc5 project.
7 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8 * in the top-level source directory and their institutional affiliations.
9 * All rights reserved. See the file COPYING in the top-level source
10 * directory for licensing information.
11 * ****************************************************************************
13 * CAD-based solver based on https://arxiv.org/pdf/2003.05633.pdf.
16 #ifndef CVC5__THEORY__ARITH__CAD_SOLVER_H
17 #define CVC5__THEORY__ARITH__CAD_SOLVER_H
21 #include "context/context.h"
22 #include "expr/node.h"
23 #include "theory/arith/nl/cad/cdcac.h"
24 #include "theory/arith/nl/cad/proof_checker.h"
28 class ProofNodeManager
;
33 class InferenceManager
;
40 * A solver for nonlinear arithmetic that implements the CAD-based method
41 * described in https://arxiv.org/pdf/2003.05633.pdf.
46 CadSolver(Env
& env
, InferenceManager
& im
, NlModel
& model
);
50 * This is called at the beginning of last call effort check, where
51 * assertions are the set of assertions belonging to arithmetic,
52 * false_asserts is the subset of assertions that are false in the current
53 * model, and xts is the set of extended function terms that are active in
54 * the current context.
56 void initLastCall(const std::vector
<Node
>& assertions
);
59 * Perform a full check, returning either {} or a single lemma.
60 * If the result is empty, the input is satisfiable and a model is available
61 * for construct_model_if_available. Otherwise, the single lemma can be used
62 * as an infeasible subset.
67 * Perform a partial check, returning either {} or a list of lemmas.
68 * If the result is empty, the input is satisfiable and a model is available
69 * for construct_model_if_available. Otherwise, the lemmas exclude some part
70 * of the search space.
75 * If a model is available (indicated by the last call to check_full() or
76 * check_partial()) this method puts a satisfying assignment in d_model,
77 * clears the list of assertions, and returns true.
78 * Otherwise, this method returns false.
80 bool constructModelIfAvailable(std::vector
<Node
>& assertions
);
84 * The variable used to encode real algebraic numbers to nodes.
90 * The object implementing the actual decision procedure.
93 /** The proof checker for cad proofs */
94 cad::CADProofRuleChecker d_proofChecker
;
97 * Indicates whether we found satisfiability in the last call to
100 bool d_foundSatisfiability
;
102 /** The inference manager we are pushing conflicts and lemmas to. */
103 InferenceManager
& d_im
;
104 /** Reference to the non-linear model object */
106 }; /* class CadSolver */
110 } // namespace theory
113 #endif /* CVC5__THEORY__ARITH__CAD_SOLVER_H */