smv-model-extractor — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited smv-model-extractor (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Automatically extract abstract finite-state models from source code for formal verification with NuSMV model checker.
This skill transforms imperative programs (C/C++, Java, Python) into declarative SMV models suitable for model checking. It analyzes control flow, data flow, and program variables to construct states and transitions, applying appropriate abstraction to make models tractable while preserving properties of interest.
Read and understand the program structure:
# For single file
python3 scripts/extract_model.py program.c -o model.smv
# For multiple files
python3 scripts/extract_model.py file1.c file2.c file3.java -o model.smv
# For entire directory
python3 scripts/extract_model.py src/*.py -o model.smvThe extractor automatically:
The skill uses medium abstraction by default (balanced approach):
Data abstraction:
Control abstraction:
Abstraction levels:
# Low abstraction (more detail, larger state space)
python3 scripts/extract_model.py program.c -o model.smv --abstraction low
# Medium abstraction (recommended, balanced)
python3 scripts/extract_model.py program.c -o model.smv --abstraction medium
# High abstraction (minimal states, protocol phases only)
python3 scripts/extract_model.py program.c -o model.smv --abstraction highThe extractor produces:
Example output structure:
-- SMV Model automatically extracted from source code
MODULE main
VAR
pc : {s0, s1, s2, s3}; -- program counter
flag : boolean;
count : 0..3;
ASSIGN
init(pc) := s0;
init(flag) := FALSE;
init(count) := 0;
next(pc) := case
pc = s0 & !flag : s1;
pc = s1 : s2;
pc = s2 & count < 3 : s3;
pc = s3 : s0;
TRUE : pc;
esac;
next(count) := case
pc = s2 & count < 3 : count + 1;
TRUE : count;
esac;After model generation, add temporal logic specifications to verify:
Safety properties (things that should never happen):
-- No buffer overflow
SPEC AG (count <= 3)
-- Mutual exclusion
SPEC AG !(process1_critical & process2_critical)Liveness properties (things that should eventually happen):
-- Eventually reach goal state
SPEC AF (pc = s3)
-- Request eventually granted
SPEC AG (request -> AF grant)See smv_syntax.md for complete SMV syntax reference.
Verify the model with NuSMV:
# Check all specifications
NuSMV model.smv
# Interactive mode
NuSMV -int model.smv
# Generate counterexample if property fails
NuSMV -dcx model.smvScenario: User has implemented a network protocol and wants to verify correctness.
Approach:
See: extraction_patterns.md for detailed protocol patterns.
Scenario: Multi-threaded program with shared resources.
Approach:
Scenario: Program with explicit state variable and transitions.
Approach:
When codebase is large, focus extraction on relevant functions:
python3 scripts/extract_model.py program.c -o model.smv \
--focus-functions connect disconnect send_messageExplicitly specify which variables to include in state:
python3 scripts/extract_model.py program.c -o model.smv \
--track-vars connection_state buffer_count retry_limitState explosion: Model has too many states, verification is slow or fails.
Over-abstraction: Model is too abstract, properties are trivially true/false.
Missing transitions: Model has deadlocks not present in original program.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.