diff options
author | dos-reis <gdr@axiomatics.org> | 2013-05-20 03:46:15 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2013-05-20 03:46:15 +0000 |
commit | 4c3e77d5efc19d097c7995f7d5f64eee0400ff66 (patch) | |
tree | 9cf6498c95ae3b7b807aec42741403a1a5578e6a /src/algebra | |
parent | e9cfc9f192acf6c1a267009d4a74643454eb7665 (diff) | |
download | open-axiom-4c3e77d5efc19d097c7995f7d5f64eee0400ff66.tar.gz |
Add Functorial category
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/Makefile.am | 13 | ||||
-rw-r--r-- | src/algebra/Makefile.in | 13 | ||||
-rw-r--r-- | src/algebra/aggcat.spad.pamphlet | 16 | ||||
-rw-r--r-- | src/algebra/catdef.spad.pamphlet | 20 |
4 files changed, 44 insertions, 18 deletions
diff --git a/src/algebra/Makefile.am b/src/algebra/Makefile.am index f2b02a34..4df8f821 100644 --- a/src/algebra/Makefile.am +++ b/src/algebra/Makefile.am @@ -129,6 +129,7 @@ SUFFIXES = .spad .$(FASLEXT) $(EXEEXT) .input .pamphlet .tex .dvi # Consequently, the dependencies listed here are at the categories # inheritance level; not necessarily at the use level. strap-0/UTYPE.$(FASLEXT): strap-0/TYPE.$(FASLEXT) +strap-0/FUNCTOR.$(FASLEXT): strap-0/TYPE.$(FASLEXT) strap-0/BASTYPE.$(FASLEXT): strap-0/TYPE.$(FASLEXT) strap-0/KOERCE.$(FASLEXT): strap-0/TYPE.$(FASLEXT) strap-0/KONVERT.$(FASLEXT): strap-0/TYPE.$(FASLEXT) @@ -312,7 +313,7 @@ strap-0/LNAGG.$(FASLEXT): strap-0/IXAGG.$(FASLEXT) \ strap-0/CLAGG.$(FASLEXT) strap-0/ETLAB.$(FASLEXT) strap-0/IXAGG.$(FASLEXT): strap-0/HOAGG.$(FASLEXT) \ strap-0/ELTAGG.$(FASLEXT) -strap-0/HOAGG.$(FASLEXT): strap-0/AGG.$(FASLEXT) \ +strap-0/HOAGG.$(FASLEXT): strap-0/AGG.$(FASLEXT) strap-0/FUNCTOR.$(FASLEXT) \ strap-0/KOERCE.$(FASLEXT) strap-0/BASTYPE.$(FASLEXT) \ strap-0/SETCAT.$(FASLEXT) strap-0/EVALAB.$(FASLEXT) strap-0/AGG.$(FASLEXT): strap-0/TYPE.$(FASLEXT) @@ -404,6 +405,7 @@ strap-0/PATTERN.$(FASLEXT): strap-0/SETCAT.$(FASLEXT) \ # the bootstrap process (stage 2). Those that were compiled at stage 0 # were (necessarily) incomplete. +strap-1/FUNCTOR.$(FASLEXT): strap-1/TYPE.$(FASLEXT) strap-1/BASTYPE.$(FASLEXT): strap-1/TYPE.$(FASLEXT) \ strap-0/BOOLEAN.$(FASLEXT) @@ -642,7 +644,7 @@ strap-1/LNAGG.$(FASLEXT): strap-1/IXAGG.$(FASLEXT) \ strap-1/IXAGG.$(FASLEXT): strap-1/HOAGG.$(FASLEXT) \ strap-1/ELTAGG.$(FASLEXT) -strap-1/HOAGG.$(FASLEXT): strap-1/AGG.$(FASLEXT) \ +strap-1/HOAGG.$(FASLEXT): strap-1/AGG.$(FASLEXT) strap-1/FUNCTOR.$(FASLEXT) \ strap-1/KOERCE.$(FASLEXT) strap-1/BASTYPE.$(FASLEXT) \ strap-1/SETCAT.$(FASLEXT) strap-1/EVALAB.$(FASLEXT) \ strap-0/EQ.$(FASLEXT) @@ -782,6 +784,7 @@ strap-1/SAOS.$(FASLEXT): strap-1/ORDSET.$(FASLEXT) \ # At this stage we recompile everything from stage 1, including # a few more domains. +strap-2/FUNCTOR.$(FASLEXT): strap-2/TYPE.$(FASLEXT) strap-2/KOERCE.$(FASLEXT): strap-2/TYPE.$(FASLEXT) strap-2/KONVERT.$(FASLEXT): strap-2/TYPE.$(FASLEXT) @@ -1011,7 +1014,7 @@ strap-2/LNAGG.$(FASLEXT): strap-2/IXAGG.$(FASLEXT) \ strap-2/CLAGG.$(FASLEXT) strap-2/ETLAB.$(FASLEXT) strap-2/IXAGG.$(FASLEXT): strap-2/HOAGG.$(FASLEXT) \ strap-2/ELTAGG.$(FASLEXT) -strap-2/HOAGG.$(FASLEXT): strap-2/AGG.$(FASLEXT) \ +strap-2/HOAGG.$(FASLEXT): strap-2/AGG.$(FASLEXT) strap-2/FUNCTOR.$(FASLEXT) \ strap-2/KOERCE.$(FASLEXT) strap-2/BASTYPE.$(FASLEXT) \ strap-2/SETCAT.$(FASLEXT) strap-2/EVALAB.$(FASLEXT) strap-2/SETAGG.$(FASLEXT): strap-2/CLAGG.$(FASLEXT) strap-2/SETCAT.$(FASLEXT) @@ -1462,6 +1465,8 @@ $(OUT)/SGPOP.$(FASLEXT): $(OUT)/SGPOPC.$(FASLEXT) $(OUT)/SETCAT.$(FASLEXT) \ $(OUT)/MONOPC.$(FASLEXT): $(OUT)/SGPOPC.$(FASLEXT) $(OUT)/FSAGG.$(FASLEXT): $(OUT)/FINAGG.$(FASLEXT) +$(OUT)/FUNCTOR.$(FASLEXT): $(OUT)/TYPE.$(FASLEXT) +$(OUT)/HOAGG.$(FASLEXT): $(OUT)/FUNCTOR.$(FASLEXT) $(OUT)/SMAGG.$(FASLEXT): $(OUT)/HOAGG.$(FASLEXT) $(OUT)/FINAGG.$(FASLEXT): $(OUT)/HOAGG.$(FASLEXT) $(OUT)/ELAGG.$(FASLEXT): $(OUT)/SMAGG.$(FASLEXT) @@ -1470,7 +1475,7 @@ oa_algebra_layer_0 = \ AHYP ATTREG CFCAT ELTAB KOERCE KONVERT \ KRCFROM KVTFROM IEVALAB IEVALAB- EVALAB EVALAB- \ RETRACT RETRACT- SETCAT SETCAT- VOID SEGCAT \ - MSYSCMD FINITE FINITE- IDEMOPC OUT \ + MSYSCMD FINITE FINITE- IDEMOPC FUNCTOR OUT \ PRIMCAT PRINT PTRANFN SPFCAT TYPE UTYPE \ BMODULE SGPOPC BASTYPE BASTYPE- STEP LMODULE \ RMODULE ALGEBRA ALGEBRA- SGROUP SGROUP- ABELSG \ diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in index e871747f..ad03d585 100644 --- a/src/algebra/Makefile.in +++ b/src/algebra/Makefile.in @@ -721,7 +721,7 @@ oa_algebra_layer_0 = \ AHYP ATTREG CFCAT ELTAB KOERCE KONVERT \ KRCFROM KVTFROM IEVALAB IEVALAB- EVALAB EVALAB- \ RETRACT RETRACT- SETCAT SETCAT- VOID SEGCAT \ - MSYSCMD FINITE FINITE- IDEMOPC OUT \ + MSYSCMD FINITE FINITE- IDEMOPC FUNCTOR OUT \ PRIMCAT PRINT PTRANFN SPFCAT TYPE UTYPE \ BMODULE SGPOPC BASTYPE BASTYPE- STEP LMODULE \ RMODULE ALGEBRA ALGEBRA- SGROUP SGROUP- ABELSG \ @@ -1619,6 +1619,7 @@ uninstall-am: # Consequently, the dependencies listed here are at the categories # inheritance level; not necessarily at the use level. strap-0/UTYPE.$(FASLEXT): strap-0/TYPE.$(FASLEXT) +strap-0/FUNCTOR.$(FASLEXT): strap-0/TYPE.$(FASLEXT) strap-0/BASTYPE.$(FASLEXT): strap-0/TYPE.$(FASLEXT) strap-0/KOERCE.$(FASLEXT): strap-0/TYPE.$(FASLEXT) strap-0/KONVERT.$(FASLEXT): strap-0/TYPE.$(FASLEXT) @@ -1802,7 +1803,7 @@ strap-0/LNAGG.$(FASLEXT): strap-0/IXAGG.$(FASLEXT) \ strap-0/CLAGG.$(FASLEXT) strap-0/ETLAB.$(FASLEXT) strap-0/IXAGG.$(FASLEXT): strap-0/HOAGG.$(FASLEXT) \ strap-0/ELTAGG.$(FASLEXT) -strap-0/HOAGG.$(FASLEXT): strap-0/AGG.$(FASLEXT) \ +strap-0/HOAGG.$(FASLEXT): strap-0/AGG.$(FASLEXT) strap-0/FUNCTOR.$(FASLEXT) \ strap-0/KOERCE.$(FASLEXT) strap-0/BASTYPE.$(FASLEXT) \ strap-0/SETCAT.$(FASLEXT) strap-0/EVALAB.$(FASLEXT) strap-0/AGG.$(FASLEXT): strap-0/TYPE.$(FASLEXT) @@ -1894,6 +1895,7 @@ strap-0/PATTERN.$(FASLEXT): strap-0/SETCAT.$(FASLEXT) \ # the bootstrap process (stage 2). Those that were compiled at stage 0 # were (necessarily) incomplete. +strap-1/FUNCTOR.$(FASLEXT): strap-1/TYPE.$(FASLEXT) strap-1/BASTYPE.$(FASLEXT): strap-1/TYPE.$(FASLEXT) \ strap-0/BOOLEAN.$(FASLEXT) @@ -2132,7 +2134,7 @@ strap-1/LNAGG.$(FASLEXT): strap-1/IXAGG.$(FASLEXT) \ strap-1/IXAGG.$(FASLEXT): strap-1/HOAGG.$(FASLEXT) \ strap-1/ELTAGG.$(FASLEXT) -strap-1/HOAGG.$(FASLEXT): strap-1/AGG.$(FASLEXT) \ +strap-1/HOAGG.$(FASLEXT): strap-1/AGG.$(FASLEXT) strap-1/FUNCTOR.$(FASLEXT) \ strap-1/KOERCE.$(FASLEXT) strap-1/BASTYPE.$(FASLEXT) \ strap-1/SETCAT.$(FASLEXT) strap-1/EVALAB.$(FASLEXT) \ strap-0/EQ.$(FASLEXT) @@ -2272,6 +2274,7 @@ strap-1/SAOS.$(FASLEXT): strap-1/ORDSET.$(FASLEXT) \ # At this stage we recompile everything from stage 1, including # a few more domains. +strap-2/FUNCTOR.$(FASLEXT): strap-2/TYPE.$(FASLEXT) strap-2/KOERCE.$(FASLEXT): strap-2/TYPE.$(FASLEXT) strap-2/KONVERT.$(FASLEXT): strap-2/TYPE.$(FASLEXT) @@ -2498,7 +2501,7 @@ strap-2/LNAGG.$(FASLEXT): strap-2/IXAGG.$(FASLEXT) \ strap-2/CLAGG.$(FASLEXT) strap-2/ETLAB.$(FASLEXT) strap-2/IXAGG.$(FASLEXT): strap-2/HOAGG.$(FASLEXT) \ strap-2/ELTAGG.$(FASLEXT) -strap-2/HOAGG.$(FASLEXT): strap-2/AGG.$(FASLEXT) \ +strap-2/HOAGG.$(FASLEXT): strap-2/AGG.$(FASLEXT) strap-2/FUNCTOR.$(FASLEXT) \ strap-2/KOERCE.$(FASLEXT) strap-2/BASTYPE.$(FASLEXT) \ strap-2/SETCAT.$(FASLEXT) strap-2/EVALAB.$(FASLEXT) strap-2/SETAGG.$(FASLEXT): strap-2/CLAGG.$(FASLEXT) strap-2/SETCAT.$(FASLEXT) @@ -2802,6 +2805,8 @@ $(OUT)/SGPOP.$(FASLEXT): $(OUT)/SGPOPC.$(FASLEXT) $(OUT)/SETCAT.$(FASLEXT) \ $(OUT)/MONOPC.$(FASLEXT): $(OUT)/SGPOPC.$(FASLEXT) $(OUT)/FSAGG.$(FASLEXT): $(OUT)/FINAGG.$(FASLEXT) +$(OUT)/FUNCTOR.$(FASLEXT): $(OUT)/TYPE.$(FASLEXT) +$(OUT)/HOAGG.$(FASLEXT): $(OUT)/FUNCTOR.$(FASLEXT) $(OUT)/SMAGG.$(FASLEXT): $(OUT)/HOAGG.$(FASLEXT) $(OUT)/FINAGG.$(FASLEXT): $(OUT)/HOAGG.$(FASLEXT) $(OUT)/ELAGG.$(FASLEXT): $(OUT)/SMAGG.$(FASLEXT) diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet index 3ff73675..df09311f 100644 --- a/src/algebra/aggcat.spad.pamphlet +++ b/src/algebra/aggcat.spad.pamphlet @@ -68,28 +68,26 @@ import CoercibleTo OutputForm import Evalable )abbrev category HOAGG HomogeneousAggregate ++ Author: Michael Monagan; revised by Manuel Bronstein and Richard Jenks +++ Further revision by Gabriel Dos Reis. ++ Date Created: August 87 through August 88 -++ Date Last Updated: April 1991, May 1995 +++ Date Last Updated: May 17, 2013. ++ Basic Operations: -++ Related Constructors: +++ Related Constructors: Aggregate, Functorial ++ Also See: ++ AMS Classifications: ++ Keywords: ++ References: ++ Description: -++ A homogeneous aggregate is an aggregate of elements all of the -++ same type. +++ A homogeneous aggregate is an aggregate of elements all of the +++ same type, and is functorial in stored elements.. ++ In the current system, all aggregates are homogeneous. ++ Two attributes characterize classes of aggregates. -HomogeneousAggregate(S:Type): Category == Aggregate with +HomogeneousAggregate(S:Type): Category == Join(Aggregate,Functorial S) with if S has CoercibleTo(OutputForm) then CoercibleTo(OutputForm) if S has BasicType then BasicType if S has SetCategory then SetCategory if S has SetCategory then if S has Evalable S then Evalable S - map : (S->S,%) -> % - ++ map(f,u) returns a copy of u with each element x replaced by f(x). - ++ For collections, \axiom{map(f,u) = [f(x) for x in u]}. add if S has Evalable S then eval(u:%,l:List Equation S):% == map(eval(#1,l),u) @@ -195,8 +193,6 @@ ShallowlyMutableAggregate(S: Type): Category == Exports where @ - - \section{category CLAGG Collection} <<category CLAGG Collection>>= diff --git a/src/algebra/catdef.spad.pamphlet b/src/algebra/catdef.spad.pamphlet index 8261e7ea..f8c394ee 100644 --- a/src/algebra/catdef.spad.pamphlet +++ b/src/algebra/catdef.spad.pamphlet @@ -2196,6 +2196,25 @@ VectorSpace(S:Field): Category == Module(S) with (v:% / s:S):% == inv(s) * v @ + +\section{Functorial} + +<<category FUNCTOR Functorial>>= +)abbrev category FUNCTOR Functorial +++ Author: Gabriel Dos Reis +++ Date Created: May 19, 2013. +++ Date Last Modified: May 19, 2013. +++ Description: +++ This category describes the class of structural objects that +++ behave functorially in distinguished class of components. +Functorial(S: Type): Category == Type with + map: (S -> S, %) -> % + ++ \spad{map(f,x)} returns an object with similar shape and + ++ structure as \spad{x}, where all \spad{S}-items \spad{s} + ++ in \spad{x} have been replacement elementwise by \spad{f s}. +@ + + \section{License} <<license>>= --Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. @@ -2234,6 +2253,7 @@ VectorSpace(S:Field): Category == Module(S) with <<*>>= <<license>> +<<category FUNCTOR Functorial>> <<category BINOPC BinaryOperatorCategory>> <<domain BINOP BinaryOperation>> <<category IDEMOPC IdempotentOperatorCategory>> |