Skip to main content

Tiny CoC-based theorem prover with inductive types

Project description

Tinyprove

A small, minimal theorem prover.

pytorch : tinygrad :: lean : tinyprove

Get started:

from parser import parse
from tinyprove import infer, check
from axiom_defs import DEFNS

Parser supports parsing with a context of existing variables specified.

ctx = [("A", parse("Type0"))]
identity = parse("λ x: A -> x", ctx)

Terms can be printed (need to pass context).

print(identity.str(ctx))

Type inference:

identity_ty = infer(identity, ctx)

DEFNS supplies some basic inductive types (False, And, Or, Exists, Nat), plus the classical excluded middle axiom (.em).

identity_ty = infer(identity, ctx, defns=DEFNS)

Since identity doesn't use any of these definitions, the result is the same.

To see how you can prove some basic theorems, check test.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinyprove-0.1.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinyprove-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file tinyprove-0.1.0.tar.gz.

File metadata

  • Download URL: tinyprove-0.1.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for tinyprove-0.1.0.tar.gz
Algorithm Hash digest
SHA256 70e690e6ea60f928d411f503fef762b34b085a776c91baa1a510e7746b4b1fe4
MD5 d1d2fbaeadc17996cf6238fadd5f99df
BLAKE2b-256 066d3b5892c1bf6aec97daae828dc2df04095676c3c127d083ebf67c294ca3c5

See more details on using hashes here.

File details

Details for the file tinyprove-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tinyprove-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for tinyprove-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46dbd4fbc9e5c648f2b0919bb93520223b4a2bed3ca5c6a83572207d47b11967
MD5 a26cb138aba98c0c9e8a548ed31776c6
BLAKE2b-256 4894355b109956232655666dab19bc099daeba088daa293144d0e6c751a23d77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page