Expand description
Rust values in the representation of Aeneas’s Lean model of Rust.
Aeneas models Rust’s integers as Std.U8 … Std.I128 (a BitVec at run time, so a Nat
holding the bits), Vec<T> and &[T] as alloc.vec.Vec and Slice (a length and a
ListN), [T; N] as Std.Array (a ListN), &str as Str (a Slice U8) and String
as Lean’s String. Model converts a Rust value to and from that representation.
#[derive(leanfran::Model)] implements it for the structs and enums of a crate, with the
constructor layout Lean gives the structure or inductive type Aeneas generates.
Traits§
- Model
- A Rust value in the representation of its type in Aeneas’s model.
Functions§
- array_
n_ ⚠from_ model [T; N]of the elements of the borrowedListN α N(Std.Array α N).- bits_
from_ ⚠model - The bits held by the borrowed
Nato(below2^128). - bits_
to_ ⚠model - A
Natholdingbits. - ctor_
layout - The layout of a constructor whose fields have the
Model::SCALAR_SIZEssizes, as Lean lays it out: object fields first in their order, then the scalar fields by decreasing size. Per field: the object index or the byte offset in the scalar area; and the number of object fields and the size of the scalar area. - list_
n_ ⚠from_ model - The elements of the borrowed
ListN α n. - list_
n_ ⚠to_ model ListN α nof the elements.- result_
value ⚠ - The value of the owned
MatchResult αm(the result ofResult.match):okgives the value,failanddivare a Rust panic. - scalar_
offset - Offset of a scalar field of a constructor with
objsobject fields. - slice_
from_ ⚠model - The elements of the borrowed
Slice α. - slice_
to_ ⚠model Slice α(andalloc.vec.Vec α, a structure around it) of the elements.