Expand description
A minimal (1-)induction library.
Mikino has a binary crate and a companion tutorial/introduction to formal verification, Verification for Dummies: SMT and Induction. While it discusses mikino mainly from the (binary-side) end-user point of view, it will be pretty useful to users of the mikino API unfamiliar with (SMT-based) formal verification.
This crate deals with two main objects: hsmt scripts and hsmt (transition)
systems, where hsmt stands for Human SMT-LIB 2.
Mikino has the ability to run scripts, and (dis)prove properties over transition systems using
k-induction. Both features are realized using SMT solvers, see the solver
module for more.
Mikino only handles relatively simple SMT-LIB 2 expressions where the only types are bool,
int and rat. For details regarding the expression structures see expr.
Also, note that you will find a bunch of examples in repository/examples which use the
systems/scripts in repository/rsc.
§Scripts
An hsmt script is a Rust-flavored SMT-LIB 2 script, with a twist. The twist is that check
sat results are meta-values that users can store in meta-variables with let is_sat = check_sat!(). Users can then branch on check sat results using if-then-elses. For more,
see
SCRIPT_DEMOfor a description of mikino’s syntax for hsmt scripts;parse::scriptfor parsing scripts;scriptfor running scripts;repository/rsc/script_demo.rsfor a documented hsmt script demo.
§Transition Systems
An hsmt transition system is a declarative transition system specified with three objects:
- the system’s state variables, which define the notion of state for the system as a valuation of all the state variables.
- the system’s initial predicate or
init, which is a predicate over the state variables (a function from a state of the system tobool);initdefines the legal initial states of the system as the states for whichinit(state) = true. - the system’s transition predicate or
trans, which is a predicate over two statesstateandstate';transdefines the states that legally follow any statestateas all the statesstate'such thattrans(state, state') = true.
For more, see
TRANS_DEMOfor a description of mikino’s syntax for hsmt systems;parse::transfor parsing hsmt systems;transfor how hsmt systems are structured;checkfor hsmt systemk-induction-based verification;repository/rsc/trans_demo.rsfor a documented hsmt system demo.
Re-exports§
pub extern crate rsmt2;
Modules§
- ast
- AST structures for expressions and scripts.
- check
- Types and helpers to check a transition system.
- err
- Error-handling.
- expr
- Defines the expression structure used to represent predicates.
- parse
- Backend parser (SMT-LIB) and frontend parser (requires the
parserfeature). - prelude
- Common imports throughout this project.
- script
- HSmt 2 scripts.
- solver
- Provides parser-equipped
rsmt2::Solvers. - trans
- Transition system structures and helpers.
Macros§
- build_
decls - Builds some declarations.
- build_
expr - Convenience macro, provides a DSL for writing expressions.
- build_
trans - Builds a transition system.
- build_
trans_ expr - Builds an expression.
- build_
typ - Builds a type.
- prelude
- Imports mikino’s prelude.
- try_
to_ pres - Converts a
crate::prelude::Resin acrate::prelude::PRes.
Constants§
- SCRIPT_
DEMO - String representation of a simple demo script.
- TRANS_
DEMO - String representation of a simple demo system.