%% time over cost number(0..4). desire(L):- literal(L). desire(cost1). isor(cost1, taxiAvl(home), taxiAvl(school)). desire(cost2). isor(cost2, cost1, taxiAvl(station)). desire(cost3). isnegation(cost3, cost2). desire(cost). always(cost, cost3). desire(otaxi). happen(otaxi, taxi(home, school)). desire(time). eventually(time, otaxi). w(D, 1):- desire(D), satisfy(D, 0). w(D, 0):- desire(D), not satisfy(D, 0). maxw(D, 2):- desire(D). preference(time_cost). w(time_cost, N):- number(N), number(N1), number(N2), w(time, N1), w(cost, N2), N = 2*N1 + N2. maxw(time_cost, 4). %#weight w(time_cost, N) = N. maximize [w(time_cost, 0) = 0, w(time_cost, 1) = 1, w(time_cost, 2) = 2, w(time_cost, 3) = 3, w(time_cost, 4) = 4] . hide preference(_). hide maxw(_,_). %hide w(_, _). hide number(_).