formal-logic

Determine tautologies, contradictions, and valid entailments using Z3 SMT solving.

33|6|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill formal-logic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: formal-logic
Source: https://github.com/xjtulyc/awesome-rosetta-skills/tree/main/skills/14-philosophy/formal-logic
Command: npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill formal-logic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires z3-solver, sympy, numpy, and includes assets (resource) components.

What problem does it solve?

Formal-logic skill helps you determine whether logical statements are tautologies/contradictions, check the validity of arguments, and solve constraint puzzles by translating reasoning tasks into satisfiability or proof checks.

Core Features & Use Cases

  • SMT for propositional and first-order logic: Encode formulas with Z3 and check satisfiability to verify arguments like “premises entail conclusion.”
  • Constraint solving via SAT/SMT encodings: Solve logic-grid puzzles, Zebra/Einstein riddle, and N-Queens by expressing them as variables and constraints.
  • Modal logic (S5) validity checking: Evaluate necessity/possibility properties under S5 Kripke frame semantics using brute-force model checks.
  • Lean-style proof verification and sympy support (conceptual tooling): Use sympy’s logic utilities for symbolic manipulations and teach/verify equivalences for smaller formulas.

Quick Start

Use the formal-logic skill to check whether a candidate argument is valid by encoding its premises and conclusion in Z3 and testing whether the negated conclusion is satisfiable.

Frequently Asked Questions about formal-logic

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if a logical argument is valid using Z3?

To check argument validity using Z3, encode the premises and conclusion as satisfiability formulas, then test whether the negated conclusion is satisfiable alongside the premises. If unsatisfiable, the formal logic argument is a valid entailment.

Can I solve constraint satisfaction puzzles like N-Queens and Zebra with an SMT solver?

Yes, you can solve constraint satisfaction puzzles like N-Queens and Zebra by expressing the grid variables and rules as Z3 constraints. The SMT solver performs satisfiability checks to find a valid model that satisfies all puzzle conditions.

How do I verify modal logic S5 validity using Kripke semantics?

You verify modal logic S5 validity by evaluating necessity and possibility properties under S5 Kripke frame semantics. The formal logic tool performs brute-force model checks across possible worlds to determine if the modal formula holds universally.

Does Z3 work with sympy for propositional logic tautology reasoning?

Z3 works alongside sympy for propositional logic reasoning by using sympy's logic utilities for symbolic manipulation and equivalence verification. This combination helps teach and verify tautologies for smaller propositional formulas before SMT encoding.

What is the best way to determine if a logical formula is a tautology or contradiction?

The best way to determine if a logical formula is a tautology or contradiction is translating the statement into a Z3 satisfiability check. If the negation is unsatisfiable, it is a tautology; if the original formula is unsatisfiable, it is a contradiction.

When should I not use an SMT solver for theorem proving?

You should avoid using an SMT solver for theorem proving when working with higher-order logic systems requiring constructive proofs, or when dealing with formulas so large that brute-force satisfiability checks become computationally intractable.