pub struct TTEOracle {
pub name: String,
pub max_precision: usize,
pub approx_cache: Vec<i64>,
}Expand description
A Type-2 Turing machine representation for computable analysis. Computes on infinite streams (Baire space ℕ^ℕ) rather than finite words.
Fields§
§name: StringName / description of the represented real function.
max_precision: usizeMaximum precision (in bits) we track in simulation.
approx_cache: Vec<i64>Cached approximations: approx[k] is the k-th dyadic approximation numerator.
Implementations§
Source§impl TTEOracle
impl TTEOracle
Sourcepub fn new(name: impl Into<String>, max_precision: usize) -> Self
pub fn new(name: impl Into<String>, max_precision: usize) -> Self
Create a new TTE oracle for a named function.
Sourcepub fn load_cauchy(&mut self, seq: impl Fn(usize) -> i64)
pub fn load_cauchy(&mut self, seq: impl Fn(usize) -> i64)
Load approximations from a Cauchy sequence with explicit modulus.
seq(k) gives the k-th numerator so that seq(k) * 2^{-k} approximates the value.
Sourcepub fn query(&self, k: usize) -> Option<(i64, usize)>
pub fn query(&self, k: usize) -> Option<(i64, usize)>
Query the oracle at precision k: returns (numerator, k) meaning num * 2^{-k}.
Sourcepub fn is_cauchy_consistent(&self, k: usize) -> bool
pub fn is_cauchy_consistent(&self, k: usize) -> bool
Check whether this representation is consistent (Cauchy condition within ε = 2^{-k}).
Sourcepub fn function_name(&self) -> &str
pub fn function_name(&self) -> &str
Returns the name of the represented real function.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TTEOracle
impl RefUnwindSafe for TTEOracle
impl Send for TTEOracle
impl Sync for TTEOracle
impl Unpin for TTEOracle
impl UnsafeUnpin for TTEOracle
impl UnwindSafe for TTEOracle
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