:- true pred append(_A,_1,_B) : ( list(_A,num), list(_1,num), var(_B) ) => ( list(_A,num), list(_1,num), list(_B,num), length(_A,_C), length(_1,_D) ) + cost(ub,steps,3.0*(_C+1)**2+6*(_D*_C)+6*_D+10.0*_C+10.0). :- true pred lnum([_A|_B]) : ( num(_A), list(_B,num) ) => ( num(_A), list(_B,num), length(_B,_C) ) + cost(ub,steps,2*_C+3). :- true pred lnum(_A) : list(_A,num) => ( list(_A,num), length(_A,_B) ) + cost(ub,steps,2*_B+1). :- true pred lnum([]) + cost(ub,steps,1).