a810d9d537b32af18623079728040a2b75b13678
1 /******************************************************************************
2 * Top contributors (to current version):
3 * Andrew Reynolds, Tim King, Gereon Kremer
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 * The extended theory callback for non-linear arithmetic.
16 #ifndef CVC5__THEORY__ARITH__NL__EXT_THEORY_CALLBACK_H
17 #define CVC5__THEORY__ARITH__NL__EXT_THEORY_CALLBACK_H
19 #include "expr/node.h"
20 #include "theory/ext_theory.h"
30 class NlExtTheoryCallback
: public ExtTheoryCallback
33 NlExtTheoryCallback(eq::EqualityEngine
* ee
);
34 ~NlExtTheoryCallback() {}
35 /** Get current substitution
37 * This function and the one below are
38 * used for context-dependent
39 * simplification, see Section 3.1 of
40 * "Designing Theory Solvers with Extensions"
41 * by Reynolds et al. FroCoS 2017.
43 * effort : an identifier indicating the stage where
44 * we are performing context-dependent simplification,
45 * vars : a set of arithmetic variables.
47 * This function populates subs and exp, such that for 0 <= i < vars.size():
48 * ( exp[vars[i]] ) => vars[i] = subs[i]
49 * where exp[vars[i]] is a set of assertions
50 * that hold in the current context. We call { vars -> subs } a "derivable
51 * substituion" (see Reynolds et al. FroCoS 2017).
53 bool getCurrentSubstitution(int effort
,
54 const std::vector
<Node
>& vars
,
55 std::vector
<Node
>& subs
,
56 std::map
<Node
, std::vector
<Node
>>& exp
) override
;
57 /** Is the term n in reduced form?
59 * Used for context-dependent simplification.
61 * effort : an identifier indicating the stage where
62 * we are performing context-dependent simplification,
63 * on : the original term that we reduced to n,
64 * exp : an explanation such that ( exp => on = n ).
66 * We return a pair ( b, exp' ) such that
68 * n is in reduced form
69 * if exp' is non-null, then ( exp' => on = n )
70 * The second part of the pair is used for constructing
71 * minimal explanations for context-dependent simplifications.
73 bool isExtfReduced(int effort
,
76 std::vector
<Node
>& exp
,
77 ExtReducedId
& id
) override
;
80 /** The underlying equality engine. */
81 eq::EqualityEngine
* d_ee
;
82 /** Commonly used nodes */
91 #endif /* CVC5__THEORY__ARITH__NL__EXT_THEORY_CALLBACK_H */