Skip to main content

pgass

Python bindings for pgass, a pretty good answer set solver. Build and solve answer set programs as typed Python classes:

import pgass

class Node(pgass.Predicate):
    x: int

class Edge(pgass.Predicate):
    x: int
    y: int

class Cover(pgass.Predicate):
    x: int

X, Y = pgass.vars("X Y")

program = pgass.Program()
program.add(Node(x) for x in range(1, 6))
program.add(Edge(x, y) for x, y in
            [(1, 2), (2, 3), (3, 4), (4, 5), (5, 1), (1, 3)])
program.add(pgass.choice(Cover(X)) << Node(X))
program.forbid(Edge(X, Y) & ~Cover(X) & ~Cover(Y))
program.minimize(Cover(X), weight=1, priority=0)

for answer_set in program.solve(models=0):
    print(sorted(c.x for c in answer_set[Cover]), answer_set.cost)

This is a minimum vertex cover: program.forbid says no edge may go uncovered at both ends, and program.minimize asks for the fewest covered nodes. See the root README for what pgass itself does and how the CLI works.

Download files

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

Source Distribution

pgass-1.0.4.tar.gz (382.2 kB view details)

Uploaded Source

Built Distributions

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

pgass-1.0.4-cp312-abi3-manylinux_2_34_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ x86-64

pgass-1.0.4-cp312-abi3-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ ARM64

pgass-1.0.4-cp312-abi3-macosx_11_0_arm64.whl (8.8 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

pgass-1.0.4-cp311-cp311-manylinux_2_34_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pgass-1.0.4-cp311-cp311-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

pgass-1.0.4-cp311-cp311-macosx_11_0_arm64.whl (8.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pgass-1.0.4-cp310-cp310-manylinux_2_34_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

pgass-1.0.4-cp310-cp310-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

pgass-1.0.4-cp310-cp310-macosx_11_0_arm64.whl (8.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pgass-1.0.4-cp39-cp39-manylinux_2_34_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

pgass-1.0.4-cp39-cp39-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ ARM64

pgass-1.0.4-cp39-cp39-macosx_11_0_arm64.whl (8.8 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file pgass-1.0.4.tar.gz.

File metadata

  • Download URL: pgass-1.0.4.tar.gz
  • Upload date:
  • Size: 382.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pgass-1.0.4.tar.gz
Algorithm Hash digest
SHA256 513919437db97e72d5f401a5302aa8625a550ce5c9846f4e1a76c563ffc0e337
MD5 22adbb7926ae203c052d22f4da0579f7
BLAKE2b-256 8d8391911f5f7d46ad97f515bd20d689dd03d12c935d8217e6695b8df3d0379f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4.tar.gz:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp312-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 af040a90cf0e8b72b5ed0a309890587f0b2f762d1de9d4459e4dc2b181bb3756
MD5 bf584742e58c9fa1e7d6fbe1be6f3bff
BLAKE2b-256 5d1db0a0ec48db746a60a0b5021f3d7a3ab02f142cbcafe6ae7a88d632d4682b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp312-abi3-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp312-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 7e83610279cbf1a5541f685d1c2fe53f53588e931b5519044be9d4c8aff75532
MD5 9401b884cfc333d687128e72e7faee87
BLAKE2b-256 1bf28e432d7547497613600c114519e4684c8efc26b382c5f69f117dc5049161

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp312-abi3-manylinux_2_34_aarch64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7720755dd2d651466d350a6cb34ad982ae4c32fb257e8e0ef58680163ce4746c
MD5 53f2df04014c14a60092fae74686a1e8
BLAKE2b-256 d35e01cc6841ca6124afd8d0c3b502b21a52405fa2172ffa85edf7be69289d72

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1d0b0c0fb95ce166161bd07cd477e14af3375a1a1258fcbff299fd9f3c9b62d8
MD5 0d224a3df1e4d8a5689f5ec6cd80faad
BLAKE2b-256 cb5bd0b5cb6926ff43af383a4bb621f4d8ba43d011c76cc585160e10947c4e6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 1ded57e20ac4a1b6ceadbac59f0e63bb6e773ced2025719e35694b65eda5475d
MD5 7c6fb7369e32e4142ac13338ed69108f
BLAKE2b-256 07a2315c8362b2e43f8bd60ffa950066927d388c77f82dd4c0260efff429db7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp311-cp311-manylinux_2_34_aarch64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d83e3287a2c6a602943f176c394f6acb473d1752715b8ddd438a6a8bd5dcb184
MD5 208f474758318bdff209f71d7ab55503
BLAKE2b-256 148edafb567a04e25789ce4e7cf9d3caacd435a24c147fe1253954a342a95407

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f48562d2cb515cff24d1016b8dede32195e8747a1c26233854c219ad9aee9b06
MD5 25f79e9de272c40fd651dcb07b529c9e
BLAKE2b-256 dc4e4a24610b12048cbe4bce72a4caca8d7c6c3fe47bbab6039823d4fd771400

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 e74181fd39559f044c34083d3a2855ec4280b5c2f756f195fbf198a68e0bedd9
MD5 3a1b3da9194ef992792bed5d4a2c3829
BLAKE2b-256 a12b91cc19039617bb022f1d1f44fb8340ce831d1671be8562d1cd628af1a71d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp310-cp310-manylinux_2_34_aarch64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd38bcf1c6b1fa89a4db4d764cd0f9c5fe3313a53600a5bcd2a4ee8961522ddc
MD5 93da447e3da925a6dbe3c095af149128
BLAKE2b-256 1144d863a42297b21bfe03414815acfa0732483a8be39037878ff3ac49cf0fcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 84fb7cd7e6e2cebf5893ab63cba459172d71049d9e85f29b715f3acfbc58b246
MD5 c7bfaf36e098443ef16ee4a2a2d6866e
BLAKE2b-256 447208be8dc882f4289ef90f17a697a999723673fc548e66f696392f62ec0479

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp39-cp39-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp39-cp39-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.4-cp39-cp39-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 df60f2129e7cdb43100a0740a8a36ded7032abc0e4aa103d996eebedc8b3154b
MD5 e9d8cabda3779764357ef95765b131f3
BLAKE2b-256 b2b97aac1d40d2cf6dd0e604f690b06597036b3bde33ccc38808f834148ede2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp39-cp39-manylinux_2_34_aarch64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgass-1.0.4-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: pgass-1.0.4-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pgass-1.0.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44d8780ed4e00e3969ff6ea42ece0120836a0dd92a25f6c16493c820fb0c3cd7
MD5 74693be135ce6b1a3702be447ca9a8fa
BLAKE2b-256 8f6cd8422817d1c9162af6dda0c89da192d532ca9187ee93ec9b6572c7a46d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.4-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: wheels.yml on aaw/pgass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.4 This release

13 files

1.0.2

16 files

1.0.0

16 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page