Program Synthesis by Sketching
Project description
Simple Sketch (Program Synthesis by Sketching)
This project is a part of the course 236347 Software Synthesis and Automated Reasoning (SSAR) at the Technion.
Description
The goal of software synthesis is to generate programs automatically from specifications. In Sketching, insight is communicated through a partial program, a sketch that expresses the high-level structure of an implementation but leaves holes in place of the low-level details.
Simple Sketch can Synthesis a program based on a set of input and output examples, or by adding assertions to the program.
Simple Sketch uses counterexample guided inductive synthesis procedure (CEGIS) to synthesize a program.
Look at the examples section in the GUI to see how to use the program.
Note: This project is still under development. Check updates regularly at the SimpleSketch repository
IMPORTANT: The tests (under
/tests
) still fail, because the tests are not updated to the new version of the program (the new parser) The tests will be updated soon. In the meantime, you can use the examples in the GUI to test the program.
Example
i := ??;
y := i*i + x * ??;
assert (y == x + x + 9);
The above program is a simple example of a program synthesis problem. The goal is to find a program that satisfies the specification.
After running the program, the output is:
i := 3;
y := i*i + x * 2;
assert (y == x + x + 9);
Installation
Build from source
git clone https://github.com/maher-bisan/SimpleSketch.git
cd simple_sketch
python3.11 -m venv .venv
source .venv/bin/activate
pip install .
On windows, run the following command instead:
python -m venv .venv
.venv\Scripts\activate
pip install .
Install from PyPI
pip install simpleSketch
Documentation
Under construction. In the meantime, you can read the docstrings in the code.
Usage
Open the GUI
In the terminal, run the following command:
If you installed from PyPI
simpleSketch-gui
If you built from source
python3.11 src/simple_sketch/simple_sketch_gui/simple_sketch_gui.py
Examples
After opening the GUI, you can select an example from the dropdown menu, at the sidebar.
Run a program
To run a program, click the "Run" button. Click the "Clear" button to clear the entire text areas.
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
Built Distribution
File details
Details for the file simpleSketch-0.0.6.tar.gz
.
File metadata
- Download URL: simpleSketch-0.0.6.tar.gz
- Upload date:
- Size: 67.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5970de79893ca24ff60aac3edd87baa8bb8ddf4e880095dbe37ff8b31d6b02 |
|
MD5 | ddd21b9223cc4db054b07a159ecfbcaf |
|
BLAKE2b-256 | f4c3e0a6acbc17ad82d894c368d3e0d56bd9f970b08c9454dfb8d0cd43a729c5 |
File details
Details for the file simpleSketch-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: simpleSketch-0.0.6-py3-none-any.whl
- Upload date:
- Size: 73.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5ca4e6a5280277bc7b732a4229bf57be9fcf267f4ee5d75284497ce6e12ebe4 |
|
MD5 | ce3e171e1fca0a0be8babd849225c3b3 |
|
BLAKE2b-256 | 6b47ac130708b9c44a444b2474ed1de3eb1f0411ce53b435b6bbe18e225ec57a |