ClauseStore
Clause database backing the argumentation context.
It replaces a full Prolog solver per context branch: clauses are only ever asserted (asserta order), retracted, and looked up as facts or through clause/2, so a dedicated store suffices. Every argument position of a stored head is indexed by the preorder path of its symbols, up to the first variable: lookups only unify the clauses whose paths are compatible with the query ones. Branches share their data until one of them is modified (copy-on-write), and then only copy the predicates they modify.
Functions
The stored clauses whose head may unify with the given one, newest first, as stored
retractall: removes every clause whose head (and body, for a :- pattern) unifies with the given term
Bodies of the clauses whose head unifies with the given one, as stored: the head bindings are not applied, so variables in the stored clauses are left untouched