News for hackers. Stuff that matters.
Re:Imperative vs. Declarative (2013) by i_am_ralpht on Tuesday December 02, 2014 @06:13PM (#8690738)
What algorithms are there for inferring the calculation?

I'm playing around with a tool for building touch gestures visually, and I have some problems that look a bit like that (want to infer a function from some examples) but I don't yet know how.

Re:Imperative vs. Declarative (2013) by gajomi on Tuesday December 02, 2014 @06:22PM (#8690797)
This calculation is underdetermined, and there isn't any algorithm that would specify "it", since there are many functions that would satisfy the requirements. In general this is a hard problem of induction. In a more limited context you might think about adding regularizations that will make the function better determined. Choosing these and implementing them may not be trivial.

If you are talking paths generated from touch gestures there is some research on that topic.

Re:Imperative vs. Declarative (2013) by art-w on Wednesday December 03, 2014 @01:42AM (#8692205)
People working on program synthesis consider the Occam razor "the shortest/simplest code" to be a good heuristic of the intended function (given a good test case.) Their main problem is the exponential space search.
Re:Imperative vs. Declarative (2013) by hcarvalhoalves on Wednesday December 03, 2014 @12:00PM (#8694830)
Sounds like a regression problem? The actual algorithm will depend on how well you need to approximate the function, the nature and amount of example data.

http://en.wikipedia.org/wiki/Machine_learning#Approaches