StandaloneContext¶
-
public class
StandaloneContext
extends io.cocotec.coco.platform.coco.Context¶ A Context that allows new modules to be loaded.
Constructors¶
Methods¶
addDiagnosticsConsumer¶
-
public void
addDiagnosticsConsumer
(io.cocotec.coco.platform.coco.DiagnosticConsumer consumer)¶ Adds a diagnostic consumer that will receive diagnostics about errors found about nodes within this Context. The caller is responsible for ensuring that the DiagnosticConsumer remains valid whilst the context is active: the context does not take ownership of the DiagnosticConsumer at all.
addImportPath¶
addPackageDependency¶
addPackageSource¶
addVerificationProgressListener¶
-
public void
addVerificationProgressListener
(io.cocotec.coco.platform.coco.VerificationProgressListener listener)¶ Adds a verification progress monitor that will receive callbacks about verification events in this Context. The caller is responsible for ensuring that the VerificationProgressListener remains valid whilst the context is active: the context does not take ownership of the VerificationProgressListener at all.
getOrCreate¶
-
public static StandaloneContext
getOrCreate
(APIClient client, long objectId)¶ Internal method
internalExportModuleEmf¶
internalLoadBinaryModule¶
internalNodeEmfUri¶
internalNodeWithEmfUri¶
internalPrintBinaryModule¶
internalPrintBinaryModule¶
loadModule¶
-
public io.cocotec.coco.platform.coco.Node
loadModule
(String moduleImportPath, io.cocotec.coco.platform.coco.ModulePathType modulePathType)¶ Loads the given module. If this module is already loaded, this will not reload the module.
Parameters: - moduleImportPath – This should either be a path to the given file relative to one of the import paths, or the name of a module.
- modulePathType – The type of the argument to module_import_path.
Returns: The root Coco element. If loading fails this will be an invalid node in which case diagnostics will be reported to this Context’s DiagnosticConsumer.
loadModule¶
-
public io.cocotec.coco.platform.coco.Node
loadModule
(String moduleImportPath, String moduleData)¶ Loads the given module using the specified data as its contents.
Parameters: - moduleImportPath – The path to the module in the form of A.B.C (i.e. ModulePathType::ModulePath).
- moduleData – The Coco source code for the given module.
Returns: The root Coco element. If loading fails this will be an invalid node in which case diagnostics will be reported to this Context’s DiagnosticConsumer.
loadPackageModules¶
-
public java.util.ArrayList<io.cocotec.coco.platform.coco.Node>
loadPackageModules
()¶ Loads all modules in the package. Requires that load_root_package has been called.
Returns: The nodes for each of the modules that are loaded. If any module could not be loaded, then its corresponding node will not be valid.
loadRootPackage¶
-
public boolean
loadRootPackage
(String directoryPath)¶ Loads a Coco package, making all modules in the package available for loading. This can only be called prior to the other load methods, since it will affect how all subsequent modules are loaded into this context.
Parameters: - directoryPath – The path to the directory containing a Coco.toml file to load.
Returns: true if an error occurred. If an error was raised, a diagnostic will have been reported to this context’s DiagnosticConsumer.
moduleAssertion¶
rootAssertion¶
-
public io.cocotec.coco.platform.coco.VerificationAssertion
rootAssertion
()¶ The root assertion for this context.
setDeterministicCounterexamples¶
-
public void
setDeterministicCounterexamples
(boolean deterministicCounterexamples)¶ Controls whether the verification will be guaranteed to generate counterexamples deterministically. This means that the same input will always give the same result. Note that enabling this may increase verification time.