pub struct ComputableFunction {
pub name: &'static str,
pub jump_level: Option<u32>,
pub table: Vec<Option<u64>>,
}Expand description
A Turing machine oracle that answers membership queries for a set X ⊆ ℕ. Used to model oracle-relative computability in the RM hierarchy.
Fields§
§name: &'static strA description / name for this function (e.g. “Halting problem oracle”).
jump_level: Option<u32>Degree information: Some(k) means the function has degree 0^(k) (k-th jump).
table: Vec<Option<u64>>The function table for inputs 0..table.len() (partial; None = diverges).
Implementations§
Source§impl ComputableFunction
impl ComputableFunction
Sourcepub fn indicator_below(bound: u64) -> Self
pub fn indicator_below(bound: u64) -> Self
Create the characteristic function of the set {n | n < bound} (computable).
Sourcepub fn eval(&self, n: usize) -> Option<u64>
pub fn eval(&self, n: usize) -> Option<u64>
Evaluate at input n, returning None if the function diverges.
Sourcepub fn is_total_up_to(&self, n: usize) -> bool
pub fn is_total_up_to(&self, n: usize) -> bool
Return true if this function is total on 0..n.
Trait Implementations§
Source§impl Clone for ComputableFunction
impl Clone for ComputableFunction
Source§fn clone(&self) -> ComputableFunction
fn clone(&self) -> ComputableFunction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ComputableFunction
impl RefUnwindSafe for ComputableFunction
impl Send for ComputableFunction
impl Sync for ComputableFunction
impl Unpin for ComputableFunction
impl UnsafeUnpin for ComputableFunction
impl UnwindSafe for ComputableFunction
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