Package com.articulate.sigma.tp
Class LEO
java.lang.Object
com.articulate.sigma.tp.LEO
Class for invoking the latest version of LEO-III from Java. It now uses
THFnew to translate the knowledge base into THF syntax. To avoid bugs
or crashes from the old THF implementation, only the connection to
THFnew has been changed; all other logic remains the same.
It should invoke a command like:
~/workspace/Leo-III/Leo-III-1.6/bin/leo3 /home/user/.sigmakee/KBs/SUMO.thf -t 60 -p
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanassertFormula(String userAssertionTPTP, KB kb, List<Formula> parsedFormulas, boolean tptp) Add an assertion for inference.voidRead in two files and write their contents to a new fileGet the full ATPResult for this run.Get the SZS status from the last run.getUserAssertions(KB kb) booleanhasError()Check if there was an error during execution.static voidvoidCreates a running instance of LEO-III adding a set of statements in THF language to a file and then calling LEO.toString()voidwriteStatements(Set<String> stmts, String type) Write the statements to the temp-stmt.invalid input: '<'/> file
-
Field Details
-
qlist
-
output
-
axiomIndex
public static int axiomIndex -
debug
public static boolean debug
-
-
Constructor Details
-
LEO
public LEO()
-
-
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 run() 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
-
assertFormula
public static boolean assertFormula(String userAssertionTPTP, KB kb, List<Formula> parsedFormulas, boolean tptp) Add an assertion for inference.- Parameters:
userAssertionTPTP- asserted formula in the TPTP/TFF/THF syntaxkb- Knowledge baseparsedFormulas- a lit of parsed formulas in KIF syntaxtptp- convert formula to TPTP if tptp = true- Returns:
- true if all assertions are added for inference
-
writeStatements
Write the statements to the temp-stmt.invalid input: '<'/> file -
catFiles
Read in two files and write their contents to a new file- Throws:
IOException
-
getUserAssertions
-
run
Creates a running instance of LEO-III adding a set of statements in THF language to a file and then calling LEO. Note that any query must be given as a "conjecture"- Parameters:
stmts- should be the query but the list gets expanded here with any other prior user assertions- Throws:
Exception
-
main
- Throws:
Exception
-