\start
Date: Thu, 30 Jun 2005 23:09:24 -0700
From: Bob McElrath
To: Kai Kaminski
Subject: SVG, MathML, and all that
Kai, in the SVG example you sent previously at:
http://kaikaminski.gmxhome.de/axiom-index.html
your server is sending the content-type "image/svg-xml" for the svg
file, where it should be "image/svg+xml" (note the "+"). Mozilla
(properly) does not understand this content-type so does not render it.
Also, anyone wanting to play with SVG (esp. under linux) should grab the
"deer park" alpha for firefox 1.1:
http://www.mozilla.org/projects/firefox/
It contains SVG enabled by default, rendered with the Cairo engine.
MathML is also enabled. (but it is enabled in all mozilla browsers
nowadays) The Mozilla SVG implementation is young, so you may want to
also install the Adobe SVG viewer:
http://www.adobe.com/svg/viewer/install/main.html
You can switch between them by typing 'about:config' in the URL bar and
changing the value of 'svg.enabled' (which controls the built-in Mozilla
SVG implementation. However, version 3.0 of their viewer (the only one
available) will hang all recent versions of firefox and mozilla, and is
therefore totally unusable. :(
Just to be pedantic, the document type I am contemplating is described
here: http://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020809/
Essentially an interface would be a single XML file with javascript to
bind user interface widgets.
Here are some interesting resources/projects:
http://smarth.sourceforge.net/
a dynamic MathML equation editor. The application itself is written in
SVG. (requires Adobe SVG viewer -- Mozilla doesn't like this one)
Here is an equation grapher that uses SVG and javascript:
http://www.jasonkarldavis.com/scripts/grapher/grapher.xml
(perhaps just to motivate that SVG is a good format for figures)
and here is the same using Mozilla's XUL interface:
http://www.jasonkarldavis.com/scripts/grapher/xul/grapher.xul
it's intended to be run in the sidebar, which is why everything is
clustered on the left. I'm envisioning javascript actions that would
allow the user to click on the graph to rescale axes, change labelling,
change from log to linear, etc. I think all of these should send a
command back to axiom to regenerate the graph.
XUL is Mozilla's XML User Interface Language, which gives developers
access to every UI widget used by Mozilla. It is the framework upon
which Firefox extensions are based.
http://www.xulplanet.com/
Sometimes it's also called "chrome".
\start
Date: Fri, 01 Jul 2005 03:05:25 -0500
From: MathAction (unknown)
To: MathAction
Subject: [#173 (1 . failed) cannot be coerced to mode (Integer) in TriangularMatrixOperations] what's wrong with that?
>From the package:
++ This package provides functions that compute "fraction-free"
++ inverses of upper and lower triangular matrices over a integral
++ domain. By "fraction-free inverse" we mean the following:
++ given a matrix B with entries in R and an element d of R such that
++ d* inv(B) also has entries in R, we return d * inv(B).
So if you enter B and d such that d * inv(B) does not have entries in R, it is an error.
The package is for internal use (that why it is not exposed)
where d is always divisible by the determinant of B.
\start
Date: Fri, 01 Jul 2005 03:17:29 -0500
From: MathAction (unknown)
To: MathAction
Subject: [#144 Domain abbreviation is no longer associated with filename] wild card and case sensitivity in hyperdoc
The searches should allow use wild card character * also be case
insensitive. This is not the case in the open source version
(something broken?), making it very unusable. Should be a high
priority to fix since it is close to impossible for newcomers to
program in Axiom without a fully working hyperdoc. Why spent time
discussing about new GUI when it is perhaps simpler to fix these?
\start
Date: Fri, 01 Jul 2005 11:03:26 +0200
From: Kai Kaminski
To: Bob McElrath
Subject: Re: SVG, MathML, and all that
Hi Bob!
Bob McElrath wrote:
>Kai, in the SVG example you sent previously at:
> http://kaikaminski.gmxhome.de/axiom-index.html
>your server is sending the content-type "image/svg-xml" for the svg
>file, where it should be "image/svg+xml" (note the "+"). Mozilla
>(properly) does not understand this content-type so does not render it.
>
>
I sent an email to my provider.
>nowadays) The Mozilla SVG implementation is young, so you may want to
>also install the Adobe SVG viewer:
> http://www.adobe.com/svg/viewer/install/main.html
>You can switch between them by typing 'about:config' in the URL bar and
>changing the value of 'svg.enabled' (which controls the built-in Mozilla
>SVG implementation. However, version 3.0 of their viewer (the only one
>available) will hang all recent versions of firefox and mozilla, and is
>therefore totally unusable. :(
>
>
I think I've read somewhere that you have to use an older version. I
also believe that Bill is running Firefox with Adobe, so maybe he can
tell you how to get it to work.
>Just to be pedantic, the document type I am contemplating is described
>here: http://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020809/
>Essentially an interface would be a single XML file with javascript to
>bind user interface widgets.
>
>
Yes, that's it. Although we might want to avoid MathML for now and rely
on jsMath instead.
>Here are some interesting resources/projects:
> http://smarth.sourceforge.net/
>a dynamic MathML equation editor. The application itself is written in
>SVG. (requires Adobe SVG viewer -- Mozilla doesn't like this one)
>
>
Looks quite impressive, but doesn't work very well on my system. For
example some keys always generate two characters and others don't
generate the correct output. But it demonstrates that one could indeed
embed a mini-GUI for plot manipulation in the plot files themselves.
>Here is an equation grapher that uses SVG and javascript:
> http://www.jasonkarldavis.com/scripts/grapher/grapher.xml
>(perhaps just to motivate that SVG is a good format for figures)
>and here is the same using Mozilla's XUL interface:
> http://www.jasonkarldavis.com/scripts/grapher/xul/grapher.xul
>it's intended to be run in the sidebar, which is why everything is
>clustered on the left. I'm envisioning javascript actions that would
>allow the user to click on the graph to rescale axes, change labelling,
>change from log to linear, etc. I think all of these should send a
>command back to axiom to regenerate the graph.
>
>
Maybe simple transformation could be done without consulting Axiom
again. Either by doing the manipulations in Javascript or by including
several plots with different parameters in the plot file and making all
but one invisible. The software at those links doesn't work for me, by
the way. I'm not sure what the problem is.
\start
Date: Fri, 01 Jul 2005 04:44:47 -0500
From: MathAction (anonymous)
To: MathAction
Subject: [#188 the do instruction doesn't display any result] A feature?
------------------
That is a feature?? (perhaps useful just for its side effects; and 'do' seems not documented -- it is equivalent to adding semicolons to each line of the pile, without the type info outputted on each line except the last). You need to explicitly ask to display a value.
\begin{axiom}
do
1
2
%
do i for i in 1..3
%
x:=do [i for i in 1..3]
x
1;
2;
%
\end{axiom}
\start
Date: Fri, 01 Jul 2005 06:16:19 -0500
From: MathAction (wyscc)
To: MathAction
Subject: [#187 trouoble with tuples] work around suggestion (if you must use Tuple)
++added:
From: William Sit, July 1, 2005 06:26:00 -5:00
The following works (not as neat as it should be, of course)
\begin{axiom}
f1:INT->Tuple INT
f1(x)==(x,2+x)
f2:(INT,INT)->INT
f2(x,y)==x*y -- fixed typo
a:=f1(4)
f2(select(a,0), select(a,1))
f3:Tuple INT -> INT
f3(x) == reduce(*,[select(x,i::NNI) for i in 0..length(x)-1])
f3(a)
f3(f1(5))
f3((1,2,3,4)::Tuple INT)
f3 [1,2,3,4]
f4:Tuple INT -> List INT
f4 x == concat(x::List INT, x::List INT)
f4(f1(5))
\end{axiom}
Note that neither 'f3(1,2,3,4)' nor 'f3((1,2,3,4))' works, even though
tuples are lists without the square brackets, essentially. In both
cases, the reason is probably the parser treats the arities
differently. Recall that the Interpreter (and Axiom) treats
parenthesis as "applied to" (so 'f3 (1,2,3,4)' is the same as applying
'f3' to 4 distinct arguments and 'f3(a)' is 'f3 a'). I do think the
second form should have worked without the explicit coercion.
I do not know why in the design of 'Tuple S', the parts are not to be
referenced with just the usual list method like 'a.i' and must use
'select'. Also the indexing in 'Tuple S' starts with 0. In the very
old days of Scratchpad, all aggregates indexing was zero based. Most
are converted to one-based and you can have a choice. Somehow, 'Tuple
S' was not updated to reflect this.
One final puzzle: What is the 'G1433' (or whatever) function from
'Integer->Boolean'? I tried
\begin{axiom}
)clear all
f3:Tuple INT->INT
f3 x == reduce(*,[select(x,i::NNI) for i in 0..length(x)-1])
a:Tuple INT:=(2,3)
f3 a
\end{axiom}
and there is no such function.
\start
Date: Fri, 01 Jul 2005 06:12:50 -0500
From: MathAction (unknown)
To: MathAction
Subject: [#188 the do instruction doesn't display any result]
I need the do command for tests with => in interpret input.
\begin{axiom}
1=2 => 3
2=2 => 4
\end{axiom}
Isn't right.
\begin{axiom}
do
1=2 => 3
2=2 => 4
\end{axiom}
is better.
I don't understand why the do command runs with a semicolon ; at the end.
If I don't want any display I add a semicolon, if not I get the result.
\start
Date: Fri, 01 Jul 2005 12:08:39 +0200
From: Michel Lavaud
To: William Sit
Subject: Re: Dispaying special characters on MathAction
Hello William,
On 30 Jun 2005 at 18:38, William Sit wrote:
> > under Firefox, I obtain the line 1 :
> >
> > math e mat i cal (math'?-mat'i-k?l)
> >
> > with u accent on the a and i, which looks rather strange, and on the
> > upper right corner
>
> I thought that was deliberate, taken from a dictionary and the
> punctuations and accents are meant to be pronunciation help and
> presumably use special Unicode-8 characters. It's the same whether I
> use Firefox or IE. Changing the encoding (even to English) will make
> that worse.
Ah, OK, thank you very much for the info.
\start
Date: Fri, 01 Jul 2005 06:49:18 -0500
From: MathAction (unknown)
To: MathAction
Subject: [#187 trouble with tuples] display of tuple
Why tuples are displayed as list ?
\par
I prefer to read (2,3) or 2,3 for tuple, and [2,3] only for lists.
\par
Students and I make errors when the display is the same, even if there is a type information.
\start
Date: Fri, 01 Jul 2005 08:02:36 -0500
From: MathAction (unknown)
To: MathAction
Subject: [#188 the do instruction doesn't display any result] do expressions in Aldor
Quoted from the Aldor User Guide at http://www.aldor.org/docs/HTML/chap5.html#7
The do expression evaluates E and discards the computed value, so that the do expression returns no value.
do E
\start
Date: Fri, 01 Jul 2005 08:05:26 -0500
From: MathAction (wyscc)
To: MathAction
Subject: [#187 trouble with tuples]
Students and I make errors when the display is the same, even if there is a type information.
>From William Sit, Fri Jul 1 08:50:00 -0500 2005
There seems to be some bug in the display, because the code in Tuple (array1.spad) uses parenthesis, not brackets.
\begin{axiom}
coerce(a)$Tuple INT
coerce(a)@PRIMARR INT
\end{axiom}
This bug may be due to the Interpreter coercing 'Tuple INT' to 'PRIMARR INT' and then to 'OutputForm', which perhaps uses the List output. Tim Daly may know more.
\start
Date: Fri, 01 Jul 2005 08:23:08 -0500
From: MathAction (wyscc)
To: MathAction
Subject: [#187 trouble with tuples]
This "bug" may be due to the Interpreter coercing 'Tuple INT' to 'PRIMARR INT' and then to 'OutputForm', which perhaps uses the List output. The order of coercion may be governed by the conditional on coerce to 'Outputform' in 'Tuple S' ('S' needs to be of 'SetCategory').
\start
Date: Fri, 1 Jul 2005 12:18:28 -0700
From: Bob McElrath
To: list
Subject: IRC channel
With our new paid rock star, Kai, the pace of development has picked up
a bit.
I just wanted to remind everyone that I set up an IRC channel on
irc.freenode.net #axiom-developer. Probably a good way to discuss many
things, with faster response time than email.
After I get this SVG graphing widget demo working, maybe I'll try again
at that axiom bot I promised for the channel. ;)
\start
Date: Fri, 01 Jul 2005 14:53:28 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [Cartesian Product] (new)
++ This domain implements cartesian product
\begin{axiom}
)show Product
\end{axiom}
\begin{axiom}
)abbrev domain PRODUCT Product
Product (A:SetCategory,B:SetCategory) : C == T
where
C == SetCategory with
if A has Finite and B has Finite then Finite
if A has Monoid and B has Monoid then Monoid
if A has AbelianMonoid and B has AbelianMonoid then AbelianMonoid
if A has CancellationAbelianMonoid and
B has CancellationAbelianMonoid then CancellationAbelianMonoid
if A has Group and B has Group then Group
if A has AbelianGroup and B has AbelianGroup then AbelianGroup
if A has OrderedAbelianMonoidSup and B has OrderedAbelianMonoidSup
then OrderedAbelianMonoidSup
if A has OrderedSet and B has OrderedSet then OrderedSet
makeprod : (A,B) -> %
++ makeprod(a,b) \undocumented
selectfirst : % -> A
++ selectfirst(x) \undocumented
selectsecond : % -> B
++ selectsecond(x) \undocumented
T == add
--representations
Rep := Record(acomp:A,bcomp:B)
--declarations
x,y: %
i: NonNegativeInteger
p: NonNegativeInteger
a: A
b: B
d: Integer
--define
coerce(x):OutputForm == paren [(x.acomp)::OutputForm,
(x.bcomp)::OutputForm]
x=y ==
x.acomp = y.acomp => x.bcomp = y.bcomp
false
makeprod(a:A,b:B) :% == [a,b]
selectfirst(x:%) : A == x.acomp
selectsecond (x:%) : B == x.bcomp
if A has Monoid and B has Monoid then
1 == [1$A,1$B]
x * y == [x.acomp * y.acomp,x.bcomp * y.bcomp]
x ** p == [x.acomp ** p ,x.bcomp ** p]
if A has Finite and B has Finite then
size == size$A () * size$B ()
if A has Group and B has Group then
inv(x) == [inv(x.acomp),inv(x.bcomp)]
if A has AbelianMonoid and B has AbelianMonoid then
0 == [0$A,0$B]
x + y == [x.acomp + y.acomp,x.bcomp + y.bcomp]
c:NonNegativeInteger * x == [c * x.acomp,c*x.bcomp]
if A has CancellationAbelianMonoid and
B has CancellationAbelianMonoid then
subtractIfCan(x, y) : Union(%,"failed") ==
(na:= subtractIfCan(x.acomp, y.acomp)) case "failed" => "failed"
(nb:= subtractIfCan(x.bcomp, y.bcomp)) case "failed" => "failed"
[na::A,nb::B]
if A has AbelianGroup and B has AbelianGroup then
- x == [- x.acomp,-x.bcomp]
(x - y):% == [x.acomp - y.acomp,x.bcomp - y.bcomp]
d * x == [d * x.acomp,d * x.bcomp]
if A has OrderedAbelianMonoidSup and B has OrderedAbelianMonoidSup then
sup(x,y) == [sup(x.acomp,y.acomp),sup(x.bcomp,y.bcomp)]
if A has OrderedSet and B has OrderedSet then
x < y ==
xa:= x.acomp ; ya:= y.acomp
xa < ya => true
xb:= x.bcomp ; yb:= y.bcomp
xa = ya => (xb < yb)
false
\start
Date: Fri, 01 Jul 2005 14:47:21 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples] Cartesian products and tuples
I think the concept of a tuple and [Cartesian Product] should be related,
i.e. a tuple is an element of a Cartesian Product:
\begin{axiom}
)expose Product
makeprod(1,1.1)
f:(INT,Float)->Float
f:Product(INT,Float)->Float
\end{axiom}
\start
Date: Fri, 01 Jul 2005 14:38:13 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples]
These error messages indicate some serious problems
'Tuple Any' should work in a similar way to 'List Any' and
'DirectProduct(2,Any)'.
-------------------
f2(x,y)==x*y
f2(x,y)==x*y
\start
Date: Fri, 01 Jul 2005 19:50:48 -0500
From: MathAction (wyscc)
To: MathAction
Subject: [#187 trouble with tuples] Tuple, Product, Direct Product
Product can be looked up in hyperdoc. It is listed in Appendix C
(p. 613 of Axiom (paper) Book; p. 1028 of eBook). Tuple is more like
Direct Product since the entries must come from the same
domain. However, Product constructs only Cartesian product of two
domains; Direct Product requires a dimension parameter; whereas Tuple
does not (arbitrary length). Also Tuple is only a linear aggregate (or
PRIMARR) and has no algebraic structure. Direct product exists in many
categories.
So, a tuple is not an element of Product (it is a Cartesian product in
a loose mathematical sense: Tuple S is actually the infinite union of
DirectProduct(n,S) over all n.
\start
Date: Sat, 02 Jul 2005 09:52:40 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples]
I think a domain such as Product deserves (much) more documentation
then just to be listed in Appendix C! Of course that is also true of
many other domains in Axiom. It worries me that a 1000+ page book is
not nearly enough to properly document more than a small number of
Axiom's mathematical constructs. How big of a book do we need? Is the
idea of a "book" adequate at all? In fact Appendix C seems to be of
very little value to me.
> Tuple is more like Direct Product since the entries must come
> from the same domain.
The domain Tuple and the use of tuple in Axiom seems to be
a little confused. See page 1100 of Book::
tuple
an expression of two or more other expressions separated by
commas, for example, 4,7,11. Tuples are also used for multiple
arguments both for applications (for example, f (x,y)) and in
signatures (for example, (Integer, Integer) > Integer). A
tuple is not a data structure, rather a syntax mechanism for
grouping expressions.
This implies that we should not think of a function with
a signature like '(Integer,Float)->Float' as a mapping
'Product(Integer,Float)->Float' and it certainly isn't the
mapping 'Tuple Any -> Float', but elsewhere in Axiom the
notion of a function as a mapping is very important.
What I want is for Product to be generalized to an n-ary
[Cartesian Product] and then instead of expressions like:
\begin{axiom}
T1:=(1,1.1)
f:(Integer,Float)->Float
\end{axiom}
being interpreted as Tuples, I think such tuples should be
Products:
\begin{axiom}
(1,1.1)$(Product(Integer,Float)
f:Product(Integer,Float)->Float
\end{axiom}
\start
Date: Sat, 02 Jul 2005 09:55:26 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples]
I prefer to read (2,3) or 2,3 for tuple, and ![2,3] only for lists.
makeprod(1,1.1)$Product(Integer,Float)
\start
Date: Sat, 02 Jul 2005 10:45:48 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [DirectProduct] (new)
Description:
This type represents the finite direct or cartesian product of an
underlying component type. This contrasts with simple vectors in that
the members can be viewed as having constant length. Thus many
categorical properties can by lifted from the underlying component type.
Component extraction operations are provided but no updating operations.
Thus new direct product elements can either be created by converting
vector elements using the \spadfun{directProduct} function
or by taking appropriate linear combinations of basis vectors provided
by the \spad{unitVector} operation.
(from vector.spad.pamphlet)
\start
Date: Sat, 02 Jul 2005 10:38:29 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples] Tuple and ITUPLE
William Sit wrote:
> Tuple S is actually the infinite union of DirectProduct?(n,S) over all n.
What you describe sounds more like InfiniteTuple - another interesting
but undocumented domain.
\start
Date: Sat, 02 Jul 2005 11:54:29 -0500
From: MathAction (William Sit)
To: MathAction
Subject: [#187 trouble with tuples] [#187 trouble with tuples]
Bill Page wrote:
> I think a domain such as Product deserves (much) more documentation
> then just to be listed in Appendix C! Of course that is also true of
> many other domains in Axiom. It worries me that a 1000+ page book is
> not nearly enough to properly document more than a small number of
> Axiom's mathematical constructs. How big of a book do we need? Is the
> idea of a "book" adequate at all? In fact Appendix C seems to be of
> very little value to me.
Documenting the algebra code of Axiom is a very big project itself. I agree that
the Appendices are not that helpful.
> > Tuple is more like Direct Product since the entries must come
> > from the same domain.
>
> The domain Tuple and the use of tuple in Axiom seems to be
> a little confused. See page 1100 of Book::
>
> tuple
>
> an expression of two or more other expressions separated by
> commas, for example, 4,7,11. Tuples are also used for multiple
> arguments both for applications (for example, f (x,y)) and in
> signatures (for example, (Integer, Integer)b > Integer). A
> tuple is not a data structure, rather a syntax mechanism for
> grouping expressions.
>
> This implies that we should not think of a function with
> a signature like '(Integer,Float)->Float' as a mapping
> 'Product(Integer,Float)->Float' and it certainly isn't the
> mapping 'Tuple Any -> Float', but elsewhere in Axiom the
> notion of a function as a mapping is very important.
There is a subtle distinction. Tuples have no bounding parenthesis or brackets
or structures. It is simply a "list" in raw enumerated form. It is convenient
because it is a true list, where as a List object is a single object, not a
"list". This distinction is important in the notion of arity of operators (and
OOP).
> What I want is for Product to be generalized to an n-ary
> [Cartesian Product] and then instead of expressions like:
> \begin{axiom}
> T1:=(1,1.1)
> f:(Integer,Float)->Float
> \end{axiom}
>
> being interpreted as Tuples, I think such tuples should be
> Products:
> \begin{axiom}
> (1,1.1)$(Product(Integer,Float)
> f:Product(Integer,Float)->Float
> \end{axiom}
>
I don't agree. When one wraps up something into a single object, it is
inconvenient to look at the parts without unwrapping. (May be some optical
technology can? :-) Here in f you must take an integer and a float, wrap them up
into a product, and then unwrap it to compute the resulting float. For objects
that are complicated, there is of course a role to wrap up the pieces before
shipping. (Ever think of zipping if you are sending just two small files?)
\start
Date: Sat, 02 Jul 2005 11:58:32 -0500
From: MathAction (William Sit)
To: MathAction
Subject: [#187 trouble with tuples] [#187 trouble with tuples] Tuple and ITUPLE
Bill Page wrote:
> William Sit wrote:
>
> > Tuple S is actually the infinite union of DirectProduct?(n,S) over all n.
>
> What you describe sounds more like InfiniteTuple - another interesting
> but undocumented domain.
No. InfiniteTuple is more like stream. It is conceptually infinite in
length. A construct analogous to Tuple S is Matrix(R), which can have
arbitary but finite dimensions. Matrix(R) is conceptually the union of
Matrix(m,n,R) over all m and n. An object in Tuple S has arbitrary but
finite length.
\start
Date: Sun, 03 Jul 2005 21:40:31 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples]
> (1,1.1)$Product(Integer,Float)
\start
Date: Sun, 03 Jul 2005 22:48:32 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples] functions are objects of type Mapping
Bill Page wrote:
> I think such tuples should be Products ...
>From page 246 of the Axiom book:
"The type of a function is always a mapping of the form
Source -> Target where Source and Target are types."
and from page 1085:
"Domains Mapping, Record, and Union are primitive domains. All
other domains are written in the Axiom programming language ..."
\begin{axiom}
)show Mapping
Mapping(String,INT,Float)
\end{axiom}
>From a mathematical point of view clearly the idea that
Mapping(T, A, B) denotes the class of mappings from (A, B)
into T implies that (A,B) denotes some kind of set, i.e.
the Product(A,B).
William Sit wrote:
> I don't agree. When one wraps up something into a single object,
> it is inconvenient to look at the parts without unwrapping.
But [Cartesian Product] is implemented as a Record and the
domain Record is a primative in Axiom. So my proposal above
amounts to stating, for example, that:
\begin{axiom}
f1:Record(a:INT,b:FLOAT)->FLOAT
f1(arg)==arg.b+arg.a
f1[1,1.1]
\end{axiom}
should be viewed as equivalent to
\begin{axiom}
f2:(INT,FLOAT)->FLOAT
f2(a,b)==a+b
f2(1,1.1)
\end{axiom}
And in fact after a simple optimization, the compiler should
be able to produce equivalent internal lisp code.
\start
Date: Mon, 04 Jul 2005 08:20:03 -0500
From: MathAction (William Sit)
To: MathAction
Subject: [#187 trouble with tuples] [#187 trouble with tuples] functions are objectsof type Mapping
Bill Page wrote:
> From a mathematical point of view clearly the idea that
> Mapping(T, A, B) denotes the class of mappings from (A, B)
> into T implies that (A,B) denotes some kind of set, i.e.
> the Product(A,B).
> William Sit wrote:
>
> > I don't agree. When one wraps up something into a single object,
> > it is inconvenient to look at the parts without unwrapping.
(Disclaimer: my earlier response above is not directly to your new comment. See
previous post. I agree that the Cartesian product of A, B is implied in the
notion of Mapping(T,A,B). But that is *not* the issue here.)
In most mathematics I know, products, if they exist, are formed from objects of
the same category. If $f:A \times B \rightarrow C$ is a mapping, where $A$, $B$
are from the same category, we may sometimes let $D = A \times B$ and identify
$f$ as $f:D \rightarrow C$ (let me rename this to $g:D \rightarrow C$). However,
there is this subtle distinction in the way we give the definition of $f$ and
$g$. In the first case, we would write f(a,b) = c, where as in the second case,
we would write g(d) = c, with d = (a,b). The two are *not* equivalent as
*mappings*: $f$ is binary and $g$ is unary. To define $c$ to be $a+b$ in both
cases, say, it is straight forward in the first case $f(a,b)=a+b$. In the second
case, there is necessarily a composition with two projection maps $p:D
\rightarrow A$ and $q:D \rightarrow B$, where $p(d)=a$, $q(d) = b$. The true
definition of $g$ is: $g(d) = p(d)+q(d)$. If the target $C$ is more involved,
say $C$ is D^2$ and $f$ is meant to be the diagonal map $D \rightarrow D^2$,
then the $g$-form would be more preferrable: $g(d) = (d,d)$.
In short, Axiom imitates closely mathematics and gives us both ways to define
mappings. When the data structure is complicated, a Record is preferred.
In mathematics, we have been trained to be sloppy with details that have been
seen too often already, so as to contemplate at newer and more abstract levels.
We tend to see things as the same via isomorphisms. Now, we are forced to think
about all the details again in using Axiom. That is the main hurdle and a steep
"relearning" curve. Perhaps in 2032 (I'm not going to let this be a sliding
window of 30 years!), computer algebra can be smart enough to incorporate all
theorems (isomorphisms included) from a self-generated data-base and we don't
have to "relearn" what is in our subconsciousness.
> But [Cartesian Product] is implemented as a Record and the
> domain Record is a primative in Axiom. So my proposal above
> amounts to stating, for example, that:
> \begin{axiom}
> f1:Record(a:INT,b:FLOAT)->FLOAT
> f1(arg)==arg.b+arg.a
> f1[1,1.1]
> \end{axiom}
>
> should be viewed as equivalent to
> \begin{axiom}
> f2:(INT,FLOAT)->FLOAT
> f2(a,b)==a+b
> f2(1,1.1)
> \end{axiom}
>
> And in fact after a simple optimization, the compiler should
> be able to produce equivalent internal lisp code.
Axiom is a strongly typed language with object oriented roots. A
Record, even if it is a primary domain, is a single object. You cannot
have the compiler *sometimes* treat it as one object and *sometimes*
not. In your example, f1 has arity one (requiring two projection
maps), and f2 has arity two. In general, the compiler reads in a list
of arguments for a function and then parses it. I don't see much
optimization (the parser needs to work one level deeper to parse the
content of the record,and there is *no way* the generated code can be
simplified to remove this level because the arities are different).
In the second form, you *explicitly* tell the compiler that f2
requires two *objects* as inputs. In the first, only one. In terms of
data structure, Axiom *must* view arg as a Record object (note your
use of square brackets). In your scenario, you seem to suggest that
the compiler *automatically* changes the arity of f1 to the length of
the record. If so, I think this will only confuse users, even if that
change is restricted to Records appearing as function signatures.
There is also another problem with your automatic translation. In a
record, the *order* of the items is not important (conceptually
speaking), each field is tagged by an identifier. In a tuple, the
physical order is important and items are not tagged.
Please note also that Axiom *hides* the data representation of objects
from code external to the object constructors. So sometimes these
projections are *not* available (for 'Product' and domains of
'DirectProductCategory', they should be, and are).
\start
Date: Mon, 04 Jul 2005 12:25:29 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples]
let me rename this to:
$$g:D \rightarrow C$$
If the target $C$ is more involved, say $C$ is $D^2$ and $f$ is meant to be
the diagonal map
\start
Date: Mon, 04 Jul 2005 12:23:00 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples]
the same category. If $$f:A \times B \rightarrow C$$ is a mapping,
where $A$, $B$ are from the same category, we may sometimes let $$D =
A \times B$$ and identify $f$ as $$f:D \rightarrow C$$ let me rename
this to: $$g:D \rightarrow C$$.
However, there is this subtle distinction in the way we give the
definition of $f$ and $g$. In the first case, we would write f(a,b) =
c, where as in the second case, we would write g(d) = c, with d =
(a,b). The two are *not* equivalent as *mappings*: $f$ is binary and
$g$ is unary. To define $c$ to be $a+b$ in both cases, say, it is
straight forward in the first case $$f(a,b)=a+b$$
In the second case, there is necessarily a composition with two projection maps
$$p:D \rightarrow A$$
and
$$q:D \rightarrow B$$
where
$$p(d)=a$$
$$q(d) = b$$
The true definition of $g$ is:
$$g(d) = p(d)+q(d)$$
If the target $C$ is more involved, say $C$ is D^2$ and $f$ is meant to be the
diagonal map
$$D \rightarrow D^2$$
then the $g$-form would be more preferrable:
$$g(d) = (d,d)$$
\start
Date: Mon, 04 Jul 2005 12:08:17 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#187 trouble with tuples]
William Sit wrote:
> I agree that the Cartesian product of A, B is implied in the notion
> of Mapping(T,A,B). But that is not the issue here.
??? But that *is* precisely the issue with which **I am** concerned.
> products, if they exist, are formed from objects of the same
> category
Yes, I agree. I think program semantics must be expressed in some
"cartesian closed" category. See
http://en.wikipedia.org/wiki/Cartesian_closed_category
In the case of Axiom I think that it is highly significant
that "The category Cat of all small categories (with functors
as morphisms) is cartesian closed;". And the choice of Mapping,
Record and Union as primatives in Axiom directly supports this
notion.
> The two are not equivalent as mappings: f is binary and g is unary.
I disagree strongly with your analysis. These two things are formally
identical. No "subtle distinction" is necessary or relevant.
> A Record, even if it is a primary domain, is a single object.
> You cannot have the compiler sometimes treat it as one object
> and sometimes not.
I agree. My point is that the expression '(A,B)' in the Mapping
'(A,B)->C', does in fact denote a single object, not two objects.
It is clear that when we write 'f(a,b) == a+b' in the definition
of the function 'f:(A,B)-> C', that 'a' and 'b' denote composition
with the necessary projections - that is precisely what we mean
when we say that 'a' and 'b' are "formal parameters" of the
function.
Your definition of "arity" is wrong. A function with multiple
inputs is necessarily defined over a product and has an "arity"
equal to the size of that product. I think Axiom's definition of
Mapping is wrong to admit more than two arguments (mapping should
be semantically equivalent to exponentiation in a cartesian closed
category). It is confusing and unnecessarily complicated from a
mathematical point of view to define Mapping(C,A,B) as different
from Mapping(C,Product(A,B)). It makes a vacuous distinction where
none is necessary.
> In a record, the order of the items is not important (conceptually
> speaking), each field is tagged by an identifier. In a tuple, the
> physical order is important and items are not tagged.
That is not true. As long as we admit a Tuple as a domain and not
"just a syntactic construct" (what ever that might mean), in a Tuple
the "fields" are simply tagged by their order - or better: indexed
by '1..n'. In Records these "tags" are given names. In both cases
these are formally just different names for projections from a
product. In Axiom the fields of a Record are also given in an order
that allows for example the assignment:
\begin{axiom}
R:Record(a:Integer,b:Float):=[1,1.1]
\end{axiom}
\start
Date: Mon, 04 Jul 2005 12:42:21 -0500
From: MathAction (anonymous)
To: MathAction
Subject: [#189 Graphics does not work on Debian] (new)
Axiom does not start if you start it in an X session.
GUI fails completely:
user@home:~$ axiom
ptyopen: Failed to grant access to slave device: No such file or directory
ptyopen: Failed to get name of slave device: No such file or directory
ptyopen: Failed to open slave: Bad address
fork_Axiom: Failed to reopen server: No such file or directory
ptyopen: Failed to grant access to slave device: No such file or directory
ptyopen: Failed to get name of slave device: No such file or directory
ptyopen: Failed to open slave: Bad address
clef trying to get the initial terminal settings: Invalid argument
This is under a chrooted environment. Is this relevant?
\start
Date: Mon, 04 Jul 2005 12:53:37 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [#93 Confusing amount of information on Axiom (beginner's issue)] content-management software
The Axiom web site is already based on content-management software.
The fact these pages might be confusing is due to either a lack of
talent or time (or both). As an Axiom user, your participation in
improving these pages is **strongly** encouraged. Please edit them
and add your own improved content. Everyone will benefit.
\start
Date: Mon, 04 Jul 2005 16:53:14 -0500
From: MathAction (Bob McElrath)
To: MathAction
Subject: [#189 Graphics does not work on Debian] See
You must be running on a system which does not have Unix98 pty's. (e.g.
/dev/ptmx) As this is by now an old standard, I'm confused why so many
people are running into this problem. It's included since the 2.1
series of linux kernels. Could you provide some more information about
your distro/kernel? Specifically, kernel version, distro version, does
/dev/ptmx exist? Is devpts mounted? Does chroot prevent you from using
ptmx due to file premissions? What/how is your chroot set up? Is it a
common configuration? Is it something you did by hand or did you
install some debian package which did it for you?
If machines with this problem are so common, we can fix it by falling
back to the BSD-style pty allocation in src/lib/openpty.c.pamphlet
(patch follows). Reporter: can you answer the above questions and/or
test the below patch?
--- openpty.c.pamphlet.orig 2005-07-04 14:37:38.000000000 -0700
+++ openpty.c.pamphlet 2005-07-04 14:39:23.000000000 -0700
@@ -177,9 +177,32 @@
if (ioctl(fds, I_PUSH, "ldterm") < 0)
perror("ptyopen: Failed to push idterm");
#endif
+#if defined(LINUXplatform) /* Linux with old-style BSD pty's (not Unix98 devpts) */
+ int looking = 1, i;
+ int oflag = O_RDWR; /* flag for opening the pty */
+
+ for (i = 0; looking && i < 1000; i++) {
+ makeNextPtyNames(controllerPath, serverPath);
+ if (access(controllerPath, 6) != 0) continue;
+ *controller = open(controllerPath, oflag, 0);
+ if (*controller >= 0) {
+ *server = open(serverPath, oflag, 0);
+ if (*server > 0)
+ looking = 0;
+ else
+ close(*controller);
+ }
+ }
+ if (looking) {
+ fprintf(stderr, "Couldn't find a free pty.\n");
+ exit(-1);
+ }
+ return (*controller);
+#else
strcpy(serverPath,slavename);
*controller=fdm;
*server=fds;
+#endif
}
}
return(fdm);
\start
Date: Mon, 04 Jul 2005 16:57:02 -0500
From: MathAction (anonymous)
To: MathAction
Subject: [#189 Graphics does not work on Debian]
??changed:
-test the below patch?
-
---- openpty.c.pamphlet.orig 2005-07-04 14:37:38.000000000 -0700
-+++ openpty.c.pamphlet 2005-07-04 14:39:23.000000000 -0700
-@@ -177,9 +177,32 @@
- if (ioctl(fds, I_PUSH, "ldterm") < 0)
- perror("ptyopen: Failed to push idterm");
- #endif
-+#if defined(LINUXplatform) /* Linux with old-style BSD pty's (not Unix98 devpts) */
-+ int looking = 1, i;
-+ int oflag = O_RDWR; /* flag for opening the pty */
-+
-+ for (i = 0; looking && i < 1000; i++) {
-+ makeNextPtyNames(controllerPath, serverPath);
-+ if (access(controllerPath, 6) != 0) continue;
-+ *controller = open(controllerPath, oflag, 0);
-+ if (*controller >= 0) {
-+ *server = open(serverPath, oflag, 0);
-+ if (*server > 0)
-[18 more lines...]
test the below patch?::
--- openpty.c.pamphlet.orig 2005-07-04 14:37:38.000000000 -0700
+++ openpty.c.pamphlet 2005-07-04 14:39:23.000000000 -0700
@@ -177,9 +177,32 @@
if (ioctl(fds, I_PUSH, "ldterm") < 0)
perror("ptyopen: Failed to push idterm");
#endif
+#if defined(LINUXplatform) /* Linux with old-style BSD pty's (not Unix98 devpts) */
+ int looking = 1, i;
+ int oflag = O_RDWR; /* flag for opening the pty */
+
+ for (i = 0; looking && i < 1000; i++) {
+ makeNextPtyNames(controllerPath, serverPath);
+ if (access(controllerPath, 6) != 0) continue;
+ *controller = open(controllerPath, oflag, 0);
+ if (*controller >= 0) {
+ *server = open(serverPath, oflag, 0);
+ if (*server > 0)
+ looking = 0;
+ else
+ close(*controller);
+ }
+ }
+ if (looking) {
+ fprintf(stderr, "Couldn't find a free pty.\n");
+ exit(-1);
+ }
+ return (*controller);
+#else
strcpy(serverPath,slavename);
*controller=fdm;
*server=fds;
+#endif
}
}
return(fdm);
\start
Date: Tue, 05 Jul 2005 11:45:05 -0500
From: MathAction (wyscc)
To: MathAction
Subject: [#187 trouble with tuples]
??changed:
-> \begin{axiom}
-> f1:Record(a:INT,b:FLOAT)->FLOAT
-
-> f1(arg)==arg.b+arg.a
-> f1[1,1.1]
-> \end{axiom}
->
-> should be viewed as equivalent to
-> \begin{axiom}
-> f2:(INT,FLOAT)->FLOAT
-> f2(a,b)==a+b
-> f2(1,1.1)
-> \end{axiom}
->
>
> (code snipped, see above)
>
In the second form, you *explicitly* tell the compiler that 'f2' requires two
arity of 'f1' to the length of the record. If so, I think this will only confuse
++added:
>From William Sit Tues Jul 5 12:29:00 -5:00 2005
Bill Page wrote:
PS. Sorry these discussions get longer and longer. I know you are not
shy about long discussions. Let's hope we can come to some
understanding.
> William Sit wrote:
>
> > I agree that the Cartesian product of A, B is implied in the notion
> > of Mapping(T,A,B). But that is not the issue here.
>
> ??? But that *is* precisely the issue with which **I am** concerned.
No one is saying that *mathematically* '(A,B)' is not 'A x B'. THEY
ARE! Here, 'A x B' is only a mathematical notation for '(A,B)'.
There is no Axiom domain with that notation. 'Mapping(C,A x B)' has
no meaning in Axiom. That was the reason I said this is not the issue
here. I'll refrain from using this notation when discussing Axiom,
since it only confuses the issues. The Cartesian product in Axiom is
either '(A,B)' or 'Product(A,B)', the latter is what I should have
denoted as 'D'.
> http://en.wikipedia.org/wiki/Cartesian_closed_category
Thanks for the pointer. Always nice to learn new jargon.
> > The two are not equivalent as mappings: f is binary and g is unary.
>
> I disagree strongly with your analysis. These two things are formally
> identical. No "subtle distinction" is necessary or relevant.
We don't agree then (even though I don't know what you mean by
"formally identical"). The distinction is both subtle and still very
relevant! The distinction is between 'Mapping(C,A,B)' and
'Mapping(C,D)' when 'D' is treated as an entity in itself (that is,
when you start writing 'Product(A,B)' in Axiom for '(A,B)',
"wrapping" the components).
> > A Record, even if it is a primary domain, is a single object.
> > You cannot have the compiler sometimes treat it as one object
> > and sometimes not.
>
> I agree. My point is that the expression '(A,B)' in the Mapping
> '(A,B)->C', does in fact denote a single object, not two objects.
> It is clear that when we write 'f(a,b) == a+b' in the definition
> of the function 'f:(A,B)->C', that 'a' and 'b' denote composition
> with the necessary projections - that is precisely what we mean
> when we say that 'a' and 'b' are "formal parameters" of the
> function.
>
> Your definition of "arity" is wrong. A function with multiple
> inputs is necessarily defined over a product and has an "arity"
> equal to the size of that product.
I see, this is what we are talking about: how to count arguments.
That depends on what you meant by "multiple inputs". We cannot
discuss about arity unless we first agree to allow the notation for
many-to-one functions: 'f:(A1,A2,...,Am)->C' is a function with 'm'
inputs. According to my understanding of the previous quote, you
consider '(A1,A2, ..., Am)' as one object, living in some Cartesian
product, and yet, you also consider that, in 'f(a1, a2, ..., am)', the
'a1, a2, ..., am' are "formal parameters" and the arity is the size of
the product, namely 'm'. This is a syntactic definition and I don't
think it is different from mine (if I ever gave one).
I would like to point out, however, that the domains 'A1, A2, ..., Am'
are considered *atomic* in this counting: that is, we do not look
inside each component, to see how they are constructed. This is how I
understand the word "formal" as in "formal parameter". So arity is
the number of formal parameters. If 'A1' turns out to be a Cartesian
product of three domains, we do not view 'A1' as contributing 3 to the
arity of 'f'. Perhaps you do not agree with this. I'll discuss later
the consequence of not viewing the components as anything other than
atomic as far as arity goes.
More specifically, your definition above first wraps the multiple
inputs (the "many") as a product and then unwraps it to count the
dimension. The number of inputs never changes in the process and is
the arity.
Notice you said this: 'a' and 'b' are "formal parameters" of the
function 'f(a,b)=a+b'. The number of *formal parameters* is precisely
the arity of the function. As long as 'a' and 'b' are supplied in the
form of parameters to a function, they are counted towards the arity
of the function. You think the composition with the projection is
implied and view '(A,B)' as "a single object". To me, '(A,B)'
definitely denotes two objects: it is spelled out loud and clear. I
am not disagreeing with your interpretation that '(A,B)' is identical
to the (mathematical) Cartesian product 'A x B' and by its notation,
'A x B', just like '(A,B)' indicates two objects are involved. But
when you *encapsulate* the cartesian product by giving it the first
class status as a new domain, by denoting it as 'Product(A,B)' or
more appropriately, as I did, as 'D', that is when it becomes one
object. This process of encapsulation is not trivial, and hides 'A',
'B' from the domain despite their appearances in 'Product(A,B)'. This
is much more than the mathematical sentence "Let D be A x B."
Encapsulation is where one starts going into the realm of computer
science. This is where the "subtle distinction" originates. When we
write 'g:D->C', the arity of 'g' is one because 'D' now becomes
atomic.
Let's look at another example regarding atomicity of parameters. If I
write a mapping in Axiom, 'f:Complex Integer->Float', would you
say 'f' has arity two just because a Gaussian integer *may be*
represented by two integers? In Axiom and object oriented languages,
I would consider 'f' having only *one* input, not two. I am not
supposed to look inside what the *data representation* of a 'Complex
Integer' is (indeed, I should *not* need to know; I may need to know
about the real and imaginary parts, but the data representation, or
inputs if you will, could be very different). Of course, if you write
the domain of 'f' in terms of these parts, 'a' and 'b', of a Gaussian
integer 'a+b i', it would have arity two and the signature would then
be: 'f:Integer x Integer->Float'. You do lose the identity of
the domain 'Complex Integer'. For illustration, I could also have
represented 'a+b i' by 'x,y,z', where 'x' is 'gcd(a,b)', 'y = a/x',
and 'z = b/x', using three integers (by the way, this would also be a
possible data representation of the Cartesian product 'Integer x
Integer'). Would you then say 'f' now has three inputs and arity 3?
There are many mathematical objects that are data-represented using
products of sets, but the arity of a function is the number of
*formal* arguments, not what the data representation of the domain of
the function is. Arity is an important notion even in mathematics
(recall the chain rule for several variables). There is some slight
difference in usage though. In computer languages, the number of
arguments are sometimes not fixed, known as *variable arity*, which in
fact, amounts to *one* list of arguments. In Axiom, I would much
prefer to call a function with source 'List ANY' as having arity one.
Take a harder example, if I write a mapping 'p:POLY INT->NNI',
what is the arity of 'p'? Are you going to say it is the number of
coefficients, which depends on the degree of the given polynomial and
hence has variable arity?
So getting back to my "subtle distinction": in 'g:D->C', where 'D' is
'Product(A,B)', the arity of 'g' is one; in 'f:(A,B)->C', the arity
of 'f' is two. It is the *formal* way the function is declared that
determines the arity, and the *mathematical* equivalences among 'D',
'(A,B)', and the mathematical object 'A x B' does not necessarily
preserve arity. In mathematics, there is but one Cartesian product of
'A' and 'B'. In computing, there are two, a raw version '(A,B)' and
an encapsulated version 'Product(A,B)'. The formal use of the symbol
'D' in declaring 'f' signifies an encapsulation.
(aside) In fact, in many Axiom constructors, to get around this
encapsulation, extra parameters are necessary, for example, in
Groebner basis package, the calling convention is::
'GroebnerPackage(Dom,Expon,VarSet,Dpol)'
where 'Dom', 'Expon' and 'VarSet' are all duplicated because they are
encapsulated in 'Dpol', which is a domain of
'POLYCAT(Dom,Expon,VarSet)'. Currently, there is no other way to
extract the parameter domains from domain constructors. But this is
another story. (My wish list includes each domain constructor freeing
the encapsulated parameter domains).
Arity may change when one makes substitutions (which is composition)!
So substituting '(A,B)' by 'D' or the other way around are both
compositions with an isomorphism (note). The map 'g' is the
composition of 'h:D->(A,B)' with 'f:(A,B)->C'. The signature of the
composite 'f o h' is not the same as the original map 'f' and the
arity of the composite need not be the same, and is not the same in
this case. (Of course, 'h' is not allowed in Axiom, the source of all
these discussions! but perfectly ok mathematically for many-to-many
functions.)
(note) Here the map is of course the identity map. But it is not
instructive to think that way. Rather, because we deliberately give
the Cartesian product a new identity, not as made up of two component
parts, but as a new object. It may be helpful to think of 'D' as just
another Cartesian product of 'A' and 'B' and by universal property is
isomorphic to '(A,B)'. In an object oriented language like Axiom, new
objects must not be thought of as just the sum of its parts, which
should be hidden, but available when needed. Polynomials would be a
good example. But 'D' with the representation '(x,y,z)' given above
is simpler and we can indeed have an isomorphism between 'h:D->(A,B)'
defined by 'h(d) = (d.x * d.y, d.x * d.z)'.
> I think Axiom's definition of
> Mapping is wrong to admit more than two arguments (mapping should
> be semantically equivalent to exponentiation in a cartesian closed
> category). It is confusing and unnecessarily complicated from a
> mathematical point of view to define Mapping(C,A,B) as different
> from Mapping(C,Product(A,B)). It makes a vacuous distinction where
> none is necessary.
On the contrary. It is the idealistic mathematical view which
identifies the two that creates "vacuous" wraps and unwraps "where
none is necessary". Indeed, I would have preferred mapping to be
many-to-many so that this wrapping and unwrapping are unnecessary both
on the source and target sides. I have argued that it is convenient
not to have to wrap cartesian products with few components. Your
correct but pedantic mathematical view of 'Mapping(Y,X)' as $Y^X$
would require wrapping on both source and targets for all mappings and
turn these multi-inputs and multi-outputs into cartesian products. It
[81 more lines...]
\start
Date: Tue, 05 Jul 2005 15:07:39 -0500
From: MathAction (wyscc)
To: MathAction
Subject: [Tuples Products And Records]
'Product' can be looked up in hyperdoc. It is listed in Appendix C (p. 613 of Axiom (paper) Book; p. 1028 of eBook). 'Tuple' is more like 'DirectProduct' since the entries must come from the same domain. However, 'Product' constructs only Cartesian product of two domains; 'DirectProduct' requires a dimension parameter; whereas 'Tuple' does not (arbitrary length). Also 'Tuple' is only a linear aggregate (or 'PRIMARR') and has no algebraic structure. Direct product exists in many categories.
So, a tuple is not an element of 'Product' (it is a Cartesian product in a loose mathematical sense: 'Tuple S' is actually the infinite union of 'DirectProduct(n,S)' over all 'n'.
I think a domain such as 'Product' deserves (much) more documentation
\start
Date: Tue, 05 Jul 2005 15:39:14 -0500
From: MathAction (wyscc)
To: MathAction
Subject: [MathAction problems] Breaking up scrolling, competitive edits
Is it possible (and easy) to break the MathAction screen into two
independent scroll areas during editing mode, one for editing and one
for preview? That way, one can keep track of editing
better. Currently, the preview screen scroll dominates; so the request
is to limit the preview screen scroll just like the edit area scroll,
in its own subwindow.
Also, right now, when a page is being edited, it is not locked, and
there is a chance (it happens often enough) that someone else may beat
one to the finish before a save. Is there an easy way to merge the two
edits so the slow guy would not lose the edits? (Otherwise, the only
way would be to save frequently, generating a lot of uninteresting
reports.)
How about an alert if two people are editing the same page at the same time?
\start
Date: Tue, 05 Jul 2005 16:14:20 -0500
From: MathAction (billpage)
To: MathAction
Subject: [Tuples Products And Records] functional-categorical programming versus object-oriented programming
William Sit wrote:
> Sorry these discussions get longer and longer.
On the contrary, that *is* one of the purposes of this web site.
I will expand on that point in the [Axiom Colloquium].
> Let's hope we can come to some understanding.
Yes, I think so. Afterall, mathematics is an *objective* science.
But sometimes this does required considerable effort and patience. :)
> Mapping(C,A x B) has no meaning in Axiom.
But I have already written the equivalent:
\begin{axiom}
f:Mapping(STRING, Product(INT,FLOAT))
\end{axiom}
and this has a clear meaning in Axiom. Using names like
\begin{axiom}
C:=STRING
D:=Product(INT,FLOAT)
f:D->C
\end{axiom}
makes no difference. My view is that
\begin{axiom}
f:Mapping(STRING,INT,FLOAT)
\end{axiom}
should have the same meaning as the previous expression.
The fact that is doesn't seems unnecessary and confusing.
About Cartesian closed categories:
> Always nice to learn new jargon.
But the concept of a [Cartesian Closed Category] is much
more important than mere jargon! It provides the categorical
basis for typed lambda calculus and thus essentially all of
the theory of computation, modern functional programming and
languages such as OCAML.
> Encapsulation is where one starts going into the realm of computer
> science. This is where the "subtle distinction" originates.
In the context of Axiom I strongly object to creating such
"subtle distinctions". Axiom is intended to be a system for
doing mathematics with a computer. I think the programming
language in which we express mathematical algorithms should
be a close as possible to the actual mathematics. This is one
of the things that distinquishes Axiom from other "engineering-
oriented" computer algebra systems like Maple and Mathematica.
> In mathematics, there is but one Cartesian product of A and B.
> In computing, there are two, a raw version (A,B) and an
> encapsulated version Product(A,B).
To me, when applied to Axiom this is wrong! wrong! wrong! :)
We do not need this kind of distinction.
> If I write a mapping in Axiom, 'f:Complex Integer->Float', would
> you say f has arity two just because a Gaussian integer may be
> represented by two integers?
No. I think the product '(A,B)' in the signature of a function
(mapping) such as 'f:(A,B)->C' plays a more fundamental role in
the semantics of the Axiom programming language than derived
domains such 'Complex Integer'. That is why the domain 'Record'
is considered a "primative". These are the basic types of things
that we need to define more complex things.
> It is the idealistic mathematical view which identifies the two
> that creates "vacuous" wraps and unwraps "where none is necessary".
No. There are no unnecessary "wraps and unwraps". This is just
normal paramater passing. The compiler only needs to do what
is usually necessary to pass, for example the tuple (a,b) i.e.
object of type Product(A,B), to the body of the function by
pushing the values of the projections onto the stack.
> It makes no sense to encapsulate objects from unrelated domains
> just because they happen to be the argument types of some function.
I disagree. This makes perfectly good sense in the context of the
cartesian closed category CAT of small categories. I think this
the foundation on which all of Axiom's algebra and it's programming
language should be based.
> why should the data-structures be the "canonical" cartesian product
> structure
Precisely because of the special role that products play in the
concept of a cartesian closed category.
\start
Date: Tue, 05 Jul 2005 21:33:27 -0500
From: MathAction (billpage)
To: MathAction
Subject: [MathAction problems] two independent scroll areas during editing mode
William Sit asked:
> Is it possible (and easy) to break the MathAction screen into two
> independent scroll areas during editing mode, one for editing and
> one for preview?
Great suggestion! Yes it is possible and it wasn't too difficult.
Please try the new edit/preview page format and let me know if
this works better for you.
About competing edits: Merging simultaneous edits is quite hard.
MathAction is based on ZWiki so it behaves as described here:
http://zwiki.org/GeneralDiscussion200311
"Zwiki prevents data loss due to simultaneous edits, throwing
up a warning when the second person tries to save. It doesn't
warn you earlier - can't, really. Normally when someone else is
active on a page you'll see a very recent last edited timestamp,
and you'll be forewarned. What it could do, and doesn't, is assist
the second editor in merging their edits, instead of just telling
them to go back and start again. I believe this situation happens
rarely on most sites, though."
Improvements to this behaviour is still on the "wish list":
http://zwiki.org/661GiveMoreWarningOfSimultaneousEdits
\start
Date: Tue, 05 Jul 2005 21:41:15 -0500
From: MathAction (billpage)
To: MathAction
Subject: [MathAction problems] controlling edit window height
In "preferences":UserOptions you can change the height
of the edit window from the default of 20 lines of text
to something smaller or larger. Click 'Save' and then
the size of the edit window will change the next time
you click "edit":editform.
\start
Date: Tue, 05 Jul 2005 22:00:00 -0500
From: MathAction (William Sit)
To: MathAction
Subject: [MathAction problems] [MathAction problems] two independent scrollareas during editing mode
billpage wrote:
> Please try the new edit/preview page format and let me know if
> this works better for you.
Excellent, thanks for the speed job. It works quite well and I can synchronize
(manually) the editing and preview.
The preview area on my screen is about half the height of the editing area. Can
that be made more even?
\start
Date: Tue, 05 Jul 2005 22:05:00 -0500
From: MathAction (William Sit)
To: MathAction
Subject: [MathAction problems] [MathAction problems] controlling edit windowheight
billpage wrote:
> In the "preferences":UserOptions menu you can change the height
> of the edit window from the default of 20 lines of text to
> something smaller or larger. Click 'Save' and then the size
> of the edit window will change the next time you click 'edit'.
You must be reading my mind.
Now, will you be providing similar control for the preview window?
\start
Date: Wed, 06 Jul 2005 00:09:50 -0500
From: MathAction (wyscc)
To: MathAction
Subject: [Tuples Products And Records]
++added:
From: wyscc Wed Jul 6 00:49:00 -5:00 2005
billpage wrote:
> makes no difference. My view is that
> (code snipped)
> should have the same meaning as the previous expression.
Of course you are correct here, but you are still missing my point. I
was using 'D' for 'Product(A,B)' to emphasize that in 'Product(A,B)',
'A' and 'B' are no longer by default available because they have been
encapsulated (encapsulation need neither necessarily hide nor not hide
information). But the distinction is that 'Product(A,B)' is not the
same as '(A,B)' computationally, as it is currently in Axiom, and no
amount of mathematical identifying each to 'A x B' is going to erase
the distinction. This is computation, not mathematics! In symbolic
computation, many concepts in mathematics split into computational
branches because of different applications of the same mathematical
domain. Sparse matrices versus dense matrices is an example.
> But the concept of a [Cartesian Closed Category] is much
> more important than mere jargon!
I was half-joking. I went and read the articles (about currying, for
example) until I had to stop! But a first step is always getting
familiar with the jargon. There are relatively few ideas but lots of
jargon for the same thing. So currying is nothing but specialization,
something mathematicians have used to turn say group multiplication
into the group acting on itself. At the end of the day, one still has
to write the binary multiplication routine to compute.
> In the context of Axiom I strongly object to creating such
> "subtle distinctions". Axiom is intended to be a system for
> doing mathematics with a computer.
The distinction is really not "subtle" but a key one for object
oriented programming (of course I didn't realize this earlier since I
was, and still am, just exploring along with you). Unfortunately, this
seems unavoidable in computing. In order to be able to speak of a
polynomial, say, as an abstract mathematical object (so we can
differentiate, integrate, etc) in as general a fashion as possible
(meaning allowing different data representation, for one, but ignoring
these at the same time), we have to omit mentioning the details until
we need them for computation. So we can say 'differentiate(p)' when
'p' is a polynomial, no matter what domain in POLYCAT p comes from. I
think that is what distinguishes Axiom from M&M.
We are (and certainly Axiom is) very far away from your ideal of
"doing mathematics" using a computer. We can't really do "symbolic
computation" the way a human mind can. Consider how a computer can
interpret what mathematicians call ... (ellipsis) and compute with
it. If you know any language that can handle that (and I don't mean
just sums or products but something iterated in general, like iterated
integrals with ellipsis between two integral signs), I would be very
interested.
> > In mathematics, there is but one Cartesian product of A and B.
> > In computing, there are two, a raw version (A,B) and an
> > encapsulated version Product(A,B).
>
> To me, when applied to Axiom this is wrong! wrong! wrong! :)
> We do not need this kind of distinction.
May be not for simple constructs like the Cartesian product (even
though there is still a role for encapsulation). How about there is
just one polynomial ring in several variables over say the integers,
but Axiom has DMP, HDMP, GDMP, SMP, and POLY? What would be the single
implementation of the polynomial ring be?
> > If I write a mapping in Axiom, 'f:Complex Integer->Float', would
> > you say f has arity two just because a Gaussian integer may be
> > represented by two integers?
>
> No. I think the product '(A,B)' in the signature of a function
> (mapping) such as 'f:(A,B)->C' plays a more fundamental role in
> the semantics of the Axiom programming language than derived
> domains such 'Complex Integer'. That is why the domain 'Record'
> is considered a "primative". These are the basic types of things
> that we need to define more complex things.
No quarrel with that, but where do you draw the line? When does a
domain become "derived enough" to count as one object one parameter?
You did not answer my question on arity. I already commented on the
role of 'Record'.
> > It is the idealistic mathematical view which identifies the two
> > that creates "vacuous" wraps and unwraps "where none is necessary".
>
> No. There are no unnecessary "wraps and unwraps". This is just
> normal paramater passing. The compiler only needs to do what
> is usually necessary to pass, for example the tuple (a,b) i.e.
> object of type Product(A,B), to the body of the function by
> pushing the values of the projections onto the stack.
I can't agree that you can equate a tuple '(a,b)' with an object of
type 'Product(A,B)' because such equating does not generalize. In your
mindset, 'Product(A,B)' *is* '(A,B)'. Just because a tuple '(a,b)' is
*one* way, even the canonical way, to represent objects of
'Product(A,B)' does not give it the right to be the only way. There
are other ways and other uses of 'Product(A,B)'. The design of the
domain 'Product(A,B)' need not be dominated by the two projection
maps. There are also more complicated tuples if every domain is
unwrapped to the basics like integers. If you identify 'Product(A,B)'
with '(A,B)', so there is no wrap and unwrap, then why not just use
'(A,B)'? Is it just because you rather *rename* '(A,B)' as
'Product(A,B)' in function declarations? (That would be syntactic
sugar if the current 'Product' is removed or renamed)
> > It makes no sense to encapsulate objects from unrelated domains
> > just because they happen to be the argument types of some function.
>
> I disagree. This makes perfectly good sense in the context of the
> cartesian closed category CAT of small categories. I think this
> the foundation on which all of Axiom's algebra and it's programming
> language should be based.
Care to elaborate? I fail to follow your logic. You on the one hand
want 'Product(A,B)' not to encapsulate 'A' and 'B' (by identifying it
as '(A,B)') and on the other hand want to encapsulate all parameters?
Even though encapsulation wraps data into a structure, its use goes
far beyond just that. One main programming design is careful planning
for information hiding that encapsulation facilitates (but not
necessarily always). Needlessly encapsulating the set of parameters of
every function only creates needless coercions.
Consider the two ways of coding
g:(INT,INT)->INT
g(a,b)==a+b
g(1,2)
f:Product(INT,INT)->INT
f(z)==(selectfirst z)+selectsecond(z)
f(makeprod(1,2))
Which is more convenient?
> > why should the data-structures be the "canonical" cartesian product
> > structure
>
> Precisely because of the special role that products play in the
> concept of a cartesian closed category.
So, use tuples.
Is CCC the only kind of categories in symbolic computation?
\start
Date: Wed, 06 Jul 2005 16:16:49 -0500
From: MathAction (billpage)
To: MathAction
Subject: [MathAction problems] controlling preview window height
In the 'preferences' menu look for the line::
Editform width: 60 height: 20 Preview height: 20
You can now change the height of both the edit window and the
preview window from the default of 20 lines of text to something
smaller or larger. Click 'Save' and then the size of the windows
will change the next time you click 'Edit' and 'Preview'.
\start
Date: Wed, 6 Jul 2005 18:23:23 -0500
From: arch@axiom-developer.org
To: Kai Kaminski
Subject: axiom--GUI--1
Kai and *,
A new project has been set up in arch called axiom--GUI--1
To check it out type:
tla get axiom--GUI--1
The project is writeable by everyone who has sent me ssh keys.
\start
Date: Wed, 06 Jul 2005 19:17:17 -0500
From: MathAction (billpage)
To: MathAction
Subject: [MathAction problems] edit and preview window synchronization
William Sit wrote:
> I can synchronize (manually) the editing and preview.
Try clicking the box labelled 'Sync [ ]' below the edit scrollbar.
When this box is checked 'Sync [x]' the edit and preview windows are
synchronized. On Internet Explorer the sychoronization is immediate.
On FireFox (due to a bug in current version of FireFox) the sychnronization
occurs only when you click the mouse in the text window.
Please let me know how this works for you. If there is a problem,
please tell me what browser you are using.
\start
Date: Wed, 06 Jul 2005 20:39:23 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [MathAction problems]
Try clicking the box labelled 'Sync()' below the edit scrollbar.
When this box is checked 'Sync(x)' the edit and preview windows are
On !FireFox (due to a bug in current version of !FireFox) the sychnronization
\start
Date: Wed, 06 Jul 2005 22:25:37 -0500
From: MathAction (William Sit)
To: MathAction
Subject: [MathAction problems] [MathAction problems] edit and preview windowsynchronization
billpage wrote:
>
> Try clicking the box labelled 'Sync [ ]' below the edit scrollbar.
> When this box is checked 'Sync [x]' the edit and preview windows are
> synchronized.
Wow, this is working great! It will save a ton of time editing.
Thanks.
In Internet Explorer and Firefox, if the Sync[] is checked when the windows are
out of sync, they will sync with this offset after the Sync[x]. (Not
complaining, just an observation).
In the preference, would it be possible to use percent of vertical space instead
of number of lines? That way, if the size of the browser window is changed,
(maybe) the two windows will resize proportionally?
\start
Date: Thu, 07 Jul 2005 00:32:01 -0500
From: MathAction (billpage)
To: MathAction
Subject: [MathAction problems] preview of comments
Here's the last thing on my !MathAction wishlist for now ...
It is now possible to preview your comments before adding them
to a page! Comment preview works the same way as when editing a
whole page, but only the new text is displayed in the preview
window. You must click 'Save' to actually add the comment to
the page.
Previewing is especially important for the !MathAction wiki because
typing correct $\text{\LaTeX}$ and Axiom commands is often more
difficult that when just writing plain text.
\start
Date: Thu, 07 Jul 2005 05:28:35 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [Sandbox Curry] (new)
Using the compiler we can write:
\begin{axiom}
)abbrev package MAPPK3C MappingPackage3c
++ Description: Higher-order Currying operations.
MappingPackage3c(A:SetCategory, B:SetCategory, C:SetCategory):_
MPcat == MPdef where
MPcat == with
curryR: ((A,B)->C) -> (B->(A ->C))
curryL: ((A,B)->C) -> (A->(B ->C))
MPdef == add
MappingPackage3(A, B, C)
fabc: (A,B)->C
curryR(fabc) == curryRight(fabc,#1)
curryL(fabc) == curryLeft(fabc,#1)
\end{axiom}
\begin{axiom}
plus:(INT,INT)->INT
plus(x,y) == x+y
plusX:=curryL(plus)
\end{axiom}
\start
Date: Thu, 07 Jul 2005 06:06:00 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [Sandbox Curry]
curried_plus:INT->(INT->INT)
curried_plus(x) == curryLeft(plus,x)
plus_one:= curried_plus(1)
plus_one(2) = plus(1,2)
plus_one(7)
\start
Date: Thu, 07 Jul 2005 06:00:24 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [Sandbox Curry]
Using the compiler we should be able to write:
MappingPackage3c(A:SetCategory, B:SetCategory, C:SetCategory):
NNI ==> NonNegativeInteger
rightCurry: ((A,B)->C) -> (B->(A ->C))
leftCurry: ((A,B)->C) -> (A->(B ->C))
Fabc: (A,B)->C
rightCurry(Fabc) == curryRight(Fabc,#1)
leftCurry(Fabc) == curryLeft(Fabc,#1)
I do not understand this error message.
If this had worked we could have used it this way:
plusX:INT->(INT->INT)
plusX(x) == curryLeft(plus,x)
plusX(1)(2) = plus(1,2)
\start
Date: Thu, 07 Jul 2005 07:04:20 -0500
From: MathAction (anonimo)
To: MathAction
Subject: [#190 Compile fail on Fedora Core 4] (nuovo)
Compile fail on Fedora Core 4. The error seems to be the randomized sbrk.
How can I avoid it?
Thanks
Domenico
checking endianness... little
checking for sbrk... yes
checking for randomized sbrk... yes
checking for randomized brk remedy... no
Cannot build with randomized sbrk
make[3]: Entering directory `/home/dmo/axiom/lsp/gcl-2.6.6'
rm -f bin/gcl xbin/gcl
MGCLDIR=`echo /home/dmo/axiom/lsp/gcl-2.6.6 | sed -e 'sX^\([a-z]\):X/\1Xg'` ; \
GCLDIR=`echo /home/dmo/axiom/lsp/gcl-2.6.6` ; \
make install-command "INSTALL_LIB_DIR=$GCLDIR" "prefix=$GCLDIR" "BINDIR=$MGCLDIR/unixport"
make[4]: Entering directory `/home/dmo/axiom/lsp/gcl-2.6.6'
rm -f /home/dmo/axiom/lsp/gcl-2.6.6/bin/gcl
(echo '#!/bin/sh' ; \
echo exec /home/dmo/axiom/lsp/gcl-2.6.6/unixport/ \\ ; \
echo ' -dir' /home/dmo/axiom/lsp/gcl-2.6.6/unixport/ \\ ; \
echo ' -libdir' /home/dmo/axiom/lsp/gcl-2.6.6/ \\ ; \
echo ' -eval '\''(setq si::*allow-gzipped-file* t)'\' \\ ;\
! [ -d "" ] || echo ' -eval '\''(setq si::*tk-library* '\"\"')'\' \\;\
echo ' '\"\$@\" ) > /home/dmo/axiom/lsp/gcl-2.6.6/bin/gcl;
echo '#' other options: -load "/tmp/foo.o" -load "jo.lsp" -eval '"(joe 3)"' >> /home/dmo/axiom/lsp/gcl-2.6.6/bin/gcl
chmod a+x /home/dmo/axiom/lsp/gcl-2.6.6/bin/gcl
rm -f /home/dmo/axiom/lsp/gcl-2.6.6/bin/gclm.bat
if gcc --version | grep mingw >/dev/null 2>&1 ; then (echo '@SET cd='; \
echo '@SET promp%prompt%'; \
echo '@PROMPT SET cd'; \
echo '@CALL>%temp%.\setdir.bat'; \
echo '@'; \
echo '% do not delete this line %'; \
echo '@ECHO off'; \
echo 'PROMPT %promp'; \
echo 'FOR %%c IN (CALL DEL) DO %%c %temp%.\setdir.bat'; \
echo 'set cwd=%cd%'; \
echo 'set libdir=%cd%\..\lib\gcl-`cat majvers`.`cat minvers`'; \
echo 'set unixportdir=%libdir%\unixport'; \
echo 'path %cd%\..\mingw\bin;%PATH%'; \
echo "start %unixportdir%\.exe -dir %unixportdir% -libdir %libdir% -eval \"(setq si::*allow-gzipped-file* t)\" %1 %2 %3 %4 %5 %6 %7 %8 %9" ) > /home/dmo/axiom/lsp/gcl-2.6.6/bin/gclm.bat ; fi
rm -f /home/dmo/axiom/lsp/gcl-2.6.6/bin/gclfinal.bat
if gcc --version | grep -i mingw >/dev/null 2>&1 ; then (echo 'ECHO path %1\mingw\bin;%PATH% > gcli.bat'; \
echo "ECHO start %1\lib\gcl-`cat majvers`.`cat minvers`\unixport\.exe -dir %1\lib\gcl-`cat majvers`.`cat minvers`\unixport -libdir %1\lib\gcl-`cat majvers`.`cat minvers` -eval \"(setq si::*allow-gzipped-file* t)\" %1 %2 %3 %4 %5 %6 %7 %8 %9 >> gcli.bat" ) > /home/dmo/axiom/lsp/gcl-2.6.6/bin/gclfinal.bat ; fi
make[4]: Leaving directory `/home/dmo/axiom/lsp/gcl-2.6.6'
(cd xbin ; cp ../bin/gcl .)
cd cmpnew && make gcl_collectfn.o
make[4]: Entering directory `/home/dmo/axiom/lsp/gcl-2.6.6/cmpnew'
../unixport/saved_pre_gcl ../unixport/ -compile gcl_collectfn.lsp
make[4]: ../unixport/saved_pre_gcl: Command not found
make[4]: *** [gcl_collectfn.o] Error 127
make[4]: Leaving directory `/home/dmo/axiom/lsp/gcl-2.6.6/cmpnew'
make[3]: *** [cmpnew/gcl_collectfn.o] Error 2
make[3]: Leaving directory `/home/dmo/axiom/lsp/gcl-2.6.6'
/bin/sh: unixport/saved_gcl: No such file or directory
make[2]: *** [gcldir] Error 127
make[2]: Leaving directory `/home/dmo/axiom/lsp'
make[1]: *** [lspdir] Error 2
make[1]: Leaving directory `/home/dmo/axiom'
make: *** [all] Error 2
[dmo@localhost axiom]$
\start
Date: Thu, 07 Jul 2005 06:53:43 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [Tuples Products And Records]
William Sit wrote:
> 'Product(A,B)' is not the same as '(A,B)' computationally, as it is
> currently in Axiom.
Yes, I agree that is true in Axiom as it is now. But I am thinking about
how Axiom should be not how it is. The mathematical concept of product
is straight-forward and there is no reason why '(A,B)' where 'A' and
'B' are domains should not denote this product.
The derived domain Product, as it is defined now in Axiom is rather
more complicated than what one needs for defining a Mapping for
a function with more than one input. The domain Tuple on the other
hand is too restricted. Axiom's built-in primitive domain Record
is just about right.
> So currying is nothing but specialization ...
No, specialization is not equivalent to currying. The result of
currying is a higher-order function. Specialization is applying
that function to a specific argument. See for example:
http://en.wikipedia.org/wiki/Currying
Unfortunating the funtions called curryLeft and curryRight are
actually specializations:
\begin{axiom}
)di op curryLeft
)di op curryRight
\end{axiom}
What we need is a function
\begin{axiom}
leftCurry:((INT,INT)->INT)->(INT->(INT->INT))
leftCurry(f)== x+->(y+->f(x,y))
\end{axiom}
But the Axiom interpreter is not able compile this function.
See [Sandbox Curry] for more attempts to define this in Axiom.
> using a computer. We can't really do "symbolic computation"
> the way a human mind can.
I do not know anything of an algorithmic nature that a human mind
does which cannot in principle be done on computer. As I understand
it dealing with " ... (ellipsis)" is one of the purposes of the
construct called Streams in Axiom.
> You did not answer my question on arity.
Do you mean the question of the arity of, for example the following
function::
f:Product(A,Product(B,C))->D
My answer (assuming that you accept the notion of Product as a
primitive domain) would be that this function has "arity" of 3
since in a Cartesian closed category (CCC) we have
Product(A,Product(B,C)) = Product(Product(A,B),C) = Product(A,B,C)
Axiom actually takes the domain Record as primitive rather than
Product. The equivalence of constructs such as::
Record(a:A,b:Record(a:B,b:C)) = Record(a:Record(a:A,b:B),b:C) =
Record(a:A,b:B,c:C)
is a little less obvious but natural coercions (isomorphisms) could
be provided which make the question of arity clear in this case as
well.
> The design of the domain Product(A,B) need not be dominated by the
> two projection maps.
That is not true. The very nature of what we mean by product is
defined in terms of these projection maps. The product is what is
known as a type of limit in category theory. It is defined by a
universal property which makes the product and it's projection
maps unique amoung all other such objects and maps. See for
example:
http://en.wikipedia.org/wiki/Limit_(category_theory)
> Consider the two ways of coding ... f, g
Using the Record constructor in Axiom this function can be
written as:
\begin{axiom}
h:Record(a:INT,b:INT)->INT
h(parameter) == parameter.a + parameter.b
h[1,2]
\end{axiom}
which is almost as convenient as your definition of 'g'. Syntactically,
the name 'parameter' could be eliminated for brevity. There is no
reason that the compiler should produce less efficient code for this
notation.
> Is CCC the only kind of categories in symbolic computation?
That is a long story that I plan to continue here
[Cartesian Closed Category]. But very briefly one answer to
your question could be: CCC is the smallest and simplist kind
of category in which we should expect to be able to do all the
symbolic computation that is possible on a computer. The reason
why we can say this with some certainty has to do with the
relation between CCC and the simple-typed lambda calculus.
Lambda calculus is the smallest and simplist programming language
which can be shown to be computation universal, i.e. in which we
can prove that it is possible to express all computable functions,
the partial recursive functions or equivalently to simulate a
Turing machine.
(Cf. previous reference to CCC for all this "jargon" :)
\start
Date: Thu, 07 Jul 2005 09:22:25 -0500
From: MathAction (Bill Page)
To: MathAction
Subject: [Tuples Products And Records] links updated after rename
What we need is are the functions:
)set functions compile on
rightCurry:((INT,INT)->INT)->(INT->(INT->INT))
rightCurry(f)== y+->(x+->f(x,y))
The option ')set functions compile on' is required for the Axiom
interpreter to able to successfully compile this function. See #156
\begin{axiom}
plus:(INT,INT)->INT
plus(x,y) == x+y
curryPlus:=leftCurry(plus)
curryPlus1:=curryPlus(1)
curryPlus1(2)
\end{axiom}
See [SandBox Curry] for an attempt to define left and right Curry
as an Axiom library functions.
\start
Date: Thu, 07 Jul 2005 17:18:55 +0200
From: Joerg van Den Hoff
To: list
Subject: build of 'axiom' under MacOS
dear all,
I want to install axiom under MacOS.
of course the configure failed: uname -s returns "Darwin" under MacOS.
being a descendant of FreeBSD, it is hopefully not to difficult to
include MacOS in the list of supported platforms?
any response appreciated.
thanks
joerg
\start
Date: Thu, 07 Jul 2005 17:52:18 +0200
From: Kai Kaminski
To: list
Subject: HyperDoc as static HTML
Hi everyone,
I converted the old HyperDoc pages to HTML and put them up at
http://kaikaminski.gmxhome.de/hyper/rootpage.html. I use jsMath, a
Javascript library, to format mathematical expressions, hence Javascript
must be enabled. The dynamic HyperDoc features, i.e. everything that
requires interaction with either Axiom or the OS, doesn't work, of
course. On the other hand all the pictures should be there, most of the
math should look reasonable and the links should all work.
Kai
PS: Don't fix any errors in those files by hand. They are generated
automatically.
\start
Date: Thu, 07 Jul 2005 12:29:36 -0400
From: William Sit
To: Kai Kaminski
Subject: Re: HyperDoc as static HTML
Kai Kaminski wrote:
>
> Hi everyone,
>
> I converted the old HyperDoc pages to HTML and put them up at
> http://kaikaminski.gmxhome.de/hyper/rootpage.html. I use jsMath, a
> Javascript library, to format mathematical expressions, hence Javascript
> must be enabled. The dynamic HyperDoc features, i.e. everything that
> requires interaction with either Axiom or the OS, doesn't work, of
> course. On the other hand all the pictures should be there, most of the
> math should look reasonable and the links should all work.
Bravo!
The Browse and Basic Command screens are not hyperlink enabled for some items.
Is Search considered "non-static"? The rest (not all) I have tried all work
nice. The Examples and graphics worked as are documentations that are clickable.
Thanks for this contribution! A good start.
\start
Date: Thu, 7 Jul 2005 12:47:41 -0400
From: Bill Page
To: Kai Kaminski
Subject: RE: HyperDoc as static HTML
Kai,
This is looking great!
Here are some initial questions and suggestions.
On Thursday, July 07, 2005 11:52 AM you wrote:
> I converted the old HyperDoc pages to HTML and put them up at
> http://kaikaminski.gmxhome.de/hyper/rootpage.html. I use jsMath,
> a Javascript library, to format mathematical expressions, hence
> Javascript must be enabled.
Could you suggest some links to pages that contain jsMath? I quickly
browsed a bunch of pages and the only math I saw was in "ASCII"
format. Perhaps you have not loaded the jsMath directory on your
server? I see a reference to: