Writing specification using SpecTec-Core, which is generalized from Wasm and P4.
See nanorust_spec folder to see specification of NanoRust.
-
Install
opamversion 2.0.5 or higher.apt-get install opam opam init
-
Create OCaml switch for version 5.1.0 Install
duneversion 3.16.1,bignumversion v0.17.0,menhirversion 20240715,coreversion v0.17.1,core_unixversion v0.17.0, andbisect_ppxversion 2.8.3 viaopam.opam switch create 5.1.0 eval $(opam env) opam install dune bignum menhir core core_unix bisect_ppx
make exeThis creates an executable spectec-core in the project root.
SpecTec-Core currently consists of three main components.
- SpecTec EL is the surface language in which the spec is authored.
- SpecTec IL (internal language). EL -> IL conversion is called "elaboration". Elaboration makes the spec more algorithmic and unambiguous.
- An interpreter backend for IL.
- Needs to be coupled with a parser that converts an input file into a SpecTec IL value to properly produce output.
# elaborate a SpecTec spec
./spectec-core elab spec/*.spectecSpecTec-Core is an open-source project. Please feel free to contribute by opening issues or pull requests.
SpecTec-Core is released under the Apache 2.0 license.