Exemple #1
0
int do_list(ai::PL::KnowledgeBase &kb, int interactive, char *buf, std::istream &in, std::ostream &out)
{
    const std::vector<ai::PL::Sentence *>       &sentences = kb.GetSentences();
    std::vector<ai::PL::Sentence *>::const_iterator sen_it = sentences.begin();
    while(sen_it != sentences.end())
    {
        out << *(*sen_it) << std::endl;
        sen_it ++;
    }
    return 0;
}
Exemple #2
0
int do_cnf(ai::PL::KnowledgeBase &kb, int interactive, char *buf, std::istream &in, std::ostream &out)
{
    const std::vector<ai::PL::Sentence *>          &sentences = kb.GetSentences();
    std::vector<ai::PL::Sentence *>::const_iterator sen_it = sentences.begin();
    while(sen_it != sentences.end())
    {
        ai::PL::Sentence *s_tmp = new ai::PL::Sentence(*(*sen_it));
        s_tmp->CNF();
        out << *(s_tmp) << std::endl;
        sen_it ++;
        delete s_tmp;
    }
    return 0;
}