Skip to main content

z3++

Project description

z4

z3 with some improvements:

  • Change the right shift operation on BitVec's to be logical instead of arithmetic
  • Extend the * operation on BoolRef's to work between two BoolRef's.
  • Add additional operations to BoolRef's:
    • +, returning an Int kind such that e.g True+True+False==2
    • &, utilizing And()
    • |, utilizing Or()
    • ~, utilizing Not()
  • Add the ByteVec class
  • Some helper methods for solving:
    • easy_solve
    • find_all_solutions
    • easy_prove
  • Add some helper functions for z3 variables/constants:
    • BoolToInt
    • Sgn
    • Abs
    • TruncDiv

Usage

Install with pip install z4-solver.

Standard usage:

import z4

a, b = z4.Ints("a b")
print(*z4.find_all_solutions([a > 0, b > 0, a % b == 3, a > b, a + b == 19]), sep="\n")

Output:

[b = 4, a = 15, div0 = [else -> 3], mod0 = [else -> 3]]
[b = 8, a = 11, div0 = [else -> 1], mod0 = [else -> 3]]

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

z4_solver-2022.12.18.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

z4_solver-2022.12.18.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file z4_solver-2022.12.18.0.tar.gz.

File metadata

  • Download URL: z4_solver-2022.12.18.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.8 Linux/6.0.12-arch1-1

File hashes

Hashes for z4_solver-2022.12.18.0.tar.gz
Algorithm Hash digest
SHA256 3702a44473d3309f09c9644309c8c88f1d654d46a63599747f33d9e20d7519e3
MD5 2b0acd5ab868b7d852c618b6085b9205
BLAKE2b-256 06cb09ce7346bd78806dcf07cf851a67f70ed0784c8fe6df045a44e233267acf

See more details on using hashes here.

File details

Details for the file z4_solver-2022.12.18.0-py3-none-any.whl.

File metadata

  • Download URL: z4_solver-2022.12.18.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.8 Linux/6.0.12-arch1-1

File hashes

Hashes for z4_solver-2022.12.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba05e30b2a56cd14f3854ea8ae404452fb5221206e16ac2f88efd346d28be805
MD5 878ef5f0fe2fea131787d98c142dff5b
BLAKE2b-256 3c2b02faee85f1529054ba53cf05e303cf94ae1c29eb7b24068061f9f783aa12

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