This is super interesting but I am really curious about its performance assuming they dont just bruteforce it to exhaust all combinationss. Tons of portfolio optimization problems can be specified very succinctly just like above but the actual computation can be quite tricky. If you had to break up a hundred dollars to invest in google amazon and rest in a riskfree interest bearing bond the optimal constraints look just like the choose function above...so i can declaratively write out the sharpe but maximizing the sharpe is fairly nontrivial. I am going to check this out right now.
It's such a shame though that this kind of research usually stops when the author is done with his/her thesis. A lot of worthwhile papers and software are out there and together probably enough to create a small revolution in software development, but the problems are very hard and usually it's not even concrete enough to define the problem that well. So it would need a lot of these researchers combined to do something great; besides maybe DARPA, I don't see much interest in that at the moment unfortunately.
I think it's much better than brute force search.
The example above produces the following code:
val (hours, minutes, seconds) = {
val loc1 = secnum div 3600
val num2 = secnum + ((−3600) ∗ loc1)
val loc2 = min(num2 div 60, 59)
val loc3 = secnum + ((−3600) ∗ loc1) + (−60 ∗ loc2)
(loc1, loc2, loc3)
}
Note that it works for constraints expressed in (parameterized) linear arithmetic and with operations on sets (like taking cardinality, union, intersection...).