Note for insallation and run
- Install some python libraries: sympy (http://sympy.org/), ply (www.dabeaz.com/ply/).
- Install Mathematica and Mathlink for Linux (www.wolfram.com/mathematica/ and http://reference.wolfram.com/mathematica/tutorial/MathLinkDeveloperGuide-Unix.html).
- The pcre_tohampi.pm is runnable with Perl-5.10.0, other versions of Perl we haven't tested yet. If you are using another version of Perl, you can switch to Perl-5.10 by using Perlbrew (http://perlbrew.pl/). Note that after installing perlbrew, you may want to add this line "source ~/perl5/perlbrew/etc/bashrc" to your .bashrc file
- You also need openjdk (either version 6 or 7 works, http://openjdk.java.net).
- It works on Linux OS only, Windows and other OSes are not supported.
src folder and run
$ cd src $ make
To run SMC
Replicating the results
Case Studies & Comparison (Section 4.2, 4.3, Table 5)
Run the script test_utilities.sh
Output reported on console:
- composition of constraints
Top-level directory structure
The script to runs all case studies in the paper
SMC's Inputs/ Outputs for Kaluza benchmark
Includes several input/output of what we reported in our paper
Handles regexes and automatons conversons.
Comes with regex library of HAMPI
The lexer file for SMC language. We use PLY library for parsing the input.
The main parser of SMC. This module reads and parses the input, converts to CNF and does other tasks as described in the paper. Finally it generates the intermediate language for further processing
Contains main data structures for the parsing & inital processing steps.
Contains main utilities for the parsing & inital processing steps. For example, we translalte the constraints to CNF form, build the concat dependency graph and export the constraint to intermediate constraint language in this file, which are called by smc_parser.py above.
Reads the generated intermediate file and does the counting job by querying to Mathematica. We read the constraint file twice: the first read is to initialize each variable with their proper length while the second time is to translate the string constraints to GF domain. Finally it returns the results corresponding to the query.
Provide the call and interaction with Mathematica.
Handle regexes operations including handle with group of regex constraints.
Handle contains operations, both single contains and conjunction of contains.
pcre_tohampi.pm, YAPE, run_pcre.pl, read_pcre.py
Convert and translate pcre regexes to an intermediate language and transform to GFs domain.
smc.conf, smc.kaluza.conf, smc.cs
Includes serveral configurations for SMC in default, kaluza testcase and case studies respectively. You can configure MAXN - the maximum length of string, ALPHABET_SIZE - the number of characters in alphabet, or the optimization options of concat operator.
Consists of several consts of the tool.
rawutils.py, raw_to_smc_parser.py, raw_to_smc_lexer.py
Translate C String operators, like strcasestr, strlen,... to SMC language. The translation was mentioned in previous work , we just self-implemented it again here.
-  http://people.csail.mit.edu/akiezun/hampi/
SMC is maintained by Loi Luu (firstname.lastname@example.org). Should you have any comments/questions, please feel free to drop me an email. You can also report bug through email or here on github.
We prepared a running VM for SMC hosted on our ftp server. It can be downloaded from:
ftp://andromeda.d2.comp.nus.edu.sg/www/smc-dev_compressed.vdi.tar.gz Username: smc Password: smc@nus Ubuntu password: 123456