Module Swal.Teacher

Minimally adequate teacher (MAT) oracle for active learning.

Wraps a target weighted language function with memoisation and provides membership and equivalence queries. Equivalence is approximated by BFS enumeration of Σ* up to a configurable bound.

type cache = {
  1. hit : Base.int;
  2. miss : Base.int;
}

Per-query-type hit/miss counters, written to the output JSON.

val pp_cache : Ppx_deriving_runtime.Format.formatter -> cache -> Ppx_deriving_runtime.unit
val show_cache : cache -> Ppx_deriving_runtime.string
val yojson_of_cache : cache -> Ppx_yojson_conv_lib.Yojson.Safe.t
type stats = {
  1. mem : cache;
  2. eq : cache;
}

Aggregated teacher statistics for one learning round.

val pp_stats : Ppx_deriving_runtime.Format.formatter -> stats -> Ppx_deriving_runtime.unit
val show_stats : stats -> Ppx_deriving_runtime.string
val yojson_of_stats : stats -> Ppx_yojson_conv_lib.Yojson.Safe.t
val mk_stats : stats
val add_cache : cache -> cache -> cache
val add_stats : stats -> stats -> stats
module type T = sig ... end

Module type for the learning oracle (teacher / minimally adequate teacher).

module Make (S : Algebra.Semiring.T) : T with type s = S.t and type a = Automata.WFA.Make(S).t