if (itc != tat->d_children.end()) {
tat = &itc->second;
} else {
- // no functions match
- return d_nullExpr;
+ Trace("parser-overloading")
+ << "Could not find overloaded function " << name << std::endl;
+ // it may be a parametric datatype
+ TypeNode tna = TypeNode::fromType(argTypes[i]);
+ if (tna.isParametricDatatype())
+ {
+ Trace("parser-overloading")
+ << "Parametric overloaded datatype selector " << name << " "
+ << tna << std::endl;
+ DatatypeType tnd = static_cast<DatatypeType>(argTypes[i]);
+ const Datatype& dt = tnd.getDatatype();
+ // tng is the "generalized" version of the instantiated parametric
+ // type tna
+ Type tng = dt.getDatatypeType();
+ itc = tat->d_children.find(tng);
+ if (itc != tat->d_children.end())
+ {
+ tat = &itc->second;
+ }
+ }
+ if (tat == nullptr)
+ {
+ // no functions match
+ return d_nullExpr;
+ }
}
}
// we ensure that there is *only* one active symbol at this node
regress0/datatypes/rec1.cvc
regress0/datatypes/rec2.cvc
regress0/datatypes/rec4.cvc
+ regress0/datatypes/repeated-selectors-2769.smt2
regress0/datatypes/rewriter.cvc
regress0/datatypes/sc-cdt1.smt2
regress0/datatypes/some-boolean-tests.cvc
--- /dev/null
+(set-logic ALL)
+(set-info :status sat)
+(declare-datatypes ((t1 1)) ((par (T1) ((mkt1 (p1 T1))))))
+(declare-datatypes ((t2 1)) ((par (T1) ((mkt2 (p1 T1))))))
+(define-fun s1 () (t1 Int) (mkt1 3))
+(define-fun s2 () (t2 Int) (mkt2 3))
+(define-fun s3 () Int (p1 s1))
+(define-fun s4 () Int (p1 s2))
+(assert (= s3 s4))
+(check-sat)