added a naive indexing structure, with lists of terms (better for small rewriting systems)