Giter VIP home page Giter VIP logo

timl's Introduction

TiML: A Functional Programming Language with Time Complexity (Parser, Typechecker and Coq Formalization)

Setup Instructions

  1. Install SML/NJ. Make sure command sml and ml-build is in current PATH. On Ubuntu, use this command to install all necessary components of SML/NJ:

    sudo apt-get install smlnj libsmlnj-smlnj ml-yacc ml-ulex
    
  2. Install the Z3 SMT solver version 4.4.1. Make sure command z3 is in current PATH. Z3-4.4.1 is required. Z3-4.4.2 has a known issue.

  3. Install Ruby. Make sure command ruby is in current PATH.

  4. Use make to build TiML, or use ./test.sh to build and test on files in examples sub-directory.

  5. (Optional). Install MLton (a whole-program optimizing SML compiler). Make sure command mlton, mlyacc and mllex is in current PATH. Use make mlton to build TiML with MLton, or use ./test-mlton.sh to build and test on files in examples sub-directory.

  6. (Optional, requires step 5). Run ruby benchmark.rb in directory examples, which will generate file result.csv that reproduces results in Table 1 of the paper.

  7. (Optional). Follow emacs/README.rst to install TiML mode on Emacs.

Play with TiML

examples/test-suite.pkg lists all the benchmark examples. You can use this command to run all the examples:

./main.sh examples/stdlib.pkg examples/test-suite.pkg

or this command to run a single example:

./main.sh examples/stdlib.pkg examples/FILENAME.timl

Note that examples/stdlib.pkg (the standard library) is usually needed.

Readers are advised to read the example files following the order in Table 1 of the companion paper (and in file examples/test-suite.pkg), as new syntax are explained in that order.

To reproduce the results in Table 1 of the companion paper, you can run

cd examples
ruby benchmark.rb

The results will be printed out and written to file "result.csv". Note that this experiment requires MLton, and your processing time may vary.

Coq Proof

The Coq formalization of TiML and its soundness is in proof/Soundness.v. The proof requires Coq 8.5pl3. To check the proof, first compile the utility library:

make

You can also compile the utility library and the soundness proof altogether:

make soundness

timl's People

Contributors

cpitclaudel avatar stonebuddha avatar wangpengmit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

timl's Issues

Error: expr-visitor.sml 787.5.

Hello,
I have just downloaded the project, installed latest Ruby, Z3 and SML, then ran "make". I get the following error:
Error: expr-visitor.sml 787.5.
unresolved flex record (need to know the names of ALL the fields
in this context)
type: {current:'Y ref, outer:'X; 'Z}
Compilation failed.
make: *** [smlnj] Error 1

I looked at the definition:
fun copy_ctx ctx =
{outer = #outer ctx, current = copy_ref $ #current ctx}

which probably creates the issue, but I have almost 0 experience with SML and am having real trouble finding a fix. Could you help me out please?

We are considering using TiML for a performance verification task on middlebox code - if we can manage to make it work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.