% Copyright 2008 INRIA, J. Martin & F. Fages % License GPL % % file psa.rcp % import('rules2cp/lib/pkml/pkml'). s1 = make_shape_box([8, 8, 4]). s2 = make_shape_box([8, 4, 2]). s3 = make_shape_box([4, 8, 2]). o1 = make_object_shape(s1, [0, 0, 0]). o2 = make_object([s2, s3], [_, _, _], _, 300). o3 = make_object([s2, s3], [_, _, _], _, 100). o4 = make_object([s2, s3], [_, _, _], _, 600). dimensions = [1, 2, 3]. bin = o1. items = [o2, o3, o4]. w(O) = size(O, 1). h(O) = size(O, 2). l(O) = size(O, 3). items_domain(Items, Bin) --> forall(I, Items, domain(x(I), 0, w(Bin)) and domain(y(I), 0, h(Bin)) and domain(z(I), 0, l(Bin))). ? items_domain(items, bin) and object_shape_domains(items) and bin_packing(items, [bin], dimensions) and gravity(items) and weight_stacking(items) and variable_ordering([greatest(weight(^)), is(shape_index(^)), is(z(^))]).