Ascend FD-23R Bedienungsanleitung Seite 23

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 81
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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).
Seitenansicht 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 80 81

Kommentare zu diesen Handbüchern

Keine Kommentare