{"id":5416,"library":"pyprover","title":"PyProver: Resolution Theorem Proving","description":"PyProver is a resolution theorem prover for first-order predicate logic, implemented in pure Python. It is written in Coconut, which compiles to universal Python, ensuring compatibility across various Python versions. The latest version is 0.6.2, released in March 2022. The project is currently in an alpha development stage and has an infrequent release cadence.","status":"active","version":"0.6.2","language":"en","source_language":"en","source_url":"https://github.com/evhub/pyprover","tags":["theorem-proving","logic","predicate-logic","resolution-prover","first-order-logic","python"],"install":[{"cmd":"pip install pyprover","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"Used for parsing formulas from strings.","symbol":"expr","correct":"from pyprover import expr"},{"note":"Determines if a conclusion can be derived from a set of givens.","symbol":"proves","correct":"from pyprover import proves"},{"note":"Strict version of 'proves' without implicit assumptions.","symbol":"strict_proves","correct":"from pyprover import strict_proves"},{"note":"Simplifies an expression, implicitly assuming something exists.","symbol":"simplify","correct":"from pyprover import simplify"},{"note":"Strict simplification without implicit assumptions.","symbol":"strict_simplify","correct":"from pyprover import strict_simplify"},{"note":"Represents the universal quantifier.","symbol":"ForAll","correct":"from pyprover import ForAll"},{"note":"Represents the existential quantifier.","symbol":"Exists","correct":"from pyprover import Exists"},{"note":"Represents equality.","symbol":"Eq","correct":"from pyprover import Eq"},{"note":"Creates multiple propositions/predicates by name.","symbol":"props","correct":"from pyprover import props"},{"note":"Creates multiple constants/variables/functions by name.","symbol":"terms","correct":"from pyprover import terms"},{"note":"While convenient for interactive use, it's recommended to import specific symbols in Python files to avoid global namespace pollution.","wrong":"from pyprover import *","symbol":"all_imports","correct":"from pyprover import *"}],"quickstart":{"code":"from pyprover import expr, proves, ForAll\n\n# Define some propositions/predicates and terms\nF, G = expr('F'), expr('G')\nx, y = expr('x'), expr('y')\n\n# Construct formulas\nformula1 = expr('A & B')\nformula2 = ForAll(x, F(x) >> G(x))\n\n# Example of a simple proof: Modus Ponens\ngivens = [expr('P >> Q'), expr('P')]\nconclusion = expr('Q')\n\nis_proven = proves(givens, conclusion)\nprint(f\"Does {givens} prove {conclusion}? {is_proven}\")\n\n# Example with quantifiers\ngivens_quant = [ForAll(x, F(x) >> G(x)), F(x)] # Note: F(x) here acts as an instance for some x\nconclusion_quant = G(x)\n\nis_proven_quant = proves(givens_quant, conclusion_quant)\nprint(f\"Does {givens_quant} prove {conclusion_quant}? {is_proven_quant}\")","lang":"python","description":"This quickstart demonstrates how to define formulas using the `expr` function and construct proofs using the `proves` function. It includes examples for propositional and first-order logic."},"warnings":[{"fix":"Be aware of potential API changes and thoroughly test your code when upgrading versions. Consider the project's maturity level for your application's requirements.","message":"The library is currently in 'Development Status :: 3 - Alpha'. This means the API might change in future versions without strict adherence to semantic versioning, and it may not be suitable for production environments requiring high stability.","severity":"gotcha","affected_versions":"<=0.6.2"},{"fix":"Ensure correct casing for symbols when defining formulas via `expr` to avoid parsing errors.","message":"When using the `expr` function to parse formulas, propositions and predicates must start with a capital letter (e.g., `P`, `Q`, `F(x)`), while constants, variables, and functions must start with a lowercase letter (e.g., `x`, `y`, `f(a)`).","severity":"gotcha","affected_versions":"<=0.6.2"},{"fix":"Prefer explicit imports for better code organization and to avoid name collisions.","message":"While `from pyprover import *` is demonstrated for interactive use, it is generally recommended to import specific functions or classes (e.g., `from pyprover import proves, expr`) in Python files to prevent polluting the global namespace and improve code clarity.","severity":"gotcha","affected_versions":"<=0.6.2"},{"fix":"Users should consider the implications of an inactive project for long-term usage and support. Check the GitHub repository for recent commits or issues before relying heavily on it.","message":"The last release (v0.6.2) was on March 2, 2022. This indicates that the project may not be actively maintained or updated, which could lead to a lack of new features, bug fixes, or compatibility updates for newer Python versions.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}