Package com.articulate.sigma.trans
Class TPTPGenerationManager
java.lang.Object
com.articulate.sigma.trans.TPTPGenerationManager
Coordinates background generation of TPTP translation files.
Provides synchronization for inference requests that arrive before
background generation completes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidgenerateFOF(KB kb) Generate FOF (First-Order Form) TPTP file for a KB.static voidgenerateProperFile(KB kb, String lang) static booleanCheck if any background generation is currently in progress.static booleanCheck if FOF generation is currently in progress.static booleanCheck if FOF generation is ready.static booleanCheck if TFF generation is currently in progress.static booleanCheck if TFF generation is ready.static booleanCheck if THF Modal generation is currently in progress.static booleanCheck if THF Modal generation is ready.static booleanCheck if THF Plain generation is currently in progress.static booleanCheck if THF Plain generation is ready.static voidshutdown()Shutdown the executor service gracefully.static voidStart background generation of all TPTP formats for all KBs.static booleanwaitForFOF(int timeoutSec) Wait for FOF generation to complete.static booleanwaitForTFF(int timeoutSec) Wait for TFF generation to complete.static booleanwaitForTHFModal(int timeoutSec) Wait for THF Modal generation to complete.static booleanwaitForTHFPlain(int timeoutSec) Wait for THF Plain generation to complete.
-
Constructor Details
-
TPTPGenerationManager
public TPTPGenerationManager()
-
-
Method Details
-
startBackgroundGeneration
public static void startBackgroundGeneration()Start background generation of all TPTP formats for all KBs. This should be called after KBmanager initialization is complete. FOF and TFF run SEQUENTIALLY on the same thread to avoid race conditions with the static SUMOKBtoTPTPKB.lang and SUMOformulaToTPTPformula.lang fields. THF generation can run in parallel (uses different code path). -
generateProperFile
-
generateFOF
Generate FOF (First-Order Form) TPTP file for a KB. -
waitForFOF
public static boolean waitForFOF(int timeoutSec) Wait for FOF generation to complete.- Parameters:
timeoutSec- Maximum time to wait in seconds- Returns:
- true if generation completed successfully, false if timed out
-
waitForTFF
public static boolean waitForTFF(int timeoutSec) Wait for TFF generation to complete.- Parameters:
timeoutSec- Maximum time to wait in seconds- Returns:
- true if generation completed successfully, false if timed out
-
waitForTHFModal
public static boolean waitForTHFModal(int timeoutSec) Wait for THF Modal generation to complete.- Parameters:
timeoutSec- Maximum time to wait in seconds- Returns:
- true if generation completed successfully, false if timed out
-
waitForTHFPlain
public static boolean waitForTHFPlain(int timeoutSec) Wait for THF Plain generation to complete.- Parameters:
timeoutSec- Maximum time to wait in seconds- Returns:
- true if generation completed successfully, false if timed out
-
isFOFReady
public static boolean isFOFReady()Check if FOF generation is ready. -
isTFFReady
public static boolean isTFFReady()Check if TFF generation is ready. -
isTHFModalReady
public static boolean isTHFModalReady()Check if THF Modal generation is ready. -
isTHFPlainReady
public static boolean isTHFPlainReady()Check if THF Plain generation is ready. -
isFOFGenerating
public static boolean isFOFGenerating()Check if FOF generation is currently in progress. -
isTFFGenerating
public static boolean isTFFGenerating()Check if TFF generation is currently in progress. -
isTHFModalGenerating
public static boolean isTHFModalGenerating()Check if THF Modal generation is currently in progress. -
isTHFPlainGenerating
public static boolean isTHFPlainGenerating()Check if THF Plain generation is currently in progress. -
isBackgroundGenerating
public static boolean isBackgroundGenerating()Check if any background generation is currently in progress. Used to prevent concurrent serialization during background generation. -
shutdown
public static void shutdown()Shutdown the executor service gracefully.
-