Fully static dimensional analysis with C++

Fully static dimensional analysis with C++
复制标题

使用 C 进行完全静态尺寸分析

DOI:
10.1145/185009.185036
复制
发表时间:
1994
影响因子:
--
通讯作者:
Zerksis D. Umrigar
Zerksis D. Umrigar
中科院分区:
--
文献类型:
--
作者:
Zerksis D. Umrigar

文献摘要

被引文献

相似文献

尺寸分析被涉及到物理科学中D的人广泛使用,以快速检查公式的尺寸理智。可以通过自动执行类似的检查来预防许多编程错误s。以前对计算机程序进行的Dimensiona L分析的尝试要么需要SOM E运行时开销[CG88] [HI188],要么需要修改现有的编程语言,以添加这样的功能[GEH77] [HOU83]。本文介绍了现有语言C ++ [str9l] ca n如何用于编写程序,这些程序可以保证在运行时在尺寸上正确。不幸的是,该方法取决于违反语言定义的语言。本文认为,禁止构造的规则可以从语言定义中移动,或者是由MOS T编译器允许使用Bidden构造作为扩展。实际上,流行的C ++编译器确实接受了此结构。该编译器用于实施一般软件包以进行维度分析。包装的功能通过示例简要说明。最终,该方法应该具有可忽略的运行时间成本。
Dimensional analysis is widely used by those involve d in the physical sciences as a quick check on the dimen sional sanity of formulas . Many programming error s can be prevented by performing similar checks automatically . Previous attempts at such dimensiona l analysis of computer programs either entailed som e run-time overhead [CG88] [Hi188], or required th e modification of an existing programming language t o add such a capability [Geh77] [Hou83] . This paper describes how an existing language C++ [Str9l] ca n be used to write programs which can be guaranteed to be dimensionally correct before run-time. Unfortunately, the method depends on a language construc t which violates the language definition . The paper argues that the rule forbidding the construct be re moved from the language definition, or that the for bidden construct be allowed as an extension by mos t compilers . In fact, a popular C++ compiler does accept this construct . This compiler was used to implement a general package for dimensional analysis . The capabilities of the package are briefly illustrated by means of an example . Ultimately, the method should have negligible run-time costs .