An API that reads the output of kind2 and shows results and suggestions.
$ java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)
$ git clone https://github.com/kind2-mc/kind2-explanations
$ cd kind2-explanations
$ ./gradlew build
$ java -jar build/libs/kind2-explanations-all.jar files/a1.jsonTo import the API, use the jar file build/libs/kind2-explanations.jar.
Alternatively you can just copy the package edu.uiowa.kind2 to your source code.
- Add
build/libs/kind2-expalnations.jarto your java class path. - Import package
edu.uiowa.kind2; - Pass kind2 json output as a string to
Kind2Result.analyzeJsonResult. For example:
String json = new String(Files.readAllBytes(Paths.get("file.json")));
Kind2Result result = Kind2Result.analyzeJsonResult(json);
System.out.println(result.toString());-
Kind2Resultfeatures:getValidProperties,getFalsifiedProperties, andgetUnknownPropertiesreturn properties for all components.getNodeResultreturns an object ofKind2NodeResultthat summarizes all analyses done by kind2 for a given component.
-
Kind2NodeResultfeatures:getSuggestionsreturns an object ofKind2Suggestionthat provides explanations and suggestions based on kind2 analyses for the current component.getValidProperties,getFalsifiedProperties, andgetUnknownPropertiesreturn properties for the current component, and all its subcomponents.
-
Kind2Suggestioncontains explanations and a suggestion for the associated component. IfNis the current component, andMis possibly a subcomponent ofN, then the suggestion is one of the following:noActionRequired: no action required because all components of the system satisfy their contracts, and no component of the system was refined.strengthenSubComponentContract: fixMs contract becauseNis correct after refinement, butM's contract is too weak to proveN's contract, butM's definition is strong enough.completeSpecificationOrRemoveComponent: Either complete specification ofN's contract, or remove componentM, because componentNsatisfies its current contract and one or more assumptions ofMare not satisfied byN.makeWeakerOrFixDefinition: either make assumptionAweaker, or fixN's definition to satisfyA, because componentNdoesn't satisfy its contract after refinement, and assumptionAofMis not satisfied byN.makeAssumptionStrongerOrFixDefinition: Either makeN's assumptions stronger, or fixN's definition to satisfyN's guarantees, because componentNdoesn't satisfy its contract after refinement, and eitherNhas no subcomponents, or all its subcomponents satisfy their contract.fixSubComponentIssues: fix reported issues forN's subcomponents, because componentNdoesn't satisfy its contract after refinement, and One or more subcomponents of N don't satisfy their contract.fixOneModeActive: define all modes of componentN, because kind2 found a state that is not covered by any of the modes inN's contract.increaseTimeout: increase the timeout for kind2, because it fails to prove or disprove one of the properties with the previous timeout.