diff options
Diffstat (limited to 'src/algebra/coerce.spad.pamphlet')
-rw-r--r-- | src/algebra/coerce.spad.pamphlet | 68 |
1 files changed, 62 insertions, 6 deletions
diff --git a/src/algebra/coerce.spad.pamphlet b/src/algebra/coerce.spad.pamphlet index f270bba6..8176377a 100644 --- a/src/algebra/coerce.spad.pamphlet +++ b/src/algebra/coerce.spad.pamphlet @@ -1,15 +1,20 @@ \documentclass{article} \usepackage{axiom} -\begin{document} + \title{\$SPAD/src/algebra coerce.spad} \author{Richard Jenks, Manuel Bronstein, Gabriel Dos Reis} + + +\begin{document} + \maketitle \begin{abstract} \end{abstract} -\eject \tableofcontents \eject + \section{category TYPE Type} + <<category TYPE Type>>= )abbrev category TYPE Type ++ The new fundamental Type (keeping Object for 1.5 as well) @@ -39,6 +44,7 @@ UnionType(): Category == with nil \section{category KOERCE CoercibleTo} + <<category KOERCE CoercibleTo>>= )abbrev category KOERCE CoercibleTo ++ Category for coerce @@ -53,7 +59,28 @@ CoercibleTo(S:Type): Category == with ++ coerce(a) transforms a into an element of S. @ + +\section{category KRCFROM CoercibleFrom} + +<<category KRCFROM CoercibleFrom>>= +)abbrev category KRCFROM CoercibleFrom +++ Author: Gabriel Dos Reis +++ Date Create: November 19, 2008 +++ Date Last Modified: November 19, 2008 +++ See Also: CoercibleTo +++ Description: +++ A is coercible from B iff any element of domain B can be +++ automically converted into an element of domain B. In symbols +++ A has CoercibleFrom B <=> B has CoercibleTo A +CoercibleFrom(S: Type): Category == with + coerce: S -> % + ++ coerce(s) transforms `s' into an element of `%'. + +@ + + \section{category KONVERT ConvertibleTo} + <<category KONVERT ConvertibleTo>>= )abbrev category KONVERT ConvertibleTo ++ Category for convert @@ -69,20 +96,43 @@ ConvertibleTo(S:Type): Category == with ++ convert(a) transforms a into an element of S. @ + +\section{category KVTFROM ConvertibleFrom} + +<<category KVTFROM ConvertibleFrom>>= +)abbrev category KVTFROM ConvertibleFrom +++ Author: Gabriel Dos Reis +++ Date Create: November 19, 2008 +++ Date Last Modified: November 19, 2008 +++ See Also: ConvertibleTo +++ Description: +++ A is convertible from B iff any element of domain B can be +++ explicitly converted into an element of domain B. In symbols +++ A has ConvertibleFrom B <=> B has ConvertibleTo A +ConvertibleFrom(S: Type): Category == with + convert: S -> % + ++ convert(s) transforms `s' into an element of `%'. + +@ + + + + + \section{category RETRACT RetractableTo} + <<category RETRACT RetractableTo>>= )abbrev category RETRACT RetractableTo ++ Category for retract ++ Author: ??? ++ Date Created: ??? -++ Date Last Updated: 14 May 1991 +++ Date Last Updated: November 19, 2008 +++ Related Constructor: CoercibleFrom ++ Description: ++ A is retractable to B means that some elementsif A can be converted ++ into elements of B and any element of B can be converted into an ++ element of A. -RetractableTo(S: Type): Category == with - coerce: S -> % - ++ coerce(a) transforms a into an element of %. +RetractableTo(S: Type): Category == CoercibleFrom S with retractIfCan: % -> Union(S,"failed") ++ retractIfCan(a) transforms a into an element of S if possible. ++ Returns "failed" if a cannot be made into an element of S. @@ -95,10 +145,14 @@ RetractableTo(S: Type): Category == with u @ + \section{License} + <<license>>= --Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. --All rights reserved. +--Copyright (C) 2007-2008, Gabriel Dos Reis. +--All rights reserved. -- --Redistribution and use in source and binary forms, with or without --modification, are permitted provided that the following conditions are @@ -134,7 +188,9 @@ RetractableTo(S: Type): Category == with <<category TYPE Type>> <<category UTYPE UnionType>> <<category KOERCE CoercibleTo>> +<<category KRCFROM CoercibleFrom>> <<category KONVERT ConvertibleTo>> +<<category KVTFROM ConvertibleFrom>> <<category RETRACT RetractableTo>> @ \eject |