[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiomdeveloper] [FunctionalMapping]
From: 
Bill Page 
Subject: 
[Axiomdeveloper] [FunctionalMapping] 
Date: 
Fri, 04 Mar 2005 14:54:49 0600 
Changes http://page.axiomdeveloper.org/zope/mathaction/FunctionalMapping/diff

++added:
This simple package defines an function g which operates on some
function with domain from set and codomain from Ring and returns
the "square" of that function.
??changed:
Test1(A:SetCategory):_
 MPcat == MPdef where
 B ==> Integer

 MPcat == with
 g:(A>B) > (A >B)
 MPdef == add

 MappingPackageInternalHacks3(A, B, B)

 fab: A > B
 sq: B > B

 sq(x)== (x*x)$B
 g(fab) == comp(sq,fab,#1)
Test1(A:SetCategory,B:Ring):_
with g:(A>B) > (A >B) == add
MappingPackage3(A, B, B)
 which provides the operator * for functional composition
sq(x:B):B == (x*x)$B
 then all we need is multiplication from some Ring
g(f:A>B) == sq*f
++added:
The call to 'MapplingPackage3' to construct a functional composition
of the right signature seems quite novel to me. I learned this from
reading MappingPackage3 in 'source/algebra/mappkg.spad'
Here we apply g to a function over the Ring Integer
??changed:
p(x:INT):INT == x1
p 4
pINT(x:INT):INT == x1
qINT := g pINT
qINT 5
??changed:

This own is over the Ring Float
??changed:
q := g p
q 4
pFLOAT(x:FLOAT):FLOAT == x1
qFLOAT := g pFLOAT
qFLOAT(5.1)

forwarded from http://page.axiomdeveloper.org/zope/mathaction/address@hidden