Refactor and update copyright headers. (#6316)
[cvc5.git] / src / main / interactive_shell.h
1 /******************************************************************************
2 * Top contributors (to current version):
3 * Morgan Deters, Christopher L. Conway, Mathias Preiner
4 *
5 * This file is part of the cvc5 project.
6 *
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 * ****************************************************************************
12 *
13 * Interactive shell for cvc5.
14 */
15
16 #ifndef CVC5__INTERACTIVE_SHELL_H
17 #define CVC5__INTERACTIVE_SHELL_H
18
19 #include <iosfwd>
20 #include <string>
21
22 #include "options/language.h"
23 #include "options/options.h"
24 #include "util/unsafe_interrupt_exception.h"
25
26 namespace cvc5 {
27
28 class Command;
29 class Options;
30
31 namespace api {
32 class Solver;
33 }
34
35 namespace parser {
36 class Parser;
37 } // namespace parser
38
39 class SymbolManager;
40
41 class InteractiveShell
42 {
43 const Options& d_options;
44 std::istream& d_in;
45 std::ostream& d_out;
46 parser::Parser* d_parser;
47 bool d_quit;
48 bool d_usingEditline;
49
50 std::string d_historyFilename;
51
52 static const std::string INPUT_FILENAME;
53 static const unsigned s_historyLimit = 500;
54
55 public:
56 InteractiveShell(api::Solver* solver, SymbolManager* sm);
57
58 /**
59 * Close out the interactive session.
60 */
61 ~InteractiveShell();
62
63 /**
64 * Read a command from the interactive shell. This will read as
65 * many lines as necessary to parse a well-formed command.
66 */
67 Command* readCommand();
68
69 /**
70 * Return the internal parser being used.
71 */
72 parser::Parser* getParser() { return d_parser; }
73
74 };/* class InteractiveShell */
75
76 } // namespace cvc5
77
78 #endif /* CVC5__INTERACTIVE_SHELL_H */