Skip to main content

VerificationError

Struct VerificationError 

Source
pub struct VerificationError {
    pub kind: VerificationErrorKind,
    pub span: Option<(usize, usize)>,
    pub explanation: String,
    pub counterexample: Option<CounterExample>,
}
Expand description

A verification error with Socratic explanation.

Each error includes contextual information to help users understand and fix the issue.

§Fields

  • kind: Categorizes the error type
  • span: Source location (byte offsets) where the error occurred
  • explanation: Human-readable context explaining why verification failed
  • counterexample: Concrete variable assignments that demonstrate the failure

Fields§

§kind: VerificationErrorKind

The category of verification error.

§span: Option<(usize, usize)>

Optional source span as (start, end) byte offsets.

§explanation: String

Human-readable explanation of why verification failed.

§counterexample: Option<CounterExample>

Concrete witness showing a failing case, when available.

Implementations§

Source§

impl VerificationError

Source

pub fn license_required() -> Self

Create a license required error.

Use when verification is attempted without providing a license key.

Source

pub fn license_invalid(reason: impl Into<String>) -> Self

Create a license invalid error.

Use when the provided license key fails validation.

Source

pub fn insufficient_plan(current: impl Into<String>) -> Self

Create an insufficient plan error.

Use when the license is valid but the plan doesn’t include verification.

Source

pub fn contradiction( explanation: impl Into<String>, counterexample: Option<CounterExample>, ) -> Self

Create a contradictory assertion error.

Use when Z3 proves the negation of an assertion is satisfiable.

Source

pub fn bounds_violation( var: impl Into<String>, expected: impl Into<String>, found: impl Into<String>, ) -> Self

Create a bounds violation error.

Use when a variable’s value falls outside its declared constraint.

Source

pub fn refinement_violation( type_name: impl Into<String>, explanation: impl Into<String>, ) -> Self

Create a refinement type violation error.

Use when a value does not satisfy its refinement type predicate.

Source

pub fn solver_unknown() -> Self

Create a solver unknown error.

Use when Z3 cannot determine satisfiability (timeout or undecidable).

Source

pub fn solver_error(message: impl Into<String>) -> Self

Create a solver error.

Use when Z3 encounters an internal error or configuration issue.

Source

pub fn termination_violation( variant: impl Into<String>, reason: impl Into<String>, ) -> Self

Create a termination violation error.

Use when loop termination cannot be proven via the variant expression.

Source

pub fn with_span(self, start: usize, end: usize) -> Self

Set the source span for this error.

Spans are byte offsets (start, end) into the source text.

Trait Implementations§

Source§

impl Debug for VerificationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for VerificationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for VerificationError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, A> IntoAst<A> for T
where T: Into<A>, A: Ast,

§

fn into_ast(self, _a: &A) -> A

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.