Created
March 3, 2011 00:04
-
-
Save martinklepsch/852054 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The function should find the helpdesk that needs the smallest amount of time (bTime) | |
to fulfill an order with a specified type of concern (d). | |
art() returns the type of concern of a given order. | |
dorders should hold all orders with the specified concern d. | |
FUN fastest: seq[order] ** (concern -> bool) -> nat | |
DEF fastest(orders, d) == | |
LET | |
dorders == filter(\\x. d(art(x)))(orders) | |
IN | |
desk(reduce(\\ x, y. IF bTime(x) < bTime(y) THEN x ELSE y, | |
ft(dorders))(dorders)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment