viii CONTENTS
2 TOY(FD) Programming Examples 23
2.1 Important Note about Programming with TOY(FD) . . . . . . . . . . . 23
2.2 Introductory TOY(FD) Examples . . . . . . . . . . . . . . . . . . . . . . 24
2.2.1 Send+More = Money . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2.2 N-queens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2.3 A Cryptoarithmetic Problem . . . . . . . . . . . . . . . . . . . . 26
2.2.4 Magic Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.3 More Complex Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.3.1 A Scheduling Problem . . . . . . . . . . . . . . . . . . . . . . . . 29
2.3.2 A Hardware Design Problem . . . . . . . . . . . . . . . . . . . . 32
2.3.3 A Colour Problem . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.4 Colour Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.5 Lazy Constraint Programs . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.5.1 Hamming Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.5.2 Lazy Magic Sequences . . . . . . . . . . . . . . . . . . . . . . . . 48
Bibliography 51
A TOY(FD) Grammar 53
B Declaration of Primitives (file basic.toy) 59
C Common Functions (file misc.toy) 61
Comentários a estes Manuais