Ada's derived types and units of measure

  title={Ada's derived types and units of measure},
  author={Narain H. Gehani},
  journal={Software: Practice and Experience},
  • N. Gehani
  • Published 1 June 1985
  • Computer Science
  • Software: Practice and Experience
Types in programming languages cannot model many properties of real world objects and quantities. Consequently, many errors resulting from the inconsistent usage of program objects representing real world objects and quantities cannot be detected automatically. For example, the real variables PRICE and WEIGHT, representing the price of diesel fuel and the weight of a person, may be inadvertently added, giving a non‐sensical value; such an error cannot be detected by a compiler. The programming… 
A model-driven approach to automatic conversion of physical units
An intuitive algorithm for performing automatic conversions between quantities measured in different units is developed, which both requires fewer conversion operations than current approaches and makes more sensible choices about which quantities to convert.
Programming languages and dimensions
This thesis investigates the extension of programming languages to support the notion of physical dimension by presenting a type system similar to that of the programming language ML but extended with polymorphic dimension types.
Pluggable Policies for C
A framework for pluggable policies for the C language with a shared rewrite-logic semantics of C designed for symbolic execution of C programs, and an annotation engine allowing for annotations across multiple policies to be added to C programs is presented.
A Rewriting Logic Approach to Static Checking of Units of Measurement in C
Precise inference of expressive units of measurement types
The experiments show that PUnits is an effective, sound, and scalable alternative to using encapsulation-based units APIs, enabling Java developers to reap the performance benefits of using primitive types instead of abstract data types for unit-wise consistent scientific computations.
Object-oriented units of measurement
This work shows how to formulate dimensions and units as classes as classes in a nominally typed object-oriented language through the use of statically typed metaclasses, which allows both parametric and inheritance poly-morphism with respect to both dimension and unit types.
An Ada package for dimensional analysis
This paper illustrates the use of Ada's abstraction facilities—notably, operator overloading and type parameterization—to define an oft-requested feature: a way to attribute units of measure to
Dimension Types
A strongly-typed programming language with a notion of dimension type which improves on previous proposals in that dimension types may be polymorphic and any expression which is typable in the system has a most general type, and an algorithm which infers this type automatically is described.
A Java Extension with Support for Dimensions
The original Java language specification defines a method signature that consists of the name of the method and the number and types of formal parameters to the method, and an extra requirement is now that the dimensions of the formal and actual parameters match.
Well-measuring programs
  • Phil Cook, C. Fidge
  • Computer Science
    Australian Software Engineering Conference (ASWEC'06)
  • 2006
A program analysis technique for inferring and checking the units used within a program is presented, which combines traditional Hindley-Milner-style type inference with the use of static single assignment form to enable analysis of imperative programs.


Units of Measure as a Data Attribute
Incorporation of units into programming languages
The issues of how a programming language might aid in keeping track of physical units (feet, sec, etc.) are discussed and a method is given for the introduction of relationships among units and subsequent automatic conversion based upon these relationships.
DoD-I: the summing up
After having worked a full month on EWD659 through EWD662-de.aling in turn with the four language proposals submitted to the DoD-I feel an urge to collect ~r,d order my impressions of the whole
Databases and Units of Measure
  • N. Gehani
  • Computer Science
    IEEE Transactions on Software Engineering
  • 1982
A serious impediment to the integrated use of databases across international boundaries, scientific disciplines and application areas is the use of different units of measure, e.g., miles or