pub struct CegisState {
pub spec: Spec,
pub counterexamples: Vec<Vec<String>>,
pub candidate: Option<Candidate>,
pub iterations: usize,
pub max_iterations: usize,
}Expand description
The CEGIS synthesis loop state.
Fields§
§spec: SpecThe specification to satisfy.
counterexamples: Vec<Vec<String>>Counterexamples accumulated across iterations.
candidate: Option<Candidate>Current candidate (if any).
iterations: usizeNumber of CEGIS iterations performed.
max_iterations: usizeMaximum allowed iterations before giving up.
Implementations§
Source§impl CegisState
impl CegisState
Sourcepub fn new(spec: Spec, max_iterations: usize) -> Self
pub fn new(spec: Spec, max_iterations: usize) -> Self
Initialise a CEGIS loop for the given spec.
use oxilean_std::program_synthesis::{CegisState, Spec};
let state = CegisState::new(Spec::logic("y = x + 1"), 100);
assert_eq!(state.iterations, 0);Sourcepub fn add_counterexample(&mut self, ce: Vec<String>)
pub fn add_counterexample(&mut self, ce: Vec<String>)
Record a counterexample returned by the verifier.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Check whether the loop has exceeded its iteration budget.
Trait Implementations§
Source§impl Clone for CegisState
impl Clone for CegisState
Source§fn clone(&self) -> CegisState
fn clone(&self) -> CegisState
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 CegisState
impl RefUnwindSafe for CegisState
impl Send for CegisState
impl Sync for CegisState
impl Unpin for CegisState
impl UnsafeUnpin for CegisState
impl UnwindSafe for CegisState
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