Name | simpleSketch JSON |
Version |
0.0.8
JSON |
| download |
home_page | |
Summary | Program Synthesis by Sketching |
upload_time | 2023-10-02 14:29:04 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.11 |
license | MIT License Copyright (c) 2023 Maher Bisan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
simplesketch
synthesis
cegis
program synthesis
sketching
pbe
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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](https://github.com/maher-bisan/SimpleSketch)
>>**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.
## Grammar
### `while_lang` grammar
```lark
start: statements
statements: statement | statements statement
statement: "skip" ";" | declaration | assignment | "if" "(" expr ")" "{" statements "}"
| "if" "(" expr ")" "{" statements "}" "else" "{" statements "}" | "while" "(" expr ")" "{" statements "}" | "assert" "(" expr ")" ";" | "assume" "(" expr ")" ";"
declaration: type id ";" | type id = expr ";" | array_type id ";" | array_type id = id ";"
assignment: id = expr ";" | id [ expr ] = expr ";"
array_type: "Array" type
type: "int" | "float" | "bool"
expr: expr "and" expr | expr "or" expr | "not" expr
| expr "==" expr | expr "!=" expr | expr "<" expr | expr ">" expr | expr "<=" expr | expr ">=" expr
| expr "+" expr | expr "-" expr | expr "*" expr | expr "/" expr | expr "**" expr
| atom
atom: "(" expr ")" | id | hole | id "[" expr "]" | int | float | bool
hole: "??" | "int?" | "bool?" | "float?"
bool : "True" | "False"
```
<!--
### Grammar for the condition (in z3 format)
```lark
```
-->
## 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.
Raw data
{
"_id": null,
"home_page": "",
"name": "simpleSketch",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Dareen Khair <dareen17.7@gmail.com>, Maher Bisan <maherbisan95@gmail.com>",
"keywords": "SimpleSketch,Synthesis,CEGIS,Program Synthesis,Sketching,PBE",
"author": "",
"author_email": "Maher Bisan <maherbisan95@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/8c/ae/e6326ecec7afc3a9f0b6cf913361003d474049121c5182879309e786a2c4/simpleSketch-0.0.8.tar.gz",
"platform": null,
"description": "# Simple Sketch (Program Synthesis by Sketching)\n\n>This project is a part of the course 236347 Software Synthesis and Automated Reasoning (SSAR) at the Technion.\n\n## Description\n\nThe goal of software synthesis is to generate programs automatically from specifications.\nIn Sketching, insight is communicated through a partial program, a sketch that\nexpresses the high-level structure of an implementation but leaves holes in place of the low-level details.\n\nSimple Sketch can Synthesis a program based on a set of input and output examples, or by adding assertions to the program.\n\nSimple Sketch uses counterexample guided inductive synthesis procedure (CEGIS) to synthesize a program.\n\nLook at the examples section in the GUI to see how to use the program.\n\n>> **Note:** This project is still under development. Check updates regularly at the [SimpleSketch repository](https://github.com/maher-bisan/SimpleSketch)\n\n>>**IMPORTANT:** The tests (under `/tests`) still fail, because the tests are not updated to the new version of the program (the new parser)\nThe tests will be updated soon. In the meantime, you can use the examples in the GUI to test the program.\n\n## Example\n\n```\ni := ??;\ny := i*i + x * ??;\nassert (y == x + x + 9);\n```\nThe above program is a simple example of a program synthesis problem.\nThe goal is to find a program that satisfies the specification.\n\nAfter running the program, the output is:\n\n```\ni := 3;\ny := i*i + x * 2;\nassert (y == x + x + 9);\n```\n\n## Installation\n\n### Build from source\n\n```\ngit clone https://github.com/maher-bisan/SimpleSketch.git\ncd simple_sketch\npython3.11 -m venv .venv\nsource .venv/bin/activate\npip install .\n```\n\nOn windows, run the following command instead:\n\n```\npython -m venv .venv\n.venv\\Scripts\\activate\npip install .\n```\n\n### Install from PyPI\n\n```\npip install simpleSketch\n```\n\n## Documentation\n\nUnder construction. In the meantime, you can read the docstrings in the code.\n\n## Grammar\n\n### `while_lang` grammar\n\n```lark\nstart: statements\n\nstatements: statement | statements statement\n\nstatement: \"skip\" \";\" | declaration | assignment | \"if\" \"(\" expr \")\" \"{\" statements \"}\" \n| \"if\" \"(\" expr \")\" \"{\" statements \"}\" \"else\" \"{\" statements \"}\" | \"while\" \"(\" expr \")\" \"{\" statements \"}\" | \"assert\" \"(\" expr \")\" \";\" | \"assume\" \"(\" expr \")\" \";\"\n\ndeclaration: type id \";\" | type id = expr \";\" | array_type id \";\" | array_type id = id \";\"\n\nassignment: id = expr \";\" | id [ expr ] = expr \";\"\n\narray_type: \"Array\" type\n\ntype: \"int\" | \"float\" | \"bool\"\n\nexpr: expr \"and\" expr | expr \"or\" expr | \"not\" expr \n| expr \"==\" expr | expr \"!=\" expr | expr \"<\" expr | expr \">\" expr | expr \"<=\" expr | expr \">=\" expr\n| expr \"+\" expr | expr \"-\" expr | expr \"*\" expr | expr \"/\" expr | expr \"**\" expr\n| atom\n\natom: \"(\" expr \")\" | id | hole | id \"[\" expr \"]\" | int | float | bool\n\nhole: \"??\" | \"int?\" | \"bool?\" | \"float?\"\n\nbool : \"True\" | \"False\"\n\n```\n<!-- \n### Grammar for the condition (in z3 format)\n\n```lark\n\n```\n -->\n\n## Usage\n\n### Open the GUI\n\nIn the terminal, run the following command:\n\n#### If you installed from PyPI\n\n```\nsimpleSketch-gui\n```\n\n#### If you built from source\n\n```\npython3.11 src/simple_sketch/simple_sketch_gui/simple_sketch_gui.py\n```\n\n\n### Examples\n\nAfter opening the GUI, you can select an example from the dropdown menu, at the sidebar.\n\n### Run a program\n\nTo run a program, click the \"Run\" button.\nClick the \"Clear\" button to clear the entire text areas.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 Maher Bisan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Program Synthesis by Sketching",
"version": "0.0.8",
"project_urls": {
"Bug Tracker": "https://github.com/maher-bisan/SimpleSketch/issues",
"Homepage": "https://github.com/maher-bisan/SimpleSketch"
},
"split_keywords": [
"simplesketch",
"synthesis",
"cegis",
"program synthesis",
"sketching",
"pbe"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e2eb3851a7e4589460e45da276613f1dd0106aecd15426ec15a5a32d88ad4eb1",
"md5": "fde0e23ae916c50b9f0238bd5793f5c6",
"sha256": "ee6042de82f83b3c9ec914dc2280393a3f73fb2b175f229d3513e32c83d4886a"
},
"downloads": -1,
"filename": "simpleSketch-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fde0e23ae916c50b9f0238bd5793f5c6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 73103,
"upload_time": "2023-10-02T14:29:01",
"upload_time_iso_8601": "2023-10-02T14:29:01.987181Z",
"url": "https://files.pythonhosted.org/packages/e2/eb/3851a7e4589460e45da276613f1dd0106aecd15426ec15a5a32d88ad4eb1/simpleSketch-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8caee6326ecec7afc3a9f0b6cf913361003d474049121c5182879309e786a2c4",
"md5": "fb45f9babc65df71bafb81d50d4836e5",
"sha256": "2f0d0bfe1fbfd79ae63379f5a3766a0f44248a1bf78bb0d0394d6a7c642e488c"
},
"downloads": -1,
"filename": "simpleSketch-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "fb45f9babc65df71bafb81d50d4836e5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 67673,
"upload_time": "2023-10-02T14:29:04",
"upload_time_iso_8601": "2023-10-02T14:29:04.486527Z",
"url": "https://files.pythonhosted.org/packages/8c/ae/e6326ecec7afc3a9f0b6cf913361003d474049121c5182879309e786a2c4/simpleSketch-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-02 14:29:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "maher-bisan",
"github_project": "SimpleSketch",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "simplesketch"
}