Exemple #1
0
SubsumptionResult TermContinuation::_IsSubsumedCore(Term *t, bool unfoldAll) {
    // TODO: How to do this smartly?
    // TODO: Maybe if we have {} we can answer sooner, without unpacking
    assert(false);

    // We unpack this term
    auto unfoldedTerm = (this->aut->IntersectNonEmpty(this->symbol, this->term, this->underComplement)).first;
    return unfoldedTerm->IsSubsumed(t, unfoldAll);
}
bool AllMaximalSetsSateLite::FindAllMaximalSets(
    DataSourceIterator* data,
    uint32_t max_item_id,
    uint32_t max_items_in_ram,
    std::ostream& os)
{
    Init();

    // Vars set by the data source iterator.
    int result;
    uint32_t set_id;
    std::vector<uint32_t> current_set;

    if (!PrepareForDataScan(data, max_item_id, 0))
        return false;  // IO error
    uint32_t items_in_ram = 0;
    CleanerUpper cleanup(&all_sets_);

    // This loop scans the input data from beginning to end and indexes
    // each candidate on the occurrs_ lists.
    while ((result = data->Next(&set_id, &current_set)) > 0)
    {
        SetProperties* index_me = SetProperties::Create(set_id, current_set);
        items_in_ram += current_set.size();
        all_sets_.push_back(index_me);
        if (items_in_ram >= max_items_in_ram)
        {
            std::cerr << "; ERROR: max_items_in_ram exceeded." << std::endl;
            return false;
        }
        ++input_sets_count_;
        for (unsigned int i = 0; i < index_me->size; ++i)
        {
            occurs_[index_me->item[i]].push_back(index_me);
        }
    }
    if (result != 0)
        return false;  // IO error

    std::cerr << "; Starting subsumption checking scan." << std::endl;
    for (unsigned int i = 0; i < all_sets_.size(); ++i)
    {
        if (!IsSubsumed(*all_sets_[i]))
            FoundMaximalSet(*(all_sets_[i]),os);
    }
    return true;
}