- Overview
- Prerequisite
- Core NESA Client
- How to Run NESA
- How to Run Baselines
- Troubleshooting
- Paper
- Contact
- License
NESA is a static analysis framework for Java and C/C++ code. It combines lightweight symbolic analysis with LLM-backed neural primitives for slicing and bug detection tasks.
This repository supports:
- Direct runs through
src/nesa/run.py - Shell wrappers under
scripts/nesa/for benchmark and project analysis - Baseline runners under
scripts/baseline/
All model-backed entrypoints use the same core contract:
--inference-model MODEL_ID # optional, defaults to gpt-4o-mini
--temperature FLOAT # optional, defaults to 0.0Set up the environment:
conda create -n nesa python=3.9
conda activate nesa
pip install -r requirements.txt
python lib/build.py
chmod +x scripts/nesa/*.sh scripts/baseline/*.shRuntime notes:
- NESA requires
lib/build/my-languages.so;python lib/build.pygenerates it. - Install
jqif you want to use the shell wrappers inscripts/. - The wrappers under
scripts/nesa/default to a Python binary inside a localnesaconda environment. - If your environment lives elsewhere, set
NESA_PYTHON="$(which python)"after activation, or pass--python-bin /path/to/python3.
Credentials:
- OpenAI models use
OPENAI_API_KEY - Claude models are invoked through AWS Bedrock and require working AWS credentials plus a Bedrock model ID
Example:
export OPENAI_API_KEY=your_openai_api_key_hereUse src/nesa/run.py when you want to run the engine directly.
Single-file example:
python src/nesa/run.py \
--source-file data/juliet/xssdata/CWE80_XSS__Servlet_getCookies_Servlet_07.java \
--analyzer-file xssdetect.dl \
--eval-rule-mode full-featured \
--parallel-rule-n 8 \
--parallel-primitive-n 8 \
-semi-naive-evaluation \
-measure-token-costProject example:
python src/nesa/run.py \
--src-project data/h3 \
--analyzer-file intraml.dl \
--language cppImportant options:
- Use either
--source-fileor--src-project --analyzer-fileis required--languagedefaults tojava; usecppfor C/C++--seed-fileis only needed for slicing workloads--parallel-rule-nand--parallel-primitive-ndefault to8
NESA wrappers live under scripts/nesa/.
Available detector wrappers:
run_xss_detector.shrun_apt_detector.shrun_dbz_detector.shrun_npd_detector.shrun_re_detector.shrun_uowh_detector.shrun_taintbench_detector.shrun_intraml_detector.shrun_backward_slicing.sh
Common NESA workflows:
Backward slicing:
bash scripts/nesa/run_backward_slicing.sh \
--source-file data/backwardslice/source_files/p00007_s586604643_14_n.java \
--seed-file data/backwardslice/seed_files/p00007_s586604643_14_n.jsonJuliet detectors:
bash scripts/nesa/run_apt_detector.sh \
--source-file data/juliet/aptdata/CWE36_Absolute_Path_Traversal__console_readLine_45.javaTaintBench:
bash scripts/nesa/run_taintbench_detector.sh 112 \
--benchmark-json data/TaintBench/benchmark.jsonMemory leak detection on a C/C++ project:
bash scripts/nesa/run_intraml_detector.sh \
--src-project data/h3Notes:
- Juliet detector wrappers support
--benchmark-filefor batch mode and--source-filefor single-file mode run_intraml_detector.shaccepts--src-projectonly- Logs are written under
log/
Baseline wrappers live under scripts/baseline/.
Available baseline runners:
run_fscot_slicing.shrun_fscot_detect.shrun_fscot_taint.sh
Examples:
Backward slicing baseline:
bash scripts/baseline/run_fscot_slicing.sh \
--source-file data/backwardslice/source_files/p00007_s586604643_14_n.javaJuliet bug detection baseline:
bash scripts/baseline/run_fscot_detect.sh \
--bug-type apt \
--source-file data/juliet/aptdata/CWE36_Absolute_Path_Traversal__console_readLine_01.javaTaintBench baseline:
bash scripts/baseline/run_fscot_taint.sh \
--global-id 112Notes:
- Supported Juliet
--bug-typevalues areapt,dbz,npd,re,uowh, andxss - Baseline logs are also written under
log/
- Model selection
If you omit
--inference-model, NESA and the baseline wrappers default togpt-4o-mini. - API key or provider errors
Make sure
OPENAI_API_KEYor AWS Bedrock credentials are configured before running. - Missing
jqInstalljqbefore using the shell wrappers inscripts/. - Missing tree-sitter library
Re-run
python lib/build.pyiflib/build/my-languages.sois missing. - Existing logs cause a run to be skipped Some runners skip files whose log already exists; delete the log or use the runner's force option if available.
If you find our research or tools helpful, please cite the corresponding papers from this project.
@article{10.1145/3808161,
author = {Wang, Chengpeng and Gao, Yifei and Zhang, Wuqi and Liu, Xuwei and Guo, Jinyao and Zheng, Mingwei and Shi, Qingkai and Zhang, Xiangyu},
title = {NESA: Relational Neuro-Symbolic Static Program Analysis},
year = {2026},
issue_date = {July 2026},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
volume = {3},
number = {FSE},
journal = {Proc. ACM Softw. Eng.},
month = jul,
articleno = {FSE154},
doi = {10.1145/3808161}
}
This project is licensed under the MIT License. See LICENSE.
For any questions or suggestions, please submit issues or pull requests on GitHub. You can also reach out to the maintainer:
- Chengpeng Wang (Purdue University) - wang6590@purdue.edu, stephenw.wangcp@gmail.com