Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package net.automatalib.modelcheckers.ltsmin;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -177,6 +178,27 @@ public Function<String, I> getString2Input() {
throw new ModelCheckingException(ioe);
}

final File ltlFile;

try {
// create a file that will contain the LTL of the specification
ltlFile = File.createTempFile("formula", ".ltl");

try {
// write to the file
FileWriter writer = new FileWriter(ltlFile);
writer.write(formula);
writer.close();
} catch (IOException ioe) {
if (!keepFiles && !ltlFile.delete()) {
LOGGER.warn("Could not delete file: " + ltlFile.getAbsolutePath());
}
throw ioe;
}
} catch (IOException ioe) {
throw new ModelCheckingException(ioe);
}

final File gcf;

try {
Expand All @@ -195,7 +217,7 @@ public Function<String, I> getString2Input() {
// add the ETF file that contains the hypothesis
etf.getAbsolutePath(),
// add the LTL formula
"--ltl=" + formula,
"--ltl=" + ltlFile,
// write the trace to this file
"--trace=" + gcf.getAbsolutePath(),
// use only one thread (hypotheses are always small)
Expand Down Expand Up @@ -259,6 +281,9 @@ public Function<String, I> getString2Input() {
if (!etf.delete()) {
LOGGER.warn("Could not delete file: " + etf.getAbsolutePath());
}
if (!ltlFile.delete()) {
LOGGER.warn("Could not delete file: " + ltlFile.getAbsolutePath());
}
if (!gcf.delete()) {
LOGGER.warn("Could not delete file: " + gcf.getAbsolutePath());
}
Expand Down