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

# U5001: Obligation refuted

The solver found values for which a proof obligation fails: a refinement at a value, a `requires` clause at a call, an `ensures` clause, a nonzero divisor, or the arms of a `when` over ranges (`spec/12 §3, §6`).

The diagnostic points at the value, the call, the failing return, the division or the `when` keyword, and names the obligation with its goal. When the goal names any value, it gives a counterexample: values of the names involved for which the goal is false.

## How to fix it

- Make the goal hold on every path, with a guard or a stronger type or contract that the solver may assume.
- Or correct the goal.

The repairs list these first. `checked(value, goal) else fail <Variant>` is the last repair, marked as an escape (ADR 0095): a runtime test replaces the proof, counts against the module's escape budget and is listed in the build report.

## The repair at a glance

```diff
  module demo

  pub kind Seats = Int in 0..5000

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

## Failing example

```una
module demo

pub kind Seats = Int in 0..5000

pub cap_seats(raw: Int) -> Seats = if raw > 5000 then 5000 else raw
```

## Fixed example

```una
module demo

pub kind Seats = Int in 0..5000

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