Ascend FD-23R Manual de usuario Pagina 24

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 81
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 23
12 CHAPTER 1. The TOY(FD) System
TOY(FD)> domain [X,Y] 1 10, X #> Y
yes
Y in 1..9
X in 2..10
Elapsed time: 0 ms.
(#)/2, (#+)/2, (#)/2, (#/)/2
Type declaration:
(#) :: int int int
(#+) :: int int int
(#) :: int int int
(#/) :: int int int
Definition: ’#Op A B’, also written in infix notation as ’A #Op B’, where Op
{∗, +, , /} imposes the constraint ’A #Op B’ and returns true if it is entailed.
Remarks: Infix notation allowed.
Priorities:
infixr 90 #*, #/ (infix, right-associative)
infixl 50 #+, #- (infix, left-associative)
Example at the TOY(FD) command level:
Next goal returns true and constrains X, Y and Z to have values in the intervals
[1,10], [1,10] and [1,100] respectively.
TOY(FD)> domain [X,Y] 1 10, X #* Y #= Z
yes
Z in 1..100
Y in 1..10
X in 1..10
Elapsed time: 0 ms.
1.4.4 Arithmetic Constraints
The following constraints express a relation between a sum or scalar product and a
value, using a dedicated algorithm that avoids creating any temporary variables hold-
ing intermediate values.
sum/3
Vista de pagina 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 ... 80 81

Comentarios a estos manuales

Sin comentarios