type/set - Maple Programming Help

type/set

check for a set

 Calling Sequence type(expr, set) type(expr, set(K))

Parameters

 expr - any expression K - type name

Description

 • In the first calling sequence, the type command checks if expr is a valid Maple set. It returns true if expr is a set and false otherwise.
 • See the set help page for a description of the set datatypes.
 • In the second calling sequence, where K is a specified type name, the type command checks whether expr is a set whose entries are of type K.  That is, type(expr, set(K)) returns true if type(expr, set) is true and type(x, K) is true for each entry x of expr.
 • See the type help page for a description of valid types in Maple.

Subtypes

 •

Supertypes

 •

Examples

 > $\mathrm{S1}≔\left\{1,\frac{3}{2},2\right\}$
 ${\mathrm{S1}}{≔}\left\{{1}{,}{2}{,}\frac{{3}}{{2}}\right\}$ (1)
 > $\mathrm{type}\left(\mathrm{S1},\mathrm{set}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{S1},\mathrm{set}\left(\mathrm{rational}\right)\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\mathrm{S1},\mathrm{set}\left(\mathrm{integer}\right)\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{S2}≔\left\{{x}^{4}-1,{x}^{2},x+3\right\}$
 ${\mathrm{S2}}{≔}\left\{{{x}}^{{2}}{,}{x}{+}{3}{,}{{x}}^{{4}}{-}{1}\right\}$ (5)
 > $\mathrm{type}\left(\mathrm{S2},\mathrm{set}\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{type}\left(\mathrm{S2},\mathrm{set}\left(\mathrm{polynom}\left(\mathrm{integer},x\right)\right)\right)$
 ${\mathrm{true}}$ (7)