package lstar-rocq
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2fc04523f29f2dfa87765e781180368cd41eab927bda69af55679d39d9fe41a8
sha512=a1d5e4754f1acf7306a094b821af307bea383976c29ecfeb3b493f5a392b2c8eae8754cfd457fe0dd3f6c8aeba4eeb4cc6ef419b66505247a41d4745fcaacd11
doc/README.html
lstar-rocq
A collection of formally-verified implementations of automata learning algorithms.
Algorithm | Resources | Proofs |
|---|---|---|
L* | ||
Kearns-Vazirani |
Functions return sigma types, so each sub-component of each algorithm provides a proof of correctness alongside its computational outputs.
Building
# Install Dependencies
opam switch create rocq 5.3.0
opam pin add rocq-runtime 9.1.0
opam install rocq-prover dune
# Clone and build
git clone https://github.com/CharlesAverill/lstar-rocq && cd lstar-rocq
make # will build lstar-rocq, extract, then build lstarOptimizations during extraction (such as using OCaml integers) are enabled by default, but can be disabled by commenting out this line in Extraction.v:
From lstar Require Import ExtrOptimizations.The following example file will break without optimizations turned on.
Example
An example execution is provided in alternating.ml. The target language is alternating bit strings (e.g., "01", "10", "101", "0101", etc.). Running dune exec lstar.alternating will start the learning algorithm, report that it has found a DFA that encodes the language, and then run some test cases for bit strings of length 3:
$ dune exec lstar.alternating
DFA found
Input Expected Got Correct
[000] false false Y
[001] false false Y
[010] true true Y
[011] false false Y
[100] false false Y
[101] true true Y
[110] false false Y
[111] false false Y
Accuracy: 8/8Examples lstar.div7 and lstar.mod3 show the learning of DFAs for decimal strings divisible by 7, and binary strings where the number of 1s is divisible by 3.