Formal Logic Model Counterexample Solver Script
Develop a formal SMT-solver verification script to identify logic flaws, boundary violations, and counterexamples in analytical models.
Use this template when validating deductive models, game-theoretic equilibria, or theoretical economics proofs. It builds an automated formal verification script that tests claim consistency and identifies mathematical counterexamples.
Role: Director of Formal Epistemology and Automated Mathematical Reasoning.
Context
- Formal Model Title: {{economic_model_name}}
- Set of Fundamental Axioms: {{core_propositions}}
- Theoretical Boundary Constraints: {{boundary_assumptions}}
- Target Claim to Validate: {{target_theorem}}
- Target Verification Language: {{solver_language}}
- Search Space Boundaries: {{counterexample_bounds}}
Task
Generate an automated formal solver script using {{solver_language}} that translates the analytical foundations of {{economic_model_name}} into first-order logical constraints, verifies the logical validity of {{target_theorem}}, and searches for falsifying counterexamples.
Method
- Translate {{core_propositions}} into explicit symbolic logic declarations and arithmetic assertions within {{solver_language}}.
- Model {{boundary_assumptions}} as active solver constraints defining state spaces, parameter domains, and agent behaviors.
- Formulate the negation of {{target_theorem}} as the target objective to prove claim invalidity via satisfiability search.
- Configure solver optimization heuristics and parameter domains according to {{counterexample_bounds}}.
- Implement an automated solver invocation pipeline that checks for
SAT(claim falsified by counterexample) versusUNSAT(claim logically entails from axioms). - Script a parsing routine that prints detailed variable assignments for any detected counterexample state.
- Construct validation assertions that verify model consistency by ensuring the underlying axioms themselves do not contain hidden contradictions.
Constraints
- MUST produce fully syntactically valid code matching the conventions of {{solver_language}} (e.g., Z3 Python API, SMT-LIB2, or Lean).
- MUST NOT allow unconstrained real variables without explicit bounds defined in {{counterexample_bounds}}.
- Axiom satisfiability MUST be proven independently before evaluating the target theorem.
- The script MUST output explicit diagnostic messages explaining whether the theorem is proven or refuted.
Output format
- Solver Initialization & Symbol Declarations: Variable, constant, and function definitions.
- Axiom & Constraint Encodings: Symbolic definitions of {{core_propositions}} and {{boundary_assumptions}}.
- Axiomatic Consistency Check: Isolated solver execution ensuring axioms are non-contradictory.
- Theorem Verification & Negation Assertion: Target proof encoding.
- Counterexample Extraction Routine: Formatting and printing discovered edge cases.
Self-review
- Ensure all 6 variables are referenced correctly with
{{variable}}syntax. - Confirm the logic inversion correctly targets the negation of {{target_theorem}}.
- Verify syntax is error-free according to {{solver_language}} specifications.
- Check that counterexample bounds are strictly enforced to prevent solver divergence.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.