9#include <unordered_set>
16using FactSet = std::unordered_set<Atom, AtomHash>;
36 [[nodiscard]]
bool contains(
const Atom& fact)
const {
return facts_.find(fact) != facts_.end(); }
37 [[nodiscard]] std::size_t
size()
const {
return facts_.size(); }
38 [[nodiscard]]
bool empty()
const {
return facts_.empty(); }
An atom is a predicate name applied to a tuple of Terms, e.g. edge(a, b) or ancestor(X,...
Definition datalog_atom.hpp:24
A fact database: a set of ground atoms. Boolean semiring only (Mission 0's scope) – a fact is simply ...
Definition datalog_fact_database.hpp:23
bool operator!=(const FactDatabase &other) const
Definition datalog_fact_database.hpp:42
bool contains(const Atom &fact) const
Definition datalog_fact_database.hpp:36
bool operator==(const FactDatabase &other) const
Definition datalog_fact_database.hpp:41
FactDatabase(FactSet facts)
bool insert(Atom fact)
Adds a fact.
std::size_t size() const
Definition datalog_fact_database.hpp:37
const FactSet & facts() const
Definition datalog_fact_database.hpp:39
bool empty() const
Definition datalog_fact_database.hpp:38
A Datalog atom: a predicate name plus a tuple of terms, no function symbols. Phase 3 Mission 0 of cam...
Definition datalog_atom.hpp:14
std::unordered_set< Atom, AtomHash > FactSet
The concrete set type a FactDatabase stores facts in and the engine derives into.
Definition datalog_fact_database.hpp:16