cirrus-uchicago/symbolon/explicit-branches-over-data-driven-loops

Claude Code and agent skill by cirrus-uchicago/symbolon

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when the solution encodes problem logic via a lookup table combined with nested loops that compute results indirectly (e.g., scanning an array for matches and using modular arithmetic to traverse it)

Install

npx vskill@latest install cirrus-uchicago/symbolon/explicit-branches-over-data-driven-loops

SKILL.md

The same SKILL.md was published earlier as cirrus-uchicago/symbolon/explicit-branches-over-data-driven-loops.

explicit-branches-over-data-driven-loops

Overview

A KLEE-coverage code transformation. Applying it rewrites C source so symbolic execution explores more of the program's behavior.

When to use

When the solution encodes problem logic via a lookup table combined with nested loops that compute results indirectly (e.g., scanning an array for matches and using modular arithmetic to traverse it)

Transformation

Replace the table-driven search with explicit conditional branches that enumerate the distinct input cases (e.g., s<=5 vs s>5, with sub-cases on the relation between s and f), each handled by a direct loop over the relevant numeric range

Why it helps

KLEE forks on each branch condition, so explicit if/else cases produce well-separated path constraints tied directly to input variables, making constraint solving fast and yielding tests that cover each semantic case; data-driven loops with index arithmetic and inner while loops create deep, intertwined symbolic states whose constraints involve loop counters and modular indices, leading to path explosion or unsolved coverage of distinct input behaviors

Example

Before:

c
#include<stdio.h>
int L[]={0,1,2,3,4,5,6,7,8,9,5,4,3,2,1};
int main(){
int a;
scanf("%d",&a);
while(a--){
int b,c;
scanf("%d%d",&b,&c);
int at=0;
int dist=99999999;
for(int i=0;i<15;i++){
if(L[i]==b){
int now=i;
int t=0;
while(L[now]!=c){
now++;
now%=15;
t++;
}
if(t<dist){
dist=t;
at=i;
}
}
}
int now=at;
while(1){
if(now!=at)printf(" ");
printf("%d",L[now]);
if(L[now]==c)break;
now++;
now%=15;
}
printf("\n");
}
}

After:

c
#include<stdio.h>
int main(){
int n,s,f;
int w;
//while(1){
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d %d",&s,&f);
if(s<=5){
if(s<f){
for(int i=s;i<=f;i++)
{
if(i!=s)printf(" ");
printf("%d",i);
}
}
else if(s>f){
for(int i=s;i>=f;i--)
{
if(i!=s)printf(" ");
printf("%d",i);
}
}
}
if(s>5){
if(f>s){
for(int i=s;i<=f;i++)
{
if(i!=s)printf(" ");
printf("%d",i);
}
}
else if(5<f&&f<s){
for(int i=s;i<=9;i++)
{
if(i!=s)printf(" ");
printf("%d",i);
}
for(int i=5;i>=0;i--)
{
printf(" ");
printf("%d",i);
}
for(int i=1;i<=f;i++)
{
printf(" ");
printf("%d",i);
}
}
else if(f<=5){
for(int i=s;i<=9;i++)
{
if(i!=s)printf(" ");
printf("%d",i);
}
for(int i=5;i>=f;i--)
{
printf(" ");
printf("%d",i);
}
}
}printf("\n");
}
return 0;
}

Evidence

  • Average coverage delta: 0.3687
  • Source problems: train_AIZU_p00140
  • Rule id: be0e88be

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
11
7-day trend score
17

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/cirrus-uchicago/symbolon/explicit-branches-over-data-driven-loops/badge)](https://verified-skill.com/skills/cirrus-uchicago/symbolon/explicit-branches-over-data-driven-loops)

Something wrong with this skill or its page? Tell us.