JBMC(1)
π JBMC(1) β User Commands π
okay so bestie, welcome to the jbmc manual page β it's filed under User Commands in the manuals, and it's literally the whole guide to Bounded model checking for Java bytecode. Buckle up, it's long, and we're doing every single flag. no skipping. periodt. π
β¨ NAME β¨
jbmc β Bounded model checking for Java bytecode π¦
β¨ SYNOPSIS β¨
here's the whole shape of it, untouched, exactly as written:
jbmc [-?] [-h] [--help]
show help
jbmc method-name
Use the fully qualified name of a method as entry point, e.g.,
'mypackage.Myclass.foo:(I)Z'
jbmc class-name
The entry point is the method specified by --function, or
otherwise, the public static void main(String[]) method of the
given class class-name.
jbmc -jar jarfile
JAR file to be checked. The entry point is the method specified
by --function or otherwise, the public static void main(String[])
method of the class specified by --main-class or the main class
specified in the JAR manifest (checked in this order).
jbmc --gb goto-binary
GOTO binary file to be checked. The entry point is the method
specified by --function, or otherwise, the public static void
main(String[]) of the class specified by --main-class (checked in
this order).
so let's vibe-check each one, one at a time π
jbmc [-?] [-h] [--help]β the "help me bestie" invocation. It shows the help. that's it, that's the whole job π«Άjbmc method-nameβ hand it the fully qualified name of a method and that method becomes your entry point. like, for real fully qualified, e.g.'mypackage.Myclass.foo:(I)Z'πjbmc class-nameβ give it a class name instead. the entry point is whatever method--functionsays, or if you didn't set that, it's thepublic static void main(String[])method of the class class-name.jbmc -jar jarfileβ checking a whole JAR file. entry point order is: the method from--function, otherwise thepublic static void main(String[])of the class from--main-class, otherwise the main class in the JAR manifest. and yes, it checks them in this order, no cap.jbmc --gb goto-binaryβ feeding it a GOTO binary file. entry point is the method from--function, otherwise thepublic static void main(String[])of the class from--main-class. again: checked in this order β¨
β¨ DESCRIPTION β¨
okay so the original page has this heading and thenβ¦ nothing. it's giving minimalism. iconic of it honestly π. the whole description lives in the options below, so let's go.
β¨ OPTIONS β¨
πΈ the basics, aka how do i even point this thing at my code
-classpath dirs/jars,-cp dirs/jars,--classpath dirs/jarsβ set the class search path for directories and jar files. you give it a colon-separated list of directories and JAR archives and it goes hunting for class files in there π§--main-class class-nameβ sets the name of the main class.--function nameβ sets the entry point function name.
π Analysis options:
--show-propertiesβ show the properties, but do not run the analysis. just a little peek, no commitment π--symex-coverage-report fβ generate a Cobertura XML coverage report, written into f.--property idβ only check one specific property. just the one. main character property π--traceβ give a counterexample trace for failed properties. receipts for the fail π--stop-on-failβ stop the analysis the second a failed property shows up. this implies--trace, so you get the receipts too.--localize-faultsβ localize faults. it's experimental, bestie.--validate-traceβ throws an error if the structure of the counterexample trace doesn't match certain assumptions. also experimental, and currently java only.
π Platform options:
--arch archβ set the analysis architecture. defaults to the host architecture. use one of:alpha,arm,arm64,armel,armhf,hppa,i386,ia64,mips,mips64,mips64el,mipsel,mipsn32,mipsn32el,powerpc,ppc64,ppc64le,riscv64,s390,s390x,sh4,sparc,sparc64,v850,x32,x86_64, ornone.--os osβ set the analysis operating system. defaults to the host operating system. use one of:freebsd,linux,macos,netbsd,openbsd,solaris,hurd, orwindows.--i386-linux,--i386-win32,--i386-macos,--ppc-macos,--win32,--winx64β set the analysis architecture and operating system, in one lil combo move.--LP64,--ILP64,--LLP64,--ILP32,--LP32β set the width of int, long and pointers. note that this does not override the default architecture and operating system π«Ά--16,--32,--64β equivalent to--LP32,--ILP32,--LP64respectively (on Windows:--LLP64).--little-endianβ allow little-endian word-byte conversions.--big-endianβ allow big-endian word-byte conversions.--gccβ use GCC as preprocessor.
π§ Program representations:
--show-parse-treeβ show the parse tree π³--show-symbol-tableβ show the loaded symbol table.--list-symbolsβ list symbols, with type information.--show-goto-functionsβ show the loaded goto program.--list-goto-functionsβ list the loaded goto functions.--drop-unused-functionsβ drop functions that are trivially unreachable from the main function. bye, you're not needed π--show-class-hierarchyβ show the class hierarchy.
π Program instrumentation options:
--no-assertionsβ ignore user assertions.--no-assumptionsβ ignore user assumptions.--mm MMβ memory consistency model for concurrent programs.--reachability-sliceβ remove instructions that cannot appear on a trace from the entry point to a property.--reachability-slice-fbβ remove instructions that cannot appear on a trace from the entry point through a property.--full-sliceβ run the full slicer. it's experimental βοΈ
β Java Bytecode frontend options:
--disable-uncaught-exception-checkβ ignore uncaught exceptions and errors.--throw-assertion-errorβ throwjava.lang.AssertionErroron violated assert statements instead of failing at the location of the assert statement.--throw-runtime-exceptionsβ make implicit runtime exceptions explicit.--assert-no-exceptions-thrownβ transformthrowinstructions intoassert FALSEfollowed byassume FALSE.--max-nondet-array-length Nβ limit nondet (e.g. input) array size to at most N.--max-nondet-tree-depth Nβ limit the size of the nondet (e.g. input) object tree; at level N, references are set tonull.--java-assume-inputs-non-nullβ never initialize a reference-typed parameter to the entry point withnull.--java-assume-inputs-interval [L:U]or[L:]or[:U]β force numerical primitive-typed inputs (byte,short,int,long,float,double) to be initialized within the given range. the lower bound L and upper bound U must be integers. heads up: this does not work for arrays π«--java-assume-inputs-integralβ forcefloatanddoubleinputs to have integer values; does not work for arrays;--java-max-vla-length Nβ limit the length of user-code-created arrays to N.--java-cp-include-files rβ regular expression or JSON list of files to load (with a'@'prefix).--java-load-class CLASSβ also load code from class CLASS.--java-no-load-class CLASSβ never load code from class CLASS.--ignore-manifest-main-classβ ignoreMain-Classentries in JAR manifest files. if this option is specified and the options--functionand--main-classare not, then we can be certain that all classes in the JAR file are loaded. cute little guarantee π--context-include i,--context-exclude eβ only analyze code matching specification i that does not match specification e, if--context-exclude eis also used. all other methods are excluded, i.e., we load their signatures and meta-information, but not their bodies. a specification is any prefix of a package, class or method name, e.g."org.cprover."or"org.cprover.MyClass."or"org.cprover.MyClass.methodToStub:(I)Z". these options can be given multiple times. the default for context-include is'all included'; default for context-exclude is'nothing excluded'.--no-lazy-methodsβ load and translate all methods given on the command line and in--classpath. default is to load methods that appear to be reachable from the--functionentry point or main class. note that--show-symbol-table,--show-goto-functionsand--show-propertiesoutput are restricted to loaded methods by default.--lazy-methods-extra-entry-point METHODNAMEβ treat METHODNAME as a possible program entry point for the purpose of lazy method loading. METHODNAME can be a regular expression that will be matched against all symbols. if missing, ajava::prefix will be added. if no descriptor is found, all overloads of a method will also be added.--static-values fβ load initial values of static fields from the given JSON file. we assign static fields to these values instead of calling the normal static initializer (clinit) method. the argument can be a relative or absolute path to the file.--java-lift-clinit-callsβ liftsclinitcalls in function bodies to the top of the function. this may reduce the overall cost of static initialisation, but may be unsound if there are cyclic dependencies between static initializers, because it can potentially change their order of execution, or if static initializers have side-effects such as updating another class' static field. β οΈ--java-threadingβ enable java multi-threading support. experimental.--java-unwind-enum-staticβ unwind loops in static initialization of enums.--symex-driven-lazy-loadingβ only load functions when first entered by symbolic execution. note that--show-symbol-table,--show-goto-functions/propertiesoutput will be restricted to loaded methods in this case, and only output after the symex phase.
π¦ Semantic transformations:
--nondet-staticβ add nondeterministic initialization of variables with static lifetime.
π₯ BMC options:
--paths [strategy]β explore paths one at a time.--show-symex-strategiesβ list strategies for use with--paths.--show-goto-symex-stepsβ show which steps symex travels. includes diagnostic information π§--show-points-to-setsβ show points-to sets for pointer dereference. requires--json-ui.--program-onlyβ only show program expression.--show-byte-opsβ show all byte extracts and updates.--depth nrβ limit search depth.--max-field-sensitivity-array-size Mβ maximum size M of arrays for which field sensitivity will be applied to the array. the default is64.--no-array-field-sensitivityβ deactivate field sensitivity for arrays. this is equivalent to setting the maximum field sensitivity size for arrays to0.--show-loopsβ show the loops in the program π--unwind nrβ unwind all loops at most nr times.--unwindset [T:]L:B,...β unwind loop L with a bound of B, optionally restricted to thread T, and overriding what may be set as default unwinding via--unwind. (use--show-loopsto get the loop IDs π)--incremental-loop Lβ check properties after each unwinding of loop L. (use--show-loopsto get the loop IDs)--unwind-min nrβ start incremental-loop after nr unwindings but before solving that iteration. if for example it is1, then the loop will be unwound once, and immediately checked. Note: this means for min-unwind1or0all properties are checked.--unwind-max nrβ stop incremental-loop after nr unwindings.--ignore-properties-before-unwind-minβ do not check properties before unwind-min when using incremental-loop.--show-vccβ show the verification conditions.--slice-formulaβ remove assignments unrelated to property.--unwinding-assertionsβ generate unwinding assertions (which are enabled by default; overrides--no-unwinding-assertionswhen both of these are given); cannot be used with--cover. π«--no-unwinding-assertionsβ do not generate unwinding assertions.--partial-loopsβ permit paths that execute loops only partially (up to the given unwinding bound) and then continue beyond the loop even when the loop condition would still hold (such paths may be spurious, resulting in false alarms). π--no-self-loops-to-assumptionsβ do not simplifywhile(1){}toassume(0).--symex-complexity-limit Nβ how complex (N) a path can become before symex abandons it. Currently uses guard size to calculate complexity.--symex-complexity-failed-child-loops-limit Nβ how many child branches (N) in an iteration are allowed to fail due to complexity violations before the loop gets blacklisted.--graphml-witness filenameβ write the witness in GraphML format tofilename.--symex-cache-dereferencesβ enable caching of repeated dereferences. π
Backend options: the solver menu β¨
--object-bits nβ number of bits used for object addresses.--sat-solver solverβ use specified SAT solver.--external-sat-solver cmdβ command to invoke SAT solver process.--no-sat-preprocessorβ disable the SAT solver's simplifier.--dimacsβ generate CNF in DIMACS format.--beautifyβ beautify the counterexample (greedy heuristic). π--smt1β use default SMT1 solver (obsolete). β οΈ--smt2β use default SMT2 solver (Z3).--bitwuzlaβ use Boolector.--boolectorβ use Boolector.--cprover-smt2β use CPROVER SMT2 solver.--cvc3β use CVC3.--cvc4β use CVC4.--cvc5β use CVC5.--mathsatβ use MathSAT.--yicesβ use Yices.--z3β use Z3.--fpaβ use theory of floating-point arithmetic.--refineβ use refinement procedure (experimental). π§ͺ--refine-arraysβ use refinement for arrays only.--refine-arithmeticβ refinement of arithmetic expressions only.--max-node-refinementβ maximum refinement iterations for arithmetic expressions.--incremental-smt2-solver cmdβ command to invoke external SMT solver for incremental solving (experimental). π§ͺ--outfile filenameβ output formula to given file.--dump-smt-formula filenameβ output smt incremental formula to the given file.--write-solver-stats-to json-fileβ collect the solver query complexity.--no-refine-stringsβ turn off string refinement.--string-printableβ restrict to printable strings and characters.--string-non-emptyβ restrict to non-empty strings (experimental). π§ͺ--string-input-value stβ restrict non-null strings to a fixed valuest; the switch can be used multiple times to give several strings.--max-nondet-string-length nβ bound the length of nondet (e.g. input) strings. Default is67108863; note that setting the value higher than this does not work with--traceor--validate-trace. π¬--arrays-uf-neverβ never turn arrays into uninterpreted functions.--arrays-uf-alwaysβ always turn arrays into uninterpreted functions.
Other options: the little extras π
--versionβ show version and exit.--xml-uiβ use XML-formatted output.--xml-interfaceβ bi-directional XML interface.--json-uiβ use JSON-formatted output.--json-interfaceβ bi-directional JSON interface.--validate-goto-modelβ enable additional well-formedness checks on the goto program.--validate-ssa-equationβ enable additional well-formedness checks on the SSA representation.--trace-json-extendedβ addrawLhsproperty to trace.--trace-show-function-callsβ show function calls in plain trace.--trace-show-codeβ show original code in plain trace.--trace-hexβ represent plain trace values in hex.--compact-traceβ give a compact trace.--stack-traceβ give a stack trace only.--flushβ flush every line of output.--verbosity #β verbosity level.--timestamp [monotonic|wall]β Print microsecond-precision timestamps.monotonic: stamps increase monotonically.wall: ISO-8601 wall clock timestamps.
ENVIRONMENT π
All tools honor the TMPDIR environment variable when generating temporary files and directories.
BUGS π
If you encounter a problem please create an issue at https://github.com/diffblue/cbmc/issues.
SEE ALSO π
cbmc(1), janalyzer(1), jdiff(1)
COPYRIGHT π
2001-2018, Daniel Kroening, Edmund Clarke
Okay bestie, that's the whole page. This is JBMC(1), from jbmc-5.59.0, dated June 2022. Go verify something cute. π β¨
π¦ where this page comes from
- debian trixie: jbmc 6.6.0-4 Β· BSD-4-Clause
- ubuntu questing: jbmc 6.6.0-4
- ubuntu resolute: jbmc 6.6.0-4ubuntu2 Β· BSD-4-Clause
- ubuntu stonking: jbmc 6.6.0-4ubuntu2 Β· BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms