public class Kind2Api
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
KIND2 |
| Constructor and Description |
|---|
Kind2Api() |
| Modifier and Type | Method and Description |
|---|---|
void |
apiDebug(java.lang.String text)
Print string to debug log (assuming setApiDebug() has been called)
|
java.lang.String |
checkAvailable()
Check if the KindApi is available for running and throw exception if not
|
void |
disable(Module module)
Disable Kind module, repeat option to disable several modules
|
void |
enable(Module module)
Enable Kind module, repeat option to enable several modules
|
Result |
execute(Program program)
Run Kind on a Lustre program
|
Result |
execute(java.lang.String program)
Run Kind on a Lustre program
|
void |
execute(java.lang.String program,
Result result,
IProgressMonitor monitor)
Run Kind on a Lustre program
|
java.util.List<java.lang.String> |
getOptions() |
void |
includeDir(java.lang.String dir)
Include a directory in the search path.
|
void |
includeDirs(java.util.List<java.lang.String> dirs)
Include directories in the search path.
|
java.lang.String |
interpret(java.net.URI uri,
java.lang.String main,
java.lang.String json) |
void |
outputDir(java.lang.String outputDir)
Output directory for the files generated: SMT traces, compilation, testgen, certification...
|
void |
setApiDebug()
Put the KindApi into debug mode where it saves all output
|
void |
setBoolectorBin(java.lang.String boolectorBin)
Executable of Boolector solver
|
void |
setCheckImplem(boolean checkImplem)
Checks the implementation of nodes
|
void |
setCheckModes(boolean checkModes)
Checks the modes of contracts for exhaustiveness
|
void |
setCheckSatAssume(boolean checkSatAssume)
Use check-sat-assuming, or simulate with push/pop when false
|
void |
setCheckSubproperties(boolean checkSubproperties)
Check properties of subnodes that are relevant for the analysis of the top node.
|
void |
setCompositional(boolean compositional)
Abstract subnodes with a contract
|
void |
setCvc4Bin(java.lang.String cvc4Bin)
Executable of CVC4 solver
|
void |
setDumpCex(boolean dumpCex)
Dump counterexample to a file.
|
void |
setIC3Abstr(IC3Abstraction ic3Abstr)
Choose method of abstraction in IC3
|
void |
setIndPrintCex(boolean indPrintCex)
Print counterexamples to induction
|
void |
setInterpreterInput(java.lang.String json)
Interpreter input as json string
|
void |
setInterpreterInputFile(java.lang.String interpreterInputFile)
Read input from file
|
void |
setInterpreterSteps(int interpreterSteps)
Run number of steps, override the number of steps given in the input file
|
void |
setIVC(boolean ivc)
Enable inductive validity core generation
|
void |
setIVCAll(boolean ivcAll)
Compute all the Minimal Inductive Validity Cores.
|
void |
setIVCApproximate(boolean ivcApproximate)
Compute an approximation (superset) of a MIVC.
|
void |
setIVCCategory(IVCCategory ivcCategory)
Minimize only a specific category of elements, repeat option to minimize multiple categories
|
void |
setIVCMustSet(boolean ivcMustSet)
Compute the MUST set in addition to the IVCs
|
void |
setIVCOnlyMainNode(boolean ivcOnlyMainNode)
Only elements of the main node are considered in the computation
|
void |
setIVCOutputDir(java.lang.String ivcOutputDir)
Output directory for the minimized programs
|
void |
setIVCPrecomputedMCS(int ivcPrecomputedMCS)
When computing all MIVCs, set a cardinality upper bound for the precomputed MCSs (helps prune
space of candidates).
|
void |
setIVCSmallestFirst(boolean ivcSmallestFirst)
Compute a smallest IVC first.
|
void |
setIVCUCTimeout(int ivcUCTimeout)
Set a timeout for each unsat core check sent to the solver.
|
void |
setLogInvs(boolean logInvs)
Logs strengthening invariants as contracts after minimization.
|
void |
setLogLevel(LogLevel logLevel)
Set the level of logs generated by Kind.
|
void |
setLsp(boolean lsp)
Provide AST info for language-servers.
|
void |
setLusMain(java.lang.String lusMain)
Set the top node in the Lustre input file.
|
void |
setMCSAll(boolean mcsAll)
Specify whether all the Minimal Cut Sets must be computed or just one
|
void |
setMCSCategory(MCSCategory category)
Consider only a specific category of elements, repeat option to consider multiple categories
|
void |
setMCSMaxCardinality(int mcsMaxCardinality)
Only search for MCSs of cardinality lower or equal to this parameter.
|
void |
setMCSOnlyMainNode(boolean mcsOnlyMainNode)
Only elements of the main node are considered in the computation
|
void |
setMCSPerProperty(boolean mcsPerProperty)
If true, MCSs will be computed for each property separately
|
void |
setMinimizeProgram(java.lang.String minimizeProgram)
Minimize the source Lustre program according to the inductive validity core(s) computed
"no" to disable this feature
"valid_lustre" to replace useless expressions by a valid node call
"concise" to replace useless expressions by a '_'
|
void |
setModular(boolean modular)
Bottom-up analysis of each node
|
void |
setOldFrontend(boolean oldFrontend)
Use the old Lustre front-end.
|
void |
setOnlyParse(boolean onlyParse)
Only parse the Lustre program.
|
void |
setOtherOptions(java.util.List<java.lang.String> options)
Sets additional options to pass to Kind 2 executable.
|
void |
setPrintIVC(boolean printIVC)
Print the inductive validity core computed
|
void |
setPrintIVCComplement(boolean printIVCComplement)
Print the complement of the inductive validity core computed (= the elements that were not
necessary to prove the properties)
|
void |
setPrintMCS(boolean printMCS)
Print the minimal cut set computed
|
void |
setPrintMCSComplement(boolean printMCSComplement)
Print the complement of the minimal cut set computed (this is equivalent to computing a Maximal
Unsafe Abstraction)
|
void |
setPrintMCSCounterexample(boolean printMCSCounterexample)
Print a counterexample for each MCS found
|
void |
setRealPrecision(java.lang.String realPrecision)
Adjust precision of real values in model output In floating-point format
f<nn> means a
relative error less than 2^-nn |
void |
setRefinement(boolean refinement)
(De)activates refinement in compositional reasoning
|
void |
setSliceNodes(boolean sliceNodes)
Only equations that are relevant for checking the contract and properties of a node are
considered during the analysis
|
void |
setSmtLogic(java.lang.String smtLogic)
Select logic for SMT solvers (none, detect, ALL, QF_UF, LIA, ...)
|
void |
setSmtShortNames(boolean smtShortNames)
Send short variable names to SMT solver, send full names if false
|
void |
setSmtSolver(SolverOption smtSolver)
Choose an SMT solver
|
void |
setSmtTrace(boolean smtTrace)
Write all SMT commands to files
|
void |
setTestgen(boolean testgen)
Activates test generation for systems proved correct
|
void |
setTestgenGraphOnly(boolean testgenGraphOnly)
Only draw the graph of reachable modes, do not log test cases.
|
void |
setTestgenLen(int testgenLen)
Maximum length for test generation
|
void |
setTimeout(float timeout)
Set a maximum run time for entire execution
|
void |
setYices2Bin(java.lang.String yices2Bin)
Executable of Yices2 solver
|
void |
setYicesBin(java.lang.String yicesBin)
Executable of Yices solver
|
void |
setZ3Bin(java.lang.String z3Bin)
Executable of Z3 solver
|
public void setApiDebug()
public void apiDebug(java.lang.String text)
text - text to print to debug logpublic Result execute(Program program)
program - Lustre programpublic Result execute(java.lang.String program)
program - Lustre program as textpublic java.lang.String interpret(java.net.URI uri,
java.lang.String main,
java.lang.String json)
public void execute(java.lang.String program,
Result result,
IProgressMonitor monitor)
program - Lustre program as textresult - Place to store results as they come inmonitor - Used to check for cancellationKind2Exceptionpublic void setOtherOptions(java.util.List<java.lang.String> options)
options - the additional options to kind2public java.util.List<java.lang.String> getOptions()
public void setSmtSolver(SolverOption smtSolver)
Default: detect
smtSolver - the SMT solver to usepublic void setSmtLogic(java.lang.String smtLogic)
Default: detect
smtLogic - the logic to usepublic void setCheckSatAssume(boolean checkSatAssume)
Default: true
checkSatAssume - whether or not to use check-sat-assumingpublic void setSmtShortNames(boolean smtShortNames)
Default: true
smtShortNames - whether or not to send short variable namespublic void setBoolectorBin(java.lang.String boolectorBin)
Default: "boolector"
boolectorBin - path to Boolector executablepublic void setCvc4Bin(java.lang.String cvc4Bin)
Default: "cvc4"
cvc4Bin - path to CVC4 executablepublic void setYicesBin(java.lang.String yicesBin)
Default: "yices"
yicesBin - path to Yices executablepublic void setYices2Bin(java.lang.String yices2Bin)
Default: "yices-smt2"
yices2Bin - path to Yices2 executablepublic void setZ3Bin(java.lang.String z3Bin)
Default: "z3"
z3Bin - path to Z3 executablepublic void setSmtTrace(boolean smtTrace)
Default: false
smtTrace - whether or not to write all SMT commands to filespublic void setIndPrintCex(boolean indPrintCex)
Default: false
indPrintCex - whether or not to print counterexamples to inductionpublic void setIC3Abstr(IC3Abstraction ic3Abstr)
Default: None
ic3Abstr - abstraction methodpublic void setTestgen(boolean testgen)
Default: false
testgen - whether or not to activate test generationpublic void setTestgenGraphOnly(boolean testgenGraphOnly)
Default: false
testgenGraphOnly - whether or not to only draw the graph of reachable modespublic void setTestgenLen(int testgenLen)
Default: 5
testgenLen - maximum length for test generationpublic void setInterpreterInputFile(java.lang.String interpreterInputFile)
interpreterInputFile - path to filepublic void setInterpreterInput(java.lang.String json)
json - interpreter input as jsonpublic void setInterpreterSteps(int interpreterSteps)
Default: 0
interpreterSteps - number of steps to runpublic void setCompositional(boolean compositional)
Default: false
compositional - whether or not to abstract subnodes with a contractpublic void setCheckModes(boolean checkModes)
Default: true
checkModes - whether or not to check if the modes are exhaustivepublic void setCheckImplem(boolean checkImplem)
Default: true
checkImplem - whether or not to check the implementation of nodespublic void setRefinement(boolean refinement)
Default: true
refinement - whether or not to activate refinement in compositional reasoningpublic void setIVC(boolean ivc)
Default: false
ivc - whether or not to enable IVC generationpublic void setIVCCategory(IVCCategory ivcCategory)
Default: minimize all categories of elements
ivcCategory - IVC category to minimizepublic void setIVCAll(boolean ivcAll)
Default: false
ivcAll - whether or not to compute all the MIVCpublic void setIVCApproximate(boolean ivcApproximate)
Default: true
ivcApproximate - whether or not to compute an approximation of a MIVCpublic void setIVCSmallestFirst(boolean ivcSmallestFirst)
Default: false
ivcSmallestFirst - whether or not to compute a smallest IVC firstpublic void setIVCOnlyMainNode(boolean ivcOnlyMainNode)
Default: false
ivcOnlyMainNode - whether or not to consider only elements of the main nodepublic void setIVCMustSet(boolean ivcMustSet)
Default: false
ivcMustSet - whether or not to compute the MUST setpublic void setPrintIVC(boolean printIVC)
Default: true
printIVC - whether or not to print the inductive validity corepublic void setPrintIVCComplement(boolean printIVCComplement)
Default: false
printIVCComplement - whether or not to print the complement of the IVC computedpublic void setMinimizeProgram(java.lang.String minimizeProgram)
Default: "no"
minimizeProgram - whether or not to minimize program according to IVC computedpublic void setIVCOutputDir(java.lang.String ivcOutputDir)
Default: <INPUT_FILENAME>
ivcOutputDir - output directory for the minimized programspublic void setIVCPrecomputedMCS(int ivcPrecomputedMCS)
Default: 0
ivcPrecomputedMCS - cardinality upper bound for the computed MCSspublic void setIVCUCTimeout(int ivcUCTimeout)
Default: 0
ivcUCTimeout - timeout for each unsat core check sent to the solverpublic void setMCSCategory(MCSCategory category)
Default: annotations
category - MCS category to considerpublic void setMCSOnlyMainNode(boolean mcsOnlyMainNode)
Default: false
mcsOnlyMainNode - whether or not to consider only elements of the main nodepublic void setMCSAll(boolean mcsAll)
Default: false
mcsAll - whether all the Minimal Cut Sets must be computed or just onepublic void setMCSMaxCardinality(int mcsMaxCardinality)
Default: -1
mcsMaxCardinality - max cardinality of MCSs to search forpublic void setPrintMCS(boolean printMCS)
Default: true
printMCS - whether or not to print the MCSpublic void setPrintMCSComplement(boolean printMCSComplement)
Default: false
printMCSComplement - whether or not to print the MCS complementpublic void setPrintMCSCounterexample(boolean printMCSCounterexample)
Default: false
printMCSCounterexample - whether or not to print a counterexample for each MCSpublic void setMCSPerProperty(boolean mcsPerProperty)
Default: true
mcsPerProperty - whether or not to compute MCSs for each property separatelypublic void outputDir(java.lang.String outputDir)
Default: tmp/<filename>.out
outputDir - path to output directory for the files generatedpublic void includeDir(java.lang.String dir)
dir - the directory to includepublic void includeDirs(java.util.List<java.lang.String> dirs)
dirs - the directories to includepublic void setRealPrecision(java.lang.String realPrecision)
f<nn> means a
relative error less than 2^-nn
Default: rational
realPrecision - can be "rational" or "float"public void setLogInvs(boolean logInvs)
Default: false
logInvs - whether or not to log strengthening invariantspublic void setDumpCex(boolean dumpCex)
Default: false
dumpCex - whether or not to dump counterexamplepublic void setTimeout(float timeout)
timeout - A positive timeout in secondspublic void setOldFrontend(boolean oldFrontend)
Default: true
oldFrontend - whether or not to use the old Lustre front-end.public void setOnlyParse(boolean onlyParse)
Default: false
onlyParse - whether or not to only parse the Lustre programpublic void setLsp(boolean lsp)
Default: false
lsp - whether or not to provide AST info.public void enable(Module module)
Default: [BMC, IND, IND2, IC3, INVGEN, INVGENOS, INVGENINTOS, INVGENMACHOS, INVGENREALOS]
module - the module to enablepublic void disable(Module module)
module - the module to disablepublic void setModular(boolean modular)
Default: false
modular - whether or not enable modular analysispublic void setSliceNodes(boolean sliceNodes)
Default: true
sliceNodes - whether or not to consider only relative equationspublic void setCheckSubproperties(boolean checkSubproperties)
Default: false
checkSubproperties - whether or not to check subpropertiespublic void setLogLevel(LogLevel logLevel)
Default: NOTE
logLevel - the log levelpublic void setLusMain(java.lang.String lusMain)
Default: "--%MAIN" annotation in source if any, last node otherwise
lusMain - the main nodepublic java.lang.String checkAvailable()
throws java.lang.Exception
java.lang.Exception - When Kind is not available