Package com.articulate.sigma.tp
Class EProver
java.lang.Object
com.articulate.sigma.tp.EProver
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a running instance of EProver based on existing batch specification file with a max answer of 1.Create a running instance of EProver based on existing batch specification file.Create a new batch specification file, and create a new running instance of EProver. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBatchConfig(String inputFilename, int timeout) Create or update batch specification file.assertFormula(String formula) Add an assertion for inference.booleanassertFormula(String userAssertionTPTP, KB kb, EProver eprover, List<Formula> parsedFormulas, boolean tptp) Add an assertion for inference.Get the full ATPResult for this run.Get the SZS status from the last run.booleanhasError()Check if there was an error during execution.static voidA simple test.voidrunCustom(File kbFile, int timeout, Collection<String> commands) Creates a running instance of Eprover with custom command line options.submitQuery(String formula, KB kb) Submit a query.voidTerminate this instance of EProver.toString()
-
Field Details
-
output
-
qlist
-
-
Constructor Details
-
EProver
Create a new batch specification file, and create a new running instance of EProver.- Parameters:
executable- A File object denoting the platform-specific EProver executable.kbFile- A File object denoting the initial knowledge base to be loaded by the EProver executable.- Throws:
IOException- should not normally be thrown unless either EProver executable or database file name are incorrect e_ltb_runner --interactive LTBSampleInput-AP.txt
-
EProver
Create a running instance of EProver based on existing batch specification file with a max answer of 1.- Parameters:
executable- A File object denoting the platform-specific EProver executable.- Throws:
IOException
-
EProver
Create a running instance of EProver based on existing batch specification file.- Parameters:
executable- A File object denoting the platform-specific EProver executable.maxAnswers- - Limit the answers up to maxAnswers only- Throws:
IOException
-
-
Method Details
-
toString
-
getResult
Get the full ATPResult for this run. This provides detailed execution metadata, SZS status, and error info.- Returns:
- The ATPResult, or null if submitQuery hasn't been called
-
hasError
public boolean hasError()Check if there was an error during execution.- Returns:
- true if the result indicates an error
-
getSzsStatus
Get the SZS status from the last run.- Returns:
- The SZSStatus, or SZSStatus.NOT_RUN if not run
-
addBatchConfig
Create or update batch specification file. e_ltb_runner processes a batch specification file; it contains a specification of the background theory, some options, and a number of individual job requests. It is used with the option --interactive. "inputFilename" is added into an existing batch specification file for inference.- Parameters:
inputFilename- contains TPTP assertionstimeout- time limit in E
-
assertFormula
Add an assertion for inference.- Parameters:
formula- asserted formula in the KIF syntax- Returns:
- answer to the assertion
-
assertFormula
public boolean assertFormula(String userAssertionTPTP, KB kb, EProver eprover, List<Formula> parsedFormulas, boolean tptp) Add an assertion for inference.- Parameters:
userAssertionTPTP- asserted formula in the TPTP syntaxkb- Knowledge baseeprover- an instance of EProverparsedFormulas- a lit of parsed formulas in KIF syntaxtptp- convert formula to TPTP if tptp = true- Returns:
- true if all assertions are added for inference TODO: This function might not be necessary if we find a way to directly add assertion into opened inference engine (e_ltb_runner)
-
terminate
Terminate this instance of EProver. After calling this function no further assertions or queries can be done.- Throws:
IOException- should not normally be thrown
-
submitQuery
Submit a query.- Parameters:
formula- query in the KIF syntaxkb- current knowledge base- Returns:
- answer to the query
-
runCustom
Creates a running instance of Eprover with custom command line options.- Parameters:
kbFile- A File object denoting the initial knowledge base to be loaded by the Eprover executable.- Throws:
ExecutableNotFoundException- if the EProver executable is not foundProverCrashedException- if EProver crashes with a non-zero exit codeProverTimeoutException- if EProver times outException- for other errors
-
main
A simple test. Works as follows:- start E;
- make an assertion;
- submit a query;
- terminate E
- Throws:
Exception
-