Project LambdaCAlculus

For discussion of other cellular automata.
Post Reply
User avatar
Redstoneboi
Posts: 467
Joined: May 14th, 2018, 3:57 am

Project LambdaCAlculus

Post by Redstoneboi »

We're collaborating to create a rule to simulate Lambda Calculus Diagrams.

First of all, what is "Lambda Calculus"?
You could try looking it up on Wikipedia, but that may be a little wordy, so I'll explain it right here.

TL;DR: (λstuff.(stuff and more stuff))(Things) -> (Things and more Things)

Basics: Substitution
Lambda Calculus is 99% substitution and 1% expressions. The 1% comes from what's left in the end.

Have you ever written a printf() command in C? It can go like this:

Code: Select all

printf("Hello %s", "there");
And it would output:

Code: Select all

Hello there
The printf, in this case, takes 2 strings: The format/body, ("Hello, %s") and the argument. Then, it replaces the %s in the format with the argument. ("there")

That's basically how Lambda Calculus works. It takes an argument, and replaces something inside its body.

If we were to write the above in Lambda Calculus notation, it'd be this:

Code: Select all

(λx.(Hello x))(there)
Which evaluates to:

Code: Select all

Hello (there)
Basically, instead of printf() we have (λx.)
Instead of "Hello %s" we have (Hello x)
This says it's a function (a.k.a. "Lambda" or "Expression") that takes in a variable "x" and returns the expression "Hello (x)".

Notice how I said it returns an "Expression" and not a "String".
In reality, there are no strings in Lambda calculus. The above example would treat each letter of "Hello" as the variables 'H', 'e', 2 of 'l', and 'o'.
This means that, if we put that in something that takes 'l' as an argument, we could do this:

Code: Select all

(λl.(Hello (there)))(VAR)
Which then becomes:

Code: Select all

He(VAR)(VAR)o (there)
Some more examples:

Code: Select all

(λz.z z)(Hello)
(Hello) (Hello)

Code: Select all

(λy.Period y)(15)
Attempt (15)
Chaining
Now, the quirk of Lambda Calculus is that you can make an expression return another valid expression.
To explain this, I'll just give an example.

Code: Select all

(λx.(λy.(I like the colors x and y))(blue))(red)
Seems a bit complex at first glance, though. Let's just look at what we need.

Code: Select all

(λx.
	(λy.(I like the colors <x> and y))(blue)
)(red)
Now, we can see what we're doing. We're asking for λx, and we're giving it (red).
For now, let's just ignore everything other than that <x> that we're substituting.

Code: Select all

(λx.
	(λy.(I like the colors x and y))(blue)
)(red)

take x = (red)
(λy.(I like the colors <x> and y))(blue)

substitute <x> with (red)
(λy.(I like the colors (red) and y))(blue)
Good.
But wait, we can still evaluate that, so let's keep going.

Code: Select all

(λy.
	(I like the colors (red) and y)
)(blue)

take y = (blue)
(I like the colors (red) and <y>)

substitute <y> with (blue)
I like the colors (red) and (blue)
This works!

Recursion
Now, watch:

Code: Select all

(λx.x x)(λx.x x)
Looks a bit strange, let's evaluate it...

Code: Select all

(λx.x x)(λx.x x)

Take x = (λx.x x)
<x> <x>

substitute all x's with (λx.x x)
(λx.x x)(λx.x x)
We ended up with the same thing we started with. We can then keep evaluating it forever and ever, and it'll never end!

This works with other expressions, and you can also give them your own arguments as well.
Here's an expression, that takes another expression, and gives it 15.

Code: Select all

(λx.x 15)(λy. Period y)

x = (λy. Period y)
<x> 15
(λy. Period y) 15

y = 15
Period <y>
Period 15
This simple substitution-based system is apparently proven to be Turing-complete.
Last edited by Redstoneboi on May 4th, 2020, 4:30 pm, edited 5 times in total.
c(>^w^<c)~*
This is 「Fluffy」
「Fluffy」is my sutando.
「Fluffy」has the ability to engineer r e p l i c a t o r s.
「Fluffy」likes to watch spaceship guns in Golly.
「Fluffy」knows Natsuki best girl.
User avatar
Moosey
Posts: 4315
Joined: January 27th, 2019, 5:54 pm
Contact:

Re: Project LambdaCAlculus

Post by Moosey »

For a tl;dr:
(\thing.stuff)(more stuff) -> replace "thing" in "stuff" with "more stuff"
κ is measurable iff there is a nontrivial elementary embedding j:V→M (M transitive) with critical point κ
Hunting
Posts: 4401
Joined: September 11th, 2017, 2:54 am

Re: Project LambdaCAlculus

Post by Hunting »

Project joined.
User avatar
Redstoneboi
Posts: 467
Joined: May 14th, 2018, 3:57 am

Re: Project LambdaCAlculus

Post by Redstoneboi »

So, enough with the abstract. How do we write lambdas in CA?
Diagrams.

How do lambda diagrams work?
Well, you have bars.
They represent abstractions/functions/lambdas.

Code: Select all

x = 11, y = 1, rule = B/S012345678
11o!
This represents "(λn.)"

Then, you have stems that come down from bars.
They represent binds/placeholders/substitutions.

Code: Select all

x = 11, y = 3, rule = B/S012345678
11o$bo3bo3bo$bo3bo3bo!
This represents 3 substitutions.

And then you have links that connect stems.
They represent applications.
To the right of the link is the argument/variable, and they're expressions denoted by the top bar.
Each link returns another expression, which means it must have a stem as well.

Code: Select all

x = 11, y = 6, rule = B/S012345678
11o$bo3bo3bo$bo3b5o$bo3bo$b5o$bo!
This represents "(λn.n (n n))"

So, how would it work on an example pattern?
Just for the sake of these examples, instead of actual expressions, each variable will just be a box with a stem and a bar.
This diagram should explain it to you:

Code: Select all

x = 48, y = 172, rule = B/S012345678
3bo5b11ob9o$3bo6bo3bo3bo3bo5bo$3bo6bo3b5o3bob2o2bo$3bo6bo3bo7bobobobo$
3bo6b5o7bobobobo$3bo6bo11bo5bo$3bo6bo11b7o$bobobo4bo11bo$2b3o5b13o$3bo
6bo4$3bo5b11ob9o$3bo6bo3bo3bo3bo5bo$3bo6bo3b5o3bob2o2bo$3bo6bo3bo7bobo
bobo$3bo6b5o7bobobobo$3bo6bo11bo5bo$3bo6bo11b7o$bobobo4bo11bo$2b3o6bob
obobobobo$3bo6bo4$3bo5b9ob9ob9o$3bo6bo5bo3bo5bo3bo5bo$3bo6bob2o2bo3bob
2o2bo3bob2o2bo$3bo6bobobobo3bobobobo3bobobobo$3bo6bobobobo3bobobobo3bo
bobobo$3bo6bo5bo3bo5bo3bo5bo$3bo6b7o3b7o3b7o$3bo6bo9bo9bo$3bo$3bo5b29o
bobobobobo$3bo6bo9bo9bo9bo5bo$3bo6bo9bo9bo$3bo6bo9bo9bo9bo5bo$3bo6bo9b
o9bo$3bo6bo9bo9bo9bo5bo$3bo6bo9bo9bo10bobobo$3bo6bo9bo9bo9bo$3bo6bo9bo
9bo$3bo6bo9bo9bo9bo$3bo6bo9b11o$3bo6bo9bo19bo$3bo6b11o$bobobo4bo29bo$
2b3o6bobobobobobobobobobobobobobobo$3bo6bo4$3bo5b9ob9ob9o$3bo6bo5bo3bo
5bo3bo5bo$3bo6bob2o2bo3bob2o2bo3bob2o2bo$3bo6bobobobo3bobobobo3bobobob
o$3bo6bobobobo3bobobobo3bobobobo$3bo6bo5bo3bo5bo3bo5bo$3bo6b7o3b7o3b7o
$3bo6bo9bo9bo$3bo$3bo5b29o$3bo16bo9bo$3bo5bobobobobo2bo9bo$3bo6bo5bo3b
o9bo$3bo16bo9bo$3bo6bo5bo3bo9bo$3bo16bo9bo$3bo6bo5bo3bo9bo$3bo7bobobo
4bo9bo$3bo6bo9bo9bo$3bo6bo9b11o$bobobo4bo9bo$2b3o5b11o$3bo6bo4$3bo15b
9ob9o$3bo16bo5bo3bo5bo$3bo16bob2o2bo3bob2o2bo$3bo16bobobobo3bobobobo$
3bo16bobobobo3bobobobo$3bo16bo5bo3bo5bo$3bo16b7o3b7o$3bo16bo9bo$3bo$3b
o5bobobobobob19o$3bo26bo$3bo5b9obobobobobo2bo$3bo6bo5bo3bo5bo3bo$3bo6b
ob2o2bo13bo$3bo6bobobobo3bo5bo3bo$3bo6bobobobo13bo$3bo6bo5bo3bo5bo3bo$
3bo6b7o4bobobo4bo$3bo6bo9bo9bo$3bo6bo9b11o$bobobo4bo9bo$2b3o5b11o$3bo
6bo4$3bo25b9o$3bo26bo5bo$3bo26bob2o2bo$3bo26bobobobo$3bo26bobobobo$3bo
26bo5bo$3bo26b7o$3bo26bo$3bo$3bo5bobobobobobobobobobob9o$3bo$3bo5b9ob
9obobobobobo$3bo6bo5bo3bo5bo3bo5bo$3bo6bob2o2bo3bob2o2bo$3bo6bobobobo
3bobobobo3bo5bo$3bo6bobobobo3bobobobo$3bo6bo5bo3bo5bo3bo5bo$3bo6b7o3b
7o4bobobo$3bo6bo9bo9bo$3bo6bo9b11o$bobobo4bo9bo$2b3o5b11o$3bo6bo4$3bo$
3bo$3bo$3bo$3bo$3bo$3bo$3bo$3bo$3bo5bobobobobobobobobobobobobobobo$3bo
$3bo5b9ob9ob9o$3bo6bo5bo3bo5bo3bo5bo$3bo6bob2o2bo3bob2o2bo3bob2o2bo$3b
o6bobobobo3bobobobo3bobobobo$3bo6bobobobo3bobobobo3bobobobo$3bo6bo5bo
3bo5bo3bo5bo$3bo6b7o3b7o3b7o$3bo6bo9bo9bo$3bo6bo9b11o$bobobo4bo9bo$2b
3o5b11o$3bo6bo4$3bo5b9ob9ob9o$3bo6bo5bo3bo5bo3bo5bo$3bo6bob2o2bo3bob2o
2bo3bob2o2bo$3bo6bobobobo3bobobobo3bobobobo$3bo6bobobobo3bobobobo3bobo
bobo$3bo6bo5bo3bo5bo3bo5bo$3bo6b7o3b7o3b7o$3bo6bo9bo9bo$3bo6bo9b11o$bo
bobo4bo9bo$2b3o5b11o$3bo6bo2$7o!
Step-by-step on what it does:
  1. Identify the argument
  2. Resize each space the argument will be put into
  3. Copy each argument into its proper position
  4. Remove the original bar
Now, what if there were multiple variables to work with, like "(λx.(λy.(y x)))"?

Code: Select all

x = 27, y = 11, rule = B/S012345678
7ob9ob9o$5bo3bo5bo3bo5bo$7o2bobobobo3bobobobo$bo3bo3bo2bo2bo3bo2bo2bo$
b5o3bobobobo3bo2bo2bo$bo7bo5bo3bo5bo$bo7b7o3b7o$bo7bo9bo$b9o9bo$bo17bo
$b19o!
The stems now cross over the bars.

Here's how it's evaluated:

Code: Select all

x = 85, y = 136, rule = B/S012345678
2bo5b7ob9ob9o9b7o5b13ob9o$2bo10bo3bo5bo3bo5bo10bo5bo6bo13bo5bo$2bo5b7o
2bobobobo3bobobobo10bo5bo6bo2b9o2bobobobo$2bo6bo3bo3bo2bo2bo3bo2bo2bo
10bo5bo6bo3bo5bo3bo2bo2bo$2bo6b5o3bobobobo3bo2bo2bo10bo5bo6bo3bobobobo
3bo2bo2bo$2bo6bo7bo5bo3bo5bo10bo5bo6bo3bo2bo2bo3bo5bo$2bo6bo7b7o3b7o
10bo5bo6bo3bobobobo3b7o$2bo6bo7bo9bo16bo5bo6bo3bo5bo3bo$obobo4b9o9bo
16bo5bo6bo3b7o3bo$b3o5bo17bo16bo5bo6bo3bo9bo$2bo6b19o16bo5bo6b5o9bo$
44bo3bobobo4bo13bo$44bo4b3o5b15o$44bo5bo6bo$2bo5b7ob9ob9o9bo$2bo10bo3b
o5bo3bo5bo10bo$2bo5b7o2bobobobo3bobobobo10bo$2bo6bo3bo3bo2bo2bo3bo2bo
2bo10bo5bo5b13ob9o$2bo6b5o3bobobobo3bo2bo2bo10bo5bo6bo13bo5bo$2bo6bo7b
o5bo3bo5bo10bo5bo6bo2b9o2bobobobo$2bo6bo7b7o3b7o10bo5bo6bo3bo5bo3bo2bo
2bo$2bo6bo7bo9bo16bo5bo6bo3bobobobo3bo2bo2bo$obobo5bobobobo10bo16bo5bo
6bo3bo2bo2bo3bo5bo$b3o5bo17bo16bo5bo6bo3bobobobo3b7o$2bo6b19o16bo5bo6b
o3bo5bo3bo$44bo5bo6bo3b7o$44bo5bo6bo3bo9bo$44bo5bo6b5o$2bo9b9o23bo3bob
obo4bo13bo$2bo10bo5bo24bo4b3o6bobobobobobobo$2bo10bobobobo24bo5bo6bo$
2bo10bo2bo2bo24bo$2bo10bobobobo24bo$2bo10bo5bo24bo$2bo10b7o24bo5bo5b9o
$2bo10bo30bo5bo6bo5bo$2bo41bo5bo6bobobobo$2bo5b13obobobobobob9o3bo5bo
6bo2bo2bo$2bo10bo9bo5bo3bo5bo4bo5bo6bo2bo2bo$2bo5b13o12bobobobo4bo5bo
6bo5bo$2bo6bo3bo9bo5bo3bo2bo2bo4bo5bo6b7o$2bo6bo3bo19bo2bo2bo4bo5bo6bo
$2bo6bo3bo9bo5bo3bo5bo4bo5bo$2bo6bo3bo10bobobo4b7o4bo5bo5b19obobobobob
o$2bo6bo3bo9bo9bo10bo5bo6bo19bo5bo$2bo6bo3bo19bo10bo5bo6bo8b9o$2bo6bo
3bo9bo9bo10bo5bo6bo9bo5bo3bo5bo$2bo6bo3bo19bo10bo5bo6bo9bobobobo$2bo6b
o3bo9bo9bo10bo5bo6bo9bo2bo2bo3bo5bo$2bo6b5o19bo10bo5bo6bo9bobobobo4bob
obo$2bo6bo13bo9bo10bo5bo6bo9bo5bo3bo$2bo6b2obobobobobobo10bo10bo5bo6bo
9b7o$obobo4bo23bo10bo5bo6bo9bo9bo$b3o5b25o10bo5bo6b11o$2bo6bo34bo3bobo
bo4bo19bo$44bo4b3o6bobobobobobobobobobo$44bo5bo6bo$44bo$2bo9b9o23bo$2b
o10bo5bo24bo$2bo10bobobobo24bo5bo5b9o$2bo10bo2bo2bo24bo5bo6bo5bo$2bo
10bobobobo24bo5bo6bobobobo$2bo10bo5bo24bo5bo6bo2bo2bo$2bo10b7o24bo5bo
6bo2bo2bo$2bo10bo30bo5bo6bo5bo$2bo41bo5bo6b7o$2bo5bobob9o11b9o3bo5bo6b
o$2bo10bo19bo5bo4bo5bo$2bo5b13o12bobobobo4bo5bo5b9obobobobobo$2bo6bo
23bo2bo2bo4bo5bo$2bo6bo2bobobobobo12bo2bo2bo4bo5bo5bobobobobob9o$2bo6b
o3bo5bo13bo5bo4bo5bo6bo5bo3bo5bo$2bo6bo23b7o4bo5bo16bobobobo$2bo6bo3bo
5bo13bo10bo5bo6bo5bo3bo2bo2bo$2bo6bo23bo10bo5bo16bobobobo$2bo6bo3bo5bo
13bo10bo5bo6bo5bo3bo5bo$2bo6bo4bobobo14bo10bo5bo7bobobo4b7o$2bo6bo3bo
19bo10bo3bobobo4bo9bo$2bo6b5o19bo10bo4b3o5b11o$2bo6bo23bo10bo5bo6bo$2b
o6bo23bo10bo$obobo4bo23bo10bo$b3o5b25o10bo$2bo6bo34bo5bo$44bo5bo$44bo
5bo$44bo5bo$2bo41bo5bo$2bo41bo5bo$2bo41bo5bo$2bo41bo5bo$2bo41bo5bo$2bo
41bo5bo5bobobobobobobobobobo$2bo41bo5bo$2bo41bo5bo5b9ob9o$2bo41bo5bo6b
o5bo3bo5bo$2bo5bobobobobobobo9b9o5bo5bo6bobobobo3bobobobo$2bo28bo5bo6b
o5bo6bo2bo2bo3bo2bo2bo$2bo5b13o10bobobobo6bo5bo6bo2bo2bo3bobobobo$2bo
6bo21bo2bo2bo6bo5bo6bo5bo3bo5bo$2bo6bo2b9o10bo2bo2bo6bo5bo6b7o3b7o$2bo
6bo3bo5bo11bo5bo6bo3bobobo4bo9bo$2bo6bo3bobobobo11b7o6bo4b3o5b11o$2bo
6bo3bo2bo2bo11bo12bo5bo6bo$2bo6bo3bobobobo24bo$2bo6bo3bo5bo11bo12bo$2b
o6bo3b7o11bo12bo$2bo6bo3bo17bo12bo5bo5b9ob9o$2bo6b5o17bo12bo5bo6bo5bo
3bo5bo$2bo6bo21bo12bo5bo6bobobobo3bobobobo$2bo41bo5bo6bo2bo2bo3bo2bo2b
o$obobo4bo21bo12bo5bo6bo2bo2bo3bobobobo$b3o5b14obobobobo13bo5bo6bo5bo
3bo5bo$2bo6bo34bo5bo6b7o3b7o$44bo3bobobo4bo9bo$44bo4b3o5b11o$44bo5bo6b
o$2bo5b13ob9o13bo$2bo6bo13bo5bo14bo2b7o$2bo6bo2b9o2bobobobo14bo$2bo6bo
3bo5bo3bo2bo2bo14bo$2bo6bo3bobobobo3bo2bo2bo14bo$2bo6bo3bo2bo2bo3bo5bo
14bo$2bo6bo3bobobobo3b7o14bo$2bo6bo3bo5bo3bo20bo$2bo6bo3b7o3bo20bo$2bo
6bo3bo9bo20bo$2bo6b5o9bo20bo$obobo4bo13bo20bo$b3o5b15o20bo$2bo6bo34bo$
44bo$2bo41bo$2bo41bo$2b43o!
As you can see, it now also moves the new expression to the same level as the next argument.
This is seen in Column 1 Step 5, and it keeps consistency with which arguments are for which functions.

With these rules, you can create diagrams equivalent to any lambda calculus function.
c(>^w^<c)~*
This is 「Fluffy」
「Fluffy」is my sutando.
「Fluffy」has the ability to engineer r e p l i c a t o r s.
「Fluffy」likes to watch spaceship guns in Golly.
「Fluffy」knows Natsuki best girl.
User avatar
Redstoneboi
Posts: 467
Joined: May 14th, 2018, 3:57 am

Re: Project LambdaCAlculus

Post by Redstoneboi »

So, now that we've gotten the introductions out of the way, let's look at how the Cellular Automaton will work.
Our goal is for the rule to take in a 2-state lambda calculus diagram such as this one:

Code: Select all

x = 15, y = 6, rule = B/S012345678
7ob7o$bo3bo3bo3bo$b5o3b5o$bo7bo$b9o$bo!
And repeatedly evaluate it by itself.

Currently, our plan is to highlight the diagram, then find the expression to be evaluated, then isolate the function argument and bar along with its substitution placeholders, then repeatedly clone, align, and insert the argument, then delete the argument, then simplify the diagram, and finally, repeat the entire process.

Easy.

So, we started working on the rule. You can find it here on Floobits. (you won't be able to edit it unless we give you permission)
It lets us collaboratively edit the same files, synchronized in real time.
We can all call and stream our screens to each other to pinpoint issues, bugs, breaks, and unhandled edge cases on the fly, and give each other suggestions on how to fix it.
Ultimately, it lets us work like we're all using the same computer. Pretty nifty.
You can find our prototype rules and patterns in their respective folders.

Hactar and I use Sublime Text to edit each file.
We can set Sublime and up in such a way that floobits files will automatically update on our local PC's every time they're saved.
We also set our rule folder to HactarCE/CA/Rules/ which makes iteration very fast compared to working yourself, then posting an update to the rule every now and then.
Just update the rule for everyone, at the same time, and have them all check for bugs and suggestions.

Hactar and I usually work about 3 hours, 5-7PM UTC when we can. If you want to join, tell us. We'd like some more help and insight.
c(>^w^<c)~*
This is 「Fluffy」
「Fluffy」is my sutando.
「Fluffy」has the ability to engineer r e p l i c a t o r s.
「Fluffy」likes to watch spaceship guns in Golly.
「Fluffy」knows Natsuki best girl.
Hunting
Posts: 4401
Joined: September 11th, 2017, 2:54 am

Re: Project LambdaCAlculus

Post by Hunting »

Can someone provide a detailed description of how the rule table will work on the recursive diagram?
User avatar
Redstoneboi
Posts: 467
Joined: May 14th, 2018, 3:57 am

Re: Project LambdaCAlculus

Post by Redstoneboi »

Hunting, as well as anyone else who wants to join, can chat with us on the Conwaylife Lounge Discord Server!

Anyway, we've finished the Lambda Diagram highlighting and compacting in one rule. Currently, all it does is highlight, compact, and unhighlight, on repeat. Flashy.
It could be modified to evaluate the diagrams between compacting and unhighlighting in the future.
Any of you can still view it on floobits, but here's the rule for convenience:

Code: Select all

@RULE Simplify

@COLORS
0    0   0   0
1  255 255 255
2  255 153 153
3  102  51  51
4  153 153 255
5  153 255 153
6    0 255 255
7    0 102 102
8  102 102  51
9  153 153 153

@TABLE
n_states:10
neighborhood:Moore
symmetries:none
var a={0,1,2,3,4,5,6,7,8,9}
var b=a
var c=a
var d=a
var e=a
var f=a
var g=a
var h=a

#reroot
	#receive
		2 a,b,8,0,0,0,0,h 9 #absorb
		0 8,0,0,0,e,f,0,2 0 #stop
	#send
		var A{1,2,3,4,5,6,7,8,9}
		0 0,0,0,0,0,7,4,0 8 #init
		0 a,b,8,d,0,f,g,h 8 #left
		0 8,b,c,d,e,f,A,h 8 #down
		0 8,b,c,d,e,f,g,A 8 #down
		8 a,b,c,d,0,f,g,h 0 #die

#squish left
	#shorten
		#wave
			0 0,0,c,0,0,7,0,0 c #lead
			0 0,b,4,0,0,0,3,0 4 #pull
			4 0,0,3,0,e,f,g,h 3 #fuse
			6 0,0,0,0,e,f,g,h 3 #init
		#signal
			6 0,b,4,d,e,f,g,h 4	#death
			4 0,0,c,0,0,0,6,0 6 #birth
	#move
		var A={2,3}
		var B={0,1,2,3,4,5,6}
		#init
			#phase 3
				4 0,0,c,0,0,A,6,0 7 #Right sheath
				6 0,0,4,0,A,7,7,0 4 #Center unflag
				7 0,0,6,d,7,f,7,h 4	#ignore flag
			#phase 2
				4 0,0,c,d,e,B,7,h 6 #Center flag/shorten init
			#phase 1
				4 0,0,4,0,6,0,4,0 4 #Center wait
				4 0,0,4,6,0,0,g,0 7 #Left sheath
		#wave
			var C=B
			var D=B
			#guide
				#init
					#spark
						4 0,0,7,d,0,f,7,0 3	#flag
						7 0,0,3,d,7,f,4,0 4	#detect flag
						3 0,0,7,d,0,f,7,0 4 #unflag
					#top
						7 0,0,0,0,7,A,4,0 4 #far Right
						7 0,b,4,A,7,0,g,0 4 #Left
				#block
					#7 0,0,c,d,e,f,g,0 7 #block top
				#wave
					4 a,b,7,d,e,f,7,h 4 #block
					4 0,0,7,B,e,f,g,0 7 #West
			#unsheath
				7 0,0,c,d,e,f,B,0 7 #bar top
				7 B,C,4,d,e,f,g,D 4 #bar Left sheath
				7 B,C,c,d,e,f,4,D 4 #bar Right sheath
				7 B,C,5,d,e,f,g,D 5 #link
				7 B,C,c,d,e,f,g,D 0 #stem default
			#stretch
				7 a,b,B,d,e,f,7,h B #highlights
		#grow
			#through
				var A={4,5}
				A 7,b,c,d,e,f,g,h 7 #through
			#beside
				var A={2,3,4,5}
				0 7,b,A,d,e,f,g,h 7	#East
				0 7,b,c,d,e,f,A,h 7	#West
				a 7,7,7,d,e,f,g,h 7 #spread SW
	#signal
		var A={2,3,4}
		var B={2,6}
		#death
			#root
				6 2,0,0,0,0,0,0,0 0
			#junction
				6 2,0,5,0,2,0,0,0 3
			#bar
				6 B,b,4,d,e,f,4,h 4 #on/off
			#stem
				6 A,b,0,d,6,f,0,h 3 #off
				6 A,b,0,d,e,f,0,h 2 #on
			#link
				6 a,b,5,d,e,f,g,h 5 #North
				6 a,b,c,d,e,f,5,h 5 #East
		#birth
			0 2,5,0,0,0,0,0,0 6 #rootless
			1 2,4,0,0,0,0,0,4 6 #root bar
			2 2,b,0,0,0,0,0,0 6 #root link
			A a,b,c,d,6,f,g,h 6 #stem/bar
			5 a,b,c,d,e,f,6,h 6 #link

#wave up
	#mark
		#init
			var A={0,8}
			2 2,0,5,0,2,0,0,0 3
			1 2,8,5,0,e,0,0,0 2
		#cull
			3 0,3,2,d,e,f,3,h 8
	#wave
		#init
			3	0,2,2,d,e,f,3,0 8 #low=L
			3 4,4,2,d,e,f,3,h 8 #low=R
		#pull
			var A={0,4,5}
			8 A,b,c,d,5,f,g,h 0 #space
			2 a,b,c,d,5,f,g,8 5 #stem
			5 5,b,c,d,e,f,g,h 0 #link squish
			8 8,b,c,d,5,f,g,h 5 #link stretch
		#cull
			var A={0,8}
			3 a,b,c,d,A,f,g,h 0
		#spread
			3 8,b,c,d,e,f,g,h 8 #S
			3 a,b,8,d,e,f,g,h 8 #W
	#fill
		#init
			0 a,b,0,5,5,1,2,h 3
		#spread
			var A={0,2}
			0 a,b,A,d,3,3,3,h 3 #NE
			0 a,b,A,5,5,5,3,h 3 #E
			0 a,b,c,d,3,f,2,h 3 #N

#left-align
	#shorten
		5 0,0,0,0,e,f,5,1 0
	#shuffle
		0 1,0,1,d,e,f,0,0 1
		1 0,0,c,d,e,f,0,1 c
	#slide
		0 1,5,1,d,e,f,0,h 1
		1 5,b,0,d,e,f,0,1 0

#highlight
	#bar
		#init
			1 0,0,0,0,0,f,1,h 4
			1 0,b,1,d,0,0,0,0 4
		#spread
			1 a,b,4,d,e,f,g,h 4
			1 a,b,c,d,e,f,4,h 4
	#mark
		var A={1,4}
		var B=A
		var C=A
		#up
			4 0,0,A,0,4,0,B,0 2
			4 4,B,0,4,4,4,0,C 3
			0 A,B,0,4,2,4,0,C 4
		#init
			2 a,0,4,0,e,0,4,0 4
			4 a,0,c,0,1,0,g,0 2
	#stem
		#spread
			var A={2,3}
			1 A,b,0,d,e,f,g,h 2

	#link
		#spread
			1 0,b,5,d,e,f,g,h 5
		#init
			1 1,0,0,0,e,f,1,0 5

#rescan
	var A={ , ,2,3,4,5}
	#scan
		A a,b,9,d,e,f,g,h 9 #West
		A a,b,c,d,9,f,g,h 9 #North
		A a,b,c,d,e,f,9,h 9 #East
	#projection
		9 3,0,4,d,e,f,g,0 9 #bar East
		9 3,0,c,d,e,f,4,0 9	#bar West
		9 a,b,c,d,9,f,g,h 0
	#line
		9 a,b,c,d,e,f,g,h 1
As you can see, it is huge. So huge, in fact, that I actually had to indent them. The tab widths on conwaylife.com are much wider than the 2-char wide ones we normally use.
From now on, the rules we make will be in that format; The 8 main variables a-h will be at the top, and any future variables will be in uppercase, defined as needed. This way, we won't need to worry about variable naming. We embrace the collisions and redefinitions.
It also works well with certain syntax highlighting, such as Java and Haskell.

Now, for the test patterns.
Large diagram:

Code: Select all

x = 58, y = 52, rule = Simplify
29D.10D.17D$5.C5.C7.C11.C6.C3.C3.C4.C3.C$29D.10D.17D$5.C5.B7.C11.C6.C
3.C3.C4.C3.C$29D.10D.17D$5.B5.B7.B11.B6.B3.B3.B4.B3.B$29D.4D3.3D2.5E
4.B2.3D$5.B5.B7.B11.B6.B5.B6.B3.B$5.B5.B7.B11.B5.3D4.B6.5E$5.B5.B7.B
11.B6.B5.B8.B$5.B5.9E11.B5.3D4.B8.B$5.B10.B14.B6.B5.B8.B$5.B10.B14.B
6.B5.B8.B$5.12E14.8E5.B8.B$12.B22.B8.10E$12.24E14.B$25.B24.B$25.B24.B
$25.B24.B$25.B24.B$25.B25E$25.B$25.B$25.I5$29A.10A.17A2$29A.10A.17A$
11.A$29A.10A.17A$5.A5.A7.A11.A6.A3.A3.A4.A3.A$29A.4A3.3A2.5A4.A2.3A$
5.A5.A7.A11.A6.A5.A6.A3.A$5.A5.A7.A11.A5.3A4.A6.5A$5.A5.A7.A11.A6.A5.
A8.A$5.A5.9A11.A5.3A4.A8.A$5.A10.A14.A6.A5.A8.A$5.A10.A14.A6.A5.A8.A$
5.12A14.8A5.A8.A$12.A22.A8.10A$12.24A14.A$25.A24.A$25.A24.A$25.A24.A$
25.A24.A$25.26A$25.A$25.A$25.A!
Recompaction:

Code: Select all

x = 35, y = 38, rule = Simplify
11D.7D.15D$.C3.C3.C3.C3.C3.C3.C3.C3.C$11D.7D.15D$.C3.B3.C3.C3.C3.C3.C
3.C3.C$11D.7D.15D$.B3.B3.B3.B3.B3.B3.B3.B3.B$11D.3D.3D2.C4E3.B2.3D$.B
3.B3.B3.B3.B3.B7.B3.B$.B3.C4E3.B2.3D2.B7.C4E$.B3.B7.B3.B3.B7.B$.C4E7.
B2.3D2.C8E$.B11.B3.B3.B$.B11.C4E3.B$.B11.B7.B$.C12E7.B$.B19.B$.B20E$.
I3$11A.7A.15A2$11A.7A.15A$5.A$11A.7A.15A$.A3.A3.A3.A3.A3.A3.A3.A3.A$
11A.3A.3A2.5A3.A2.3A$.A3.A3.A3.A3.A3.A7.A3.A$.A3.5A3.A2.3A2.A7.5A$.A
3.A7.A3.A3.A7.A$.5A7.A2.3A2.9A$.A11.A3.A3.A$.A11.5A3.A$.A11.A7.A$.13A
7.A$.A19.A$.21A$.A!
Small diagrams:

Code: Select all

x = 19, y = 53, rule = Simplify
3A4.3A4.3A$.A6.A$.A5.3A4.3A$.A6.A6.A$.A6.A6.A3$4A3.4A3.4A$2.A6.A$2.A
4.4A3.4A$2.A6.A6.A$2.A6.A6.A3$4A3.4A3.4A$.A6.A$.A5.4A3.4A$.A6.A6.A$.A
6.A6.A3$5A2.5A2.5A$2.A6.A$2.A4.5A2.5A$2.A6.A6.A$2.A6.A6.A3$3A4.3A4.3A
$.A6.A$7.3A4.3A$8.A6.A4$4A3.4A3.4A$2.A6.A$7.4A3.4A$9.A6.A4$4A3.4A3.4A
$.A6.A$.A5.4A3.4A$8.A6.A4$5A2.5A2.5A$2.A6.A$7.5A2.5A$9.A6.A!
Vertical compaction edge cases:

Code: Select all

x = 34, y = 58, rule = Simplify
34A$9.A6.A7.A$9.A6.9A$9.A14.A$9.16A$15.A$15.A10$34A$9.A6.A7.A$9.A6.9A
$9.A14.A$9.A14.A$9.A14.A$9.A14.A$9.16A$14.A$14.A7$29A$5.A13.A$4.3A10.
5A$5.A13.A$5.A11.5A$5.A13.A$5.A13.A$5.15A$19.A$19.A7$29A$5.A13.A$4.3A
10.5A$5.A13.A$4.3A12.A$5.A13.A$5.A13.A$5.15A$5.A$5.A!

Code: Select all

x = 14, y = 36, rule = Simplify
11A$.A3.A3.A$.A2.3A.3A$.A3.A3.A$.A3.A2.3A$.A3.A3.A$.A3.A2.3A$.A3.A3.A
$.5A3.A$.A7.A$.A7.A$.A7.A$.9A$.A$.A6$14A$.A$.A2.4A.5A$.A9.A$.A2.4A.5A
$.A3.A5.A$.A3.A5.A$.A3.A5.A$.A3.A5.A$.A3.A5.A$.5A5.A$.A9.A$.A9.A$.A9.
A$.11A$.A!
Horizontal compaction hanging cases:

Code: Select all

x = 22, y = 19, rule = Simplify
22A$2.A10.A$22A$2.A10.A$2.A4.15A$2.A6.A3.A$2.A4.15A$2.A6.A3.A$2.A6.5A
3.3A$2.A8.A6.A$2.A8.A6.A$2.A8.A6.A$2.A8.8A$2.A11.A$2.A11.A$2.A11.A$2.
13A$2.A$2.A!
Sample Y-combinator diagrams:

Code: Select all

x = 33, y = 28, rule = Simplify
19A$9.A$7A.11A$.A3.A3.A3.A3.A$.5A3.A3.5A$5.A3.A3.A$5.A3.5A$5.A3.A$5.
5A4$33A$17.A$12A.20A$.A6.A8.A6.A6.A$.A6.A8.A6.A6.A$.A6.A8.A6.A6.A$.A
6.A8.A6.A6.A$.A6.A8.A6.8A$.8A8.A6.A$4.A12.A6.A$4.A12.8A$4.A16.A$4.A
16.A$4.A16.A$4.A16.A$4.18A!
c(>^w^<c)~*
This is 「Fluffy」
「Fluffy」is my sutando.
「Fluffy」has the ability to engineer r e p l i c a t o r s.
「Fluffy」likes to watch spaceship guns in Golly.
「Fluffy」knows Natsuki best girl.
Hunting
Posts: 4401
Joined: September 11th, 2017, 2:54 am

Re: Project LambdaCAlculus

Post by Hunting »

Unfortunately I will not be able to use Discord recently.

Congratulations on the Simplify rule!
Hunting
Posts: 4401
Joined: September 11th, 2017, 2:54 am

Re: Project LambdaCAlculus

Post by Hunting »

(λx.x x x)(λx.x x x) is a replicator. However, I can't understand the diagrams.
Post Reply