Ascend FD-23R Manual de usuario Pagina 23

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 81
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 22
1.4. FD Constraints 11
Example in the TOY(FD)command level:
Next goal returns true and constrains X and Y to have values in the range [1,10].
TOY(FD)> domain [X,Y] 1 10
yes
Y in 1..10
X in 1..10
Elapsed time: 0 ms.
1.4.3 Relational Constraints
Relational constraints include equality and disequality constraints in the form e¦ e
0
where ¦ {#<, #=, #<=, #>=, #>, #\=} and e and e
0
are either integers, or FD
variables or functional expressions.
(#<)/2, (#=)/2, (#<=)/2, (#>=)/2, (#>)/2, (#\=)/2
Type declaration:
(#>) :: int int bool
(#<) :: int int bool
(#>=) :: int int bool
(#<=):: int int bool
(# =) :: int int bool
(#\=) :: int int bool
Definition: ’#Op A B’, also written in infix notation as ’A #Op B’, where Op
{>, <, >=, <=, =, \ =}, returns true if the imposition of the relation ’A #Op
B’ entails the constraint store.
Remarks: Infix notation allowed.
Priorities:
infix 30 #>, #<, #>=, #<= (infix)
infix 20 #=, #\= (infix)
Example at the TOY(FD) command level:
Next goal returns true and restricts X and Y to have values in the intervals [2,10]
and [1,9] respectively (as a consequence of range narrowing).
Vista de pagina 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 80 81

Comentarios a estos manuales

Sin comentarios