Description
The artifact is the prototype of the typechecker used to provide experimental results in the article ‘On Type-Cases, Union Elimination, and Occurrence Typing’. It features an implementation of the inference algorithm presented in the paper (as well as several extensions documented in the supplementary appendix).
Assets
Instructions
General Installation
Software Dependencies:
Software dependencies include: - the OCaml compiler version 4.08.1 or more recent (https://www.ocaml.org) - the following OCaml tools or libraries: * dune https://github.com/ocaml/dune * odoc https://github.com/ocaml/odoc * num https://github.com/ocaml/num * menhir and menhirLib http://gallium.inria.fr/~fpottier/menhir/ * pomap https://github.com/mmottl/pomap * ppx_deriving https://github.com/ocaml-ppx/ppx_deriving
* sedlex https://github.com/ocaml-community/sedlex
There is an optional dependency on the Js_of_ocaml compiler to generate a javascript/html version of the prototype.
https://github.com/ocsigen/js_of_ocaml
General Installation:
It is advised to install the OCaml compiler and the dependencies through the opam package manager. Assuming a functional installation of opam and OCaml compiler >= 4.08.1:
opam install odoc num dune menhir pomap ppx_deriving menhirLib sedlex
cd typecaseunion-prototype/src
make
if the make or gnumake utility is not available, one can simply run:
dune build prototype.exe
instead.
The Javascript version can be built with:
make js
or
dune build prototype_js.bc.js
cp _build/default/prototype_js.bc.js html/prototype_js.js
chmod +w html/prototype_js.js
Experimental Installation
Installation:
There is no need to install anything. One can simply run the prototype.exe executable after building it, using the command:
dune exec -- prototype.exe
The JavaScript version can be used by serving the html/ directory over HTTP (directly opening the index.html page will not work).
Parameterization:
Without any argument, the prototype typechecks the file ‘test.ml’ of the current directory. Otherwise, one can pass a filename on the command line:
dune exec -- prototype.exe path/to/myfile.ml
Examples from the paper and others can be found in the html/ subdirectory. The file index.html of the online prototype contains the grammar of the language.
Evaluation:
The prototype will type-check the file, printing the inferred type as well as various timing statistics. In case of a type error, the prototype will print an error message.
Provenance
The typecaseunion-prototype is the original work of Mickaël Laurent as part of his Ph.D. thesis.
The vendored cduce compiler is the original work of Alain Frisch and contributors and is only included for convenience. It is available here: https://www.cduce.org under the term of an MIT-like free software license.
License
free
Comments
-
Author Tags
Copyright
Author(s)


