Optimisation in swi prolog
Say I want to find argmax(x,y,z) -1/2(20x^2+32xy +16y^2)+2x+2y. subject to: x>=0, y>=0,z>=0 and -x-y+z =0. I know the partial derivatives being set to 0 is : -20x-16y+2=0 and -16x-16y+2 =0 so we could have x= 0 and y =1/8 and z=1/8. How would I do this in Swi-prolog? I see that there is library simplex for linear solving, but this is a quadratic problem but the partial derivatives are not. (I am a bit confused!) This is what I have: :- use_module(library(simplex)). my_constraints(S):- gen_state(S0), constraint([-20*x, -16*y] = 0, S0, S1), constraint([-16*x,-16*y] = 0, S1,S2), constraint([x] >=