axiom-developer
[Top][All Lists]

## Re: [Axiom-developer] Re: new problem compiling wh-sandbox

 From: Ralf Hemmecke Subject: Re: [Axiom-developer] Re: new problem compiling wh-sandbox Date: Thu, 29 Mar 2007 10:40:15 +0200 User-agent: Thunderbird 2.0b2 (X11/20070116)

```Hello,

```
```Below part of the "gseries.as.nw" test file. Note that the machinery of
AldorUnit automatically creates a file "gseries.signatures.as", which contains
the signatures necessary to compile "gseries.as".
```
```
```
To make it a bit more correct. gseries.signatures.as is *not* generated by AldorUnit, but rather by ALLPROSE or if you use AldorUnit in Christian's environment, then LibModel is generating the file. Both, ALLPROSE and LibModel (http://www.risc.uni-linz.ac.at/software/aldor/) are doing it by scanning patterns of the form
```
testFUNCTIONNAME(): () == {

in the corresponding file. But that is a simple thing.

```
AldorUnit is great. Without it we wouldn't have been so far with Aldor-Combinat. It seems however not so totally trivial to adapt AldorUnit for Axiom since Axiom does not have exception handling. And there are some more details which Christian could report about.
```
Ralf

```
```%------------------------------------------------------------------
%---
%--- Combinat
%--- svn co svn://svn.risc.uni-linz.ac.at/hemmecke/combinat/
%---
%------------------------------------------------------------------

This file test generating series.
Since our implementations of \useterm[ordinary]{ordinary generating series} and
\useterm{exponential generating series} rely on the implementation of
\useterm{formal power series} as given in \srcfile{src/gseries.as} we
some \useterm{cycle index series}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Test Generating Series}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
<<*>>=
-------------------------------------------------------------------
----
---- Combinat
---- svn co svn://svn.risc.uni-linz.ac.at/hemmecke/combinat/
----
-------------------------------------------------------------------

#assert DontNeedLibraryTestCases
#include "testcases"

TestGeneratingSeries: TestCaseType with {
#include "gseries.signatures.as"
import from TestCaseTools;
import from Integer, DataStream Integer, I;
<<test series>>
}
@ %def TestGeneratingSeries
%TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Test FactorialStream}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The \useterm[Bell numbers]{Bell number} are given by the
\useterm{exponential generating series} \$e^{(e^x-1)}\$.

%CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
<<test series>>=
testComposeBell(): () == {
macro S == ExponentialGeneratingSeries;
import from S, Q, DataStream Q;
expx: S := stream(inv(fn) for fn in factorialStream) :: S;
e: S := term(-1, 0);
t: S := e + expx; -- (-1+exp(x))
assertEquals(Integer, 0, count(t, 0));
u := compose(expx, t);
l1: List Integer := [1,1,2,5,15,52,203,877,4140,21147,115975];
l2: List Integer := [count(u, i) for i in 0..prev #l1];
assertEquals(List Integer, l1, l2);
}
@
%TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

_______________________________________________
Axiom-developer mailing list
```