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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
987a5a59a91afd36b01a3021e8596d2cf7187d69d1f197c9481e428004b11598
|
|
| MD5 |
77a45c2297be4e1ea70b3a9c02e8c769
|
|
| BLAKE2b-256 |
7fca5d101b93f168b338564de40fd43314464b83d766c2b2c22ea685444d06ec
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8d7c38b39f14b7191779a587c0ced13066e34c603ca74282488a971b8a4ac2f
|
|
| MD5 |
c8166798caf497e1545939784cac94cc
|
|
| BLAKE2b-256 |
d0ee6cf173af321736d11cf2cb53d51576f3e410468da06fc16b7cf20281dbf7
|