Compiling rules and queries in knowledge base systems: a substitution-based approach | IEEE Conference Publication | IEEE Xplore