Home / Docs / Configure a package
verification.lock
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.
[package]
name = "shop"
version = "0.1.0"
edition = "0.2"encoding_version = "una-smt-1"
solver = "z3"
solver_version = "5.1.0"
logic = "QF_UFLIA"
step_budget = 5000000
random_seed = 0module 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 rawForms
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:
[package]
name = "shop"
version = "0.1.0"
edition = "0.2"encoding_version = "una-smt-1"
solver = "z3"
solver_version = "4.12.0"
logic = "QF_UFLIA"
step_budget = 5000000
random_seed = 0-- 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 rawEdge cases
Exactly the six keys:
[package]
name = "shop"
version = "0.1.0"
edition = "0.2"encoding_version = "una-smt-1"
solver = "z3"
solver_version = "5.1.0"
logic = "QF_UFLIA"
step_budget = 5000000-- 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 rawFurther rules:
- A single file uses the default lock, the lock built into
una, whose solver versionuna --versionprints. - Determinism. For identical sources,
una.tomlandverification.lock, checking produces identical diagnostics, statuses and reports, except obligations that ran out of wall-clock time.
Diagnostics
- U5003: the Z3 built into
unais at a version other than the one the lock names, or cannot run: a development build with no solver built in, or a solver child that could not be confined, such as one run as root.unanever runs az3from the path. - U7004: a missing lock, a syntax error, a missing or unknown key, or a wrong value.
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
- spec/12 §9: the lock file and cache; spec/12 §5: the solver protocol; spec/12 §10: determinism.
- spec/13 §7: project files; spec/13 §5:
una --versionand the default lock.