:- true pred nreverse(_A,_B)
         : ( list(_A), var(_B) )
        => ( list(_A), list(_B), length(_A,_C) )
         + cost(ub,steps,sum(_D,2,_C+1,1.5*(_D-1)**2)+7.75*(_C+1)**2+5.25*_C+3.25).

:- true pred appendlast(_A,_B,_C)
         : ( list(_A), term(_B), var(_C) )
        => ( list(_A), term(_B), list(_C), length(_A,_D) )
         + cost(ub,steps,1.5*(_D+1)**2+12.5*_D+14.5).

:- true pred list(_A)
         : list(_A)
        => ( list(_A), length(_A,_B) )
         + cost(ub,steps,_B+1).

:- true pred list([_A|_B])
         : ( term(_A), list(_B) )
        => ( term(_A), list(_B), length(_B,_C) )
         + cost(ub,steps,_C+2).

:- true pred list([_A])
         : term(_A)
        => term(_A)
         + cost(ub,steps,2).

:- true pred list(_A)
         : list(_A)
        => ( list(_A), length(_A,_B) )
         + cost(ub,steps,_B+1).

:- true pred list([])
         + cost(ub,steps,1).