## Two algorithms in search of a type-system (710)

### BibTeX

@MISC{Danner710twoalgorithms,

author = {Norman Danner and James and S. Royer},

title = {Two algorithms in search of a type-system},

year = {710}

}

### OpenURL

### Abstract

Abstract. The authors ’ ATR programming formalism is a version of call-by-value PCF under a complexity-theoretically motivated type system. ATR programs run in type-2 polynomial-time and all standard type-2 basic feasible functionals are ATR-definable (ATR types are confined to levels 0, 1, and 2). A limitation of the original version of ATR is that the only directly expressible recursions are tail-recursions. Here we extend ATR so that a broad range of affine recursions are directly expressible. In particular, the revised ATR can fairly naturally express the classic insertion- and selection-sort algorithms, thus overcoming a sticking point of most prior implicit-complexity-based formalisms. The paper’s main work is in refining the original time-complexity semantics for ATR to show that these new recursion schemes do not lead out of the realm of feasibility. 1.

### Citations

711 | Types and Programming Languages - Pierce - 2002 |

607 |
The Definition of Standard ML (Revised
- Harper, Milner, et al.
- 1997
(Show Context)
Citation Context ...straint is violated. As (Shift) provides a kind of limited polymorphism, this restriction is similar to the restriction in ML that polymorphism is disabled in recursive definitions (see Milner et al. =-=[19]-=- and Pierce [20, Page 338]). (2) ATS restricted (d-I) and (ta-I) to computational types. There was no real need for this, as these term constructors represent operations that are not size-increasing. ... |

193 | Programming parallel algorithms
- BLELLOCH
- 1996
(Show Context)
Citation Context ... and deal with the problems noted above. Here is a reworked version of quick-sort using a possible such combinator, inspired by Blelloch and colleagues’ work on the parallel programming language NESL =-=[5, 4]-=-:TWO ALGORITHMS IN SEARCH OF A TYPE-SYSTEM 27 val quicksort = fn xs ⇒ letrec qsort = fn ys ⇒ if (length ys) ≤ 1 then ys else let val (zs, part idx) = partition ys in concat (map ′ qsort zs [part idx ... |

179 | A new recursion-theoretic characterization of the polytime functions
- Bellantoni, Cook
- 1992
(Show Context)
Citation Context ... capture many natural algorithms—usually because the complexity-theoretic types used to control primitive recursion impose draconian restrictions on programming. For example, in Bellantoni and Cook’s =-=[3]-=- and Leivant’s [17] well-known characterizations of the polynomial-time computable functions, a value that is the result of a recursive call cannot itself be used to drive a recursion. But, for instan... |

178 | Implementation of a portable nested data-parallel language
- Blelloch, Hardwick, et al.
- 1994
(Show Context)
Citation Context ... and deal with the problems noted above. Here is a reworked version of quick-sort using a possible such combinator, inspired by Blelloch and colleagues’ work on the parallel programming language NESL =-=[5, 4]-=-:TWO ALGORITHMS IN SEARCH OF A TYPE-SYSTEM 27 val quicksort = fn xs ⇒ letrec qsort = fn ys ⇒ if (length ys) ≤ 1 then ys else let val (zs, part idx) = partition ys in concat (map ′ qsort zs [part idx ... |

89 |
Dual intuitionistic linear logic
- Barber, Plotkin
- 1997
(Show Context)
Citation Context ... recursion. In Section 3 we present several sample ATR programs. The typing rules are given in Figure 2. Type contexts are split into intuitionistic and affine zones as with Barber and Plotkin’s DILL =-=[2]-=-. When we write ∆0 ∪ ∆1 we implicitly assume that the environments are consistent (i.e., assign the same type to variables in Dom ∆0 ∩Dom ∆1) and when we write ∆0,∆1 we implicitly assume that the envi... |

87 | Functional interpretations of feasibly constructive arithmetic
- Cook, Urquhart
- 1993
(Show Context)
Citation Context ...as a (second-order) polynomial run-time. 2 Finally, we show that the type-2 basic feasible functionals (an extension of polynomial-time computability to type-2) of Mehlhorn [18] and Cook and Urquhart =-=[7]-=- are ATR definable. However, the version of ATR defined in ATS is still somewhat limited as its only base type is binary words and the only recursions allowed are tail-recursions. 1.2. What is new in ... |

79 | S.: Data parallel haskell: a status report
- Chakravarty, Leshchinskiy, et al.
- 2007
(Show Context)
Citation Context ... work one could do a straightforward static analysis of ATR + map ′ -programs to extract bounds on their parallel time complexity. This would fit in very nicely with recent work of Chakravarty et al. =-=[6]-=- on data-parallel Haskell. Lazy ATR. A version of ATR with lazy evaluation would be very interesting, regardless of whether the constructors are strict or lazy (yielding streams). There are many techn... |

70 | Linear types and non-size-increasing polynomial time computation
- Hofmann
(Show Context)
Citation Context ...ion clause of insertion-sort has the form ins sort(cons(a,l)) = insert(a,ins sort(l)), where insert is defined by recursion on its second argument; selection-sort presents analogous problems. Hofmann =-=[12, 11]-=- addresses this problem by noting that the output of a non-size-increasing program (such as ins sort) can be safely used to drive another recursion, as it cannot cause the sort of complexity blow-up t... |

57 |
Ramified recurrence and computational complexity I: Word recurrence and poly-time
- Leivant
- 1994
(Show Context)
Citation Context ...ral algorithms—usually because the complexity-theoretic types used to control primitive recursion impose draconian restrictions on programming. For example, in Bellantoni and Cook’s [3] and Leivant’s =-=[17]-=- well-known characterizations of the polynomial-time computable functions, a value that is the result of a recursive call cannot itself be used to drive a recursion. But, for instance, the recursion c... |

52 |
Computational complexity of real functions
- Ko, Friedman
- 1982
(Show Context)
Citation Context ...al-number algorithms. ATR is a type-2 language, but here we have focused on type-1 algorithms. We are interested in type-2 algorithms, specifically in real-number algorithms as discussed in, e.g., Ko =-=[16]-=-, where real numbers are represented by type-1 oracles. This can be done in either a callby-value setting in which algorithms take a string of length n as input and return something like an n-bit appr... |

36 | A new characterization of type-2 feasibility
- Kapron, Cook
- 1996
(Show Context)
Citation Context ...: τ, ‖t‖ is tail(‖τ‖)-safe w.r.t. ‖Γ;∆‖ and t ⊑ ‖t‖. 6. Second-order polynomial bounds Our last goal is to connect time-complexity polynomials to the usual second-order polynomials of Kapron and Cook =-=[15]-=- and show that any ATR program is computable in type-2 polynomial time. The polynomial here will be in the lengths of the program’s arguments, and hence we need a semantics of lengths, which lives ins... |

30 |
Polynomial and abstract subrecursive classes
- Mehlhorn
- 1976
(Show Context)
Citation Context ...t each type-2 ATR program has a (second-order) polynomial run-time. 2 Finally, we show that the type-2 basic feasible functionals (an extension of polynomial-time computability to type-2) of Mehlhorn =-=[18]-=- and Cook and Urquhart [7] are ATR definable. However, the version of ATR defined in ATS is still somewhat limited as its only base type is binary words and the only recursions allowed are tail-recurs... |

24 | The expressive power of higher-order types or, life without cons
- Jones
- 2001
(Show Context)
Citation Context ...rent work. (5) ATS did not allow affine variables in the argument of (→-E). This is another non-trivial improvement of the current work. 2.2. Operational semantics. Motivated by the approach of Jones =-=[14]-=-, we define the cost of computing a program to be the cost of a call-by-value evaluation derivation. 5 The evaluation relation ↓ relates closures to values, which are inductively defined as follows: 6... |

19 |
types and non-size-increasing polynomial time computation
- Linear
- 1999
(Show Context)
Citation Context ...ion clause of insertion-sort has the form ins sort(cons(a,l)) = insert(a,ins sort(l)), where insert is defined by recursion on its second argument; selection-sort presents analogous problems. Hofmann =-=[12, 11]-=- addresses this problem by noting that the output of a non-size-increasing program (such as ins sort) can be safely used to drive another recursion, as it cannot cause the sort of complexity blow-up t... |

11 | H.: A syntactical analysis of non-size-increasing polynomial time computation
- Aehlig, Schwichtenberg
- 2000
(Show Context)
Citation Context ...se. Through this scheme Hofmann is able to implement many natural algorithms while still ensuring that any typable program is non-size-increasing polynomial-time computable (Aehlig and Schwichtenberg =-=[1]-=- sketch an extension that captures all of polynomial-time). Our earlier paper [8, 9], hereafter referred to as ATS, takes a different approach to constructing a usable programming language with guaran... |

11 | The strength of non-size increasing computation
- Hofmann
- 2002
(Show Context)
Citation Context ...me-complexity semantics for ATR to show that these new recursion schemes do not lead out of the realm of feasibility. 1. Introduction 1.1. Feasible programming and Affine Tiered Recursion. As Hofmann =-=[12]-=- has noted, a problem with implicit characterizations of complexity classes is that they often fail to capture many natural algorithms—usually because the complexity-theoretic types used to control pr... |

5 |
Recognition of polynomial-time programs
- Frederiksen, Jones
- 2004
(Show Context)
Citation Context ...r any type σ define tail(σ) by tail(b) = b and tail(σ → τ) = tail(τ). 2 These kinds of results may also have applications in the type of static analysis for time-complexity that Frederiksen and Jones =-=[10]-=- investigate. 3 We discuss quick-sort in Section 7.TWO ALGORITHMS IN SEARCH OF A TYPE-SYSTEM 3 K ::= {0,1} ∗ E ::= V | O | K | λV.E | EE | c0 E | c1 E | dE | t0 E | t1 E | if E then E else E | down E... |

3 | Adventures in time and space
- Danner, Royer
(Show Context)
Citation Context ...e still ensuring that any typable program is non-size-increasing polynomial-time computable (Aehlig and Schwichtenberg [1] sketch an extension that captures all of polynomial-time). Our earlier paper =-=[8, 9]-=-, hereafter referred to as ATS, takes a different approach to constructing a usable programming language with guaranteed resource usage. ATS introduces a type-2 programming formalism called ATR, for A... |

3 | Some applications of logic to feasibility in higher types
- Ignjatovic, Sharma
(Show Context)
Citation Context ...if it is computed by such an oracle Turing machine with oracle f in time p(|f|, |x|), where p is a second-order polynomial (this is the characterization of Kapron and Cook [15]; Ignjatovic and Sharma =-=[13]-=- give a similar characterization for unit-cost oracle queries). Now, ATR is not interpreted in the full type structure but rather in the well-tempered semantics discussed in Section 4.1. Thus, we have... |