Note that although using untable/1 followed by table/1 may be used to flush all tables associated with the given predicate(s), flushing tables should be done using one of the table abolish predicates both for better performance and compatibility with other Prolog implementations: abolish_all_tables/0, abolish_private_tables/0, abolish_shared_tables/0, abolish_module_tables/1 or abolish_table_subgoals/1. For example, to remove all tables for p/3 , run the goal below. The predicate functor/3 may be used to create a head term from a given name and arity.
?- abolish_table_subgoals(p(_,_,_)).