---
title: "U5002: Obligation unknown"
url: https://una-lang.org/en/docs/errors/U5002/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U5002.md
---

# U5002: Obligation unknown

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`):

- A query with an `F64` term runs with the fixed step budget 5,000,000 whatever the lock sets, so raising `step_budget` does not decide it.
- A query whose float arithmetic weighs more than 4 is not sent at all. A multiplication, a division, a square root or a conversion weighs 4, an addition or a subtraction 1.
- A refutation that holds unless floating-point facts make its path unreachable is unknown too.
- So is a fact that needs `n.to_f64()` of an `Int` outside -2^63..2^63, which the verifier does not interpret.

## How to fix it

- Simplify the goal.
- Give the proof the hypotheses it needs through stronger types or `requires` clauses.
- Or raise the step budget. The proof is still required, so a raised budget keeps the guarantee.

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:

- Move the fact to a checked boundary (`checked(value, p(it))`, an escape).
- Split the contract so that each helper's `ensures` states a fact about one operation.
- Or state a weaker property, such as finiteness, a sign or a bound by a constant.

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.lock`

```diff
  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.lock`

```toml
encoding_version = "una-smt-1"
solver           = "z3"
solver_version   = "5.1.0"
logic            = "QF_UFLIA"
step_budget      = 1
random_seed      = 0
```

`src/demo.una`

```una
module demo

pub kind Seats = Int in 0..5000

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

## Fixed example

`verification.lock`

```toml
encoding_version = "una-smt-1"
solver           = "z3"
solver_version   = "5.1.0"
logic            = "QF_UFLIA"
step_budget      = 5000000
random_seed      = 0
```

`src/demo.una`

```una
module demo

pub kind Seats = Int in 0..5000

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