Skip to main content

A small library for propositional logic and formal systems.

Project description

frege

A small, typed library for propositional logic and formal systems.

Install

uv add frege

Quickstart

from frege import Var, evaluate, truth_table

a, b = Var("A"), Var("B")
formula = (a & ~b) | b          # operators build the expression tree

evaluate(formula, {"A": True, "B": False})   # -> True

for assignment, result in truth_table(formula):
    print(assignment, result)

Run the bundled example:

uv run python examples/propositional_logic.py

Development

All tasks run through plain uv commands:

uv sync                          # install the project + dev dependencies
uv run pytest                    # run tests with coverage
uv run ruff check .              # lint
uv run ruff format .             # format (use --check in CI)
uv run ty check                  # type check
uv run python examples/propositional_logic.py

Drop throwaway scripts in playground/ (git-ignored) to experiment.

Releasing

Releases publish to PyPI via GitHub Actions trusted publishing (OIDC, no tokens):

# bump version in pyproject.toml, commit, then:
git tag v0.0.1
git push origin v0.0.1

The tag triggers .github/workflows/release.yml, which builds and uploads to PyPI. A one-time PyPI pending publisher must be configured first: at https://pypi.org/manage/account/publishing add project frege, owner tom-h-f, repository frege, workflow release.yml, environment pypi.

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

frege-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

frege-0.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file frege-0.0.1.tar.gz.

File metadata

  • Download URL: frege-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for frege-0.0.1.tar.gz
Algorithm Hash digest
SHA256 987a5a59a91afd36b01a3021e8596d2cf7187d69d1f197c9481e428004b11598
MD5 77a45c2297be4e1ea70b3a9c02e8c769
BLAKE2b-256 7fca5d101b93f168b338564de40fd43314464b83d766c2b2c22ea685444d06ec

See more details on using hashes here.

File details

Details for the file frege-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: frege-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for frege-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8d7c38b39f14b7191779a587c0ced13066e34c603ca74282488a971b8a4ac2f
MD5 c8166798caf497e1545939784cac94cc
BLAKE2b-256 d0ee6cf173af321736d11cf2cb53d51576f3e410468da06fc16b7cf20281dbf7

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