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 typespan: Source location (byte offsets) where the error occurredexplanation: Human-readable context explaining why verification failedcounterexample: Concrete variable assignments that demonstrate the failure
Fields§
§kind: VerificationErrorKindThe category of verification error.
span: Option<(usize, usize)>Optional source span as (start, end) byte offsets.
explanation: StringHuman-readable explanation of why verification failed.
counterexample: Option<CounterExample>Concrete witness showing a failing case, when available.
Implementations§
Source§impl VerificationError
impl VerificationError
Sourcepub fn license_required() -> Self
pub fn license_required() -> Self
Create a license required error.
Use when verification is attempted without providing a license key.
Sourcepub fn license_invalid(reason: impl Into<String>) -> Self
pub fn license_invalid(reason: impl Into<String>) -> Self
Create a license invalid error.
Use when the provided license key fails validation.
Sourcepub fn insufficient_plan(current: impl Into<String>) -> Self
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.
Sourcepub fn contradiction(
explanation: impl Into<String>,
counterexample: Option<CounterExample>,
) -> Self
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.
Sourcepub fn bounds_violation(
var: impl Into<String>,
expected: impl Into<String>,
found: impl Into<String>,
) -> Self
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.
Sourcepub fn refinement_violation(
type_name: impl Into<String>,
explanation: impl Into<String>,
) -> Self
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.
Sourcepub fn solver_unknown() -> Self
pub fn solver_unknown() -> Self
Create a solver unknown error.
Use when Z3 cannot determine satisfiability (timeout or undecidable).
Sourcepub fn solver_error(message: impl Into<String>) -> Self
pub fn solver_error(message: impl Into<String>) -> Self
Create a solver error.
Use when Z3 encounters an internal error or configuration issue.
Trait Implementations§
Source§impl Debug for VerificationError
impl Debug for VerificationError
Source§impl Display for VerificationError
impl Display for VerificationError
Source§impl Error for VerificationError
impl Error for VerificationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()