return Expr(this, d_nodeManager->mkBoundVarPtr(*type.d_typeNode));
}
-Expr ExprManager::mkSepNil(Type type) {
+Expr ExprManager::mkUniqueVar(Type type, Kind k){
NodeManagerScope nms(d_nodeManager);
- Node n = d_nodeManager->mkSepNil(*type.d_typeNode);
+ Node n = d_nodeManager->mkUniqueVar(*type.d_typeNode, k);
return n.toExpr();
- //return Expr(this, d_nodeManager->mkSepNilPtr(*type.d_typeNode));
}
Expr ExprManager::mkAssociative(Kind kind,
Expr mkBoundVar(Type type);
/**
- * Create a (nameless) new nil reference for separation logic of type
+ * Create unique variable of type
*/
- Expr mkSepNil(Type type);
+ Expr mkUniqueVar( Type type, Kind k);
/** Get a reference to the statistics registry for this ExprManager */
Statistics getStatistics() const throw();
d_operators[i] = Node::null();
}
- d_sep_nils.clear();
+ d_unique_vars.clear();
//d_tupleAndRecordTypes.clear();
d_tt_cache.d_children.clear();
return n;
}
-Node NodeManager::mkSepNil(const TypeNode& type) {
- std::map< TypeNode, Node >::iterator it = d_sep_nils.find( type );
- if( it==d_sep_nils.end() ){
- Node n = NodeBuilder<0>(this, kind::SEP_NIL);
+Node NodeManager::mkUniqueVar(const TypeNode& type, Kind k) {
+ std::map< TypeNode, Node >::iterator it = d_unique_vars[k].find( type );
+ if( it==d_unique_vars[k].end() ){
+ Node n = NodeBuilder<0>(this, k);
n.setAttribute(TypeAttr(), type);
n.setAttribute(TypeCheckedAttr(), true);
- d_sep_nils[type] = n;
+ d_unique_vars[k][type] = n;
+ Assert( n.getMetaKind() == kind::metakind::VARIABLE );
return n;
}else{
return it->second;
*/
Node d_operators[kind::LAST_KIND];
- /** sep nil per type */
- std::map< TypeNode, Node > d_sep_nils;
+ /** unique vars per (Kind,Type) */
+ std::map< Kind, std::map< TypeNode, Node > > d_unique_vars;
/**
* A list of subscribers for NodeManager events.
/** Create a instantiation constant with the given type. */
Node mkInstConstant(const TypeNode& type);
-
- /** Create nil reference for separation logic with the given type (unique per type). */
- Node mkSepNil(const TypeNode& type);
/** Make a new abstract value with the given type. */
Node mkAbstractValue(const TypeNode& type);
+
+ /** make unique (per Type,Kind) variable. */
+ Node mkUniqueVar(const TypeNode& type, Kind k);
/**
* Create a constant of type T. It will have the appropriate
} else if(f.getKind() == CVC4::kind::SEP_NIL_REF) {
//We don't want the nil reference to be a constant: for instance, it could be of type Int but is not a const rational.
//However, the expression has 0 children. So we convert to a SEP_NIL variable.
- expr = EXPR_MANAGER->mkSepNil(type);
+ expr = EXPR_MANAGER->mkUniqueVar(type, kind::SEP_NIL);
} else {
if(f.getType() != type) {
PARSER_STATE->parseError("Type ascription not satisfied.");
name = "UFBV";
} else if(name == "SLIA") {
name = "UFSLIA";
+ } else if(name == "SAT") {
+ name = "UF";
} else if(name == "ALL_SUPPORTED") {
//no change
} else {
Node TheorySep::getNilRef( TypeNode tn ) {
std::map< TypeNode, Node >::iterator it = d_nil_ref.find( tn );
if( it==d_nil_ref.end() ){
- Node nil = NodeManager::currentNM()->mkSepNil( tn );
+ Node nil = NodeManager::currentNM()->mkUniqueVar( tn, kind::SEP_NIL );
setNilRef( tn, nil );
return nil;
}else{