Skip to content

Commit

Permalink
Merge pull request #131 from Yiannis128/dev
Browse files Browse the repository at this point in the history
Set fix code prompt to optimized version
  • Loading branch information
Yiannis128 committed Jun 5, 2024
2 parents f32d2de + c302496 commit 759b3b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
35 changes: 5 additions & 30 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"--context-bound",
"2"
],
"esbmc_output_type": "vp",
"esbmc_output_type": "full",
"source_code_format": "full",
"llm_requests": {
"max_tries": 5,
Expand Down Expand Up @@ -70,8 +70,8 @@
]
},
"generate_solution": {
"max_attempts": 5,
"temperature": 1.3,
"max_attempts": 4,
"temperature": 0.0,
"message_history": "normal",
"scenarios": {
"division by zero": {
Expand All @@ -87,33 +87,8 @@
]
}
},
"system": [
{
"role": "System",
"content": "You are an secure code generator that parses vulnerable source code, and output from a program called ESBMC, which contains vulnerability information about the source code. You should use the output from ESBMC to find the problem, and correct the source code. ESBMC is always correct. You shall add a NULL check for every heap allocation you make. From this point on, you can only reply in source code. You shall only output source code as whole. Reply OK if you understand."
},
{
"role": "AI",
"content": "OK"
},
{
"role": "Human",
"content": "The following text is the source code of the program, reply OK if you understand:\n\n```c\n{source_code}\n```"
},
{
"role": "AI",
"content": "OK"
},
{
"role": "Human",
"content": "The following text is the output of ESBMC, reply OK if you understand:\n\n```\n{esbmc_output}```"
},
{
"role": "AI",
"content": "OK"
}
],
"initial": "Generate a correction for the source code provided. Show the code only. Do not reply with acknowledgements."
"system": [],
"initial": "From now on, act as an Automated Code Repair Tool that repairs AI C code. You will be shown AI C code, along with ESBMC output. Pay close attention to the ESBMC output, which contains a stack trace along with the type of error that occurred and its location. Provide the repaired C code as output, as would an Automated Code Repair Tool. Aside from the corrected source code, do not output any other text. The ESBMC output is {esbmc_output} The source code is {source_code}"
}
}
}
2 changes: 1 addition & 1 deletion esbmc_ai/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Author: Yiannis Charalambous

__version__ = "v0.5.0rc4"
__version__ = "v0.5.0"
__author__: str = "Yiannis Charalambous"

0 comments on commit 759b3b1

Please sign in to comment.