use of de.prob.statespace.StateSpace in project prob2 by bendisposto.
the class UnitAnalysis method run.
public CompoundPrologTerm run(final String filename) throws IOException, ModelTranslationError {
StateSpace s = api.eventb_load(filename);
final ActivateUnitPluginCommand activatePlugin = new ActivateUnitPluginCommand();
GetPluginResultCommand pluginResultCommand = new GetPluginResultCommand("Grounded Result State");
s.execute(activatePlugin, pluginResultCommand);
return pluginResultCommand.getResult();
}
use of de.prob.statespace.StateSpace in project prob2 by bendisposto.
the class SimpleLoadTest method testLoadBFile.
@Test
public void testLoadBFile() throws IOException, ModelTranslationError {
StateSpace s = api.b_load("src" + File.separator + "test" + File.separator + "resources" + File.separator + "tla" + File.separator + "Foo.mch");
assertNotNull(s);
s.kill();
}
use of de.prob.statespace.StateSpace in project prob2 by bendisposto.
the class SimpleLoadTest method testLoadTLAFileChoose.
@Test
public void testLoadTLAFileChoose() throws IOException, ModelTranslationError {
StateSpace s = api.tla_load("src" + File.separator + "test" + File.separator + "resources" + File.separator + "tla" + File.separator + "Choose.tla");
assertNotNull(s);
s.kill();
}
use of de.prob.statespace.StateSpace in project prob2 by bendisposto.
the class StateSpaceProvider method loadFromCommand.
public StateSpace loadFromCommand(final AbstractModel model, final AbstractElement mainComponent, final Map<String, String> preferences, final AbstractCommand loadCmd) {
StateSpace s = ssProvider.get();
s.setModel(model, mainComponent);
List<AbstractCommand> cmds = new ArrayList<>();
for (Entry<String, String> pref : preferences.entrySet()) {
cmds.add(new SetPreferenceCommand(pref.getKey(), pref.getValue()));
}
try {
s.execute(new ComposedCommand(cmds));
s.execute(loadCmd);
s.execute(new StartAnimationCommand());
} catch (Exception e) {
s.kill();
throw e;
}
return s;
}
use of de.prob.statespace.StateSpace in project prob2 by bendisposto.
the class RulesCheckerTest method testExecuteAllOperations.
@Test
public void testExecuteAllOperations() throws IOException {
StateSpace s = api.brules_load(dir + "RulesMachineExample.rmch");
Trace trace = new Trace(s);
RulesChecker rulesChecker = new RulesChecker(trace);
rulesChecker.init();
rulesChecker.executeAllOperations();
for (Entry<AbstractOperation, OperationStatus> entry : rulesChecker.getOperationStates().entrySet()) {
OperationStatus state = entry.getValue();
if (entry.getKey().getName().equals("RULE_BasedOnRuleWithViolations")) {
assertEquals(RuleStatus.NOT_CHECKED, state);
} else {
assertTrue(state.isExecuted());
}
}
}
Aggregations