Results 1 
4 of
4
Equal Rights for Functional Objects or, The More Things Change, The More They Are the Same
, 1993
"... DATA TYPES A. Comparing Type Objects There has been as much confusion over type identity as there has been over object identity, although the type identity problem is usually referred to as the type equivalence problem [Aho86,s.6.3] [Wegbreit74] [Welsh77]. The type identity problem is to determine ..."
Abstract

Cited by 24 (7 self)
 Add to MetaCart
DATA TYPES A. Comparing Type Objects There has been as much confusion over type identity as there has been over object identity, although the type identity problem is usually referred to as the type equivalence problem [Aho86,s.6.3] [Wegbreit74] [Welsh77]. The type identity problem is to determine when two types are equal, so that type checking can be done in a programming language. 22 Algol68 takes the point of view of "structural" equivalence, in which nonrecursive types that are built up from primitive types using the same type constructors in the same order should compare equal, while Ada takes the point of view of "name" equivalence, in which types are equivalent if and only if they have the same name. We will ignore the software engineering issues of which kind of type equivalence makes for betterengineered programs, and focus on the basic issue of type equivalence itself. We note that if a type system offers the type TYPEi.e., it offers firstclass representations of typ...
CONS Should not CONS its Arguments, or, a Lazy Alloc is a Smart Alloc
 ACM Sigplan Not
, 1992
"... Lazy allocation is a model for allocating objects on the execution stack of a highlevel language which does not create dangling references. Our model provides safe transportation into the heap for objects that may survive the deallocation of the surrounding stack frame. Space for objects that do no ..."
Abstract

Cited by 15 (11 self)
 Add to MetaCart
Lazy allocation is a model for allocating objects on the execution stack of a highlevel language which does not create dangling references. Our model provides safe transportation into the heap for objects that may survive the deallocation of the surrounding stack frame. Space for objects that do not survive the deallocation of the surrounding stack frame is reclaimed without additional effort when the stack is popped. Lazy allocation thus performs a firstlevel garbage collection, and if the language supports garbage collection of the heap, then our model can reduce the amortized cost of allocation in such a heap by filtering out the shortlived objects that can be more efficiently managed in LIFO order. A runtime mechanism called result expectation further filters out unneeded results from functions called only for their effects. In a sharedmemory multiprocessor environment, this filtering reduces contention for the allocation and management of global memory. Our model performs s...
ACM Sigplan Notices 27,1 (Jan. 1992),9598. COMPUTING A*B (MOD N)
"... Let W be the word size of the ANSI C "long integer " implementation. Then W1 is the largest unsigned long integer, and W/21 is the largest signed long integer. Since we assume that N is a positive (but signed) integer, 0<N<W/2. Let A,B be nonnegative integers such that 0≤A, ..."
Abstract
 Add to MetaCart
Let W be the word size of the ANSI C &quot;long integer &quot; implementation. Then W1 is the largest unsigned long integer, and W/21 is the largest signed long integer. Since we assume that N is a positive (but signed) integer, 0<N<W/2. Let A,B be nonnegative integers such that 0≤A,B<N. Let P=A*B; i.e., P requires double precision, and can be as large as W 2 /42W+4. Let R=mod(P,N)=mod(A*B,N). In other words, there exists an integer Q such that R=PQ*N=A*BQ*N, and 0≤R<N. If we could calculate Q, then we could calculate R using two double precision multiplies and a double precision subtract; i.e., R=A*BQ*N. However, since 0≤R<N<W/2<W, we can more efficiently calculate R using singleprecision ANSI C unsigned (modular) arithmetic. In other words, R=mod(R,W)=mod(A*BQ*N,W)=mod(mod(A*B,W)mod(Q*N,W),W), which follows from the fact that x>mod(x,W) is a ring homomorphism. This calculation requires only 2 singleprecision unsigned multiplies and 1 singleprecision unsigned subtraction. Unfortunately, calculating Q precisely requires that we calculate Q=floor(P/N) precisely, and since P=A*B is double precision, a precise Q needs 1 doubleprecision multiply and 1 doubleprecision quotient. In this case, we would do better by simply using a brute force doubleprecision Euclidean
Computing A*B (mod N) Efficiently in ANSI C
, 1992
"... INTRODUCTION Many exact integer computations, rather than being performed using multipleprecision arithmetic, are performed instead over a number of singleprecision modular rings or fields, with the results being then combined using the Chinese Remainder Theorem [Moses71] [Knuth81] [Gregory84] [S ..."
Abstract
 Add to MetaCart
INTRODUCTION Many exact integer computations, rather than being performed using multipleprecision arithmetic, are performed instead over a number of singleprecision modular rings or fields, with the results being then combined using the Chinese Remainder Theorem [Moses71] [Knuth81] [Gregory84] [Schroeder86]. Organizing the computation in this way avoids many multipleprecision arithmetic operations and the storage management overheads that these operations entail. Unfortunately, unless the hardware architecture and computer language offers doubleprecision multiplication and doubleprecision Euclidean divisionwithremainder operations, the cost of simulating these doubleprecision operations can eliminate any savings from the modular approach. In order to profit from modular techniques, therefore, one must either restrict the program to use only halfprecision integer operations (e.g., 15 bits), or seek another way to avoid doubleprecision operations. The popularity of ANSI