1 /********************* */
2 /*! \file smt_engine_subsolver.h
4 ** Top contributors (to current version):
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 Utilities for initializing subsolvers (copies of SmtEngine) during
16 #include "cvc4_private.h"
18 #ifndef CVC4__THEORY__SMT_ENGINE_SUBSOLVER_H
19 #define CVC4__THEORY__SMT_ENGINE_SUBSOLVER_H
25 #include "expr/node.h"
26 #include "smt/smt_engine.h"
32 * This function initializes the smt engine smte to check the satisfiability
33 * of the argument "query". It takes the logic and options of the current
34 * SMT engine in scope.
36 * Notice this method intentionally does not fully initialize smte. This means
37 * that the options of smte can still be modified after it is returned by
40 * Notice that some aspects of subsolvers are not incoporated by this call.
41 * For example, the type of separation logic heaps is not set on smte, even
42 * if the current SMT engine has declared a separation logic heap.
44 * @param smte The smt engine pointer to initialize
45 * @param needsTimeout Whether we would like to set a timeout
46 * @param timeout The timeout (in milliseconds)
48 void initializeSubsolver(std::unique_ptr
<SmtEngine
>& smte
,
49 bool needsTimeout
= false,
50 unsigned long timeout
= 0);
53 * This returns the result of checking the satisfiability of formula query.
55 * If necessary, smte is initialized to the SMT engine that checked its
58 Result
checkWithSubsolver(std::unique_ptr
<SmtEngine
>& smte
,
60 bool needsTimeout
= false,
61 unsigned long timeout
= 0);
64 * This returns the result of checking the satisfiability of formula query.
66 * In contrast to above, this is used if the user of this method is not
67 * concerned with the state of the SMT engine after the check.
69 * @param query The query to check
70 * @param needsTimeout Whether we would like to set a timeout
71 * @param timeout The timeout (in milliseconds)
73 Result
checkWithSubsolver(Node query
,
74 bool needsTimeout
= false,
75 unsigned long timeout
= 0);
78 * This returns the result of checking the satisfiability of formula query.
79 * Additionally, if the query is satisfiable, it adds the model values for vars
82 * @param query The query to check
83 * @param vars The variables we are interesting in getting a model for.
84 * @param modelVals A vector storing the model values of variables in vars.
85 * @param needsTimeout Whether we would like to set a timeout
86 * @param timeout The timeout (in milliseconds)
88 Result
checkWithSubsolver(Node query
,
89 const std::vector
<Node
>& vars
,
90 std::vector
<Node
>& modelVals
,
91 bool needsTimeout
= false,
92 unsigned long timeout
= 0);
97 #endif /* CVC4__THEORY__SMT_ENGINE_SUBSOLVER_H */