:- true pred list_diff(A,B,C)
         : ( list(A,gnd), rt9(B), var(C) )
        => ( list(A,gnd), list(B,gnd), list(C,gnd), length(A,_A), length(B,_B) )
         + cost(ub,steps,(_A+1)**2+3*(_B*_A)+2*_B+11.0*_A+9.0).

:- true pred memberchk(_1,_A)
         : ( gnd(_1), list(_A,gnd) )
        => ( gnd(_1), rt9(_A), length(_A,_B) )
         + cost(ub,steps,_B+2).

:- true pred listgnd(_A)
         : rt0(_A)
        => rt0(_A)
         + cost(ub,steps,1).

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

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

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