[previous] [up] [next]     [contents]
Next: Accurate Numeric Operations Up: PLT MrSpidey: Static Debugger Previous: Analysis of Large Programs

The Type Language

 

The language of basic types in MrSpidey is defined as follows:


type is one of: set-variable empty zeroary-constructor (constructor type tex2html_wrap_inline1154 type) (union type tex2html_wrap_inline1154 type) (rec ([set-variable type] tex2html_wrap_inline1154 ) type) (class [ivar type] tex2html_wrap_inline1154 ) (object [ivar type] tex2html_wrap_inline1154 ) function-type type-abbreviation

set-variable is: symbol

zeroary-constructor is one of: nil num sym str char void true false bool eof

constructor is one of: zeroary-constructor vec box promise mvalues-list Unary constructors cons Binary constructors define-structure-constructor user-defined-constructor

define-structure-constructor is: symbol

user-defined-constructor is: symbol

function-type is one of: (type tex2html_wrap_inline1154 type -> type) (type tex2html_wrap_inline1154 type *-> type) Rest argument (type tex2html_wrap_inline1154 type ->* type) Return value list (type tex2html_wrap_inline1154 type *->* type) Rest argument and return value list (lambda type type) same as (type *->* type)

type-abbreviation is one of: (MU set-variable type) Abbreviates (rec ([set-variable type]) set-variable) noarg Abbreviates nil (arg type type) Abbreviates (cons type type) (list type tex2html_wrap_inline1154 type) Abbreviates (cons type (cons tex2html_wrap_inline1154 (cons type nil))) (listof type) Abbreviates (MU x type) null Abbreviates nil bool Abbreviates (union true false) atom Abbreviates (union nil num sym str char bool) sexp Abbreviates (MU x (union atom (cons x x) (vec x)))

The behavior of primitive operations is defined using multiple-arity schemas. For each reference to a primitive operation, MrSpidey retrieves the corresponding multiple-arity schema and selects the schema appropriate for the number of arguments given to the primitive (or the last schema if the primitive is used in a higher-order manner). It then instantiates the schema by replacing the quantified set variables by set variables, and converts the resulting basic type into a constraint system. Multiple-arity schemas are defined as follows:


multiple-arity-schema is one of: schema (case-> schema tex2html_wrap_inline1154 )

schema is one of: type (forall (set-variable tex2html_wrap_inline1154 ) type)

For more information, see [1].




[previous] [up] [next]     [contents]
Next: Accurate Numeric Operations Up: PLT MrSpidey: Static Debugger Previous: Analysis of Large Programs

PLT