aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/coerce.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-11-20 07:57:14 +0000
committerdos-reis <gdr@axiomatics.org>2008-11-20 07:57:14 +0000
commit90dee68c255cd77c5e72fb78da8a02d07e3c1c49 (patch)
treef1bda1d35b9549660a6275890865894e87ebaf44 /src/algebra/coerce.spad.pamphlet
parent29c64f74f12bbeebb82045b08db420d2d2b60cf7 (diff)
downloadopen-axiom-90dee68c255cd77c5e72fb78da8a02d07e3c1c49.tar.gz
* algebra/coerce.spad.pamphlet (CoercibleFrom): New.
(ConvertibleFrom): Likewise. (RetractableTo): Use it. * algebra/Makefile.pamphlet (axiom_algebra_layer_0): Include KRCFROM and KVTFROM. * share/algebra/: Update databases.
Diffstat (limited to 'src/algebra/coerce.spad.pamphlet')
-rw-r--r--src/algebra/coerce.spad.pamphlet68
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