% Qualitative regression general background knowledge. % % Background knowledge for learning numeric functions in order[0-4].pl % The modes gives three families of functions that can be fitted % to the points. These are 1) linear, 2) polynomial in one % term and 3) exponential. % The predicate order/1 contains one solver for each of these % functional forms. The solvers work by successive approximation % and find integer coefficients and floating point error terms that fit % the given example. For ease, the solvers all assume that % the function goes through the origin. This assumtion % works best for large values of X and Y. :- modeh(1,f(+posfloat,+posfloat))? :- modeb(32,order((+posfloat)=((#int)*(+posfloat)+(#int))+/-(#posfloat)))? :- modeb(32,order((+posfloat)=((#int)*(+posfloat)^(#int))+/-(#posfloat)))? :- modeb(8,order(+posfloat=((#int)^(+posfloat))+/-(#posfloat)))? :- set(c,1)? posfloat(X) :- float(X), not(X=<0.0). range(-0.5,0.5). round(X,Y) :- Y is floor(X). round(X,Y) :- Y is ceil(X). abs(X,Y) :- not(0.0=