Readit News logoReadit News
LightMachine commented on Discovering algorithms by enumerating terms in Haskell   twitter.com/VictorTaelin/... · Posted by u/agomez314
tadfisher · a year ago
I'm confused, what is the search space? All possible functions from Int -> Int? And how do you verify a result is optimal across inputs?
LightMachine · a year ago
The search space I'm using is that of all functions of a given dependent type. That allows you to make the search space by using a strong enough type.

For example, if you search for `Integer -> Integer -> Integer` function, it will consider Integers of different bit-sizes. But if you instead search for `∀(n: Nat). Int(n) -> Int(n) -> Int(n)`, you will only consider integers of the same bit-size, which is a much smaller space. You can make arbitrary restrictions to shorten your search.

LightMachine commented on Discovering algorithms by enumerating terms in Haskell   twitter.com/VictorTaelin/... · Posted by u/agomez314
smusamashah · a year ago
Only thing I could read (don't understand any of this otherwise) was that you take input pairs and you give python function to generate that output. Does that mean that many math etc problems can be just solved? What kind of python code will it generate to return primes?
LightMachine · a year ago
It will just return the smallest function that passes your tests.

It works by enumerating ALL possible functions and running them. Obviously, that naive approach is exponential, so, the entire point is whether we can apply some clever tricks (based on optimal evaluators) to make this search "slightly less intractable".

So, to answer your question directly: if you asked it to design a prime number generator, if it found anything at all, it would probably be a simple, slow trial-and-error algorithm, or something in these lines.

LightMachine commented on Discovering algorithms by enumerating terms in Haskell   twitter.com/VictorTaelin/... · Posted by u/agomez314
LightMachine · a year ago
Uhm author here. Not sure why this tweet is on Hacker News, as it is just a non-technical "blog post". But I've posted a follow-up today with some code and details, if you're curious:

https://x.com/VictorTaelin/status/1819774880130158663

That's as much as I can share for now though

u/LightMachine

KarmaCake day1647September 27, 2015View Original