Logic inference from Knowledge base given and a query asked. Input read from file and ouput to file.