A simple wrapper for Z3 solver
Project description
Argyle_Sudoku
This project was partly based on the code from z3-sudoku
This project uses python z3-solver to benchmark encoding techniques to solving the same problem. It then compares the efficiency of each method and between different encoding techniques.
A demo of how to use the library is provided by solving sudoku in ./src/Sudokus
In Sudoku.py
both traditional implementation of adding conditional constraints using if-else
statements and our approach of adding conditional constraints using our custom solver is presented.
An example of two different ways of querying if an index can be set to a number is presented.
Directory Structure
-
/analysis
: Includes scripts and notebooks for analyzing solver performance and generating images for reports or presentations. -
/problem_instances
:/particular_hard_instances_records
: Particular hard instances identified during the generation process, in txt and SMT format/whole_problem_records
: Whole sudoku problems in txt and SMT format- Details of recording format explained here
-
/solvers
: Houses executables and related files for various SMT solvers used in the project. -
/src
: Contains source code for core functionalities./Sudokus/Sudoku.py
: Contains all functionalities of building sudoku with various constraints, logging sudoku instances to files in string format and smt format,/sudoku_database
: Stores string descriptions of generated Sudoku puzzles, both full (solved) and holes (incomplete)./Sudokus/run_sudoku_experiment.py
: This file contains the main function. It takes in a sudoku file and solves it using the methods in sudoku.py. It then prints/ the solution and the time taken to solve it.
-
sudoku_database
: Stores the already generated full and holes sudokuscurrline.txt
: stores the which line of the full sudokus file should the solver generating sudoku holes start loading from and solving when callingrun_experiment
-
/tests
: scripts for development testing -
/time_records
: Direct directory for storing time records from solver runs, highlighting the performance of different solvers.
The workflow is depicted in the following picture:
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
File details
Details for the file jz3-0.1.10.tar.gz
.
File metadata
- Download URL: jz3-0.1.10.tar.gz
- Upload date:
- Size: 7.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc47627f0042be456839f2858c73727ecc0c82a60f306e4502e9b263123cdc8c |
|
MD5 | 99e61cdf99437557cab40588565f41ab |
|
BLAKE2b-256 | 3dd4b74f5f4e9dbc5d19c0310db46c3fa873bc8b52912ef0d0958ff4fe85e8d8 |
File details
Details for the file jz3-0.1.10-py3-none-any.whl
.
File metadata
- Download URL: jz3-0.1.10-py3-none-any.whl
- Upload date:
- Size: 7.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00da9033882608ffb336f511675f0fd9eceaf3ad64b269d245b011b2e0f7864b |
|
MD5 | c200228a9b2a88320e336917a945406e |
|
BLAKE2b-256 | cbdda6e2973befceddbff1bc3df85cdd21096d5dde324cc362b4a2972def91b9 |