Quantity and QuantityKind

A DEPS package called Universal.deps has been defined. It contains the most common Quantities and Quantity Kinds.

Data types

Data manipulated in DEPS can be:

  • integer or real values

  • integer intervals, real intervals, integer enumerated domains, or real enumerated domains.

QuantityKind

A QuantityKind carries a basic type (integer or real), a min limit, a max limit as well as the dimension in the sense of the dimensional analysis of the quantity. For example L is the dimension of a length, LT-2 is the dimension of an acceleration where M represents a mass, L a length and T a time. We can also define dimensionless Quantitykind as processor indexes or other. In this case, the dimensionless symbol u will be used. The negative and positive infinite values for the domain terminals are noted -maxreal and +maxreal for real and -maxint, +maxint for integers.

A QuantityKind is defined according to the following syntax:

<QuantityKind> ::=
               QuantityKind  <QuantityKindName>
               Type : real | integer ;
               Min  : <ConstantExpression> | -minreal | -minint ;
               Max  : <ConstantExpression> | +maxreal | +maxint ;
               Dim  : <DimensionalExpression> ;
               End

Quantity

A Quantity is defined from a QuantityKind. The QuantityKind carries the dimension, the Quantity carries the unit.

More precisely, a Quantity has:

  • A base quantity type (Kind). For example, Real, Integer, Length;

  • A Min (resp. Max) bound that represents the minimum (resp. maximum) value that can be taken by any constant or variable having the defined quantity as its type;

  • A Unit of the quantity.

A Quantity is defined according to the following syntax:

<Quantity> ::=
           Quantity <QuantityName>
           Kind : <QuantityKindName> ;
           Min  :  <ConstantExpression> | -minreal | -minint ;
           Max  : <ConstantExpression>  | +maxreal | +maxint ;
           Unit : <UnitValue> ;
           End

Note

The domain of a Quantity has to be included in the domain of its QuantityType.

Examples

Here is an extract of Universal.deps that defines a QuantityKind and a Quantity to manipulate a Pressure.

QuantityKind Pressure
Type : real ;
Min  : 0 ;
Max  : +maxreal ;
Dim  :  Lminus1MTminus2; (* L^-1.M.T^-2 *)
End

Quantity Pressure
Kind : Pressure ;
Min  : 0 ;
Max  : +maxreal ;
Unit : Pa ;
End