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.2.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.2-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.2-cp313-cp313-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

pgass-1.0.2-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.2-cp312-cp312-manylinux_2_34_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9manylinux: glibc 2.34+ ARM64

pgass-1.0.2-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.2.tar.gz.

File metadata

  • Download URL: pgass-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 8681759fb2a23f9b26d22086e025d56a2f3108169303f0e4d5308dac9a8e4815
MD5 2d7dc07dd189d2562ded676c68101e03
BLAKE2b-256 630d3dd9b8be5cdf033c25b6c0a1693377ab96eee79f0462f21f1da3663d7538

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 656b6acb6f6c69bb28f6d88d713533fe387843df73e879b564f2d5b4e0359371
MD5 2399c4ad1dda587fdb6420a46d329be4
BLAKE2b-256 f7538c0a51ee5ee75364357f0d1a59313431fc67ffd0e0ad10b7f3c9feb22d05

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 2a2f540b7a579180fc8738ce114cc20a4c5f4175d050451f9cc1997d6d4e2772
MD5 8d42fa4ad297fdd91807582e48174412
BLAKE2b-256 f4e1e995b66def2fc5d5c62dc2461dc08df3655f8dd3e72c855c93d9a3ba03ad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55937b59d17f7331d150890b5ec27cbfd86f0b8bc2f9b5562fca61b449df364c
MD5 4b982e42ffc379ee584e81af4217b3d3
BLAKE2b-256 3bce8001bfb6ff471ba901bad609345638a8c3240ce84fb5d757b82ea7383df3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8ea71ea4e706a9db76f319588320a38489c17e38c6f390b70285786d6736f644
MD5 7cb566c64d6d0598f8bf0797ce6f93a2
BLAKE2b-256 814a1f6c6e1f9c0ca77f3ac1aa36033be61dee1ed17dfe239da4694eda3a52c6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 b9f9fa2e3fe1dfae6ace711337227e4016a8f1decd521ad1ee565142288801bd
MD5 422fa4c4dd630b021461c5c5d561c026
BLAKE2b-256 1a51baf5a98857a6a7dacf798c9e396f2e779952bdc17d2fcab0f51f45764133

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8532e396d9fa7859229d44f44940b2fa5d19d0460b7188c429f9cce3804009c1
MD5 e2bb2ff03ae3e534c7524c8565b7d64d
BLAKE2b-256 39aa79413a4ac5162329384420b7ca1d7a4ccb514bc887fddb7bd3715908c44c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5fa58c2035e7cd8d9c6ed510d63ce17566624d5e065dd6e08337ebdfd432ce43
MD5 f1e7e934df2845b7101f720560e59ef8
BLAKE2b-256 a6b87b1af6e599643ac4ef094dd578b31ef3701dc3ae42b5866925a444cb7674

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 83fc31ed591e4ad3ce4002840db8665daddfd34924f042ca598f240e71b3b575
MD5 2eb9225b7148285454f19db5260d7a00
BLAKE2b-256 37e1af250d66a75bc16e75acb1568d1f7453bb15e3364f68a0bcc721834f8243

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ca598a4d392b407e1fcdba28a1fdc114cedaa879bd6a481ad28f761eecf96e5
MD5 f4ab3e2078e23518306721d9d9e9b6fa
BLAKE2b-256 feb269375fc04d9a71a60ad11908d7b2acd27643610bf1e328a1d03336864be9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bce148ffe91cb80627bbcaeb9b79b224ac1c5648dd0a715af03cca75dcbcf905
MD5 98cc31380d123b59c5130d836e0af38d
BLAKE2b-256 2c4de5212b04d61dcd54e18f934b2642923f8820647a187a7f067f5001a6e4e2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 643cb8321a4a7c3a563d6ac3d03fb684993e9af561663ef7e537c20de50d4f07
MD5 f28645e7ad6c56507a82e0f9ac570f0b
BLAKE2b-256 7cf8a1e24a49aebad685e36946e3f17c85935b052e2845968f7d97de9d1bf586

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4ea19d64751637e84ee43292778f531696c46601d8da43e4e630f566371642f
MD5 813b5203b36fcdbc2ae984dc3b9316c2
BLAKE2b-256 75fcafed61fb8116218a3a258082b24925e17055986825b86c62a52c73599bf8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dc2f160fe8f0bae2c3bed07208fe936221bb87c0b43258fb917e50dfdb80a700
MD5 acb93ebcd66877e82efd8e64673cfcbb
BLAKE2b-256 1009666cf4ab69b7df212e98b44f0a214385079ddaddf49b3f5be1966df2fba8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pgass-1.0.2-cp39-cp39-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 0460a0003a76ade36036aedd662e23e997028a396c4591f59903feb5d9ada234
MD5 a4a4746b15cc32314b87de56a23831b7
BLAKE2b-256 4d25b7ddb2b3a0a167f6cb6a94d87a22dae2233fa3f1bb81924bb6de91ff0d60

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pgass-1.0.2-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.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 faa1104050078e7d245be70edc7cead35cb44cf82d186d8982a8f7d5e2dbc791
MD5 451c6e2a50379c44ddb37dba84400a8e
BLAKE2b-256 18c23b8c305dd67a8cdace5162e781ef6359ecce42338b276377ba79e256b010

See more details on using hashes here.

Provenance

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

This release

1.0.2 This release

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