propositional-logic
npx machina-cli add skill parcadei/Continuous-Claude-v3/propositional-logic --openclawPropositional Logic
When to Use
Use this skill when working on propositional-logic problems in mathematical logic.
Decision Tree
-
Identify Formula Structure
- Classify: tautology, contradiction, or contingent?
- Main connective: AND, OR, IMPLIES, NOT, IFF?
z3_solve.py sat "formula"to check satisfiability
-
Truth Table Method
- For small formulas (<=4 variables): enumerate all valuations
sympy_compute.py truthtable "p & (p -> q) -> q"- Tautology = all T, Contradiction = all F
-
Natural Deduction
- Apply inference rules: Modus Ponens, Modus Tollens
- Conditional proof: assume antecedent, derive consequent
z3_solve.py prove "Implies(And(p, Implies(p,q)), q)"
-
Semantic Tableaux
- Build tree by decomposing formula
- Closed branches = contradictions
- All branches closed = valid argument
Tool Commands
Z3_Sat
uv run python -m runtime.harness scripts/z3_solve.py sat "And(p, Implies(p, q), Not(q))"
Z3_Tautology
uv run python -m runtime.harness scripts/z3_solve.py prove "Implies(And(p, Implies(p, q)), q)"
Sympy_Truthtable
uv run python -m runtime.harness scripts/sympy_compute.py truthtable "p & (p >> q) >> q"
Z3_Modus_Ponens
uv run python -m runtime.harness scripts/z3_solve.py prove "Implies(And(p, Implies(p,q)), q)"
Cognitive Tools Reference
See .claude/skills/math-mode/SKILL.md for full tool documentation.
Source
git clone https://github.com/parcadei/Continuous-Claude-v3/blob/main/.claude/skills/math/mathematical-logic/propositional-logic/SKILL.mdView on GitHub Overview
This skill provides practical strategies for solving propositional logic problems in mathematical logic. It guides you through formula structure analysis, truth tables, natural deduction, and semantic tableaux, with concrete commands to test satisfiability and prove validity.
How This Skill Works
Begin by identifying the formula's structure (tautology, contradiction, or contingent) and the main connective. For small formulas, construct truth tables with Sympy; for proving consequences, apply natural deduction rules such as Modus Ponens and conditional proof; for general validity, use semantic tableaux. Validate results with the included tool commands (Z3_Sat, Z3_Tautology, Sympy_Truthtable, Z3_Modus_Ponens).
When to Use It
- When you need to classify a formula as tautology, contradiction, or contingent
- When proving a logical consequence or an implication
- When checking the satisfiability of a propositional formula
- When solving problems that require applying natural deduction rules
- When validating arguments via semantic tableaux
Quick Start
- Step 1: Identify the formula structure and main connective
- Step 2: Pick a method (truth table for small formulas, natural deduction for proofs, or tableaux for validity)
- Step 3: Run the recommended commands to obtain satisfiability or proofs (e.g., Z3_Sat, Z3_Tautology, Sympy_Truthtable, Z3_Modus_Ponens)
Best Practices
- Identify the main connective and the overall structure before deriving steps
- Use truth tables for formulas with up to four variables to test satisfiability or validity
- Choose the method (truth table, natural deduction, tableaux) based on the problem type
- Leverage the exact tool commands shown in the skill to automate checks
- Document each step clearly to maintain traceability of the proof or refutation
Example Use Cases
- Check satisfiability of And(p, Implies(p, q), Not(q))
- Prove Implies(And(p, Implies(p, q)), q)
- Compute truth table for p & (p -> q) -> q
- Demonstrate a conditional proof: assume p and p -> q to derive q
- Verify the validity of the argument: from p -> q and p, conclude q using a semantic tableau