:- true pred list_diff(_1,_2,_3)
         : ( list(_1,gnd), list(_2,gnd), var(_3) )
        => ( list(_1,gnd), list(_2,gnd), list(_3,gnd), length(_1,_A), length(_2,_B) )
         + cost(ub,steps,_B*_A+2*_B+5*_A+6).

:- true pred list_diff_i(_A,_1,_2)
         : ( list(_A,gnd), rt7(_1), var(_2) )
        => ( list(_A,gnd), list(_1,gnd), list(_2,gnd), length(_A,_B), length(_1,_C) )
         + cost(ub,steps,_C*_B+3*_B+1).

:- true pred list_diff_i(_A,_1,_2)
         : ( list(_A,gnd), list(_1,gnd), var(_2) )
        => ( list(_A,gnd), list(_1,gnd), list(_2,gnd), length(_A,_B), length(_1,_C) )
         + cost(ub,steps,_C*_B+3*_B+1).

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

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