Skip to content

adilanwar2399/esbmc-ai

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESBMC AI

AI Augmented ESBMC processing. Passes the output from ESBMC to an AI model that allows the user to use natural language to understand the output. As the output from ESBMC can be quite technical in nature. The AI can also be asked other questions, such as suggestions on how to fix the problem outputted by ESBMC, and to offer further explanations.

This is an area of research. From the ESBMC GitHub:

The efficient SMT-based context-bounded model checker (ESBMC)

demo.webm

Initial Setup

  1. Install required Python modules: pip install -r requirements.txt.
  2. ESBMC-AI does not come with the original ESBMC software. In order to use ESBMC-AI you must provide ESBMC. Download ESBMC executable or build from source.
  3. Create a .env file using the provided .env.example as a template, and, insert your OpenAI API key.
  4. Enter the ESBMC executable location in the .env ESBMC_PATH.
  5. Further adjust .env settings as required.
  6. You can now run ESBMC-AI.

Settings

The following settings are adjustable in the .env file. Some settings are allowed to be omitted, however, the program will display a warning when done so as it is not recommended. This list may be incomplete:

  1. OPENAI_API_KEY: Your OpenAI API key.
  2. CHAT_TEMPERATURE: The temperature parameter used when calling the chat completion API. This controls the temperature sampling that the model uses. Higher values like 0.8 and above will make the output more random, on the other hand, lower values like 0.2 will be more deterministic. Allowed values are between 0.0 to 2.0. Default is 1.0.
  3. AI_MODEL: The model to use. Options: gpt-3.5-turbo, gpt-4 (under API key conditions).
  4. ESBMC_PATH: Override the default ESBMC path. Leave blank to use the default ("./esbmc").
  5. CFG_SYS_PATH: Path to JSON file that contains initial prompt messages for the AI model that give it instructions on how to function.
  6. CFG_INITIAL_PROMPT_PATH: Text file that contains the instructions to initiate the initial prompt, where the AI is asked to walk through the code and explain the ESBMC output.

Usage

Basic

./main.py /path/to/source_code.c

Help

./main.py -h

In-Chat Commands Help

/help

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Acknowledgments

License

GNU Affero General Public License v3.0

About

AI Augmented ESBMC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.2%
  • C 4.8%