aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-02-25 02:52:24 +0000
committerdos-reis <gdr@axiomatics.org>2012-02-25 02:52:24 +0000
commit2918e9b3cf5c5a39c85c765a79236e01a9540629 (patch)
tree1cb35fbd8df84932eb2c5b7fc452f48fe6107bb6 /src/algebra
parent230e2d3f27c556cf2c61127ea8f525dc17c5aa9a (diff)
downloadopen-axiom-2918e9b3cf5c5a39c85c765a79236e01a9540629.tar.gz
* algebra/catdef.spad.pamphlet (BinaryOperatorCategory): New.
(BinaryOperation): Likewise. (IdempotentOperatorCategory): Likewise. (SemiGroupOperatorCategory): Likewise. (SemiGroupOperation): Likewise. (MonoidOperatorCategory): Likewise. (MonoidOperation): Likewise. * algebra/exposed.lsp.pamphlet: Expose them. * algebra/Makefile.in (oa_algebra_layer_0): Include IDEMOPC, SGPOPC, SPGOP, MONOPC, BINOPC. (axiom_algebra_layer_1): Include MONOP.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/Makefile.in23
-rw-r--r--src/algebra/catdef.spad.pamphlet130
-rw-r--r--src/algebra/exposed.lsp.pamphlet7
3 files changed, 153 insertions, 7 deletions
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in
index 7f30bb8e..0077bbde 100644
--- a/src/algebra/Makefile.in
+++ b/src/algebra/Makefile.in
@@ -1428,17 +1428,25 @@ $(OUT)/DSEXT.$(FASLEXT): $(OUT)/DIFFSPC.$(FASLEXT) $(OUT)/PDSPC.$(FASLEXT)
$(OUT)/ORDTYPE.$(FASLEXT): $(OUT)/BASTYPE.$(FASLEXT)
$(OUT)/ORDSTRCT.$(FASLEXT): $(OUT)/ORDTYPE.$(FASLEXT) $(OUT)/HOMOTOP.$(FASLEXT)
+$(OUT)/BINOPC.$(FASLEXT): $(OUT)/TYPE.$(FASLEXT)
+$(OUT)/BINOP.$(FASLEXT): $(OUT)/BINOPC.$(FASLEXT) $(OUT)/SETCAT.$(FASLEXT)
+$(OUT)/IDEMOPC.$(FASLEXT): $(OUT)/BINOPC.$(FASLEXT) $(OUT)/BASTYPE.$(FASLEXT)
+$(OUT)/SGPOPC.$(FASLEXT): $(OUT)/BINOPC.$(FASLEXT) $(OUT)/BASTYPE.$(FASLEXT)
+$(OUT)/SGPOP.$(FASLEXT): $(OUT)/SGPOPC.$(FASLEXT) $(OUT)/SETCAT.$(FASLEXT) \
+ $(OUT)/BINOP.$(FASLEXT)
+$(OUT)/MONOPC.$(FASLEXT): $(OUT)/SGPOPC.$(FASLEXT)
+
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- OUT \
+ MSYSCMD FINITE FINITE- IDEMOPC OUT \
PRIMCAT PRINT PTRANFN SPFCAT TYPE UTYPE \
- BMODULE BASTYPE BASTYPE- STEP LMODULE \
+ BMODULE SGPOPC BASTYPE BASTYPE- STEP LMODULE \
RMODULE ALGEBRA ALGEBRA- SGROUP SGROUP- ABELSG \
- ABELSG- ORDSET OASGP FILECAT SEXCAT \
+ ABELSG- ORDSET SGPOP OASGP FILECAT SEXCAT \
MODULE MODULE- PID OAGROUP OAGROUP- OCAMON \
- OAMON OAMON- DIOID \
+ OAMON OAMON- DIOID MONOPC \
RNG ORDFIN LLINSET RLINSET LINSET OAMONS \
MKBCFUNC MKRECORD MKUCFUNC DROPT1 PLOT1 ITFUN2 \
ITFUN3 STREAM1 STREAM2 STREAM3 ANY1 SEGBIND2 \
@@ -1458,7 +1466,7 @@ oa_algebra_layer_0 = \
DSEXT DSEXT- ORDTYPE ORDTYPE- ORDSTRCT \
BOOLE BOOLE- REF ALIST PRIMARR SRING \
INS INS- DIVRING DIVRING- EUCDOM EUCDOM- \
- FPS FPS- RNS RNS- \
+ BINOPC BINOP FPS FPS- RNS RNS- \
POLYCAT POLYCAT- QFCAT QFCAT- \
INT NNI PI SINT SYMBOL DFLOAT
@@ -1523,6 +1531,9 @@ $(OUT)/DMEXT.$(FASLEXT): $(OUT)/DSEXT.$(FASLEXT) $(OUT)/DIFFMOD.$(FASLEXT) \
$(OUT)/PDMOD.$(FASLEXT)
$(OUT)/STREAM.$(FASLEXT): $(OUT)/LZSTAGG.$(FASLEXT)
+$(OUT)/MONOP.$(FASLEXT): $(OUT)/MONOPC.$(FASLEXT) $(OUT)/PAIR.$(FASLEXT) \
+ $(OUT)/SETCAT.$(FASLEXT)
+
axiom_algebra_layer_1 = \
ABELGRP ABELGRP- ABELMON ABELMON- ITUPLE \
CABMON MONOID MONOID- RING RING- COMRING \
@@ -1532,7 +1543,7 @@ axiom_algebra_layer_1 = \
IDENT OUTFORM BINDING BOOLEAN \
ORDRING FEVALAB FEVALAB- IARRAY1 \
OSGROUP MAYBE DATAARY PROPLOG HOMOTOP BYTEORD \
- FIELD FIELD- VECTCAT VECTCAT- \
+ FIELD FIELD- VECTCAT VECTCAT- MONOP \
PROPERTY ARITY OPERCAT OPERCAT- PAIR STREAM \
RADCAT RADCAT- PDMOD DMEXT LZSTAGG LZSTAGG-
diff --git a/src/algebra/catdef.spad.pamphlet b/src/algebra/catdef.spad.pamphlet
index 00930fb2..997b4bba 100644
--- a/src/algebra/catdef.spad.pamphlet
+++ b/src/algebra/catdef.spad.pamphlet
@@ -12,6 +12,126 @@
\tableofcontents
\eject
+\section{Binary operations}
+
+<<category BINOPC BinaryOperatorCategory>>=
+)abbrev category BINOPC BinaryOperatorCategory
+++ Author: Gabriel Dos Reis
+++ Date Created: February 24, 2012
+++ Date Last Modified: February 24, 2012
+++ Description:
+++ This is the category of all domains that implement binary operations.
+BinaryOperatorCategory(T: Type): Category == MappingCategory(T,T,T)
+
+@
+
+<<domain BINOP BinaryOperation>>=
+)abbrev domain BINOP BinaryOperation
+++ Author: Gabriel Dos Reis
+++ Date Created: February 24, 2012
+++ Date Last Modified: February 24, 2012
+++ Description:
+++ This domain implements binary operations.
+BinaryOperation(T: Type): Join(BinaryOperatorCategory T, SetCategory) with
+ binaryOperation: ((T,T) -> T) -> %
+ ++ \spad{binaryOperation f} constructs a binary operation value
+ ++ out of any homogeneous mapping of arity 2.
+ == (T,T) -> T add
+ binaryOperation f == per f
+ elt(f,x,y) == rep(f)(x,y)
+
+@
+
+
+\section{Idempotent operations}
+
+<<category IDEMOPC IdempotentOperatorCategory>>=
+)abbrev category IDEMOPC IdempotentOperatorCategory
+++ Author: Gabriel Dos Reis
+++ Date Created: February 24, 2012
+++ Date Last Modified: February 24, 2012
+++ Description:
+++ This is the category of all domains that implement idempotent operations.
+IdempotentOperatorCategory(T: BasicType): Category ==
+ BinaryOperatorCategory T with
+ assume idempotence ==
+ forall(f: %, x: T) . f(x,x) = x
+@
+
+
+\section{Semigroup operations}
+
+<<category SGPOPC SemiGroupOperatorCategory>>=
+)abbrev category SGPOPC SemiGroupOperatorCategory
+++ Author: Gabriel Dos Reis
+++ Date Created: February 24, 2012
+++ Date Last Modified: February 24, 2012
+++ Description:
+++ This is the category of all domains that implement semigroup operations
+SemiGroupOperatorCategory(T: BasicType): Category ==
+ BinaryOperatorCategory T with
+ assume associativity ==
+ forall(f: %, x: T, y:T, z: T) . f(f(x,y),z) = f(x,f(y,z))
+
+@
+
+<<domain SGPOP SemiGroupOperation>>=
+)abbrev domain SGPOP SemiGroupOperation
+++ Author: Gabriel Dos Reis
+++ Date Created: February 24, 2012
+++ Date Last Modified: February 24, 2012
+++ Description:
+++ This domain implements semigroup operations.
+SemiGroupOperation(T: BasicType): Public == Private where
+ Public == Join(SemiGroupOperatorCategory T,SetCategory) with
+ semiGroupOperation: ((T,T) -> T) -> %
+ ++ \spad{semiGroupOperation f} constructs a semigroup operation
+ ++ out of a binary homogeneous mapping known to be associative.
+ Private == BinaryOperation T
+
+@
+
+
+\section{Monoid operations}
+
+<<category MONOPC MonoidOperatorCategory>>=
+)abbrev category MONOPC MonoidOperatorCategory
+++ Author: Gabriel Dos Reis
+++ Date Created: February 24, 2012
+++ Date Last Modified: February 24, 2012
+++ Description:
+++ This is the category of all domains that implement monoid operations
+MonoidOperatorCategory(T: BasicType): Category ==
+ SemiGroupOperatorCategory T with
+ neutralValue: % -> T
+ ++ \spad{neutralValue f} returns the neutral value of the
+ ++ monoid operation \spad{f}.
+ assume neutrality ==
+ forall(f: %, x: T) .
+ f(x, neutralValue f) = x
+ f(neutralValue f, x) = x
+
+@
+
+<<domain MONOP MonoidOperation>>=
+)abbrev domain MONOP MonoidOperation
+++ Author: Gabriel Dos Reis
+++ Date Created: February 24, 2012
+++ Date Last Modified: February 24, 2012
+++ Description:
+++ This domain implements monoid operations.
+MonoidOperation(T: BasicType): Public == Private where
+ Public == Join(MonoidOperatorCategory T,SetCategory) with
+ monoidOperation: ((T,T) -> T, T) -> %
+ ++ \spad{monoidOperation(f,e)} constructs a operation from
+ ++ the binary mapping \spad{f} with neutral value \spad{e}.
+ Private == Pair((T,T) -> T,T) add
+ monoidOperation(f,e) == per pair(f,e)
+ elt(op,x,y) == first(rep op)(x,y)
+ neutralValue op == second rep op
+@
+
+
\section{Linear sets}
<<category LLINSET LeftLinearSet>>=
@@ -2065,7 +2185,7 @@ VectorSpace(S:Field): Category == Module(S) with
<<license>>=
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--All rights reserved.
---Copyright (C) 2007-2010, Gabriel Dos Reis.
+--Copyright (C) 2007-2012, Gabriel Dos Reis.
--All rights reversed.
--
--Redistribution and use in source and binary forms, with or without
@@ -2099,6 +2219,14 @@ VectorSpace(S:Field): Category == Module(S) with
<<*>>=
<<license>>
+<<category BINOPC BinaryOperatorCategory>>
+<<domain BINOP BinaryOperation>>
+<<category IDEMOPC IdempotentOperatorCategory>>
+<<category SGPOPC SemiGroupOperatorCategory>>
+<<domain SGPOP SemiGroupOperation>>
+<<category MONOPC MonoidOperatorCategory>>
+<<domain MONOP MonoidOperation>>
+
<<category BASTYPE BasicType>>
<<category ORDTYPE OrderedType>>
<<domain ORDSTRCT OrderedStructure>>
diff --git a/src/algebra/exposed.lsp.pamphlet b/src/algebra/exposed.lsp.pamphlet
index 0c8523cf..85f460f4 100644
--- a/src/algebra/exposed.lsp.pamphlet
+++ b/src/algebra/exposed.lsp.pamphlet
@@ -70,6 +70,7 @@
(|BasicOperator| . BOP)
(|BasicOperatorFunctions1| . BOP1)
(|BinaryExpansion| . BINARY)
+ (|BinaryOperation| . BINOP)
(|BinarySearchTree| . BSTREE)
(|BinaryTournament| . BTOURN)
(|BinaryTree| . BTREE)
@@ -260,6 +261,7 @@
(|MergeThing| . MTHING)
(|ModularDistinctDegreeFactorizer| . MDDFACT)
(|ModuleOperator| . MODOP)
+ (|MonoidOperation| . MONOP)
(|MonoidRingFunctions2| . MRF2)
(|MoreSystemCommands| . MSYSCMD)
(|MPolyCatFunctions2| . MPC2)
@@ -386,6 +388,7 @@
(|SegmentBinding| . SEGBIND)
(|SegmentBindingFunctions2| . SEGBIND2)
(|SegmentFunctions2| . SEG2)
+ (|SemiGroupOperation| . SGPOP)
(|SequenceAst| . SEQAST)
(|Set| . SET)
(|Signature| . SIG)
@@ -476,6 +479,7 @@
(|BagAggregate| . BGAGG)
(|BasicType| . BASTYPE)
(|BiModule| . BMODULE)
+ (|BinaryOperatorCategory| . BINOPC)
(|BinaryRecursiveAggregate| . BRAGG)
(|BinaryTreeCategory| . BTCAT)
(|BitAggregate| . BTAGG)
@@ -553,6 +557,7 @@
(|HomogeneousAggregate| . HOAGG)
(|HomotopicTo| . HOMOTOP)
(|HyperbolicFunctionCategory| . HYPCAT)
+ (|IdempotentOperatorCategory| . IDEMOPC)
(|IndexedAggregate| . IXAGG)
(|IndexedDirectProductCategory| . IDPC)
(|InnerEvalable| . IEVALAB)
@@ -579,6 +584,7 @@
(|Monad| . MONAD)
(|MonadWithUnit| . MONADWU)
(|Monoid| . MONOID)
+ (|MonoidOperatorCategory| . MONOPC)
(|MonogenicAlgebra| . MONOGEN)
(|MonogenicLinearOperator| . MLO)
(|MultiDictionary| . MDAGG)
@@ -649,6 +655,7 @@
(|SegmentCategory| . SEGCAT)
(|SegmentExpansionCategory| . SEGXCAT)
(|SemiGroup| . SGROUP)
+ (|SemiGroupOperatorCategory| . SGPOPC)
(|SemiRing| . SRING)
(|SetAggregate| . SETAGG)
(|SetCategory| . SETCAT)