22 Emulation of the Algebra Library API via Axiom

 22.1 Basic Axiom Types Extended
 22.2 AC Integer Tools
 22.3 ACPrimitiveArray
 22.4 Array
 22.5 ACFraction
ToDo 79
mrx 21 27-Dec-2006: For some reason, changes to this file force make to recompile everything even if compiled with VARIANTSTOBUILD=debug.

Combinat is built on the libraries Aldor and Algebra that are distributed with Aldor. For making Combinat available in Axiom, we currently decided not to modify the Combinat source files but rather simulate the necessary (not all) functionality of Aldor and Algebra with the help of the Axiom library.

This file together with a few changes Axiom specific modifications in include/combinat.as.nw is (nearly) all that is needed in order to make Combinat run in Axiom.

Unfortunately, there is another quite unpleasant issue. Domains from the Axiom library that are extended do not work in Axiom. However, Combinat contains extensions of the domains String, Integer, and MachineInteger to LabelType in src/species.as.nw. We therefore must switch off that extension by using the

#if Axiom
#else
...
#endif

construction also in src/species.as.nw. Instead we define LabelType and the corresponding extensions already here.
569a* 13+   554  613
-------------------------------------------------------------------
----
---- Combinat
---- Copyright (C) Ralf Hemmecke <ralf@hemmecke.de>
---- svn co svn://svn.risc.uni-linz.ac.at/hemmecke/combinat/
----
-------------------------------------------------------------------
#if Axiom
#unassert MacrosCombinat
#assert DontNeedLibraryCombinat
#include "combinat"
macro {macros 569b}
cat: OutputType 570
cat: TotallyOrderedType 571
cat: LabelType 62 -- This is a workaround for not being able to "extend".
dom: ACCharacter 577
dom: ACString 579
dom: ACInteger 581a
dom: ACMachineInteger 584
dom: ACSymbol 587a
dom: ACList 588b
pkg: ACIntegerTools 591
dom: ACPrimitiveArray 592
dom: Array 599
dom: ACFraction 610a
#endif

Uses DontNeedLibraryCombinat 51.
569bmacros 569b  (569a)
PrimitiveType == BasicType;
I == ACMachineInteger;
Z == ACInteger;
NNI == NonNegativeInteger;
TextWriter == OutputForm;

Uses ACInteger 581a, ACMachineInteger 584, I 47, and Z 47.