pub struct TerminationChecker { /* private fields */ }Expand description
Termination checker for recursive definitions.
Implementations§
Source§impl TerminationChecker
impl TerminationChecker
Sourcepub fn register_params(&mut self, name: Name, params: Vec<ParamInfo>)
pub fn register_params(&mut self, name: Name, params: Vec<ParamInfo>)
Register parameter info for a function.
Sourcepub fn add_smaller(&mut self, big: Expr, small: Expr)
pub fn add_smaller(&mut self, big: Expr, small: Expr)
Mark an expression as structurally smaller than another.
This is used when we know that small is a subterm of big,
e.g., when pattern matching on an inductive type.
Sourcepub fn is_smaller(&self, big: &Expr, small: &Expr) -> bool
pub fn is_smaller(&self, big: &Expr, small: &Expr) -> bool
Check if small is known to be structurally smaller than big.
Sourcepub fn check_terminates(
&mut self,
name: &Name,
body: &Expr,
) -> Result<(), String>
pub fn check_terminates( &mut self, name: &Name, body: &Expr, ) -> Result<(), String>
Check if a recursive definition terminates.
Returns Ok(()) if the definition is structurally decreasing, or Err with a message explaining why it might not terminate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TerminationChecker
impl RefUnwindSafe for TerminationChecker
impl Send for TerminationChecker
impl Sync for TerminationChecker
impl Unpin for TerminationChecker
impl UnsafeUnpin for TerminationChecker
impl UnwindSafe for TerminationChecker
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