Giter Site home page Giter Site logo

fmjs / emme Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 22.28 MB

EMME: ECMAScript Memory Model Evaluator

License: Other

Makefile 0.02% Python 94.64% Shell 1.19% Alloy 4.15%
emcascript javascript formal-methods formal-verification satisfiability-modulo-theories cvc4

emme's Introduction

EMME: ECMAScript Memory Model Evaluator

This tools provides a SAT/SMT-based verification for JavaScript programs with shared array memory access (i.e., SharedArrayBuffer).

Learn more.

Briefly, given a JavaScript-like SharedArrayBuffer bounded execution program (see .bex files in the examples folder), EMME computes all valid executions according with the ECMA specification (http://tc39.github.io/ecmascript_sharedmem/shmem.html). The valid executions are provided as: 1) a set of graphviz files represeting the memory model relations (i.e., mm*.dot), and 2) an assertion on the automatically generated JavaScript program (i.e., program.js).

Installation

Using Docker:

  1. install Docker with your package manager e.g., sudo apt-get install docker
  2. build the Docker image: cd docker/fedora_64 && docker build -f fedora-emme .
  3. run the Docker image: docker run -i -t fedora-emme /bin/bash

On Linux and MacOS:

  1. install python package dependencies: pip install -r requirements.txt
  2. install CVC4 SMT solver (see http://cvc4.cs.stanford.edu/ for licensing and additional informations): cd ext_tools && bash get_CVC4.sh && cd ..
  3. install V8 JS engine (see https://developers.google.com/v8/ for licensing and additional informations): cd ext_tools && bash get_v8.sh && cd ..

Usage

To start playing with the tool, you can run:

  1. python emme.py examples/single_var/sv_simple01.bex (to generate the valid executions in the folder examples/single_var/sv_simple01/)
  2. python litmus.py -c "bash ext_tools/run_v8.sh" -i examples/single_var/sv_simple01/program.js -n 1k -j 4 (to check if the d8 engine obeys the expected results)
  3. python emme.py examples/single_var/sv_simple01.bex --unmatched --jsengine="bash ext_tools/run_v8.sh" -n 1k -j 4 (to perform the behavioral coverage constraint analysis)
  4. python emme.py examples/single_var/sv_simple01.bex --synth (to generate all equivalent programs in the folder examples/single_var/sv_simple01/)

For more details on the license, have a look at LICENSE.txt

Publications

  • "EMME: a formal tool for ECMAScript Memory Model Evaluation". C. Mattarei, C. Barrett, S. Guo, B. Nelson, and B. Smith. TACAS 2018, 24th International Conference on Tools and Algorithms for the Construction and Analysis of Systems. Thessaloniki (Greece).

Build Status

Code Health https://travis-ci.org/FMJS/EMME.svg?branch=master

emme's People

Contributors

cristian-mattarei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

shxdow

emme's Issues

Some expected executions not observed when en_SINGLE_WRITES disabled

Hi Cristian!

I've found EMME very useful for double-checking expectations I've had about the JS memory model. I currently believe that the JS spec mis-specifies "Init" actions, and I tried to use EMME to confirm that the pathological executions I was expecting were exhibited, but it's not giving the output I was expecting.

For the following test, with en_SINGLE_WRITES disabled, I expected to observe 4 valid executions, for each bytewise combination of thread 2 reading from the init event/thread 1's write.
test.zip (see test.bex in the zip)

However, EMME only reported 2 executions, where thread 2 reads from one or the other, but never a bytewise combination. Graphs are included in the above zip.

However, if I add an unrelated read event on a different thread, at a disjoint section of the arraybuffer, I get the 4 executions I was expecting.
test_unrelated_read.zip (see test.bex in the zip)

This seems to be affected by the tear-free reads predicate. In the first example, if I comment this predicate out of the model, I observe the 4 executions I'm expecting. I don't believe that the tear-free reads condition should affect my test, since "Init" events are specified as being one byte in size.

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.