counterexample-generator

Solid

Generate concrete counterexamples when formal verification, assertions, or specifications fail. Use this skill when debugging failed proofs, understanding why verification fails, creating minimal reproducing examples, analyzing assertion violations, investigating invariant breaks, or diagnosing specification mismatches. Produces concrete input values, execution traces, and state information that demonstrate the failure.

Code & Development 160 stars 17 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 87/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Counterexample Generator Systematically generate counterexamples that demonstrate why verification fails. Provides concrete input values, execution traces, and diagnostic information to help understand and fix specification or implementation issues. ## Core Capabilities ### 1. Precondition Violation Detection Generate inputs that violate preconditions: - **Invalid parameter values** - Out-of-range inputs - **Null/undefined references** - Missing required objects - **State violations** - Invalid object states - **Type mismatches** - Incorrect types - **Constraint violations** - Broken business rules ### 2. Postcondition Failure Analysis Find executions where postconditions fail: - **Return value violations** - Wrong return values - **State inconsistencies** - Incorrect final states - **Invariant breaks** - Invariants violated after execution - **Side effect errors** - Unexpected modifications - **Exception failures** - Wrong or missing exceptions ### 3. Invariant Violation Discovery Identify cases where invariants break: - **Class invariant violations** - Object consistency broken - **Loop invariant violations** - Invariant not maintained - **Data structure violations** - Consistency broken - **Temporal violations** - Time-based properties fail - **Concurrency violations** - Race conditions exposed ### 4. Execution Trace Generation Produce detailed execution paths: - **Step-by-step traces** - Line-by-line execution - **State snapshots** - Variable values at each st...

Details

Author
ArabelaTso
Repository
ArabelaTso/Skills-4-SE
Created
6 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Solid

counterexample-to-test-generator

Automatically generates executable test cases from model checking counterexample traces. Translates abstract counterexample states and transitions into concrete test inputs, execution steps, and assertions that reproduce property violations. Use when working with model checker outputs (SPIN, CBMC, NuSMV, TLA+, Java PathFinder, etc.) and needing to create regression tests, validate bug fixes, or reproduce verification failures in executable test suites.

160 Updated today
ArabelaTso
AI & Automation Solid

counterexample-explainer

Explain why counterexamples violate specifications by analyzing formal specifications (temporal logic, invariants, pre/postconditions, code contracts), informal requirements (user stories, acceptance criteria), test specifications (assertions, property-based tests), and providing step-by-step traces showing state changes, comparing expected vs actual behavior, identifying root causes, and assessing violation impact. Use when debugging test failures, understanding model checker output, explaining runtime assertion violations, analyzing static analysis warnings, or teaching specification concepts. Produces structured markdown explanations with traces, comparisons, state diagrams, and cause chains. Triggers when users ask why something failed, explain a violation, understand a counterexample, debug a specification, or analyze why a test fails.

160 Updated today
ArabelaTso
Code & Development Solid

counterexample-debugger

Debug proof failures using counterexamples from Nitpick (Isabelle) or QuickChick (Coq) to identify specification errors, missing preconditions, and proof strategy issues. Use when: (1) A proof attempt fails and you need to understand why, (2) Counterexamples are generated by Nitpick or QuickChick, (3) Specifications may be incorrect or incomplete, (4) Theorems need validation before proving, (5) Missing preconditions or lemmas need identification, or (6) Proof failures need explanation and correction suggestions. Supports both Isabelle/HOL and Coq equally.

160 Updated today
ArabelaTso