In scientific and engineering applications, physical quantities embodied as units of measurement (UoM) are frequently used. The loss of the Mars climate orbiter, attributed to a confusion between the metric and imperial unit systems, popularised the disastrous consequences of incorrectly handling measurement values. Dimensional analysis can be used to ensure expressions containing annotated values are evaluated correctly. This has led to the development of a large number of libraries, languages and validators to ensure developers can specify and verify UoM information in their designs and codes. Many tools can also automatically convert values between commensurable UoM, such as yards and metres. However these systems do not differentiate between quantities and dimensions. For instance torque and work, which share the same UoM, can not be interchanged because they do not represent the same entity. We present a named quantity layer that complements dimensional analysis by ensuring that values of different quantities are safely managed. Our technique is a mixture of analysis and discipline, where expressions involving multiplications are relegated to functions, in order to ensure that named quantities are handled soundly.
翻译:在科学和工程应用中,经常使用作为测量单位(UOM)的物理数量。火星气候轨道器的丢失是由于公制和帝国单位系统之间的混淆造成的,它普及了错误处理测量值的灾难性后果。多面分析可用于确保正确评价含有附加说明值的表达式。这导致大量图书馆、语言和验证器的开发,以确保开发商能够在其设计和代码中指定和核实UOM信息。许多工具还可以自动转换可相互交换的UOM(如机场和米)之间的数值。但是这些系统并不区分数量和尺寸。例如,共享相同的UOM(UoM)的透镜和工作无法互换,因为它们不代表同一个实体。我们提出了一个命名的量层,通过确保安全管理不同数量值来补充量的量分析。我们的技术是一种分析和纪律的混合体系,其中涉及倍增的表达式被降为功能,以确保所指定的数量得到妥善处理。