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§
Sourcefn membership(&self, word: &[Symbol]) -> bool
fn membership(&self, word: &[Symbol]) -> bool
Returns true when word is in the target language.
Sourcefn equivalence(
&self,
hypothesis: &Dfa,
config: &ActiveLearningConfig,
) -> Option<Vec<Symbol>>
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.