Home / Docs / Diagnostics

U2014: Expression outside the refinement language

Release v0.4.0

A clause or a predicate of checked holds an expression outside the refinement language. The diagnostic points at the outermost sub-expression outside the language.

Why Una rejects it

where, requires and ensures clauses, and the predicate of checked, are written in the refinement language, which the verifier decides (spec/03 §3). The language has:

How to fix it

The repair at a glance

diff
  module demo

  pub shift(x: Int) -> Int
-   requires abs(x) < 100
+   requires x > -100 and x < 100
  =
    x

Failing example

una
module demo

pub shift(x: Int) -> Int
  requires abs(x) < 100
=
  x

Fixed example

una
module demo

pub shift(x: Int) -> Int
  requires x > -100 and x < 100
=
  x