Skip to main content

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

simpleSketch-0.0.7.tar.gz (67.3 kB view details)

Uploaded Source

Built Distribution

simpleSketch-0.0.7-py3-none-any.whl (73.2 kB view details)

Uploaded Python 3

File details

Details for the file simpleSketch-0.0.7.tar.gz.

File metadata

  • Download URL: simpleSketch-0.0.7.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

Hashes for simpleSketch-0.0.7.tar.gz
Algorithm Hash digest
SHA256 c7766b5f3f0116543c85b9b331a4842fcbdc6b6c8bca72800d108a48969b5fae
MD5 8ac99c74230062a141c0513cae8bfa60
BLAKE2b-256 c3d751e704be08636021566a9094ee04665bc5715d70120fe98c5e9a2dfbfb54

See more details on using hashes here.

File details

Details for the file simpleSketch-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for simpleSketch-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 186431782a52bc3f38b83bed7f215e9055584980d1939fa5022ad0737623ee68
MD5 9b140428396c4ac6bec78752d604f158
BLAKE2b-256 99ebe4d1db48d174518c0db6821b870e558bf59e99c1fb5c68e6067dbb157512

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page