Skip to content

Commit c2c7632

Browse files
committed
Fixed failing test by readding generation guard in vampire
1 parent 60bcb8b commit c2c7632

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/java/com/articulate/sigma/tp/Vampire.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ portions copyright Teknowledge (c) 2003 and reused under the terms of the GNU li
2121
import com.articulate.sigma.trans.SessionTPTPManager;
2222
import com.articulate.sigma.trans.THFnew;
2323
import com.articulate.sigma.trans.TPTP3ProofProcessor;
24+
import com.articulate.sigma.trans.TPTPGenerationManager;
2425
import com.articulate.sigma.trans.TPTPutil;
2526
import com.articulate.sigma.utils.FileUtil;
2627
import com.articulate.sigma.utils.StringUtil;
@@ -181,6 +182,13 @@ else if ("tff".equalsIgnoreCase(requestedTptpLang)){
181182
this.timeout = timeout;
182183
this.maxAnswers = maxAnswers;
183184
this.inferenceFilePath = KBmanager.getMgr().getPref("kbDir") + File.separator + KBmanager.getMgr().getPref("sumokbname") + "." + this.inferenceFileExtension;
185+
if (!(new File(this.inferenceFilePath).exists()) || KBmanager.getMgr().infBaseFileOldIgnoringUserAssertions(this.inferenceFileExtension)) {
186+
System.out.println("INFO in KB.loadVampire(): this.inferenceFilePath=" + !(new File(this.inferenceFilePath).exists()));
187+
System.out.println("INFO in KB.loadVampire(): managerInfFileOld " + KBmanager.getMgr().infFileOld());
188+
synchronized (kb.baseGenLock) {
189+
TPTPGenerationManager.generateProperFile(kb, this.requestedTptpLanguage);
190+
}
191+
}
184192
}
185193

186194
/***************************************************************
@@ -371,6 +379,18 @@ public void askVampireHOL(String stmt, boolean useModals) {
371379
File thfAxioms = new File(kbThfPath);
372380
if (!thfAxioms.exists()) {
373381
System.out.println("Vampire.askVampireHOL(): no such file: " + kbThfPath + ". Waiting for background generation or creating it.");
382+
// Wait for background THF generation if in progress, otherwise generate synchronously
383+
if (useModals) {
384+
if (!TPTPGenerationManager.waitForTHFModal(600)) {
385+
System.out.println("Vampire.askVampireHOL(): Background generation not ready, generating THF Modal synchronously");
386+
THFnew.transModalTHF(this.kb);
387+
}
388+
} else {
389+
if (!TPTPGenerationManager.waitForTHFPlain(600)) {
390+
System.out.println("Vampire.askVampireHOL(): Background generation not ready, generating THF Plain synchronously");
391+
THFnew.transPlainTHF(this.kb);
392+
}
393+
}
374394
}
375395
// -------- 2. Prepare temp-stmt.thf and temp-comb.thf (mirrors FOF/TFF run() pattern) --------
376396
String stmtFile = dir + "temp-stmt." + this.inferenceFileExtension;

0 commit comments

Comments
 (0)