Towards setting up the proper callbacks into the new justification heuristic.
Moves ownership of skolem definition manager from TheoryProxy to PropEngine.
using namespace std;
namespace cvc5 {
+namespace decision {
DecisionEngine::DecisionEngine(context::Context* sc,
context::UserContext* uc,
}
}
+}
} // namespace cvc5
using namespace cvc5::decision;
namespace cvc5 {
+namespace decision {
class DecisionEngine {
std::unique_ptr<ITEDecisionStrategy> d_enabledITEStrategy;
};/* DecisionEngine class */
+}
} // namespace cvc5
#endif /* CVC5__DECISION__DECISION_ENGINE_H */
namespace cvc5 {
-class DecisionEngine;
-
namespace context {
class Context;
} // namespace context
namespace decision {
+
+class DecisionEngine;
class DecisionStrategy {
protected:
namespace cvc5 {
namespace decision {
-JustificationHeuristic::JustificationHeuristic(cvc5::DecisionEngine* de,
+JustificationHeuristic::JustificationHeuristic(DecisionEngine* de,
context::UserContext* uc,
context::Context* c)
: ITEDecisionStrategy(de, c),
};
public:
- JustificationHeuristic(cvc5::DecisionEngine* de,
+ JustificationHeuristic(DecisionEngine* de,
context::UserContext* uc,
context::Context* c);
: d_inCheckSat(false),
d_theoryEngine(te),
d_context(satContext),
+ d_skdm(new SkolemDefManager(satContext, userContext)),
d_theoryProxy(nullptr),
d_satSolver(nullptr),
d_pnm(pnm),
d_theoryProxy = new TheoryProxy(this,
d_theoryEngine,
d_decisionEngine.get(),
+ d_skdm.get(),
satContext,
userContext,
pnm);
#include "context/cdlist.h"
#include "expr/node.h"
+#include "prop/skolem_def_manager.h"
#include "theory/output_channel.h"
#include "theory/trust_node.h"
#include "util/result.h"
namespace cvc5 {
class ResourceManager;
-class DecisionEngine;
class OutputManager;
class ProofNodeManager;
class TheoryEngine;
+namespace decision {
+class DecisionEngine;
+}
+
namespace prop {
class CnfStream;
TheoryEngine* d_theoryEngine;
/** The decision engine we will be using */
- std::unique_ptr<DecisionEngine> d_decisionEngine;
+ std::unique_ptr<decision::DecisionEngine> d_decisionEngine;
/** The context */
context::Context* d_context;
+ /** The skolem definition manager */
+ std::unique_ptr<SkolemDefManager> d_skdm;
+
/** SAT solver's proxy back to theories; kept around for dtor cleanup */
TheoryProxy* d_theoryProxy;
TNode SkolemDefManager::getDefinitionForSkolem(TNode skolem) const
{
NodeNodeMap::const_iterator it = d_skDefs.find(skolem);
- AlwaysAssert(it != d_skDefs.end()) << "No skolem def for " << skolem;
+ Assert(it != d_skDefs.end()) << "No skolem def for " << skolem;
return it->second;
}
void SkolemDefManager::notifyAsserted(TNode literal,
- std::vector<TNode>& activatedSkolems)
+ std::vector<TNode>& activatedSkolems,
+ bool useDefs)
{
std::unordered_set<Node, NodeHashFunction> skolems;
getSkolems(literal, skolems);
continue;
}
d_skActive.insert(k);
- // add to the activated list
- activatedSkolems.push_back(k);
+ if (useDefs)
+ {
+ // add its definition to the activated list
+ NodeNodeMap::const_iterator it = d_skDefs.find(k);
+ Assert(it != d_skDefs.end());
+ activatedSkolems.push_back(it->second);
+ }
+ else
+ {
+ // add to the activated list
+ activatedSkolems.push_back(k);
+ }
}
}
* Notify that the given literal has been asserted. This method adds skolems
* that become "active" as a result of asserting this literal. A skolem
* is active in the SAT context if it appears in an asserted literal.
+ *
+ * @param literal The literal that became asserted
+ * @param activatedSkolems The list to add skolems to
+ * @param useDefs If this flag is true, we add the skolem definition for
+ * skolems to activatedSkolems instead of the skolem itself.
*/
- void notifyAsserted(TNode literal, std::vector<TNode>& activatedSkolems);
+ void notifyAsserted(TNode literal,
+ std::vector<TNode>& activatedSkolems,
+ bool useDefs = false);
/**
* Get the set of skolems maintained by this class that occur in node n,
#include "proof/cnf_proof.h"
#include "prop/cnf_stream.h"
#include "prop/prop_engine.h"
+#include "prop/skolem_def_manager.h"
#include "smt/smt_statistics_registry.h"
#include "theory/rewriter.h"
#include "theory/theory_engine.h"
TheoryProxy::TheoryProxy(PropEngine* propEngine,
TheoryEngine* theoryEngine,
- DecisionEngine* decisionEngine,
+ decision::DecisionEngine* decisionEngine,
+ SkolemDefManager* skdm,
context::Context* context,
context::UserContext* userContext,
ProofNodeManager* pnm)
d_theoryEngine(theoryEngine),
d_queue(context),
d_tpp(*theoryEngine, userContext, pnm),
- d_skdm(new SkolemDefManager(context, userContext))
+ d_skdm(skdm)
{
}
#include "expr/node.h"
#include "prop/registrar.h"
#include "prop/sat_solver_types.h"
-#include "prop/skolem_def_manager.h"
#include "theory/theory.h"
#include "theory/theory_preprocessor.h"
#include "theory/trust_node.h"
namespace cvc5 {
+namespace decision {
class DecisionEngine;
+}
class TheoryEngine;
namespace prop {
class PropEngine;
class CnfStream;
+class SkolemDefManager;
/**
* The proxy class that allows the SatSolver to communicate with the theories
public:
TheoryProxy(PropEngine* propEngine,
TheoryEngine* theoryEngine,
- DecisionEngine* decisionEngine,
+ decision::DecisionEngine* decisionEngine,
+ SkolemDefManager* skdm,
context::Context* context,
context::UserContext* userContext,
ProofNodeManager* pnm);
CnfStream* d_cnfStream;
/** The decision engine we are using. */
- DecisionEngine* d_decisionEngine;
+ decision::DecisionEngine* d_decisionEngine;
/** The theory engine we are using. */
TheoryEngine* d_theoryEngine;
theory::TheoryPreprocessor d_tpp;
/** The skolem definition manager */
- std::unique_ptr<SkolemDefManager> d_skdm;
+ SkolemDefManager* d_skdm;
}; /* class TheoryProxy */
} // namespace prop