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§

Required Methods§

source

fn oracle(&self, dsl: &Self::Representation, expr: &Self::Expression) -> f64

Assess an expression. For EC this should return a log-likelihood. For GP this should return non-negative fitness, where smaller values correspond to better expressions.

source

fn tp(&self) -> &TypeScheme

An expression that is considered valid for the oracle is one of this type.

source

fn observation(&self) -> &Observation

Some program induction methods can take advantage of observations. This may often practically be the unit type ().

Implementors§