LeanEncoder

Struct LeanEncoder 

Source
pub struct LeanEncoder<'genv, 'tcx> {
    genv: GlobalEnv<'genv, 'tcx>,
    def_id: MaybeExternId,
    pretty_var_map: PrettyMap<LocalVar>,
    sort_deps: SortDeps,
    fun_deps: Vec<FunDef>,
    kvar_solutions: KVarSolutions,
    kvar_decls: Vec<KVarDecl>,
    constraint: Constraint,
    sort_files: FxHashMap<DataSort, LeanFile>,
    fun_files: FxHashMap<FluxDefId, LeanFile>,
}

Fields§

§genv: GlobalEnv<'genv, 'tcx>§def_id: MaybeExternId§pretty_var_map: PrettyMap<LocalVar>§sort_deps: SortDeps§fun_deps: Vec<FunDef>§kvar_solutions: KVarSolutions§kvar_decls: Vec<KVarDecl>§constraint: Constraint§sort_files: FxHashMap<DataSort, LeanFile>§fun_files: FxHashMap<FluxDefId, LeanFile>

Implementations§

Source§

impl<'genv, 'tcx> LeanEncoder<'genv, 'tcx>

Source

fn lean_cx(&self) -> LeanCtxt<'_, 'genv, 'tcx>

Source

fn datasort_name(&self, sort: &DataSort) -> String

Source

fn lean_file_for_fun(&self, fun: &FunDef) -> LeanFile

Source

fn var_name(&self, var: &Var) -> String

Source

fn import(&self, file: &LeanFile) -> String

Source

fn new( genv: GlobalEnv<'genv, 'tcx>, def_id: MaybeExternId, pretty_var_map: PrettyMap<LocalVar>, sort_deps: SortDeps, fun_deps: Vec<FunDef>, kvar_solutions: KVarSolutions, kvar_decls: Vec<KVarDecl>, constraint: Constraint, ) -> Result<Self>

Source

fn run(&self) -> Result<()>

Source

fn fun_files(&self) -> FxHashMap<FluxDefId, LeanFile>

Source

fn sort_files(&self) -> FxHashMap<DataSort, LeanFile>

Source

fn generate_lake_project_if_not_present(&self) -> Result<()>

Source

fn generate_opaque_sort_file_if_not_present( &self, sort: &SortDecl, ) -> Result<()>

Source

fn data_decl_dependencies(&self, data_decl: &DataDecl) -> Vec<&LeanFile>

Source

fn generate_struct_file_if_not_present( &self, data_decl: &DataDecl, ) -> Result<()>

Source

fn sort_file(&self, sort: &DataSort) -> &LeanFile

Source

fn fun_file(&self, did: &FluxDefId) -> &LeanFile

Source

fn fun_def_dependencies( &self, did: FluxDefId, fun_def: &FunDef, ) -> Vec<&LeanFile>

Source

fn generate_fun_def_file_if_not_present( &self, did: FluxDefId, fun_def: &FunDef, ) -> Result<()>

Source

fn generate_lib_if_absent(&self) -> Result<()>

Source

fn generate_vc_prelude(&self) -> Result<()>

Source

fn generate_vc_imports(&self, file: &mut File) -> Result<()>

Source

fn generate_vc_file(&self) -> Result<()>

Source

fn generate_proof_if_absent(&self) -> Result<()>

Source

fn record_proof(&self) -> Result<()>

Source

pub fn encode( genv: GlobalEnv<'genv, 'tcx>, def_id: MaybeExternId, pretty_var_map: PrettyMap<LocalVar>, sort_deps: SortDeps, fun_deps: Vec<FunDef>, kvar_decls: Vec<KVarDecl>, constraint: Constraint, kvar_solutions: KVarSolutions, ) -> Result<()>

Auto Trait Implementations§

§

impl<'genv, 'tcx> Freeze for LeanEncoder<'genv, 'tcx>

§

impl<'genv, 'tcx> !RefUnwindSafe for LeanEncoder<'genv, 'tcx>

§

impl<'genv, 'tcx> !Send for LeanEncoder<'genv, 'tcx>

§

impl<'genv, 'tcx> !Sync for LeanEncoder<'genv, 'tcx>

§

impl<'genv, 'tcx> Unpin for LeanEncoder<'genv, 'tcx>

§

impl<'genv, 'tcx> !UnwindSafe for LeanEncoder<'genv, 'tcx>

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more