pub struct HoudiniInvariantSynth {
pub candidates: Vec<String>,
pub iterations: usize,
}Expand description
An inductive loop invariant synthesiser using Houdini-style fixpoint.
Fields§
§candidates: Vec<String>Candidate invariant predicates to try.
iterations: usizeIterations of the Houdini fixpoint computation.
Implementations§
Source§impl HoudiniInvariantSynth
impl HoudiniInvariantSynth
Sourcepub fn new(candidates: Vec<String>) -> Self
pub fn new(candidates: Vec<String>) -> Self
Create a Houdini synthesiser with an initial set of candidates.
use oxilean_std::program_synthesis::HoudiniInvariantSynth;
let h = HoudiniInvariantSynth::new(vec!["x >= 0".into(), "x <= n".into()]);
assert_eq!(h.candidates.len(), 2);Sourcepub fn add_candidate(&mut self, pred: impl Into<String>)
pub fn add_candidate(&mut self, pred: impl Into<String>)
Add a candidate invariant predicate.
Sourcepub fn step(&mut self) -> usize
pub fn step(&mut self) -> usize
Simulate one Houdini iteration: remove candidates falsified by pre-image.
In a real implementation, each candidate would be checked against the loop body; here we just count the iteration.
Sourcepub fn current_invariants(&self) -> &[String]
pub fn current_invariants(&self) -> &[String]
Return the current invariant candidate set.
Sourcepub fn is_fixpoint(&self) -> bool
pub fn is_fixpoint(&self) -> bool
Check whether a fixpoint has been reached (placeholder heuristic).
Trait Implementations§
Source§impl Clone for HoudiniInvariantSynth
impl Clone for HoudiniInvariantSynth
Source§fn clone(&self) -> HoudiniInvariantSynth
fn clone(&self) -> HoudiniInvariantSynth
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 HoudiniInvariantSynth
impl RefUnwindSafe for HoudiniInvariantSynth
impl Send for HoudiniInvariantSynth
impl Sync for HoudiniInvariantSynth
impl Unpin for HoudiniInvariantSynth
impl UnsafeUnpin for HoudiniInvariantSynth
impl UnwindSafe for HoudiniInvariantSynth
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