當前位置: 首頁>>代碼示例>>Java>>正文


Java Counterexample類代碼示例

本文整理匯總了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);
		}


	});
}
 
開發者ID:AFifarek,項目名稱:SpeAR,代碼行數:26,代碼來源:JKindMenuListener.java

示例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);
		}
	});
}
 
開發者ID:agacek,項目名稱:jkind-xtext,代碼行數:22,代碼來源:JKindMenuListener.java

示例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);			
	}		
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:21,代碼來源:CounterexampleLoaderHelper.java

示例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);
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:19,代碼來源:ExportAction.java

示例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();
	}
}
 
開發者ID:AFifarek,項目名稱:SpeAR,代碼行數:10,代碼來源:JKindMenuListener.java

示例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();
	}
}
 
開發者ID:AFifarek,項目名稱:SpeAR,代碼行數:12,代碼來源:JKindMenuListener.java

示例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;
	}
}
 
開發者ID:AFifarek,項目名稱:SpeAR,代碼行數:11,代碼來源:JKindMenuListener.java

示例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();
	}
}
 
開發者ID:agacek,項目名稱:jkind-xtext,代碼行數:11,代碼來源:JKindMenuListener.java

示例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;
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:9,代碼來源:TestCase.java

示例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();
    }
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:11,代碼來源:TestCaseGeneratorMenuListener.java

示例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();
    }
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:11,代碼來源:TestCaseGeneratorMenuListener.java

示例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;
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:13,代碼來源:TcgXmlReader.java

示例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;
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:12,代碼來源:TcgXmlReader.java

示例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);
    }
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:10,代碼來源:TcgExtractorProxy.java

示例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);
	}
}
 
開發者ID:smaccm,項目名稱:smaccm,代碼行數:12,代碼來源:TcgXmlWriter.java


注:本文中的jkind.results.Counterexample類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。