• Home
  • Search
  • A decision procedure for common Lisp'sSUBTYPEP predicate
  • Cite Icon9
  • https://doi.org/10.1007/bf01807504Copy DOI Icon

A decision procedure for common Lisp'sSUBTYPEP predicate

Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

Common Lisp [25],[26] includes a dynamic datatype system of moderate complexity, as well as predicates for checking the types of language objects. Additionally, an interesting predicate of two “type specifiers”—SUBTYPEP—is included in the language. Thissubtypep predicate provides a mechanism with which to query the Common Lisp type system regarding containment relations among the various built-in and user-defined types. Whilesubtypep is rarely needed by an applications programmer, the efficiency of a Common Lisp implementation can depend critically upon the quality of itssubtypep predicate: the run-time system typically calls uponsubtypep to decide what sort of representations to use when making arrays; the compiler calls uponsubtypep to interpret userdeclarations, on which efficient data representation and code generation decisions are based. As might be expected due to the complexity of the Common Lisp type system, there may be type containment questions which cannot be decided. In these casessubtypep is expected to return “can't determine”, in order to avoid giving an incorrect answer. Unfortunately, most Common Lisp implementations have abused this license by answering “can't determine” in all but the most trivial cases.In particular, most Common Lisp implementations of SUBTYPEP fail on the basic axioms of the Common Lisp type system itself [25][26]. This situation is particularly embarrassing for Lisp-the premier “symbol processing language”—in which the implementation of complex symbolic logical operations should be relatively easy. Sincesubtypep was presumably included in Common Lisp to answer thehard cases of type containment, this “lazy evaluation” limits the usefulness of an important language feature. This paper shows how those type containment relations of Common Lisp which can be decided at all, can be decided simply and quickly by a decision procedure which can dramatically reduce the number of occurrences of the “can't determine” answer fromsubtypep. This decision procedure doesnot require the conversion of a type specifier expression to conjunctive or disjunctive normal form, and therefore does not incur the exponential explosion in space and time that such a conversion would entail. The lattice mechanism described here for decidingsubtypep is also ideal for performingtype inference [2]; the particular implementation developed here, however, is specific to the type system of Common Lisp [4]. Categories and Subject Descriptors: Lisp, dynamic typing, compiler optimization, type inference, decision procedure.

Similar Papers
  • Research Article
  • Citations14

CLOStrophobia: its etiology and treatment

  • Oct 01, 1991
  • ACM SIGPLAN OOPS Messenger
  • Henry G Baker
  • Research Article
  • Citations2

UCL+P—Defining and Implementing Persistent Common Lisp

  • Jan 01, 1997
  • LISP and Symbolic Computation
  • J H Jacobs +1
  • Book Chapter
  • Citations2

Structs and Interfaces

  • Jan 01, 2016
  • Shiju Varghese
  • PDF
  • Research Article
  • Citations34

A Bi-Directional Refinement Algorithm for the Calculus of (Co)Inductive Constructions

  • Mar 02, 2012
  • Logical Methods in Computer Science
  • Andrea Asperti +3
  • Research Article
  • Citations141

Theoretical aspects of object-oriented programming: types, semantics, and language design

  • Mar 01, 1995
  • Choice Reviews Online
  • Carl A Gunter +1
  • Research Article
  • Citations114

Complexity, convexity and combinations of theories

  • Nov 01, 1980
  • Theoretical Computer Science
  • Derek C Oppen
  • Conference Instance
  • Citations2

Proceedings of the 2002 workshop on Memory system performance

  • Jun 16, 2002
  • Book Chapter
  • Citations2

The Development of Interval Data Type for Analytical Information Processing

  • Jul 11, 2020
  • A K Pogodaev +3
  • Research Article
  • Citations21

Persistence and probabilistic projection

  • Jan 01, 1989
  • IEEE Transactions on Systems, Man, and Cybernetics
  • T Dean +1
  • Research Article
  • Citations8

Shadow-object interface between Fortran 95 and C++

  • Jan 01, 1999
  • Computing in Science & Engineering
  • M.G Gray +2
  • Conference Article
  • Citations30

R melts brains: an IR for first-class environments and lazy effectful arguments

  • Oct 20, 2019
  • Olivier Flückiger +5
  • Conference Article
  • Citations4

DelayRepay: delayed execution for kernel fusion in Python

  • Nov 15, 2020
  • John Magnus Morton +7
  • Conference Article
  • Citations96

Representation independence and data abstraction

  • Jan 01, 1986
  • John C Mitchell
  • Research Article
  • Citations2

Axioms as generic rewrite rules in C++ with concepts

  • Jun 01, 2014
  • Science of Computer Programming
  • Xiaolong Tang +1
  • Research Article
  • Citations1

A common-LISP implementation of an extended Prolog system

  • Apr 01, 1988
  • ACM SIGPLAN Notices
  • Giuseppe Cattaneo +1
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.