In this manual, we assume that you are using a Linux system. Particular to this manual, it is run on a Ubuntu system.
- Clone this repo
- Run the following command
cd ext-gitfacts cargo build --release
- (Optional) You may need to install OpenSSL for cargo build to be successful. For Ubuntu system, run
sudo apt-get install libssl-dev
- Verify if the build is successful, run
target/release/gitfacts -h
`
- Install JDK 1.8, run
sudo apt-get install openjdk-8-jdk
- Verify if the build is successful, run
java -version
- (Optional) If you have multiple jdk versions, you can set JDK 1.8 to the default one, run
sudo update-alternatives --set java /usr/lib/jvm/<jdk_name>/bin/java
- Install Maven, run
sudo apt install maven
- Verify if maven is installed successfully, run
mvn -version
- Set environment variables, run
sudo nano /etc/profile.d/maven.sh
, and input the following
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export M2_HOME=/usr/share/maven
export MAVEN_HOME=/usr/share/maven
export PATH=${M2_HOME}/bin:${PATH}
- Activate environment variables, run
sudo chmod +x /etc/profile.d/maven.sh
source /etc/profile.d/maven.sh
- Clone gitslice, run
git clone git@bitbucket.org:liyistc/gitslice.git
- Run the following commands
cd gitslice
git checkout facts-dl4ql
mvn clean install -DskipTests
echo "deb https://dl.bintray.com/souffle-lang/deb-unstable bionic main" | sudo tee -a /etc/apt/sources.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
sudo apt-get update
If you are in a different operating system, please refer here for more information.
Please refer to this guide.
- Install any repository you like and write a corresponding query file
- Run the following commands
cd scripts
python3.7 run.py --repo_path <todo> \
--gitfacts_path <todo> \
--output_path <todo> \
--query_file_path <todo> \
--evome_path <todo> \
--cslicer_path <todo>
Upcoming!
stmt_list :- stmt (stmt_list)?
stmt :- "import java"
| "define" version_selection_opts
| select_stmt
version_selection_opts :- lower_id string_literal ("," version_selection_opts)?
| lower_id "(" multiple_versions_selection_opts ")" ("," version_selection_opts)?
| lower_id "(" string_literal ".." string_literal ")" ("," version_selection_opts)?
multiple_versions_selection_opts :- string_literal ("," multiple_ versions_selection_opts)?
select_stmt :- ("from" from_opts)? ("range" range_opts)? ("where" where_opts)? "select" select_opts
select_opts :- expr ("as" lower_id)? (select_opts)?
from_opts :- upper_id lower_id ("," from_opts)?
range_opts :- lower_id "@" lower_id ("," range_opts)
where_opts :- ("exists" | "not exist" | "forall") "(" reason_opts "that" formula ")" ("and" whereopts)?
reason_opts :- lower_id ("," reason_opts)
formula :- "(" formula ")"
| formula "and" formula
| "not" formula
| primary (">=" | ">" | "=" | "!=" | "<" | "<=" | "=") primary
| call
primary :- lower_id | string_literal | int_literal | call
call :- lower_id "." lower_id "(" (string_literal)? ")"
expr :- "_" | primary