本文整理汇总了Java中jkind.results.Counterexample类的典型用法代码示例。如果您正苦于以下问题:Java Counterexample类的具体用法?Java Counterexample怎么用?Java Counterexample使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Counterexample类属于jkind.results包,在下文中一共展示了Counterexample类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addViewCounterexampleMenu
import jkind.results.Counterexample; //导入依赖的package包/类
private void addViewCounterexampleMenu(IMenuManager manager, PropertyResult result) {
final Counterexample cex = getCounterexample(result);
if (cex == null) {
return;
}
boolean inductive = result.getProperty() instanceof UnknownProperty;
String text = "View " + (inductive ? "Inductive " : "") + "Counterexample in ";
manager.add(new Action(text + "spreadsheet") {
@Override
public void run() {
viewCexSpreadsheet(cex, layout);
}
});
manager.add(new Action(text + "Eclipse") {
@Override
public void run() {
viewCexEclipse(cex,layout);
}
});
}
示例2: addViewCounterexampleMenu
import jkind.results.Counterexample; //导入依赖的package包/类
private void addViewCounterexampleMenu(IMenuManager manager, PropertyResult result) {
final Counterexample cex = getCounterexample(result);
if (cex == null) {
return;
}
boolean inductive = result.getProperty() instanceof UnknownProperty;
String text = "View " + (inductive ? "Inductive " : "") + "Counterexample in ";
manager.add(new Action(text + "Spreadsheet") {
@Override
public void run() {
viewCexSpreadsheet(cex, layout);
}
});
manager.add(new Action(text + "Eclipse") {
@Override
public void run() {
viewCexEclipse(cex, layout);
}
});
}
示例3: receiveCex
import jkind.results.Counterexample; //导入依赖的package包/类
public void receiveCex(final ComponentImplementation compImpl, Property property, EObject agreeProperty, final Counterexample cex, final Map<String, EObject> refMap, final Mode mode) {
// Launch the simulation
final SimulationService simulationService = Objects.requireNonNull((SimulationService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(SimulationService.class), "Unable to retrieve simulation service");
final SimulationLaunchShortcut launchShortcut = new SimulationLaunchShortcut();
try {
final boolean isInductiveCex = property instanceof UnknownProperty;
final ILaunch launch = launchShortcut.launch(compImpl, isInductiveCex ? mode.inductiveEngineTypeId : mode.engineTypeId, ILaunchManager.RUN_MODE);
// Get the simulation engine
final SimulationEngine simulationEngine = getSimulationEngine(launch);
if(simulationEngine instanceof AGREESimulationEngine) {
final AGREESimulationEngine agreeSimulationEngine = (AGREESimulationEngine)simulationEngine;
final SimulationUIService simulationUIService = Objects.requireNonNull((SimulationUIService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(SimulationUIService.class), "Unable to retrieve simulation UI service");
final Map<String, Object> signalNameToSimStateElementMap = buildAgreeNameToSimulationStateElementMap(agreeSimulationEngine);
simulateCounterexample(cex, 0, signalNameToSimStateElementMap, agreeSimulationEngine, simulationService, simulationUIService);
}
} catch (final Exception e) {
simulationService.getExceptionHandler().handleException(e);
}
}
示例4: addElementToCounterexample
import jkind.results.Counterexample; //导入依赖的package包/类
private static void addElementToCounterexample(final Counterexample cex, final Object element, final AGREESimulationState engineState) {
assert engineState.getElementLustreId(element) != null;
// Create the signal
final Signal<Value> newSignal = new Signal<>(engineState.getElementLustreId(element));
// Populate the signal's values
final int numberOfFrames = engineState.getNumberOfFrames();
for(int frameIndex = 0; frameIndex < numberOfFrames; frameIndex++) {
final Value value = engineState.getElementLustreValue(frameIndex, element);
if(value != null) {
newSignal.putValue(frameIndex, value);
}
}
// Add signal to the counterexample
cex.addSignal(newSignal);
}
示例5: viewCexEclipse
import jkind.results.Counterexample; //导入依赖的package包/类
private void viewCexEclipse(Counterexample cex, Layout layout) {
try {
JKindCounterexampleView cexView = (JKindCounterexampleView) window.getActivePage().showView(JKindCounterexampleView.ID);
cexView.setInput(cex, layout);
cexView.setFocus();
} catch (PartInitException e) {
e.printStackTrace();
}
}
示例6: viewCexSpreadsheet
import jkind.results.Counterexample; //导入依赖的package包/类
private void viewCexSpreadsheet(Counterexample cex, Layout layout) {
try {
File file = File.createTempFile("cex", ".xls");
cex.toExcel(file, layout);
Program.launch(file.toString());
} catch (IOException e) {
MessageDialog.openError(table.getControl().getShell(), "Error opening spreadsheet",
e.getMessage());
e.printStackTrace();
}
}
示例7: getCounterexample
import jkind.results.Counterexample; //导入依赖的package包/类
private static Counterexample getCounterexample(PropertyResult result) {
Property prop = result.getProperty();
if (prop instanceof InvalidProperty) {
return ((InvalidProperty) prop).getCounterexample();
} else if (prop instanceof UnknownProperty) {
return ((UnknownProperty) prop).getInductiveCounterexample();
} else {
return null;
}
}
示例8: viewCexEclipse
import jkind.results.Counterexample; //导入依赖的package包/类
private void viewCexEclipse(Counterexample cex, Layout layout) {
try {
JKindCounterexampleView cexView = (JKindCounterexampleView) window.getActivePage()
.showView(JKindCounterexampleView.ID);
cexView.setInput(cex, layout);
cexView.setFocus();
} catch (PartInitException e) {
e.printStackTrace();
}
}
示例9: TestCase
import jkind.results.Counterexample; //导入依赖的package包/类
public TestCase(String name, String description, Counterexample cex,
Set<Obligation> satisfiedObligations) {
super();
this.name = name;
this.description = description;
this.cex = cex;
this.satisfiedObligations = satisfiedObligations;
}
示例10: viewCexEclipse
import jkind.results.Counterexample; //导入依赖的package包/类
private void viewCexEclipse(Counterexample cex, Layout layout, Map<String, EObject> refMap) {
try {
TestCaseGeneratorTestCaseView tcView = (TestCaseGeneratorTestCaseView) window.getActivePage().showView(
TestCaseGeneratorTestCaseView.ID);
tcView.setInput(cex, layout, refMap);
tcView.setFocus();
} catch (PartInitException e) {
e.printStackTrace();
}
}
示例11: viewCexSpreadsheet
import jkind.results.Counterexample; //导入依赖的package包/类
private void viewCexSpreadsheet(Counterexample cex, Layout layout) {
try {
File file = File.createTempFile("cex", ".xls");
cex.toExcel(file, layout);
org.eclipse.swt.program.Program.launch(file.toString());
} catch (IOException e) {
Dialog.showError("Unable to open spreadsheet", e.getMessage());
e.printStackTrace();
}
}
示例12: constructTests
import jkind.results.Counterexample; //导入依赖的package包/类
public List<TestCase> constructTests(List<Element> testElements) {
List<TestCase> testCases = new ArrayList<>();
for (Element elem: testElements) {
String name = elem.getAttribute("name");
String description = getTextElement(elem, "Description");
int length = Integer.parseInt(getTextElement(elem, "Length"));
Counterexample cex = getCounterexample(elem,length);
TestCase tc = new TestCase(name, description, cex);
testCases.add(tc);
}
return testCases;
}
示例13: getCounterexample
import jkind.results.Counterexample; //导入依赖的package包/类
private Counterexample getCounterexample(Element cexElement, int k) {
if (cexElement == null) {
return null;
}
Counterexample cex = new Counterexample(k);
for (Element signalElement : getElements(cexElement, getSignalTag())) {
cex.addSignal(getSignal(signalElement));
}
return cex;
}
示例14: receiveCex
import jkind.results.Counterexample; //导入依赖的package包/类
@Override
public void receiveCex(ComponentImplementation compImpl, EObject property, Counterexample cex,
Map<String, EObject> refMap) {
TcgExtractor extractor = getCexExtractor();
if (extractor != null) {
extractor.receiveCex(compImpl, property, cex, refMap);
}
}
示例15: writeTest
import jkind.results.Counterexample; //导入依赖的package包/类
private void writeTest(String name, String description, Counterexample cex) {
try {
out.println(" <Test name=\"" + escapeXml(name) + "\">");
out.println(" <Description>" + escapeXml(description) + "</Description>");
out.println(" <Length>" + cex.getLength() + "</Length>");
writeCounterexample(cex);
out.println(" </Test>");
} catch (Exception e) {
throw new TcgException("Error writing XML Test Suite", e);
}
}