Home / Docs / Diagnostics

U5002: Obligation unknown

Release v0.4.0

The solver could not decide a proof obligation within the step_budget of verification.lock or the wall-clock guard of --solver-wallclock. The message gives the solver's reason.

Why Una rejects it

In v0.1 an unknown obligation is an error, as a refuted one is (ADR 0008): nothing the solver could not prove is accepted.

A loop has a reason of its own: "the loop forgets every fact about ...". A loop keeps only the refinements of the bindings it updates, so a postcondition about what it built, as result.len <= votes.len or counts.has(key: v) after the loop, stays unknown however the solver is given time.

Floating point has reasons of its own (edition 0.3, spec/29 §8):

How to fix it

The repairs are those of U5001, and checked is the last one, marked as an escape (ADR 0095).

For a loop, put the fact on a helper that does one iteration's update to an edit parameter, whose ensures names the parameter's value on entry as old(p), as counts.has(key: vote) or counts.len <= old(counts).len + 1. The solver proves it once, and each call gives it to the caller right after the call. The loop's own postcondition about everything it built still cannot be proven; state what the callers need on the helper (spec/17 §5, the guide for agents, §11).

For a floating-point query that runs with the fixed step budget or is not sent:

For a fact that needs n.to_f64() of an Int outside -2^63..2^63, give n a range refinement or a fixed-width type.

The repair at a glance

verification.lockdiff
  encoding_version = "una-smt-1"
  solver           = "z3"
  solver_version   = "5.1.0"
  logic            = "QF_UFLIA"
- step_budget      = 1
+ step_budget      = 5000000
  random_seed      = 0

Failing example

verification.locktoml
encoding_version = "una-smt-1"
solver           = "z3"
solver_version   = "5.1.0"
logic            = "QF_UFLIA"
step_budget      = 1
random_seed      = 0
src/demo.unauna
module demo

pub kind Seats = Int in 0..5000

pub shift(seats: Seats, by: Int) -> Int
  ensures result >= by
=
  seats + by

Fixed example

verification.locktoml
encoding_version = "una-smt-1"
solver           = "z3"
solver_version   = "5.1.0"
logic            = "QF_UFLIA"
step_budget      = 5000000
random_seed      = 0
src/demo.unauna
module demo

pub kind Seats = Int in 0..5000

pub shift(seats: Seats, by: Int) -> Int
  ensures result >= by
=
  seats + by