Skip to content

Commit d3ada89

Browse files
committed
Adding readme
1 parent e2fe0b3 commit d3ada89

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

readme.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,9 @@ Excessive usage will be monitored, and we may revoke keys if abused.
7777

7878
### 📚 Reference
7979

80-
The design of the synthesizer and the Shape DSL is adapted (with permission) from PSET1 in MIT’s Introduction to Program Synthesis, taught by Prof. Armando Solar-Lezama.
80+
The design of the synthesizer and the Shape DSL is adapted from [PSET1](https://people.csail.mit.edu/asolar/SynthesisCourse/Assignment1.htm) in MIT’s [Introduction to Program Synthesis](https://people.csail.mit.edu/asolar/SynthesisCourse/index.htm), taught by [Prof. Armando Solar-Lezama](https://people.csail.mit.edu/asolar/).
8181

82-
83-
Here’s a polished, engaging version of your **Setting up** section in markdown—clearer, a bit more fun, and student-friendly:
84-
85-
# 🚀 Setting Up
82+
# 🚀 Part 0: Setting Up
8683

8784
First things first—let’s get your environment ready.
8885

@@ -92,22 +89,23 @@ First things first—let’s get your environment ready.
9289
git clone https://github.com/machine-programming/assignment-1
9390
```
9491

95-
2. **Move into the assignment directory and install dependencies**
92+
2. **Move into the assignment directory, create virtual environments, and install dependencies**
9693

9794
```bash
9895
cd assignment-1
99-
pip install -r requirements.txt
96+
python -m venv .venv # creating a virtual environment for this assignment
97+
source .venv/bin/activate # change this to other activate scripts if you use shells like fish
98+
pip install -r requirements.txt # install the dependencies
10099
```
101100

102101
3. **Test your setup (don’t panic if it fails!)**
103-
Run the tests for Part 1:
104102

105103
```bash
106-
pytest tests/test_shapes.py
104+
python test_part1.py
107105
```
108106

109107
You should see the tests run but **all of them fail**.
110-
✅ That’s exactly what we expect—your job in Part 1 is to turn those failures into passes!
108+
✅ That’s exactly what we expect. Your job in Part 1 is to turn those failures into passes!
111109

112110

113111
# 🎨 Part 1: Bottom-up Synthesis for Shapes
@@ -133,6 +131,22 @@ Given a set of points with positive/negative labels (`List[Tuple[float, float, b
133131
The image above shows an example with 12 positive and 12 negative points.
134132
The expected synthesized program was `Subtraction(Circle(5,5,4), Circle(5,5,2))`, which produces a ring.
135133

134+
### 🧪 Running the Synthesizer on Test Cases
135+
136+
To actually apply your synthesizer to the provided test cases, run:
137+
```
138+
python test_part1.py
139+
```
140+
- At the beginning: you should see synthesis failures (don’t worry—that’s expected).
141+
- A new folder called `shape_visualization/` will be created. Inside, you’ll find:
142+
- Visualization of examples: e.g., `ring_examples.png` (positive/negative coordinates)
143+
- Visualization of synthesized program: e.g., `ring_synthesized.png` which is the same as the image above
144+
- If a test case fails, you’ll only see the examples file (no synthesized visualization).
145+
- Use these visualizations to get an intuition for what kind of program your synthesizer should be generating.
146+
147+
Once you complete Part 1, rerun this test—you should start seeing synthesized shapes that match the examples.
148+
It’s also helpful to peek at test_part1.py to see the full set of test cases.
149+
136150
### 🧩 Understanding the DSL
137151

138152
Shapes are implemented in shapes.py.
@@ -232,7 +246,6 @@ Now is the time to take all that we have already and iteratively synthesize shap
232246

233247

234248

235-
236249
# Part 2: Bottom-up Synthesis for Strings
237250

238251

0 commit comments

Comments
 (0)