keep track of tables used and add corresponding invariant