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.json
To 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.jar
to 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());
-
Kind2Result
features:getValidProperties
,getFalsifiedProperties
, andgetUnknownProperties
return properties for all components.getNodeResult
returns an object ofKind2NodeResult
that summarizes all analyses done by kind2 for a given component.
-
Kind2NodeResult
features:getSuggestions
returns an object ofKind2Suggestion
that provides explanations and suggestions based on kind2 analyses for the current component.getValidProperties
,getFalsifiedProperties
, andgetUnknownProperties
return properties for the current component, and all its subcomponents.
-
Kind2Suggestion
contains explanations and a suggestion for the associated component. IfN
is the current component, andM
is 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
: fixM
s contract becauseN
is 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 componentN
satisfies its current contract and one or more assumptions ofM
are not satisfied byN
.makeWeakerOrFixDefinition
: either make assumptionA
weaker, or fixN
's definition to satisfyA
, because componentN
doesn't satisfy its contract after refinement, and assumptionA
ofM
is not satisfied byN
.makeAssumptionStrongerOrFixDefinition
: Either makeN
's assumptions stronger, or fixN
's definition to satisfyN
's guarantees, because componentN
doesn't satisfy its contract after refinement, and eitherN
has no subcomponents, or all its subcomponents satisfy their contract.fixSubComponentIssues
: fix reported issues forN
's subcomponents, because componentN
doesn'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.