diff options
author | Martin Brain <> | 2014-03-11 00:03:41 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@cs.nyu.edu> | 2014-03-19 16:55:22 -0400 |
commit | 9d855960ba88c9b476ab1be17b7686c009f516f5 (patch) | |
tree | 143f12b95eb7563b3186658c20c8fa45236b2aa4 /src/smt/logic_request.h | |
parent | ea22ebcbd69b24906d2214b7d294261578ce67a7 (diff) |
Refactor the theory specific parts of definition expansion into the theory solvers.
In the process of doing this I may have fixed some bugs or some potential bugs so there
may be some user visible results of this refactoring.
Signed-off-by: Morgan Deters <mdeters@cs.nyu.edu>
Diffstat (limited to 'src/smt/logic_request.h')
-rw-r--r-- | src/smt/logic_request.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/smt/logic_request.h b/src/smt/logic_request.h new file mode 100644 index 000000000..4985b0e65 --- /dev/null +++ b/src/smt/logic_request.h @@ -0,0 +1,53 @@ +/********************* */ +/*! \file logic_request.h + ** \verbatim + ** Original author: Morgan Deters + ** Major contributors: none + ** Minor contributors (to current version): none + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2014 New York University and The University of Iowa + ** See the file COPYING in the top-level source directory for licensing + ** information.\endverbatim + ** + ** \brief An object to request logic widening in the running SmtEngine + ** + ** An object to request logic widening in the running SmtEngine. This + ** class exists as a proxy between theory code and the SmtEngine, allowing + ** a theory to enable another theory in the SmtEngine after initialization + ** (thus the usual, public setLogic() cannot be used). This is mainly to + ** support features like uninterpreted divide-by-zero (to support the + ** partial function DIVISION), where during theory expansion, the theory + ** of uninterpreted functions needs to be added to the logic to support + ** partial functions. + **/ + +#include "cvc4_private.h" + +#ifndef __CVC4__LOGIC_REQUEST_H +#define __CVC4__LOGIC_REQUEST_H + +#include "expr/kind.h" +#include "smt/smt_engine.h" + +namespace CVC4 { + +class LogicRequest { + /** The SmtEngine at play. */ + SmtEngine& d_smt; + +public: + LogicRequest(SmtEngine& smt) : d_smt(smt) { } + + /** Widen the logic to include the given theory. */ + void widenLogic(theory::TheoryId id) { + d_smt.d_logic.getUnlockedCopy(); + d_smt.d_logic = d_smt.d_logic.getUnlockedCopy(); + d_smt.d_logic.enableTheory(id); + d_smt.d_logic.lock(); + } + +};/* class LogicRequest */ + +}/* CVC4 namespace */ + +#endif /* __CVC4__LOGIC_REQUEST_H */ |