Skip to content

Commit 18deaba

Browse files
committed
Update docs
1 parent 5bfdee6 commit 18deaba

2 files changed

Lines changed: 95 additions & 68 deletions

File tree

README.md

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,77 @@
1-
<sub>The project has been moved from https://code.google.com/archive/p/visual-lambda/<br/>and from https://bitbucket.org/bntr/visual-lambda as well.</sub>
1+
<sub>The project was migrated from https://code.google.com/archive/p/visual-lambda/ and from https://bitbucket.org/bntr/visual-lambda.</sub>
22

33
# Visual Lambda Calculus
44

55
![logo](https://bntr.planet.ee/lambda/loop_.gif)
66

7-
The Visual Lambda environment enables intuitive manipulation of lambda calculus expressions.
7+
Visual Lambda is a graphical environment and visual programming tool
8+
for exploring pure lambda calculus using Bubble Notation.
9+
It represents lambda expressions as colorful, tree-like 2D structures
10+
and animates beta-reduction steps smoothly, making reductions easy to follow.
811

9-
![](https://raw.githubusercontent.com/bntre/visual-lambda/master/screenshot.png)
12+
**Try it live**: https://bntr.itch.io/visual-lambda
1013

11-
Also available online at: [https://bntr.itch.io/visual-lambda](https://bntr.itch.io/visual-lambda)
14+
The project started as a master's thesis (2008); see the thesis for details:
15+
[visual_lambda.pdf](https://bntr.planet.ee/lambda/work/visual_lambda.pdf).
1216

13-
## Notation
14-
- [Basics](https://bntr.planet.ee/lambda/visual_lambda_bubble_notation.gif)
15-
- More detailed in this thesis: [visual_lambda.pdf](https://bntr.planet.ee/lambda/work/visual_lambda.pdf)
17+
This might be useful for students, educators and researchers who want
18+
an intuitive, interactive way to explore λ‑calculus and reduction strategies.
1619

17-
## Examples
18-
- Pairs, construction, reduction: [https://www.youtube.com/watch?v=YEyyyzUuUJQ](https://www.youtube.com/watch?v=YEyyyzUuUJQ)
19-
- Predecessors: [https://www.youtube.com/watch?v=CWzn2ucPMdg](https://www.youtube.com/watch?v=CWzn2ucPMdg)
20-
- ['MULT 3 2' evaluation](https://bntr.planet.ee/lambda/visual_lambda_MULT_3_2_=_6.gif) (gif)
21-
- ['((λgm.m(gg))(λgm.m(gg)))M' building and evaluation](https://bntr.planet.ee/lambda/lambda_F_anim.gif) (gif)
22-
- ['Y I' evaluation](https://bntr.planet.ee/lambda/Y_I.gif) (gif)
20+
![Screenshot](https://raw.githubusercontent.com/bntre/visual-lambda/master/screenshot.png)
2321

22+
## Bubble Notation
2423

25-
## Dependencies
26-
- python 3
24+
![Basics](https://bntr.planet.ee/lambda/visual_lambda_bubble_notation.gif)
25+
26+
Watch a short demo to get an idea of how Bubble Notation works:
27+
https://www.youtube.com/watch?v=aRgu8S3Pnb8
28+
29+
<p><a href="https://www.youtube.com/watch?v=aRgu8S3Pnb8" title="Factorial 3">
30+
<img src="https://img.youtube.com/vi/aRgu8S3Pnb8/maxresdefault.jpg" width="600" alt="Factorial 3"/>
31+
</a></p>
32+
33+
Other video examples:
34+
- Pairs, construction and reduction: https://www.youtube.com/watch?v=YEyyyzUuUJQ
35+
- Predecessors: https://www.youtube.com/watch?v=CWzn2ucPMdg
36+
- Recursion: https://www.youtube.com/watch?v=bGG9exO2kew
37+
38+
Old GIF examples:
39+
- 'MULT 3 2' evaluation: [MULT_3_2_=_6.gif](https://bntr.planet.ee/lambda/visual_lambda_MULT_3_2_=_6.gif)
40+
- 'Y I' evaluation: [Y_I.gif](https://bntr.planet.ee/lambda/Y_I.gif)
41+
42+
## Requirements
43+
44+
Dependencies
45+
- Python 3.8+
2746
- pygame-ce 2.5.6
2847

29-
## Runningpython
30-
python main.py
48+
Install and run locally:
49+
```
50+
pip install pygame-ce==2.5.6
51+
python main.py
52+
```
3153

3254
## Controls
33-
- [controls.txt](controls.txt)
3455

35-
## Predefined expression library
36-
- [library.txt](library.txt)
56+
See the full UI control reference in [controls.txt](controls.txt).
3757

58+
## Expression library
59+
60+
The repository includes a small library of predefined expressions that
61+
you can paste into the console: see [library.txt](library.txt).
62+
63+
## Related work
3864

39-
## Related works
4065
- [Programming with Visual Expressions, Wayne Citrin](https://web.archive.org/web/20110524135539/users.encs.concordia.ca/~haarslev/vl95www/html-papers/citrin/citrin.html)
4166
- [A Graphical Notation for the Lambda Calculus, Dave Keenan](https://dkeenan.com/Lambda/)
4267
- [Alligator Eggs, Bret Victor](http://worrydream.com/AlligatorEggs/) ([browser game](https://tibordp.github.io/gator-calculus/))
4368
- More in [Prathyvsh's catalog](https://github.com/prathyvsh/lambda-calculus-visualizations)
69+
70+
## Future work
71+
72+
I still think Bubble Notation is a promising way to represent lambda terms, but this implementation is a bit dated.
73+
A modern reimplementation could improve interaction and visuals.
74+
Possible directions:
75+
76+
- Make terms feel more "springy" and react to dragging with natural, physics-like motion.
77+
- Revisit the lazy-evaluation visualization to make it clearer and more robust.

controls.txt

Lines changed: 40 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,60 @@
1-
21
--------------------------------------------------------
3-
Controls
2+
Visual Lambda environment mouse/keyboard controls
43

54

5+
View
6+
Zoom Mouse Wheel, +/-
7+
Move Middle mouse button, Arrow buttons
8+
Refresh F5
69

7-
Items
8-
Input from console I
9-
Examples:
10-
>> \x y. (\x. x)
11-
>> FACT 3 (see library.txt)
12-
>> "Label"
13-
10+
11+
Items on screen (lambda terms or text labels)
1412
Select, Drag Left mouse button
1513

1614
With selected item
1715
Delete D
1816
Copy C
1917

20-
Add Free Variable V
21-
22-
23-
Zoom View Mouse Wheel, +/-
24-
Move View Middle mouse button, Arrows
25-
Refresh View F5
26-
27-
28-
Reduce Selected Enter
29-
Nonstop reduction Ctrl+Enter
30-
18+
Input from console I
19+
Examples:
20+
>> \x y. (\x. x) add lambda term
21+
>> FACT 3 add predefined lambda term, see library.txt
22+
>> "Label" add text label
3123

32-
Modes of reduction
33-
Applicative/Normal Alt+A
34-
Lazy/Pure Alt+L, Alt+P
35-
Inside selection Alt+S
36-
37-
Quick Mode Q
38-
Pick for reduction
3924

25+
Construction of lambda terms
4026

41-
Construction of terms
42-
Expand selection Space
43-
44-
Add Free Variable V
27+
Add free variable V
4528

4629
With selected sub-term
47-
Delete Delete
48-
Insert Application before Insert, A
49-
Insert Application after Ctrl+Insert, Ctrl+A
50-
Insert Lambda Alt+Insert, L
30+
Delete Del
31+
Insert application before Ins or A
32+
Insert application after Ctrl+Ins or Ctrl+A
33+
Insert lambda Alt+Ins or L
5134
Bind Variable/Lambda with
5235
selected Lambda/Variable RClick or Ctrl+LClick
53-
54-
Applicate Drop Item onto another
36+
37+
Expand selection Space
38+
39+
Create application (apply) Drop one term onto another
40+
41+
Substitute a free variable
42+
with a term Drop the term onto the free variable
43+
44+
45+
Reduction
5546

56-
Substitute for free variable
57-
with Item Drop Item onto free variable
47+
Reduce single step Enter
48+
Full reduction Ctrl+Enter
5849

50+
Modes of reduction
51+
Applicative/Normal Alt+A
52+
Lazy/Pure Alt+L, Alt+P
53+
Inside selection only Alt+S
5954

55+
Quick (Finger) Mode Q
56+
Pick a term for reduction
57+
6058

6159
History
6260
Undo Ctrl+Z, Alt+Left, Backspace
@@ -65,12 +63,7 @@ History
6563
Workspace
6664
Save Ctrl+S
6765
Load Ctrl+O
68-
69-
70-
71-
Zoom Wheel
72-
73-
7466

75-
Save screen to png F12
76-
Mode of export frames Alt+E
67+
Saving images/frames
68+
Save screen to png F12
69+
Mode of export frames Alt+E

0 commit comments

Comments
 (0)