Saturday, March 17, 2007

The brute force program generator has a way of finding "dirty tricks" to solve for your data set.

For instance, I wanted it to come up with a program that would add 100 and take the square root. More or less:

function a -> sqrt (a+100)

Here are some dirty tricks:

brute 10000000000 0 10 5 10 21 11
6840772: 5m5<+


translation into ocaml: function a -> (a mod 5) + 10

Here's another try, with the additional in/out pair (261,19):

brute 10000000000 0 10 5 10 21 11 261 19
78030700: >4+q8+


translation: function a -> sqrt ((a*2)+4)+8

Sure, these work for the data I gave it, but neither are what I wanted: 5<d*+q.

1 comment:

Anonymous said...

People should read this.