1 /********************* */
2 /*! \file smt_globals.h
4 ** Original author: Tim King
5 ** Major contributors: none
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2015 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
12 ** \brief SmtGlobals is a light container for psuedo-global datastructures
13 ** that are set by the user.
15 ** SmtGlobals is a light container for psuedo-global datastructures
16 ** that are set by the user. These contain paramaters for infrequently
17 ** used modes: Portfolio and Replay. There should be exactly one of these
18 ** per SmtEngine with the same lifetime as the SmtEngine.
19 ** A user directly passes these as pointers and is resonsible for cleaning up
22 ** Basically, the problem this class is solving is that previously these were
23 ** using smt_options.h and the Options class as globals for these same
26 ** This class is NOT a good long term solution, but is a reasonable stop gap.
29 #include "cvc4_public.h"
31 #ifndef __CVC4__SMT__SMT_GLOBALS_H
32 #define __CVC4__SMT__SMT_GLOBALS_H
38 #include "expr/expr_stream.h"
39 #include "options/option_exception.h"
40 #include "smt_util/lemma_input_channel.h"
41 #include "smt_util/lemma_output_channel.h"
46 * SmtGlobals is a wrapper around 4 pointers:
49 * - getLemmaInputChannel()
50 * - getLemmaOutputChannel()
52 * The user can directly set these and is responsible for handling the
53 * memory for these. These datastructures are used for the Replay and Portfolio
56 class CVC4_PUBLIC SmtGlobals
{
58 /** Creates an empty SmtGlobals with all 4 pointers initially NULL. */
62 /** This setsReplayLog based on --replay-log */
63 void parseReplayLog(std::string optarg
) throw (OptionException
);
64 void setReplayLog(std::ostream
*);
65 std::ostream
* getReplayLog() { return d_replayLog
; }
67 void setReplayStream(ExprStream
* stream
);
68 ExprStream
* getReplayStream() { return d_replayStream
; }
70 void setLemmaInputChannel(LemmaInputChannel
* in
);
71 LemmaInputChannel
* getLemmaInputChannel() { return d_lemmaInputChannel
; }
73 void setLemmaOutputChannel(LemmaOutputChannel
* out
);
74 LemmaOutputChannel
* getLemmaOutputChannel() { return d_lemmaOutputChannel
; }
77 // Disable copy constructor.
78 SmtGlobals(const SmtGlobals
&) CVC4_UNDEFINED
;
80 // Disable assignment operator.
81 SmtGlobals
& operator=(const SmtGlobals
&) CVC4_UNDEFINED
;
83 static std::pair
<bool, std::ostream
*>
84 checkReplayLogFilename(std::string optarg
) throw (OptionException
);
87 * d_gcReplayLog is true iff d_replayLog was allocated by parseReplayLog.
91 /** This captures the old options::replayLog .*/
92 std::ostream
* d_replayLog
;
94 /** This captures the old options::replayStream .*/
95 ExprStream
* d_replayStream
;
97 /** This captures the old options::lemmaInputChannel .*/
98 LemmaInputChannel
* d_lemmaInputChannel
;
100 /** This captures the old options::lemmaOutputChannel .*/
101 LemmaOutputChannel
* d_lemmaOutputChannel
;
102 }; /* class SmtGlobals */
104 } /* namespace CVC4 */
106 #endif /* __CVC4__SMT__SMT_GLOBALS_H */