For the model, this was used for ensuring that we skipped enumerating the Real constant 1.0 if the Integer constant 1 already existed in the model. Now, these two nodes are disjoint, and due to #8740, the use of getBaseType in this context has no effect since the set of real and integer constants are disjoint.
It was also used in CEGQI in a similar manner, where since equivalence classes of Int and Real terms are disjoint, it is not necessary to search for e.g. Real variables in integer equivalence classes.
return (*this)[0];
}
-TypeNode TypeNode::getBaseType() const {
- TypeNode realt = NodeManager::currentNM()->realType();
- if (isSubtypeOf(realt)) {
- return realt;
- }
- return *this;
-}
-
std::vector<TypeNode> TypeNode::getArgTypes() const {
vector<TypeNode> args;
if (isDatatypeTester())
*/
TypeNode getUninterpretedSortConstructor() const;
- /** Get the most general base type of the type */
- TypeNode getBaseType() const;
-
/**
* Returns the leastUpperBound in the extended type lattice of the two types.
* If this is \top, i.e. there is no inhabited type that contains both,
Node pv)
{
TypeNode pvtn = pv.getType();
- TypeNode pvtnb = pvtn.getBaseType();
Node pvr = pv;
eq::EqualityEngine* ee = d_qstate.getEqualityEngine();
if (ee->hasTerm(pv))
Trace("cegqi-inst-debug")
<< "[2] try based on solving equalities." << std::endl;
d_curr_iphase[pv] = CEG_INST_PHASE_EQUAL;
- std::vector<Node>& cteqc = d_curr_type_eqc[pvtnb];
+ std::vector<Node>& cteqc = d_curr_type_eqc[pvtn];
for (const Node& r : cteqc)
{
TheoryId tid = d_env.theoryOf(rtn);
//if we care about the theory of this eqc
if( std::find( d_tids.begin(), d_tids.end(), tid )!=d_tids.end() ){
- if (rtn.isRealOrInt())
- {
- rtn = rtn.getBaseType();
- }
Trace("cegqi-proc-debug") << "...type eqc: " << r << std::endl;
d_curr_type_eqc[rtn].push_back( r );
if( d_curr_eqc.find( r )==d_curr_eqc.end() ){
// information from another class. Thus, rep may be non-null here.
// Regardless, we assign constRep as the representative here.
assignConstantRep(tm, eqc, constRep);
- typeConstSet.add(eqct.getBaseType(), constRep);
+ typeConstSet.add(eqct, constRep);
continue;
}
else if (!rep.isNull())
{
assertedReps[eqc] = rep;
- typeRepSet.add(eqct.getBaseType(), eqc);
+ typeRepSet.add(eqct, eqc);
std::unordered_set<TypeNode> visiting;
- addToTypeList(eqct.getBaseType(), type_list, visiting);
+ addToTypeList(eqct, type_list, visiting);
}
else
{
for (type_it = type_list.begin(); type_it != type_list.end(); ++type_it)
{
TypeNode t = *type_it;
- TypeNode tb = t.getBaseType();
+ TypeNode tb = t;
set<Node>* noRepSet = typeNoRepSet.getSet(t);
// 1. Try to evaluate the EC's in this type
}
#endif
- TypeNode tb = t.getBaseType();
+ TypeNode tb = t;
if (!assignOne)
{
set<Node>* repSet = typeRepSet.getSet(tb);
{
Trace("model-builder-debug") << "Enumerate term of type " << t
<< std::endl;
- n = typeConstSet.nextTypeEnum(t, true);
+ n = typeConstSet.nextTypeEnum(t);
//--- AJR: this code checks whether n is a legal value
Assert(!n.isNull());
success = true;
return (*it).second;
}
-Node TypeSet::nextTypeEnum(TypeNode t, bool useBaseType)
+Node TypeSet::nextTypeEnum(TypeNode t)
{
TypeEnumerator* te;
TypeToTypeEnumMap::iterator it = d_teMap.find(t);
{
return Node();
}
-
- if (useBaseType)
- {
- t = t.getBaseType();
- }
iterator itSet = d_typeSet.find(t);
std::set<Node>* s;
if (itSet == d_typeSet.end())
void add(TypeNode t, TNode n);
/** get the set of values of type t */
std::set<Node>* getSet(TypeNode t) const;
- /** get the next enumerated term of type t
- *
- * useBaseType is whether
- */
- Node nextTypeEnum(TypeNode t, bool useBaseType = false);
+ /** get the next enumerated term of type t */
+ Node nextTypeEnum(TypeNode t);
bool empty() { return d_typeSet.empty(); }
iterator begin() { return d_typeSet.begin(); }
ASSERT_FALSE(bvType.isComparableTo(realType));
ASSERT_FALSE(bvType.isComparableTo(arrayType));
ASSERT_TRUE(bvType.isComparableTo(bvType));
-
- ASSERT_TRUE(realType.getBaseType() == realType);
- ASSERT_TRUE(integerType.getBaseType() == realType);
- ASSERT_TRUE(booleanType.getBaseType() == booleanType);
- ASSERT_TRUE(arrayType.getBaseType() == arrayType);
- ASSERT_TRUE(bvType.getBaseType() == bvType);
}
} // namespace test
} // namespace cvc5::internal