pub struct ProgramSketch {
pub template: String,
pub num_holes: usize,
pub hole_types: Vec<String>,
}Expand description
A program sketch: a program template with “holes” to be filled.
Fields§
§template: StringThe template string with {hole_N} placeholders.
num_holes: usizeThe number of holes.
hole_types: Vec<String>The type constraints for each hole (simplified).
Implementations§
Source§impl ProgramSketch
impl ProgramSketch
Sourcepub fn set_hole_type(&mut self, i: usize, ty: &str)
pub fn set_hole_type(&mut self, i: usize, ty: &str)
Set the type of hole i.
Sourcepub fn fill(&self, completions: &[&str]) -> String
pub fn fill(&self, completions: &[&str]) -> String
Fill holes with given completions to get a concrete program.
Sourcepub fn is_complete(&self, program: &str) -> bool
pub fn is_complete(&self, program: &str) -> bool
Check if all holes are filled in a given program string.
Sourcepub fn sketch_space_size(&self, num_operations: u64) -> u64
pub fn sketch_space_size(&self, num_operations: u64) -> u64
Generate all sketches of programs up to depth d with k holes.
Returns simplified count: (operations^holes).
Trait Implementations§
Source§impl Clone for ProgramSketch
impl Clone for ProgramSketch
Source§fn clone(&self) -> ProgramSketch
fn clone(&self) -> ProgramSketch
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 ProgramSketch
impl RefUnwindSafe for ProgramSketch
impl Send for ProgramSketch
impl Sync for ProgramSketch
impl Unpin for ProgramSketch
impl UnsafeUnpin for ProgramSketch
impl UnwindSafe for ProgramSketch
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