Skip to main content

Oracle

Trait Oracle 

Source
pub trait Oracle {
    // Required methods
    fn alphabet(&self) -> &[Symbol] ;
    fn membership(&self, word: &[Symbol]) -> bool;
    fn equivalence(
        &self,
        hypothesis: &Dfa,
        config: &ActiveLearningConfig,
    ) -> Option<Vec<Symbol>>;
}
Expand description

Minimally adequate teacher for active regular-language learning.

Required Methods§

Source

fn alphabet(&self) -> &[Symbol]

Input alphabet explored by the learner.

Source

fn membership(&self, word: &[Symbol]) -> bool

Returns true when word is in the target language.

Source

fn equivalence( &self, hypothesis: &Dfa, config: &ActiveLearningConfig, ) -> Option<Vec<Symbol>>

Returns a counterexample when hypothesis disagrees with the target.

Returning None accepts the hypothesis as equivalent. Exact oracles can ignore config; approximate oracles use it for bounded deterministic sampling.

Implementors§