Home / Docs / Configure a package

verification.lock

Release v0.4.0Edition 0.1 and laterU5003U7004

What it does

Una proves a program's obligations, the facts each line needs to be safe, such as a value staying in its range, with a solver: Z3, built into una, which decides whether such a fact always holds. verification.lock pins which Z3 and which settings, so that a proof means the same on every machine. It sits at the package root, beside una.toml, and is committed. Proofs already found are kept in the proof cache, a folder of saved answers keyed by the lock's contents, so changing the lock verifies every obligation again.

Learn more: The manifest and the lock and What the verifier proves.

una.tomltoml
[package]
name = "shop"
version = "0.1.0"
edition = "0.2"
verification.locktoml
encoding_version = "una-smt-1"
solver           = "z3"
solver_version   = "5.1.0"
logic            = "QF_UFLIA"
step_budget      = 5000000
random_seed      = 0
src/shop.unauna
module shop

pub kind Seats = Int in 0..5000

pub cap(raw: Int) -> Seats = if raw < 0 then 0 else if raw > 5000 then 5000 else raw

Forms

text
encoding_version = "una-smt-1"
solver           = "z3"
solver_version   = "<a non-empty string: the exact Z3 version>"
logic            = "QF_UFLIA"
step_budget      = <an integer of at least 1>
random_seed      = <an integer of at least 0>

Exactly these six keys.

Examples

A lock that names a Z3 version other than the one built into una, or a una whose solver cannot run, is rejected once there is something to prove. Verification never passes silently. Here the lock names a version this una does not have:

una.tomltoml
[package]
name = "shop"
version = "0.1.0"
edition = "0.2"
verification.locktoml
encoding_version = "una-smt-1"
solver           = "z3"
solver_version   = "4.12.0"
logic            = "QF_UFLIA"
step_budget      = 5000000
random_seed      = 0
src/shop.unauna
-- fails with U5003
module shop

pub kind Seats = Int in 0..5000

pub cap(raw: Int) -> Seats = if raw < 0 then 0 else if raw > 5000 then 5000 else raw

Edge cases

Exactly the six keys:

una.tomltoml
[package]
name = "shop"
version = "0.1.0"
edition = "0.2"
verification.locktoml
encoding_version = "una-smt-1"
solver           = "z3"
solver_version   = "5.1.0"
logic            = "QF_UFLIA"
step_budget      = 5000000
src/shop.unauna
-- fails with U7004
module shop

pub kind Seats = Int in 0..5000

pub cap(raw: Int) -> Seats = if raw < 0 then 0 else if raw > 5000 then 5000 else raw

Further rules:

Diagnostics

Edition

The lock is the same in editions 0.1 and 0.2. From edition 0.4 a package has no verification.lock: ita.lock pins the solver in its solver section (see ita.lock), and una migrate moves the pin there.

Normative source