summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2017-04-14 17:03:44 -0500
committerajreynol <andrew.j.reynolds@gmail.com>2017-04-14 17:03:44 -0500
commit08d6ec676189826f99756f9245186ee9de7dbc36 (patch)
tree0705bfd0caf37d694c87b7a907edcd5bea466cbe
parent9d7766ed1e41da53d59ad16e9ef8be8f522226df (diff)
Fix bug related to portfolio with nullary operators.
-rw-r--r--src/expr/expr_template.cpp7
-rw-r--r--src/expr/node_manager.cpp6
2 files changed, 9 insertions, 4 deletions
diff --git a/src/expr/expr_template.cpp b/src/expr/expr_template.cpp
index 4fbb0cd33..806650e57 100644
--- a/src/expr/expr_template.cpp
+++ b/src/expr/expr_template.cpp
@@ -137,7 +137,12 @@ public:
return to->mkConst(::CVC4::EmptySet(type));
}
return exportConstant(n, NodeManager::fromExprManager(to), vmap);
- } else if(n.isVar()) {
+ } else if(n.getMetaKind() == metakind::NULLARY_OPERATOR ){
+ Expr from_e(from, new Node(n));
+ Type type = from->exportType(from_e.getType(), to, vmap);
+ NodeManagerScope nullScope(NULL);
+ return to->mkNullaryOperator(type, n.getKind()); // FIXME thread safety
+ } else if(n.getMetaKind() == metakind::VARIABLE) {
Expr from_e(from, new Node(n));
Expr& to_e = vmap.d_typeMap[from_e];
if(! to_e.isNull()) {
diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp
index 7cf228403..e9e92a5b1 100644
--- a/src/expr/node_manager.cpp
+++ b/src/expr/node_manager.cpp
@@ -459,7 +459,7 @@ TypeNode NodeManager::getType(TNode n, bool check)
/* The check should have happened, if we asked for it. */
Assert( !check || getAttribute(n, TypeCheckedAttr()) );
- Debug("getType") << "type of " << n << " is " << typeNode << endl;
+ Debug("getType") << "type of " << &n << " " << n << " is " << typeNode << endl;
return typeNode;
}
@@ -799,10 +799,10 @@ Node NodeManager::mkNullaryOperator(const TypeNode& type, Kind k) {
//setAttribute(n, TypeCheckedAttr(), true);
d_unique_vars[k][type] = n;
Assert( n.getMetaKind() == kind::metakind::NULLARY_OPERATOR );
- Trace("ajr-temp") << this << "...made nullary operator " << n << std::endl;
+ Trace("ajr-temp") << this << "...made nullary operator " << n << " " << &n << " " << type << std::endl;
return n;
}else{
- Trace("ajr-temp") << this << "...reuse nullary operator " << it->second << std::endl;
+ Trace("ajr-temp") << this << "...reuse nullary operator " << it->second << " " << &( it->second ) << std::endl;
return it->second;
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback