In particular, theory_engine.h is included many places spuriously.
A few blocks of code changed indentation, updated to guidelines.
#include "base/check.h"
#include "expr/node_algorithm.h"
#include "options/options.h"
+#include "options/smt_options.h"
using namespace CVC4;
using namespace CVC4::theory;
#include "expr/node.h"
#include "expr/node_traversal.h"
+#include "options/smt_options.h"
#include "options/uf_options.h"
#include "theory/bv/theory_bv_rewrite_rules_operator_elimination.h"
#include "theory/bv/theory_bv_rewrite_rules_simplification.h"
#include "preprocessing/passes/extended_rewriter_pass.h"
+#include "options/smt_options.h"
#include "theory/quantifiers/extended_rewrite.h"
namespace CVC4 {
#include "expr/node.h"
#include "expr/node_traversal.h"
+#include "options/smt_options.h"
#include "theory/rewriter.h"
#include "theory/theory.h"
#include "preprocessing/passes/ite_removal.h"
+#include "options/smt_options.h"
#include "theory/rewriter.h"
#include "theory/theory_preprocessor.h"
#include <vector>
+#include "options/smt_options.h"
#include "smt/smt_statistics_registry.h"
#include "smt_util/nary_builder.h"
#include "theory/arith/arith_ite_utils.h"
#include "expr/node_self_iterator.h"
#include "options/arith_options.h"
+#include "options/smt_options.h"
#include "smt/smt_statistics_registry.h"
#include "smt_util/boolean_simplification.h"
#include "theory/booleans/circuit_propagator.h"
#include <vector>
#include "context/cdo.h"
+#include "options/smt_options.h"
#include "smt/smt_statistics_registry.h"
#include "theory/theory_model.h"
#include "theory/trust_substitutions.h"
#include <vector>
#include "options/quantifiers_options.h"
+#include "options/smt_options.h"
#include "smt/smt_engine.h"
#include "smt/smt_engine_scope.h"
#include "theory/arith/arith_msum.h"
#include "preprocessing/passes/theory_preprocess.h"
+#include "options/smt_options.h"
#include "theory/rewriter.h"
#include "theory/theory_engine.h"
#include "context/context.h"
#include "decision/decision_engine.h"
#include "options/decision_options.h"
+#include "options/smt_options.h"
#include "proof/cnf_proof.h"
#include "prop/cnf_stream.h"
#include "prop/prop_engine.h"
#include "smt/smt_solver.h"
+#include "options/smt_options.h"
#include "prop/prop_engine.h"
#include "smt/assertions.h"
#include "smt/preprocessor.h"
#include "theory/combination_care_graph.h"
#include "expr/node_visitor.h"
+#include "prop/prop_engine.h"
#include "theory/care_graph.h"
#include "theory/theory_engine.h"
#include "theory/model_manager.h"
+#include "options/smt_options.h"
#include "options/theory_options.h"
+#include "prop/prop_engine.h"
#include "theory/quantifiers_engine.h"
#include "theory/theory_engine.h"
#include "expr/node_algorithm.h"
#include "options/quantifiers_options.h"
-#include "smt/term_formula_removal.h"
#include "theory/arith/partial_model.h"
#include "theory/arith/theory_arith.h"
#include "theory/arith/theory_arith_private.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
using namespace std;
using namespace CVC4::kind;
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
-#include "theory/uf/theory_uf.h"
using namespace CVC4::kind;
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
-#include "theory/uf/equality_engine.h"
#include "theory/uf/theory_uf_rewriter.h"
#include "util/hash.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
using namespace std;
using namespace CVC4::kind;
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
-#include "theory/uf/equality_engine.h"
using namespace std;
using namespace CVC4;
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
using namespace CVC4::kind;
using namespace std;
bool QuantInfo::entailmentTest( QuantConflictFind * p, Node lit, bool chEnt ) {
Trace("qcf-tconstraint-debug") << "Check : " << lit << std::endl;
Node rew = Rewriter::rewrite( lit );
- if( rew==p->d_false ){
- Trace("qcf-tconstraint-debug") << "...constraint " << lit << " is disentailed (rewrites to false)." << std::endl;
- return false;
- }else if( rew!=p->d_true ){
- //if checking for conflicts, we must be sure that the (negation of) constraint is (not) entailed
- if( !chEnt ){
- rew = Rewriter::rewrite( rew.negate() );
- }
- //check if it is entailed
- Trace("qcf-tconstraint-debug") << "Check entailment of " << rew << "..." << std::endl;
- std::pair<bool, Node> et =
- p->getQuantifiersEngine()->getTheoryEngine()->entailmentCheck(
- options::TheoryOfMode::THEORY_OF_TYPE_BASED, rew);
- ++(p->d_statistics.d_entailment_checks);
- Trace("qcf-tconstraint-debug") << "ET result : " << et.first << " " << et.second << std::endl;
- if( !et.first ){
- Trace("qcf-tconstraint-debug") << "...cannot show entailment of " << rew << "." << std::endl;
- return !chEnt;
- }else{
- return chEnt;
- }
- }else{
- Trace("qcf-tconstraint-debug") << "...rewrites to true." << std::endl;
- return true;
+ if (rew.isConst())
+ {
+ Trace("qcf-tconstraint-debug") << "...constraint " << lit << " rewrites to "
+ << rew << "." << std::endl;
+ return rew.getConst<bool>();
+ }
+ // if checking for conflicts, we must be sure that the (negation of)
+ // constraint is (not) entailed
+ if (!chEnt)
+ {
+ rew = Rewriter::rewrite(rew.negate());
+ }
+ // check if it is entailed
+ Trace("qcf-tconstraint-debug")
+ << "Check entailment of " << rew << "..." << std::endl;
+ std::pair<bool, Node> et = p->getState().getValuation().entailmentCheck(
+ options::TheoryOfMode::THEORY_OF_TYPE_BASED, rew);
+ ++(p->d_statistics.d_entailment_checks);
+ Trace("qcf-tconstraint-debug")
+ << "ET result : " << et.first << " " << et.second << std::endl;
+ if (!et.first)
+ {
+ Trace("qcf-tconstraint-debug")
+ << "...cannot show entailment of " << rew << "." << std::endl;
+ return !chEnt;
}
+ return chEnt;
}
bool QuantInfo::completeMatch( QuantConflictFind * p, std::vector< int >& assigned, bool doContinue ) {
#include "expr/skolem_manager.h"
#include "options/quantifiers_options.h"
+#include "options/smt_options.h"
#include "theory/quantifiers/quantifiers_attributes.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
#include "theory/quantifiers/sygus/synth_conjecture.h"
#include "theory/quantifiers/sygus/term_database_sygus.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
using namespace std;
using namespace CVC4::kind;
#include "theory/quantifiers/sygus/synth_conjecture.h"
#include "theory/quantifiers/sygus/term_database_sygus.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
using namespace CVC4::kind;
#include "options/datatypes_options.h"
#include "options/quantifiers_options.h"
#include "printer/printer.h"
-#include "prop/prop_engine.h"
#include "smt/smt_engine_scope.h"
#include "smt/smt_statistics_registry.h"
#include "theory/datatypes/sygus_datatype_utils.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
#include "theory/smt_engine_subsolver.h"
-#include "theory/theory_engine.h"
using namespace CVC4::kind;
using namespace std;
#include "theory/quantifiers/sygus/term_database_sygus.h"
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
using namespace CVC4::kind;
using namespace std;
#include "theory/quantifiers/sygus/sygus_grammar_cons.h"
#include "theory/quantifiers/sygus/synth_engine.h"
#include "theory/quantifiers_engine.h"
-#include "theory/theory_engine.h"
namespace CVC4 {
namespace theory {
#include "options/base_options.h"
#include "options/quantifiers_options.h"
+#include "options/smt_options.h"
#include "options/theory_options.h"
#include "options/uf_options.h"
#include "theory/quantifiers/ematching/trigger_term_info.h"
#include "theory/quantifiers/term_enumeration.h"
#include "theory/quantifiers_engine.h"
#include "theory/strings/word.h"
-#include "theory/theory_engine.h"
using namespace std;
using namespace CVC4::kind;
#include "options/printer_options.h"
#include "options/quantifiers_options.h"
+#include "options/smt_options.h"
#include "options/uf_options.h"
#include "smt/smt_engine_scope.h"
#include "smt/smt_statistics_registry.h"
#include "theory/theory_engine.h"
-#include <list>
-#include <vector>
-
#include "base/map_util.h"
#include "decision/decision_engine.h"
#include "expr/attribute.h"
#include "expr/lazy_proof.h"
-#include "expr/node.h"
#include "expr/node_builder.h"
#include "expr/node_visitor.h"
#include "expr/proof_ensure_closed.h"
-#include "options/bv_options.h"
-#include "options/options.h"
#include "options/quantifiers_options.h"
+#include "options/smt_options.h"
#include "options/theory_options.h"
#include "printer/printer.h"
+#include "prop/prop_engine.h"
#include "smt/dump.h"
#include "smt/logic_exception.h"
-#include "smt/term_formula_removal.h"
-#include "theory/arith/arith_ite_utils.h"
-#include "theory/bv/theory_bv_utils.h"
-#include "theory/care_graph.h"
#include "theory/combination_care_graph.h"
#include "theory/decision_manager.h"
#include "theory/quantifiers/first_order_model.h"
-#include "theory/quantifiers/fmf/model_engine.h"
-#include "theory/quantifiers/theory_quantifiers.h"
#include "theory/quantifiers_engine.h"
#include "theory/relevance_manager.h"
#include "theory/rewriter.h"
#ifndef CVC4__THEORY_ENGINE_H
#define CVC4__THEORY_ENGINE_H
-#include <deque>
#include <memory>
-#include <set>
-#include <unordered_map>
-#include <utility>
#include <vector>
#include "base/check.h"
-#include "context/cdhashset.h"
+#include "context/cdhashmap.h"
#include "expr/node.h"
-#include "options/options.h"
-#include "options/smt_options.h"
#include "options/theory_options.h"
-#include "prop/prop_engine.h"
#include "theory/atom_requests.h"
#include "theory/engine_output_channel.h"
#include "theory/interrupted.h"
#include "theory/uf/equality_engine.h"
#include "theory/valuation.h"
#include "util/hash.h"
-#include "util/resource_manager.h"
#include "util/statistics_registry.h"
#include "util/unsafe_interrupt_exception.h"
namespace CVC4 {
class ResourceManager;
+class OutputManager;
class TheoryEngineProofGenerator;
/**
class DecisionManager;
class RelevanceManager;
-namespace eq {
-class EqualityEngine;
-} // namespace eq
}/* CVC4::theory namespace */
+namespace prop {
+class PropEngine;
+}
+
/**
* This is essentially an abstraction for a collection of theories. A
* TheoryEngine provides services to a PropEngine, making various
#include "theory/uf/cardinality_extension.h"
+#include "options/smt_options.h"
#include "options/uf_options.h"
-#include "theory/uf/theory_uf.h"
-#include "theory/uf/equality_engine.h"
-#include "theory/theory_engine.h"
-#include "theory/quantifiers_engine.h"
#include "theory/quantifiers/term_database.h"
+#include "theory/quantifiers_engine.h"
+#include "theory/theory_engine.h"
#include "theory/theory_model.h"
+#include "theory/uf/equality_engine.h"
+#include "theory/uf/theory_uf.h"
using namespace std;
using namespace CVC4::kind;
#include "theory/uf/theory_uf_model.h"
#include <stack>
-#include <vector>
#include "expr/attribute.h"
-#include "options/quantifiers_options.h"
#include "theory/quantifiers/first_order_model.h"
-#include "theory/theory_engine.h"
-#include "theory/uf/equality_engine.h"
-#include "theory/uf/theory_uf.h"
-using namespace std;
-using namespace CVC4;
using namespace CVC4::kind;
-using namespace CVC4::context;
-using namespace CVC4::theory;
-using namespace CVC4::theory::uf;
+
+namespace CVC4 {
+namespace theory {
+namespace uf {
//clear
void UfModelTreeNode::clear(){
defaultValue = d_data[Node::null()].getFunctionValue(args, index + 1, argDefaultValue, simplify);
}
- vector<Node> caseArgs;
- map<Node, Node> caseValues;
+ std::vector<Node> caseArgs;
+ std::map<Node, Node> caseValues;
- for(map< Node, UfModelTreeNode>::iterator it = d_data.begin(); it != d_data.end(); ++it) {
- if(!it->first.isNull()) {
- Node val = it->second.getFunctionValue(args, index + 1, defaultValue, simplify);
- caseArgs.push_back(it->first);
- caseValues[it->first] = val;
+ for (std::pair<const Node, UfModelTreeNode>& p : d_data)
+ {
+ if (!p.first.isNull())
+ {
+ Node val =
+ p.second.getFunctionValue(args, index + 1, defaultValue, simplify);
+ caseArgs.push_back(p.first);
+ caseValues[p.first] = val;
}
}
Node val = caseValues[ caseArgs[ i ] ];
if(val.getKind() == ITE) {
// use a stack to reverse the order, since we're traversing outside-in
- stack<TNode> stk;
+ std::stack<TNode> stk;
do {
stk.push(val);
val = val[2];
}
return getFunctionValue( vars, simplify );
}
+
+} // namespace uf
+} // namespace theory
+} // namespace CVC4
#ifndef CVC4__THEORY_UF_MODEL_H
#define CVC4__THEORY_UF_MODEL_H
+#include <vector>
+
+#include "expr/node.h"
#include "theory/theory_model.h"
namespace CVC4 {
#include "expr/node.h"
#include "options/theory_options.h"
+#include "prop/prop_engine.h"
#include "theory/rewriter.h"
#include "theory/theory_engine.h"
#include "theory/theory_model.h"