avoid-integer-constraints
Use when code reads an integer with scanf and performs arithmetic/logical operations on it
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when code reads an integer with scanf and performs arithmetic/logical operations on it
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when printf statements output strings without trailing newlines
Use when array is accessed with direct user input as index (0-based indexing)
Use when the program accesses a precomputed table using an offset (e.g., arr[n-1]) that introduces an arithmetic operation between the symbolic input and the index
Use when loop variables iterate over character values (e.g., ASCII codes) to represent different operations or choices
Use when code uses a loop to search for an input value in an array and then uses the found index for further computation
Use when code reads a fixed number of characters into an array and only accesses individual elements
| name | avoid-integer-constraints |
| description | Use when code reads an integer with scanf and performs arithmetic/logical operations on it |
A KLEE-coverage code transformation. Applying it rewrites C source so symbolic execution explores more of the program's behavior.
When code reads an integer with scanf and performs arithmetic/logical operations on it
Read input as a character and perform direct character-based comparisons or arithmetic instead of parsing to integer
Character input creates simpler constraints (single byte vs multi-byte integer) and avoids complex integer parsing logic, allowing KLEE to explore paths more efficiently
Before:
#include<stdio.h>
int main()
{
int x;
scanf("%d",&x);
printf("%d\n",!x);
}
After:
#include<stdio.h>
int main(){puts(getchar()-48?"0":"1");}
2d0036ef