bool Vocabulary::isSuccOrMax(int _nPredicateId) const { const char* name = getNameById(_nPredicateId, PREDICATE); assert(name); if (strncmp(name, "succ", 4) == 0 || strncmp(name, "max", 3) == 0) { return true; } return false; }
void DBFileDialog::sSelectedReport() { _name->setText(getNameById()); _name->end(false); _grade->setValue(getGradeById()); }
/** * 获取变量所在论域 * @param _variableId * @return */ const char* Vocabulary::getVariableDomain(int _variableId) { int domainId = m_mapVariableDomain[_variableId]; return getNameById(domainId, DOMAIN); }
/** * 输出字符表的信息 * @param out */ void Vocabulary::dumpVocabulary(FILE* _out) { fprintf(_out, "\nvariable:\n"); for (map<int, string>::const_iterator it = m_mapVariableName.begin(); it != m_mapVariableName.end(); ++ it) { fprintf(_out, "%s ", (it->second).c_str()); } fprintf(_out, "\nfunction:\n"); for (map<int, string>::const_iterator it = m_mapFunctionName.begin(); it != m_mapFunctionName.end(); ++ it) { fprintf(_out, "%s ", (it->second).c_str()); } fprintf(_out, "\npredicate:\n"); for (map<int, string>::const_iterator it = m_mapPredicateName.begin(); it != m_mapPredicateName.end(); ++ it) { fprintf(_out, "%s:%d\t", (it->second).c_str(), it->first); } fprintf(_out, "\nmininal predicates' priority:\n"); for (unsigned int i = 0; i < m_vvMininalPredicates.size(); ++ i) { for (unsigned int j = 0; j < m_vvMininalPredicates[i].size(); ++ j) { fprintf(_out, "%s:%d\t", getNameById(m_vvMininalPredicates[i][j], PREDICATE), i); } } fprintf(_out, "\nintension predicate:\n"); for (map<int, string>::const_iterator it = m_mapPredicateName.begin(); it != m_mapPredicateName.end(); ++ it) { if (isIntensionPredicate(it->first)) { fprintf(_out, "%s ", (it->second).c_str()); } } fprintf(_out, "\nvary predicate:\n"); for (map<int, string>::const_iterator it = m_mapPredicateName.begin(); it != m_mapPredicateName.end(); ++ it) { if (isVaryPredicate(it->first)) { fprintf(_out, "%s ", (it->second).c_str()); } } fprintf(_out, "\ndomains:"); for (map<int, string>::const_iterator it = m_mapDomainName.begin(); it != m_mapDomainName.end(); ++ it) { fprintf(_out, "\nvariables at domain %s: ", (it->second).c_str()); vector<int> variables = m_mapDomainVariables[it->first]; for (vector<int>::const_iterator it2 = variables.begin(); it2 != variables.end(); ++ it2) { fprintf(_out, "%s", m_mapVariableName[*it2].c_str()); if (it2 != variables.end() - 1) { fprintf(_out, ", "); } } } fprintf(_out, "\n\natom:\n"); for (FORMULAS_CONST_ITERATOR it = m_fmlAtomList->begin(); it != m_fmlAtomList->end(); ++ it) { it->output(stdout); } }