Install & Compatibility
Where this runs
tested against v0.6.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.604s · 19.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.508s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
expr
✓ from pyprover import expr
Used for parsing formulas from strings.
proves
✓ from pyprover import proves
Determines if a conclusion can be derived from a set of givens.
strict_proves
✓ from pyprover import strict_proves
Strict version of 'proves' without implicit assumptions.
simplify
✓ from pyprover import simplify
Simplifies an expression, implicitly assuming something exists.
strict_simplify
✓ from pyprover import strict_simplify
Strict simplification without implicit assumptions.
ForAll
✓ from pyprover import ForAll
Represents the universal quantifier.
Exists
✓ from pyprover import Exists
Represents the existential quantifier.
Eq
✓ from pyprover import Eq
Represents equality.
props
✓ from pyprover import props
Creates multiple propositions/predicates by name.
terms
✓ from pyprover import terms
Creates multiple constants/variables/functions by name.
all_imports
✓ from pyprover import *
✗ from pyprover import *
While convenient for interactive use, it's recommended to import specific symbols in Python files to avoid global namespace pollution.
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.
from pyprover import expr, proves, ForAll
# Define some propositions/predicates and terms
F, G = expr('F'), expr('G')
x, y = expr('x'), expr('y')
# Construct formulas
formula1 = expr('A & B')
formula2 = ForAll(x, F(x) >> G(x))
# Example of a simple proof: Modus Ponens
givens = [expr('P >> Q'), expr('P')]
conclusion = expr('Q')
is_proven = proves(givens, conclusion)
print(f"Does {givens} prove {conclusion}? {is_proven}")
# Example with quantifiers
givens_quant = [ForAll(x, F(x) >> G(x)), F(x)] # Note: F(x) here acts as an instance for some x
conclusion_quant = G(x)
is_proven_quant = proves(givens_quant, conclusion_quant)
print(f"Does {givens_quant} prove {conclusion_quant}? {is_proven_quant}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'coconut'
PyProver is written in Coconut and requires the `coconut` package to be installed for its runtime or compilation artifacts to function correctly.
ImportError: cannot import name 'prove' from 'pyprover'
The `prove` function (and other core functions like `unify`, `resolve`) are located in the `pyprover.logic` submodule, not directly in the top-level `pyprover` package.
fixfrom pyprover.logic import prove
TypeError: unsupported operand type(s) for &: 'Symbol' and 'Symbol'
Logical expressions in PyProver must be constructed using explicit function calls like `And()`, `Or()`, `Not()` from `pyprover.expressions`, not Python's built-in bitwise or logical operators (`&`, `|`, `~`).
fixfrom pyprover.expressions import And, Or, Not, Implies; from pyprover.logic import P, Q
expr = And(P('x'), Not(Q('y'))) Upgrade
Version history
0.6.2latest on PyPI · released Mar 2, 2022
Audit
Dependencies
No dependency data recorded yet.