const LogicInfo& logicInfo)
: Theory(THEORY_SETS, c, u, out, valuation, logicInfo),
d_internal(new TheorySetsPrivate(*this, c, u))
-{}
+{
+ // Do not move me to the header.
+ // The constructor + destructor are not in the header as d_internal is a
+ // unique_ptr<TheorySetsPrivate> and TheorySetsPrivate is an opaque type in
+ // the header (Pimpl). See https://herbsutter.com/gotw/_100/ .
+}
-TheorySets::~TheorySets() {
- delete d_internal;
+TheorySets::~TheorySets()
+{
+ // Do not move me to the header. See explanation in the constructor.
}
void TheorySets::addSharedTerm(TNode n) {
#ifndef __CVC4__THEORY__SETS__THEORY_SETS_H
#define __CVC4__THEORY__SETS__THEORY_SETS_H
+#include <memory>
+
#include "theory/theory.h"
#include "theory/uf/equality_engine.h"
class TheorySetsPrivate;
class TheorySetsScrutinize;
-class TheorySets : public Theory {
-private:
- friend class TheorySetsPrivate;
- friend class TheorySetsScrutinize;
- friend class TheorySetsRels;
- TheorySetsPrivate* d_internal;
-public:
-
- /**
- * Constructs a new instance of TheorySets w.r.t. the provided
- * contexts.
- */
- TheorySets(context::Context* c, context::UserContext* u, OutputChannel& out,
- Valuation valuation, const LogicInfo& logicInfo);
-
- ~TheorySets();
+class TheorySets : public Theory
+{
+ public:
+ /** Constructs a new instance of TheorySets w.r.t. the provided contexts. */
+ TheorySets(context::Context* c,
+ context::UserContext* u,
+ OutputChannel& out,
+ Valuation valuation,
+ const LogicInfo& logicInfo);
+ ~TheorySets() override;
void addSharedTerm(TNode) override;
-
void check(Effort) override;
-
bool needsCheckLastEffort() override;
-
bool collectModelInfo(TheoryModel* m) override;
-
void computeCareGraph() override;
-
Node explain(TNode) override;
-
EqualityStatus getEqualityStatus(TNode a, TNode b) override;
-
Node getModelValue(TNode) override;
-
std::string identify() const override { return "THEORY_SETS"; }
-
void preRegisterTerm(TNode node) override;
-
Node expandDefinition(LogicRequest& logicRequest, Node n) override;
-
PPAssertStatus ppAssert(TNode in, SubstitutionMap& outSubstitutions) override;
-
void presolve() override;
-
void propagate(Effort) override;
-
void setMasterEqualityEngine(eq::EqualityEngine* eq) override;
+ bool isEntailed(Node n, bool pol);
- bool isEntailed( Node n, bool pol );
+ private:
+ friend class TheorySetsPrivate;
+ friend class TheorySetsScrutinize;
+ friend class TheorySetsRels;
-};/* class TheorySets */
+ std::unique_ptr<TheorySetsPrivate> d_internal;
+}; /* class TheorySets */
}/* CVC4::theory::sets namespace */
}/* CVC4::theory namespace */