gsdlab / clafer

Clafer is a lightweight modeling language
http://clafer.org
MIT License
45 stars 13 forks source link

add support for min and max to Alloy generator #79

Closed mantkiew closed 8 years ago

mantkiew commented 9 years ago

The module util/integer contains min and max functions:

/** given a set of integers, return the largest element */
fun max [es: set Int]: lone Int { es - es.^prev }

/** given a set of integers, return the smallest element */
fun min [es: set Int]: lone Int { es - es.^next }