pub struct UntranslateCtx {
pub peano: Option<PeanoCtx>,
}Expand description
Context threaded from the --explain render site. peano is set when the
law being un-translated has a given whose type is a canonical-Peano ADT
(T { Zero; Succ(T) }, shape-detected — any name, not just literal Nat).
The transpiler lifts such a type’s VALUES to Lean Nat (Zero→0,
Succ x→x + 1), so the dumped goal speaks Nat. Inverting that
deterministic lift here — 0→T.Zero, x + 1 / Nat.succ x→T.Succ x, literal
n≤8→Succ^n(Zero) — stays inside the translator image (it undoes OUR OWN
lift, not a guess). Nat truncated subtraction / mul / div and any non-+1
Nat arithmetic stay OUT of grammar, so the #630 boundary against foreign Nat
semantics is untouched. None (no Peano given) = exactly the pre-V2 behavior.
Fields§
§peano: Option<PeanoCtx>Trait Implementations§
Source§impl Clone for UntranslateCtx
impl Clone for UntranslateCtx
Source§fn clone(&self) -> UntranslateCtx
fn clone(&self) -> UntranslateCtx
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UntranslateCtx
impl Debug for UntranslateCtx
Source§impl Default for UntranslateCtx
impl Default for UntranslateCtx
Source§fn default() -> UntranslateCtx
fn default() -> UntranslateCtx
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UntranslateCtx
impl RefUnwindSafe for UntranslateCtx
impl Send for UntranslateCtx
impl Sync for UntranslateCtx
impl Unpin for UntranslateCtx
impl UnsafeUnpin for UntranslateCtx
impl UnwindSafe for UntranslateCtx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more