Encoding — SMT constraint systems for WFA learning

This library provides the two encoding strategies that translate a set of membership observations into an SMT constraint system whose satisfying assignments are WFAs consistent with those observations. This corresponds to the getAutomaton abstraction of Definition 5 in the paper.

Interface

Encoding.Intf defines Encoding.Intf.T, the shared interface for both strategies. An encoding value of type t accumulates SMT variables and constraint batches. The learner calls:

  1. Encoding.Intf.T.mk — once per hypothesis size to allocate fresh variables.
  2. Encoding.Intf.T.add — after each counterexample to incorporate new membership observations.
  3. Either Encoding.Intf.T.get (incremental mode) or Encoding.Intf.T.all (non-incremental mode) to extract constraints for the solver.
  4. Encoding.Intf.T.aut — after a SAT result to reconstruct the hypothesis WFA from the model.

Strategies

Selecting a strategy

Encoding.get returns a first-class module (module Intf.T) for the chosen strategy. This is called in bin/main.ml based on the --encoding flag.