1 /********************* */
2 /*! \file exponential_solver.h
4 ** Top contributors (to current version):
5 ** Andrew Reynolds, Tim King
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2020 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.\endverbatim
12 ** \brief Solving for handling exponential function.
15 #ifndef CVC4__THEORY__ARITH__NL__TRANSCENDENTAL__EXPONENTIAL_SOLVER_H
16 #define CVC4__THEORY__ARITH__NL__TRANSCENDENTAL__EXPONENTIAL_SOLVER_H
19 #include <unordered_map>
20 #include <unordered_set>
23 #include "expr/node.h"
24 #include "theory/arith/inference_manager.h"
25 #include "theory/arith/nl/nl_model.h"
26 #include "theory/arith/nl/transcendental/transcendental_state.h"
32 namespace transcendental
{
34 /** Transcendental solver class
36 * This class implements model-based refinement schemes
37 * for transcendental functions, described in:
39 * - "Satisfiability Modulo Transcendental
40 * Functions via Incremental Linearization" by Cimatti
43 * It's main functionality are methods that implement lemma schemas below,
44 * which return a set of lemmas that should be sent on the output channel.
46 class ExponentialSolver
49 ExponentialSolver(TranscendentalState
* tstate
);
52 void initLastCall(const std::vector
<Node
>& assertions
,
53 const std::vector
<Node
>& false_asserts
,
54 const std::vector
<Node
>& xts
);
57 * check initial refine
59 * Constructs a set of valid theory lemmas, based on
60 * simple facts about the exponential function.
61 * This mostly follows the initial axioms described in
62 * Section 4 of "Satisfiability
63 * Modulo Transcendental Functions via Incremental
64 * Linearization" by Cimatti et al., CADE 2017.
71 void checkInitialRefine();
76 * Constructs a set of valid theory lemmas, based on a
77 * lemma scheme that ensures that applications
78 * of the exponential function respect monotonicity.
82 * x > y => exp( x ) > exp( y )
84 void checkMonotonic();
86 /** Sent tangent lemma around c for e */
87 void doTangentLemma(TNode e
, TNode c
, TNode poly_approx
);
89 /** Sent secant lemmas around c for e */
90 void doSecantLemmas(TNode e
, TNode c
, TNode poly_approx
, unsigned d
);
93 /** Generate bounds for secant lemmas */
94 std::pair
<Node
, Node
> getSecantBounds(TNode e
, TNode c
, unsigned d
);
96 /** Holds common state for transcendental solvers */
97 TranscendentalState
* d_data
;
99 /** The transcendental functions we have done initial refinements on */
100 std::map
<Node
, bool> d_tf_initial_refine
;
102 }; /* class ExponentialSolver */
104 } // namespace transcendental
107 } // namespace theory
110 #endif /* CVC4__THEORY__ARITH__TRANSCENDENTAL_SOLVER_H */