use of de.prob.model.eventb.translate.EventBModelTranslator in project prob2 by bendisposto.
the class Api method eventb_save.
/**
* Save an EventB {@link StateSpace} to the given file.
*
* @param s the {@link StateSpace} to save, whose model must be an EventB model
* @param path the path of the file to save to
*/
public void eventb_save(final StateSpace s, final String path) throws IOException, ModelTranslationError {
final EventBModelTranslator translator = new EventBModelTranslator((EventBModel) s.getModel(), s.getMainComponent());
try (final FileOutputStream fos = new FileOutputStream(path)) {
final PrologTermOutput pto = new PrologTermOutput(fos, false);
pto.openTerm("package");
translator.printProlog(pto);
pto.closeTerm();
pto.fullstop();
pto.flush();
}
}
Aggregations