Download
language ESSENCE 1.2.0
$ Steel Mill Slab Design Problem
$ Problem details available at http://www.csplib.org/Problems/prob038/
$ 4/8/2020

given Colour new type enum
given n_orders, col_per_slab : int(1..)
given slabSizes: set of int(1..)
letting Order be domain int(1..n_orders)
given ordSize : function (total) Order --> int(1..)
given ordCol : function (total) Order --> Colour
letting max_slab_size be max(slabSizes)

find cut : partition from Order
minimising sum p in parts(cut) .
    min([s | s <- slabSizes, s >= 
        sum o in p . ordSize(o)]) 

$max slab size not exceeded
such that forAll p in parts(cut) .
    max_slab_size >= sum o in p . ordSize(o) 

    $ At most col_per_slab distinct colours on each slab
such that forAll p in parts(cut) .  
    |toSet([ ordCol(o) | o <- p])| <= col_per_slab