corpus compilation, checking and querying