JavaScript Finite State Machine/Theorem Prover