The congress.datalog.database Module

class congress.datalog.database.Database(name=None, abbr=None, theories=None, schema=None, desc=None, owner=None)

Bases: congress.datalog.topdown.TopDownTheory

class DBTuple(iterable, proofs=None)

Bases: object

match(atom, unifier)
class Database.Proof(binding, rule)

Bases: object

class Database.ProofCollection(proofs)

Bases: object

Database.atom_to_internal(atom, proofs=None)
Database.bi_unify(dbtuple, unifier1, atom, unifier2, theoryname)

THING1 is always a ground DBTuple and THING2 is always an ATOM.

Database.body(thing)
Database.content(tablenames=None)

Return a sequence of Literals representing all the table data.

Database.content_string()
Database.defined_tablenames()
Database.delete(atom, proofs=None)

Deletes ATOM from the DB. Returns changes.

Database.delete_actual(atom, proofs=None)

Workhorse for deleting ATOM from the DB.

Along with the proofs that are no longer true.

Database.explain(atom)
Database.get_arity_self(tablename)
Database.head(thing)
Database.head_index(table, match_literal=None)
Database.insert(atom, proofs=None)

Inserts ATOM into the DB. Returns changes.

Database.insert_actual(atom, proofs=None)

Workhorse for inserting ATOM into the DB.

Along with proofs explaining how ATOM was computed from other tables.

Database.is_noop(event)

Returns T if EVENT is a noop on the database.

Database.modify(event)

Insert/Delete atom.

Inserts/deletes ATOM and returns a list of changes that were caused. That list contains either 0 or 1 Event.

Database.policy()

Return the policy for this theory.

No policy in this theory; only data.

Database.str2()
Database.tablenames(body_only=False, include_builtin=False, include_modal=True)

Return all table names occurring in this theory.

Database.update(events)

Applies all of EVENTS to the DB.

Each event is either an insert or a delete.

Database.update_would_cause_errors(events)

Return a list of Policyxception.

Return a list of PolicyException if we were to apply the events EVENTS to the current policy.