Results 1  10
of
31
Adding Apples and Oranges
 In 4th Int. Symp. on Practical Aspects of Declarative Languages, LNCS 2257
, 2002
"... We define a unit system for enduser spreadsheets that is based on the concrete notion of units instead of the abstract concept of types. Units are derived from header information given by spreadsheets. ..."
Abstract

Cited by 52 (23 self)
 Add to MetaCart
We define a unit system for enduser spreadsheets that is based on the concrete notion of units instead of the abstract concept of types. Units are derived from header information given by spreadsheets.
Encoding types in MLlike languages
, 1998
"... A HindleyMilner type system such as ML's seems to prohibit typeindexed values, i.e., functions that map a family of types to a family of values. Such functions generally perform case analysis on the input types and return values of possibly different types. The goal of our work is to demonstr ..."
Abstract

Cited by 43 (0 self)
 Add to MetaCart
(Show Context)
A HindleyMilner type system such as ML's seems to prohibit typeindexed values, i.e., functions that map a family of types to a family of values. Such functions generally perform case analysis on the input types and return values of possibly different types. The goal of our work is to demonstrate how to program with typeindexed values within a HindleyMilner type system. Our first approach is to interpret an input type as its corresponding value, recursively. This solution is typesafe, in the sense that the ML type system statically prevents any mismatch between the input type and function arguments that depend on this type. Such specific type interpretations, however, prevent us from combining different typeindexed values that share the same type. To meet this objection, we focus on finding a valueindependent type encoding that can be shared by different functions. We propose and compare two solutions. One requires firstclass and higherorder polymorphism, and, thus, is not implementable in the core language of ML, but it can be programmed using higherorder functors in Standard ML of New Jersey. Its usage, however, is clumsy. The other approach uses embedding/projection functions. It appears to be more practical. We demonstrate the usefulness of typeindexed values through examples including typedirected partial evaluation, C printflike formatting, and subtype coercions. Finally, we discuss the tradeoffs between our approach and some other solutions based on more expressive typing disciplines.
Certifying Measurement Unit Safety Policy
 In Proceedings of the ASE'03
, 2003
"... Measurement unit safety policy checking is a topic in software analysis concerned with ensuring that programs do not violate basic principles of units of measurement. Such violations can hide significant domainspecific errors which are hard or impossible to find otherwise. Measurement unit analysi ..."
Abstract

Cited by 16 (5 self)
 Add to MetaCart
(Show Context)
Measurement unit safety policy checking is a topic in software analysis concerned with ensuring that programs do not violate basic principles of units of measurement. Such violations can hide significant domainspecific errors which are hard or impossible to find otherwise. Measurement unit analysis by means of automatic deduction is addressed in this paper. We draw general design principles for measurement unit certification tools and discuss our prototype for the C language, which includes both dynamic and static checkers. Our approach is based on assume/assert annotations of code, which are properly interpreted by our deductionbased tools and ignored by standard compilers. We do not modify the language in order to support units. The approach can be extended to incorporate other safety policies without great efforts. 1
Objectoriented units of measurement
 ACM SIGPLAN International Conference on ObjectOriented Programming, Systems, Languages, and Applications. ACM
, 2004
"... Programs that manipulate physical quantities typically represent these quantities as raw numbers corresponding to the quantities ’ measurements in particular units (e.g., a length represented as a number of meters). This approach eliminates the possibility of catching errors resulting from adding or ..."
Abstract

Cited by 15 (0 self)
 Add to MetaCart
(Show Context)
Programs that manipulate physical quantities typically represent these quantities as raw numbers corresponding to the quantities ’ measurements in particular units (e.g., a length represented as a number of meters). This approach eliminates the possibility of catching errors resulting from adding or comparing quantities expressed in different units (as in the Mars Climate Orbiter error [11]), and does not support the safe comparison and addition of quantities of the same dimension. We show how to formulate dimensions and units as classes in a nominally typed objectoriented language through the use of statically typed metaclasses. Our formulation allows both parametric and inheritance polymorphism with respect to both dimension and unit types. It also allows for integration of encapsulated measurement systems, dynamic conversion factors, declarations of scales (including nonlinear scales) with defined zeros, and nonconstant exponents on dimension types. We also show how to encapsulate most of the “magic machinery ” that handles the algebraic nature of dimensions and units in a single metaclass that allows us to treat select static types as generators of a free abelian group.
Rulebased analysis of dimensional safety
 In Proceeding so the 14th International Conference on Rewriting Techniques and Applications RTA03
, 2003
"... Abstract. Dimensional safety policy checking is an old topic in software analysis concerned with ensuring that programs do not violate basic principles of units of measurement. Scientific and/or navigation software is routinely dimensional and violations of measurement unit safety policies can hide ..."
Abstract

Cited by 14 (4 self)
 Add to MetaCart
(Show Context)
Abstract. Dimensional safety policy checking is an old topic in software analysis concerned with ensuring that programs do not violate basic principles of units of measurement. Scientific and/or navigation software is routinely dimensional and violations of measurement unit safety policies can hide significant domainspecific errors which are hard or impossible to find otherwise. Dimensional analysis of programs written in conventional programming languages is addressed in this paper. We draw general design principles for dimensional analysis tools and then discuss our prototypes, implemented by rewriting, which include both dynamic and static checkers. Our approach is based on assume/assert annotations of code which are properly interpreted by our tools and ignored by standard programming language compilers/interpreters. The output of our prototypes consists of warnings that list those expressions violating the unit safety policy. These prototypes are implemented in the rewriting system Maude, using more than 2,000 rewriting rules. This paper presents a nontrivial application of rewriting techniques to software analysis. 1
A Simple Proof Technique for Certain Parametricity Results
 In 4th ACM International Conference on Functional Programming
, 1998
"... Many properties of parametric, polymorphic functions can be determined simply by inspection of their types. Such results are usually proven using Reynolds's parametricity theorem. However, Reynolds's theorem can be difficult to show in some settings, particularly ones involving computation ..."
Abstract

Cited by 13 (2 self)
 Add to MetaCart
(Show Context)
Many properties of parametric, polymorphic functions can be determined simply by inspection of their types. Such results are usually proven using Reynolds's parametricity theorem. However, Reynolds's theorem can be difficult to show in some settings, particularly ones involving computational effects. I present an alternative technique for proving some parametricity results. This technique is considerably simpler and easily generalizes to effectful settings. It works by instantiating polymorphic functions with singleton types that fully specify the behavior of the functions. Using this technique, I show that callers' stacks are protected from corruption during function calls in Typed Assembly Language programs. 1 Introduction A polymorphic function can be termed parametric [11] if it always uses the same algorithm, regardless of the type at which it is applied. In particular, a parametric, polymorphic function can neither branch on nor otherwise analyze its type argument. In many type ...
Virtual Values for Language Extension
"... This paper focuses on extensibility, the ability of a programmer using a particular language to extend the expressiveness of that language. This paper explores how to provide an interesting notion of extensibility by virtualizing the interface between code and data. A virtual value is a special valu ..."
Abstract

Cited by 11 (1 self)
 Add to MetaCart
(Show Context)
This paper focuses on extensibility, the ability of a programmer using a particular language to extend the expressiveness of that language. This paper explores how to provide an interesting notion of extensibility by virtualizing the interface between code and data. A virtual value is a special value that supports behavioral intercession. When a primitive operation is applied to a virtual value, it invokes a trap on that virtual value. A virtual value contains multiple traps, each of which is a userdefined function that describes how that operation should behave on that value. This paper formalizes the semantics of virtual values, and shows how they enable the definition of a variety of language extensions, including additional numeric types; delayed evaluation; taint tracking; contracts; revokable membranes; and units of measure. We report on our experience implementing virtual values for Javascript within an extension for the Firefox browser. D.3.1 [Formal Defini
Visually Customizing Inference Rules About Apples and Oranges
, 2002
"... We have been working on a unit system for enduser spreadsheets that is based on the concrete notion of units instead of the abstract concept of types. In previous work, we defined such a system formally. In this paper, we describe a visual system to support the formal reasoning in two ways. First, ..."
Abstract

Cited by 8 (5 self)
 Add to MetaCart
We have been working on a unit system for enduser spreadsheets that is based on the concrete notion of units instead of the abstract concept of types. In previous work, we defined such a system formally. In this paper, we describe a visual system to support the formal reasoning in two ways. First, it supports communicating and explaining the unit inference process to users. Second and more important, our approach allows users to change the system's reasoning by adding and customizing the system's inference rules.
Types for UnitsofMeasure: Theory and Practice
"... Unitsofmeasure are to science what types are to programming. In science and engineering, dimensional and unit consistency provides a first check on the correctness of an equation or formula, just as in programming the validation of a program by the typechecker eliminates one possible reason for f ..."
Abstract

Cited by 7 (1 self)
 Add to MetaCart
(Show Context)
Unitsofmeasure are to science what types are to programming. In science and engineering, dimensional and unit consistency provides a first check on the correctness of an equation or formula, just as in programming the validation of a program by the typechecker eliminates one possible reason for failure.
A rewriting logic approach to static checking of units of measurement in C
 In 9th International Workshop on RuleBased Programming (RULE’08), volume To Appear of Electronic
"... Many C programs assume the use of implicit domainspecific information. A common example is units of measurement, where values can have both a standard C type and an associated unit. However, since there is no way in the C language to represent this additional information, violations of domainspeci ..."
Abstract

Cited by 6 (4 self)
 Add to MetaCart
(Show Context)
Many C programs assume the use of implicit domainspecific information. A common example is units of measurement, where values can have both a standard C type and an associated unit. However, since there is no way in the C language to represent this additional information, violations of domainspecific policies, such as unit safety violations, can be difficult to detect. In this paper we present a static analysis, based on the use of an abstract C semantics defined using rewriting logic, for the detection of unit violations in C programs. In contrast to typed approaches, the analysis makes use of annotations present in C comments on function headers and in function bodies, leaving the C language unchanged. Initial evaluation results show that performance scales well, and that errors can be detected without imposing a heavy annotation burden.