File under: development, plt, racket, scheme
Function Finder
Find functions by example in PLT Racket
(? 2 2) = 4
Answer: +
(? "My name is ~a" "John") = "My name is John"
Answer: format
Enter some inputs and the answer, and Function Finder will find the function that does the that calculation!
Examples
(guess '(1 1) 2) -> arithmetic-shift +
(guess '( () ) #t) -> null? list? ... empty?
(guess '("el" "hello") #t) -> putenv ... regexp-match?
(guess-str '( 3 ) '(0 1 2)) -> iota
[guess-str '[[ 0 1 2]] 2] -> caddr last third
Function finder finds every function that matches the rules you provide. So if you tell it that
the inputs are 1,1 and the answer is 2, FF will tell you that the function you want is addition or '+'.
And, apparently, arithmetic shift. Enter 2,2 and 4 for the answer, and it will tell you '*' and 'square'.
When it starts, it disables filesystem and network access, to prevent you from accidentally erasing your
hard drive while it runs. It does crash often, because it is calling random functions, so save your work first!
Status
Complete
Download
function finder for PLT racket