## `property::hasprop` -- does an object have properties?

#### Introduction

`property::hasprop(`object`)` tests, whether an object has properties.

#### Call(s)

`property::hasprop(object)`
`property::hasprop()`

#### Parameters

`object` | - | any MuPAD object

#### Returns

`TRUE` or `FALSE`

#### Related Functions

`assume`, `getprop`, `is`, `indets`, `unassume`

#### Details

- `property::hasprop(`object`)` tests, whether the object has properties and returns `TRUE` if the object or any subexpression has a property, otherwise `FALSE`.
- `property::hasprop` always returns `TRUE` if the global property is defined.
- Compared with `getprop`, `property::hasprop` is a fast function and can be used to determine, whether an object has properties without using the slower functions `getprop` or `is`.

- In some cases, the function `is` can derive some aspects without any defined property (see example 3)!

#### Example 1

Does the expression `2*(x+1)` have any properties?

    >> property::hasprop(2*(x + 1))

                                       FALSE

    >> assume(x > 0):
       property::hasprop(2*(x + 1))

                                       TRUE

    >> getprop(2*(x + 1))

                                        > 2

    >> delete x:

#### Example 2

Is the global property defined?

    >> property::hasprop()

                                       FALSE

If the global property is defined, `property::hasprop` returns always `TRUE`:

    >> assume(Type::Real):
       property::hasprop(2*(x + 1)), property::hasprop()

                                    TRUE, TRUE

    >> property::hasprop(sin(2*x^sqrt(2)) + cos(2*x)^sqrt(2))

                                       TRUE

    >> unassume():

#### Example 3

`property::hasprop` returns `FALSE`, but `is` can determine an answer unequal to `UNKNOWN`:

    >> property::hasprop(a + 1 > a)

                                       FALSE

    >> is(a + 1 > a)

                                       TRUE

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000