---
title: "U2015: Invalid predicate body (impure, failing, recursive or outside RL for `reflect`)"
url: https://una-lang.org/en/docs/errors/U2015/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U2015.md
---

# U2015: Invalid predicate body (impure, failing, recursive or outside RL for `reflect`)

The body of a predicate is not valid for its kind of predicate.

## Why Una rejects it

A predicate is a pure, total function that returns `Bool` (`spec/03 §4`).

- The body of a `reflect` predicate, which the verifier sees, is written in the refinement language.
- An `opaque` predicate may use any pure expression, but cannot perform operations, fail, or call functions that do.
- No predicate calls itself, directly or through other predicates and functions.

## The repair at a glance

```diff
  module demo

- predicate reflect even(n: Int) -> Bool = n == 0 or even(n - 2)
+ predicate reflect even(n: Int) -> Bool = n mod 2 == 0
```

## Failing example

```una
module demo

predicate reflect even(n: Int) -> Bool = n == 0 or even(n - 2)
```

## Fixed example

```una
module demo

predicate reflect even(n: Int) -> Bool = n mod 2 == 0
```
