diff options
Diffstat (limited to 'src/theory/quantifiers/instantiate.cpp')
-rw-r--r-- | src/theory/quantifiers/instantiate.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/theory/quantifiers/instantiate.cpp b/src/theory/quantifiers/instantiate.cpp index 9969de458..218753308 100644 --- a/src/theory/quantifiers/instantiate.cpp +++ b/src/theory/quantifiers/instantiate.cpp @@ -116,7 +116,7 @@ bool Instantiate::addInstantiation( // Ensure the type is correct, this for instance ensures that real terms // are cast to integers for { x -> t } where x has type Int and t has // type Real. - terms[i] = quantifiers::TermUtil::ensureType(terms[i], tn); + terms[i] = ensureType(terms[i], tn); if (mkRep) { // pick the best possible representative for instantiation, based on past @@ -747,6 +747,22 @@ void Instantiate::debugPrintModel() } } +Node Instantiate::ensureType(Node n, TypeNode tn) +{ + Trace("inst-add-debug2") << "Ensure " << n << " : " << tn << std::endl; + TypeNode ntn = n.getType(); + Assert(ntn.isComparableTo(tn)); + if (ntn.isSubtypeOf(tn)) + { + return n; + } + if (tn.isInteger()) + { + return NodeManager::currentNM()->mkNode(TO_INTEGER, n); + } + return Node::null(); +} + Instantiate::Statistics::Statistics() : d_instantiations("Instantiate::Instantiations_Total", 0), d_inst_duplicate("Instantiate::Duplicate_Inst", 0), |