Structured Flavors in Maple
|
Description
|
|
•
|
A structured flavor is any Maple expression other than a symbol that can be interpreted as a description of a random flavor. A typical example would be . This expression describes a list that contains two elements, each of which is an integer.
|
•
|
The following table gives a formal grammatical description of the valid structured flavors in Maple. The table uses the following notation: "::=" means "is defined to be", "|" means "or", and "*" means "zero or more occurrences of".
|
|
Syntax
|
Matches
|
|
|
|
flavor ::=
|
{ flavor* }
|
alternation; any of the flavors
|
|
| [ flavor* ]
|
a list of the given flavors
|
|
| complex(numeric)
|
match complex numerical constants exactly
|
|
| string
|
match strings exactly
|
|
| flavor = flavor
|
an equation of the corresponding flavors
|
|
| flavor <> flavor
|
an inequality compared with given flavors
|
|
| flavor < flavor
|
a relation compared with given flavors
|
|
| flavor <= flavor
|
a relation compared with given flavors
|
|
| flavor > flavor
|
a relation compared with given flavors
|
|
| flavor >= flavor
|
a relation compared with given flavors
|
|
| flavor .. flavor
|
a range compared with given flavors
|
|
| flavor and flavor
|
an and of the corresponding flavors
|
|
| flavor or flavor
|
an or of the corresponding flavors
|
|
| not flavor
|
a not of the corresponding flavor
|
|
| flavor &+ flavor ...
|
a sum of the corresponding flavors
|
|
| flavor &* flavor ...
|
a product of the corresponding flavors
|
|
| flavor &. flavor ...
|
a dot product of the corresponding flavors
|
|
| flavor ^ flavor
|
a power compared with the given flavors
|
|
| fcnflavor
|
a function or special flavor
|
|
|
|
fcnflavor ::=
|
set(flavor, nonnegint)
|
sets of elements compared with the given flavor
|
|
| list(flavor, nonnegint)
|
lists of elements compared with the given flavor
|
|
| `&+`(flavor)
|
a sum of terms of the given flavors
|
|
| `&*`(flavor)
|
a product of factors of the given flavors
|
|
| function(flavor)
|
any function with arguments compared with given flavor
|
|
| name(flavor)
|
any name with a value of the given flavor
|
|
| foo(flavor*)
|
a flavor defined by a procedure added with RandomTools[AddFlavor]
|
|
| foo(flavor*)
|
the function foo with arguments compared with the given flavors
|
|
|
•
|
The square brackets [ and ] are used to check for a fixed argument sequence. For example, the flavor describes a list that contains an integer and a rational number.
|
•
|
The flavor describes the object itself.
|
•
|
The flavor generates a string of length .
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
|
|
Download Help Document
Was this information helpful?