Command* cmd_to_export = *i;
Command* cmd = cmd_to_export->exportTo(exprManager, variableMap);
seq->addCommand(cmd);
+ Debug("export") << "[export] so far coverted: " << seq << endl;
}
seq->d_index = d_index;
return seq;
}
Command* DefineFunctionCommand::exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap) {
- Expr func = d_func.exportTo(exprManager, variableMap);
+ Expr func = d_func.exportTo(exprManager, variableMap, /* flags = */ ExprManager::VAR_FLAG_DEFINED);
vector<Expr> formals;
transform(d_formals.begin(), d_formals.end(), back_inserter(formals),
ExportTransformer(exprManager, variableMap));
static Node exportConstant(TNode n, NodeManager* to);
-Node exportInternal(TNode n, ExprManager* from, ExprManager* to, ExprManagerMapCollection& vmap) {
+Node exportInternal(TNode n, ExprManager* from, ExprManager* to, ExprManagerMapCollection& vmap, uint32_t flags) {
if(n.isNull()) return Node::null();
if(theory::kindToTheoryId(n.getKind()) == theory::THEORY_DATATYPES) {
throw ExportUnsupportedException
bool isGlobal;
Node::fromExpr(from_e).getAttribute(GlobalVarAttr(), isGlobal);
NodeManagerScope nullScope(NULL);
- to_e = to->mkVar(name, type, isGlobal ? ExprManager::VAR_FLAG_GLOBAL : ExprManager::VAR_FLAG_NONE);// FIXME thread safety
+ to_e = to->mkVar(name, type, isGlobal ? ExprManager::VAR_FLAG_GLOBAL : flags);// FIXME thread safety
} else if(n.getKind() == kind::SKOLEM) {
// skolems are only available at the Node level (not the Expr level)
TypeNode typeNode = TypeNode::fromType(type);
if(n.getMetaKind() == kind::metakind::PARAMETERIZED) {
Debug("export") << "+ parameterized, op is " << n.getOperator() << std::endl;
children.reserve(n.getNumChildren() + 1);
- children.push_back(exportInternal(n.getOperator(), from, to, vmap));
+ children.push_back(exportInternal(n.getOperator(), from, to, vmap, flags));
} else {
children.reserve(n.getNumChildren());
}
for(TNode::iterator i = n.begin(), i_end = n.end(); i != i_end; ++i) {
Debug("export") << "+ child: " << *i << std::endl;
- children.push_back(exportInternal(*i, from, to, vmap));
+ children.push_back(exportInternal(*i, from, to, vmap, flags));
}
if(Debug.isOn("export")) {
ExprManagerScope ems(*to);
}/* CVC4::expr namespace */
-Expr Expr::exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap) const {
+Expr Expr::exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap,
+ uint32_t flags /* = 0 */) const {
Assert(d_exprManager != exprManager,
"No sense in cloning an Expr in the same ExprManager");
ExprManagerScope ems(*this);
- return Expr(exprManager, new Node(expr::exportInternal(*d_node, d_exprManager, exprManager, variableMap)));
+ return Expr(exprManager, new Node(expr::exportInternal(*d_node, d_exprManager, exprManager, variableMap, flags)));
}
Expr& Expr::operator=(const Expr& e) {
class CVC4_PUBLIC ExprDag;
class CVC4_PUBLIC ExprSetLanguage;
- NodeTemplate<true> exportInternal(NodeTemplate<false> n, ExprManager* from, ExprManager* to, ExprManagerMapCollection& vmap);
+ NodeTemplate<true> exportInternal(NodeTemplate<false> n, ExprManager* from, ExprManager* to, ExprManagerMapCollection& vmap, uint32_t flags);
}/* CVC4::expr namespace */
/**
* variableMap for the translation and extending it with any new
* mappings.
*/
- Expr exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap) const;
+ Expr exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap, uint32_t flags = 0) const;
/**
* IOStream manipulator to set the maximum depth of Exprs when
friend class TypeCheckingException;
friend class expr::pickle::Pickler;
friend class prop::TheoryProxy;
- friend NodeTemplate<true> expr::exportInternal(NodeTemplate<false> n, ExprManager* from, ExprManager* to, ExprManagerMapCollection& vmap);
+ friend NodeTemplate<true> expr::exportInternal(NodeTemplate<false> n, ExprManager* from, ExprManager* to, ExprManagerMapCollection& vmap, uint32_t flags);
friend std::ostream& CVC4::operator<<(std::ostream& out, const Expr& e);
template <bool ref_count> friend class NodeTemplate;
friend class expr::NodeValue;
friend class expr::pickle::PicklerPrivate;
- friend Node expr::exportInternal(TNode n, ExprManager* from, ExprManager* to, ExprManagerMapCollection& vmap);
+ friend Node expr::exportInternal(TNode n, ExprManager* from, ExprManager* to, ExprManagerMapCollection& vmap, uint32_t flags);
/** A convenient null-valued encapsulated pointer */
static NodeTemplate s_null;
dynamic_cast<QueryCommand*>(cmd) != NULL) {
mode = 1;
} else if(dynamic_cast<GetValueCommand*>(cmd) != NULL ||
- dynamic_cast<GetModelCommand*>(cmd) != NULL ||
dynamic_cast<GetAssignmentCommand*>(cmd) != NULL ||
dynamic_cast<GetModelCommand*>(cmd) != NULL ||
dynamic_cast<GetProofCommand*>(cmd) != NULL ||
mode = 2;
}
+ Debug("portfolio::outputmode") << "Mode is " << mode
+ << "lastWinner is " << d_lastWinner
+ << "d_seq is " << d_seq << std::endl;
+
if(mode == 0) {
d_seq->addCommand(cmd->clone());
Command* cmdExported =
template<typename S>
void runThread(int thread_id, boost::function<S()> threadFn, S& returnValue)
{
+ /* Uncommment line to delay first thread, useful to unearth errors/debug */
+ // if(thread_id == 0) { sleep(1); }
returnValue = threadFn();
if( mutex_done.try_lock() ) {