SWAL — SMT-based Active Learning of Weighted Automata

SWAL is an active automata learning algorithm parametric in a commutative semiring, presented in the CAV 2026 paper of the same name. Given a teacher holding a target weighted finite automaton (WFA), it builds an SMT constraint system whose solutions are WFAs consistent with observed membership queries, then calls an SMT solver (Z3, CVC5, or Bitwuzla) to find one. On termination it is guaranteed to produce a minimal WFA.

Top-level modules

Sub-libraries

Quick start

# Build
dune build

# Learn a random 5-state tropical WFA over 3 symbols
dune exec swal -- --algo swal --lang rand_tropical:5:3 --smt z3

Results are written to SWAL-<uuid>.json containing configuration, per-round statistics (query counts, wall-clock times, hypothesis sizes), and the final learned WFA.