pub struct Pattern {
pub holes: Vec<ZId>,
pub first_zid_of_ivar: Vec<ZId>,
pub match_locations: Vec<Id>,
pub utility_upper_bound: i32,
pub body_utility: i32,
pub tracked: bool,
/* private fields */
}Expand description
A Pattern is a partial invention with holes. The simplest pattern is the single hole ?? which
matches at all nodes in the program set. From this single hole in a top-down manner we grow more complex
patterns like (+ ?? ??) and (+ 3 (* ?? ??)). Expanding a hole in a pattern always results in a pattern
that matches at a subset of the places that the original pattern matched.
match_locations is the list of structurally hashed nodes where the pattern matches.
holes is the list of zippers that point from the root of the pattern to the holes.
arg_choices is the same as holes but for the invention arguments like #i
body_utility is the cost of the non-hole non-argchoice parts of the pattern so far
Fields§
§holes: Vec<ZId>§first_zid_of_ivar: Vec<ZId>§match_locations: Vec<Id>§utility_upper_bound: i32§body_utility: i32§tracked: boolImplementations§
Trait Implementations§
impl Eq for Pattern
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more