{"id":28615563,"url":"https://github.com/ocamlpro/mikino_bin","last_synced_at":"2025-07-19T22:04:55.033Z","repository":{"id":40299300,"uuid":"400753563","full_name":"OCamlPro/mikino_bin","owner":"OCamlPro","description":"A simple induction and BMC engine.","archived":false,"fork":false,"pushed_at":"2022-05-16T12:50:47.000Z","size":507,"stargazers_count":23,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-12T02:09:27.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCamlPro.png","metadata":{"files":{"readme":"README.md","changelog":"changes.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-28T09:29:04.000Z","updated_at":"2024-12-16T22:33:19.000Z","dependencies_parsed_at":"2022-08-18T23:11:06.330Z","dependency_job_id":null,"html_url":"https://github.com/OCamlPro/mikino_bin","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/OCamlPro/mikino_bin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmikino_bin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmikino_bin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmikino_bin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmikino_bin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCamlPro","download_url":"https://codeload.github.com/OCamlPro/mikino_bin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fmikino_bin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266026245,"owners_count":23866031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T02:09:25.890Z","updated_at":"2025-07-19T22:04:54.543Z","avatar_url":"https://github.com/OCamlPro.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Mikino is a (relatively) simple induction and BMC engine. Its goal is to serve as a simple yet\ninteresting tool for those interested in formal verification, especially SMT-based induction. For\ninstance, mikino as an input language much easier to get into than SMT-LIB 2 (the SMT solver input\nlanguage standard). Also, we took great care in making its output as readable and easy to understand\nas possible.\n\n![crates.io](https://img.shields.io/crates/v/mikino_api.svg)\n\nMikino comes with [a tutorial on SMT, induction (and strengthening)][dummies]. Definitely read it if\nyou're new to either of these topics, or just take a look at the examples throughout to get a taste\nof mikino. See the [gallery](#gallery) for screenshots of mikino's awesome output.\n\n\u003e *\"Mikino\"* does **not** mean *cinema*. It is a contraction of *\"mini\"* and *\"kinō\"* (帰納:\n\u003e induction, recursion). It is a significantly simpler version of the now defunct [kino]\n\u003e `k`-induction engine on transition systems.\n\nContents:\n- [Installing](#installing)\n- [Basics](#basics)\n- [SMT Solver (Z3)](#smt-solver-z3)\n- [Building From Source](#building-from-source)\n- [Transition Systems](#transition-systems)\n- [Scripts](#scripts)\n- [Dependencies](#dependencies)\n- [Gallery](#gallery)\n- [License](#license)\n\n\n# Installing\n\nMake sure Rust is installed and up to date.\n\n```bash\n\u003e rustup update\n```\n\nUse cargo to install mikino.\n\n```bash\n\u003e cargo install mikino\n```\n\nThat's it. Alternatively, you can [build it from source](#building-from-source).\n\n```bash\n\u003e mikino -V\nmikino 0.9.0\n```\n\n\n# Basics\n\nYou can run mikino in demo mode with `mikino demo demo.mkn`. This will write a heavily commented\nexample system in `demo.mkn`. There is a discussion on transition systems\n[below](#transition-systems) that goes into details on the input format, using this exact system as\nan example.\n\nRunning `mikino help` is also probably a good idea.\n\nNote that mikino files are designed to work well with Rust syntax highlighting.\n\n\n# SMT Solver (Z3)\n\nMikino requires an [SMT solver] to run induction (and BMC). More precisely, it requires [Z3] which\nyou can download directly from the [Z3 release page]. You must either\n\n- make sure the Z3 binary is in your path, and is called `z3`, or\n- use mikino's `--z3_cmd` to specify how to call it, for instance:\n    - `mikino --z3_cmd my_z3 ...` if `my_z3` is in your path, or\n    - `mikino --z3_cmd ./path/to/my_z3 ...` if `path/to/my_z3` is where the Z3 binary is.\n\n\n# Building From Source\n\n```bash\n\u003e cargo build --release\n\u003e ./target/release/mikino --version\nmikino 0.9.0\n```\n\n\n# Transition Systems\n\n\u003e See the [gallery](#gallery) for screenshots of mikino's awesome output.\n\nA (transition) system is composed of some variable declarations, of type `bool`, `int` or `rat`\n(rational). A valuation of these variables is usually called a *state*. (An `int` is a\n*mathematical* integer here: it cannot over/underflow. A `rat` is a fraction of `int`s.)\n\n\u003e Let's use a simple counter system as an example. Say this system has two variables, `cnt` of type\n\u003e `int` and `inc` of type bool.\n\nThe definition of a system features an *initial predicate*. It is a boolean expression over the variables of the system that evaluate to true on the initial states of the system.\n\n\u003e Assume now that we want to allow our counter's `cnt` variable's initial value to be anything as\n\u003e long as it is positive. Our initial predicate will be `cnt ≥ 0`. Note that variable `inc` is\n\u003e irrelevant in this predicate.\n\nNext, the *transition relation* of the system is an expression over two versions of the variables:\nthe *current* variables, and the *next* variables. The transition relation is a relation between\nthe current state and the next state that evaluates to true if the next state is a legal successor\nof the current one. A the *next* version of a variable `v` is written `'v`, and its *current*\nversion is just written `v`.\n\n\u003e Our counter should increase by `1` whenever variable `inc` is true, and maintain its value\n\u003e otherwise. There is several ways to write this, for instance\n\u003e\n\u003e ```rust\n\u003e (inc ⋀ 'cnt = cnt + 1) ⋁ (¬inc ⋀ 'cnt = cnt)\n\u003e ```\n\u003e\n\u003e or\n\u003e\n\u003e ```rust\n\u003e if inc { 'cnt = cnt + 1 } else { 'cnt = cnt }\n\u003e ```\n\u003e\n\u003e or\n\u003e\n\u003e ```rust\n\u003e 'cnt = if inc { cnt + 1 } else { cnt }\n\u003e ```\n\nLast, the transition system has a list of named candidates (*candidate invariants*) which are\nboolean expressions over the variables. The system is **safe** if and only if it is not possible to\nreach a falsification of any of these candidates from the initial states by applying the transition\nrelation repeatedly.\n\n\u003e A reasonable candidate for the counter system is `(≥ cnt 0)`. The system is safe for this\n\u003e candidate as no reachable state of the counter can falsify it.\n\u003e\n\u003e The candidate `¬(cnt = 7)` does not hold in all reachable states, in fact the initial state `{\n\u003e cnt: 7, inc: _ }` falsifies it. But assume we change the initial predicate to be `cnt = 0`. Then\n\u003e the candidate is still falsifiable by applying the transition relation seven times to the (only)\n\u003e initial state `{ cnt: 0, inc: _ }`. In all seven transitions, we need `inc` to be true so that\n\u003e `cnt` is actually incremented.\n\nA falsification of a candidate is a *concrete trace*: a sequence of states *i)* that starts from an\ninitial state, *ii)* where successors are valid by the transition relation and *iii)* such that the\nlast state of the sequence falsifies the PO.\n\n\u003e A falsification of `¬(cnt = 7)` for the last system above with the modified initial predicate\n\u003e is\n\u003e\n\u003e ```\n\u003e Step 0\n\u003e | cnt: 0\n\u003e Step 1\n\u003e | cnt: 1\n\u003e | inc: true\n\u003e Step 2\n\u003e | cnt: 2\n\u003e | inc: true\n\u003e Step 3\n\u003e | cnt: 3\n\u003e | inc: true\n\u003e Step 4\n\u003e | cnt: 4\n\u003e | inc: true\n\u003e Step 5\n\u003e | cnt: 5\n\u003e | inc: true\n\u003e Step 6\n\u003e | cnt: 6\n\u003e | inc: true\n\u003e Step 7\n\u003e | cnt: 7\n\u003e | inc: true\n\u003e ```\n\n\n# Scripts\n\n\u003e See the [gallery](#gallery) for screenshots of mikino's awesome output.\n\nMikino also has a `script` mode which runs scripts in Rust-flavored SMT-LIB 2. The syntax is very\nsimilar to that of transition system, check out the demo by running `mikino demo --script\ndemo_script.rs`.\n\n\n# Dependencies\n\nMikino relies on the following stellar libraries:\n\n- [`ansi_term`](https://crates.io/crates/ansi_term)\n- [`atty`](https://crates.io/crates/atty)\n- [`clap`](https://crates.io/crates/clap)\n- [`mikino_api`](https://crates.io/crates/mikino_api)\n\n- [`either`](https://crates.io/crates/either)\n- [`error-chain`](https://crates.io/crates/error-chain)\n- [`lazy_static`](https://crates.io/crates/lazy_static)\n- [`num`](https://crates.io/crates/num)\n- [`peg`](https://crates.io/crates/peg)\n- [`readonly`](https://crates.io/crates/readonly)\n- [`rsmt2`](https://crates.io/crates/rsmt2)\n\n\n# Gallery\n\nGenerate and run demo script. All lines starting with `//` in the output are `echo!`-s from the script:\n\n![script demo](rsc/screenshots/script.png)\n\nGenerate and run the demo transition system:\n\n![trans demo](rsc/screenshots/trans.png)\n\nRun on a modified (unsafe) version of the demo system:\n\n![trans cex demo](rsc/screenshots/trans_cex.png)\n\n\n# License\n\nMikino is distributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\nSee [LICENSE-APACHE][apache] and [LICENSE-MIT][mit] for details.\n\n-------\n\nCopyright © OCamlPro SAS\n\n[SMT solver]: https://en.wikipedia.org/wiki/Satisfiability_modulo_theories\n(SMT on wikipedia)\n[Z3]: https://github.com/Z3Prover/z3/wiki\n(Z3's wiki on github)\n[Z3 release page]: https://github.com/Z3Prover/z3/releases\n(Z3's release page on github)\n[kino]: https://github.com/kino-mc/kino\n(kino on github)\n[apache]: https://github.com/AdrienChampion/mikino_bin/blob/master/LICENSE-APACHE\n(Apache 2.0 license on github)\n[mit]: https://github.com/AdrienChampion/mikino_bin/blob/master/LICENSE-MIT\n(MIT license on github)\n[release page]: https://github.com/OCamlPro/mikino_bin/releases\n(Mikino's release page on github)\n[dummies]: https://ocamlpro.com/blog/2021_10_14_verification_for_dummies_smt_and_induction\n(Induction for Dummies: SMT and Induction)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fmikino_bin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focamlpro%2Fmikino_bin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fmikino_bin/lists"}