pub struct ConstraintSynthEngine {
pub hard_constraints: Vec<String>,
pub soft_constraints: Vec<(String, u32)>,
pub template: Option<String>,
}Expand description
A constraint-based synthesis engine that encodes the problem as SMT.
Fields§
§hard_constraints: Vec<String>Hard constraints that the synthesised program must satisfy.
soft_constraints: Vec<(String, u32)>Soft constraints (ranked by weight).
template: Option<String>The program template (sketch).
Implementations§
Source§impl ConstraintSynthEngine
impl ConstraintSynthEngine
Sourcepub fn add_soft(&mut self, constraint: impl Into<String>, weight: u32)
pub fn add_soft(&mut self, constraint: impl Into<String>, weight: u32)
Add a soft constraint with a weight.
Sourcepub fn set_template(&mut self, template: impl Into<String>)
pub fn set_template(&mut self, template: impl Into<String>)
Set the program template (sketch with holes).
Sourcepub fn num_constraints(&self) -> usize
pub fn num_constraints(&self) -> usize
Count total constraints.
Sourcepub fn encode_pbo(&self) -> String
pub fn encode_pbo(&self) -> String
Encode as a pseudo-Boolean optimisation problem (placeholder).
Trait Implementations§
Source§impl Clone for ConstraintSynthEngine
impl Clone for ConstraintSynthEngine
Source§fn clone(&self) -> ConstraintSynthEngine
fn clone(&self) -> ConstraintSynthEngine
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 moreSource§impl Debug for ConstraintSynthEngine
impl Debug for ConstraintSynthEngine
Source§impl Default for ConstraintSynthEngine
impl Default for ConstraintSynthEngine
Source§fn default() -> ConstraintSynthEngine
fn default() -> ConstraintSynthEngine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConstraintSynthEngine
impl RefUnwindSafe for ConstraintSynthEngine
impl Send for ConstraintSynthEngine
impl Sync for ConstraintSynthEngine
impl Unpin for ConstraintSynthEngine
impl UnsafeUnpin for ConstraintSynthEngine
impl UnwindSafe for ConstraintSynthEngine
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