Trait programinduction::Task
source · pub trait Task<Observation: ?Sized>: Sync {
type Representation;
type Expression;
// Required methods
fn oracle(&self, dsl: &Self::Representation, expr: &Self::Expression) -> f64;
fn tp(&self) -> &TypeScheme;
fn observation(&self) -> &Observation;
}
Expand description
A task which is solved by an expression under some representation.
A task can be made from an evaluator and examples with lambda::task_by_evaluation
or
pcfg::task_by_evaluation
.
Required Associated Types§
type Representation
type Expression
Required Methods§
sourcefn oracle(&self, dsl: &Self::Representation, expr: &Self::Expression) -> f64
fn oracle(&self, dsl: &Self::Representation, expr: &Self::Expression) -> f64
sourcefn tp(&self) -> &TypeScheme
fn tp(&self) -> &TypeScheme
An expression that is considered valid for the oracle
is one of this type.
sourcefn observation(&self) -> &Observation
fn observation(&self) -> &Observation
Some program induction methods can take advantage of observations. This may often
practically be the unit
type ()
.