- Home
- Skills
- Testing & Debugging
- Formal Verification Discipline — SMT Solver Proof Hygiene
Works with the AI Agents you already use
Formal Verification Discipline — SMT Solver Proof Hygiene
Enforces a rigorous SMT solver discipline to prevent silent errors and false positives in formal verification.
$13
Formal Verification Discipline — SMT Solver Proof Hygiene
Example session with this skill installed
I have a new z3 script for a trace identity. Check if it follows the verification discipline before I run the full campaign.
- Read your context and instructions
- Compiled the formal verification discipline
I have audited your z3 script against the formal verification discipline. While the logic for the identity is sound, the script currently lacks per-check timeout handling and does not explicitly print a model when SAT is found.
SMT Verification Audit
| Requirement | Status | Observation |
|---|---|---|
| Counterexample Search | PASS | Uses s.add(left != right) pattern correctly. |
| Manual Derivation | FAIL | No hand-derived trivial case (d=2) found in comments. |
| Per-check Timeout | FAIL | set_param is missing; script may hang on large d. |
| Expansion Logic | PASS | Left side is fully expanded; no tautological rewrites. |
| Limit Declaration | WARNING | Script does not state which sizes it is intended to close. |
Improved Solver Configuration
import z3
def verify_identity(left, right, label):
s = z3.Solver()
# Enforce discipline: per-check timeout (20s)
z3.set_param('timeout', 20000)
# Search for counterexample
s.add(left != right)
print(f"Checking {label}...")
r = s.check()
if r == z3.unsat:
print(f"RESULT: THEOREM (UNSAT) for {label}")
elif r == z3.sat:
print(f"RESULT: SAT - Counterexample found: {s.model()}")
else:
print(f"RESULT: TIMEOUT/UNKNOWN - {label} is UNPROVEN")
# Trivial hand-check (d=2) recorded:
# Trace(A) where A=[[1,2],[3,4]] is 5. Claim: Tr(A)=5.
# Matches hand derivation.
Next steps
- Insert the manual derivation for the
d=2case into the script header. - Add the
set_paramcall inside your check loop to handle high-degree terms. - Update your proof ledger to mark any
UNKNOWNresults as unproven rather than skipped.
Connects securely to your tools. The creator never sees your data.
About this skill
Formal verification with SMT solvers like z3 or NLSat often fails because of silent errors. A solver returning UNSAT might mean your theorem is correct, or it might mean you accidentally encoded a tautology or missed a term. This skill enforces a rigorous mathematical discipline to ensure your proofs are actually valid and your solver scripts are reliable.
What it does
- Enforces counterexample construction by requiring a
left != rightsearch pattern rather than simple side-by-side rewrites. - Validates manual derivations by checking the trivial base case by hand before the solver ever runs.
- Configures execution limits by mandating per-check timeouts and explicit
TIMEOUT/UNKNOWNhandling to prevent false positives. - Documents solver limits by embedding the specific sizes and parameters that closed (or failed to close) directly within the script.
- Prevents encoding corruption by providing specific PowerShell UTF-8 handling for scripts containing mathematical symbols.
How it works
- Initial Claim Review: State the mathematical claim in a single sentence and derive a trivial case by hand to catch basic encoding errors.
- Encoding Audit: Review the SMT script to ensure one side of the equation is fully expanded and no tautologies exist.
- Execution Setup: Verify that
set_param('timeout', ...)is applied per check and that the script handles non-terminating checks as "unproven." - Result Recording: Update the proof ledger with what was proven, at what sizes, and which conjectures were refuted.
Frameworks & tools
Python-based SMT solvers including z3-solver and NLSat. It also includes specific encoding fixes for PowerShell 5.1 environments.
Why this beats prompting it yourself
Standard LLMs often trust a solver's UNSAT result blindly, leading to "verified" claims that are actually based on flawed logic or tautologies. This skill forces a specific working order—learned from real-world failures—that treats a timeout as a failure rather than a success and mandates manual arithmetic checks to ground the AI's logic.
Use cases
- Adding a new theorem to a project proof ledger.
- Debugging a solver script that returns suspicious UNSAT results.
- Extending existing solver scripts to larger dimensions or higher degree terms.
- Managing complex inequality proofs where manual verification is impossible but encoding errors are likely.
Known limitations
This skill does not provide the solver binaries or scripts themselves. It is a discipline for auditing and writing them within the user's existing environment.
Does not provide solver binaries. Requires the user to maintain their own proof ledger. Focuses on Python-based SMT solver patterns.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 20 days ago