Skip to main content

VerificationContext

Struct VerificationContext 

Source
pub struct VerificationContext { /* private fields */ }
Expand description

A verification context for building constraints incrementally.

Provides direct access to Z3 types for constructing custom proofs. For most use cases, prefer VerificationSession which works with the higher-level VerifyExpr IR.

Implementations§

Source§

impl VerificationContext

Source

pub fn solver(&self) -> Solver

Create a new solver for this context.

The solver accumulates assertions and can check their satisfiability.

Source

pub fn bool_val(&self, value: bool) -> Bool

Create a boolean constant.

Source

pub fn int_val(&self, value: i64) -> Int

Create an integer constant.

Source

pub fn bool_var(&self, name: &str) -> Bool

Create a named boolean variable.

Source

pub fn int_var(&self, name: &str) -> Int

Create a named integer variable.

Source

pub fn check_valid( &self, solver: &Solver, assertion: &Bool, ) -> VerificationResult

Check if an assertion is valid (always true).

Uses the standard validity check: P is valid iff ¬P is unsatisfiable. The solver state is preserved using push/pop.

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, 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.