%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % At run time, this below predicate will be build % and used to pass information. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% solution(Customer, Requirements, Old_sol, New_sol, Difference). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % instantiated example %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % note that the capability description may be a subset % of a particular type of board. solution(john-1, [total_cost(M), less_than(M, 1000), special_req(B, capability, [fast_graphics]) ], [], [] ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % init_solution indicates a minimum solution % for any requirement, i.e. an io, a disk_controller % and processor board must be allocated. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% init_solution( Customer, Requirements, [ instance_of(X, processor), instance_of(Y, disk_controller), instance_of(Z, io), allocate(X, Slot1), allocate(Y, Slot2), allocate(Z, Slot3), total_cost(Cost) ], Solution ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%