The simplified-types Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The simplified-types Reference Manual

This is the simplified-types Reference Manual, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Apr 08 15:02:00 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

#+TITLE: Simplified Types

Common Lisp has powerful facilities for reasoning about types, including
logical connectives, numeric intervals, and predicates involving arbitrary
functions.  A downside of this expressiveness is that the manipulation of
type specifiers is an arduous and error-prone task.  This library provides
functions to simplify type specifiers.

The API consists of two functions:

- =simplify-type= takes a type specifier and, optionally, an environment,
  and returns the corresponding simplified type.

- =simplified-type-of= takes an object and returns the simplified type of
  that object.

The simplified type hierarchy has been chosen to strike a balance between
simplicity and expressiveness.  The following simplified type specifiers
exist:

- The symbols =t= and =nil=.

- The symbols =function=, =character=, =symbol=, and =cons=.

- The symbols =short-float=, =single-float=, =double-float=, and =long-float=.

- The compound type specifier =(integer  )=,
  where == are either an integer, or the
  symbol =*=.

- The compound type specifier =(complex )=, where
  == is one of the symbols =short-float=, =single-float=,
  =double-float=, or =long-float=.

A consequence of restricting all types this way is that the simplified type
lattice has only a single layer of disjoint types between =t= and =nil=.
That means that all types except =t= and =nil= are disjoint, that the join
of any of these disjoint types is =t=, and that the meet of any of these
disjoint types is =nil=.

Despite its simplicity, this set of types is expressive enough to help a
compiler generate fast code.  In particular, it covers all upgraded array
element types that are usually provided by an implementation.

The special variable =*precise-integer-types*= decides whether integer
types have a precise upper and lower limit, or whether the simplification
may also upgrade the bounds to the symbol =*=.  The advantage of the latter
approach is that type simplification will not cons.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 simplified-types

Author

Marco Heisig <marco.heisig@fau.de>

License

MIT

Description

Simplification of Common Lisp type specifiers.

Dependencies
Source

simplified-types.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 simplified-types.asd

Location

simplified-types.asd

Systems

simplified-types (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 simplified-types/packages.lisp

Parent

simplified-types (system)

Location

packages.lisp

Packages

simplified-types


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 simplified-types/simplified-types.lisp

Dependency

packages.lisp (file)

Parent

simplified-types (system)

Location

simplified-types.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 simplified-types/simplified-type-of.lisp

Dependency

simplified-types.lisp (file)

Parent

simplified-types (system)

Location

simplified-type-of.lisp

Exported Definitions
Internal Definitions

enable-if-class-exists (macro)


Previous: , Up: Lisp files   [Contents][Index]

3.1.5 simplified-types/simplify-type.lisp

Dependency

simplified-type-of.lisp (file)

Parent

simplified-types (system)

Location

simplify-type.lisp

Exported Definitions

simplify-type (function)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 simplified-types

Source

packages.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: simplify-type TYPE-SPECIFIER &optional ENVIRONMENT

Returns a simplified type specifier that is a supertype of TYPE-SPECIFIER.

In particular, for any type specifier TS, the expression
(subtypep TS (simplify-type TS)) will evaluate to either T T, or NIL NIL.

Package

simplified-types

Source

simplify-type.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Generic functions

Generic Function: simplified-type-of OBJECT

Returns a simplified type specifier for a type that has OBJECT as an element.

The expression (simplified-type-of OBJECT) yields exactly the same result as the expression (simplify-type (type-of OBJECT)), but the former is likely to be more efficient.

Package

simplified-types

Source

simplified-type-of.lisp (file)

Methods
Method: simplified-type-of (CONS cons)
Method: simplified-type-of (SYMBOL symbol)
Method: simplified-type-of (CHARACTER character)
Method: simplified-type-of (FUNCTION function)
Method: simplified-type-of (COMPLEX complex)
Method: simplified-type-of (DOUBLE-FLOAT double-float)
Method: simplified-type-of (SINGLE-FLOAT single-float)
Method: simplified-type-of (INTEGER integer)
Method: simplified-type-of OBJECT

Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Types

Type: simplified-complex-type-specifier ()
Package

simplified-types

Source

simplified-types.lisp (file)

Type: simplified-floating-point-type-specifier ()
Package

simplified-types

Source

simplified-types.lisp (file)

Type: simplified-integer-type-specifier ()
Package

simplified-types

Source

simplified-types.lisp (file)

Type: simplified-number-type-specifier ()
Package

simplified-types

Source

simplified-types.lisp (file)

Type: simplified-type-specifier ()
Package

simplified-types

Source

simplified-types.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +complex-double-float-type+
Package

simplified-types

Source

simplified-types.lisp (file)

Constant: +complex-long-float-type+
Package

simplified-types

Source

simplified-types.lisp (file)

Constant: +complex-short-float-type+
Package

simplified-types

Source

simplified-types.lisp (file)

Constant: +complex-single-float-type+
Package

simplified-types

Source

simplified-types.lisp (file)

Constant: +double-float-type+
Package

simplified-types

Source

simplified-types.lisp (file)

Constant: +long-float-type+
Package

simplified-types

Source

simplified-types.lisp (file)

Constant: +short-float-type+
Package

simplified-types

Source

simplified-types.lisp (file)

Constant: +single-float-type+
Package

simplified-types

Source

simplified-types.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Special variables

Special Variable: *precise-integer-types*

Whether the lower- and upper-limit of simplified integer type specifiers should be as accurate as possible, or whether it is permissible that one or both of them can be upgraded to a wider bound or the symbol *.

When the value of this variable is false, working with simplified types is guaranteed to be non-consing.

Package

simplified-types

Source

simplified-types.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Macros

Macro: define-complex-types ()
Package

simplified-types

Source

simplified-types.lisp (file)

Macro: define-floating-point-types ()
Package

simplified-types

Source

simplified-types.lisp (file)

Macro: enable-if-class-exists CLASS &body BODY
Package

simplified-types

Source

simplified-type-of.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Compiler macros

Compiler Macro: make-integer-type LOWER-LIMIT UPPER-LIMIT
Package

simplified-types

Source

simplified-types.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Functions

Function: make-integer-type LOWER-LIMIT UPPER-LIMIT
Package

simplified-types

Source

simplified-types.lisp (file)

Function: simplified-type-conjunction T1 T2
Package

simplified-types

Source

simplify-type.lisp (file)

Function: simplified-type-disjunction T1 T2
Package

simplified-types

Source

simplify-type.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, simplified-types.asd: The simplified-types<dot>asd file
File, Lisp, simplified-types/packages.lisp: The simplified-types/packages<dot>lisp file
File, Lisp, simplified-types/simplified-type-of.lisp: The simplified-types/simplified-type-of<dot>lisp file
File, Lisp, simplified-types/simplified-types.lisp: The simplified-types/simplified-types<dot>lisp file
File, Lisp, simplified-types/simplify-type.lisp: The simplified-types/simplify-type<dot>lisp file

L
Lisp File, simplified-types.asd: The simplified-types<dot>asd file
Lisp File, simplified-types/packages.lisp: The simplified-types/packages<dot>lisp file
Lisp File, simplified-types/simplified-type-of.lisp: The simplified-types/simplified-type-of<dot>lisp file
Lisp File, simplified-types/simplified-types.lisp: The simplified-types/simplified-types<dot>lisp file
Lisp File, simplified-types/simplify-type.lisp: The simplified-types/simplify-type<dot>lisp file

S
simplified-types.asd: The simplified-types<dot>asd file
simplified-types/packages.lisp: The simplified-types/packages<dot>lisp file
simplified-types/simplified-type-of.lisp: The simplified-types/simplified-type-of<dot>lisp file
simplified-types/simplified-types.lisp: The simplified-types/simplified-types<dot>lisp file
simplified-types/simplify-type.lisp: The simplified-types/simplify-type<dot>lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   D   E   F   G   M   S  
Index Entry  Section

C
Compiler Macro, make-integer-type: Internal compiler macros

D
define-complex-types: Internal macros
define-floating-point-types: Internal macros

E
enable-if-class-exists: Internal macros

F
Function, make-integer-type: Internal functions
Function, simplified-type-conjunction: Internal functions
Function, simplified-type-disjunction: Internal functions
Function, simplify-type: Exported functions

G
Generic Function, simplified-type-of: Exported generic functions

M
Macro, define-complex-types: Internal macros
Macro, define-floating-point-types: Internal macros
Macro, enable-if-class-exists: Internal macros
make-integer-type: Internal compiler macros
make-integer-type: Internal functions
Method, simplified-type-of: Exported generic functions
Method, simplified-type-of: Exported generic functions
Method, simplified-type-of: Exported generic functions
Method, simplified-type-of: Exported generic functions
Method, simplified-type-of: Exported generic functions
Method, simplified-type-of: Exported generic functions
Method, simplified-type-of: Exported generic functions
Method, simplified-type-of: Exported generic functions
Method, simplified-type-of: Exported generic functions

S
simplified-type-conjunction: Internal functions
simplified-type-disjunction: Internal functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplified-type-of: Exported generic functions
simplify-type: Exported functions

Jump to:   C   D   E   F   G   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
C   S  
Index Entry  Section

*
*precise-integer-types*: Internal special variables

+
+complex-double-float-type+: Internal constants
+complex-long-float-type+: Internal constants
+complex-short-float-type+: Internal constants
+complex-single-float-type+: Internal constants
+double-float-type+: Internal constants
+long-float-type+: Internal constants
+short-float-type+: Internal constants
+single-float-type+: Internal constants

C
Constant, +complex-double-float-type+: Internal constants
Constant, +complex-long-float-type+: Internal constants
Constant, +complex-short-float-type+: Internal constants
Constant, +complex-single-float-type+: Internal constants
Constant, +double-float-type+: Internal constants
Constant, +long-float-type+: Internal constants
Constant, +short-float-type+: Internal constants
Constant, +single-float-type+: Internal constants

S
Special Variable, *precise-integer-types*: Internal special variables

Jump to:   *   +  
C   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S   T  
Index Entry  Section

P
Package, simplified-types: The simplified-types package

S
simplified-complex-type-specifier: Exported types
simplified-floating-point-type-specifier: Exported types
simplified-integer-type-specifier: Exported types
simplified-number-type-specifier: Exported types
simplified-type-specifier: Exported types
simplified-types: The simplified-types system
simplified-types: The simplified-types package
System, simplified-types: The simplified-types system

T
Type, simplified-complex-type-specifier: Exported types
Type, simplified-floating-point-type-specifier: Exported types
Type, simplified-integer-type-specifier: Exported types
Type, simplified-number-type-specifier: Exported types
Type, simplified-type-specifier: Exported types

Jump to:   P   S   T