Results 1  10
of
25
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 50 (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 42 (0 self)
 Add to MetaCart
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.
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
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 ...
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 11 (0 self)
 Add to MetaCart
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 Rewriting Techniques and Applications (RTA’03), volume 2706 of LNCS
, 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 10 (2 self)
 Add to MetaCart
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 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. 1
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.
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 5 (0 self)
 Add to MetaCart
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
Annotationless Unit Type Inference for C
 Final Project, 6.883: Program Analysis, CSAIL, MIT
, 2005
"... Types in programming languages are crucial for catching errors at compiletime. Similarly, in scientific applications, the units system forms a type discipline because a correct equation must necessarily include terms with units that are equivalent on both sides. Many scientific and numericallyorie ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Types in programming languages are crucial for catching errors at compiletime. Similarly, in scientific applications, the units system forms a type discipline because a correct equation must necessarily include terms with units that are equivalent on both sides. Many scientific and numericallyoriented programs are written in C, but the language provides no support for attaching units to variables. Thus, programmers
Language Support for Program Generation: Reasoning, Implementation, and Applications
, 2001
"... ..."
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 2 (1 self)
 Add to MetaCart
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.