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.0.tar.gz (17.7 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.0-cp313-cp313-manylinux_2_34_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

pgass-1.0.0-cp313-cp313-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

pgass-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (8.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

pgass-1.0.0-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.0-cp311-cp311-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

pgass-1.0.0-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.0-cp310-cp310-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

pgass-1.0.0-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.0-cp39-cp39-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ ARM64

pgass-1.0.0-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.0.tar.gz.

File metadata

  • Download URL: pgass-1.0.0.tar.gz
  • Upload date:
  • Size: 17.7 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.0.tar.gz
Algorithm Hash digest
SHA256 5d09d84335cff1674d425e1093cf4a5ec7d692d9b8eaa320380f8ce664a59837
MD5 3ba6e97dfd9d726e5abe3fa6ec9e04aa
BLAKE2b-256 fafb2486fe24c8f07234cab99e606f4d541fcb1adcc66daebec9e11c8181b379

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0.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.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ea6905dad3ddcd4302a1d4cd6d0f0727fa8dc73b439677cf8332ac95befd3a55
MD5 ca0e458d9d27c4ee54aa0386b1a09771
BLAKE2b-256 ac84b5e9603c19c0c2b388a6b2f5643e62b2ce07437017c598edb727c96caf5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-cp313-cp313-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.0-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 7e890093669a8a152b4d8be916e61be3c7242f4fd2fd3614696fad52b344ce44
MD5 3d595f3917c4ac20d4bf18eb929e09bd
BLAKE2b-256 3981042348dfc1bc802a4900f4e191e459baa5cb27098e33aca9a5f7e2ff5d34

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-cp313-cp313-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.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2d03e0da94ccc49179d6e0ae9ff77fa56833bfdf3bb6436bf572d50614175d3
MD5 4ea04f3a647a5c4e94b753156359048c
BLAKE2b-256 ae0acc82f78778c8549d7de9dfd0b0a3746276f330fe913dc69edeac1847e3d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-cp313-cp313-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.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e68739e47d120627314819f527f1aeef39f355b740314652ff15bb6849cf9e3d
MD5 501c755e7c228abc259e69998e8a6a2a
BLAKE2b-256 c4c6c0f5e95e35a51bc705b076065ebaaba38636529746160d202143bb8c371e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-cp312-cp312-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.0-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 6640fdca57c4d7d3e69f57c968bd41c7a9b5a8d4e551dcde2bb0e3b61b8ec894
MD5 7ded32ada5d1bb01a1a535e1ac65256e
BLAKE2b-256 d330dda0330c92ff7aa9caebd22acba1b51df37561aeb6d6371d6fc3d016c805

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-cp312-cp312-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.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 50acd747c54c685836e18aac430f7a91ee211f5388ea2dff45b1054581519c74
MD5 b3e826093b84679ac6c0c64abf420e90
BLAKE2b-256 670dc3d045522d75282b07be796588651d1c17f4957ea68896ad0c6a78ef47c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-cp312-cp312-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.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f1ccdc0759ae35b19c41d8ba03eb1c39ae3b8cdf7f88e1d35463419d96287695
MD5 4fd289d137561cdf0deb66ea0de7cbfc
BLAKE2b-256 564a554ad516367dd0cdc2a9ee45ed88a9aee690a1023788f95cea6417dfd45b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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.0-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 146d2402b51cb77bd4f299f2b668c2de3f480c267268c8153fa64d0e19d47b82
MD5 8188d18306edfb8913767bd40845838c
BLAKE2b-256 7a95f9a981c510c0fd272c546bd0cb6f5b156fe2af8697b4dda65e058b0b2b39

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 782b38e50c50f5346e5bde905cf22d7c0df123671527f180cdeb26a84e07cb0e
MD5 deeecad41177abc05713d7943720f76e
BLAKE2b-256 1f3dd73c9468f3f99372d9656d8d75ad153cfdf60d1666313d1c8516d4086f1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0f3b67b493a1ddf3471ed774241d280fa0f647cb3edbedaf27e4b694a7b4a6c0
MD5 63bb969593408cf5c1ba06a03d78a192
BLAKE2b-256 90010d868582864d9f6a7c9062153ed17d4ff3dce2b87f6baf3bf6a4bf639892

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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.0-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 1632f322558964b81d75ff92babb8e45e1c0103ab49d166662afc38c577e7765
MD5 9f996dce5e0b61fd34433b6870cc4181
BLAKE2b-256 a874345f5cee5fab6f00605bb099b234a3eaa06f388df2585b1bab2ef3fb4cce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 70a42bf635baad2165a271a5d32b2ae6b6e04f5b797cc8c43dc6a8444da6a7fc
MD5 1fcef59cc2aa584e21978d4557f252f5
BLAKE2b-256 2f4713b946a05e529c0d47e09c42c7b88fd26a4dff384f1e2e621445ae77daa5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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.0-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7595da05c4100d6d9af3f48038853570771261486f3a1d1e292bb7257bfe4694
MD5 5e1b09b31cc87ff379ee775cc6957a5b
BLAKE2b-256 1b5ee118ac9e3c0cd2dfc0410a10db383f436a3f2bbbc885e56ff85df2fe3484

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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.0-cp39-cp39-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pgass-1.0.0-cp39-cp39-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 b5143e4f35de70b311e2e00763d735640002f7fa9725896286e27cf6d3b7e5e6
MD5 ec153c155f99b55b95fbb26f3870e7a6
BLAKE2b-256 0dfa2b06802b349457713ffbe931822101db673ecbbe540051a1bda00222b4ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: pgass-1.0.0-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.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89745a5cdadc14ec80809664d9688dc9b2c38def26c14bc7701822b9c8df0b6f
MD5 5ede0619469a44a5981d44e2b0a232c5
BLAKE2b-256 5d759537baa721614b711303b62ea43f16e83b71bf4a4a454263e7d29b947204

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgass-1.0.0-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

1.0.4

13 files

1.0.2

16 files

This release

1.0.0 This release

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