This is work towards properly printing shared selectors in external proofs.
{
case CONSTRUCTOR_TYPE: return t[t.getNumChildren() - 1].getDType();
case SELECTOR_TYPE:
- case TESTER_TYPE: return t[0].getDType();
+ case TESTER_TYPE:
+ case UPDATER_TYPE: return t[0].getDType();
default:
Unhandled() << "arg must be a datatype constructor, selector, or tester";
}
std::stringstream ss;
ss << "sel_" << index;
SkolemManager* sm = nm->getSkolemManager();
- s = sm->mkDummySkolem(ss.str(),
- nm->mkSelectorType(dtt, t),
- "is a shared selector",
- NodeManager::SKOLEM_NO_NOTIFY);
+ TypeNode stype = nm->mkSelectorType(dtt, t);
+ Node nindex = nm->mkConst(Rational(index));
+ s = sm->mkSkolemFunction(SkolemFunId::SHARED_SELECTOR,
+ stype,
+ nindex,
+ NodeManager::SKOLEM_NO_NOTIFY);
d_sharedSel[dtt][t][index] = s;
Trace("dt-shared-sel") << "Made " << s << " of type " << dtt << " -> " << t
<< std::endl;
case SkolemFunId::MOD_BY_ZERO: return "MOD_BY_ZERO";
case SkolemFunId::SQRT: return "SQRT";
case SkolemFunId::SELECTOR_WRONG: return "SELECTOR_WRONG";
+ case SkolemFunId::SHARED_SELECTOR: return "SHARED_SELECTOR";
case SkolemFunId::SEQ_NTH_OOB: return "SEQ_NTH_OOB";
default: return "?";
}
return k;
}
-Node SkolemManager::mkSkolemFunction(SkolemFunId id, TypeNode tn, Node cacheVal)
+Node SkolemManager::mkSkolemFunction(SkolemFunId id,
+ TypeNode tn,
+ Node cacheVal,
+ int flags)
{
std::tuple<SkolemFunId, TypeNode, Node> key(id, tn, cacheVal);
std::map<std::tuple<SkolemFunId, TypeNode, Node>, Node>::iterator it =
NodeManager* nm = NodeManager::currentNM();
std::stringstream ss;
ss << "SKOLEM_FUN_" << id;
- Node k = nm->mkSkolem(ss.str(), tn, "an internal skolem function");
+ Node k = nm->mkSkolem(ss.str(), tn, "an internal skolem function", flags);
d_skolemFuns[key] = k;
return k;
}
SQRT,
/** a wrongly applied selector */
SELECTOR_WRONG,
+ /** a shared selector */
+ SHARED_SELECTOR,
/** an application of seq.nth that is out of bounds */
SEQ_NTH_OOB,
};
*/
Node mkSkolemFunction(SkolemFunId id,
TypeNode tn,
- Node cacheVal = Node::null());
+ Node cacheVal = Node::null(),
+ int flags = NodeManager::SKOLEM_DEFAULT);
/**
* Create a skolem constant with the given name, type, and comment. This
* should only be used if the definition of the skolem does not matter.