# DeclareStatement

## `DeclareStatement`

A DeclareStatement declares a variable and initial value.

syntax: `check var name : type := expression;`

`type` or `expression` but not both may be omitted. An omitted type is deduced from the initial expression values.

`check` may be omitted when the expression type is necessarily conformant.

conformsTo `VariableStatement` , `ObservableStatement`

Attributes

`isCheck : Boolean[?]`

True if the initial expression’s type must be checked for conformance with the variable’s type. A non-conforming vlaue is a predicate failure causing the mapping to fail without doing anything. This is a derivation of not ownedInit.type.conformsTo(self.type).

Associations

`ownedExpression : OCLExpression[1]`

The expression computing the variable’s value.